@deephaven/code-studio 0.38.1-beta.0 → 0.38.1-beta.2
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/AppRoot-0312ece9.css +1 -0
- package/build/assets/AppRoot-7cfe096c.js +42 -0
- package/build/assets/AppRoot-7cfe096c.js.map +1 -0
- package/build/assets/{index-ce86c5b9.js → index-051adcd2.js} +2 -2
- package/build/assets/{index-ce86c5b9.js.map → index-051adcd2.js.map} +1 -1
- package/build/assets/index-77c2e65e.js +6 -0
- package/build/assets/index-77c2e65e.js.map +1 -0
- package/build/assets/useConnection-2334ddd0.js +5 -0
- package/build/assets/useConnection-2334ddd0.js.map +1 -0
- package/build/index.html +1 -1
- package/package.json +31 -31
- package/build/assets/AppRoot-77b81088.js +0 -42
- package/build/assets/AppRoot-77b81088.js.map +0 -1
- package/build/assets/AppRoot-86cdc34b.css +0 -1
- package/build/assets/index-32b27852.js +0 -6
- package/build/assets/index-32b27852.js.map +0 -1
- package/build/assets/useConnection-dbff5b5b.js +0 -5
- package/build/assets/useConnection-dbff5b5b.js.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{A as d,B as g,H as I,aC as Ls,C as c,D as Te,F as x,R as vn,N as Pe,O as ee,G as z,Z as Se,aD as js,aE as $s,a5 as Vs,a6 as Bs,aF as Hs,a2 as gt,E as Mn,aG as _s,aH as Oe,aI as Us,aJ as Ks,aK as Ws,aL as yn,aM as qs,aN as Gs}from"./vendor-4a7e2c7c.js";import{T as ce,g as B,aV as zs,aW as Zs,aX as Xs,aY as Qs,ad as It,ah as xt,ae as Tn,aZ as En,L as wt,ar as Js,e as Ys,a_ as ei,a$ as ti,p as ni,ac as In,X as si,a3 as ii,m as oi,b0 as ai,c as xn,V as ri,b1 as li,q as je,b2 as wn,b3 as ci}from"./index-77c2e65e.js";class ui extends d.Component{static propTypes={children:g.node.isRequired,options:g.shape({}),className:g.string,timeout:g.number,onEntered:g.func,onExited:g.func,isShown:g.bool,closeOnBlur:g.bool,interactive:g.bool,referenceObject:g.shape({}),"data-testid":g.string};static defaultProps={options:{},className:"",timeout:ce.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};constructor(e){super(e),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=I.createRef(),this.rAF=0;const{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}element;container;rAF;getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){let{popper:e}=this.state;const{closeOnBlur:t,referenceObject:n}=this.props;if(e||this.container.current===null)return;let{options:s}=this.props;s={placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}},...s},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new Ls(n||o,this.element,s),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){const a=this.element.firstElementChild;a instanceof HTMLElement&&a.focus()}}),this.setState({popper:e})}destroyPopper(e=!0){cancelAnimationFrame(this.rAF);const{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){const{onEntered:e}=this.props;e()}handleExit(){const{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){const{className:e,children:t,timeout:n,interactive:s,closeOnBlur:o}=this.props,{show:a}=this.state;return c.jsx(Te,{in:a,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:c.jsx("div",{onClick:r=>{r.stopPropagation()},onKeyDown:r=>{r.key==="Escape"&&this.hide()},className:x("popper",{interactive:s},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:c.jsxs("div",{className:"popper-content",children:[t,c.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:e}=this.state,{"data-testid":t}=this.props;return c.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&vn.createPortal(this.renderContent(),this.element)})}}const De=ui,di=Object.freeze(Object.defineProperty({__proto__:null,Log:B,LogHistory:zs,LogProxy:Zs,Logger:Xs,LoggerLevel:Qs,default:B},Symbol.toStringTag,{value:"Module"})),hi=B.module("Tooltip");class X extends d.Component{static defaultTimeout=500;static defaultReshowTimeout=100;static triggerReshowThreshold=300;static shownTooltipCount=0;static lastHiddenTime=Date.now();static defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:X.defaultReshowTimeout,timeout:X.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0};static handleHidden(){X.shownTooltipCount-=1,X.shownTooltipCount===0&&(X.lastHiddenTime=Date.now())}static handleShown(){X.shownTooltipCount+=1}constructor(e){super(e),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=I.createRef(),this.popper=I.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:s}=this.state;s!==n&&(s?X.handleShown():X.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&X.handleHidden()}container;popper;parent;timer;startListening(){if(!this.container.current||!this.container.current.parentElement){hi.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:s}=this.state;if(!this.popper.current||!this.parent)return;const o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(X.shownTooltipCount>0||Date.now()-X.lastHiddenTime<X.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){const{isShown:e}=this.state;if(this.stopTimer(),!e){this.popper.current?.show(),this.setState({isShown:!0});const{interactive:t}=this.props;t&&this.startListeningWindow()}}hide(){this.popper.current?.hide(),this.stopListeningWindow()}update(){this.popper.current?.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,referenceObject:n,popperClassName:s,"data-testid":o,onEntered:a}=this.props,{isShown:r}=this.state;let{options:l}=this.props;return l={placement:"bottom",...l},c.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:c.jsx(De,{className:x(s),options:l,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:c.jsxs("div",{className:"tooltip-content",children:[" ",r&&t]})})})}}const Nt=X;const pi=100;var Nn=(i=>(i.UP="UP",i.DOWN="DOWN",i))(Nn||{});class me extends d.Component{static propTypes={options:g.arrayOf(g.shape({title:g.string.isRequired,value:g.string.isRequired})).isRequired,popperOptions:g.shape({}),onChange:g.func,inputPlaceholder:g.string,disabled:g.bool,className:g.string,defaultTitle:g.string,spellCheck:g.bool,onEnter:g.func,noMatchText:g.string,"data-testid":g.string};static defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};static MENU_NAVIGATION_DIRECTION=Nn;constructor(e){super(e);let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Pe(this.updateInputValue,pi),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=I.createRef(),this.cbContainer=I.createRef(),this.menuContainer=I.createRef(),this.input=I.createRef()}popper;cbContainer;menuContainer;input;setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getCachedFilteredOptions=ee((e,t)=>e.filter(n=>n.title.toLowerCase().indexOf(t.toLowerCase())>=0));getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(s=>s.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:s}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,s)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,o=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),o&&n){this.closeMenu();return}this.popper.current?.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s!=null&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),this.input.current?.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(me.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(me.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(me.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(me.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let s=n;e===me.MENU_NAVIGATION_DIRECTION.UP?n>0?(s=(s-1)%t.length,this.setState({keyboardOptionIndex:s})):n===0&&(s=t.length-1,this.setState({keyboardOptionIndex:s})):e===me.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(s=(s+1)%t.length,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),this.input.current?.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){this.input.current?.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{this.popper.current?.show()})}closeMenu(e=!0){this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&this.input.current?.focus(),this.popper.current?.hide()}scrollOptionIntoView(e){this.menuContainer.current&&this.menuContainer.current.children.item(e)?.scrollIntoView({behavior:"smooth",block:"nearest"})}renderMenuElement(){const{inputWidth:e}=this.state;return c.jsx("div",{className:x("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?c.jsx("div",{className:"no-match",children:e}):n.map((s,o)=>this.renderOption(s,o))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return c.jsx("button",{type:"button",className:x("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},s)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultTitle:o,spellCheck:a,"data-testid":r}=this.props,{title:l,menuIsOpen:u,popperOptions:h,invalid:p}=this.state;return c.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[c.jsx("input",{value:l||o,className:x("form-control",s,"aci-input",{"is-invalid":p&&!u}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:a,"data-testid":r}),c.jsx(De,{ref:this.popper,options:h,className:x("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}const mi=me;function kt({className:i="",value:e,onChange:t,spellCheck:n=!1,placeholder:s="",disabled:o=!1,delimiter:a="",id:r="","data-testid":l}){const[u,h]=d.useState(e),[p,m]=d.useState(!1),f=d.useRef(null);d.useEffect(function(){h(e)},[e]);function v(A){return A.trim().split(a).filter(L=>L).join(`
|
|
2
|
+
${a.trim()}`)}function S(A){return A.split(`
|
|
3
|
+
`).map(L=>L.trim()).join(" ")}function C(){if(!f.current)return;f.current.style.height="0";const A=f.current.scrollHeight+(f.current.offsetHeight-f.current.clientHeight);A>0&&(f.current.style.height=`${A}px`)}function w(A){let L=A.target.value;p&&(a&&(L=v(L)),m(!1)),h(L),t(L)}function D(){f.current&&(a&&(h(v(u)),C()),f.current.scrollLeft=0)}function M(){f.current&&document.activeElement!==f.current&&f.current.focus()}function F(){a&&(h(S(u)),t(S(u)))}function P(){m(!0)}return d.useEffect(function(){C()},[u]),c.jsx("textarea",{ref:f,id:r,className:x(i,"auto-resize-textarea form-control"),placeholder:s,value:u,rows:1,onChange:w,onFocus:D,onMouseDown:M,onBlur:F,onPaste:P,spellCheck:n,disabled:o,"data-testid":l})}kt.propTypes={value:g.string.isRequired,onChange:g.func.isRequired,className:g.string,placeholder:g.string,spellCheck:g.bool,disabled:g.bool,delimiter:g.string,id:g.string,"data-testid":g.string};kt.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function $e(i){const{children:e,className:t,style:n,"data-testid":s}=i;return c.jsx("div",{className:x("btn-group",t),style:n,role:"group","data-testid":s,children:e})}$e.displayName="ButtonGroup";$e.propTypes={children:g.node.isRequired,className:g.string,style:g.object,"data-testid":g.string};$e.defaultProps={className:null,style:{},"data-testid":void 0};const fi=["primary","secondary","tertiary","success","danger","inline","ghost"],gi=["group-end"];function bi(i,e){switch(i){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 x("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Ci(i){switch(i){case"group-end":return x("pl-2","pr-3")}}const Je=I.forwardRef((i,e)=>{const{kind:t,variant:n,type:s,tooltip:o,icon:a,disabled:r=!1,active:l,onClick:u,onContextMenu:h,onMouseDown:p,onMouseUp:m,onMouseEnter:f,onMouseLeave:v,onKeyDown:S,className:C,style:w,children:D,tabIndex:M,"data-testid":F,"aria-label":P}=i,A=Boolean(a&&D==null),L=bi(t,A);let W;n&&(W=Ci(n));let ae;a&&(ae=I.isValidElement(a)?a:c.jsx(z,{icon:a}));let $;o!==void 0&&($=typeof o=="string"?c.jsx(Nt,{children:o}):o);let j=P;P===void 0&&A&&o!=null&&typeof o=="string"&&(j=o);const _=c.jsxs("button",{"data-testid":F,ref:e,type:s,className:x("btn",L,W,{active:l},C),onClick:u,onContextMenu:h,onMouseUp:m,onMouseDown:p,onMouseEnter:f,onMouseLeave:v,onKeyDown:S,style:w,disabled:r,tabIndex:M,"aria-label":j,children:[a&&ae,D,o!=null&&!r&&$]});return r?c.jsxs("span",{className:"btn-disabled-wrapper",children:[_,o!==void 0&&$]}):_});Je.displayName="Button";Je.propTypes={kind:g.oneOf(fi).isRequired,variant:g.oneOf(gi),type:g.oneOf(["submit","reset","button"]),tooltip(i){const{tooltip:e,icon:t,children:n}=i;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(i){const{children:e,icon:t}=i;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!I.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:g.bool,active:g.bool,onClick(i){const{onClick:e,type:t}=i;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:g.func,onMouseUp:g.func,onMouseDown:g.func,onMouseEnter:g.func,onMouseLeave:g.func,onKeyDown:g.func,tabIndex:g.number,children:g.node,className:g.string,style:g.object,"data-testid":g.string};Je.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 te=Je;function Ve(i,e="No value available in context. Was code wrapped in a provider?"){const t=d.useContext(i);if(t==null)throw new Error(e);return t}function Ot(i){const e=d.useRef();return d.useEffect(function(){e.current=i}),e.current}function Dt(i){const e=d.useRef(null);return d.useEffect(function(){i&&(typeof i=="function"?i(e.current):i.current=e.current)}),e}const yr=Object.freeze([]),Tr=new Map,Si=()=>{};class vi extends Error{isCanceled=!0}const bt=vi;async function Mi(i){const{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(i)}catch{return Jt(i)}Jt(i)}function Jt(i){const e=document.activeElement,t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.focus(),t.select();const n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}class kn extends CustomEvent{constructor(e,t){super(e,t)}}class yi extends Error{isTimeout=!0}const Ye=yi;class Le{static makeCancelable(e,t){let n=!1,s,o;const a=new Promise((r,l)=>{o=l,Promise.resolve(e).then(u=>{n?t&&t(u):(s=u,r(u))}).catch(u=>l(u))});return a.cancel=()=>{n=!0,o(new bt),s!=null&&t&&t(s)},a}static isCanceled(e){return e instanceof bt}static isTimedOut(e){return e instanceof Ye}static withTimeout(e,t){return new Promise((n,s)=>{setTimeout(()=>{try{n(t())}catch(o){s(o)}},e)})}}function Ti(i){if(i==null)throw new Error("Value is null or undefined")}function Er(i,e,t=void 0){const n=i.get(e)??t;if(n!==void 0)return n;throw new Error(`Missing value for key ${e}`)}function qe(i){let e=i;i instanceof CustomEvent&&(e=i.detail);let t="";if(e instanceof Error?t=e.message:e!=null&&(t=`${e}`),t=t.trim(),t.length>0)return t}class At{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(!At.isValidRange(e))throw new Error(`Invalid range! ${e}`)}static isSelected(e,t){for(let n=0;n<e.length;n+=1){const s=e[n],o=s[0],a=s[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){let[n,s]=t;const o=[...e];for(let a=o.length-1;a>=0;a-=1){const r=o[a],l=r[0],u=r[1];if(l<=n&&s<=u)return o;n<=u&&l<=s&&(n=Math.min(n,l),s=Math.max(s,u),o.splice(a,1))}return o.push([n,s]),o}static deselectRange(e,t){const[n,s]=t,o=[...e];for(let a=o.length-1;a>=0;a-=1){const r=o[a],l=r[0],u=r[1];if(!(s<l||u<n))if(l<n&&s<u){o[a]=[l,n-1],o.splice(a+1,0,[s+1,u]);break}else n<=l&&u<=s?o.splice(a,1):l<n?o[a]=[l,n-1]:o[a]=[s+1,u]}return o}static count(e){return e.reduce((t,n)=>t+(n[1]-n[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((n,s)=>{const o=[...n];for(let a=s[0];a<=s[1];a+=1)o.push(e[a]);return o},[])}}const le=At;class Ei{static join(e,t="and"){if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${t} ${e[1]}`;const n=e.slice(0,e.length-1).join(", "),s=e[e.length-1];return`${n}, ${t} ${s}`}static toLower(e,t=!0){if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t,n=!0){return e<t?n?-1:1:e>t?n?1:-1:0}}const Ii=Ei;class Ft{static TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";static 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"}]);static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;return`${t>0?`${t}h `:""}${n>0||t>0?`${n}m `:""}${e>=60?`${s}s`.padStart(3,"0"):`${s}s`}`}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error(`${e} is not a number that can be expressed as a formatted time`);const t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),s=String(Math.floor(n/60)).padStart(2,"0"),o=n%60,a=String(Math.ceil(o)).padStart(2,"0");return`${t}:${s}:${a}`}static isTimeString(e){return new RegExp(Ft.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error(`${e} is not a valid string`);const t=e.split(":");if(t.length!==3)throw new Error(`${e} is not a time string that can be parsed`);return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}const Fe=Ft,xi=3500,wi=B.module("useCopyToClipboard");function On(){const[i,e]=d.useState(!1),t=d.useRef(null),n=d.useCallback(s=>{Mi(s).then(()=>{e(!0)}).catch(o=>wi.error(`Unable to copy ${s}`,`
|
|
4
|
+
`,o))},[]);return d.useEffect(()=>(t.current&&clearTimeout(t.current),i&&(t.current=setTimeout(()=>{e(!1)},xi)),()=>{t.current&&clearTimeout(t.current)}),[i]),[i,n]}function Ni(i){i.preventDefault()}function ki(i=!1){const e=d.useMemo(()=>`useSubmitButtonRef-${Se()}`,[]),t=d.useCallback(o=>{o?.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),n=d.useMemo(()=>({id:e,onSubmit:i?void 0:Ni}),[e,i]),s=d.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:n,submitButtonProps:s}}function Dn(i,e,{autoLoad:t=!0}={}){const[n,s]=d.useState(null),[o,a]=d.useState(null),[r,l]=d.useState(!1),u=d.useCallback(async()=>{l(!0);try{const h=await i(...e);s(h),a(null)}catch(h){s(null),a(h)}finally{l(!1)}},[i,...e]);return d.useEffect(()=>{t&&u()},[t,u]),{data:n,error:o,isError:o!=null,isLoading:r,reload:u}}function An(i,e){const[t,n]=d.useState(i);return d.useEffect(()=>{const s=setTimeout(()=>{n(i)},e);return()=>{clearTimeout(s)}},[i,e]),t}const Oi=Object.freeze(Object.defineProperty({__proto__:null,useContextOrThrow:Ve,useCopyToClipboard:On,useDebouncedValue:An,useFormWithDetachedSubmitButton:ki,useForwardedRef:Dt,usePrevious:Ot,usePromiseFactory:Dn},Symbol.toStringTag,{value:"Module"}));function Di({blockInteraction:i=!0,children:e,debounceMs:t,isOpen:n=!1}){const s=An(n,t);return c.jsxs(c.Fragment,{children:[i&&n&&c.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),I.cloneElement(e,{isOpen:n&&s})]})}function Ai({className:i,icon:e,isOpen:t=!1,subtitle:n,title:s}){return c.jsx(It,{isOpen:t,className:i,children:c.jsx(xt,{children:c.jsxs("div",{className:"info-modal",children:[e!=null&&c.jsx("div",{className:"message-icon",children:c.jsx(z,{icon:e})}),c.jsx("div",{className:"message-header",children:s}),n!=null&&c.jsx("div",{className:"message-content",children:n})]})})})}function Fn({className:i="modal-footer",children:e,"data-testid":t}){return c.jsx("div",{className:i,"data-testid":t,children:e})}function Rt(i){const{isOpen:e,headerText:t,bodyText:n,onCancel:s,onConfirm:o,onDiscard:a,onModalDisable:r,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:m,"data-testid":f}=i,v=d.useRef(null),S=d.useRef(null),C=d.useCallback(()=>{S.current!==null&&S.current.checked&&r&&r(),o()},[o,r]),w=d.useCallback(()=>{v.current?.focus()},[]);let D="";return e&&(D=typeof n=="function"?n():n),c.jsxs(It,{isOpen:e,className:"theme-bg-light",onOpened:w,children:[c.jsx(Tn,{closeButton:!1,children:t}),c.jsx(xt,{children:D}),c.jsxs(Fn,{children:[r&&c.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[c.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:S,"data-testid":f!==void 0?`${f}-checkbox-confirm`:void 0}),c.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&c.jsx(te,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":f!==void 0?`${f}-btn-discard`:void 0,children:h}),s&&c.jsx(te,{kind:"secondary","data-dismiss":"modal",onClick:s,"data-testid":f!==void 0?`${f}-btn-cancel`:void 0,children:l}),c.jsxs($e,{children:[c.jsx(te,{kind:p?"danger":"primary",onClick:C,ref:v,"data-testid":f!==void 0?`${f}-btn-confirm`:void 0,children:u}),m]})]})]})}Rt.propTypes={isOpen:g.bool.isRequired,headerText:g.string.isRequired,bodyText:g.oneOfType([g.string,g.func]).isRequired,onCancel:g.func,onConfirm:g.func.isRequired,onDiscard:g.func,onModalDisable:g.func,cancelButtonText:g.string,confirmButtonText:g.string,discardButtonText:g.string,children:g.node,"data-testid":g.string};Rt.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};const et=I.forwardRef((i,e)=>{const{children:t,className:n,disabled:s,onClick:o,style:a,id:r}=i;return c.jsx("button",{ref:e,type:"button",className:x("btn",n),onClick:o,style:a,disabled:s,id:r,children:t})});et.displayName="Button";et.propTypes={children:g.node,className:g.string,disabled:g.bool,onClick:g.func,style:g.shape({}),id:g.string};et.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Fi=et;function Ri({className:i,isFlipped:e,children:t,"data-testid":n}){const s=l=>{if(t.length!==2)throw new Error("CardFlip requires 2 children to function");return t[l]},o=d.useRef(null),a=d.useCallback(l=>{l.target===l.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),r=d.useCallback(l=>{l.target===l.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return d.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",a);const u=o.current;return function(){if(u!=null)return u.removeEventListener("transitionstart",a)}},[a]),c.jsxs("div",{className:x(i,{"card-flip--show-front":e,"card-flip--show-back":!e}),"data-testid":n,children:[c.jsx("div",{className:"card-flip--back",children:s(0)}),c.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:r,children:s(1)})]})}function dt(i){return i.then!==void 0}class ye{static actionsDisabled=!1;static disableAllActions(){ye.actionsDisabled=!0}static enableAllActions(){ye.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){return e.group!==t.group?(e.group??0)>(t.group??0)?1:-1:e.order!==t.order?(e.order??0)>(t.order??0)?1:-1:e.title!==t.title?(e.title??"")>(t.title??"")?1:-1:e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];const t=e.slice();return t.sort(ye.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ye.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=ye.getModifierKey();return e[t]}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o+=1){const a=s[o];let r;typeof a=="function"?r=a():r=a,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(o=>o.title!==void 0||o.then!=null||o.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let o=1;o<n.length+1;o+=1){const a=(s+t*o+n.length)%n.length,r=n[a];if(!(r instanceof Promise)&&r.disabled!==!0)return a}return e}}const U=ye,Yt=B.module("GlobalContextAction");class Pi extends d.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){const t=e;t.contextActions==null&&(t.contextActions=[]);const{action:n}=this.props;n.title==null&&!n.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(n),Yt.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){const{action:t}=this.props;!U.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)&&(Yt.debug("Global hotkey matched!",e),t.action?.(e),e.preventDefault(),e.stopPropagation())}render(){return null}}const Li=Pi;class ji extends d.Component{render(){const{actions:e,"data-testid":t}=this.props,n=[];for(let s=0;s<e.length;s+=1){const o=e[s],{shortcut:a}=o;if(o.title!=null||o.menuElement||a){const r=c.jsx(Li,{action:o,"data-testid":t},`${o.title}.${a?.id}`);n.push(r)}}return n}}const $i=ji;const He=B.module("ContextActions");class Vi extends d.Component{static groups={default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100};static triggerMenu(e,t,n,s){if(s.length===0)return;const o=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});o.contextActions=s,e.dispatchEvent(o)}constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=I.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};const t=e.actions.filter(s=>!dt(s)&&typeof s!="function"&&s.isGlobal),n=e.actions.filter(s=>!dt(s)&&typeof s!="function"&&(s.isGlobal===void 0||!s.isGlobal)&&s.shortcut!=null);return{globalActions:t,keyboardActions:n}}componentDidMount(){this.container.current?.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){this.container.current?.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}container;handleContextMenu(e){const{ignoreClassNames:t=[]}=this.props;if(t.length>0){let s=e.target;for(;s!=null;){const{classList:o}=s,a=t.find(r=>o.contains(r));if(a!==void 0){He.debug2(`Contextmenu event ignored based on the target className "${a}"`);return}s=s.parentElement}}if(U.isContextActionEvent(e)||(e.contextActions=[]),!U.isContextActionEvent(e))return;const{actions:n}=this.props;if(n!=null){let s=n;Array.isArray(s)&&(s=s.filter(o=>dt(o)||typeof o=="function"||o.isGlobal===void 0||!o.isGlobal)),e.contextActions=e.contextActions.concat(s)}He.debug("Received context menu event! Menu items are now: ",e.contextActions)}handleKeyDown(e){const{keyboardActions:t}=this.state;for(let n=0;n<t.length;n+=1){const s=t[n];!U.actionsDisabled&&s.shortcut!=null&&s.shortcut.matchesEvent(e)&&(He.debug("Context hotkey matched!",e),s.action?.(e),e.stopPropagation(),e.preventDefault(),He.debug2("Matched hotkey returned false, key event not consumed"))}}render(){const{"data-testid":e}=this.props,{globalActions:t}=this.state;return c.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:c.jsx($i,{actions:t})})}}const Bi=Vi,Pt=I.forwardRef((i,e)=>{function t(C){const{menuItem:w,onMenuItemClick:D}=i;D(w,C)}function n(C){const{menuItem:w,onMenuItemMouseMove:D}=i;D(w,C)}function s(C){const{menuItem:w,onMenuItemContextMenu:D}=i;D(w,C)}function o(C,w,D){if(typeof C.type=="string")return C;const{closeMenu:M,menuItem:F,isKeyboardSelected:P,isMouseSelected:A,"data-testid":L}=i,W={menuItem:F,closeMenu:M,isKeyboardSelected:P,isMouseSelected:A,iconElement:w,displayShortcut:D,"data-testid":L};return I.cloneElement(C,{forwardedProps:W})}const{children:a,menuItem:r,isKeyboardSelected:l=!1,isMouseSelected:u=!1,"data-testid":h}=i,p=r.shortcut?.getDisplayText();let m=null;if(r.icon){const C=r.icon;if(I.isValidElement(C))m=C;else{let w;r.iconColor!=null&&(r.disabled===void 0||!r.disabled)&&(w={color:r.iconColor}),m=c.jsx(z,{icon:C,style:w})}}let f=null;const v=Boolean(a);r.actions&&(f=c.jsx(z,{icon:En}));let S=null;if(r.menuElement)S=c.jsx("div",{className:"custom-menu-item",onMouseMove:n,children:o(r.menuElement,m,p)});else{const C=r.disabled,w=r.iconOutline;S=c.jsx("button",{type:"button",className:x("btn-context-menu",{disabled:C},{active:(v||u)&&(C===void 0||!C)},{"keyboard-active":l&&(C===void 0||!C)}),onClick:t,onMouseMove:n,onContextMenu:s,title:r.description??"",children:c.jsxs("div",{className:"btn-context-menu-wrapper",children:[c.jsx("span",{className:x("icon",{outline:w}),children:m}),c.jsx("span",{className:"title",children:r.title}),p!==void 0&&c.jsx("span",{className:"shortcut",children:p}),f&&c.jsx("span",{className:x("submenu-indicator",{disabled:C}),children:f})]})})}return c.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":h,children:[a,S]})});Pt.displayName="ContextMenuItem";Pt.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const Lt=Pt,en=B.module("ContextMenu");class Ge extends d.PureComponent{static defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=I.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=I.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{this.container.current?.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?this.container.current?.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(this.container.current==null||!this.container.current.contains(document.activeElement))&&this.container.current?.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}container;oldFocus;activeSubMenuRef;subMenuTimer;rAF;initialPosition;getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);const{options:e}=this.props;let t=e.initialKeyboardIndex;t===void 0&&(t=-1);const{actions:n}=this.props,s=U.getMenuItems(n),o=[];for(let a=s.length-1;a>=0;a-=1){const r=s[a];r instanceof Promise?this.initMenuPromise(r):o.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:U.sortActions(o)})}initMenuPromise(e){const t=Le.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const o=s.pendingItems.indexOf(t);if(o>=0){const a=s.pendingItems.slice();return a.splice(o,1),{menuItems:U.sortActions(s.menuItems.concat(n)),pendingItems:a}}return null})},n=>{Le.isCanceled(n)||(this.setState(s=>{const o=s.pendingItems.indexOf(t);if(o>=0){const a=s.pendingItems.slice();return a.splice(o,1),{pendingItems:a}}return null}),en.error(n))})}cancelPromises(){const{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current===null)return;const e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}verifyPosition(){const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:o,left:a}=this.props;if(!this.container.current||e.doNotVerifyPosition!=null&&e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:u,height:h}=this.container.current?.getBoundingClientRect()??{width:0,height:0},p=(this.container.current?.scrollHeight??0)>window.innerHeight;h===0||u===0||(r+h>window.innerHeight&&(r-h-s>0?r-=h-s:r=window.innerHeight-h),l+u>window.innerWidth&&(l=l-u-n),(a!==l||o!==r)&&(this.setState({hasOverflow:p}),t(r,l)))}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){en.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){let t=e.relatedTarget,n=!1;for(;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){const{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?o=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=U.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=U.getNextMenuItem(s,1,t)),o){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){const{menuItems:t,activeSubMenu:n}=this.state,s=t[e].actions?e:null;n!==s&&this.setState({activeSubMenu:s,subMenuTop:null,subMenuLeft:null})}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();const{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:o,keyboardIndex:a,menuItems:r,mouseIndex:l,pendingItems:u,subMenuTop:h,subMenuLeft:p,subMenuParentWidth:m,subMenuParentHeight:f}=this.state;for(let D=0;D<r.length;D+=1){const M=r[D];D>0&&M.group!==r[D-1].group&&e.push(c.jsx("hr",{},`${D}.separator`));const F=c.jsx(Lt,{ref:s===D?this.activeSubMenuRef:null,isKeyboardSelected:a===D,isMouseSelected:l===D,menuItem:M,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},D);e.push(F)}let v=null;u.length>0&&(v=c.jsx("div",{className:"loading",children:c.jsx(wt,{})}));const{menuStyle:S,"data-testid":C}=this.props,w=s!==null&&h!==null&&p!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:x({"has-overflow":o},"context-menu-container"),style:{top:t,left:n,...S},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:Ge.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":C,children:[e,v]}),w&&s!==null&&h!==null&&p!==null&&c.jsx(Ge,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:h,left:p,updatePosition:(D,M)=>{this.setState({subMenuTop:D,subMenuLeft:M})},subMenuParentWidth:m,subMenuParentHeight:f},`sub-${s}`)]})}}const Hi=Ge;class _i extends d.Component{constructor(e){super(e),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=I.createRef(),this.openMenu=I.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){this.container.current?.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){this.container.current?.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}container;openMenu;handleContextMenu(e){if(!U.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const t=U.getMenuItems(e.contextActions),n=this.container.current.getBoundingClientRect(),s=e.clientY-n.top,o=e.clientX-n.left;if(t.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const a=document.elementFromPoint(o,s),r=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});a?.dispatchEvent(r)});return}return}e.preventDefault(),this.setState({actions:t,top:s,left:o})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":t}=this.props,{actions:n,top:s,left:o}=this.state;return n&&(e=c.jsx(Hi,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:s,left:o,updatePosition:(a,r)=>{this.setState({top:a,left:r})},"data-testid":t})),c.jsx("div",{className:x("context-menu-root",{active:n}),ref:this.container,children:e})}}const Ui=_i;class fe extends d.Component{static propTypes={className:g.string,in:g.bool.isRequired,children:g.node.isRequired,autoFocusOnShow:g.bool,"data-testid":g.string};static defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${fe.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${fe.getHeight(t)}px`}static getHeight(e){const t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){const t=e;t.style.height="";const{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){const s=t.querySelector("input, select, textarea");s?.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return c.jsx(Te,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:fe.handleEnter,onEntering:fe.handleEntering,onEntered:this.handleEntered,onExit:fe.handleExit,onExiting:fe.handleExiting,timeout:350,children:o=>c.jsx("div",{className:x({collapse:o==="exited"},t),"data-testid":s,children:e})})}}const Ki=fe,tt=I.forwardRef((i,e)=>{const{checked:t=!1,children:n,className:s,disabled:o,inputClassName:a,isInvalid:r,labelClassName:l,name:u,onChange:h,"data-testid":p}=i,[m]=d.useState(Se()),f=Dt(e);d.useEffect(function(){f.current&&(f.current.indeterminate=t===null)},[f,t]);const v=d.useCallback(S=>{f.current&&(f.current.indeterminate=t===null),h&&h(S)},[f,t,h]);return c.jsxs("div",{className:x("custom-control custom-checkbox",s),children:[c.jsx("input",{type:"checkbox",ref:f,checked:t??!1,className:x("custom-control-input",a,{"is-invalid":r}),disabled:o,id:m,name:u,onChange:v,"data-testid":p}),c.jsx("label",{className:x("custom-control-label",l),htmlFor:m,children:n})]})});tt.displayName="Checkbox";tt.propTypes={checked:(i,e)=>{const{[e]:t}=i;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:g.node.isRequired,className:g.string,disabled:g.bool,inputClassName:g.string,isInvalid:g.bool,labelClassName:g.string,name:g.string,onChange:g.func,"data-testid":g.string};tt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const ze=tt;class Wi extends d.PureComponent{static defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};constructor(e){super(e),this.inputField=I.createRef()}inputField;focus(){this.inputField.current?.focus()}render(){const{value:e,placeholder:t,onBlur:n,onChange:s,className:o,disabled:a,matchCount:r,id:l,onKeyDown:u,"data-testid":h}=this.props;return c.jsxs("div",{className:x("search-group",o),children:[c.jsx("input",{type:"search",value:e,onBlur:n,onChange:s,onKeyDown:u,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),r!=null&&c.jsx("span",{className:"search-match",children:r}),c.jsx("span",{className:"search-icon",children:c.jsx(z,{icon:Js})})]})}}const nt=Wi;var Rn=(i=>(i.UP="UP",i.DOWN="DOWN",i))(Rn||{});class xe extends d.Component{static MENU_NAVIGATION_DIRECTION=Rn;static DROP_DOWN_MENU_HEIGHT=200;static propTypes={options:g.arrayOf(g.shape({title:g.string.isRequired,value:g.string.isRequired})).isRequired,popperOptions:g.shape({title:g.string.isRequired,value:g.string.isRequired}),onChange:g.func,inputPlaceholder:g.string,searchPlaceholder:g.string,disabled:g.bool,className:g.string,defaultValue:g.string,spellCheck:g.bool,onEnter:g.func,"data-testid":g.string};static defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};constructor(e){super(e),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=I.createRef(),this.cbContainer=I.createRef(),this.toggleButton=I.createRef(),this.menuContainer=I.createRef(),this.input=I.createRef(),this.searchInput=I.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}popper;cbContainer;toggleButton;menuContainer;input;searchInput;setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getCachedFilteredOptions=ee((e,t)=>e.filter(n=>n.title.toLowerCase().indexOf(t.toLowerCase())>=0||n.value.toLowerCase().indexOf(t.toLowerCase())>=0));focus(){this.input.current?.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:o}=this.props,a=t?n:o;switch(e.key){case"Enter":a[s]?.value!=null&&this.updateInputValue(a[s].value),this.closeMenu(),this.input.current?.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(xe.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(xe.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&s===a.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:o}=this.props,r=(t?n:o).length;let l=0;switch(e){case xe.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case xe.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(s+l+r)%r})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:o}=this.props,a=n?s:o;this.updateInputValue(a[t].value),this.closeMenu(),this.input.current?.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),this.popper.current?.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){this.scrollOptionIntoView(),this.searchInput.current?.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),this.popper.current?.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{this.popper.current?.show()})}closeMenu(e=!0){this.setState({menuIsOpen:!1}),e&&this.input.current?.focus(),this.popper.current?.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,a=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:a})}scrollOptionIntoView(){const e=this.menuContainer.current?.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return c.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[c.jsx("div",{className:"cb-search-input-container",children:c.jsx(nt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),c.jsx("div",{className:"cb-options-container",children:c.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:s}=this.state;return(n?s:e).map((a,r)=>{const l=`option-${r}-${a.value}`;return c.jsx("button",{type:"button",value:r,className:x("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:a.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:o,spellCheck:a,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:u}=this.props;return u={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...u},c.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[c.jsx("input",{value:l||o,className:x("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:a,"data-testid":r!==void 0?`${r}-input`:void 0}),c.jsx("div",{className:"input-group-append cb-dropdown",children:c.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r!==void 0?`${r}-btn`:void 0,children:[c.jsx(z,{icon:Ys}),c.jsx(De,{ref:this.popper,options:u,className:x("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}const qi=xe;function Gi({copy:i,kind:e="ghost",tooltip:t="Copy",className:n,"data-testid":s,children:o}){const[a,r]=On();return c.jsx(te,{kind:e,className:n,"data-testid":s,icon:a?ei:ti,tooltip:a?"Copied":t,onClick:()=>{r(typeof i=="function"?i():i)},children:o})}function st(i,e,t){return i.substring(0,e)+t+i.substring(e+1)}function Pn(i,e,t){return i.length<t?`${i}${e.substring(i.length,t)}`:i}function Ct(i,e){let{length:t}=i;for(let n=i.length-1;n>=0&&e[n]===i[n];n-=1)t=n;return i.substring(0,t)}const ie=B.module("MaskedInput"),Ee={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},_e=" ",Ln=I.forwardRef((i,e)=>{const{className:t,example:n,getNextSegmentValue:s=(k,O,y)=>y,getPreferredReplacementString:o=st,onChange:a=()=>!1,onSelect:r=()=>!1,onSubmit:l,pattern:u,placeholder:h,selection:p,value:m,onFocus:f=()=>!1,onBlur:v=()=>!1,"data-testid":S}=i,C=Dt(e),w=d.useMemo(()=>Array.isArray(n)?n:[n],[n]),D=d.useMemo(()=>w[0].replace(/[a-zA-Z0-9]/g,_e),[w]);d.useEffect(function(){if(p!=null){ie.debug("setting selection...",p);const{selectionStart:O,selectionEnd:y,selectionDirection:V}=p;C.current?.setSelectionRange(O,y,V),ie.debug("selection set!")}},[p,C]);const M=d.useCallback(k=>{let O=k,y=k;const V=w.length>0?w[0]:m;for(let E=O-1;E>=0&&/[a-zA-Z0-9]/g.test(V.charAt(E));E-=1)O=E;for(let E=y;E<V.length&&/[a-zA-Z0-9]/g.test(V.charAt(E));E+=1)y=E+1;const R=O===y?Ee.NONE:Ee.BACKWARD;return{selectionStart:O,selectionEnd:y,selectionDirection:R}},[w,m]);function F(k,O,y=k.length){let V="";for(let R=0;R<y;R+=1)k.charAt(R)!==_e?V=V.concat(k[R]):V=V.concat(O[R]);return V=V.concat(O.substring(y)),V}function P(k,O=k.length){const y=new RegExp(`^${u}$`);if(y.test(k))return!0;for(let V=0;V<w.length;V+=1){const R=F(k,w[V],O);if(y.test(R))return!0}return!1}function A(k){const O=M(k),y=O.selectionEnd+1;return y>=m.length?O:M(y)}function L(k){const O=M(k),y=O.selectionStart-1;return y<=0?O:M(y)}function W(k,O){const y=M(k),V=m.substring(y.selectionStart,y.selectionEnd),R=s(y,O,V,m),E=m.substring(0,y.selectionStart)+R+m.substring(y.selectionEnd);P(E,y.selectionEnd)&&(a(E),r(y))}const ae=d.useCallback(k=>{const{selectionStart:O=0,selectionEnd:y=0,selectionDirection:V="none"}=k.target;if(O===null||y===null||V===null){ie.error("Selection attempted on non-text input element",k.target);return}if(ie.debug2("handleSelect",O,y,V),!(p!=null&&O===p.selectionStart&&y===p.selectionEnd)){if(p!=null&&O===m.length&&y===m.length&&k.nativeEvent.type!=="mouseup"){r({...p});return}if(O===y){const R=M(O);ie.debug("Selection segment from ",O,y,"=>",R),r(R)}else r({selectionStart:O,selectionEnd:y,selectionDirection:V})}},[M,r,p,m]),$=d.useCallback(k=>{if(!C.current)return;ie.debug("handleSelectCapture",k);const O=C.current.selectionStart??0;O===m.length&&p!=null&&O!==p.selectionStart&&(k.preventDefault(),k.stopPropagation())},[C,p,m]);function j(k){if(k.preventDefault(),k.stopPropagation(),!C.current)return;const{key:O}=k,{selectionStart:y=0,selectionEnd:V=0}=C.current;if(y===null||V===null){ie.error("Selection arrow nvaigation attempted on non-text input element",k.target);return}O==="ArrowLeft"?r(L(y)):O==="ArrowRight"?r(A(V)):O==="ArrowUp"?W(y,-1):O==="ArrowDown"&&W(y,1)}function _(k){if(!C.current)return;ie.debug("handleKeyDown",k);const{key:O}=k,{selectionStart:y=0,selectionEnd:V=0}=C.current;if(y===null||V===null){ie.error("Selection key event on non-text input element",k.target);return}if(O==="Enter"){l?.(k);return}if(O.startsWith("Arrow")){j(k);return}if(O==="Delete"||O==="Backspace"){if(k.preventDefault(),k.stopPropagation(),V>=Ct(m,D).length){const E=m.substring(0,y===V?y-1:y),H=Ct(E,D);H!==m&&(a(H),r({selectionStart:H.length,selectionEnd:H.length,selectionDirection:Ee.NONE}));return}if(y!==V){const E=m.substring(0,y)+m.substring(y,V).replace(/[a-zA-Z0-9]/g,_e)+m.substring(V);ie.debug("Range ",y,V,"deleted, setting value",E),a(E),r({selectionStart:y,selectionEnd:y,selectionDirection:Ee.NONE})}else if(y>0)for(let E=y-1;E>=0;E-=1){const H=m.substring(0,E)+m.substring(E,y).replace(/[a-zA-Z0-9]/g,_e)+m.substring(y);if(H!==m){a(H),r({selectionStart:E,selectionEnd:E,selectionDirection:Ee.NONE});return}}return}if(k.altKey||k.metaKey||k.ctrlKey||O.length>1)return;k.preventDefault(),k.stopPropagation();const R=Array.from(new Set([O,O.toUpperCase(),O.toLowerCase()]));for(let E=0;E<R.length;E+=1){const H=R[E],ne=/[a-zA-Z0-9]/g.test(H)?w[0].length-1:y;for(let se=y;se<=ne;se+=1){const Ps=Pn(m,w[0],se+1),lt=o(Ps,se,H,y,V);if(P(lt,se+1)){const Xt=M(se),ct=se+1;let ut={selectionStart:ct,selectionEnd:ct,selectionDirection:Ee.NONE};if(ct>=Xt.selectionEnd){const Qt=A(se);Qt.selectionStart!==Xt.selectionStart&&(ut=Qt)}ie.debug("handleKeyDown",O,"=>",lt,ut),a(lt),r(ut);return}}}}return c.jsx("input",{ref:C,className:x("form-control masked-input",t),type:"text",pattern:u,placeholder:h,value:m,onChange:()=>{},onKeyDown:_,onSelect:ae,onSelectCapture:$,onFocus:f,onBlur:v,"data-testid":S})});Ln.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(i,e,t)=>t,getPreferredReplacementString:st,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const it=Ln,zi=B.module("TimeInput"),Zi="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Xi=["00:00:00","12:34:56","23:59:59"],jn=I.forwardRef((i,e)=>{const{allowValueWrapping:t=!0,className:n="",onChange:s=()=>!1,value:o=0,onFocus:a=()=>!1,onBlur:r=()=>!1,onSelect:l=()=>!1,"data-testid":u}=i,[h,p]=d.useState(Fe.formatTime(o)),[m,f]=d.useState(),v=d.useRef(null);d.useImperativeHandle(e,()=>({focus:()=>{v.current?.focus()},setSelection:M=>{v.current?.focus(),f(M)}}),[]),d.useEffect(function(){p(Fe.formatTime(o))},[o]);function S(M,F,P){const A=M.selectionStart===0?24:60;let L=parseInt(P,10)-F;return Number.isNaN(L)?L=0:t?L=(L%A+A)%A:L=Math.min(Math.max(0,L),A-1),`${L}`.padStart(2,"0")}function C(M,F,P,A,L){return A===0&&L===2&&F===1&&parseInt(P,10)>1?`0${P}${M.substring(2)}`:st(M,F,P)}function w(M){zi.debug("handleChange",M),p(M),Fe.isTimeString(M)&&s(Fe.parseTime(M))}const D=d.useCallback(M=>{f(M),l(M)},[l]);return c.jsx(it,{ref:v,className:n,example:Xi,getNextSegmentValue:S,getPreferredReplacementString:C,onChange:w,onSelect:D,pattern:Zi,selection:m,value:h,onFocus:a,onBlur:r,"data-testid":u})});jn.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Ze=jn;let Qi=class extends d.PureComponent{static defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};constructor(e){super(e),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=I.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:t}=e,n=t.initialKeyboardIndex??-1;this.state={menuItems:[],keyboardIndex:n,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{this.container.current?.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e){const{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}container;oldFocus;rAF;getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:e}=this.props,t=U.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:U.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let s=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}e.key==="Escape"?s=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?s=U.getNextMenuItem(s??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(s=U.getNextMenuItem(s??0,1,t)),n!==s&&(s!==null?this.setKeyboardIndex(s):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(),this.closeMenu(!0))}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{"data-testid":t}=this.props,{keyboardIndex:n,menuItems:s,mouseIndex:o}=this.state;for(let r=0;r<s.length;r+=1){const l=s[r];r>0&&l.group!==s[r-1].group&&e.push(c.jsx("hr",{},`${r}.separator`));const u=c.jsx(Lt,{isKeyboardSelected:n===r,isMouseSelected:o===r,menuItem:l,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},r);e.push(u)}const{menuStyle:a}=this.props;return c.jsx("div",{className:"context-menu-container",style:{...a},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};const Ji=Qi;class Yi extends d.PureComponent{static defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};constructor(e){super(e),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=I.createRef(),this.parent=null,this.popper=I.createRef(),this.isOpen=!1}componentDidMount(){const{isShown:e}=this.props;e===null?this.container.current?.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):e&&this.openMenu()}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}container;parent;popper;isOpen;closeMenu(){this.popper.current?.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){this.popper.current?.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:e}=this.props;e()}render(){const{actions:e,onMenuOpened:t,popperClassName:n,"data-testid":s}=this.props,{menuStyle:o}=this.props;let{options:a,popperOptions:r}=this.props;return r={placement:"bottom",...r},a={separateKeyboardMouse:!0,...a},c.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":s,children:c.jsx(De,{ref:this.popper,options:r,className:x("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:c.jsx(Ji,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:a,menuStyle:o})})})}}const $n=Yi;const tn=-1;var Vn=(i=>(i.UP="UP",i.DOWN="DOWN",i))(Vn||{});class re extends d.Component{static MENU_NAVIGATION_DIRECTION=Vn;static DROP_DOWN_MENU_HEIGHT=125;static defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:ni,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0};constructor(e){super(e);const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=I.createRef(),this.menuContainer=I.createRef(),this.button=I.createRef(),this.input=I.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}csContainer;menuContainer;button;input;getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let o=0;o<e.length;o+=1){const a=e[o];if(a.value===t)return a.title}return Fe.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){this.button.current?.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(s[t].value),this.closeMenu(),this.button.current?.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(re.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(re.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(re.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(re.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:s}=this.props,o=s.length;let a=t;switch(e){case re.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(a=(a-1)%o,this.setState({keyboardOptionIndex:a})):t===0&&(a=o-1,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a);break;case re.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===o-1){this.focusInput();break}else n&&this.focusOption(t);t<o&&!(n&&t===0)&&(a=(a+1)%o,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:o}=this.state;if(t===tn){const a=s(o);this.updateAndClose(a)}else this.updateAndClose(n[t].value)}updateAndClose(e){this.updateInputValue(e),this.closeMenu(),this.button.current?.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=this.menuContainer.current?.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(a=>a.value).indexOf(t)<0&&this.focusInput()}focusInput(){this.input.current?.focus()}focusOption(e){const t=this.menuContainer.current?.querySelector(".cs-options");if(t&&t.children!=null){const n=t.children.item(e);n instanceof HTMLElement&&n.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){this.setState({menuIsOpen:!1}),e&&this.button.current?.focus()}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){const t=this.menuContainer.current?.querySelector(".cs-options");if(t&&t.children!=null){const n=t.children.item(e);n instanceof HTMLElement&&n.offsetTop>re.DROP_DOWN_MENU_HEIGHT?t.scrollTop=n.offsetTop-re.DROP_DOWN_MENU_HEIGHT:(n instanceof HTMLElement&&n.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return c.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:c.jsx("div",{className:"cs-options-container",children:c.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:o,customTime:a,inputFocused:r}=this.state;let l=!1;const u=[];for(let h=0;h<e.length;h+=1){const p=e[h],m=`option-${h}-${p.value}`;l=l||p.value===t,u.push(c.jsxs("button",{type:"button",value:h,className:x("cs-option-btn",{"keyboard-active":o===h&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[p.value===t&&c.jsx(z,{icon:n,className:"mr-2"}),p.value!==t&&c.jsx("span",{className:"mr-4"}),p.title]},m))}return u.push(c.jsx("hr",{className:"cs-divider"},"option-divider")),u.push(c.jsxs("button",{type:"button",value:tn,className:x("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?c.jsx(z,{icon:n,className:"mr-2"}):c.jsx("span",{className:"mr-4"}),s]},"option-custom-label")),u.push(c.jsxs("div",{className:"cs-custom-container",children:[c.jsx("span",{className:"mr-2"}),c.jsx(Ze,{ref:this.input,onChange:this.handleCustomInput,value:a,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),c.jsx("span",{className:"ml-2"})]},"cs-custom-container")),u.push(c.jsx("hr",{className:"mb-2"},"option-end")),u}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:o}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},c.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:c.jsx("div",{className:x("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:c.jsxs("button",{type:"button",className:x("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[c.jsx("span",{className:x({"text-muted":n===null}),children:this.getSelectedText()}),c.jsx("span",{children:c.jsx(z,{icon:In,className:"cs-caret"})}),c.jsx($n,{isShown:o,actions:{menuElement:this.renderMenuElement()},popperOptions:a,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}const eo=re;function Ie(i,e,t,n,s){const o=n-t+1;return`${((parseInt(e,10)-i-t)%o+o)%o+t}`.padStart(s,"0")}function Bn(i,e,t){const{selectionStart:n}=i;return n===0?Ie(e,t,1900,2099,4):n===5?Ie(e,t,1,12,2):n===8?Ie(e,t,1,31,2):n===11?Ie(e,t,0,23,2):n===17||n===14?Ie(e,t,0,59,2):n===20||n===24||n===28?Ie(e,t,0,999,3):t}function St(i){const e=i.substring(0,23),t=i.substring(23,26),n=i.substring(26);return[e,t,n].filter(s=>s!=="").join("")}const to=B.module("DateTimeInput"),no="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",so="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",io=`${no} ${so}`,We="2022-01-01",Hn=`${We} 00:00:00.000000000`,oo="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function nn(i){return i!=null&&i.length>=We.length?`${i.substring(0,We.length)}${i.substring(We.length).replace(/\u2007/g,"0")}${Hn.substring(i.length)}`:i}function sn(i){return i.replace(/\u200B/g,"")}const ao=[St(Hn)],jt=I.forwardRef((i,e)=>{const{className:t="",onChange:n=()=>{},defaultValue:s="",onFocus:o=()=>{},onBlur:a=()=>{},onSubmit:r,"data-testid":l}=i,[u,h]=d.useState(s.length>0?St(s):""),[p,m]=d.useState(),f=d.useCallback(S=>{to.debug("handleChange",S),h(S),n(nn(sn(S)))},[n]),v=d.useCallback(()=>{const S=sn(u),C=nn(S);C!==S&&h(St(C)),a()},[u,a]);return c.jsx("div",{className:"d-flex flex-row align-items-center",children:c.jsx(it,{ref:e,className:x(t),example:ao,getNextSegmentValue:Bn,onChange:f,onSelect:m,onSubmit:r,pattern:io,placeholder:oo,selection:p,value:u,onFocus:o,onBlur:v,"data-testid":l})})});jt.displayName="DateTimeInput";jt.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const ro=jt,lo=B.module("DateInput"),co="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",uo=["2000-01-01","2022-12-31"],ho="YYYY-MM-DD",$t=I.forwardRef((i,e)=>{const{className:t="",onChange:n=()=>{},defaultValue:s="",onFocus:o=()=>{},onBlur:a=()=>{},"data-testid":r}=i,[l,u]=d.useState(s),[h,p]=d.useState(),m=d.useCallback(f=>{lo.debug("handleChange",f),u(f),n(f)},[n]);return c.jsx("div",{className:"d-flex flex-row align-items-center",children:c.jsx(it,{ref:e,className:x(t),example:uo,getNextSegmentValue:Bn,onChange:m,onSelect:p,pattern:co,placeholder:ho,selection:h,value:l,onFocus:o,onBlur:a,"data-testid":r})})});$t.displayName="DateInput";$t.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const po=$t;class mo extends d.PureComponent{static defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};constructor(e){super(e),this.searchInput=I.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Pe(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){const{value:t}=this.props;e.value!==t&&this.setState({value:t})}searchInput;focus(){this.searchInput.current?.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){const{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){const{placeholder:e,className:t,matchCount:n,id:s,"data-testid":o}=this.props,{value:a}=this.state;return c.jsx(nt,{value:a,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:s,"data-testid":o})}}const fo=mo;const go=B.module("ItemListItem");class Vt extends d.Component{static 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:{}};static handleKeyDown(){return go.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),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=I.createRef()}itemRef;handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:o,"data-testid":a}=this.props;return c.jsx("div",{className:x("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:Vt.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:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":a,children:o})}}const _n=Vt;const on=B.module("ItemList"),an=5;class oe extends d.PureComponent{static CACHE_SIZE=1e3;static DEFAULT_ROW_HEIGHT=20;static DEFAULT_OVERSCAN=10;static defaultProps={offset:0,items:[],rowHeight:oe.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:oe.DEFAULT_OVERSCAN,renderItem:oe.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};static renderItem({item:e}){return c.jsx("div",{className:"item-list-item-content",children:e!=null&&(e.displayValue??e.value??`${e}`)})}constructor(e){super(e),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=I.createRef(),this.listContainer=I.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){const{selectedRanges:n,itemCount:s}=this.props,{focusIndex:o,isStuckToBottom:a,scrollOffset:r,height:l,selectedRanges:u}=this.state;if(a&&!this.isListAtBottom()&&s>0&&this.scrollToBottom(),(r!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==u)this.setSelectedRanges(n);else if(u!==t.selectedRanges){const{onSelectionChange:h}=this.props;h(u)}if(o!==t.focusIndex){const{onFocusChange:h}=this.props;h(o)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}list;listContainer;getItemSelected=ee((e,t)=>le.isSelected(t,e),{max:oe.CACHE_SIZE});getCachedItem=ee((e,t,n,s,o,a,r,l)=>{const u=a({item:n,itemIndex:e,isFocused:s,isSelected:o,style:r});return c.jsx(_n,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:l,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:o,itemIndex:e,style:r,children:u},t)},{max:oe.CACHE_SIZE});getOuterElement=ee(e=>{const t=I.forwardRef((n,s)=>c.jsx("div",{ref:s,tabIndex:-1,onKeyDown:e,role:"presentation",...n}));return t.displayName="ItemListOuterElement",t});getInnerElement=ee(()=>{const e=I.forwardRef((t,n)=>c.jsx("div",{className:"item-list-inner-element",ref:n,...t}));return e.displayName="ItemListInnerElement",e});getItemData=ee((e,t,n)=>({items:e,selectedRanges:t,renderItem:n}));focus(){this.listContainer.current?.focus()}restoreScrollPosition(){const{scrollOffset:e}=this.state;e!=null&&this.listContainer.current?.scrollTo(0,e)}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),o=e-n;return s[o]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t?.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,o=le.isSelected(n,e)||U.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:o})=>({selectedRanges:le.selectRange(o,[e,e])}),()=>{s(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){on.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){on.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:s}=n;return s!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:s,disableSelect:o}=this.props,{mouseDownIndex:a,selectedRanges:r,mouseX:l,mouseY:u}=this.state;if(a==null||o)return;const h=Math.abs(t.clientX-(l??0)),p=Math.abs(t.clientY-(u??0));h>an&&p>an&&this.setState({isDragging:!0}),(n||a===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!U.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(a,e),Math.max(a,e)])):this.toggleSelect(e,t.shiftKey,U.isModifierKeyDown(t),!1))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:o}=this.props,{mouseDownIndex:a,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(a===e&&!r){const l=t.shiftKey,u=U.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,u,n),!s&&!l&&!u&&o(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:o}=this.state;let a=o;if(e.key==="Enter"||e.key===" "){!t&&a!=null&&this.setState({selectedRanges:[[a,a]]},()=>{a!=null&&s(a,e)});return}if(e.key==="ArrowUp")a!=null&&a>=0?a=Math.max(0,a-1):a=n-1;else if(e.key==="ArrowDown")a!=null&&a>=0?a=Math.min(a+1,n-1):a=0;else return;if(o!==a){e.stopPropagation(),e.preventDefault(),this.focusItem(a);const{selectedRanges:r}=this.state;if(e.shiftKey&&r.length>0){const l=r[r.length-1];this.selectRange([Math.min(a,l[0]),Math.max(a,l[1])])}else this.deselectAll(),a!==null?this.selectItem(a):this.listContainer.current?.focus();this.scrollIntoView(a)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:o}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:o}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,s=!0){const{isMultiSelect:o}=this.props,{selectedRanges:a}=this.state;if(o&&t&&a.length>0){const r=a[a.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else o&&a.length===1&&a[0][0]===e&&a[0][1]===e?s&&this.deselectItem(e):o&&n?this.getItemSelected(e,a)?s&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){le.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:le.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){le.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:le.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:s}=this.props,o=Math.floor(e/s),a=o+Math.ceil(t/s);n(o,a)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:s}=this.props;return e+t>=n*s}renderInnerElement({index:e,style:t}){const{items:n,offset:s,renderItem:o,disableSelect:a}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const u=n[e-s];return this.getCachedItem(e,e,u,e===r&&!a,this.getItemSelected(e,l),o,t,a)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:o,"data-testid":a}=this.props,{selectedRanges:r,isStuckToBottom:l}=this.state;return c.jsx(js,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:u,height:h})=>c.jsx($s,{className:"item-list-scroll-pane",height:h,width:u,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,r,s),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":a,children:this.renderInnerElement})})}}class ge extends d.PureComponent{static DEFAULT_ROW_HEIGHT=30;static defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ge.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ge.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};static renderHandle(){return c.jsxs("div",{children:[c.jsx(Nt,{children:"Drag to re-order"}),c.jsx(z,{icon:si})]})}static renderBadge({text:e}){return e!=null&&e.length>0?c.jsx("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return c.jsxs("div",{className:x("item-list-item-content","draggable-item-list-item-content",n),children:[c.jsx("span",{className:"title",children:e}),ge.renderBadge({text:t}),ge.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e!=null?e.displayValue??e.value??`${e}`:"",o=t!==void 0&&t?`${n}`:"",a=t!==void 0&&t?"item-list-item-clone":"";return ge.renderTextItem({text:s,badgeText:o,className:a})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){const t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=I.createRef(),this.state={selectedCount:0}}itemList;selectItem(e){this.itemList.current?.selectItem(e)}focusItem(e){this.itemList.current?.focusItem(e)}scrollToItem(e){this.itemList.current?.scrollToItem(e)}getCachedDraggableItem=ee((e,t,n,s,o,a,r,l)=>c.jsx(Vs,{draggableId:ge.getDraggableId(e,s),index:s,isDragDisabled:r,children:u=>c.jsx("div",{role:"menuitem",className:"draggable-item-list-item",ref:u.innerRef,tabIndex:-1,...u.draggableProps,...u.dragHandleProps,children:t({item:n,itemIndex:s,isFocused:o,isSelected:a,style:l,isClone:!1})})},s),{max:oe.CACHE_SIZE});handleSelectionChange(e){this.setState({selectedCount:le.count(e)});const{onSelectionChange:t}=this.props;t(e)}getCachedRenderDraggableItem=ee((e,t,n)=>({item:s,itemIndex:o,isFocused:a,isSelected:r,style:l})=>this.getCachedDraggableItem(e,n,s,o,a,r,t,l),{max:1});getCachedRenderClone=ee((e,t,n,s)=>(o,a,r)=>{const{selectedCount:l}=this.state,{draggableProps:u,dragHandleProps:h,innerRef:p}=o,{index:m}=r.source,f=t[m-n];return c.jsx("div",{className:x("draggable-item-list-dragging-item-container",e),...u,...h,ref:p,children:c.jsx("div",{className:x("draggable-item-list-dragging-item",{"two-dragged":l===2},{"multiple-dragged":l>2}),children:s({item:f,itemIndex:m,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:l})})})},{max:1});render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:o,isDragDisabled:a,isDropDisabled:r,isMultiSelect:l,isStickyBottom:u,itemCount:h,items:p,offset:m,onFocusChange:f,onSelect:v,onViewportChange:S,renderItem:C,rowHeight:w,selectedRanges:D,style:M,"data-testid":F}=this.props;return c.jsx(Bs,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,p,m,C),"data-testid":F,children:(P,A)=>c.jsx("div",{role:"menu",className:x("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":a,"is-dragging-from-this":A.draggingFromThisWith,"is-dragging-over":A.isDraggingOver,"is-dropping":A.draggingOverWith}),style:M,ref:P.innerRef,...P.droppableProps,children:c.jsx(oe,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:o,isDragSelect:!1,isMultiSelect:l,isStickyBottom:u,itemCount:h,items:p,onFocusChange:f,onSelect:v,onSelectionChange:this.handleSelectionChange,onViewportChange:S,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,a,C),rowHeight:w,selectedRanges:D})})})}}const bo=ge;class Xe{static reorder(e,t,n,s){const o=e===n?Xe.adjustDestinationIndex(s,t):s,a=Xe.removeItems(e,t);return n.splice(o,0,...a),a}static removeItems(e,t){const n=[],s=t.map((o,a)=>({range:o,index:a})).sort((o,a)=>a.range[0]-o.range[0]);for(let o=0;o<s.length;o+=1){const{range:a,index:r}=s[o],[l,u]=a;n[r]=e.splice(l,u-l+1)}return Hs(n)}static adjustDestinationIndex(e,t){let n=e;for(let s=0;s<t.length;s+=1){const[o,a]=t[s];if(o>e)break;n-=Math.min(a,e-1)-o+1}return n}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const Co=Xe;function So(i){const{isInvalid:e=!1,items:t,onAdd:n=()=>{},onDelete:s=()=>{},validate:o=()=>null}=i,[a,r]=d.useState(null),[l,u]=d.useState([]),[h,p]=d.useState(""),m=d.useCallback(M=>{u(M)},[]),f=d.useCallback(()=>{s(le.getItemsInRanges(t,l)),u([])},[t,l,s]),v=d.useCallback(()=>{if(h==="")return;const M=o(h);M==null?(n(h),p("")):r(M)},[h,n,o]),S=d.useCallback(M=>{const{value:F}=M.target;p(F),r(F===""?null:o(F))},[o]),C=d.useCallback(()=>{u([])},[]),w=d.useCallback(M=>{M.key==="Enter"&&v()},[v]),D=d.useMemo(()=>14+gt(t.length,1,6)*oe.DEFAULT_ROW_HEIGHT,[t.length]);return c.jsxs("div",{className:x("editable-item-list-container",{"is-invalid":e}),children:[c.jsx("div",{style:{height:D},children:c.jsx(oe,{itemCount:t.length,items:t.map((M,F)=>({value:M,isSelected:le.isSelected(l,F)})),offset:0,selectedRanges:l,onSelectionChange:m,isMultiSelect:!0})}),c.jsxs("div",{className:"d-flex flex-row pt-2",children:[c.jsx("div",{className:"d-flex flex-grow-1",children:c.jsx("input",{className:x("form-control",{"is-invalid":a!=null}),placeholder:"Enter value",type:"text",value:h,onChange:S,onFocus:C,onKeyDown:w})}),c.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[c.jsx(te,{kind:"ghost",onClick:v,disabled:a!=null||h==="",icon:ii,tooltip:"Add new item","data-testid":"add-item-button"}),c.jsx(te,{kind:"ghost",onClick:f,disabled:l.length===0,icon:oi,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}class Re extends d.Component{static defaultProps={className:"",icon:null,id:"","data-testid":void 0};static isParentSelected(e,t){const n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;const s=Array.from(n.values()).includes(!0),o=Array.from(n.values()).includes(!1);return s&&o?null:s}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=>{const{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){const{valueMap:n,onUpdateValueMap:s}=this.props,o=new Map(n),a=o.get(e);if(a instanceof Map){const l=new Map(a);if(t!=null)l.set(t,a.get(t)===void 0);else{const u=Re.isParentSelected(e,o),h=u==null||!u;a.forEach((p,m)=>l.set(m,h))}o.set(e,l)}else o.set(e,a==null||!a);const r=o.get(e);if(t===void 0&&r!==void 0&&typeof r!="boolean"){const l=Re.isParentSelected(e,n);l!=null&&l?r.forEach((u,h)=>r.set(h,!1)):r.forEach((u,h)=>r.set(h,!0))}s(o)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((o,a)=>{if(typeof o=="boolean")s.set(a,e);else{const r=new Map;o.forEach((l,u)=>r.set(u,e)),s.set(a,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return c.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>c.jsxs("div",{children:[c.jsx(ze,{className:"hcm-parent",checked:Re.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([o,a])=>c.jsx(ze,{className:"hcm-child",checked:a,onChange:()=>this.toggleValueFor(n,o),children:o},o))]},n)),c.jsx(te,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?`${t}-btn-select-all`:void 0,children:"Select All"}),c.jsx(te,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":o}=this.props,{menuIsOpen:a}=this.state;return c.jsxs("button",{type:"button",className:x("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":o,children:[c.jsxs("span",{children:[n&&c.jsx(z,{icon:n,className:"hcm-icon mr-1"}),e]}),c.jsx(z,{icon:In,className:"hcm-icon ml-1"}),c.jsx(De,{options:{placement:"bottom"},isShown:a,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}const vo=Re;function Un({on:i,id:e,className:t,isInvalid:n,disabled:s=!1,onClick:o,"data-testid":a}){return c.jsx("button",{type:"button",className:x("btn","btn-switch",t,{active:i},{"is-invalid":n}),id:e,onClick:o,disabled:s,"data-testid":a,children:c.jsx("div",{className:"handle"})})}function rn(i){return i.isOn!==void 0}function Kn({item:i,onSelect:e=()=>{},"data-testid":t}){const{icon:n,subtitle:s,title:o}=i,a=d.useMemo(()=>rn(i)?()=>{i.onChange(!i.isOn)}:e,[i,e]);return c.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:a,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&a()},tabIndex:0,role:"menuitem",children:[n!==void 0&&c.jsx("div",{className:"icon",children:c.jsx(z,{icon:n})}),c.jsx("div",{className:"title",children:o}),s!==void 0&&c.jsx("div",{className:"shortcut",children:s}),c.jsx("div",{className:"accessory","data-testid":t,children:rn(i)?c.jsx(Un,{on:i.isOn,onClick:r=>{r.stopPropagation(),a()}}):c.jsx(z,{icon:En})})]})}function Mo({items:i,onSelect:e=()=>{},"data-testid":t}){return c.jsx("div",{className:"navigation-menu-view","data-testid":t,children:c.jsx("ul",{className:"navigation-menu-list",children:i.map((n,s)=>c.jsx("li",{children:c.jsx(Kn,{item:n,onSelect:()=>{e(s)}})},n.title))})})}function yo({children:i,onBack:e,onClose:t,title:n,"data-testid":s}){return c.jsxs("div",{className:"navigation-page","data-testid":s,children:[c.jsxs("div",{className:"navigation-title-bar",children:[c.jsx("div",{className:"navigation-left-buttons",children:e!==void 0&&c.jsx(te,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:e,icon:ai,children:"Back"})}),c.jsx("div",{className:"navigation-title",children:n}),c.jsx("div",{className:"navigation-right-buttons",children:t!==void 0&&c.jsx(te,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:t,icon:xn,tooltip:"Close"})})]}),c.jsx("div",{className:"navigation-content",children:i})]})}function To({children:i,"data-testid":e}){const t=d.useMemo(()=>I.Children.toArray(i),[i]),n=Ot(t),[s,o]=d.useState(t[t.length-1]),[a,r]=d.useState(null),[l,u]=d.useState(null);d.useEffect(function(){if(n===void 0||t===n)return;const f=t[t.length-1];t.length===n.length||n.length===0||a!==null||l!==null?a!==null&&f!==a?r(f):f!==l&&f!==s&&o(f):t.length>n.length?r(f):t.length<n.length&&(o(f),u(n[n.length-1]))},[t,n,a,l,s]);const h=d.useCallback(()=>{o(a),r(null)},[a]),p=d.useCallback(()=>{u(null)},[]);return c.jsxs("div",{className:"navigation-stack",children:[c.jsx("div",{className:"main-view","data-testid":e,children:s}),c.jsx(Te,{in:l!=null,timeout:ce.transitionMidMs,classNames:"slide-right",onEntered:p,children:c.jsx(c.Fragment,{children:l!=null&&c.jsx("div",{className:"popping-view",children:l})})}),c.jsx(Te,{in:a!=null,timeout:ce.transitionMidMs,classNames:"slide-left",onEntered:h,children:c.jsx(c.Fragment,{children:a!=null&&c.jsx("div",{className:"pushing-view",children:a})})})]})}function Eo({children:i,disabled:e,value:t,"data-testid":n}){return c.jsx("option",{value:t,disabled:e,"data-testid":n,children:i})}function Io(i){const{children:e,disabled:t=!1,name:n,onChange:s,value:o="","data-testid":a}=i,[r]=d.useState(n??Se());return c.jsx(c.Fragment,{children:I.Children.map(e,l=>l?I.cloneElement(l,{name:r,onChange:l.props.onChange??s,checked:o===l.props.value,disabled:l.props.disabled??t,"data-testid":a}):null)})}const Bt=I.forwardRef((i,e)=>{const{checked:t,children:n,className:s="",disabled:o=!1,inputClassName:a="",isInvalid:r=!1,labelClassName:l="",name:u,onChange:h,value:p,"data-testid":m}=i,[f]=d.useState(Se());return c.jsxs("div",{className:x("custom-control custom-radio",s),children:[c.jsx("input",{type:"radio",id:f,"data-testid":m,name:u,ref:e,className:x("custom-control-input",a,{"is-invalid":r}),checked:t,disabled:o,value:p,onChange:h}),c.jsx("label",{className:x("custom-control-label",l),htmlFor:f,children:n})]})});Bt.displayName="RadioItem";Bt.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const xo=Bt;const wo=.025,No=.9,ko=.1,Oo=.618,ht=ce["primary-dark"],ln=80,Do=ce["gray-800"],Ao=ce["gray-900"],ve={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},pe=18,Fo=250,Ro=60*1e3,Po=I.memo(()=>{const i=d.useRef(null),e=d.useRef(null),[t,n]=d.useState(!1),s=window.devicePixelRatio;let o,a,r,l,u,h=null,p=[];function m(){e.current!=null&&(r=e.current.offsetWidth,l=e.current.offsetHeight),i.current!=null&&(i.current.style.width=`${r}px`,i.current.style.height=`${l}px`,i.current.width=r*s,i.current.height=l*s),o?.scale(s,s)}function f(){const $=document.createElement("canvas");$.width=ve.SIZE,$.height=ve.SIZE;const j=$.getContext("2d");return j!=null&&(j.fillStyle=ht,j.fillRect(0,0,ve.DOT_SIZE,ve.DOT_SIZE),j.fillStyle=ht+Math.round(255*ve.FILL_OPACITY).toString(16).padStart(2,"0"),j.fillRect(0,0,ve.SIZE,ve.SIZE)),j?.createPattern($,"repeat")}function v($){const j=Math.random()-.5;let _=wo*j;return $<ko?_=Math.abs(_):$>No&&(_=-Math.abs(_)),$+_}function S(){const $=[];let j=Oo;for(let _=0;_<r+pe;_+=1)j=v(j),$.push(j);return $}function C(){for(;p.length>=r+pe;)p.pop();for(;p.length<r+pe;)p.push(v(p[p.length-1]))}function w($,j){j.beginPath(),j.moveTo(-1,l+1),j.lineTo(-1,l*$[0]);for(let _=0;_<$.length;_+=1)j.lineTo(_,l*$[_]);j.lineTo(r+pe,l*$[$.length-1]),j.lineTo(r+pe,l+1),j.closePath()}function D($){$.beginPath();for(let j=1;j<r;j+=ln)$.moveTo(j,0),$.lineTo(j,l);for(let j=1;j<l;j+=ln)$.moveTo(0,j),$.lineTo(r,j)}function M($){h=h??$,Ti(o),o.fillStyle=Ao,o.fillRect(0,0,r,l),D(o),o.lineWidth=1,o.strokeStyle=Do,o.stroke();const j=((h??0)-($??0))/(1e3/pe);if(o.translate(j,0),w(p,o),o.lineWidth=2,o.strokeStyle=ht,o.stroke(),o.translate(-j,0),a!=null&&(o.fillStyle=a),o.fill(),o.setTransform(s,0,0,s,0,0),($??0)-(h??0)>1e3/pe){const _=Math.floor((($??0)-(h??0))/(1e3/pe));for(let k=0;k<_;k+=1)p.shift(),p.push(v(p[p.length-1]));h=$}u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(M)}const F=Pe(()=>{u=requestAnimationFrame($=>{m(),C(),n(!1),M($)})},Fo,{leading:!0});function P(){n(!0),u!=null&&cancelAnimationFrame(u),u=null,h=null}const A=Pe(()=>{P()},Ro);function L(){u==null&&(n(!1),m(),C(),u=requestAnimationFrame(M)),A()}function W(){document.hasFocus()&&L()}function ae(){u!=null&&cancelAnimationFrame(u),A(),F()}return d.useEffect(()=>(o=i.current?.getContext("2d",{alpha:!1}),m(),p=S(),a=f(),M(),A(),window.addEventListener("resize",ae),window.addEventListener("focus",L),window.addEventListener("blur",P),window.addEventListener("mousemove",W),window.addEventListener("keydown",W),()=>{u!=null&&cancelAnimationFrame(u),window.removeEventListener("resize",ae),window.removeEventListener("focus",L),window.removeEventListener("blur",P),window.removeEventListener("mousemove",W),window.removeEventListener("keydown",W),A.cancel(),F.cancel()}),[]),c.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:c.jsx("canvas",{ref:i,className:t?"shade":""})})}),Wn=Po;function Lo({children:i,onBlur:e,onChange:t,className:n,defaultValue:s,name:o,value:a,disabled:r,"data-testid":l}){const u=d.useCallback(h=>{t(h.target.value)},[t]);return c.jsx("select",{className:x("custom-select",n),onBlur:e,onChange:u,defaultValue:s,value:a,name:o,disabled:r,"data-testid":l,children:i})}class jo extends d.PureComponent{static defaultProps={disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0};constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=I.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}list;topRow;bottomRow;getCachedItem=ee((e,t,n,s,o,a,r)=>{const l={height:o},u=s??n;return c.jsx("li",{className:"value-list-item",style:l,tabIndex:-1,children:c.jsx(ze,{checked:a,disabled:r,onChange:()=>this.handleSelect(e),children:u})},t)},{max:1e3});getCachedItems=ee((e,t,n,s)=>{const o=[];for(let a=0;a<e.length;a+=1){const r=e[a],{value:l,displayValue:u,isSelected:h}=r,p=n+a,m=p,f=this.getCachedItem(p,m,l,u,t,h,s);o.push(f)}return o},{max:1});handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){const{onBlur:t}=this.props;t?.(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){const{items:t,offset:n,onSelect:s}=this.props,o=e-n;if(o>=0&&o<t.length){const a=t[o],{value:r}=a;s(e,r)}else s(e,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:e,rowHeight:t}=this.props,n=this.list.current.scrollTop,s=n+this.list.current.clientHeight,o=Math.floor(n/t),a=Math.ceil(s/t);(this.topRow!==o||this.bottomRow!==a)&&(this.topRow=o,this.bottomRow=a,e(o,a))}getElement(e){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[e]}scrollIntoView(e){this.getElement(e)?.scrollIntoView({block:"center"})}render(){const{className:e,disabled:t,isInvalid:n,items:s,itemCount:o,offset:a,rowHeight:r,"data-testid":l}=this.props,u=this.getCachedItems(s,r,a,t);return c.jsx("div",{className:x("select-value-list-scroll-pane h-100 w-100",{"is-invalid":n},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:c.jsx("div",{className:"select-value-list",style:{height:o*r},children:c.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:s.length*r,top:a*r,left:0},children:u})})})}}const qn=jo,cn=B.module("Shortcut");var Y=(i=>(i.CTRL="MODIFIER_CTRL",i.CMD="MODIFIER_CMD",i.ALT="MODIFIER_ALT",i.OPTION="MODIFIER_OPTION",i.SHIFT="MODIFIER_SHIFT",i))(Y||{}),Z=(i=>(i.A="A",i.B="B",i.C="C",i.D="D",i.E="E",i.F="F",i.G="G",i.H="H",i.I="I",i.J="J",i.K="K",i.L="L",i.M="M",i.N="N",i.O="O",i.P="P",i.Q="Q",i.R="R",i.S="S",i.T="T",i.U="U",i.V="V",i.W="W",i.X="X",i.Y="Y",i.Z="Z",i.ZERO="0",i.ONE="1",i.TWO="2",i.THREE="3",i.FOUR="4",i.FIVE="5",i.SIX="6",i.SEVEN="7",i.EIGHT="8",i.NINE="9",i.BACKSPACE="Backspace",i.ESCAPE="Escape",i.ENTER="Enter",i.DELETE="Delete",i.SLASH="/",i.QUESTION_MARK="?",i.BACKSLASH="\\",i.PIPE="|",i.MINUS="-",i.UNDERSCORE="_",i.EQUALS="=",i.PLUS="+",i.BACKTICK="`",i.TILDE="~",i.COMMA=",",i.LEFT_CHEVRON="<",i.PERIOD=".",i.RIGHT_CHEVRON=">",i.SEMICOLON=";",i.COLON=":",i.SINGLE_QUOTE="'",i.DOUBLE_QUOTE='"',i.LEFT_BRACKET="[",i.RIGHT_BRACKET="]",i.LEFT_CURLY="{",i.RIGHT_CURLY="}",i.F1="F1",i.F2="F2",i.F3="F3",i.F4="F4",i.F5="F5",i.F6="F6",i.F7="F7",i.F8="F8",i.F9="F9",i.F10="F10",i.F11="F11",i.F12="F12",i))(Z||{});const $o=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]);class K extends Mn{id;name;tooltip;isEditable;defaultKeyState;keyState;static NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};static isAllowedKey(e){return Object.values(Z).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!K.isMacPlatform&&e.metaKey||!K.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||$o.has(t)}static isMacPlatform=U.isMacPlatform();static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!K.isAllowedKey(t)&&K.isAllowedKey(String.fromCharCode(n))?s=String.fromCharCode(n):s=t,{keyValue:s,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case"Enter":t+="⏎";break;case"Escape":t+="⎋";break;case"Backspace":t+="⌫";break;case"Delete":t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){return e.keyValue?.toUpperCase()===t.keyValue?.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({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:o,tooltip:a}){super(),this.id=e,this.name=o,this.tooltip=a,this.isEditable=s;const l=K.isMacPlatform?n:t;this.defaultKeyState=K.createKeyState(l),this.keyState=this.defaultKeyState}getDisplayText(){return K.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){K.isValidKeyState(e)?(cn.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new kn("onUpdate",{detail:this}))):cn.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${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))}}const un=B.module("ShortcutRegistry");class Vo extends Mn{shortcutMap=new Map;shortcutsByCategory=new Map;createAndAdd(e){const t=new K(e);return this.add(t)}add(e){const t=this.shortcutMap.get(e.id);if(t)return un.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${e.id}`),t;un.debug2(`Adding shortcut to registry: ${e.id}`),e.addEventListener("onUpdate",({detail:s})=>this.dispatchEvent(new kn("onUpdate",{detail:s})));const n=e.id.split(".")[0];return this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)?this.shortcutsByCategory.get(n)?.push(e):this.shortcutsByCategory.set(n,[e]),e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}const Bo=Object.freeze(new Vo),Me=Bo,Ho={COPY:Me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[Y.CTRL,Z.C],macShortcut:[Y.CMD,Z.C],isEditable:!1}),PASTE:Me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[Y.CTRL,Z.V],macShortcut:[Y.CMD,Z.V],isEditable:!1}),SAVE:Me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[Y.CTRL,Z.S],macShortcut:[Y.CMD,Z.S],isEditable:!1}),SELECT_ALL:Me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[Y.CTRL,Z.A],macShortcut:[Y.CMD,Z.A],isEditable:!1}),LINKER:Me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[Y.CTRL,Z.L],macShortcut:[Y.CMD,Z.L]}),LINKER_CLOSE:Me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[Z.ESCAPE],macShortcut:[Z.ESCAPE],isEditable:!1})},_o=Ho;const Ht=I.forwardRef((i,e)=>{const{children:t,className:n,disabled:s,id:o,isLinked:a,isLinkedSource:r,isInvalid:l,onClick:u,onMouseEnter:h,onMouseLeave:p,style:m,"data-testid":f}=i;return c.jsxs("button",{ref:e,type:"button",className:x("btn-socketed",{"btn-socketed-linked":a!==void 0&&a||r},{"btn-socketed-linked-source":r},{"is-invalid":l},n),id:o,onClick:u,onMouseEnter:h,onMouseLeave:p,style:m,disabled:s,"data-testid":f,children:[t,c.jsx(z,{icon:ri,className:"linked btn-socketed-icon",transform:"down-1"}),c.jsx(z,{icon:li,className:"is-invalid btn-socketed-icon"})]})});Ht.displayName="SocketedButton";Ht.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 Uo=Ht,Ko={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_i6xja_5"},Wo={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_16vb7_5"},{global:qo,light:Go,dark:zo,medium:Zo,large:Xo}=_s,Qo={global:qo,light:{...Go,...Wo},dark:{...zo,...Ko},medium:Zo,large:Xo},Jo="_track_535ju_30",Yo="_handle_535ju_13",ea="_ticks_535ju_98",Gn={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_535ju_3","time-slider-popovers":"_time-slider-popovers_535ju_8","handle-popper":"_handle-popper_535ju_13","flex-spacer":"_flex-spacer_535ju_26",track:Jo,"track-fills":"_track-fills_535ju_37","track-fill":"_track-fill_535ju_37","track-fill-start":"_track-fill-start_535ju_55","track-fill-middle":"_track-fill-middle_535ju_56","track-fill-end":"_track-fill-end_535ju_59","handle-track":"_handle-track_535ju_62",handle:Yo,ticks:ea,"tick-labels":"_tick-labels_535ju_116","tick-label":"_tick-label_535ju_116","tick-label-wrapper":"_tick-label-wrapper_535ju_132"};const Ue=parseInt(Gn["handle-size"],10),dn=parseInt(Gn["popover-width"],10),J=24*60*60-1,hn=5*60;function ta({startTime:i,endTime:e,onChange:t,isStartModified:n=!1,isEndModified:s=!1,"data-testid":o}){const[a,r]=d.useState(i),[l,u]=d.useState(e),h=d.useRef(null);d.useEffect(function(){r(i),u(e)},[i,e]);const p=d.useCallback((v,S)=>{let C=v,w=S;C===w&&(w<J?w+=1:C-=1),r(C),u(w),t({startTime:C,endTime:w})},[r,u,t]),m=d.useCallback(v=>{p(v,l)},[p,l]),f=d.useCallback(v=>{p(a,v)},[p,a]);return c.jsxs("div",{className:"time-slider","data-testid":o,children:[c.jsx(na,{startTime:a,endTime:l,onStartTimeChange:m,onEndTimeChange:f,isStartModified:n,isEndModified:s}),c.jsxs("div",{className:"track",ref:h,children:[c.jsx(sa,{startTime:a,endTime:l}),c.jsx("div",{className:"ticks",children:Array(24).fill(null).map((v,S)=>c.jsx("div",{className:"tick"},S))}),c.jsx(pn,{track:h,time:a,setTime:m}),c.jsx(pn,{track:h,time:l,setTime:f})]}),c.jsxs("div",{className:"tick-labels",children:[c.jsx("div",{className:"tick-label",children:"0:00"}),c.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((v,S)=>c.jsx("div",{className:"tick-label",children:`${S+1}:00`},S))})]})]})}function na(i){const{startTime:e,endTime:t,onStartTimeChange:n,onEndTimeChange:s,isStartModified:o,isEndModified:a,"data-testid":r}=i,l=e>t,[u,h]=d.useState(l?t:e),[p,m]=d.useState(l?e:t),f=d.useRef(null),v=d.useRef(null),S=d.useRef(null),C=d.useRef(null);d.useEffect(function(){h(e>t?t:e),m(e>t?e:t)},[e,t]),d.useEffect(function(){S.current!==null&&v.current?.setSelection(S.current),C.current!==null&&f.current?.setSelection(C.current)},[l]);function w(P){e<=t?n(P):s(P)}function D(P){e<=t?s(P):n(P)}const M=d.useCallback(P=>{S.current=P,C.current=null},[]),F=d.useCallback(P=>{S.current=null,C.current=P},[]);return c.jsxs("div",{className:"time-slider-popovers",children:[c.jsx("div",{className:"flex",style:{flexBasis:`calc(${u/J*100}% - ${dn/2}px)`}}),c.jsxs("div",{className:"handle-popper",children:[c.jsx("label",{className:x({modified:l?a:o}),children:l?"End Time":"Start Time"}),c.jsx(Ze,{ref:f,allowValueWrapping:!1,value:u,onChange:w,onSelect:M,"data-testid":r!==void 0?`${r}-input-1`:void 0})]}),c.jsx("div",{className:"flex-spacer"}),c.jsxs("div",{className:"handle-popper",children:[c.jsx("label",{className:x({modified:l?o:a}),children:l?"Start Time":"End Time"}),c.jsx(Ze,{ref:v,allowValueWrapping:!1,value:p,onChange:D,onSelect:F,"data-testid":r!==void 0?`${r}-input-2`:void 0})]}),c.jsx("div",{className:"flex",style:{flexBasis:`calc(${(J-p)/J*100}% - ${dn/2}px)`}})]})}function sa(i){const{startTime:e,endTime:t,"data-testid":n}=i;return c.jsxs("div",{className:"track-fills","data-testid":n,children:[e>t&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"track-fill track-fill-start",style:{transform:`scaleX(${t/J})`}}),c.jsx("div",{className:"track-fill track-fill-end",style:{transform:`scaleX(${(J-e)/J})`}})]}),e<t&&c.jsx("div",{className:"track-fill track-fill-middle",style:{transform:`translateX(${e/J*100}%) scaleX(${(t-e)/J})`}})]})}function pn(i){const{track:e,time:t,setTime:n,"data-testid":s}=i,o=d.useMemo(()=>{let f=Ue/2;return t<3600?f=t/3600*(Ue/2):t>23*3600&&(f=Ue/2+1/(J-23*3600)*(t-23*3600)*(Ue/2)),`translateX(calc(${t/J*100}% - ${f}px))`},[t]),a=d.useCallback(m=>{if(!e.current)return 0;const f=e.current.getBoundingClientRect(),v=Math.max(m-f.left,0),S=J*Math.min(1,v/f.width),C=hn*Math.round(S/hn);return Math.min(J,C)},[e]),r=d.useCallback(({clientX:m})=>{n(a(m))},[n,a]),l=d.useCallback(({clientX:m})=>{n(a(m)),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[n,a,r]),u=d.useCallback(()=>{window.addEventListener("mousemove",r),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[r,l]),h=d.useCallback(()=>{window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,l]),p=d.useCallback(()=>{u()},[u]);return d.useEffect(function(){return()=>{h()}},[h]),c.jsx("div",{className:"handle-track",style:{transform:o},children:c.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:p,"data-testid":s})})}function zn({buttons:i,isShown:e=!1,classNames:t,message:n,type:s,onClick:o,onDismiss:a,"data-testid":r}){const l=i&&i.length!==0;return c.jsx(Te,{in:e,timeout:ce.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:c.jsxs("div",{className:x("toast-notification",t,s),role:"presentation",onClick:o,onKeyPress:o,"data-testid":r,children:[c.jsx("div",{className:"message-container",children:c.jsx("span",{className:"message",children:n})}),c.jsx(Te,{in:l,timeout:ce.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:c.jsx("div",{className:"buttons-container",children:i})}),a&&c.jsx(te,{kind:"ghost",icon:xn,tooltip:"Close notification",className:"my-2",onClick:a})]})})}zn.TYPE=Object.freeze({ERROR:"error"});function ia(i){const{children:e,className:t,labelText:n,hintText:s,isModified:o,validationError:a,showValidationError:r=!0,"data-testid":l,id:u}=i,{current:h}=d.useRef(u??Se());return c.jsxs(c.Fragment,{children:[c.jsx("label",{className:x("validate-label",t,{modified:o}),htmlFor:h,"data-testid":l,children:n}),I.Children.toArray(e).map(p=>I.isValidElement(p)?I.cloneElement(p,{className:x(p.props.className,{"is-invalid":a})}):c.jsx("div",{className:x(t),children:p})),s!==void 0&&c.jsx("small",{className:"form-text text-muted",children:s}),a!==void 0&&r&&c.jsx("p",{className:"validate-label-error text-danger",children:a})]})}const oa=Object.freeze(Object.defineProperty({__proto__:null,AutoCompleteInput:mi,AutoResizeTextarea:kt,BasicModal:Rt,Button:te,ButtonGroup:$e,ButtonOld:Fi,CardFlip:Ri,Checkbox:ze,Collapse:Ki,ComboBox:qi,ContextActionUtils:U,ContextActions:Bi,ContextMenuItem:Lt,ContextMenuRoot:Ui,CopyButton:Gi,CustomTimeSelect:eo,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:st,DateInput:po,DateTimeInput:ro,DebouncedModal:Di,DebouncedSearchInput:fo,DragUtils:Co,DraggableItemList:bo,DropdownMenu:$n,EditableItemList:So,GLOBAL_SHORTCUTS:_o,HierarchicalCheckboxMenu:vo,InfoModal:Ai,ItemList:oe,ItemListItem:_n,KEY:Z,LoadingOverlay:je,LoadingSpinner:wt,MODIFIER:Y,MaskedInput:it,Menu:Mo,MenuItem:Kn,Modal:It,ModalBody:xt,ModalFooter:Fn,ModalHeader:Tn,Option:Eo,Page:yo,Popper:De,RadioGroup:Io,RadioItem:xo,RandomAreaPlotAnimation:Wn,SearchInput:nt,Select:Lo,SelectValueList:qn,Shortcut:K,ShortcutRegistry:Me,SocketedButton:Uo,Stack:To,ThemeExport:ce,TimeInput:Ze,TimeSlider:ta,ToastNotification:zn,Tooltip:Nt,UISwitch:Un,ValidateLabelInput:ia,fillToLength:Pn,themeDHDefault:Qo,trimTrailingMask:Ct},Symbol.toStringTag,{value:"Module"}));function Ae(){return Ve(wn,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function aa(i,e){const t=Ae(),n=d.useMemo(()=>new t.CoreClient(i,e),[t,i,e]);return d.useEffect(()=>()=>{n.disconnect()},[n]),n}const _t=d.createContext(null);function ra({serverUrl:i,options:e,children:t}){const n=aa(i,e);return c.jsx(_t.Provider,{value:n,children:t})}function Be(){return Ve(_t,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const la=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:ci,ApiContext:wn,ClientBootstrap:ra,ClientContext:_t,useApi:Ae,useClient:Be},Symbol.toStringTag,{value:"Module"})),{dh:ca}=globalThis,N=ca,Zn=1e4;function ua(i,e,t=Zn){return new Promise((n,s)=>{let o;const a=setTimeout(()=>{o?.(),s(new Ye(`Variable ${e} not found`))},t);function r(l){const u=l.created.find(h=>h.title===e);u!=null&&(clearTimeout(a),o?.(),n(u))}o=i.subscribeToFieldUpdates(r)})}class da{static TYPE_GLOBAL="type-global";static TYPE_CONTEXT_PRESET="type-context-preset";static TYPE_CONTEXT_CUSTOM="type-context-custom";static isValid(e){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}const G=da;class ha extends G{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const Xn=ha;class pa extends G{format(e){return String.fromCharCode(e)}}const Qn=pa,mn=B.module("DateTimeColumnFormatter");class he extends G{static isValid(e){try{return N.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=G.TYPE_CONTEXT_PRESET){return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";static DEFAULT_TIME_ZONE_ID="America/New_York";static makeGlobalFormatStringMap(e,t){const n=t?"'T'":" ",s=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getGlobalFormats(e,t){return[...he.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t!==void 0&&t?"'T'":" ",s=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd",`yyyy-MM-dd${s}`],["MM-dd-yyyy",`MM-dd-yyyy${s}`],["HH:mm:ss",`HH:mm:ss${s}`],["HH:mm:ss.SSS",`HH:mm:ss.SSS${s}`],["HH:mm:ss.SSSSSSSSS",`HH:mm:ss.SSSSSSSSS${s}`],["yyyy-MM-dd HH:mm:ss",`yyyy-MM-dd${n}HH:mm:ss${s}`],["yyyy-MM-dd HH:mm:ss.SSS",`yyyy-MM-dd${n}HH:mm:ss.SSS${s}`],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS",`yyyy-MM-dd${n}HH:mm:ss.SSSSSSSSS${s}`]])}static getFormats(e,t){return[...he.makeFormatStringMap(e,t).keys()]}dhTimeZone;defaultDateTimeFormatString;showTimeZone;showTSeparator;formatStringMap;constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=he.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const o=e||he.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=N.i18n.TimeZone.getTimeZone(o)}catch{mn.error("Unsupported time zone id",o),this.dhTimeZone=N.i18n.TimeZone.getTimeZone(he.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=he.makeFormatStringMap(t,n)}getEffectiveFormatString(e){return this.formatStringMap.get(e)??e}format(e,t={}){const n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return N.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{mn.error("Invalid format arguments")}return""}}const ma=B.module("DecimalColumnFormatter");class Q extends G{static isValid(e){try{return N.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=G.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Q.makeFormat(e,t,G.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Q.makeFormat("Custom Format",e,G.TYPE_CONTEXT_CUSTOM,t)}static DEFAULT_FORMAT_STRING="###,##0.0000";static FORMAT_PERCENT=Q.makePresetFormat("Percent","##0.00%");static FORMAT_BASIS_POINTS=Q.makePresetFormat("Basis Points","###,##0 bp",1e4);static FORMAT_MILLIONS=Q.makePresetFormat("Millions","###,##0.000 mm",1e-6);static FORMAT_SCIENTIFIC_NOTATION=Q.makePresetFormat("Scientific Notation","0.0000E0");static FORMAT_ROUND=Q.makePresetFormat("Round","###,##0");static FORMAT_ROUND_TWO_DECIMALS=Q.makePresetFormat("0.00","###,##0.00");static FORMAT_ROUND_FOUR_DECIMALS=Q.makePresetFormat("0.0000","###,##0.0000");static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}defaultFormatString;constructor({defaultFormatString:e=Q.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}format(e,t={}){const n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,s=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return N.i18n.NumberFormat.format(n,s)}catch{ma.error("Invalid format arguments")}return""}}class fa extends G{format(e){return`${e}`}}const Jn=fa,ga=B.module("IntegerColumnFormatter");class be extends G{static isValid(e){try{return N.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=G.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return be.makeFormat(e,t,G.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return be.makeFormat("Custom Format",e,G.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}static DEFAULT_FORMAT_STRING="###,##0";static FORMAT_MILLIONS=be.makePresetFormat("Millions","###,##0.000 mm",1e-6);static FORMAT_SCIENTIFIC_NOTATION=be.makePresetFormat("Scientific Notation","0.0000E0");defaultFormatString;constructor({defaultFormatString:e=be.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}format(e,t={}){const n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,s=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return N.i18n.NumberFormat.format(n,s)}catch{ga.error("Invalid format arguments")}return""}}class Yn extends G{format(e){return e}}class q{static FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";static months=["january","february","march","april","may","june","july","august","september","october","november","december"];static makeDateWrapper(e,t,n=0,s=1,o=0,a=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const u=`${t}`.padStart(4,"0"),h=`${n+1}`.padStart(2,"0"),p=`${s}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),f=`${a}`.padStart(2,"0"),v=`${r}`.padStart(2,"0"),S=`${l}`.padStart(9,"0"),C=`${u}-${h}-${p} ${m}:${f}:${v}.${S}`;return N.i18n.DateTimeFormat.parse(q.FULL_DATE_FORMAT,C,N.i18n.TimeZone.getTimeZone(e))}static getNextNanos(e){const t=parseInt(e,10),n="0".repeat(9-e.length),s=`${t+1}${n}`;return parseInt(s,10)}static getNextDate(e,t,n){let{year:s,month:o,date:a,hours:r,minutes:l,seconds:u,nanos:h}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;h=q.getNextNanos(e.nanos),h>999999999&&(u+=1,h=0)}else e.seconds!=null?u+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?a+=1:e.month!=null?o+=1:s+=1;const p=new Date(s,o,a,r,l,u);return q.makeDateWrapper(n,p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds(),h)}static parseMonth(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;const n=e.trim().toLowerCase();if(n.length>=3){for(let s=0;s<q.months.length;s+=1)if(q.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,o,a,r){const l=parseInt(e,10),u=t!=null?this.parseMonth(t):0,h=n!=null?parseInt(n,10):1,p=s!=null?parseInt(s,10):0,m=o!=null?parseInt(o,10):0,f=a!=null?parseInt(a,10):0,v=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(u)||Number.isNaN(h)||Number.isNaN(p)||Number.isNaN(m)||Number.isNaN(f)||Number.isNaN(v)?null:{year:l,month:u,date:h,hours:p,minutes:m,seconds:f,nanos:v}}static parseDateTimeString(e){const n=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/.exec(e);if(n==null)throw new Error(`Unexpected date string: ${e}`);const[,s,,o,,a,,r,,l,,u,,h,p]=n;if(p!=null&&p.length>0)throw new Error(`Unexpected characters after date string '${e}': ${p}`);return{year:s,month:o,date:a,hours:r,minutes:l,seconds:u,nanos:h}}static parseDateRange(e,t){const n=e.trim().toLowerCase();if(n.length===0)throw new Error("Cannot parse date range from empty string");if(n==="null")return[null,null];if(n==="today"){const l=new Date(Date.now()),u=q.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),h=q.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[u,h]}if(n==="yesterday"){const l=new Date(Date.now()),u=q.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),h=q.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[u,h]}if(n==="now"){const l=new Date(Date.now());return[N.DateWrapper.ofJsDate(l),null]}const s=q.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const o=q.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(o==null)throw new Error(`Unable to extract date values from ${s}`);const a=q.makeDateWrapper(t,o.year,o.month,o.date,o.hours,o.minutes,o.seconds,o.nanos),r=q.getNextDate(s,o,t);return[a,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}class fn{static not="not";static and="and";static or="or"}function xr(i){if(!(i==="not"||i==="and"||i==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class T{static eq="eq";static eqIgnoreCase="eqIgnoreCase";static notEq="notEq";static notEqIgnoreCase="notEqIgnoreCase";static greaterThan="greaterThan";static greaterThanOrEqualTo="greaterThanOrEqualTo";static lessThan="lessThan";static lessThanOrEqualTo="lessThanOrEqualTo";static in="in";static inIgnoreCase="inIgnoreCase";static notIn="notIn";static notInIgnoreCase="notInIgnoreCase";static isTrue="isTrue";static isFalse="isFalse";static isNull="isNull";static invoke="invoke";static contains="contains";static notContains="notContains";static startsWith="startsWith";static endsWith="endsWith";static containsAny="containsAny"}const ue=B.module("TableUtils");class b{static dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};static sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};static APPLY_TABLE_CHANGE_TIMEOUT_MS=3e4;static REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});static NUMBER_REGEX=/^-?\d+(\.\d+)?$/;static executeAndWaitForEvent=async(e,t,n,s=b.APPLY_TABLE_CHANGE_TIMEOUT_MS)=>{if(t==null)return null;const o=b.makeCancelableTableEventPromise(t,n,s);return e(t),await o,t};static async applyCustomColumns(e,t,n=b.APPLY_TABLE_CHANGE_TIMEOUT_MS){return b.executeAndWaitForEvent(s=>s?.applyCustomColumns(t),e,N.Table.EVENT_CUSTOMCOLUMNSCHANGED,n)}static async applyFilter(e,t,n=b.APPLY_TABLE_CHANGE_TIMEOUT_MS){return b.executeAndWaitForEvent(s=>s?.applyFilter(t),e,N.Table.EVENT_FILTERCHANGED,n)}static async applyNeverFilter(e,t,n=b.APPLY_TABLE_CHANGE_TIMEOUT_MS){if(e==null)return null;const s=e.findColumn(t),o=[b.makeNeverFilter(s)];return await b.applyFilter(e,o,n),e}static async applySort(e,t,n=b.APPLY_TABLE_CHANGE_TIMEOUT_MS){return b.executeAndWaitForEvent(s=>s?.applySort(t),e,N.Table.EVENT_SORTCHANGED,n)}static getSortIndex(e,t){for(let n=0;n<e.length;n+=1)if(e[n].column?.name===t)return n;return null}static getSortForColumn(e,t){const n=b.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return b.isBooleanType(e)?[T.isTrue,T.isFalse,T.isNull]:b.isCharType(e)||b.isNumberType(e)||b.isDateType(e)?[T.eq,T.notEq,T.greaterThan,T.greaterThanOrEqualTo,T.lessThan,T.lessThanOrEqualTo]:b.isTextType(e)?[T.eq,T.eqIgnoreCase,T.notEq,T.notEqIgnoreCase,T.contains,T.notContains,T.startsWith,T.endsWith]:[]}static getNextSort(e,t,n){if(n<0||n>=e.length)return null;const s=b.getSortForColumn(t,e[n].name);return s===null?e[n].sort().asc():s.direction===b.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(t<0||t>=e.length||n===b.sortDirection.none)return null;let o=e[t].sort();switch(n){case b.sortDirection.ascending:o=o.asc();break;case b.sortDirection.descending:o=o.desc();break}return s&&(o=o.abs()),o}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const o=b.getNextSort(t,e,n);return b.setSortForColumn(e,t[n].name,o,s)}static sortColumn(e,t,n,s,o,a){if(n<0||n>=t.length)return[];const r=b.makeColumnSort(t,n,s,o);return b.setSortForColumn(e,t[n].name,r,a)}static setSortForColumn(e,t,n,s=!1){const o=b.getSortIndex(e,t);let a=[];return s&&(a=a.concat(e.filter(({direction:r})=>r!==b.sortDirection.reverse)),o!==null&&a.splice(o,1)),n!==null&&a.push(n),a}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case b.dataType.BOOLEAN:return b.dataType.BOOLEAN;case"char":case"java.lang.Character":case b.dataType.CHAR:return b.dataType.CHAR;case"java.lang.String":case b.dataType.STRING:return b.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case b.dataType.DATETIME:return b.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case b.dataType.DECIMAL:return b.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case b.dataType.INT:return b.dataType.INT;default:return b.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return b.isIntegerType(e)||b.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return b.getNormalizedType(e)===b.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let o=null;for(let a=0;a<s.length;a+=1){const l=s[a].split("&&");let u=null;for(let h=0;h<l.length;h+=1){const p=l[h].trim();if(p.length>0){const m=b.makeQuickFilterFromComponent(e,p,n);if(m)u?u=u.and(m):u=m;else throw new Error(`Unable to parse quick filter from text ${t}`)}}o&&u?o=o.or(u):o=u}return o}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return b.isNumberType(s)?this.makeQuickNumberFilter(e,t):b.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n!=null&&b.isDateType(s)?this.makeQuickDateFilter(e,t,n):b.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){const n=e.filter();let s=null;const a=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,u=null,h=null,p=null;if(a!==null&&a.length>3&&([,r,l,u,h,p]=a),p!=null&&p.trim().length>0)return null;if(r==null&&(r="="),h!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(h=h.trim().toLowerCase(),h){case"null":s=n.isNull();break;case"nan":s=N.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"∞":l!=null?s=N.FilterCondition.invoke("isInf",n).and(n.lessThan(N.FilterValue.ofNumber(0))):s=N.FilterCondition.invoke("isInf",n).and(n.greaterThan(N.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(u==null)return null;if(u=b.removeCommas(u),b.isLongType(e.type))try{u=N.FilterValue.ofNumber(N.LongWrapper.ofString(`${l!=null?"-":""}${u}`))}catch(m){return ue.warn("Unable to create long filter",m),null}else{if(u=parseFloat(u),u==null||Number.isNaN(u))return null;u=N.FilterValue.ofNumber(l!=null?0-u:u)}return s=e.filter(),b.makeRangeFilterWithOperation(s,r,u)}static makeQuickTextFilter(e,t){const n=`${t}`.trim(),o=/^(!~|!=|~|=|!)?(.*)/.exec(n);let a=null,r=null;if(o!==null&&o.length>2&&([,a,r]=o,r!=null&&(r=r.trim())),r==null||r.length===0)return null;a==null&&(a="=");const l=e.filter();if(r.toLowerCase()==="null")switch(a){case"=":return l.isNull();case"!=":case"!":return l.isNull().not()}let u=null,h=null;switch(r.startsWith("*")?(u="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(h="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),a){case"~":return l.isNull().not().and(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return u==="*"?l.isNull().or(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):h==="*"?l.isNull().or(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(N.FilterValue.ofString(r.toLowerCase()));case"=":return u==="*"?l.isNull().not().and(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):h==="*"?l.isNull().not().and(l.invoke("matches",N.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(N.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,o,a]=s,r=o==="!"||o==="!=",l=a.trim().toLowerCase();let u=e.filter();try{const h=b.makeBooleanValue(l);return h!=null&&h?u=u.isTrue():h===null?u=u.isNull():u=u.isFalse(),r?u.not():u}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(a==null||a.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=a;let u=T.eq;switch(r){case"<":u=T.lessThan;break;case"<=":case"=<":u=T.lessThanOrEqualTo;break;case">":u=T.greaterThan;break;case">=":case"=>":u=T.greaterThanOrEqualTo;break;case"!=":case"!":u=T.notEq;break;case"=":case"==":default:u=T.eq;break}return b.makeQuickDateFilterWithOperation(e,l,u,n)}static makeQuickDateFilterWithOperation(e,t,n,s){const[o,a]=q.parseDateRange(t,s),r=o!=null?N.FilterValue.ofNumber(o):null,l=a!=null?N.FilterValue.ofNumber(a):null,u=e.filter();if(r==null)return n===T.notEq?u.isNull().not():u.isNull();switch(n){case T.eq:{if(l!=null){const h=u.greaterThanOrEqualTo(r),p=u.lessThan(l);return h.and(p)}return u.eq(r)}case T.lessThan:return u.lessThan(r);case T.lessThanOrEqualTo:return l!=null?u.lessThan(l):u.lessThanOrEqualTo(r);case T.greaterThan:return l!=null?u.greaterThanOrEqualTo(l):u.greaterThan(r);case T.greaterThanOrEqualTo:return u.greaterThanOrEqualTo(r);case T.notEq:{if(l!=null){const h=u.lessThan(r),p=u.greaterThanOrEqualTo(l);return h.or(p)}return u.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:`"${e}"`}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeQuickCharFilter(e,t){const n=`${t}`.trim(),o=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/.exec(n);let a=null,r=null,l=null;if(o!==null&&o.length>3&&([,a,r,l]=o),l!=null&&l.trim().length>0||r==null||r.length===0)return null;a==null&&(a="=");const u=e.filter();if(r.toLowerCase()==="null")switch(a){case"=":return u.isNull();case"!=":case"!":return u.isNull().not();default:return null}const h=N.FilterValue.ofString(b.isRangeOperation(a)?b.quoteValue(r):r);return b.makeRangeFilterWithOperation(u,a,h)}static makeRangeFilterWithOperation(e,t,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return Le.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t,n=0,s=null){let o,a,r=!0;const l=new Promise((u,h)=>{a=setTimeout(()=>{o(),r=!1,h(new Ye(`Event "${t}" timed out.`))},n),o=e.addEventListener(t,p=>{if(s!=null&&!s(p)){ue.debug2("Event triggered, but matcher returned false.");return}ue.debug2("Event triggered, resolving."),o(),clearTimeout(a),r=!1,u(p)})});return l.cancel=()=>{if(r){ue.debug2("Pending promise cleanup."),o(),clearTimeout(a),r=!1;return}ue.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:o,invertSelection:a,selectedValues:r}=t;let l=null;for(let h=0;h<s.length;h+=1){const p=s[h],{selectedType:m,value:f}=p;if(m!=null&&m.length>0&&f!=null&&f.length>0)try{const v=b.makeAdvancedValueFilter(e,m,f,n);if(v!=null){if(h===0)l=v;else if(l!==null&&h-1<o.length){const S=o[h-1];if(S===fn.and)l=l.and(v);else if(S===fn.or)l=l.or(v);else{ue.error("Unexpected filter operator",S,v),l=null;break}}}else ue.debug2("Empty filter ignored for",m,f)}catch(v){ue.error("Unable to create filter",v),l=null;break}}const u=b.makeSelectValueFilter(e,r,a);return u!=null&&(l!=null?l=l.and(u):l=u),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=b.getBaseType(e);return b.isTextType(n)?N.FilterValue.ofString(t):b.isLongType(n)?N.FilterValue.ofNumber(N.LongWrapper.ofString(b.removeCommas(t))):N.FilterValue.ofNumber(b.removeCommas(t))}static makeFilterRawValue(e,t){return b.isTextType(e)?N.FilterValue.ofString(t):b.isBooleanType(e)?N.FilterValue.ofBoolean(t):N.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==="null")return null;if(b.isTextType(e))return t;if(b.isLongType(e))return N.LongWrapper.ofString(b.removeCommas(t));if(b.isBooleanType(e))return b.makeBooleanValue(t,!0);if(b.isDateType(e)){const[s]=q.parseDateRange(t,n);return s}return b.isNumberType(e)?b.makeNumberValue(t):(ue.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e?.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error(`Invalid boolean '${e}'`)}}static makeNumberValue(e){if(e==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=b.removeCommas(t);if(b.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static getFilterOperatorString(e){switch(e){case T.eq:return"=";case T.notEq:return"!=";case T.greaterThan:return">";case T.greaterThanOrEqualTo:return">=";case T.lessThan:return"<";case T.lessThanOrEqualTo:return"<=";case T.contains:return"~";case T.notContains:return"!~";default:throw new Error(`Unexpected filter type ${e}`)}}static makeAdvancedValueFilter(e,t,n,s){if(b.isDateType(e.type))return b.makeQuickDateFilterWithOperation(e,n,t,s);if(b.isNumberType(e.type)||b.isCharType(e.type))return b.makeQuickFilter(e,`${b.getFilterOperatorString(t)}${n}`);const o=b.makeFilterValue(e.type,n),a=e.filter();switch(t){case T.eq:return a.eq(o);case T.eqIgnoreCase:return a.eqIgnoreCase(o);case T.notEq:return a.notEq(o);case T.notEqIgnoreCase:return a.notEqIgnoreCase(o);case T.greaterThan:return a.greaterThan(o);case T.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(o);case T.lessThan:return a.lessThan(o);case T.lessThanOrEqualTo:return a.lessThanOrEqualTo(o);case T.isTrue:return a.isTrue();case T.isFalse:return a.isFalse();case T.isNull:return a.isNull();case T.contains:return a.isNull().not().and(a.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case T.notContains:return a.isNull().or(a.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case T.startsWith:return a.isNull().not().and(a.invoke("matches",N.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case T.endsWith:return a.isNull().not().and(a.invoke("matches",N.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case T.in:case T.inIgnoreCase:case T.notIn:case T.notInIgnoreCase:case T.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeNeverFilter(e){let t=null;b.isTextType(e.type)?t=N.FilterValue.ofString("a"):b.isBooleanType(e.type)?t=N.FilterValue.ofBoolean(!0):b.isDateType(e.type)?t=N.FilterValue.ofNumber(N.DateWrapper.ofJsDate(new Date)):t=N.FilterValue.ofNumber(0);const n=e.filter().eq(t),s=e.filter().notEq(t);return n.and(s)}static makeSelectValueFilter(e,t,n){if(t.length===0)return n?null:b.makeNeverFilter(e);const s=[];let o=!1;for(let a=0;a<t.length;a+=1){const r=t[a];r==null?o=!0:b.isTextType(e.type)?s.push(N.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):b.isBooleanType(e.type)?s.push(N.FilterValue.ofBoolean(Boolean(r))):s.push(N.FilterValue.ofNumber(r))}return o?s.length>0?n?e.filter().isNull().not().and(e.filter().notIn(s)):e.filter().isNull().or(e.filter().in(s)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(s):e.filter().in(s)}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e,t=!0){return[...e].sort((n,s)=>{const o=n.name.toUpperCase(),a=s.name.toUpperCase();return Ii.sort(o,a,t)})}}class ot{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{const s=b.getNormalizedType(n.columnType);return s===null||(t.has(s)||t.set(s,new Map),t.get(s)?.set(n.columnName,n.format)),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e=[],t,n,s,o=!1){this.defaultColumnFormatter=new Jn,this.typeFormatterMap=new Map([[b.dataType.BOOLEAN,new Xn],[b.dataType.CHAR,new Qn],[b.dataType.DATETIME,new he(t)],[b.dataType.DECIMAL,new Q(n)],[b.dataType.INT,new be(s)],[b.dataType.STRING,new Yn]]),this.columnFormatMap=ot.makeColumnFormatMap(e),this.truncateNumbersWithPound=o}defaultColumnFormatter;typeFormatterMap;columnFormatMap;truncateNumbersWithPound;getColumnFormatMapForType(e,t=!1){const n=b.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){return this.getColumnFormatMapForType(e)?.get(t)??null}getColumnTypeFormatter(e){const t=b.getNormalizedType(e);let n=this.defaultColumnFormatter;return t&&(n=this.typeFormatterMap.get(t)??n),n}getFormattedString(e,t,n="",s){if(e==null)return"";const o=this.getColumnTypeFormatter(t),a=s||this.getColumnFormat(t,n);return o.format(e,a??void 0)}get timeZone(){return this.typeFormatterMap.get(b.dataType.DATETIME)?.dhTimeZone?.id}}function es(i){if(i&&i.formatter){const{formatter:e}=i;return e}}function ts(i){return{timeZone:i?.timeZone,defaultDateTimeFormatString:i?.defaultDateTimeFormat,showTimeZone:i?.showTimeZone,showTSeparator:i?.showTSeparator}}function ns(i,e,t){const n=i.getColumnFormat(t,e);return n!=null&&(n.type===G.TYPE_CONTEXT_PRESET||n.type===G.TYPE_CONTEXT_CUSTOM)}const vt={getColumnFormats:es,getDateTimeFormatterOptions:ts,isCustomColumnFormatDefined:ns},pt=B.module("MessageUtils"),ss="io.deephaven.message.LoginOptions.request",is="io.deephaven.message.SessionDetails.request",os="io.deephaven.broadcast",as="io.deephaven.broadcast.Login",rs="io.deephaven.broadcast.Logout";function at(i){const e=i;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function ls(i){return at(i)&&i.message===as}function cs(i){return at(i)&&i.message===rs}function us(i){const e=i;return e!=null&&typeof e.id=="string"}function ds(i,e=Se(),t){return{message:i,id:e,payload:t}}function ba(i,e){return{id:i,payload:e}}async function Ut(i,e=3e4){if(window.opener==null)throw new Error("window.opener is null, unable to send request.");return new Promise((t,n)=>{let s;const o=Se(),a=r=>{const{data:l}=r;if(!us(l)){pt.debug("Ignoring non-deephaven response",l);return}if(pt.debug("Received message",l),l?.id!==o){pt.debug("Ignore message, id doesn't match",l);return}window.clearTimeout(s),window.removeEventListener("message",a),t(l.payload)};window.addEventListener("message",a),s=window.setTimeout(()=>{window.removeEventListener("message",a),n(new Ye("Request timed out"))},e),window.opener.postMessage(ds(i,o),"*")})}class hs extends Error{isNoConsolesError=!0}function ps(i){return i.isNoConsolesError}const we=B.module("SessionUtils");function Ca(i){return we.info(`Starting connection to '${i}'...`),new dh.IdeConnection(i)}async function ms(i,e){we.info("Getting console types...");const t=await i.getConsoleTypes();if(t.length===0)throw new hs("No console types available");we.info("Available types:",t);const n=t[0];we.info("Starting session with type",n);const s=await i.startSession(n),o={type:n,id:Se.generate()};return we.info("Console session established",o),{session:s,config:o,connection:i,details:e}}function Sa(i,e){return we.info("createCoreClient",i),new dh.CoreClient(i,e)}function va(i){return i!=null&&typeof i=="object"}async function Ma(){const i=await Ut(is);if(!va(i))throw new Error(`Unexpected session details response: ${i}`);return i}async function ya(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return Ma()}return{}}async function Ta(i,e){let t;try{t=await ms(i,e)}catch(n){if(!ps(n))throw n}return t}const Ea=B.module("ViewportDataUtils");function fs(i,e){return String(i.offsetInSnapshot+e)}function gs(i,e){return function(n){const{columns:s,offset:o,rows:a}=n.detail;Ea.debug("table updated",n.detail),a.forEach(r=>{const l=e(r,s),u={key:fs(r,o),item:l};i.getItem(u.key)!=null?i.update(u.key,u):i.append(u)})}}function bs(i,e){return e.reduce((t,n)=>(t[n.name]=i.get(n),t),{})}function*Cs(i,e){for(let t=i;t<=e;++t)yield{key:String(t)}}function Ia(i,...e){return e.map(t=>i.getItem(t))}function Kt(i){return i==null||rt(i)?0:i.size}function rt(i){return"isClosed"in i?i.isClosed:!1}function Ss(i,e,t,n){const s=i+e-1,[o,a]=[0,n-1],r=gt(i-t,o,a),l=gt(s+t,o,a);return[r,l]}const xa=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:os,BROADCAST_LOGIN_MESSAGE:as,BROADCAST_LOGOUT_MESSAGE:rs,BooleanColumnFormatter:Xn,CharColumnFormatter:Qn,DateTimeColumnFormatter:he,DateUtils:q,DecimalColumnFormatter:Q,DefaultColumnFormatter:Jn,FETCH_TIMEOUT:Zn,Formatter:ot,FormatterUtils:vt,IntegerColumnFormatter:be,LOGIN_OPTIONS_REQUEST:ss,NoConsolesError:hs,SESSION_DETAILS_REQUEST:is,StringColumnFormatter:Yn,TableColumnFormatter:G,TableUtils:b,createConnection:Ca,createCoreClient:Sa,createKeyFromOffsetRow:fs,createOnTableUpdatedHandler:gs,createSessionWrapper:ms,defaultRowDeserializer:bs,fetchVariableDefinition:ua,generateEmptyKeyedItems:Cs,getColumnFormats:es,getDateTimeFormatterOptions:ts,getItemsFromListData:Ia,getSessionDetails:ya,getSize:Kt,isBroadcastLoginMessage:ls,isBroadcastLogoutMessage:cs,isClosed:rt,isCustomColumnFormatDefined:ns,isMessage:at,isNoConsolesError:ps,isResponse:us,loadSessionWrapper:Ta,makeMessage:ds,makeResponse:ba,padFirstAndLastRow:Ss,requestParentResponse:Ut},Symbol.toStringTag,{value:"Module"}));function vs(i){if(i==null)return!1;const e=i;return e.Component!==void 0&&typeof e.isAvailable=="function"}const Ms="io.deephaven.auth.AnonymousAuthenticationHandler",wa="io.deephaven.authentication.psk.PskAuthenticationHandler";class Na extends Error{name="AuthenticationError";isAuthenticationError=!0}const ys=Na,gn=B.module("AuthPluginBase");function Wt({children:i,getLoginOptions:e}){const t=Be(),[n,s]=d.useState(),[o,a]=d.useState(!1);return d.useEffect(()=>{let r=!1;function l(){if(r)throw new bt("Login canceled.")}async function u(){try{const h=await e();l(),gn.info("Logging in..."),await t.login(h),l(),a(!0)}catch(h){if(!r){gn.error("Unable to login:",h);const p=qe(h)??"Unable to login. Verify credentials.";s(new ys(p)),a(!1)}}}return u(),()=>{r=!0}},[t,e]),o?c.jsx(c.Fragment,{children:i}):c.jsx(je,{"data-testid":"auth-base-loading",isLoading:n==null,isLoaded:!1,errorMessage:qe(n)})}const ka=d.createContext({}),qt=d.createContext({}),Oa={canLogout:!1};function Da({children:i}){const e=Ae(),t=d.useCallback(()=>({type:e.CoreClient.LOGIN_TYPE_ANONYMOUS}),[e]);return c.jsx(Wt,{getLoginOptions:t,children:c.jsx(qt.Provider,{value:Oa,children:i})})}const Aa={Component:Da,isAvailable:i=>i.includes(Ms)},Fa=Aa,Ra=B.module("AuthPluginParent"),Pa={canLogout:!1};function La(i){return i!=null&&typeof i.type=="string"}async function ja(){Ra.info("Logging in by delegating to parent window...");const i=await Ut(ss);if(!La(i))throw new Error(`Unexpected login options response: ${i}`);return i}function $a(){return new URLSearchParams(window.location.search).get("authProvider")??""}function Va({children:i}){return c.jsx(Wt,{getLoginOptions:ja,children:c.jsx(qt.Provider,{value:Pa,children:i})})}const Ba={Component:Va,isAvailable:()=>window.opener!=null&&$a()==="parent"},Ha=Ba,bn=B.module("useTableListener"),_a=(i,e,t)=>d.useEffect(function(){if(i==null){bn.debug2("Emitter undefined, skipping addEventListener",e);return}return bn.debug2("Adding listener",e),i.addEventListener(e,t)},[i,e,t]),ke=_a;class Ua extends Error{isColumnNameError=!0}const Ka=Ua;class Wa extends Error{isTableDisconnectError=!0}const qa=Wa,Ke=B.module("useTable"),Ga=(i,e,t,n)=>{const s=Ae(),[o,a]=d.useState(void 0),[r,l]=d.useState([]),[u,h]=d.useState(null),[p,m]=d.useState(null);d.useEffect(()=>{if(n===void 0){a(i?.columns),h(null);return}try{a(i?.findColumns(n)),h(null)}catch(C){Ke.error("Column not found",C,n),h(new Ka("Invalid columnNames argument"))}},[i,n]),d.useEffect(()=>{if(!o||!i){Ke.debug2("Table or column not initialized, skip viewport update.");return}Ke.debug2("Setting viewport",e,t),i.setViewport(e,t,o)},[o,i,e,t]);const f=d.useCallback(({detail:C})=>{if(!o){Ke.error("Columns not initialized.");return}const w=o.map(D=>C.rows.map(M=>M.get(D)));l(w)},[o]),v=d.useCallback(()=>{m(new qa("Table disconnected"))},[]),S=d.useCallback(()=>{m(null)},[]);return ke(i,s.Table.EVENT_UPDATED,f),ke(i,s.Table.EVENT_DISCONNECT,v),ke(i,s.Table.EVENT_RECONNECT,S),{columns:o,data:r,error:p??u}},Ts=Ga,za=(i,e,t,n)=>{const s=d.useMemo(()=>[n],[n]),{columns:o=[],data:a=[],error:r}=Ts(i,e,t,s);return{column:o[0],data:a[0],error:r}},Es=za;const de=B.module("TableInput"),mt=250;function Gt(i){const{className:e=void 0,columnName:t,settings:n,defaultValue:s=[],isInvalid:o=!1,onChange:a=()=>!1,onBlur:r=()=>!1,table:l}=i,u=d.useRef(null),h=d.useMemo(()=>{const R=vt.getColumnFormats(n),E=vt.getDateTimeFormatterOptions(n),{defaultDecimalFormatOptions:H={},defaultIntegerFormatOptions:ne={}}=n;return new ot(R,E,H,ne)},[n]),[p,m]=d.useState(""),[f,v]=d.useState(new Set(s)),[S,C]=d.useState(),w=d.useRef(null),D=Math.min(S?.size??0,mt),{column:M,data:F,error:P}=Es(S,0,mt-1,t),A=d.useCallback(R=>M?h.getFormattedString(R,M.type,M.name):`${R}`,[M,h]),[L,W]=d.useMemo(()=>{const R=new Set(f),E=[];if(F==null)return[E,null];if(F.forEach(H=>{const ne=`${H}`,se=f.has(ne);se&&R.delete(ne),E.push({value:ne,displayValue:A(H),isSelected:se})}),R.size>0){de.debug2("Selection has items that are missing from the viewport");const H=new Set(f);return Array.from(R).forEach(ne=>{H.delete(ne)}),[E,H]}return[E,null]},[F,f,A]);d.useEffect(()=>{W!==null&&(v(W),a(Array.from(W)))},[a,W]);const ae=d.useCallback(async R=>{try{const E=await R;de.debug("Table resolved",E),C(E)}catch(E){if(Le.isCanceled(E))return;de.error(E)}},[]);d.useEffect(()=>{const R=Le.makeCancelable(l);return ae(R),()=>{de.debug2("Cancel table promise"),R.cancel()}},[l,ae]);const $=d.useCallback(R=>{const{value:E}=R.target;m(E);const H=L.findIndex(ne=>ne.displayValue.includes(E));H>-1?(de.debug2(`Found ${E} at index ${H}`),w.current?.scrollIntoView(H)):de.debug2(`${E} not found`)},[L,w]),j=d.useCallback(R=>{if(de.debug("handleSelect",R),R>=L.length){de.error("Invalid index",R);return}const E=L[R].value,H=new Set(f);L[R].isSelected?H.delete(E):H.add(E),v(H),a(Array.from(H))},[a,L,f]),_=d.useCallback(()=>{const R=L.map(H=>H.value),E=new Set(R);v(E),a(R)},[L,a]),k=d.useCallback(()=>{v(new Set),a([])},[a]),O=d.useCallback(()=>{},[]),y=d.useCallback(R=>{const{relatedTarget:E}=R;de.debug("handleChildBlur",E,E instanceof HTMLElement,u.current,u.current?.contains(E)),(!E||u.current&&E instanceof HTMLElement&&!u.current.contains(E))&&r()},[r]),V=L.length===0;return c.jsxs("div",{ref:u,className:x("table-input-container d-flex flex-column position-relative",e),children:[c.jsx(nt,{disabled:!!P||V,value:p,placeholder:"Search",onChange:$,className:"mb-2 d-flex",onBlur:y}),c.jsx(qn,{className:"table-input-list",disabled:S===void 0||V,isInvalid:o,items:V?[{value:"Empty",isSelected:!1}]:L,itemCount:D,offset:0,onSelect:j,onViewportChange:O,ref:w,onBlur:y}),S&&c.jsxs("div",{className:"meta-row",children:[c.jsx("div",{className:"d-flex align-items-center text-muted small",children:S!=null&&S.size>D&&c.jsxs(c.Fragment,{children:["Table is too large, showing the first ",mt," items."]})}),c.jsxs("div",{children:[c.jsx("button",{type:"button",className:"btn btn-link",onBlur:y,onClick:_,children:"Select All"}),c.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:y,onClick:k,children:"Clear"})]})]}),S==null||P&&c.jsx("div",{className:"h-100 w-100 position-absolute",children:c.jsx(je,{isLoaded:S!=null,isLoading:S==null&&P==null,errorMessage:P?.message??null})})]})}Gt.displayName="TableInput";Gt.defaultProps={isInvalid:!1,className:void 0};const Cn=B.module("useBroadcastChannel");function Is(i=Si,e=os){const t=d.useMemo(()=>new BroadcastChannel(e),[e]);return d.useEffect(()=>()=>{t.close()},[t]),d.useEffect(()=>{function n(s){const{data:o}=s;if(!at(o)){Cn.debug("Ignoring non-deephaven message",o);return}Cn.debug("event received",o),i(s)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}},[t,i]),t}function zt(i,e){const t=d.useCallback(n=>{ls(n.data)?i?.(n.data):cs(n.data)&&e?.(n.data)},[i,e]);Is(t)}const Qe="io.deephaven.web.client.auth.refreshToken",xs=d.createContext(null),Za=B.module("RefreshTokenUtils");function Mt(){const i=Oe.get(Qe);try{if(i!=null)return JSON.parse(i)}catch(e){Za.error("Error parsing refresh token",i,e)}return null}function yt(i){if(i==null){Oe.remove(Qe);return}const e=JSON.stringify({bytes:i.bytes,expiry:i.expiry}),t=new Date(i.expiry);Oe.set(Qe,e,{secure:!0,sameSite:"strict",expires:t})}function Xa({children:i}){const e=Ae(),t=Be(),[n,s]=d.useState(Mt());d.useEffect(function(){return t.addEventListener(e.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,u=>{const{detail:h}=u;yt(h),s(h)})},[e,t,n]);const o=d.useCallback(()=>{s(Mt())},[]),a=d.useCallback(()=>{yt(null),s(null)},[]);return zt(o,a),c.jsx(xs.Provider,{value:n,children:i})}const Qa=200;function Ja(i,e,t=Qa){const n=d.useMemo(()=>Pe(s=>{if(i.table==null)return;const o=s.trim();if(o===""){i.applyFiltersAndRefresh([]);return}const a=i.table.findColumn(e),r=b.makeFilterValue(a.type,o),l=[a.filter().contains(r)];i.applyFiltersAndRefresh(l)},t),[e,t,i]);return d.useEffect(()=>()=>{n.cancel()},[n]),n}function Zt(i){const[,e]=d.useState(0);return ke(i,dh.Table.EVENT_SIZECHANGED,()=>{e(t=>t+1)}),Kt(i)}function ws(i){const e=Us({}),t=Ot(i),n=Math.max(0,Zt(i));return d.useEffect(()=>{let s=e.items.length;if(i!==t&&s&&(e.remove(...e.items.map(({key:o})=>o)),s=0),!!i){if(n>s)e.insert(s,...Cs(s,n-1));else if(n<s){const o=e.items.slice(n).map(({key:a})=>a);e.remove(...o)}}},[n,i]),e}function Ya(i,...e){const t=d.useCallback(async()=>i?.selectDistinct(i.findColumns(e))??null,[i,...e]),{data:n,error:s,isError:o,isLoading:a}=Dn(t,[]);return d.useEffect(()=>()=>{n?.close()},[n]),{distinctTable:n,error:s,isError:o,isLoading:a}}function Ns(i,e,t){return d.useCallback(function(s){const[o,a]=Ss(s,e,t,Kt(i));i?.setViewport(o,a)},[i,t,e])}function er(i){d.useEffect(()=>()=>{i!=null&&(rt(i)||i.close())},[i])}function tr({table:i,viewportSize:e=10,viewportPadding:t=50,deserializeRow:n=bs}){const s=ws(i),o=Ns(i,e,t),a=d.useCallback(l=>{i?.applyFilter(l),o(0)},[o,i]);ke(i,dh.Table.EVENT_UPDATED,gs(s,n));const r=Zt(i);return d.useEffect(()=>{i&&!rt(i)&&o(0)},[i,o,r]),{viewportData:s,size:r,table:i,applyFiltersAndRefresh:a,setViewport:o}}const nr=Object.freeze(Object.defineProperty({__proto__:null,REFRESH_TOKEN_KEY:Qe,RefreshTokenBootstrap:Xa,RefreshTokenContext:xs,TableInput:Gt,readRefreshToken:Mt,storeRefreshToken:yt,useBroadcastChannel:Is,useBroadcastLoginListener:zt,useDebouncedViewportSearch:Ja,useInitializeViewportData:ws,useSelectDistinctTable:Ya,useSetPaddedViewportCallback:Ns,useTable:Ts,useTableClose:er,useTableColumn:Es,useTableListener:ke,useTableSize:Zt,useViewportData:tr},Symbol.toStringTag,{value:"Module"}));function ks({children:i,errorMessage:e,isLoggingIn:t=!1,onSubmit:n}){return c.jsxs("form",{className:"login-form",onSubmit:s=>{s.preventDefault(),s.stopPropagation(),n?.(s)},children:[c.jsx("div",{className:"flex-spacer"}),c.jsxs("div",{className:"flex-wrapper",children:[c.jsx("fieldset",{disabled:t,className:"container-fluid",children:i}),c.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:c.jsxs("button",{type:"submit",className:x("btn btn-primary",{"btn-spinner":t},{"btn-cancelable":t}),"data-testid":"btn-login",children:[t&&c.jsxs("span",{children:[c.jsx(wt,{}),c.jsx("span",{className:"btn-normal-content",children:"Logging in"}),c.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Login"]})})]}),c.jsx("div",{className:"flex-spacer",children:e!=null&&c.jsx("p",{className:"error-message mb-0",role:"alert",children:`${e}`})})]})}function Os({children:i,logoPath:e="./logo.png"}){return c.jsxs("div",{className:"login-container",children:[c.jsx(Wn,{}),c.jsxs("div",{className:"login-box",children:[c.jsx("div",{className:"logo",children:c.jsx("img",{src:e,alt:"Deephaven Data Labs"})}),i,c.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}const Tt="io.deephaven.authentication.psk.PskAuthenticationHandler",Ds="psk",Et="io.deephaven.web.client.auth.psk.token",Ne=B.module("AuthPluginPsk");function sr(){return new URLSearchParams(window.location.search).get(Ds)}function ir(){Ne.debug2("clearWindowToken");const i=new URL(window.location.href);i.searchParams.delete(Ds),window.history.replaceState(null,"",i.href)}function Sn(){return Oe.get(Et)??null}function ft(i){Ne.debug2("Storing token in cookie",i),i!=null?Oe.set(Et,i,{secure:!0,sameSite:"strict"}):Oe.remove(Et)}function or({children:i,logoPath:e}){const t=Be(),n=d.useRef(null),s=d.useRef(null),[o,a]=d.useState(),[r,l]=d.useState(!1),[u,h]=d.useState(!1),[p,m]=d.useState(!1),[f,v]=d.useState(""),S=d.useCallback(async(F,P=!0)=>{Ne.info("Logging in..."),m(!0);let A=null;try{if(A=t.login({type:Tt,token:F}),s.current=A,await A,Ne.info("Logged in successfully"),s.current!==A)return;ft(F),h(!0)}catch(L){if(s.current!==A)return;if(l(!0),P){Ne.error("Unable to login",L);const W=qe(L)??"Unable to login: Verify credentials.";a(new ys(W))}}m(!1)},[t]),C=d.useCallback(()=>{s.current=null,m(!1)},[]),w=d.useCallback(async()=>{Ne.debug("onLogin");const F=Sn();u||p||F==null||S(F,!1)},[u,p,S]),D=d.useCallback(()=>{ft(null)},[]);zt(w,D),d.useEffect(()=>{let F=!1;async function P(){const A=sr()??Sn();if(ir(),A==null){l(!0);return}m(!0);try{await t.login({type:Tt,token:A}),F||(ft(A),h(!0),m(!1))}catch{F||(l(!0),m(!1))}}return P(),()=>{F=!0}},[t]);const M=d.useCallback(()=>{p?C():S(f)},[C,p,S,f]);return d.useEffect(function(){n.current?.focus()},[n,r]),c.jsxs(c.Fragment,{children:[u&&i,r&&c.jsx(Te,{in:!u,timeout:ce.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:c.jsx(Os,{logoPath:e,children:c.jsx(ks,{errorMessage:qe(o),isLoggingIn:p,onSubmit:M,children:c.jsxs("div",{className:"form-group",children:[c.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),c.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:n,value:f,onChange:F=>{a(void 0),v(F.target.value)}})]})})})}),c.jsx(je,{"data-testid":"auth-psk-loading",isLoaded:u||r,isLoading:!u&&!r})]})}const ar={Component:or,isAvailable:i=>i.includes(Tt)},rr=ar,lr=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:Ms,AUTH_HANDLER_TYPE_PSK:wa,AuthPluginAnonymous:Fa,AuthPluginBase:Wt,AuthPluginParent:Ha,AuthPluginPsk:rr,Login:Os,LoginForm:ks,UserOverrideContext:ka,UserPermissionsOverrideContext:qt,isAuthPlugin:vs},Symbol.toStringTag,{value:"Module"})),As={react:I,"react-dom":vn,redux:Ks,"react-redux":Ws,"@deephaven/auth-plugins":lr,"@deephaven/components":oa,"@deephaven/jsapi-bootstrap":la,"@deephaven/jsapi-components":nr,"@deephaven/jsapi-utils":xa,"@deephaven/log":di,"@deephaven/react-hooks":Oi},cr=yn.createRequires(()=>As),ur=yn.createRemoteComponent({requires:cr}),dr=ur,hr=qs.createRequires(As),pr=Gs({requires:hr}),mr=pr,Ce=B.module("@deephaven/app-utils.PluginUtils");function wr(i,e){const t=new URL(`${e}.js`,i),n=I.forwardRef((s,o)=>c.jsx(dr,{url:t.href,render:({err:a,Component:r})=>{if(a!=null&&a!==""){const l=`Error loading plugin ${e} from ${t} due to ${a}`;return Ce.error(l),c.jsx("div",{className:"error-message",children:`${l}`})}return c.jsx(r,{ref:o,...s})}}));return n.pluginName=e,n.displayName="Plugin",n}async function fr(i){return await mr(i)}async function gr(i){const e=await fetch(i);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch{throw new Error("Could not be parsed as JSON")}}async function br(i){Ce.debug("Loading plugins...");try{const e=await gr(`${i}/manifest.json`);if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");Ce.debug("Plugin manifest loaded:",e);const t=[];for(let o=0;o<e.plugins.length;o+=1){const{name:a,main:r}=e.plugins[o],l=`${i}/${a}/${r}`;t.push(fr(l))}const n=await Promise.allSettled(t),s=new Map;for(let o=0;o<n.length;o+=1){const a=n[o],{name:r}=e.plugins[o];a.status==="fulfilled"?s.set(r,a.value):Ce.error(`Unable to load plugin ${r}`,a.reason)}return Ce.info("Plugins loaded:",s),s}catch(e){return Ce.error("Unable to load plugins:",e),new Map}}function Cr(i){return i.get("AuthHandlers")?.split(",")??[]}function Nr(i,e,t){const n=Cr(e),s=[...i.entries()].filter(([,l])=>vs(l.AuthPlugin)).map(([l,u])=>[l,u.AuthPlugin]);s.push(...t??[]);const o=s.filter(([l,u])=>u.isAvailable(n,e));if(o.length===0)throw new Error(`No login plugins found, please register a login plugin for auth handlers: ${n}`);o.length>1&&Ce.warn("More than one login plugin available, will use the first one: ",o.map(([l])=>l).join(", "));const[a,r]=o[0];return Ce.info("Using LoginPlugin",a),r.Component}const Fs=d.createContext(null);function kr({pluginsUrl:i,children:e}){const[t,n]=d.useState(null);return d.useEffect(function(){let o=!1;async function a(){const r=await br(i);o||n(r)}return a(),()=>{o=!0}},[i]),c.jsx(Fs.Provider,{value:t,children:e})}const Sr=B.module("@deephaven/jsapi-components.ConnectionBootstrap"),Rs=d.createContext(null);function Or({children:i}){const e=Ae(),t=Be(),[n,s]=d.useState(),[o,a]=d.useState();return d.useEffect(function(){let l=!1;async function u(){try{const h=await t.getAsIdeConnection();if(l)return;a(h)}catch(h){if(l)return;s(h)}}return u(),()=>{l=!0}},[e,t]),d.useEffect(function(){if(o==null)return;function l(h){const{detail:p}=h;Sr.info("Shutdown",`${JSON.stringify(p)}`),s(`Server shutdown: ${p??"Unknown reason"}`)}return o.addEventListener(e.IdeConnection.EVENT_SHUTDOWN,l)},[e,o]),o==null||n!=null?c.jsx(je,{"data-testid":"connection-bootstrap-loading",isLoading:o==null,errorMessage:n!=null?`${n}`:void 0}):c.jsx(Rs.Provider,{value:o,children:i})}function Dr(){return Ve(Fs,"No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?")}function Ar(){return Ve(Rs,"No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?")}export{le as $,Eo as A,te as B,Bi as C,$n as D,yr as E,vt as F,_o as G,xo as H,oe as I,De as J,Z as K,Mo as L,Y as M,qi as N,fn as O,Le as P,ro as Q,Io as R,Me as S,Fe as T,Un as U,To as V,yo as W,kn as X,Fi as Y,Uo as Z,Ri as _,Ti as a,Rt as a0,Fn as a1,fo as a2,Ui as a3,Ki as a4,K as a5,os as a6,ds as a7,rs as a8,Di as a9,br as aA,Cr as aB,Ai as aa,Be as ab,Ar as ac,Dr as ad,ka as ae,qt as af,ya as ag,Ta as ah,Is as ai,as as aj,Fs as ak,Nr as al,qe as am,rr as an,Ha as ao,Fa as ap,zt as aq,kr as ar,ra as as,Xa as at,Or as au,Rs as av,dr as aw,wr as ax,fr as ay,gr as az,Ii as b,ze as c,nt as d,bt as e,Nt as f,Mi as g,T as h,b as i,q as j,ot as k,Er as l,Tr as m,U as n,G as o,he as p,Q as q,be as r,N as s,Gi as t,Ot as u,qn as v,xr as w,Co as x,bo as y,Lo as z};
|
|
5
|
+
//# sourceMappingURL=useConnection-2334ddd0.js.map
|