@deephaven/embed-grid 0.15.6-vite.19 → 0.15.6-vite.21
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/{index.acd0ae2d.js → index.d615cb98.js} +1 -1
- package/build/assets/{monaco.e1c87eac.js → monaco.3eae455a.js} +1 -1
- package/build/assets/monaco.96171034.css +1 -0
- package/build/assets/vendor.c53844f2.css +1 -0
- package/build/assets/{vendor.a51ebb91.js → vendor.fafb26fa.js} +1 -1
- package/build/index.html +8 -8
- package/package.json +16 -16
- package/build/assets/monaco.17b1baf0.css +0 -1
- package/build/assets/vendor.6885683a.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as M,r as R,R as Q,P as Da,j as u,C as tt,c as W,a as v,b as Io,m as pe,l as wt,F as G,d as Ie,s as zt,A as Fa,e as xa,f as Fi,g as Ps,h as Oa,E as Mo,$ as ll,D as _s,i as nt,k as Co,n as xe,W as pr,o as sn,q as ka,t as bo,u as Hs}from"./vendor.a51ebb91.js";import{e as ln,W as Aa,l as as,K as un,b as gr,d as Vt,f as wi}from"./monaco.e1c87eac.js";import"ext/window-this";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const La="#1a171a",Ha="#f0f0ee",Pa="#fcd65b",_a="#9edc6f",Va="#76d9e4",Ua="#aa9af4",Ba="#f37e3f",Wa="#f95d84",za="#4878ea",$a="#5b5a5c",Ga="#9edc6f",qa="#fcd65b",Ka="#f37e3f",Ya="#f95d84",Xa="#fcfcfa",Qa="#929192",ja="#373438",Za="#f0f0ee",Ja="#1a171a",ec="#2d2a2e",tc="#1a171a",nc="#f0f0ee",sc="0.15s",ic={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:La,white:Ha,yellow:Pa,green:_a,blue:Va,purple:Ua,orange:Ba,red:Wa,primary:za,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:$a,success:Ga,info:qa,warning:Ka,danger:Ya,light:Xa,mid:Qa,dark:ja,"text-muted":"#929192",interfacewhite:Za,interfaceblack:Ja,interfacegray:ec,"content-bg":"#2d2a2e",background:tc,foreground:nc,transition:sc},bt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...ic});class dn extends R.exports.Component{constructor(t){super(t),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=Q.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Da(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(tt,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:W("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:v("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Io.createPortal(this.renderContent(),this.element)})}}dn.propTypes={children:M.exports.node.isRequired,options:M.exports.shape({}),className:M.exports.string,timeout:M.exports.number,onEntered:M.exports.func,onExited:M.exports.func,isShown:M.exports.bool,closeOnBlur:M.exports.bool,interactive:M.exports.bool,referenceObject:M.exports.shape({}),"data-testid":M.exports.string};dn.defaultProps={options:{},className:"",timeout:bt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const oc=-1,al=0,cl=1,No=2,dl=3,hl=4;Object.freeze({SILENT:oc,ERROR:al,WARN:cl,INFO:No,DEBUG:dl,DEBUG2:hl});const yt=()=>{};class fr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=yt,this.warn=yt,this.log=yt,this.info=yt,this.debug=yt,this.debug2=yt,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=al?console.error.bind(console,this.prefix):yt,this.warn=t>=cl?console.warn.bind(console,this.prefix):yt,this.log=t>=No?console.log.bind(console,this.prefix):yt,this.info=this.log,this.debug=t>=dl?console.debug.bind(console,this.prefix):yt,this.debug2=t>=hl?console.debug.bind(console,this.prefix):yt}}class rc extends fr{constructor(t=No){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new fr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const ee=new rc,lc=ee.module("Tooltip"),ht=class extends R.exports.Component{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=Q.createRef(),this.popper=Q.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){ht.shownTooltipCount-=1,ht.shownTooltipCount===0&&(ht.lastHiddenTime=Date.now())}static handleShown(){ht.shownTooltipCount+=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?ht.handleShown():ht.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&ht.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){lc.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 i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(ht.shownTooltipCount>0||Date.now()-ht.lastHiddenTime<ht.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o}=this.props,{isShown:r}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(dn,{className:W(i),options:n,ref:this.popper,onExited:this.handleExited,interactive:e,referenceObject:s,children:v("div",{className:"tooltip-content",children:[" ",r&&t]})})})}};let he=ht;he.defaultTimeout=500;he.defaultReshowTimeout=100;he.triggerReshowThreshold=300;he.shownTooltipCount=0;he.lastHiddenTime=Date.now();he.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:ht.defaultReshowTimeout,timeout:ht.defaultTimeout,onExited:()=>{},"data-testid":void 0};const ac=100;var ul=(e=>(e.UP="UP",e.DOWN="DOWN",e))(ul||{});const Bn=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=pe((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=wt(this.updateInputValue,ac),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(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){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Bn.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===Bn.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===Bn.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){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:W("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?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:W("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:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return v("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:W("form-control",s,"aci-input",{"is-invalid":d&&!a}),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:o,"data-testid":r}),u(dn,{ref:this.popper,options:c,className:W("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let Do=Bn;Do.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({}),onChange:M.exports.func,inputPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultTitle:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,noMatchText:M.exports.string,"data-testid":M.exports.string};Do.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};Do.MENU_NAVIGATION_DIRECTION=ul;M.exports.string.isRequired,M.exports.func.isRequired,M.exports.string,M.exports.string,M.exports.bool,M.exports.bool,M.exports.string,M.exports.string,M.exports.string;M.exports.node.isRequired,M.exports.string,M.exports.object,M.exports.string;const cc=["primary","secondary","tertiary","success","danger","inline","ghost"],dc=["group-end"];function hc(e,t){switch(e){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 W("btn-link",{"btn-link-icon":t,"px-2":t})}}function uc(e){switch(e){case"group-end":return W("pl-2","pr-3")}}const Re=Q.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p}=e,f=hc(n,r&&!m);let b;s&&(b=uc(s));let C;r&&(C=Q.isValidElement(r)?r:u(G,{icon:r}));let w;o&&(w=typeof o=="string"?u(he,{children:o}):o);const T=v("button",{"data-testid":p,ref:t,type:i,className:W("btn",f,b,{active:a},d),onClick:c,style:h,disabled:l,children:[r&&C,m,o&&!l&&w]});return l?v("span",{className:"btn-disabled-wrapper",children:[T,o&&w]}):T});Re.displayName="Button";Re.propTypes={kind:M.exports.oneOf(cc).isRequired,variant:M.exports.oneOf(dc),type:M.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Q.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.exports.bool,active:M.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:M.exports.node,className:M.exports.string,style:M.exports.object,"data-testid":M.exports.string};Re.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const mc=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=R.exports.useRef(),m=R.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);R.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),R.exports.useEffect(function(){i&&l&&l()},[l,i]),R.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Io.createPortal(v(Ie,{children:[u(tt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:bt.transitionMs,onExited:p,children:u("div",{className:W("modal-backdrop fade"),style:{zIndex:1050}})}),u(tt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:bt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:W(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Ie,{})},pc=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),gc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>v("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});M.exports.bool.isRequired,M.exports.string.isRequired,M.exports.oneOfType([M.exports.string,M.exports.func]).isRequired,M.exports.func,M.exports.func.isRequired,M.exports.func,M.exports.func,M.exports.string,M.exports.string,M.exports.string,M.exports.node,M.exports.string;const xi=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:W("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});xi.displayName="Button";xi.propTypes={children:M.exports.node,className:M.exports.string,disabled:M.exports.bool,onClick:M.exports.func,style:M.exports.shape({}),id:M.exports.string};xi.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function to(e){return e.then!==void 0}const Sn=class{static disableAllActions(){Sn.actionsDisabled=!0}static enableAllActions(){Sn.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||!Array.isArray(e))return[];const t=e.slice();return t.sort(Sn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Sn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Sn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Sn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Sn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let we=Sn;we.actionsDisabled=!1;const Cr=ee.module("GlobalContextAction");class fc extends R.exports.Component{constructor(t){super(t),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(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),Cr.debug("Received context menu event at window action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!we.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){Cr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Cc extends R.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(fc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const ri=ee.module("ContextActions");class ne extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Q.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!to(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!to(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){ri.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(we.isContextActionEvent(t)||(t.contextActions=[]),!we.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>to(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}ri.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!we.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){ri.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}ri.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Cc,{actions:n})})}}ne.groups={default:null,high:100,medium:5e3,low:1e4,window:1e5,edit:100};var bc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},Qn={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},wc={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Sc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},ml={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},vc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},Fo={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Tc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},br={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},Oi={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Ec={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},pl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},gl={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},wr={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},Rc={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},yc={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},Si={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},Ic={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},fl={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},ki={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},Mc={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},Nc={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},Dc={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},Cl={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},Fc={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},xc={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},Oc={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},kc={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},Ac={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},bl={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},wl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},Lc={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},Hc={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},Xt={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},Pc={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},_c={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},Sl={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},Vc={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},Uc={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},Sr={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},Bc={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Mn={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Tn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},vl={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},Zn={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},Wc={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},zc={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},$c={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},Gc={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},vr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},wo={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},qc={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Kc={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},Yc={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},xo={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},Xc={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},no={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Qc={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},gs={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},jc={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Zc={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},Jc={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Oo={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},ko={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Tr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},ed={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},td={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Ao={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Er={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Lo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},nd={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},sd={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},id={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},Rr={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},od={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const Ai=Q.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:T}=e;T(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:T}=e;T(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:T}=e;T(w,C)}function o(C,w,T){if(typeof C.type=="string")return C;const{closeMenu:y,menuItem:S,isKeyboardSelected:E,isMouseSelected:I,"data-testid":D}=e,k={menuItem:S,closeMenu:y,isKeyboardSelected:E,isMouseSelected:I,iconElement:w,displayShortcut:T,"data-testid":D};return Q.cloneElement(C,{forwardedProps:k})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Q.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(G,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(G,{icon:ml}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:W("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:v("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:W("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:W("submenu-indicator",{disabled:C}),children:p})]})})}return v("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});Ai.displayName="ContextMenuItem";Ai.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class hs extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Ho{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Ho.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const rd="table_",Tl="column_",ld=new Set(["in","not","i","ii","k"]),ad=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),cd=/[^a-zA-Z0-9_$+@-]/g,dd=/[^A-Za-z0-9_$]/g,fs=class{};let Nn=fs;Nn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(ld.has(o)||ad.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Nn.legalizeTableName=e=>fs.legalize(e,rd,cd,!1,0);Nn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=fs.legalizeColumnName(n,s);t.includes(i)&&(i=Tl+s),t.push(i)}),t};Nn.legalizeColumnName=(e,t=0)=>fs.legalize(e,Tl,dd,!0,t);Nn.isValidTableName=e=>fs.legalizeTableName(e)===e;Nn.isValidColumnName=e=>fs.legalizeColumnName(e)===e;function hd(e,t){return e?e.closest(`.${t}`):null}const ud={getClosestByClassName:hd};class ve extends CustomEvent{constructor(t,n){super(t,n)}}class El extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class Le{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new hs)):(i=a,r(a))},a=>l(s?new hs:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof hs}static isTimedOut(t){return t instanceof El}}class Li{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=Le.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class _t{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!_t.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class Po{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const Rl=class{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"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(Rl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||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])}};let Bt=Rl;Bt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Bt.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\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",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\u22125",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"}]);class md extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Ft=({className:e="","data-testid":t})=>v("div",{className:W("loading-spinner fa-layers",e),"data-testid":t,children:[u(G,{icon:Tc,className:"text-white-50"}),u(G,{icon:xc,className:"text-primary",spin:!0})]}),yr=ee.module("ContextMenu"),So=class extends R.exports.PureComponent{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=Q.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Q.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}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;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=we.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:we.sortActions(i)})}initMenuPromise(e){const t=Le.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:we.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{Le.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),yr.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(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){yr.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,i=!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?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=we.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=we.getNextMenuItem(s,1,t)),i){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&&(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&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const T=u(Ai,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(T)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Ft,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return v(Ie,{children:[v("div",{className:W({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:So.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(So,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let yl=So;yl.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class pd extends R.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Q.createRef(),this.openMenu=Q.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!we.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=we.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u(yl,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:W("context-menu-root",{active:s}),ref:this.container,children:t})}}const Wn=class extends R.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Wn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Wn.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){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(tt,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Wn.handleEnter,onEntering:Wn.handleEntering,onEntered:this.handleEntered,onExit:Wn.handleExit,onExiting:Wn.handleExiting,timeout:350,children:i=>u("div",{className:W({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let Il=Wn;Il.propTypes={className:M.exports.string,in:M.exports.bool.isRequired,children:M.exports.node.isRequired,autoFocusOnShow:M.exports.bool,"data-testid":M.exports.string};Il.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function _o(e){const t=R.exports.useRef();return R.exports.useEffect(function(){t.current=e}),t.current}function Ml(e){const t=R.exports.useRef(null);return R.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const St=Q.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,onChange:c,"data-testid":d}=e,[h]=R.exports.useState(zt()),m=Ml(t);R.exports.useEffect(function(){m.current&&(m.current.indeterminate=n===null)},[m,n]);const p=R.exports.useCallback(g=>{m.current&&(m.current.indeterminate=n===null),c&&c(g)},[m,n,c]);return v("div",{className:W("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:m,checked:n!=null?n:!1,className:W("custom-control-input",r,{"is-invalid":l}),disabled:o,id:h,onChange:p,"data-testid":d}),u("label",{className:W("custom-control-label",a),htmlFor:h,children:s})]})});St.displayName="Checkbox";St.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:M.exports.node.isRequired,className:M.exports.string,disabled:M.exports.bool,inputClassName:M.exports.string,isInvalid:M.exports.bool,labelClassName:M.exports.string,onChange:M.exports.func,"data-testid":M.exports.string};St.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",onChange:void 0,"data-testid":void 0};class Dn extends R.exports.PureComponent{constructor(t){super(t),this.inputField=Q.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onChange:s,className:i,matchCount:o,id:r,onKeyDown:l,"data-testid":a}=this.props;return v("div",{className:W("search-group",i),children:[u("input",{type:"search",value:t,onChange:s,onKeyDown:l,className:"form-control",placeholder:n,ref:this.inputField,id:r,"data-testid":a}),o!=null&&u("span",{className:"search-match",children:o}),u("span",{className:"search-icon",children:u(G,{icon:Sl})})]})}}Dn.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var Nl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Nl||{});const xs=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=pe((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.toggleButton=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef(),this.searchInput=Q.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(xs.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(xs.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===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case xs.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case xs.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){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return v("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(Dn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("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((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:W("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},v("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:W("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:v("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(G,{icon:Tn}),u(dn,{ref:this.popper,options:a,className:W("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Cs=xs;Cs.MENU_NAVIGATION_DIRECTION=Nl;Cs.DROP_DOWN_MENU_HEIGHT=200;Cs.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired}),onChange:M.exports.func,inputPlaceholder:M.exports.string,searchPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultValue:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,"data-testid":M.exports.string};Cs.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const It=ee.module("MaskedInput"),ys={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},so="\u2007";function Vo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}const Dl=Q.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(H,A,N)=>N,getPreferredReplacementString:o=Vo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,selection:c,value:d,onFocus:h=()=>!1,onBlur:m=()=>!1,"data-testid":p}=e,g=Ml(t),f=R.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]);R.exports.useEffect(function(){var A;if(c!=null){It.debug("setting selection...",c);const{selectionStart:N,selectionEnd:B,selectionDirection:U}=c;(A=g.current)==null||A.setSelectionRange(N,B,U),It.debug("selection set!")}},[c,g]);function b(H){let A=H,N=H;const B=f.length>0?f[0]:d;for(let L=A-1;L>=0&&/[a-zA-Z0-9]/g.test(B.charAt(L));L-=1)A=L;for(let L=N;L<B.length&&/[a-zA-Z0-9]/g.test(B.charAt(L));L+=1)N=L+1;const U=A===N?ys.NONE:ys.BACKWARD;return{selectionStart:A,selectionEnd:N,selectionDirection:U}}function C(H,A,N=H.length){let B="";for(let U=0;U<N;U+=1)H.charAt(U)!==so?B=B.concat(H[U]):B=B.concat(A[U]);return B=B.concat(A.substring(N)),B}function w(H,A=H.length){const N=new RegExp(a);if(N.test(H))return!0;for(let B=0;B<f.length;B+=1){const U=C(H,f[B],A);if(N.test(U))return!0}return!1}function T(H){const A=b(H),N=A.selectionEnd+1;return N>=d.length?A:b(N)}function y(H){const A=b(H),N=A.selectionStart-1;return N<=0?A:b(N)}function S(H,A){const N=b(H),B=d.substring(N.selectionStart,N.selectionEnd),U=i(N,A,B,d),L=d.substring(0,N.selectionStart)+U+d.substring(N.selectionEnd);w(L,N.selectionEnd)&&(r(L),l(N))}function E(H){const{selectionStart:A=0,selectionEnd:N=0,selectionDirection:B="none"}=H.target;if(A===null||N===null||B===null){It.error("Selection attempted on non-text input element",H.target);return}if(It.debug2("handleSelect",A,N,B),!(c!=null&&A===c.selectionStart&&N===c.selectionEnd))if(A===N){const U=b(A);It.debug("Selection segment from ",A,N,"=>",U),l(U)}else l({selectionStart:A,selectionEnd:N,selectionDirection:B})}function I(H){if(!g.current)return;It.debug("handleSelectCapture",H);const A=g.current.selectionStart||0;A===d.length&&c!=null&&A!==c.selectionStart&&(H.preventDefault(),H.stopPropagation())}function D(H){if(H.preventDefault(),H.stopPropagation(),!g.current)return;const{key:A}=H,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){It.error("Selection arrow nvaigation attempted on non-text input element",H.target);return}A==="ArrowLeft"?l(y(N)):A==="ArrowRight"?l(T(B)):A==="ArrowUp"?S(N,-1):A==="ArrowDown"&&S(N,1)}function k(H){if(!g.current)return;It.debug("handleKeyDown",H);const{key:A}=H,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){It.error("Selection key event on non-text input element",H.target);return}if(A.startsWith("Arrow")){D(H);return}if(A==="Delete"||A==="Backspace"){if(H.preventDefault(),H.stopPropagation(),N!==B){const L=d.substring(0,N)+d.substring(N,B).replace(/[a-zA-Z0-9]/g,so)+d.substring(B);It.debug("Range ",N,B,"deleted, setting value",L),r(L),l({selectionStart:N,selectionEnd:N,selectionDirection:ys.NONE})}else if(N>0)for(let L=N-1;L>=0;L-=1){const _=d.substring(0,L)+d.substring(L,N).replace(/[a-zA-Z0-9]/g,so)+d.substring(N);if(_!==d){r(_),l({selectionStart:L,selectionEnd:L,selectionDirection:ys.NONE});return}}return}if(H.altKey||H.metaKey||H.ctrlKey||A.length>1)return;H.preventDefault(),H.stopPropagation();const U=Array.from(new Set([A,A.toUpperCase(),A.toLowerCase()]));for(let L=0;L<U.length;L+=1){const _=U[L],$=/[a-zA-Z0-9]/g.test(_)?d.length-1:N;for(let K=N;K<=$;K+=1){const j=o(d,K,_,N,B);if(w(j,K+1)){const oe=b(K),te=K+1;let me={selectionStart:te,selectionEnd:te,selectionDirection:ys.NONE};if(te>=oe.selectionEnd){const ae=T(K);ae.selectionStart!==oe.selectionStart&&(me=ae)}It.debug("handleKeyDown",A,"=>",j,me),r(j),l(me);return}}}}return u("input",{ref:g,className:W("form-control masked-input",n),type:"text",pattern:a,value:d,onChange:()=>{},onKeyDown:k,onSelect:E,onSelectCapture:I,onFocus:h,onBlur:m,"data-testid":p})});Dl.defaultProps={className:"",onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Vo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const gd=ee.module("TimeInput"),fd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Cd=["00:00:00","12:34:56","23:59:59"],Fl=Q.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,"data-testid":a}=e,[c,d]=R.exports.useState(Bt.formatTime(o)),[h,m]=R.exports.useState();R.exports.useEffect(function(){d(Bt.formatTime(o))},[o]);function p(C,w,T){const y=C.selectionStart===0?24:60;let S=parseInt(T,10)-w;return Number.isNaN(S)?S=0:n?S=(S%y+y)%y:S=Math.min(Math.max(0,S),y-1),`${S}`.padStart(2,"0")}function g(C,w,T,y,S){return y===0&&S===2&&w===1&&parseInt(T,10)>1?`0${T}${C.substring(2)}`:Vo(C,w,T)}function f(C){gd.debug("handleChange",C),d(C),Bt.isTimeString(C)&&i(Bt.parseTime(C))}function b(C){m(C)}return u(Dl,{ref:t,className:s,example:Cd,getNextSegmentValue:p,getPreferredReplacementString:g,onChange:f,onSelect:b,pattern:fd,selection:h,value:c,onFocus:r,onBlur:l,"data-testid":a})});Fl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class xl extends R.exports.PureComponent{constructor(t){var i;super(t),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=Q.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=we.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:we.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=we.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=we.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(Ai,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}xl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class yn extends R.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Q.createRef(),this.parent=null,this.popper=Q.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(dn,{ref:this.popper,options:l,className:W("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(xl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}yn.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Ir=-1;var Ol=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ol||{});const Zt=class extends R.exports.Component{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=Q.createRef(),this.menuContainer=Q.createRef(),this.button=Q.createRef(),this.input=Q.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Bt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;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(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Zt.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,i=s.length;let o=t;switch(e){case Zt.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case Zt.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Ir){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>Zt.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-Zt.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(v("button",{type:"button",value:c,className:W("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(G,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(v("button",{type:"button",value:Ir,className:W("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(G,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(v("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Fl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:W("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:v("button",{type:"button",className:W("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:W({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(G,{icon:Ao,className:"cs-caret"})}),u(yn,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Uo=Zt;Uo.MENU_NAVIGATION_DIRECTION=Ol;Uo.DROP_DOWN_MENU_HEIGHT=125;Uo.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:Qn,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};class bd extends R.exports.PureComponent{constructor(t){super(t),this.searchInput=Q.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=wt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(Dn,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}bd.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const wd=({className:e="",show:t=!0,"data-testid":n})=>v("div",{className:W("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const Sd=ee.module("ItemListItem"),kl=class extends R.exports.Component{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=Q.createRef()}static handleKeyDown(){return Sd.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:W("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:kl.handleKeyDown,onContextMenu: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:"presentation",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let Al=kl;Al.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Mr=ee.module("ItemList"),us=class extends R.exports.PureComponent{constructor(e){super(e),this.getItemSelected=pe((s,i)=>_t.isSelected(i,s),{max:us.CACHE_SIZE}),this.getCachedItem=pe((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(Al,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:us.CACHE_SIZE}),this.getOuterElement=pe(s=>{const i=Q.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=pe(()=>{const s=Q.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=pe((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),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=Q.createRef(),this.listContainer=Q.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}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=_t.isSelected(n,e)||we.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:_t.selectRange(i,[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}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Mr.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){Mr.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:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!we.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,we.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=we.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),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:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?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){_t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:_t.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){_t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:_t.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,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}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:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(Fa,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(xa,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,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":o,children:this.renderInnerElement})})}};let $t=us;$t.CACHE_SIZE=1e3;$t.DEFAULT_ROW_HEIGHT=20;$t.DEFAULT_OVERSCAN=10;$t.defaultProps={offset:0,items:[],rowHeight:us.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:us.DEFAULT_OVERSCAN,renderItem:us.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const Yn=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=pe((t,n,s,i,o,r,l,a)=>u(Fi,{draggableId:Yn.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:$t.CACHE_SIZE}),this.getCachedRenderDraggableItem=pe((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=pe((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:W("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:W("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Q.createRef(),this.state={selectedCount:0}}static renderHandle(){return v("div",{children:[u(he,{children:"Drag to re-order"}),u(G,{icon:ki})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return v("div",{className:W("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),Yn.renderBadge({text:t}),Yn.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return Yn.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:_t.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":T}=this.props;return u(Ps,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":T,children:(y,S)=>u("div",{role:"menu",className:W("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":S.draggingFromThisWith,"is-dragging-over":S.isDraggingOver,"is-dropping":S.draggingOverWith}),style:w,ref:y.innerRef,...y.droppableProps,children:u($t,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let ut=Yn;ut.DEFAULT_ROW_HEIGHT=30;ut.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Yn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Yn.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class ot{static reorder(t,n,s,i){const o=t===s?ot.adjustDestinationIndex(i,n):i,r=ot.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return Oa(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const fi=class extends R.exports.Component{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),i=Array.from(n.values()).includes(!1);return s&&i?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,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!fi.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(fi.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return v("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>v("div",{children:[u(St,{className:"hcm-parent",checked:fi.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(St,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return v("button",{type:"button",className:W("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[v("span",{children:[n&&u(G,{icon:n,className:"hcm-icon mr-1"}),e]}),u(G,{icon:Ao,className:"hcm-icon ml-1"}),u(dn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let vd=fi;vd.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const Ll=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(tt,{in:!!n||!e||t,timeout:bt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:W("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:v("div",{className:"message-content",children:[v("div",{className:"message-icon",children:[t&&u(Ft,{}),!t&&n&&u(G,{icon:Zn})]}),u("div",{className:"message-text",children:n})]})})})});const Hl=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:W("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function Nr(e){return e.isOn!==void 0}const Td=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=R.exports.useMemo(()=>Nr(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return v("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(G,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:Nr(e)&&u(Hl,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(G,{icon:ml})})]})};const Pl=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(Td,{item:s,onSelect:()=>{t(i)}})},s.title))})});const Dr=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>v("div",{className:"navigation-page","data-testid":i,children:[v("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&v("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(G,{icon:Sc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(G,{icon:Oi})})})]}),u("div",{className:"navigation-content",children:e})]});const Ed=({children:e,"data-testid":t})=>{const n=R.exports.useMemo(()=>Q.Children.toArray(e),[e]),s=_o(n),[i,o]=R.exports.useState(n[n.length-1]),[r,l]=R.exports.useState(null),[a,c]=R.exports.useState(null);R.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=R.exports.useCallback(()=>{o(r),l(null)},[r]),h=R.exports.useCallback(()=>{c(null)},[]);return v("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(tt,{in:a!=null,timeout:bt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Ie,{children:a&&u("div",{className:"popping-view",children:a})})}),u(tt,{in:r!=null,timeout:bt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Ie,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},Rd=({children:e,value:t,"data-testid":n})=>u("option",{value:t,"data-testid":n,children:e}),Bo=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=R.exports.useState(s||zt());return u(Ie,{children:Q.Children.map(t,a=>a?Q.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},an=Q.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=R.exports.useState(zt());return v("div",{className:W("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:W("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:W("custom-control-label",a),htmlFor:p,children:s})]})});an.displayName="RadioItem";an.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const yd=({children:e,onChange:t,className:n,defaultValue:s,value:i,disabled:o,"data-testid":r})=>{const l=R.exports.useCallback(a=>{t(a.target.value)},[t]);return u("select",{className:W("custom-select",n),onChange:l,defaultValue:s,value:i,disabled:o,"data-testid":r,children:e})};class _l extends R.exports.PureComponent{constructor(t){super(t),this.getCachedItem=pe((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,children:u(St,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=pe((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Q.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}render(){const{disabled:t,items:n,itemCount:s,offset:i,rowHeight:o,"data-testid":r}=this.props,l=this.getCachedItems(n,o,i,t);return u("div",{className:"select-value-list-scroll-pane h-100 w-100",onScroll:this.handleScroll,ref:this.list,"data-testid":r,children:u("div",{className:"select-value-list",style:{height:s*o},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:n.length*o,top:i*o,left:0},children:l})})})}}_l.defaultProps={disabled:!1,rowHeight:21,"data-testid":void 0};const Fr=ee.module("Shortcut");var se=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(se||{}),le=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(le||{});const Id=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),$e=class extends Mo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=$e.isMacPlatform?n:t;this.defaultKeyState=$e.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(le).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!$e.isMacPlatform&&e.metaKey||!$e.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Id.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!$e.isAllowedKey(t)&&$e.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+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":$e.isMacPlatform?$e.getMacDisplayText(e):$e.getWindowsDisplayText(e)}getDisplayText(){return $e.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){$e.isValidKeyState(e)?(Fr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new ve("onUpdate",{detail:this}))):Fr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return $e.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState($e.NULL_KEY_STATE)}isNull(){return $e.doKeyStatesMatch(this.keyState,$e.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return $e.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState($e.getKeyStateFromEvent(e))}};let Wo=$e;Wo.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};Wo.isMacPlatform=we.isMacPlatform();const xr=ee.module("ShortcutRegistry");class Md extends Mo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new Wo(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return xr.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;xr.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new ve("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const ye=Object.freeze(new Md),zo={COPY:ye.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[se.CTRL,le.C],macShortcut:[se.CMD,le.C],isEditable:!1}),PASTE:ye.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[se.CTRL,le.V],macShortcut:[se.CMD,le.V],isEditable:!1}),SAVE:ye.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[se.CTRL,le.S],macShortcut:[se.CMD,le.S],isEditable:!1}),SELECT_ALL:ye.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[se.CTRL,le.A],macShortcut:[se.CMD,le.A],isEditable:!1}),LINKER:ye.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[se.CTRL,le.L],macShortcut:[se.CMD,le.L]}),LINKER_CLOSE:ye.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[le.ESCAPE],macShortcut:[le.ESCAPE],isEditable:!1})};const Vl=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return v("button",{ref:t,type:"button",className:W("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(G,{icon:Cl,className:"linked btn-socketed-icon",transform:"down-1"}),u(G,{icon:Gc,className:"is-invalid btn-socketed-icon"})]})});Vl.displayName="SocketedButton";Vl.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Nd="_track_xvu02_28",Dd="_handle_xvu02_11",Fd="_ticks_xvu02_96",Ul={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Nd,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:Dd,ticks:Fd,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(Ul["handle-size"],10);parseInt(Ul["popover-width"],10);Object.freeze({ERROR:"error"});window.$=ll;window.jQuery=ll;var Jn=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(Jn||{});Object.freeze([[Jn.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[Jn.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var be=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(be||{});class Oe{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}Oe.TYPE_GLOBAL="type-window";Oe.TYPE_CONTEXT_PRESET="type-context-preset";Oe.TYPE_CONTEXT_CUSTOM="type-context-custom";class xd extends Oe{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class Od extends Oe{format(t){return String.fromCharCode(t)}}const{dh:P}=globalThis,Hi=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Bl=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),kd=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:Hi.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Ad=M.exports.shape({columns:M.exports.arrayOf(Hi).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Bl),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),Ld=M.exports.shape({columns:M.exports.arrayOf(Hi),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Ci=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Hd=M.exports.shape({created:M.exports.arrayOf(Ci).isRequired,updated:M.exports.arrayOf(Ci).isRequired,removed:M.exports.arrayOf(Ci).isRequired}),Pd=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),_d=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:Hi,FilterCondition:Bl,IdeSession:_d,RollupConfig:Pd,Sort:kd,Table:Ad,TreeTable:Ld,VariableChanges:Hd,VariableDefinition:Ci});const Or=ee.module("DateTimeColumnFormatter"),zn=class extends Oe{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=zn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||zn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=P.i18n.TimeZone.getTimeZone(i)}catch{Or.error("Unsupported time zone id",i),this.dhTimeZone=P.i18n.TimeZone.getTimeZone(zn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=zn.makeFormatStringMap(t,n)}static isValid(e){try{return P.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=Oe.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 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[...zn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=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[...zn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return P.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Or.error("Invalid format arguments")}return""}};let In=zn;In.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";In.DEFAULT_TIME_ZONE_ID="America/New_York";const Vd=ee.module("DecimalColumnFormatter"),Wt=class extends Oe{constructor({defaultFormatString:e=Wt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return P.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=Oe.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Wt.makeFormat(e,t,Oe.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Wt.makeFormat("Custom Format",e,Oe.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}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return P.i18n.NumberFormat.format(n,s)}catch{Vd.error("Invalid format arguments")}return""}};let Be=Wt;Be.DEFAULT_FORMAT_STRING="###,##0.0000";Be.FORMAT_PERCENT=Wt.makePresetFormat("Percent","##0.00%");Be.FORMAT_BASIS_POINTS=Wt.makePresetFormat("Basis Points","###,##0 bp",1e4);Be.FORMAT_MILLIONS=Wt.makePresetFormat("Millions","###,##0.000 mm",1e-6);Be.FORMAT_ROUND=Wt.makePresetFormat("Round","###,##0");Be.FORMAT_ROUND_TWO_DECIMALS=Wt.makePresetFormat("0.00","###,##0.00");Be.FORMAT_ROUND_FOUR_DECIMALS=Wt.makePresetFormat("0.0000","###,##0.0000");class Ud extends Oe{format(t){return`${t}`}}const Bd=ee.module("IntegerColumnFormatter"),As=class extends Oe{constructor({defaultFormatString:e=As.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return P.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=Oe.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return As.makeFormat(e,t,Oe.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return As.makeFormat("Custom Format",e,Oe.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}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return P.i18n.NumberFormat.format(n,s)}catch{Bd.error("Invalid format arguments")}return""}};let on=As;on.DEFAULT_FORMAT_STRING="###,##0";on.FORMAT_MILLIONS=As.makePresetFormat("Millions","###,##0.000 mm",1e-6);class Wd extends Oe{format(t){return t}}const it=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return P.i18n.DateTimeFormat.parse(it.FULL_DATE_FORMAT,f,P.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:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=it.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return it.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}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<it.months.length;s+=1)if(it.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}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,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}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()),a=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[P.DateWrapper.ofJsDate(l),null]}const s=it.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=it.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=it.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=it.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let es=it;es.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";es.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Ut{}Ut.not="not";Ut.and="and";Ut.or="or";function zd(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class z{}z.eq="eq";z.eqIgnoreCase="eqIgnoreCase";z.notEq="notEq";z.notEqIgnoreCase="notEqIgnoreCase";z.greaterThan="greaterThan";z.greaterThanOrEqualTo="greaterThanOrEqualTo";z.lessThan="lessThan";z.lessThanOrEqualTo="lessThanOrEqualTo";z.in="in";z.inIgnoreCase="inIgnoreCase";z.notIn="notIn";z.notInIgnoreCase="notInIgnoreCase";z.isTrue="isTrue";z.isFalse="isFalse";z.isNull="isNull";z.invoke="invoke";z.contains="contains";z.notContains="notContains";z.startsWith="startsWith";z.endsWith="endsWith";z.containsAny="containsAny";function $d(e){switch(e){case z.eq:return"is exactly";case z.eqIgnoreCase:return"is exactly (ignore case)";case z.notEq:return"is not exactly";case z.notEqIgnoreCase:return"is not exactly (ignore case)";case z.contains:return"contains";case z.notContains:return"does not contain";case z.startsWith:return"starts with";case z.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function Gd(e){switch(e){case z.eq:return"is equal to";case z.notEq:return"is not equal to";case z.greaterThan:return"greater than";case z.greaterThanOrEqualTo:return"greater than or equal to";case z.lessThan:return"less than";case z.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function qd(e){switch(e){case z.eq:return"date is";case z.notEq:return"date is not";case z.notEqIgnoreCase:case z.greaterThan:return"date is after";case z.greaterThanOrEqualTo:return"date is after or equal";case z.lessThan:return"date is before";case z.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function Kd(e){switch(e){case z.isTrue:return"Is True";case z.isFalse:return"Is False";case z.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const Qt=ee.module("TableUtils"),Y=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=Y.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return Y.isBooleanType(e)?[z.isTrue,z.isFalse,z.isNull]:Y.isCharType(e)?[z.eq,z.notEq]:Y.isNumberType(e)||Y.isDateType(e)?[z.eq,z.notEq,z.greaterThan,z.greaterThanOrEqualTo,z.lessThan,z.lessThanOrEqualTo]:Y.isTextType(e)?[z.eq,z.eqIgnoreCase,z.notEq,z.notEqIgnoreCase,z.contains,z.notContains,z.startsWith,z.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=Y.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===Y.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===Y.sortDirection.none)return null;let i=e[t].sort();switch(n){case Y.sortDirection.ascending:i=i.asc();break;case Y.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=Y.getNextSort(t,e,n);return Y.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=Y.makeColumnSort(t,n,s,i);return Y.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=Y.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==Y.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case Y.dataType.BOOLEAN:return Y.dataType.BOOLEAN;case"char":case"java.lang.Character":case Y.dataType.CHAR:return Y.dataType.CHAR;case"java.lang.String":case Y.dataType.STRING:return Y.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case Y.dataType.DATETIME:return Y.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case Y.dataType.DECIMAL:return Y.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 Y.dataType.INT:return Y.dataType.INT;default:return Y.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"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return Y.isIntegerType(e)||Y.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 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 Y.getNormalizedType(e)===Y.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=Y.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return Y.isNumberType(s)?this.makeQuickNumberFilter(e,t):Y.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&Y.isDateType(s)?this.makeQuickDateFilter(e,t,n):Y.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=P.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=P.FilterCondition.invoke("isInf",n).and(n.lessThan(P.FilterValue.ofNumber(0))):s=P.FilterCondition.invoke("isInf",n).and(n.greaterThan(P.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=Y.removeCommas(a),Y.isLongType(e.type))try{a=P.FilterValue.ofNumber(P.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return Qt.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=P.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),Y.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(P.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(P.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=Y.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=z.eq;switch(r){case"<":a=z.lessThan;break;case"<=":case"=<":a=z.lessThanOrEqualTo;break;case">":a=z.greaterThan;break;case">=":case"=>":a=z.greaterThanOrEqualTo;break;case"!=":case"!":a=z.notEq;break;case"=":case"==":default:a=z.eq;break}return Y.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=z.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=es.parseDateRange(t,s),r=i!=null?P.FilterValue.ofNumber(i):null,l=o!=null?P.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===z.notEq?a.isNull().not():a.isNull();switch(n){case z.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case z.lessThan:return a.lessThan(r);case z.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case z.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case z.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case z.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!=|=|!)?(null|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}return Y.makeRangeFilterWithOperation(a,o,P.FilterValue.ofString(r))}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 i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new El(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){Qt.debug2("Event triggered, but matcher returned false.");return}Qt.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){Qt.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}Qt.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=Y.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===Ut.and)l=l.and(p);else if(g===Ut.or)l=l.or(p);else{Qt.error("Unexpected filter operator",g,p),l=null;break}}}else Qt.debug2("Empty filter ignored for",h,m)}catch(p){Qt.error("Unable to create filter",p),l=null;break}}const a=Y.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=Y.getBaseType(e);return Y.isTextType(n)?P.FilterValue.ofString(t):Y.isLongType(n)?P.FilterValue.ofNumber(P.LongWrapper.ofString(Y.removeCommas(t))):P.FilterValue.ofNumber(Y.removeCommas(t))}static makeFilterRawValue(e,t){return Y.isTextType(e)?P.FilterValue.ofString(t):Y.isBooleanType(e)?P.FilterValue.ofBoolean(t):P.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(Y.isTextType(e))return t;if(Y.isLongType(e))return P.LongWrapper.ofString(Y.removeCommas(t));if(Y.isBooleanType(e))return Y.makeBooleanValue(t,!0);if(Y.isDateType(e)){const[s]=es.parseDateRange(t,n);return s}return Y.isNumberType(e)?Y.makeNumberValue(t):(Qt.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0: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==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=Y.removeCommas(t);if(Y.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static makeAdvancedValueFilter(e,t,n,s){if(Y.isDateType(e.type))return Y.makeQuickDateFilterWithOperation(e,n,t,s);const i=Y.makeFilterValue(e.type,n),o=e.filter();switch(t){case z.eq:return o.eq(i);case z.eqIgnoreCase:return o.eqIgnoreCase(i);case z.notEq:return o.notEq(i);case z.notEqIgnoreCase:return o.notEqIgnoreCase(i);case z.greaterThan:return o.greaterThan(i);case z.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case z.lessThan:return o.lessThan(i);case z.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case z.isTrue:return o.isTrue();case z.isFalse:return o.isFalse();case z.isNull:return o.isNull();case z.contains:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case z.notContains:return o.isNull().or(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case z.startsWith:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case z.endsWith:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case z.in:case z.inIgnoreCase:case z.notIn:case z.notInIgnoreCase:case z.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;Y.isTextType(e.type)?o=P.FilterValue.ofString("a"):Y.isBooleanType(e.type)?o=P.FilterValue.ofBoolean(!0):Y.isDateType(e.type)?o=P.FilterValue.ofNumber(P.DateWrapper.ofJsDate(new Date)):o=P.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:Y.isTextType(e.type)?s.push(P.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):Y.isBooleanType(e.type)?s.push(P.FilterValue.ofBoolean(!!r)):s.push(P.FilterValue.ofNumber(r))}return i?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 i=n.name.toUpperCase(),o=s.name.toUpperCase();return Po.sort(i,o,t)})}};let F=Y;F.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};F.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};F.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});F.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class cn{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=F.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new Ud,this.typeFormatterMap=new Map([[F.dataType.BOOLEAN,new xd],[F.dataType.CHAR,new Od],[F.dataType.DATETIME,new In(n)],[F.dataType.DECIMAL,new Be(s)],[F.dataType.INT,new on(i)],[F.dataType.STRING,new Wd]]),this.columnFormatMap=cn.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=F.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=F.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(F.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}class vi{static getColumnFormats(t){if(t&&t.formatter){const{formatter:n}=t;return n}}static getDateTimeFormatterOptions(t){return{timeZone:t==null?void 0:t.timeZone,defaultDateTimeFormatString:t==null?void 0:t.defaultDateTimeFormat,showTimeZone:t==null?void 0:t.showTimeZone,showTSeparator:t==null?void 0:t.showTSeparator}}static isCustomColumnFormatDefined(t,n,s){const i=t.getColumnFormat(s,n);return i!=null&&(i.type===Oe.TYPE_CONTEXT_PRESET||i.type===Oe.TYPE_CONTEXT_CUSTOM)}}const Yd=e=>{switch(e){default:return!1}},Xd=(e,t)=>{switch(e){case be.COUNT:case be.FIRST:case be.LAST:case be.COUNT_DISTINCT:case be.DISTINCT:case be.UNIQUE:return!0;case be.MIN:case be.MAX:return F.isNumberType(t)||F.isDateType(t)||F.isTextType(t);case be.SUM:case be.ABS_SUM:case be.VAR:case be.AVG:case be.STD:return F.isNumberType(t);case be.SKIP:return!1}},$o=(e,t)=>e.filter(n=>Xd(t,n.type)),Qd=(e,t,n,s)=>$o(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),En={isRollupOperation:Yd,filterValidColumns:$o,getOperationColumnNames:Qd};const kr=ee.module("Aggregations"),jd=[be.SUM,be.ABS_SUM,be.MIN,be.MAX,be.VAR,be.AVG,be.STD,be.FIRST,be.LAST,be.COUNT_DISTINCT,be.DISTINCT,be.COUNT,be.UNIQUE],Zd=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=R.exports.useMemo(()=>jd.filter(k=>!i.some(H=>H.operation===k)),[i]),[l,a]=R.exports.useState(r[0]),[c,d]=R.exports.useState([]),h=R.exports.useCallback(k=>{n({...t,...k})},[n,t]),m=R.exports.useCallback(k=>{h({aggregations:k})},[h]),p=R.exports.useCallback(k=>{h({showOnTop:k})},[h]),g=R.exports.useCallback(()=>{kr.debug("handleDragStart"),ot.startDragging()},[]),f=R.exports.useCallback(({destination:k,source:H})=>{if(kr.debug("handleDragEnd",k,H),ot.stopDragging(),k===null)return;let A=k.index;H.index<k.index&&(A+=1);const N=[...i],B=ot.reorder(N,c,N,A),U=ot.adjustDestinationIndex(A,c),L=[[U,U+B.length-1]];m(N),d(L)},[m,i,c,d]),b=R.exports.useCallback(k=>{a(k)},[a]),C=R.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=R.exports.useCallback(k=>{m(i.filter((H,A)=>A!==k))},[i,m]),T=R.exports.useCallback(k=>{d(k)},[d]),y=R.exports.useCallback(k=>{const H=i[k];En.isRollupOperation(H.operation)||s(H)},[i,s]),S=R.exports.useCallback(k=>{p(k.target.value==="true")},[p]);R.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const E=R.exports.useCallback(({item:k,itemIndex:H,isClone:A,selectedCount:N})=>{const B=k.operation,U=A?`${N}`:void 0,L=A?"item-list-item-clone":void 0,_=En.isRollupOperation(k.operation),$=!A&&!_;return v(Ie,{children:[v("div",{className:W("item-list-item-content","draggable-item-list-item-content",L),children:[v("span",{className:"title",children:[B,!e&&_&&v("span",{className:"small text-warning",children:[u(G,{icon:od})," Requires rollup"]})]}),ut.renderBadge({text:U}),ut.renderHandle()]}),!A&&v(Ie,{children:[u(Re,{kind:"ghost",className:"btn-edit",icon:gl,tooltip:"Edit Columns",onClick:()=>s(k),disabled:!$}),u(Re,{kind:"ghost",className:"btn-delete",icon:Mn,tooltip:"Delete Aggregation",onClick:()=>w(H)})]})]})},[w,s,e]),I=r.length>0,D=i.length>0;return v("div",{className:"aggregations",children:[I&&v("div",{className:"form-inline",children:[u(yd,{onChange:b,value:l,children:r.map(k=>u(Rd,{value:k,children:k},k))}),v("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(G,{icon:gs}),"Add Aggregation"]})]}),I&&D&&u("hr",{}),D&&v(Ie,{children:[!e&&v("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),v(Bo,{onChange:S,value:`${o}`,children:[u(an,{value:"true",children:"Top"}),u(an,{value:"false",children:"Bottom"})]})]}),u(_s,{onDragStart:g,onDragEnd:f,children:u(ut,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:E,offset:0,onSelectionChange:T,onSelect:y,selectedRanges:c,isMultiSelect:!0})})]})]})};const Jd=30,eh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=R.exports.useState(-1),[o,r]=R.exports.useState(-1),[l,a]=R.exports.useState(0),{invert:c,selected:d}=e,h=R.exports.useRef(null),m=R.exports.useCallback(S=>d.includes(S)?!c:c,[c,d]),p=R.exports.useMemo(()=>{let S=$o(t,e.operation);return l!==0&&(S=F.sortColumns(S,l===1)),S},[t,e.operation,l]),g=R.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(S=>({value:S.name,displayValue:S.name,isSelected:m(S.name)})):[],[p,m,o,s]),f=R.exports.useCallback(S=>{const{name:E}=p[S],I=d.indexOf(E);let D=[...d],k=c;I>=0?D.splice(I,1):(D.push(E),D.length===p.length&&(D=[],k=!c)),n({...e,selected:D,invert:k})},[e,c,p,d,n]),b=R.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=R.exports.useCallback((S,E)=>{i(S),r(E)},[i,r]),w=R.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),T=d.length===0?c:null,y=d.length!==0||!c||l!==0;return v("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:v("div",{className:"form-inline",children:[u(St,{checked:T,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(tt,{in:y,timeout:bt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(Re,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(Re,{kind:"ghost",className:W({active:l===1}),icon:Oo,tooltip:"Sort ascending",onClick:()=>a(1)}),u(Re,{kind:"ghost",className:W({active:l===2}),icon:ko,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u($t,{itemCount:p.length,items:g,offset:s,renderItem:({item:S})=>u(St,{checked:m(S.value),children:S.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Jd,focusSelector:"input",ref:h})})]})};function th(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function nh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function sh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function ih(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function oh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function rh(e){return v("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function lh(e){return v("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Ar=ee.module("ChartBuilder"),Ge=class extends R.exports.PureComponent{static getTypeName(e){switch(e){case P.plot.SeriesPlotStyle.LINE:return"Line";case P.plot.SeriesPlotStyle.BAR:return"Bar";case P.plot.SeriesPlotStyle.SCATTER:return"Scatter";case P.plot.SeriesPlotStyle.PIE:return"Pie";case P.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case P.plot.SeriesPlotStyle.LINE:return u(sh,{});case P.plot.SeriesPlotStyle.BAR:return u(th,{});case P.plot.SeriesPlotStyle.SCATTER:return u(oh,{});case P.plot.SeriesPlotStyle.PIE:return u(ih,{});case P.plot.SeriesPlotStyle.HISTOGRAM:return u(nh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return 1;case P.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return"Labels";case P.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:zt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ge.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ge.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ge.types[0],i=Ge.getDefaultXAxis(s,n),o=Ge.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:zt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ge.types[0],s=Ge.getDefaultXAxis(n,t),i=Ge.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ge.types[s];Ar.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ge.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ge.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Ar.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ge.getMaxSeriesCount(s),l=Ge.getXAxisLabel(s),a=Ge.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:v("form",{onSubmit:this.handleSubmit,children:[v("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ge.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:v("button",{type:"button",className:W("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ge.getTypeIcon(h),Ge.getTypeName(h)]})},p)})})]}),u("hr",{}),v("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>v("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(G,{icon:Mn})})]},h.id)),d&&v("div",{className:"form-row",children:[u("div",{className:"col-2"}),v("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(G,{icon:gs}),"Add Series"]})]}),v("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:v("div",{className:"fa-md fa-layers",children:[u(G,{mask:Lo,icon:Fo,transform:"right-5 down-5"}),u(G,{icon:o?Cl:id,transform:"grow-2 right-8 down-6"})]})}),v(Bo,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(an,{value:"true",children:"Sync State"}),u(an,{value:"false",children:"Freeze State"})]})]}),v("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),v("div",{className:W("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let Wl=Ge;Wl.types=[P.plot.SeriesPlotStyle.LINE,P.plot.SeriesPlotStyle.BAR,P.plot.SeriesPlotStyle.SCATTER,P.plot.SeriesPlotStyle.PIE];class zl extends R.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=ln.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return v("div",{className:W("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}zl.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const vo=class extends R.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,vo.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(Fi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>v("div",{className:W("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[v("div",{className:"custom-column-input-container",children:[v("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:W("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,vo.INPUT_TYPE.NAME,d.target.value)}}),v("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(he,{children:"Delete custom column"}),u(G,{icon:Mn})]}),v("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(he,{children:"Drag column to re-order"}),u(G,{icon:ki})]})]}),u(zl,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let Go=vo;Go.INPUT_TYPE={NAME:"name",FORMULA:"formula"};Go.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class $l extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Lr(e){if(e==null)throw new $l(`Expected 'val' to be defined, but received ${e}`)}class io extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Fe(e){return(e==null?void 0:e.isEditable)!==void 0}function Hr(e){if(!Fe(e))throw new $l(`Expected 'model' to be editable, but received ${e}`)}function qe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Dt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Dt||{});const ce=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new ce(...ce.normalize(e,t,n,s))}static makeCell(e,t){return new ce(e,t,e,t)}static makeColumn(e){return new ce(e,null,e,null)}static makeRow(e){return new ce(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=ce.minOrNull(i.startColumn,r.startColumn),d=ce.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new ce(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=ce.minOrNull(i.startRow,r.startRow),d=ce.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new ce(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new ce(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=ce.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new ce(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new ce(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new ce(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new ce(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...ce.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=ce.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return ce.isBounded(e)?e:new ce((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>ce.boundedRange(s,t,n))}static offset(e,t,n){return new ce(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=ce.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=ce.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return ce.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&ce.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return ce.subtractFromRange(this,e)}startCell(e=ce.SELECTION_DIRECTION.DOWN){if(!ce.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!ce.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case ce.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case ce.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case ce.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case ce.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=ce.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let X=ce;X.SELECTION_DIRECTION=Dt;function ah(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function oo(e){return ah(e)&&e[0]!=null&&e[1]!=null}const fe=class{static getGridPointFromXY(e,t,n){const s=fe.getColumnAtX(e,n),i=fe.getRowAtY(t,n),o=fe.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=fe.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=fe.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return nt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=fe.iterateFloatingStart(e,n,s);return i!==void 0?i:fe.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=fe.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:fe.iterateFloating(n,s,t,c=>{if(fe.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(fe.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return fe.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return fe.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,T,y;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let S=r.length-1;S>=0;S-=1){const E=r[S],I=(C=c.get(E))!=null?C:0,D=(w=d.get(E))!=null?w:0,k=D===0;if(!b||!k){let H=I+D;k?H+=f:b&&(H-=f);const A=H-f,N=H+f;if(A<=g&&g<=N)return E;b=k}}b=!1;for(let S=a.length-1;S>=0;S-=1){const E=a[S],I=(T=c.get(E))!=null?T:0,D=(y=d.get(E))!=null?y:0,k=D===0;if(I<l-D)return null;if(!b||!k){let H=I+D;k?H+=f:b&&(H-=f);const A=H-f,N=H+f;if(A<=g&&g<=N)return E;b=k}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return fe.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!fe.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!fe.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return fe.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,T=(f=a.get(C))!=null?f:0,y=T===0;if(!p||!y){let S=w+T;y?S+=m:p&&(S-=m);const E=S-m,I=S+m;if(E<=h&&h<=I)return C;p=y}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return fe.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return fe.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!oo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&oo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;oo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,T=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let y;const S=[[w,m-1],[m,p],[p+1,T]].map(([E,I])=>[Math.max(E,w),Math.min(I,T)]).filter(([E,I])=>E<=I).map(E=>{const[I,D]=E;return m<=I&&p>=D?(y=[I+f,D+f],y):p<I?[I-d,D-d]:E}).map(E=>{const[I,D]=E;return g>I&&g<=D?[[I,g-1],[g+d,D+d]]:E===y?[E]:g<=I?[[I+d,D+d]]:[E]}).flat();b.push(...S)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=fe.applyItemMoves(e.startColumn,e.endColumn,t,s),o=fe.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new X(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return fe.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>fe.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return fe.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return fe.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>fe.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=fe.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,T=o,y=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(T-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(y-=g)),{x1:C,y1:w,x2:T,y2:y}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!fe.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(fe.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let V=fe;V.PIXELS_PER_LINE=100/3;function x(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function li(e,t=Vs.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Pr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=x(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=x(i,n-l-1),o.set(n-l-1,r);return o}const Gl=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:T,rowCount:y,floatingTopRowCount:S,floatingBottomRowCount:E,floatingLeftColumnCount:I,floatingRightColumnCount:D,columnHeaderMaxDepth:k}=a,H=this.getFirstRow(e),A=this.getFirstColumn(e),N=this.getGridX(e),B=this.getGridY(e),U=qe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,L=0;let _=this.getVisibleRowHeights(e),$=this.getVisibleColumnWidths(e,A,U);const K=Array.from(_.keys()),j=Array.from($.keys());_=new Map([..._,...this.getFloatingRowHeights(e)]),$=new Map([...$,...this.getFloatingColumnWidths(e)]);let oe=this.getVisibleColumnXs($,j,s),te=this.getVisibleRowYs(_,K,i);const me=K.length>0?K[K.length-1]:n,ae=j.length>0?j[j.length-1]:t,Me=this.getBottomViewport(e,K,te,_),Ke=this.getRightViewport(e,j,oe,$),We=this.getFloatingTopHeight(e,_),He=this.getFloatingBottomHeight(e,_),_e=this.getFloatingLeftWidth(e,$),Qe=this.getFloatingRightWidth(e,$),ke=Array.from($.values()),xt=Array.from(_.values()),Fn=ke.reduce((Ue,is)=>Ue+is,0)-s,qt=xt.reduce((Ue,is)=>Ue+is,0)-i,Ze=this.getLastLeft(e,null,o-N-w-g),ue=this.getLastTop(e,null,r-B-w-He),ze=s+Fn+g,Ve=i+qt,rt=o-N,vt=r-B,Tt=Ze>0||ze>rt,lt=Tt?w:0,xn=ue>0||Ve>vt-lt,Et=xn?w:0,Rt=o-p-Et,On=r-b-lt,zi=p,$i=b,Gi=T===1?Rt/ze:(T-Ze)/T,$s=y===1?On/Ve:(y-ue)/y,Gs=Tt?nt(Rt*Gi,C,Rt-1):0,qs=xn?nt(On*$s,C,On-1):0,Ks=x($,t,0),Ys=x(_,n,0),Xs=Ks>0?s/Ks:0,Qs=Ys>0?i/Ys:0,qi=T===1?s/(ze-rt):(t+Xs)/Ze,Ki=y===1?i/(Ve-vt):(n+Qs)/ue,kn=Tt?qi*(Rt-Gs):0,Yi=xn?Ki*(On-qs):0;let ss=[];(S>0||E>0)&&(ss=[...Array(S).keys(),...[...Array(E).keys()].map(Ue=>y-Ue-1)],te=new Map([...te,...this.getFloatingRowYs(e,_,Math.floor(r-B-lt))]));let vs=[];(I>0||D>0)&&(vs=[...Array(I).keys(),...[...Array(D).keys()].map(Ue=>T-Ue-1)],oe=new Map([...oe,...this.getFloatingColumnXs(e,$,Math.floor(o-N-Et))]));const js=[];if(h)for(let Ue=h.range[0];Ue<=h.range[1];Ue+=1)js.push(Ue),$.has(Ue)||$.set(Ue,this.getVisibleColumnWidth(Ue,e)),oe.has(Ue)||oe.set(Ue,0);const Zs=K.concat(ss),Ts=j.concat(vs).concat(js),Es=this.getModelRows(Zs,e),Xi=this.getModelColumns(Ts,e),Qi=this.getVisibleRowTreeBoxes(_,Es,e),Js=this.getTopVisible(e,te,_,K),ji=this.getLeftVisible(e,oe,$,j),ei=ue>0?this.getBottomVisible(e,te,_,K,B):me,ti=Ze>0?this.getRightVisible(e,oe,$,j,N):ae,{fontWidths:ni,userColumnWidths:si,userRowHeights:ii,calculatedRowHeights:Zi,calculatedColumnWidths:Ji}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:y,columnWidth:f,columnCount:T,columnHeaderHeight:b,floatingTopRowCount:S,floatingBottomRowCount:E,floatingLeftColumnCount:I,floatingRightColumnCount:D,gridX:N,gridY:B,firstRow:H,firstColumn:A,treePaddingX:U,treePaddingY:L,left:t,top:n,bottom:me,right:ae,topOffset:i,leftOffset:s,topVisible:Js,leftVisible:ji,bottomVisible:ei,rightVisible:ti,bottomViewport:Me,rightViewport:Ke,width:o,height:r,maxX:Fn,maxY:qt,lastLeft:Ze,lastTop:ue,barHeight:On,barTop:$i,barWidth:Rt,barLeft:zi,handleHeight:qs,handleWidth:Gs,hasHorizontalBar:Tt,hasVerticalBar:xn,verticalBarWidth:Et,horizontalBarHeight:lt,scrollX:kn,scrollY:Yi,scrollableContentWidth:ze,scrollableContentHeight:Ve,scrollableViewportWidth:rt,scrollableViewportHeight:vt,visibleRows:K,visibleColumns:j,floatingRows:ss,floatingColumns:vs,allRows:Zs,allColumns:Ts,visibleRowHeights:_,visibleColumnWidths:$,floatingTopHeight:We,floatingBottomHeight:He,floatingLeftWidth:_e,floatingRightWidth:Qe,visibleRowYs:te,visibleColumnXs:oe,visibleRowTreeBoxes:Qi,modelRows:Es,modelColumns:Xi,movedRows:c,movedColumns:d,fontWidths:ni,userColumnWidths:si,userRowHeights:ii,calculatedRowHeights:Zi,calculatedColumnWidths:Ji,columnHeaderMaxDepth:k}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Pr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=x(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Pr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=x(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return qe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=x(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=x(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=x(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=x(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=x(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(x(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(x(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=x(t,h),p=x(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=x(t,h),p=x(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=x(t,o)+x(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return x(this.modelRows,e);const{movedRows:n}=t,s=V.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return x(this.modelColumns,e);const{movedColumns:n}=t,s=V.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),li(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),li(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,T=Math.ceil(n+w);return V.iterateAllItems(n,T,l,a,c,y=>{const S=this.getModelRow(y,t),E=o.textForCell(e,S);if(E){const I=h*2;b=Math.max(b,E.length*C+I)}}),b=Math.max(Math.min(b,(i-p-f-g)*Gl.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!qe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return x(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),li(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),li(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let Vs=Gl;Vs.CACHE_SIZE=1e4;Vs.MAX_COLUMN_WIDTH=.8;const ch=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),Ct=(e,t)=>{let n=!1;const s=pe(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function hh(e,t,n=6){const s=Co.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Co.lab.hex(s)}`}function uh(e,t){const[n,s,i]=Co.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const _r={colorWithAlpha:uh,darkenForDepth:hh};class Xe{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class ql extends Xe{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=x(l,g),C=s-a-b-this.dragOffset,w=x(d,g),T=this.targetSizes.get(w),y=this.resizingItems.length>1,S=this.hiddenItems.indexOf(g);let E=x(c,w);g===h&&(E+=m);let I=C;Math.abs(C-E)<=r.headerResizeSnapThreshold?I=null:T!==void 0&&C>T&&(y&&S!==0||S>0)?I=T:C<=r.headerResizeHiddenSnapThreshold&&(I=0),I!==E?p.set(w,I):p.set(w,null),C<-r.headerResizeSnapThreshold&&I===0?S>=0&&y?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(x(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):T!==void 0&&C>T+r.headerResizeSnapThreshold&&I===T?S>0?(this.dragOffset+=I,g=this.hiddenItems[S-1],this.resizingItems.push(g),this.addTargetSize(o,g)):y?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=x(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];x(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=x(s,n);let a=i.get(l);(a==null||a===0)&&(a=x(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=x(s,n);this.targetSizes.delete(i)}}class Pi extends ql{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=V.getHiddenColumns,this.getNextShownItem=V.getNextShownColumn,this.getSeparator=Pi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=V.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const Jt=class{constructor(){this.getCachedTruncatedString=Ct((e,t,n,s,i)=>Jt.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=Ct((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(_r.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=Ct((e,t)=>_r.colorWithAlpha(e,t),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=Jt.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=Jt.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return Jt.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:x(h,r-1)+x(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:x(h,c-l)+.5,maxY:x(h,c-1)+x(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:x(f,r-1)+x(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:x(f,p-l)+.5,maxX:x(f,p-1)+x(b,p-1)});for(let T=0;T<d.length;T+=1){const y=d[T];for(let S=0;S<g.length;S+=1){const E=g[S];this.drawCellContent(e,t,y,E)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=x(d,i-1)+x(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=x(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=x(h,r-1)+x(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=x(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=x(d,i-1)+x(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=x(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=x(h,r-1)+x(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=x(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?x(g,l+1):-10,minY:c>0&&p.has(c+1)?x(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?x(g,d-a-1)+x(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?x(p,h-r-1)+x(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(T,y)=>{const S=qe(a)?a.depthForRow(T):0,E=m[T%m.length],I=E[Math.min(S,E.length-1)];if(f.has(I)||f.set(I,[]),f.get(I).push(T),y!=null){const D=qe(a)?a.depthForRow(y):0;D<S?b.push(T):D>S&&C.push(y)}};for(let T=0;T<n.length;T+=1){const y=n[T],S=T>0?n[T-1]:void 0;w(y,S)}if(f.forEach((T,y)=>{e.fillStyle=y,e.beginPath();for(let S=0;S<T.length;S+=1){const E=T[S],I=x(p,E),D=x(g,E);e.rect(i,I,o,D)}e.fill()}),b.length>0){e.save();const T=this.getCachedColorWithAlpha(h,.15),y=this.getCachedColorWithAlpha(h,0),S=e.createLinearGradient(0,0,0,d);S.addColorStop(0,T),S.addColorStop(1,y),e.fillStyle=S;for(let E=0;E<b.length;E+=1){const I=b[E],D=x(p,I);e.translate(0,D),e.fillRect(i,0,o,d),e.translate(0,-D)}e.restore()}if(C.length>0){e.save();const T=this.getCachedColorWithAlpha(h,0),y=this.getCachedColorWithAlpha(h,.15),S=e.createLinearGradient(0,0,0,d);S.addColorStop(0,T),S.addColorStop(1,y),e.fillStyle=S;for(let E=0;E<C.length;E+=1){const I=C[E],D=x(p,I),k=x(g,I),H=D+k-d;e.translate(0,H),e.fillRect(i,0,o,d),e.translate(0,-H)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=V.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=x(a,r),h=x(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=V.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=V.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=x(l,n),d=x(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=x(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=x(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=x(d,s),b=x(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,T=qe(r)&&r.hasExpandableRows;if(C){const y=x(h,n)+1,S=x(p,s)+1,E=x(m,n)-1,I=x(g,s)-1;e.fillStyle=C,e.fillRect(y,S,E,I)}w&&T&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=x(i,n),c=x(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=x(c,n),C=x(h,s),w=x(d,n),T=x(m,s),y=n===a;let S=0;qe(r)&&r.hasExpandableRows&&y&&(S=g*(r.depthForRow(s)+1)+f);const E=w-S;let I=b+p;const D=C+T*.5;return i==="right"?I=b+E-p:i==="center"&&(I=b+E*.5),I+=S,{width:E-p*2,x:I,y:D}}drawCellContent(e,t,n,s,i){var y;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=x(m,s),f=x(h,s),b=x(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),T=n===a;if(C&&g>0){const S=r.textAlignForCell(b,f)||"left";e.textAlign=S;const E=r.colorForCell(b,f,l)||p;e.fillStyle=E;const{width:I,x:D,y:k}=this.getTextRenderMetrics(e,t,n,s),H=(y=c.get(e.font))!=null?y:Jt.DEFAULT_FONT_WIDTH,A=this.getCachedTruncatedString(e,C,I,H,w);A&&e.fillText(A,D,k)}T&&qe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=x(h,a),T=x(m,a),y=x(p,n),S=x(g,n);if(!qe(i)||!i.isRowExpandable(n))return;const E=x(f,n),I=o!=null&&r!=null&&o>=c+w&&o<=c+w+T&&r>=d+y&&r<=d+y+S?C:b;this.drawTreeMarker(e,t,w,y,E,I,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!qe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=x(c,a),b=x(d,n),C=x(h,n),w=s!==void 0?o.depthForRow(s):0,T=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-T>0){e.beginPath();for(let y=0;y<l-T;y+=1){const S=f+y*m+m*.5+p+.5;e.moveTo(S,b),e.lineTo(S,b+C)}e.stroke()}if(T>0){e.beginPath();for(let y=l-T;y<l;y+=1){const S=f+y*m+m*.5+p+.5;e.moveTo(S,b),e.lineTo(S,b+Math.ceil(C/2)),e.moveTo(S-.5,b+Math.ceil(C/2)+.5),e.lineTo(S+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:T,columnHeaderMaxDepth:y}=o;if(c<=0)return;const{headerHiddenSeparatorSize:S,headerHiddenSeparatorHoverColor:E,headerSeparatorColor:I,headerSeparatorHoverColor:D}=i,k=c*.5,H=c*(y-1)+c*.5-k*.5,A=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),A&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),I){e.strokeStyle=I;const N=[...g.entries()].filter(([B,U])=>U===0).map(([B])=>B);e.beginPath(),e.fillStyle=I;for(let B=0;B<N.length;B+=1){const U=N[B],L=x(f,U),_=x(g,U),$=h+L+_+.5-S*.5;e.rect($,H,S,k)}e.fill()}if(D){let{index:N,depth:B}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const L=Pi.getColumnSeparator(V.getGridPointFromXY(n,s,o),o,a,i);N=L==null?void 0:L.index,B=L==null?void 0:L.depth}let U;if(N==null)U=!1;else{const L=T.get(N),_=T.get(N+1);L==null||_==null?U=!1:U=a.textForColumnHeader(L,B)!==a.textForColumnHeader(_,B)}if(U&&N!=null&&B!=null&&(!l||r!=null)){e.strokeStyle=D;const L=x(f,N),_=x(g,N),$=h+L+_+.5,K=p.indexOf(N),j=K<p.length-1?p[K+1]:null,oe=j!=null?g.get(j):null,te=_===0,me=oe!=null&&oe===0;te?(e.strokeStyle=E,e.fillStyle=E,e.fillRect($,H,S*.5,k)):me&&(e.fillStyle=D,e.fillRect($-S*.5,H,S*.5,k)),e.beginPath(),e.moveTo($,(y-B-1)*c),e.lineTo($,(y-B)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var H,A,N,B,U,L;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C,columnHeaderHeight:w,columnWidth:T}=l,{columnHeaderMaxDepth:y}=r,{minX:S,maxX:E}=s,I=E-S;if(y===0)return;const D=n[0],k=n[1];if(e.save(),e.translate(0,(y-i-1)*w),i===0){this.drawColumnHeader(e,t,"",S,E,{backgroundColor:f,separatorColor:C});for(let _=D;_<=k;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=D;for(;_<=k;){const{columnCount:$}=o,K=x(a,_),j=r.textForColumnHeader(K,i),oe=r.colorForColumnHeader(K,i);let te=x(c,_)+d,me=te+x(p,_);if(j!=null){let ae=_-1;for(;ae>=0&&(me-te<I||te>S);){const He=(H=a.get(ae))!=null?H:V.getModelIndex(ae,g);if(He==null||r.textForColumnHeader(He,i)!==j)break;te-=(N=(A=m.get(He))!=null?A:h.get(He))!=null?N:T,ae-=1}let Me=_+1;for(;Me<$&&(me-te<I||me<E);){const He=(B=a.get(Me))!=null?B:V.getModelIndex(Me,g);if(r.textForColumnHeader(He,i)!==j)break;me+=(L=(U=m.get(He))!=null?U:h.get(He))!=null?L:T,Me+=1}_=Me-1;const Ke=me-te>=I;let We=te;Ke&&(me<E?We=me-I:te<S&&(We=S)),this.drawColumnHeader(e,t,j,We,Math.min(me-te,I),{backgroundColor:oe!=null?oe:f,textColor:b,separatorColor:C},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var w;const{metrics:i,model:o,theme:r}=t,{modelColumns:l,visibleColumnWidths:a,visibleColumnXs:c,gridX:d}=i,h=x(a,n),m=x(c,n)+d,p=x(l,n),g=o.textForColumnHeader(p),{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C}=r;g!=null&&this.drawColumnHeader(e,t,g,m,h,{backgroundColor:(w=o.colorForColumnHeader(p))!=null?w:f,textColor:b,separatorColor:C},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d}=a,{fontWidths:h,width:m}=l,p=h.get(e.font)||Jt.DEFAULT_FONT_WIDTH,f=(i-c*2)/p,{backgroundColor:b,textColor:C="#ffffff",separatorColor:w}=o!=null?o:{};let{minX:T=0,maxX:y=m}=r!=null?r:{};e.save(),e.rect(T,0,y-T,d),e.clip(),b&&(e.fillStyle=b,e.fillRect(s,0,i,d)),w&&(e.strokeStyle=w,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=C;let S=n;f<=0?S="":S.length>f&&(S=`${S.substring(0,f-1)}\u2026`);const E=S.length*p;let I=s+i*.5;const D=d*.5;T+=c,y-=c;const k=s+c,H=nt(k,T,y),A=s+i-c,B=nt(A,T,y)-H,U=I-E*.5<T,L=I+E*.5>y;U?E<B?I=T+E*.5:I=A-E*.5:L&&(E<B?I=y-E*.5:I=k+E*.5),e.textAlign="center",e.fillText(S,I,D),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,T=a*.5,y=a*.5-T*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const S=[];let E=!1;for(let I=0;I<d.length;I+=1){const D=d[I],k=x(m,D),H=x(h,D);if(H>0){const A=l+k+H+.5;e.moveTo(0,A),e.lineTo(a,A),E=!1}else E||(E=!0,S.push(D))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let I=0;I<S.length;I+=1){const D=S[I],k=x(m,D),H=x(h,D),A=l+k+H+.5-f*.5;e.rect(y,A,T,f)}e.fill()}if(w){let{index:S=null}=r!=null?r:{};if(S==null&&n!=null&&s!=null&&(S=V.getRowSeparatorIndex(n,s,i,o)),S!=null){e.strokeStyle=w;const E=x(m,S),I=x(h,S),D=l+E+I+.5,k=d.indexOf(S),H=k<d.length-1?d[k+1]:null,A=H!=null?h.get(H):null,N=I===0,B=A!=null&&A===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(y,D,T,f*.5)):B&&(e.fillStyle=w,e.fillRect(y,D-f*.5,T,f*.5)),e.beginPath(),e.moveTo(.5,D),e.lineTo(a+.5,D),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let S=0;S<d.length;S+=1){const E=d[S],I=x(h,E),D=x(m,E)+l;this.drawRowHeader(e,t,E,D,I)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=x(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:T,headerBackgroundColor:y,headerColor:S,headerHiddenSeparatorSize:E,headerHiddenSeparatorHoverColor:I,headerSeparatorColor:D,headerSeparatorHoverColor:k}=r,H=m*.5,A=m*.5-H*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=y,e.fillRect(N,a,m,p),D){e.strokeStyle=D,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const U=[];let L=!1;for(let _=0;_<f.length;_+=1){const $=f[_],K=x(C,$),j=x(b,$);if(j>0){const oe=a+K+j+.5;e.moveTo(N+.5,oe),e.lineTo(N+m-.5,oe),L=!1}else L||(L=!0,U.push($))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=D;for(let _=0;_<U.length;_+=1){const $=U[_],K=x(C,$),j=x(b,$),oe=a+K+j+.5-E*.5;e.rect(N+A,oe,H,E)}e.fill()}if(k){let{index:U=null}=l!=null?l:{};if(U==null&&n!=null&&s!=null&&(U=V.getRowSeparatorIndex(n,s,i,r)),U!=null){e.strokeStyle=k;const L=x(C,U),_=x(b,U),$=a+L+_+.5,K=f.indexOf(U),j=K<f.length-1?f[K+1]:null,oe=j!=null?b.get(j):null,te=_===0,me=oe!=null&&oe===0;te?(e.strokeStyle=I,e.fillStyle=I,e.fillRect(A,$,H,E*.5)):me&&(e.fillStyle=k,e.fillRect(A,$-E*.5,H,E*.5)),e.beginPath(),e.moveTo(N+.5,$),e.lineTo(N+m+.5,$),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=S,e.textAlign="left";const B=N+T;for(let U=0;U<f.length;U+=1){const L=f[U],_=x(b,L);if(_>0){const $=x(C,L)+a,K=x(h,L),j=$+_*.5;e.fillText(o.textForRowFooter(K),B,j)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:T=a.top,right:y=a.right,bottom:S=a.bottom,minY:E=-10,maxY:I=C+10,minX:D=-10,maxX:k=b+10}=n;if(d.length===0)return;const H=Fe(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(H){const A=x(p,s),N=x(f,i),B=x(m,s),U=x(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(A,N,B,U),e.clip("evenodd")}e.beginPath();for(let A=0;A<d.length;A+=1){const N=d[A],B=N.startColumn!==null?N.startColumn:w,U=N.startRow!==null?N.startRow:T,L=N.endColumn!==null?N.endColumn:y,_=N.endRow!==null?N.endRow:S;if(_>=T&&S>=U&&L>=w&&y>=B){const $=B>=w&&p.has(B)?Math.round(x(p,B))+.5:D,K=U>=T&&f.has(U)?Math.max(Math.round(x(f,U))+.5,.5):E,j=L<=y&&p.has(L)?Math.round(x(p,L)+x(m,L))-.5:k,oe=_<=S&&f.has(_)?Math.round(x(f,_)+x(g,_))-.5:I;e.rect($,K,j-$,oe-K)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}H&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=Jt.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=x(a,n),m=x(d,s),p=x(l,n),g=x(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:T}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=T}drawRoundedRect(e,t,n,s,i,o=Jt.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var oe;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:T}=s,y=(oe=w.get(l[0]))!=null?oe:V.getModelIndex(l[0],C),S=r.getColumnHeaderGroup(y,a);if(a>0&&!S)return;const[E,I]=l,D=x(h,E),H=x(h,I)+x(m,I)-D,A=n.left,{backgroundColor:N,font:B,headerFont:U,reorderOffset:L,shadowBlur:_,shadowColor:$}=o,K=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(T,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(D,K,H,p),e.restore(),e.translate(0,L),e.save(),e.shadowColor=$,e.shadowBlur=_,e.fillStyle=N,e.fillRect(n.left,K+L,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,K,n.width+1,p),e.clip(),e.translate(A-D,0),e.font=U;const j=[];for(let te=n.range[0];te<=n.range[1];te+=1)j.push(te);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[j[0],j[j.length-1]],{minX:D,maxX:g}),e.translate(0,d),e.font=B,this.drawGridBackground(e,t);for(let te=E;te<=I;te+=1)this.drawColumnCellContents(e,t,te);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=x(c,n),p=x(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:T}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=T,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:T,barHeight:y}=o,{scrollBarBackgroundColor:S,scrollBarHoverBackgroundColor:E,scrollBarCasingColor:I,scrollBarCornerColor:D,scrollBarColor:k,scrollBarHoverColor:H,scrollBarActiveColor:A,scrollBarSize:N,scrollBarHoverSize:B,scrollBarCasingWidth:U,scrollBarSelectionTick:L,scrollBarSelectionTickColor:_,scrollBarActiveSelectionTickColor:$,autoSelectRow:K,autoSelectColumn:j}=a,oe=r!=null&&l!=null&&r<=h&&l<=m,te=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-B&&l<=y+d&&oe,me=n||C&&!s&&!i&&!te&&r!=null&&l!=null&&l>=m-B&&r<=T-c&&oe,ae=me?B:N,Me=te?B:N;if(e.translate(c,d),C&&w&&(e.fillStyle=I,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=D,e.fillRect(h-c-N+U,m-d-N+U,N-U,N-U)),C){const Ke=f,We=m-d-ae;if(e.fillStyle=I,e.fillRect(0,We,T,ae-U),e.fillStyle=me?E:S,e.fillRect(0,We+U,T,ae-U),n?e.fillStyle=A:me?e.fillStyle=H:e.fillStyle=k,e.fillRect(Ke,We+U,g,ae-U),!K&&L&&_!=null&&$!=null){e.fillStyle=_;const{selectedRanges:He,cursorColumn:_e}=t,{lastLeft:Qe,columnCount:ke}=o,Fn=[...He].filter(ue=>ue.startColumn!=null&&ue.endColumn!=null).map(ue=>[ue.startColumn,ue.endColumn]).sort(V.compareRanges),qt=V.mergeSortedRanges(Fn),Ze=ue=>ue<=Qe?ue/Qe*(T-g):T-g+(ue-Qe)/(ke-Qe)*g;for(let ue=0;ue<qt.length;ue+=1){const ze=qt[ue],Ve=ze[0],rt=ze[1];if(Ve!=null&&rt!=null&&(Ve!==_e||rt!==_e)){const vt=Ze(Ve),Tt=Math.max(1,Math.round(Ze(rt+1)-vt)),lt=ae-U;e.fillRect(vt,We+U+Math.round(lt/3),Tt,Math.round(lt/3))}}if(_e!=null){const ue=Ze(_e),ze=2,Ve=ae-U;e.fillStyle=$,e.fillRect(ue,We+U,ze,Ve)}}}if(w){const Ke=h-c-Me,We=b;if(e.fillStyle=I,e.fillRect(Ke,0,Me-U,y),e.fillStyle=te?E:S,e.fillRect(Ke+U,0,Me-U,y),s?e.fillStyle=A:te?e.fillStyle=H:e.fillStyle=k,e.fillRect(Ke+U,We,Me-U,p),!j&&L&&_!=null&&$!=null){const{selectedRanges:He,cursorRow:_e}=t,{lastTop:Qe,rowCount:ke}=o,xt=ue=>ue<=Qe?ue/Qe*(y-p):y-p+(ue-Qe)/(ke-Qe)*p;e.fillStyle=_;const qt=[...He].filter(ue=>ue.startRow!=null&&ue.endRow!=null).map(ue=>[ue.startRow,ue.endRow]).sort(V.compareRanges),Ze=V.mergeSortedRanges(qt);for(let ue=0;ue<Ze.length;ue+=1){const ze=Ze[ue],Ve=ze[0],rt=ze[1];if(Ve!=null&&rt!=null&&(Ve!==_e||rt!==_e)){const vt=xt(Ve),Tt=Me-U,lt=Math.max(1,Math.round(xt(rt+1)-vt));e.fillRect(Ke+U+Math.round(Tt/3),vt,Math.round(Tt/3),lt)}}if(_e!=null){const ue=Math.round(xt(_e)),ze=Me-U,Ve=2;e.fillStyle=$,e.fillRect(Ke+U,ue,ze,Ve)}}}e.translate(-c,-d)}};let ms=Jt;ms.DEFAULT_FONT_WIDTH=10;ms.DEFAULT_EDGE_RADIUS=2;ms.ACTIVE_CELL_BORDER_WIDTH=2;const Vr=100;class mh extends Xe{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=V.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:T}=C;return(r!==null||!T)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=V.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=V.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:T,floatingBottomRowCount:y,floatingLeftColumnCount:S,floatingRightColumnCount:E,columnCount:I,rowCount:D,bottom:k,right:H,topVisible:A,bottomVisible:N,leftVisible:B,rightVisible:U}=c;this.hasExtendedFloating||(s!==null&&s<T&&l>=T?(l=T,this.hasExtendedFloating=!0):s!==null&&s>=D-y&&l<D-y&&(l=D-y-1,this.hasExtendedFloating=!0),i!==null&&i<S&&a>=S?(a=S,this.hasExtendedFloating=!0):i!==null&&i>=I-E&&a<I-E&&(a=I-E-1,this.hasExtendedFloating=!0)),s!==null&&!V.isFloatingRow(s,c)&&V.isFloatingRow(l,c)&&(s>l&&l<m?l=A-1:s<l&&l>k&&(l=N+1)),i!==null&&!V.isFloatingColumn(i,c)&&V.isFloatingColumn(a,c)&&(i>a&&a<d?a=B-1:i<a&&a>H&&(a=U+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?Vr-Math.min(Vr,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const Ur=5,ph=1e3/60,ai=10;function mn(e,t,n,s){var T,y,S,E,I,D,k;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(T=i.get(e))!=null?T:V.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[H,A]=g.getVisibleRange(o);b=(y=r.get(H))!=null?y:h,C=((S=r.get(A))!=null?S:m)+((E=a.get(A))!=null?E:0),w=[H,A]}else{const H=r.get(e);if(H==null)return null;b=H,C=b+((k=(D=(I=a.get(e))!=null?I:c.get(p))!=null?D:d.get(p))!=null?k:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class gh extends Xe{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=ai;m<0;){h-=1;const C=V.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=ai;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=V.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-ai:ai),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},ph))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=mn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<Ur&&Math.abs(this.initialGridPoint.y-o)<Ur)return!1;if(a==null){const d=mn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=mn(a.range[0],0,c,l),m=mn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var I,D,k,H,A;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=mn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=mn(V.getColumnAtX(nt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const B=this.moveColumn(p,N[0],r);this.draggingOffset=t-((I=h.get(N[0]))!=null?I:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}if(b.visibleIndex>N[1]){const B=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:U=0}=(D=mn(N[1],0,l,o))!=null?D:{};this.draggingOffset=t-(U-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const U=this.moveColumn(p,N,r);n.setState({movedColumns:U,draggingColumn:this.draggingColumn})}const B=mn(N,0,l,o);m?this.draggingOffset=t-((k=B==null?void 0:B.left)!=null?k:0):this.draggingOffset=t-(((H=B==null?void 0:B.right)!=null?H:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,T=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let y,S=((A=T==null?void 0:T.depth)!=null?A:d)-1;for(;S>=0&&y===void 0;)y=o.getColumnHeaderGroup(b.modelIndex,S),S-=1;let E;m&&g<w&&(!y||b.visibleIndex===y.getVisibleRange(r)[0])&&(E=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!y||b.visibleIndex===y.getVisibleRange(r)[1])&&(E=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),E&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:E,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?V.moveRange(t.range,n,s):V.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class qo extends Xe{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=nt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return qo.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class fh extends Xe{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=x(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:E}=n.getGridPointFromXY(o,r);if(E!=null&&!s.isRowMovable(E)||(i=E,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const E=i-1;C=x(f,E)+x(g,E)*.5+p}let w=b;if(i<d){const E=i+1;w=x(f,E)+x(g,E)*.5+p}let{movedRows:T}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(T=V.moveItem(i,i-1,T),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(T=V.moveItem(i,i+1,T),i+=1),n.setState({movedRows:T,draggingRow:i});const y=p+x(g,a)*.5,S=p+x(f,h)+x(g,h)*.5;return r<y&&a>0?n.setState({top:a-1}):r>S&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class Ko extends ql{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=V.getHiddenRows,this.getNextShownItem=V.getNextShownRow,this.getSeparator=Ko.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=V.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class Ti extends Xe{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=x(h,s),C=x(m,s),w=x(g,i),T=x(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+T)return!0}return!1}onDown(t,n){return Ti.isInTreeBox(t,n)}onClick(t,n){if(Ti.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class Ch extends Xe{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class Yo extends Xe{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=nt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return Yo.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class bh extends Xe{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Fe(i)&&t!=null&&n!=null&&i.isEditableRange(X.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class ns{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class wh extends ns{onDown(t,n){switch(t.key){case"a":if(V.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return V.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return V.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return V.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:0,V.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:i-1,V.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?X.SELECTION_DIRECTION.UP:X.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?X.SELECTION_DIRECTION.LEFT:X.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=V.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=nt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=nt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class Sh extends ns{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&qe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class vh extends ns{onDown(t,n){if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Fe(s)||!s.isEditableRange(X.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function Th(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function Eh(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function Rh(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return Th(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
1
|
+
import{p as M,r as R,R as Q,P as Da,j as u,C as tt,c as W,a as v,b as Io,m as pe,l as wt,F as G,d as Ie,s as zt,A as Fa,e as xa,f as Fi,g as Ps,h as Oa,E as Mo,$ as ll,D as _s,i as nt,k as Co,n as xe,W as pr,o as sn,q as ka,t as bo,u as Hs}from"./vendor.fafb26fa.js";import{e as ln,W as Aa,l as as,K as un,b as gr,d as Vt,f as wi}from"./monaco.3eae455a.js";import"ext/window-this";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const La="#1a171a",Ha="#f0f0ee",Pa="#fcd65b",_a="#9edc6f",Va="#76d9e4",Ua="#aa9af4",Ba="#f37e3f",Wa="#f95d84",za="#4878ea",$a="#5b5a5c",Ga="#9edc6f",qa="#fcd65b",Ka="#f37e3f",Ya="#f95d84",Xa="#fcfcfa",Qa="#929192",ja="#373438",Za="#f0f0ee",Ja="#1a171a",ec="#2d2a2e",tc="#1a171a",nc="#f0f0ee",sc="0.15s",ic={"gray-100":"#fcfcfa","gray-200":"#f0f0ee","gray-300":"#c0bfbf","gray-400":"#929192","gray-500":"#5b5a5c","gray-600":"#555356","gray-700":"#403e41","gray-800":"#373438","gray-850":"#322f33","gray-900":"#211f22",black:La,white:Ha,yellow:Pa,green:_a,blue:Va,purple:Ua,orange:Ba,red:Wa,primary:za,"primary-hover":"#235de6","primary-dark":"#343e5d",secondary:$a,success:Ga,info:qa,warning:Ka,danger:Ya,light:Xa,mid:Qa,dark:ja,"text-muted":"#929192",interfacewhite:Za,interfaceblack:Ja,interfacegray:ec,"content-bg":"#2d2a2e",background:tc,foreground:nc,transition:sc},bt=Object.freeze({transitionMs:150,transitionMidMs:200,transitionLongMs:300,transitionSlowMs:1e3,...ic});class dn extends R.exports.Component{constructor(t){super(t),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=Q.createRef(),this.rAF=0;const{isShown:n}=this.props;this.state={show:n,popper:null}}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(t){return t==null||t.clientHeight>0||t.clientWidth>0?t:this.getVisibleElement(t.parentElement)}initPopper(){let{popper:t}=this.state;const{closeOnBlur:n,referenceObject:s}=this.props;if(t||this.container.current===null)return;let{options:i}=this.props;i={placement:"auto",...i},document.body.appendChild(this.element);let o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),t=new Da(s||o,this.element,i),t.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(n&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:t})}destroyPopper(t=!0){cancelAnimationFrame(this.rAF);const{popper:n}=this.state;!n||(n.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),t&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:t}=this.state;t&&t.scheduleUpdate()}handleBlur(t){t.relatedTarget instanceof HTMLElement&&(this.element.contains(t.relatedTarget)||this.hide())}handleEnter(){const{onEntered:t}=this.props;t()}handleExit(){const{onExited:t}=this.props,{show:n}=this.state;n||this.destroyPopper(),t()}renderContent(){const{className:t,children:n,timeout:s,interactive:i,closeOnBlur:o}=this.props,{show:r}=this.state;return u(tt,{in:r,timeout:s,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u("div",{onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:W("popper",{interactive:i},t),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:v("div",{className:"popper-content",children:[n,u("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:t}=this.state,{"data-testid":n}=this.props;return u("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":n,children:t&&Io.createPortal(this.renderContent(),this.element)})}}dn.propTypes={children:M.exports.node.isRequired,options:M.exports.shape({}),className:M.exports.string,timeout:M.exports.number,onEntered:M.exports.func,onExited:M.exports.func,isShown:M.exports.bool,closeOnBlur:M.exports.bool,interactive:M.exports.bool,referenceObject:M.exports.shape({}),"data-testid":M.exports.string};dn.defaultProps={options:{},className:"",timeout:bt.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0};const oc=-1,al=0,cl=1,No=2,dl=3,hl=4;Object.freeze({SILENT:oc,ERROR:al,WARN:cl,INFO:No,DEBUG:dl,DEBUG2:hl});const yt=()=>{};class fr{constructor(t,n){this.name=t,this.prefix=t?`[${t}]`:"",this.error=yt,this.warn=yt,this.log=yt,this.info=yt,this.debug=yt,this.debug2=yt,this.level=n,this.setLogLevel(n)}setLogLevel(t){if(!Number.isFinite(t)){console.warn(`Expected a number for log level. Received: ${t}. Ignoring`);return}this.level=t,this.error=t>=al?console.error.bind(console,this.prefix):yt,this.warn=t>=cl?console.warn.bind(console,this.prefix):yt,this.log=t>=No?console.log.bind(console,this.prefix):yt,this.info=this.log,this.debug=t>=dl?console.debug.bind(console,this.prefix):yt,this.debug2=t>=hl?console.debug.bind(console,this.prefix):yt}}class rc extends fr{constructor(t=No){super(null,t),this.modules={}}module(t){return this.modules[t]||(this.modules[t]=new fr(t,this.level)),this.modules[t]}setLogLevel(t){if(super.setLogLevel(t),!this.modules)return;const n=Object.keys(this.modules);for(let s=0;s<n.length;s+=1)this.modules[n[s]].setLogLevel(t)}}const ee=new rc,lc=ee.module("Tooltip"),ht=class extends R.exports.Component{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=Q.createRef(),this.popper=Q.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){ht.shownTooltipCount-=1,ht.shownTooltipCount===0&&(ht.lastHiddenTime=Date.now())}static handleShown(){ht.shownTooltipCount+=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?ht.handleShown():ht.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&ht.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){lc.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 i=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=i.left&&t<=i.left+i.width&&n>=i.top&&n<=i.top+i.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():s&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(ht.shownTooltipCount>0||Date.now()-ht.lastHiddenTime<ht.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,options:n,referenceObject:s,popperClassName:i,"data-testid":o}=this.props,{isShown:r}=this.state;return u("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u(dn,{className:W(i),options:n,ref:this.popper,onExited:this.handleExited,interactive:e,referenceObject:s,children:v("div",{className:"tooltip-content",children:[" ",r&&t]})})})}};let he=ht;he.defaultTimeout=500;he.defaultReshowTimeout=100;he.triggerReshowThreshold=300;he.shownTooltipCount=0;he.lastHiddenTime=Date.now();he.defaultProps={interactive:!1,options:{},popperClassName:"",reshowTimeout:ht.defaultReshowTimeout,timeout:ht.defaultTimeout,onExited:()=>{},"data-testid":void 0};const ac=100;var ul=(e=>(e.UP="UP",e.DOWN="DOWN",e))(ul||{});const Bn=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=pe((n,s)=>n.filter(i=>i.title.toLowerCase().indexOf(s.toLowerCase())>=0));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=wt(this.updateInputValue,ac),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(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){var o;const{options:t}=this.props,{menuIsOpen:n}=this.state,s=e?this.getCachedFilteredOptions(t,e):t,i=s.length===1&&s[0].title===e;if(this.setState({filteredOptions:s,keyboardOptionIndex:0}),i&&n){this.closeMenu();return}(o=this.popper.current)==null||o.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,s=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s&&(this.setState({title:s.title,invalid:!1}),this.fireOnChange(s.value)),this.closeMenu(),(i=this.input.current)==null||i.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Bn.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Bn.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===Bn.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===Bn.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){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuBlur(e){var t;e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:W("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?u("div",{className:"no-match",children:e}):n.map((s,i)=>this.renderOption(s,i))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,s=`option-${t}-${e.value}`;return u("button",{type:"button",className:W("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:i,spellCheck:o,"data-testid":r}=this.props,{title:l,menuIsOpen:a,popperOptions:c,invalid:d}=this.state;return v("div",{className:"aci-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:W("form-control",s,"aci-input",{"is-invalid":d&&!a}),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:o,"data-testid":r}),u(dn,{ref:this.popper,options:c,className:W("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let Do=Bn;Do.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({}),onChange:M.exports.func,inputPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultTitle:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,noMatchText:M.exports.string,"data-testid":M.exports.string};Do.defaultProps={onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0};Do.MENU_NAVIGATION_DIRECTION=ul;M.exports.string.isRequired,M.exports.func.isRequired,M.exports.string,M.exports.string,M.exports.bool,M.exports.bool,M.exports.string,M.exports.string,M.exports.string;M.exports.node.isRequired,M.exports.string,M.exports.object,M.exports.string;const cc=["primary","secondary","tertiary","success","danger","inline","ghost"],dc=["group-end"];function hc(e,t){switch(e){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 W("btn-link",{"btn-link-icon":t,"px-2":t})}}function uc(e){switch(e){case"group-end":return W("pl-2","pr-3")}}const Re=Q.forwardRef((e,t)=>{const{kind:n,variant:s,type:i,tooltip:o,icon:r,disabled:l,active:a,onClick:c,className:d,style:h,children:m,"data-testid":p}=e,f=hc(n,r&&!m);let b;s&&(b=uc(s));let C;r&&(C=Q.isValidElement(r)?r:u(G,{icon:r}));let w;o&&(w=typeof o=="string"?u(he,{children:o}):o);const T=v("button",{"data-testid":p,ref:t,type:i,className:W("btn",f,b,{active:a},d),onClick:c,style:h,disabled:l,children:[r&&C,m,o&&!l&&w]});return l?v("span",{className:"btn-disabled-wrapper",children:[T,o&&w]}):T});Re.displayName="Button";Re.propTypes={kind:M.exports.oneOf(cc).isRequired,variant:M.exports.oneOf(dc),type:M.exports.oneOf(["submit","reset","button"]),tooltip(e){const{tooltip:t,icon:n,children:s}=e;return!t&&n&&!s?new Error("Tooltip is required for icon only buttons"):null},icon(e){const{children:t,icon:n}=e;return!n&&!t?new Error("Icon is required if no children are provided"):!t&&!Q.isValidElement(n)&&!(n!=null&&n.iconName)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:M.exports.bool,active:M.exports.bool,onClick(e){const{onClick:t,type:n}=e;return n==="button"&&typeof t!="function"?new Error("type button requires an onClick function"):t!==void 0&&typeof t!="function"?new Error("onClick must be a function"):null},children:M.exports.node,className:M.exports.string,style:M.exports.object,"data-testid":M.exports.string};Re.defaultProps={type:"button",onClick:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const mc=({className:e="theme-bg-light",children:t,role:n="role",keyboard:s=!0,isOpen:i=!1,centered:o=!1,size:r,onOpened:l,onClosed:a,toggle:c,"data-testid":d})=>{const h=R.exports.useRef(),m=R.exports.useCallback(g=>{switch(g.key){case"Escape":c==null||c();break}},[c]);R.exports.useEffect(function(){if(i&&s)return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[m,i,s]),R.exports.useEffect(function(){i&&l&&l()},[l,i]),R.exports.useEffect(function(){!i&&a&&a()},[a,i]),i&&!h.current&&(h.current=document.createElement("div"),h.current.setAttribute("style","padding-right: 15px; display: block"),h.current.setAttribute("role","presentation"),document.body.appendChild(h.current));const p=()=>{h.current&&(document.body.removeChild(h.current),h.current=void 0)};return h.current?Io.createPortal(v(Ie,{children:[u(tt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearActive:"show",appearDone:"show"},timeout:bt.transitionMs,onExited:p,children:u("div",{className:W("modal-backdrop fade"),style:{zIndex:1050}})}),u(tt,{appear:!0,mountOnEnter:!0,unmountOnExit:!0,in:i,classNames:{appearDone:"show"},timeout:bt.transitionMs,onExited:p,children:u("div",{className:"modal fade",onClick:c,role:"dialog",style:{display:"block"},children:u("div",{className:W(`modal-dialog ${e}`,{"modal-lg":r==="lg","modal-sm":r==="sm","modal-xl":r==="xl","modal-dialog-centered":o}),style:{zIndex:1040},children:u("div",{className:"modal-content",onClick:g=>g.stopPropagation(),role:"presentation","data-testid":d,children:t})})})})]}),h.current):u(Ie,{})},pc=({className:e="modal-body",style:t,children:n,"data-testid":s})=>u("div",{className:e,"data-testid":s,style:t,children:n}),gc=({className:e,children:t,closeButton:n=!0,style:s,toggle:i,"data-testid":o})=>v("div",{className:`modal-header ${e}`,style:s,children:[u("h5",{className:"modal-title",children:t}),n&&u("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",onClick:i,children:u("span",{"aria-hidden":"true",children:"\xD7"})})]});M.exports.bool.isRequired,M.exports.string.isRequired,M.exports.oneOfType([M.exports.string,M.exports.func]).isRequired,M.exports.func,M.exports.func.isRequired,M.exports.func,M.exports.func,M.exports.string,M.exports.string,M.exports.string,M.exports.node,M.exports.string;const xi=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,onClick:o,style:r,id:l}=e;return u("button",{ref:t,type:"button",className:W("btn",s),onClick:o,style:r,disabled:i,id:l,children:n})});xi.displayName="Button";xi.propTypes={children:M.exports.node,className:M.exports.string,disabled:M.exports.bool,onClick:M.exports.func,style:M.exports.shape({}),id:M.exports.string};xi.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};function to(e){return e.then!==void 0}const Sn=class{static disableAllActions(){Sn.actionsDisabled=!0}static enableAllActions(){Sn.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||!Array.isArray(e))return[];const t=e.slice();return t.sort(Sn.compareActions),t}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Sn.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=Sn.getModifierKey();return e[t]}static copyToClipboard(e){const{clipboard:t}=navigator;return t===void 0?(Sn.copyToClipboardExecCommand(e),Promise.resolve()):navigator.clipboard.writeText(e).catch(()=>{Sn.copyToClipboardExecCommand(e)})}static copyToClipboardExecCommand(e){const t=document.activeElement,n=document.createElement("textarea");if(n.value=e,document.body.appendChild(n),n.focus(),n.select(),!document.execCommand("copy"))throw new Error("Unable to execute copy command");document.body.removeChild(n),t instanceof HTMLElement&&t.focus()}static getMenuItems(e,t=!0){let n=[],s=e;Array.isArray(s)||(s=[s]);for(let i=0;i<s.length;i+=1){const o=s[i];let r;typeof o=="function"?r=o():r=o,r!=null&&(r instanceof Promise?t&&n.push(r):Array.isArray(r)?n=n.concat(r):n.push(r))}return n=n.filter(i=>i.title||i.then||i.menuElement),n}static getNextMenuItem(e,t,n){let s=e;s<0&&t<0&&(s=n.length);for(let i=1;i<n.length+1;i+=1){const o=(s+t*i+n.length)%n.length,r=n[o];if(!(r instanceof Promise)&&r.disabled!==!0)return o}return e}};let we=Sn;we.actionsDisabled=!1;const Cr=ee.module("GlobalContextAction");class fc extends R.exports.Component{constructor(t){super(t),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(t){const n=t;n.contextActions||(n.contextActions=[]);const{action:s}=this.props;!s.title&&!s.menuElement||(n.contextActions||(n.contextActions=[]),n.contextActions.push(s),Cr.debug("Received context menu event at window action! Menu items are now: ",n.contextActions))}handleKeyDown(t){var s,i;const{action:n}=this.props;if(!we.actionsDisabled&&((s=n.shortcut)==null?void 0:s.matchesEvent(t))){Cr.debug("Global hotkey matched!",t);const o=(i=n.action)==null?void 0:i.call(n,t);(o||o===void 0)&&(t.preventDefault(),t.stopPropagation())}}render(){return null}}class Cc extends R.exports.Component{render(){const{actions:t,"data-testid":n}=this.props,s=[];for(let i=0;i<t.length;i+=1){const o=t[i],{shortcut:r}=o;if(o.title||o.menuElement||r){const l=u(fc,{action:o,"data-testid":n},`${o.title}.${r==null?void 0:r.id}`);s.push(l)}}return s}}const ri=ee.module("ContextActions");class ne extends R.exports.Component{constructor(t){super(t),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=Q.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(t,n,s,i){if(!t||!n||!s||!i)return;const o=new MouseEvent("contextmenu",{clientX:n,clientY:s,bubbles:!0,cancelable:!0});o.contextActions=i,t.dispatchEvent(o)}static getDerivedStateFromProps(t){if(!t.actions||!Array.isArray(t.actions))return{globalActions:[],keyboardActions:[]};const n=t.actions.filter(i=>!to(i)&&typeof i!="function"&&i.isGlobal),s=t.actions.filter(i=>!to(i)&&typeof i!="function"&&!i.isGlobal&&i.shortcut!=null);return{globalActions:n,keyboardActions:s}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(t){const{ignoreClassNames:n=[]}=this.props;if(n.length>0){let i=t.target;for(;i!=null;){const{classList:o}=i,r=n.find(l=>o.contains(l));if(r!==void 0){ri.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}i=i.parentElement}}if(we.isContextActionEvent(t)||(t.contextActions=[]),!we.isContextActionEvent(t))return;const{actions:s}=this.props;if(s){let i=s;Array.isArray(i)&&(i=i.filter(o=>to(o)||typeof o=="function"||!o.isGlobal)),t.contextActions=t.contextActions.concat(i)}ri.debug("Received context menu event! Menu items are now: ",t.contextActions)}handleKeyDown(t){var s,i;const{keyboardActions:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o];if(!we.actionsDisabled&&((s=r.shortcut)==null?void 0:s.matchesEvent(t))){ri.debug("Context hotkey matched!",t);const l=(i=r.action)==null?void 0:i.call(r,t);if(l||l===void 0){t.stopPropagation(),t.preventDefault();return}ri.debug2("Matched hotkey returned false, key event not consumed")}}}render(){const{"data-testid":t}=this.props,{globalActions:n}=this.state;return u("div",{className:"context-actions-listener",ref:this.container,"data-testid":t,children:u(Cc,{actions:n})})}}ne.groups={default:null,high:100,medium:5e3,low:1e4,window:1e5,edit:100};var bc={prefix:"vs",iconName:"arrow-left",icon:[512,512,[],"f000","m224 98.976 -160 160V281.6l160 160 22.624 -22.624 -132.672 -132.704H448v-32H113.92L246.656 121.6 224 98.976z"]},Qn={prefix:"vs",iconName:"check",icon:[512,512,[],"f000","m461.792 106.336 -271.04 320 -25.28 -1.152 -107.2 -152.64 26.176 -18.368 95.296 135.68 257.632 -304.192 24.448 20.672z"]},wc={prefix:"vs",iconName:"chevron-down",icon:[512,512,[],"f000","m255.232 322.304 139.424 -139.424 19.84 19.776L265.088 352h-19.776L96 202.656l19.808 -19.776 139.424 139.424z"]},Sc={prefix:"vs",iconName:"chevron-left",icon:[512,512,[],"f000","m189.696 255.232 139.424 139.424 -19.776 19.84L160 265.088v-19.776L309.344 96l19.776 19.808 -139.424 139.424z"]},ml={prefix:"vs",iconName:"chevron-right",icon:[512,512,[],"f000","M322.304 256.768 182.88 117.344l19.776 -19.84L352 246.912v19.776L202.656 416l-19.776 -19.808 139.424 -139.424z"]},vc={prefix:"vs",iconName:"chevron-up",icon:[512,512,[],"f000","m256.768 189.696 -139.424 139.424 -19.84 -19.776L246.912 160h19.776L416 309.344l-19.808 19.776 -139.424 -139.424z"]},Fo={prefix:"vs",iconName:"circle-large-filled",icon:[512,512,[],"f000","M256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568 229.024 229.024 0 0 1 -80.512 80.288 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32z"]},Tc={prefix:"vs",iconName:"circle-large-outline",icon:[512,512,[],"f000","M306.816 70.88A185.856 185.856 0 0 0 256 64c-17.728 0 -34.624 2.336 -50.816 6.88l-0.192 0.064c-16.448 4.512 -31.68 10.944 -45.824 19.232A196.992 196.992 0 0 0 90.24 159.36l-0.064 0.128A190.944 190.944 0 0 0 70.72 205.12 191.552 191.552 0 0 0 64 256c0 17.76 2.24 34.72 6.72 50.912a193.6 193.6 0 0 0 49.536 84.832c11.84 11.68 24.768 21.664 38.912 30.08a195.2 195.2 0 0 0 45.92 19.488A192.64 192.64 0 0 0 256 448c17.76 0 34.72 -2.24 50.912 -6.72 16.48 -4.64 31.68 -11.136 45.632 -19.424l0.128 -0.064a197.12 197.12 0 0 0 69.152 -68.96 187.2 187.2 0 0 0 19.2 -45.824l0.096 -0.192A185.824 185.824 0 0 0 448 256c0 -17.728 -2.304 -34.624 -6.88 -50.816l-0.064 -0.192a184.704 184.704 0 0 0 -19.2 -45.536l-0.064 -0.128a188.8 188.8 0 0 0 -30.144 -38.72l-0.256 -0.256a188.864 188.864 0 0 0 -38.72 -30.144l-0.128 -0.064a184.704 184.704 0 0 0 -45.536 -19.2l-0.192 -0.064zm142.56 298.24a229.024 229.024 0 0 1 -80.512 80.256 222.912 222.912 0 0 1 -53.376 22.72A223.488 223.488 0 0 1 256 480a223.488 223.488 0 0 1 -59.52 -7.872 227.136 227.136 0 0 1 -53.568 -22.752 233.6 233.6 0 0 1 -45.28 -35.008 233.44 233.44 0 0 1 -35.008 -45.28 227.136 227.136 0 0 1 -22.72 -53.6A223.52 223.52 0 0 1 32 256c0 -20.576 2.624 -40.384 7.872 -59.52a222.976 222.976 0 0 1 22.752 -53.344 228.992 228.992 0 0 1 80.288 -80.512 220.64 220.64 0 0 1 53.6 -22.528A217.856 217.856 0 0 1 256 32a217.6 217.6 0 0 1 59.52 8.096 220.768 220.768 0 0 1 98.656 57.76 220.896 220.896 0 0 1 57.728 98.656C477.312 215.616 480 235.424 480 256s-2.688 40.384 -8.096 59.52a220.8 220.8 0 0 1 -22.528 53.568z"]},br={prefix:"vs",iconName:"clippy",icon:[512,512,[],"f000","M224 447.744H128v-288h256v64h32v-80l-16 -16H352v-32h-32a64 64 0 0 0 -128 0H158.08v32H112l-16 16v320l16 16H224v-32zm0 -358.4a32 32 0 0 1 25.6 -25.6 32 32 0 0 1 18.56 1.92 30.08 30.08 0 0 1 14.4 11.52 32 32 0 1 1 -56 30.08 32 32 0 0 1 -2.56 -17.92zm226.56 302.72L416 426.944v-171.2h-32v170.88l-34.56 -34.56 -22.72 22.72 62.08 61.76h22.72l61.76 -61.76 -22.72 -22.72zm-189.44 -133.12h22.72l61.76 61.76 -22.72 22.72 -34.56 -34.56v170.88h-32v-171.2l-34.56 34.88 -22.72 -22.72 62.08 -61.76z"]},Oi={prefix:"vs",iconName:"close",icon:[512,512,[],"f000","m256 278.624 116.672 116.704 22.656 -22.624L278.624 256l116.704 -116.672 -22.624 -22.656L256 233.376 139.328 116.672l-22.624 22.656L233.376 256l-116.672 116.672 22.624 22.656L256 278.624z"]},Ec={prefix:"vs",iconName:"cloud-download",icon:[512,512,[],"f000","M382.624 192h1.6a95.68 95.68 0 0 1 67.712 28.128 96.096 96.096 0 0 1 0 135.744 95.68 95.68 0 0 1 -67.744 28.128v-32a64.064 64.064 0 0 0 0 -128h-29.248l-3.936 -27.424a79.68 79.68 0 0 0 -68.032 -67.904A79.296 79.296 0 0 0 199.392 176l-10.656 24.384 -25.888 -6.048A79.68 79.68 0 0 0 144.736 192c-21.184 0 -41.504 8.416 -56.448 23.424A80.096 80.096 0 0 0 144.736 352h15.936v32h-15.936a111.552 111.552 0 0 1 -84.096 -37.12 112.064 112.064 0 0 1 62.656 -184.96 110.784 110.784 0 0 1 46.976 1.28 111.552 111.552 0 0 1 117.024 -65.92A111.328 111.328 0 0 1 382.624 192zm-168 163.872 42.048 42.048V224h31.808v172.8l40.896 -40.928 22.624 22.624 -68.672 68.704h-22.656L192 378.528l22.624 -22.656z"]},pl={prefix:"vs",iconName:"copy",icon:[512,512,[],"f000","m128 128 32 -32h173.248L448 210.752V448l-32 32H160l-32 -32V128zm288 96 -96 -96H160v320h256V224zM96 32 64 64v320l32 32V64h205.248l-32 -32H96z"]},gl={prefix:"vs",iconName:"edit",icon:[512,512,[],"f000","M423.36 32h-46.72L112.64 296l-5.12 7.04L32 434.88 77.12 480l131.84 -75.52 7.04 -5.12L480 135.36V88.64L423.36 32zM77.12 434.88l48.32 -96 46.4 46.4 -94.72 49.6zm122.56 -65.92L143.04 312.32l256 -256 56.64 56.64 -256 256z"]},wr={prefix:"vs",iconName:"file-code",icon:[512,512,[],"f000","m338.24 36.48 104.96 105.6 4.8 11.52v310.4l-16 16h-352l-16 -16v-416l16 -16h247.04l11.2 4.48zM320 160h96l-96 -96v96zM96 64v384h320V192H304L288 176V64H96zm65.984 241.056 58.144 -58.496L197.44 224 128 293.728v22.624l69.472 69.568 22.624 -22.624 -58.112 -58.24zM281.6 246.848l22.4 -22.688 70.048 69.6v22.688L304 385.984l-22.56 -22.688 58.592 -58.24L281.6 246.848z"]},Rc={prefix:"vs",iconName:"file-zip",icon:[512,512,[],"f000","M80 32h352l16 16v160l-4.8 11.2 -27.2 27.52v217.28l-16 16h-320l-16 -16v-416l16 -16zM192 64H160v64h32V64zm0 384h128V245.76l-27.2 -27.2L288 207.04V64H224v80l-16 16H192v32H160V160h-16L128 144V64H96v384h64v-32h32v32zm0 -64v32h32v-32H192zm0 -32v32H160v-32h32zm0 -32h32v32H192v-32zm0 -32v32H160V288h32zm0 -32h32v32H192V256zm0 -32v32H160V224h32zm0 0h32V192H192v32zm196.8 4.8 27.2 -27.52V64h-96v136.64l27.2 27.2 4.8 11.2V448h32V240l4.8 -11.2z"]},yc={prefix:"vs",iconName:"files",icon:[512,512,[],"f000","M373.333 0h-192L149.333 32V128H53.333L21.333 160v321.493L53.333 512h257.493L341.333 481.493V384h100.267l27.733 -30.507V96L373.333 0zm0 45.227 50.773 50.773H373.333V45.227zm-64 434.773h-256v-320H149.333v193.493L181.333 384h128v96zm128 -128h-256v-320H341.333V128h96v224z"]},Si={prefix:"vs",iconName:"filter",icon:[512,512,[],"f000","M480 64v53.44l-160 152.288V448H192V269.728l-160 -152.32V64h448zM224 256v160h64V256l160 -152.32V96H64v7.68L224 256z"]},Ic={prefix:"vs",iconName:"gear",icon:[512,512,[],"f000","M291.2 140.8 275.2 64H236.8l-16 76.8 -22.4 9.6 -64 -41.6 -28.8 25.6 41.6 64 -6.4 22.4 -76.8 16v38.4l76.8 16 9.6 25.6 -41.6 64 25.6 25.6 64 -41.6 25.6 9.6 12.8 73.6h38.4l16 -76.8 25.6 -9.6 64 41.6 25.6 -25.6 -41.6 -64 9.6 -25.6 73.6 -12.8V236.8l-76.8 -16 -9.6 -25.6 41.6 -64 -25.6 -25.6 -64 41.6 -22.4 -6.4zM300.8 32l16 76.8L384 67.2l64 64 -44.8 67.2 76.8 12.8v89.6l-76.8 16L448 384l-64 64 -67.2 -44.8 -16 76.8H211.2l-16 -76.8L128 444.8l-64 -64 44.8 -67.2L32 300.8V211.2l76.8 -16L67.2 128l64 -64 67.2 44.8 12.8 -76.8h89.6zm19.2 224c0 35.2 -28.8 64 -64 64s-64 -28.8 -64 -64 28.8 -64 64 -64 64 28.8 64 64zM256 288c19.2 0 32 -12.8 32 -32s-12.8 -32 -32 -32 -32 12.8 -32 32 12.8 32 32 32z"]},fl={prefix:"vs",iconName:"graph",icon:[512,512,[],"f000","M48 448H480v-32H64V0H32v432l16 16zM96 368v-256l16 -16h64l16 16v256l-16 16h-64l-16 -16zm64 -16V128H128v224h32zm192 -304v320l16 16h64l16 -16v-320l-16 -16h-64l-16 16zm64 16v288h-32V64h32zm-192 304v-192l16 -16h64l16 16v192l-16 16h-64l-16 -16zm64 -16V192H256v160h32z"]},ki={prefix:"vs",iconName:"gripper",icon:[512,512,[],"f000","M160 96h64v64H160zm0 128h64v64H160zm0 128h64v64H160zm128 -256h64v64H288zm0 128h64v64H288zm0 128h64v64H288z"]},Mc={prefix:"vs",iconName:"json",icon:[512,512,[],"f000","M192 95.488V64h-2.88c-10.016 0 -19.712 1.984 -29.088 5.92a74.56 74.56 0 0 0 -24.8 16.96 71.36 71.36 0 0 0 -15.776 24.096v0.032a113.344 113.344 0 0 0 -6.336 26.56v0.064a194.56 194.56 0 0 0 -0.768 27.616c0.384 9.28 0.576 18.56 0.576 27.808 0 6.496 -1.28 12.576 -3.744 18.304v0.032a48.128 48.128 0 0 1 -24.48 25.184 44.032 44.032 0 0 1 -17.856 3.68H64v31.488h2.88c6.24 0 12.16 1.28 17.792 3.872l0.032 0.032c5.696 2.496 10.528 5.888 14.56 10.176l0.064 0.064c4.16 4.16 7.456 9.12 9.824 14.88l0.032 0.064c2.496 5.76 3.744 11.776 3.744 18.112 0 9.28 -0.192 18.56 -0.576 27.808 -0.384 9.472 -0.128 18.72 0.768 27.84v0.032c1.056 9.056 3.168 17.856 6.304 26.368v0.032c3.392 8.736 8.672 16.768 15.808 24.096 7.136 7.36 15.424 13.024 24.8 16.96 9.376 3.936 19.072 5.92 29.12 5.92H192v-31.488h-2.88c-6.4 0 -12.384 -1.216 -18.016 -3.68a51.616 51.616 0 0 1 -14.624 -10.24 53.088 53.088 0 0 1 -9.888 -14.944c-2.368 -5.76 -3.52 -11.84 -3.52 -18.336 0 -7.296 0.096 -14.496 0.352 -21.504 0.256 -7.296 0.256 -14.4 0 -21.28a148.448 148.448 0 0 0 -1.76 -20.48 85.824 85.824 0 0 0 -5.376 -19.488A73.088 73.088 0 0 0 112.704 256a73.088 73.088 0 0 0 23.616 -30.56c2.56 -6.144 4.32 -12.576 5.376 -19.264 1.056 -6.72 1.632 -13.536 1.76 -20.48 0.256 -7.04 0.256 -14.144 0 -21.312 -0.256 -7.168 -0.384 -14.4 -0.384 -21.696a47.04 47.04 0 0 1 28.064 -43.328 42.56 42.56 0 0 1 18.016 -3.872H192zm128 321.024V448h2.88c10.016 0 19.712 -1.984 29.088 -5.92 9.376 -3.936 17.664 -9.6 24.8 -16.96 7.136 -7.36 12.416 -15.36 15.776 -24.096v-0.032c3.2 -8.512 5.28 -17.376 6.336 -26.56v-0.064c0.896 -8.96 1.152 -18.144 0.768 -27.616 -0.384 -9.28 -0.576 -18.56 -0.576 -27.808 0 -6.496 1.28 -12.576 3.744 -18.304v-0.032a48.064 48.064 0 0 1 24.48 -25.184 44.16 44.16 0 0 1 17.856 -3.68H448v-31.488h-2.88c-6.272 0 -12.192 -1.28 -17.824 -3.872l-0.032 -0.032a44.032 44.032 0 0 1 -14.56 -10.176l-0.064 -0.064a45.28 45.28 0 0 1 -9.824 -14.88v-0.064a44.96 44.96 0 0 1 -3.776 -18.112c0 -9.28 0.192 -18.56 0.576 -27.808a197.568 197.568 0 0 0 -0.768 -27.84v-0.032a113.184 113.184 0 0 0 -6.304 -26.368v-0.032a71.36 71.36 0 0 0 -15.808 -24.096 74.592 74.592 0 0 0 -24.8 -16.96 74.4 74.4 0 0 0 -29.12 -5.92H320v31.488h2.88c6.4 0 12.384 1.216 17.984 3.68 5.568 2.624 10.432 6.016 14.624 10.24 4.064 4.288 7.36 9.28 9.888 14.944 2.368 5.76 3.52 11.84 3.52 18.336 0 7.296 -0.096 14.464 -0.352 21.504 -0.256 7.296 -0.256 14.4 0 21.28 0.128 7.104 0.704 13.92 1.76 20.48 1.056 6.848 2.848 13.312 5.376 19.488a73.12 73.12 0 0 0 23.616 30.56 73.12 73.12 0 0 0 -23.616 30.56 86.048 86.048 0 0 0 -5.376 19.264c-1.056 6.72 -1.632 13.536 -1.76 20.48a292.8 292.8 0 0 0 0 21.312c0.256 7.168 0.384 14.4 0.384 21.696a47.072 47.072 0 0 1 -28.064 43.328 42.56 42.56 0 0 1 -18.016 3.872H320z"]},Nc={prefix:"vs",iconName:"kebab-vertical",icon:[512,512,[],"f000","M238.208 442.624a32 32 0 1 0 35.552 -53.216 32 32 0 0 0 -35.52 53.184zM256 288a32 32 0 1 1 0 -64 32 32 0 0 1 0 64zm0 -160a32 32 0 1 1 0 -64 32 32 0 0 1 0 64z"]},Dc={prefix:"vs",iconName:"link-external",icon:[512,512,[],"f000","M48 32H192v32H64v384h384v-128h32v144l-16 16h-416l-16 -16v-416l16 -16zm432 16V256h-32V86.624L231.776 302.88l-22.624 -22.656L425.376 64H256V32h208l16 16z"]},Cl={prefix:"vs",iconName:"link",icon:[512,512,[],"f000","M140.8 96h98.72a108.8 108.8 0 0 1 108.8 108.8v6.56A108.8 108.8 0 0 1 239.52 320H224V288h15.52A76.8 76.8 0 0 0 316.16 211.52V204.8A76.8 76.8 0 0 0 239.68 128H140.8A76.8 76.8 0 0 0 64 204.8v6.56A76.608 76.608 0 0 0 128 286.72v32a108.8 108.8 0 0 1 -96 -107.2V204.8A108.96 108.96 0 0 1 140.8 96zM384 225.28v-32a108.8 108.8 0 0 1 96 107.52v6.56A108.96 108.96 0 0 1 371.36 416h-98.88A108.8 108.8 0 0 1 163.84 307.52V300.8A108.8 108.8 0 0 1 272.48 192H288v32h-15.52A76.8 76.8 0 0 0 195.84 300.8v6.56A76.8 76.8 0 0 0 272.48 384h98.88A76.8 76.8 0 0 0 448 307.52V300.8a76.608 76.608 0 0 0 -64 -75.52z"]},Fc={prefix:"vs",iconName:"list-ordered",icon:[512,512,[],"f000","M73.184 74.432 86.144 64h21.664v96h-22.656V89.344l-11.968 8.992v-23.904zM160 96h320v32H160V96zm0 128h320v32H160V224zm320 128H160v32h320v-32zM119.744 244.032l0.928 -1.248 2.08 -2.88a26.88 26.88 0 0 0 4.992 -16.224c0 -3.84 -0.64 -7.68 -1.824 -11.328a27.136 27.136 0 0 0 -15.744 -16.928 35.936 35.936 0 0 0 -14.464 -2.624 35.008 35.008 0 0 0 -14.656 2.784 27.744 27.744 0 0 0 -15.328 16.704A33.216 33.216 0 0 0 64 222.624v1.6h25.92v-1.6a9.6 9.6 0 0 1 1.472 -5.024 5.568 5.568 0 0 1 1.824 -1.728 6.08 6.08 0 0 1 5.504 0 6.016 6.016 0 0 1 1.792 1.92 7.68 7.68 0 0 1 0.992 2.592 14.24 14.24 0 0 1 -1.152 9.28 41.888 41.888 0 0 1 -3.84 5.824l-32 36.416 -0.384 0.416v17.28h63.616v-22.4h-28.8l20.8 -23.168zm-1.184 122.144c1.472 1.024 2.752 2.24 3.84 3.648a26.912 26.912 0 0 1 5.344 17.6c0 3.424 -0.544 6.816 -1.6 10.048a25.344 25.344 0 0 1 -15.584 16 41.216 41.216 0 0 1 -15.36 2.528c-3.68 0 -7.36 -0.512 -10.912 -1.568a30.08 30.08 0 0 1 -8.256 -3.936 24.032 24.032 0 0 1 -5.824 -5.664 34.016 34.016 0 0 1 -3.712 -6.4A33.216 33.216 0 0 1 64 386.496v-1.568h26.048v1.568c0 0.864 0.096 1.76 0.288 2.624a6.624 6.624 0 0 0 0.96 2.368 4.48 4.48 0 0 0 1.696 1.664 6.4 6.4 0 0 0 5.024 0.256 5.088 5.088 0 0 0 1.792 -1.248 7.04 7.04 0 0 0 1.344 -2.4 13.344 13.344 0 0 0 0.544 -4.032 15.456 15.456 0 0 0 -0.704 -5.216 6.4 6.4 0 0 0 -1.632 -2.56 4.416 4.416 0 0 0 -1.92 -0.928 17.184 17.184 0 0 0 -2.464 -0.224h-5.152v-20.64h5.376a7.712 7.712 0 0 0 2.208 -0.352 5.248 5.248 0 0 0 2.08 -1.088 5.6 5.6 0 0 0 1.536 -2.144 9.152 9.152 0 0 0 0.672 -3.872 8.96 8.96 0 0 0 -0.512 -3.2 5.312 5.312 0 0 0 -3.104 -3.168 6.4 6.4 0 0 0 -4.992 0.224 5.248 5.248 0 0 0 -1.76 1.696 11.008 11.008 0 0 0 -1.28 4.992v1.568H64v-1.568a31.584 31.584 0 0 1 5.76 -17.408 25.6 25.6 0 0 1 5.728 -5.952 27.84 27.84 0 0 1 8.384 -4.256c3.648 -1.152 7.488 -1.696 11.328 -1.632 3.712 -0.032 7.392 0.32 11.008 1.152 2.944 0.672 5.76 1.76 8.416 3.2a24.224 24.224 0 0 1 10.24 10.176 23.36 23.36 0 0 1 2.88 11.104 25.92 25.92 0 0 1 -5.344 16.896 17.984 17.984 0 0 1 -3.84 3.648z"]},xc={prefix:"vs",iconName:"loading",icon:[512,512,[],"f000","M445.344 224A192.064 192.064 0 0 0 66.656 224H34.272a224.064 224.064 0 0 1 443.456 0h-32.384z"]},Oc={prefix:"vs",iconName:"lock",icon:[512,512,[],"f000","M416 224h-32V160a128 128 0 1 0 -256 0v64H96L64 256v192l32 32h320l32 -32V256l-32 -32zM160 160a96 96 0 1 1 192 0v64H160V160zm256 288H96V256h320v192z"]},kc={prefix:"vs",iconName:"menu",icon:[512,512,[],"f000","M512 160H0V128h512v32zm0 256H0v-32h512v32zm0 -128.256H0V256h512v31.744z"]},Ac={prefix:"vs",iconName:"new-file",icon:[512,512,[],"f000","m304 35.2 108.8 112 3.2 12.8v64h-32V192H256V64H96v352h128v32H80l-16 -16v-384l16 -16h214.4l9.6 3.2zM288 64v96h92.8L288 64zm128 448h-32v-96H288v-32h96V288h32v96h96v32h-96v96z"]},bl={prefix:"vs",iconName:"pass-filled",icon:[512,512,[],"f000","M256 480A224 224 0 1 0 256 32a224 224 0 0 0 0 448zm-32.64 -132.16h-22.72L128 275.2l22.72 -22.72 61.44 61.44 134.4 -134.72 22.72 22.72 -145.92 145.92z"]},wl={prefix:"vs",iconName:"pass",icon:[512,512,[],"f000","M200.64 347.84h22.72l145.92 -145.92 -22.72 -22.72 -134.4 134.72 -61.44 -61.44L128 275.2l72.64 72.64zM275.2 32c51.2 3.2 99.2 28.8 134.4 64 41.6 44.8 64 99.2 64 163.2 0 51.2 -19.2 99.2 -51.2 140.8 -32 38.4 -76.8 67.2 -128 76.8 -51.2 9.6 -102.4 3.2 -147.2 -22.4 -44.8 -25.6 -80 -64 -99.2 -112C28.8 294.4 25.6 240 41.6 192c16 -51.2 44.8 -92.8 89.6 -121.6C172.8 41.6 224 28.8 275.2 32zm16 412.8c41.6 -9.6 80 -32 108.8 -67.2 25.6 -35.2 41.6 -76.8 38.4 -121.6 0 -51.2 -19.2 -102.4 -54.4 -137.6 -32 -32 -70.4 -51.2 -115.2 -54.4 -41.6 -3.2 -86.4 6.4 -121.6 32 -35.2 25.6 -60.8 60.8 -73.6 105.6 -12.8 41.6 -12.8 86.4 6.4 128 19.2 41.6 48 73.6 86.4 96 38.4 22.4 83.2 28.8 124.8 19.2z"]},Lc={prefix:"vs",iconName:"play",icon:[512,512,[],"f000","M120.96 64 96 77.12v384l24.96 13.44 288 -192V256l-288 -192zM128 431.36V107.2l243.2 162.24L128 431.36z"]},Hc={prefix:"vs",iconName:"preview",icon:[512,512,[],"f000","M64 64h384l32 32v320l-32 32H64l-32 -32V96l32 -32zm0 352h384V96H64v320zm352 -288H96v96h320V128zm-32 64H128V160h256v32zm-96 192h128V256H288v128zm32 -96h64v64h-64V288zM224 256H96v32h128V256zm-128 96h128v32H96v-32z"]},Xt={prefix:"vs",iconName:"remove",icon:[512,512,[],"f000","M480 256H32V224h448v32z"]},Pc={prefix:"vs",iconName:"reply",icon:[512,512,[],"f000","m201.792 68.672 -128.64 128.64v22.656l128.64 128.64 22.656 -22.624L121.824 223.36H182.08c90.016 0 147.36 19.36 182.56 55.328 35.264 36 51.68 92.064 51.68 173.472v11.2h32v-11.2c0 -84.672 -16.864 -151.04 -60.8 -195.872C343.52 211.36 275.744 191.36 182.08 191.36H124.384l100.064 -100.032 -22.656 -22.656z"]},_c={prefix:"vs",iconName:"ruby",icon:[512,512,[],"f000","m32 230.08 212.48 212.48h23.04L480 230.08v-23.04l-106.24 -106.24 -11.52 -4.8H149.76l-11.52 4.8L32 207.04v23.04zm224 177.92L66.56 218.56 156.48 128h199.04l89.92 90.56L256 408zm0 -247.36h86.08l57.92 57.92 -144 140.8V160.64z"]},Sl={prefix:"vs",iconName:"search",icon:[512,512,[],"f000","M325.333 0a176 176 0 0 0 -131.84 292.693L21.333 488.107l23.893 21.333 171.733 -194.56A176.021 176.021 0 1 0 325.333 0.213V0zm0 320a144 144 0 1 1 0 -288 144 144 0 0 1 0 288z"]},Vc={prefix:"vs",iconName:"split-horizontal",icon:[512,512,[],"f000","M448 32H96L64 64v352l32 32h352l32 -32V64l-32 -32zM256 416H96V64h160v352zm192 0H288V64h160v352z"]},Uc={prefix:"vs",iconName:"symbol-operator",icon:[512,512,[],"f000","M91.936 35.2c10.72 4.352 19.264 12.736 23.84 23.36 2.304 5.44 3.488 11.264 3.424 17.184a42.88 42.88 0 0 1 -19.52 36.32 43.488 43.488 0 0 1 -24.096 7.136A43.36 43.36 0 0 1 32 75.584a43.36 43.36 0 0 1 26.56 -40.192A43.84 43.84 0 0 1 91.936 35.2zm-9.536 56.48a17.632 17.632 0 0 0 10.624 -16 17.536 17.536 0 1 0 -10.624 16zM205.76 35.488 35.52 205.76l21.952 21.984 170.24 -170.24 -21.952 -21.984zM368 288h32v80H480v32h-80V480h-32v-80H288v-32h80V288zm-183.424 16.8 22.624 22.624L150.624 384l56.576 56.576 -22.624 22.624L128 406.624l-56.576 56.576 -22.624 -22.624L105.376 384l-56.576 -56.576 22.624 -22.624L128 361.376l56.576 -56.576zm43.2 -134.24a43.296 43.296 0 0 0 -40.192 -26.56 43.36 43.36 0 0 0 -40.192 26.56 43.584 43.584 0 0 0 40.224 60.64A43.456 43.456 0 0 0 227.776 170.56zm-24.096 23.84a17.696 17.696 0 0 1 -9.248 9.28 17.504 17.504 0 0 1 -19.168 -3.744 16.928 16.928 0 0 1 -3.744 -5.536 17.408 17.408 0 0 1 22.912 -22.88 18.08 18.08 0 0 1 5.536 3.712 17.568 17.568 0 0 1 3.712 19.168zM448 96h-128v32h128V96z"]},Sr={prefix:"vs",iconName:"terminal",icon:[512,512,[],"f000","M64 32 32 64v384L64 480h384l32 -32V64L448 32H64zM64 448V64h384v384H64zm120.661 -85.547 22.144 22.635 112.213 -111.851v-19.456l-112.213 -112.213 -22.08 22.613 97.92 100.309 -97.984 97.963z"]},Bc={prefix:"vs",iconName:"tools",icon:[512,512,[],"f000","m472.736 111.52 -24.96 -5.888 -67.456 67.072 -38.208 -38.912 65.792 -69.024 -5.76 -25.344a141.44 141.44 0 0 0 -43.104 -7.296 116.48 116.48 0 0 0 -46.624 8.96 122.368 122.368 0 0 0 -37.952 26.88 119.552 119.552 0 0 0 -28 40.48 126.016 126.016 0 0 0 0 94.912 10730.912 10730.912 0 0 0 -197.536 199.488c-6.72 8.8 -9.92 19.776 -9.088 30.816a44.896 44.896 0 0 0 14.848 30.944c3.968 4.32 8.704 7.904 13.984 10.496 5.44 2.4 11.296 3.776 17.216 4.064 10.112 -0.192 19.808 -4.032 27.328 -10.784 49.536 -46.624 144.448 -142.4 198.368 -198.528 14.624 6.208 30.336 9.408 46.208 9.376a119.552 119.552 0 0 0 85.664 -36.256 124.32 124.32 0 0 0 35.552 -87.36 134.752 134.752 0 0 0 -6.272 -44.096zM93.856 445.696a9.92 9.92 0 0 1 -4.32 2.24 13.984 13.984 0 0 1 -4.768 0 11.072 11.072 0 0 1 -4.608 -1.824 10.752 10.752 0 0 1 -3.648 -3.52c-4.48 -4.576 -8.672 -13.28 -4.48 -18.176 43.84 -46.624 134.112 -137.76 190.56 -193.472 3.2 4.224 6.72 8.256 10.496 12.032 3.776 3.936 7.84 7.584 12.16 10.912 -54.592 56 -143.616 146.048 -191.36 191.808zm355.776 -290.08c0.064 24.48 -9.472 48 -26.624 65.536a91.552 91.552 0 0 1 -128.224 0 95.744 95.744 0 0 1 -20.32 -100.384A87.936 87.936 0 0 1 324.48 69.76a88.32 88.32 0 0 1 34.304 -6.848h8.128L308.768 122.848v22.272l60.64 60.352h21.12l59.104 -58.112v8.256zM103.68 214.016h48.992l22.56 22.944 21.696 -21.568 -21.28 -21.696V192.32l1.824 -52.768 -7.04 -13.984 -91.52 -60.224 -18.912 2.112 -26.592 27.168 -2.112 19.168 58.816 93.376 13.568 6.88zm-30.24 -116.224L147.488 146.56 146.24 182.496H111.808L64.064 106.912l9.376 -9.12zm227.36 222.72 21.568 -21.536 99.392 101.92a47.328 47.328 0 0 1 0 65.248 44.928 44.928 0 0 1 -49.568 10.08 41.92 41.92 0 0 1 -13.984 -10.08l-100.544 -102.496 21.728 -21.696 100.224 102.208a12.864 12.864 0 0 0 4.896 3.36 15.264 15.264 0 0 0 11.488 0 12.896 12.896 0 0 0 4.896 -3.36 13.952 13.952 0 0 0 3.2 -4.896 16.8 16.8 0 0 0 1.152 -5.888 17.504 17.504 0 0 0 -1.12 -5.888 13.952 13.952 0 0 0 -3.2 -4.896L300.8 320.512z"]},Mn={prefix:"vs",iconName:"trash",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64a32 32 0 0 1 32 -32h96a32 32 0 0 1 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm64 -256H160v224h32V160zm32 0h32v224H224V160zm64 0h32v224H288V160z"]},Tn={prefix:"vs",iconName:"triangle-down",icon:[512,512,[],"f000","M64 177.92 77.216 160h358.208l12.576 17.28L267.936 352h-26.464L64 177.92z"]},vl={prefix:"vs",iconName:"triangle-right",icon:[512,512,[],"f000","M177.92 448 160 434.784V76.576L177.28 64 352 244.064v26.464L177.92 448z"]},Zn={prefix:"vs",iconName:"warning",icon:[512,512,[],"f000","M241.92 32h28.16l209.28 392.32 -14.08 23.68H46.08L32 424.32 241.92 32zM256 72.96 72.96 416H438.4L256 72.96zM276 384v-32h-40v32h40zm-40 -64V192h40v128h-40z"]},Wc={prefix:"dh",iconName:"arrow-to-bottom",icon:[512,512,[],"f000","m99.2 224 160 160h22.4l160 -160 -22.4 -22.4L288 332.8V64H256v268.8L124.8 201.6l-25.6 22.4zM96 416h352v32H96z"]},zc={prefix:"dh",iconName:"arrow-to-top",icon:[512,512,[],"f000","m444.8 288 -160 -160h-22.4l-160 160 22.4 22.4L256 179.2V448h32V179.2l131.2 131.2 25.6 -22.4zm3.2 -192H96V64h352v32z"]},$c={prefix:"dh",iconName:"check-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-188.8 284.8h-22.4L144 278.4l22.4 -22.4 60.8 60.8 134.4 -134.4 22.4 22.4 -147.2 144z"]},Gc={prefix:"dh",iconName:"exclamation",icon:[512,512,[],"f000","M275.2 384v-32H236.8v32h38.4zm-38.4 -64V128h38.4v192H236.8z"]},vr={prefix:"dh",iconName:"eye-slash",icon:[512,512,[],"f000","M480 256c0 -32 -99.2 -160 -224 -160 -32 0 -64 9.6 -92.8 22.4L70.4 25.6 25.6 70.4 435.2 480l44.8 -44.8 -76.8 -76.8C451.2 320 480 272 480 256zM256 131.2c96 0 176 92.8 188.8 124.8 -6.4 16 -32 48 -67.2 76.8L316.8 272c3.2 -6.4 3.2 -9.6 3.2 -16 0 -35.2 -28.8 -64 -64 -64 -6.4 0 -9.6 0 -16 3.2L192 147.2c19.2 -9.6 41.6 -16 64 -16zm0 249.6C160 380.8 80 288 67.2 256c6.4 -9.6 19.2 -32 41.6 -54.4l-25.6 -25.6C51.2 208 32 243.2 32 256c0 32 99.2 160 224 160 19.2 0 38.4 -3.2 57.6 -9.6l-28.8 -28.8c-9.6 3.2 -19.2 3.2 -28.8 3.2z"]},wo={prefix:"dh",iconName:"eye",icon:[512,512,[],"f000","M256 96C131.2 96 32 224 32 256s99.2 160 224 160 224 -128 224 -160 -99.2 -160 -224 -160zm0 284.8C160 380.8 80 288 67.2 256 80 227.2 160 131.2 256 131.2S432 224 444.8 256c-12.8 28.8 -92.8 124.8 -188.8 124.8zM256 192c-35.2 0 -64 28.8 -64 64s28.8 64 64 64 64 -28.8 64 -64 -28.8 -64 -64 -64zm0 92.8c-16 0 -28.8 -12.8 -28.8 -28.8s12.8 -28.8 28.8 -28.8 28.8 12.8 28.8 28.8 -12.8 28.8 -28.8 28.8z"]},qc={prefix:"dh",iconName:"file-csv",icon:[512,512,[],"f000","m444.8 140.8 -105.6 -105.6 -12.8 -3.2H80l-16 16V224h32V64h192v112l16 16H416v32h32V153.6l-3.2 -12.8zM320 160V64l96 96h-96zM80 256l-16 16v192l16 16h352l16 -16v-192l-16 -16h-352zM416 416v32H96V288h320v128zm-217.6 -3.2c-6.4 3.2 -16 3.2 -25.6 3.2 -16 0 -25.6 -3.2 -35.2 -12.8 -9.6 -6.4 -12.8 -19.2 -12.8 -32 0 -16 3.2 -28.8 12.8 -38.4 9.6 -9.6 22.4 -12.8 38.4 -12.8 9.6 0 16 0 22.4 3.2v19.2c-6.4 -3.2 -12.8 -6.4 -22.4 -6.4 -9.6 0 -16 3.2 -22.4 9.6 -6.4 6.4 -9.6 12.8 -9.6 22.4 0 9.6 3.2 16 6.4 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16 -3.2 22.4 -6.4v19.2zm19.2 0v-22.4c3.2 3.2 9.6 6.4 12.8 6.4 3.2 3.2 9.6 3.2 12.8 3.2h6.4c3.2 0 3.2 0 6.4 -3.2l3.2 -3.2v-3.2c0 -3.2 0 -3.2 -3.2 -6.4 3.2 0 0 0 0 -3.2 -3.2 0 -3.2 -3.2 -6.4 -3.2s-6.4 -3.2 -9.6 -3.2c-6.4 -3.2 -12.8 -6.4 -16 -12.8 -3.2 -3.2 -6.4 -9.6 -6.4 -16s0 -9.6 3.2 -12.8c3.2 -3.2 3.2 -6.4 9.6 -9.6 3.2 0 6.4 -3.2 12.8 -3.2h25.6c3.2 0 6.4 0 9.6 3.2v19.2s-3.2 -3.2 -6.4 -3.2 -3.2 0 -6.4 -3.2h-19.2c-3.2 0 -3.2 0 -6.4 3.2l-3.2 3.2v6.4l3.2 3.2s3.2 3.2 6.4 3.2 3.2 3.2 6.4 3.2c3.2 3.2 6.4 3.2 9.6 6.4 3.2 3.2 6.4 3.2 6.4 6.4 3.2 3.2 3.2 6.4 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4 0 9.6 -3.2 12.8 -3.2 3.2 -3.2 6.4 -9.6 9.6 3.2 3.2 0 6.4 -3.2 6.4h-32c-3.2 0 -6.4 -3.2 -12.8 -3.2zm169.6 -92.8 -32 96h-25.6l-32 -96h22.4l19.2 67.2c0 3.2 3.2 6.4 3.2 9.6 0 -3.2 0 -6.4 3.2 -9.6l19.2 -67.2h22.4z"]},Kc={prefix:"dh",iconName:"file-download",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm-134.4 182.4 76.8 76.8h22.4l76.8 -76.8 -25.6 -22.4L288 368V227.2H256v140.8L208 320l-22.4 22.4z"]},Yc={prefix:"dh",iconName:"file-spreadsheet",icon:[512,512,[],"f000","m438.4 137.6 -96 -96L320 32H128L96 64v384l32 32h288l32 -32V160l-9.6 -22.4zM416 448H128V64h160v128h128v256zm-96 -288V64l96 96h-96zm64 99.2 -19.2 -19.2H179.2l-19.2 19.2v137.6l19.2 19.2h185.6l19.2 -19.2V259.2zm-150.4 134.4H182.4v-48h51.2v48zm0 -115.2v48H182.4V278.4m115.2 115.2H246.4v-48h48v48zm0 -64H246.4V278.4h48v51.2zm64 64H310.4v-48h48v48zm-51.2 -64V278.4h48v48H310.4z"]},xo={prefix:"dh",iconName:"filter-filled",icon:[512,512,[],"f000","M480 64v54.4l-160 153.6V448H192V268.8L32 118.4V64h448z"]},Xc={prefix:"dh",iconName:"freeze",icon:[512,512,[],"f000","m438.4 300.8 -19.2 -28.8 -60.8 35.2L272 256l86.4 -51.2 60.8 35.2 19.2 -28.8 -44.8 -25.6 48 -28.8 -16 -25.6 -48 28.8V108.8h-35.2v67.2L256 227.2V128l60.8 -35.2 -16 -28.8 -44.8 25.6V32H224v57.6L179.2 64l-16 28.8L224 128v99.2L137.6 176V108.8H102.4V160l-48 -28.8 -16 25.6 48 28.8 -44.8 25.6 19.2 28.8 60.8 -35.2L208 256 121.6 307.2 60.8 272l-19.2 28.8 44.8 25.6 -48 28.8 16 25.6 48 -28.8v51.2h35.2v-67.2L224 284.8V384l-60.8 35.2 16 28.8 44.8 -25.6V480h32v-57.6l44.8 25.6 16 -28.8L256 384V284.8l86.4 51.2v67.2h35.2V352l48 28.8 16 -25.6 -48 -28.8z"]},no={prefix:"dh",iconName:"gear-filled",icon:[512,512,[],"f000","m480 211.2 -76.8 -12.8L448 131.2l-64 -64 -67.2 41.6L300.8 32H211.2l-12.8 76.8L131.2 64l-64 64 41.6 67.2 -76.8 16v89.6l76.8 12.8L64 380.8l64 64 67.2 -41.6 16 76.8h89.6l16 -76.8L384 448l64 -64 -44.8 -67.2 76.8 -16V211.2zM256 320c-38.4 0 -64 -25.6 -64 -64s25.6 -64 64 -64 64 25.6 64 64 -25.6 64 -64 64z"]},Qc={prefix:"dh",iconName:"graph-line-up",icon:[512,512,[],"f000","M64 416V0H32v432l16 16H480v-32zm153.6 -150.4 70.4 64 128 -144V256h32V144l-16 -16H320v32h76.8L288 284.8l-70.4 -64 -108.8 112 22.4 22.4z"]},gs={prefix:"dh",iconName:"new-circle-large-filled",icon:[512,512,[],"f000","M240 0C108.8 0 0 108.8 0 240S108.8 480 240 480 480 371.2 480 240 371.2 0 240 0zM352 256H256v96H224V256H128V224h96V128h32v96h96v32z"]},jc={prefix:"dh",iconName:"pandas",icon:[512,512,[],"f000","M185.6 28.8h54.4v115.2H185.6V28.8zm0 240h54.4V384H185.6V268.8zm0 -89.6h54.4v54.4H185.6V179.2zM96 124.8h54.4V512H96V124.8zm176 240h54.4V480H272v-115.2zm0 -240h54.4v115.2H272V124.8zm0 150.4h54.4v54.4H272V275.2zM361.6 0H416v387.2h-54.4V0z"]},Zc={prefix:"dh",iconName:"refresh",icon:[512,512,[],"f000","m313.6 73.6 -9.6 32c83.2 25.6 131.2 118.4 102.4 201.6 -19.2 64 -80 108.8 -150.4 108.8 -89.6 0 -160 -70.4 -160 -160 0 -51.2 22.4 -96 64 -128v64h32V80L176 64H64v32h86.4c-76.8 51.2 -108.8 150.4 -70.4 236.8C112 403.2 179.2 448 256 448c105.6 0 192 -86.4 192 -192 0 -83.2 -54.4 -156.8 -134.4 -182.4z"]},Jc={prefix:"dh",iconName:"remove-square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16zM352 256H128V224h224v32z"]},Oo={prefix:"dh",iconName:"sort-alpha-down",icon:[512,512,[],"f000","M236.8 368 156.8 448h-22.4l-80 -80 22.4 -22.4L128 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM371.2 224l-6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6s-3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 310.4h73.6V448H272v-32l73.6 -89.6H275.2V288h128v32l-70.4 89.6z"]},ko={prefix:"dh",iconName:"sort-alpha-up",icon:[512,512,[],"f000","M51.2 144 131.2 64h22.4l80 80 -22.4 22.4L160 115.2V448H128V115.2L76.8 166.4l-25.6 -22.4zm320 304 -6.4 -28.8H316.8l-9.6 28.8H256l54.4 -160h60.8l51.2 160h-51.2zm-32 -124.8c0 3.2 -3.2 3.2 -3.2 9.6 0 6.4 -3.2 19.2 -12.8 51.2h32l-9.6 -44.8c-3.2 -6.4 -6.4 -9.6 -6.4 -16zm-6.4 -137.6h73.6V224H272V192l73.6 -89.6H275.2V64h128v32l-70.4 89.6z"]},Tr={prefix:"dh",iconName:"sort-amount-down",icon:[512,512,[],"f000","M204.8 368 124.8 448h-22.4L22.4 368l22.4 -22.4L96 396.8V64h32v332.8l51.2 -51.2 25.6 22.4zM256 64h256v64H256zm0 105.6h192v64H256zm0 108.8h128v64H256zM256 384h64v64H256z"]},ed={prefix:"dh",iconName:"sort-down",icon:[512,512,[],"f000","m128 288 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},td={prefix:"dh",iconName:"sort-up",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128z"]},Ao={prefix:"dh",iconName:"sort",icon:[512,512,[],"f000","m128 224 -12.8 -25.6 128 -118.4h25.6l128 118.4 -12.8 25.6H128zm0 64 -12.8 25.6 128 118.4h25.6l128 -118.4L384 288H128z"]},Er={prefix:"dh",iconName:"square-filled",icon:[512,512,[],"f000","M432 32h-384l-16 16v384l16 16h384l16 -16v-384l-16 -16z"]},Lo={prefix:"dh",iconName:"table",icon:[512,512,[],"f000","M432 64h-384l-16 16v352l16 16h384l16 -16v-352l-16 -16zM160 416H64v-64h96v64zm0 -96H64V256h96v64zm0 -96H64V160h96v64zm128 192H192v-64h96v64zm0 -96H192V256h96v64zm0 -96H192V160h96v64zm128 192h-96v-64h96v64zm0 -96h-96V256h96v64zm0 -96h-96V160h96v64z"]},nd={prefix:"dh",iconName:"trash-undo",icon:[512,512,[],"f000","M320 96h96v32h-32v288l-32 32H128l-32 -32V128H64V96h96V64c0 -19.2 12.8 -32 32 -32h96c19.2 0 32 12.8 32 32v32zM288 64H192v32h96V64zM128 416h224V128H128v288zm112 -64L160 272v-22.4l80 -80 22.4 22.4 -51.2 54.4H320v32H211.2l51.2 51.2 -22.4 22.4z"]},sd={prefix:"dh",iconName:"triangle-down-square",icon:[512,512,[],"f000","M425.6 64H86.4l-22.4 22.4v342.4l22.4 19.2h342.4l22.4 -22.4V86.4l-25.6 -22.4zm-160 288h-22.4L99.2 208l9.6 -16h291.2l9.6 12.8L265.6 352z"]},id={prefix:"dh",iconName:"unlink",icon:[512,512,[],"f000","M32 211.2v-6.4C32 144 80 96 140.8 96h99.2c12.8 0 25.6 3.2 38.4 6.4l-25.6 25.6H140.8C99.2 128 64 163.2 64 204.8v6.4c0 28.8 16 54.4 38.4 67.2l-22.4 22.4C51.2 281.6 32 249.6 32 211.2zM403.2 6.4l-38.4 38.4 -67.2 67.2 -22.4 25.6 -150.4 147.2 -25.6 25.6 -54.4 54.4 -38.4 38.4L51.2 448 448 51.2 403.2 6.4zM384 192v32c38.4 6.4 64 38.4 64 76.8v6.4c0 41.6 -35.2 76.8 -76.8 76.8H272c-32 0 -60.8 -22.4 -73.6 -51.2l-25.6 25.6c19.2 35.2 54.4 60.8 96 60.8h99.2c60.8 0 108.8 -48 108.8 -108.8v-9.6C480 246.4 438.4 198.4 384 192zM246.4 288l-22.4 19.2v12.8h16c60.8 0 108.8 -48 108.8 -108.8v-6.4c0 -6.4 0 -12.8 -3.2 -19.2l-32 32c0 38.4 -32 67.2 -67.2 70.4z"]},Rr={prefix:"dh",iconName:"warning-circle-filled",icon:[512,512,[],"f000","M470.4 195.2c-9.6 -38.4 -28.8 -70.4 -57.6 -99.2 -25.6 -25.6 -60.8 -44.8 -96 -54.4C297.6 35.2 275.2 32 256 32c-19.2 0 -41.6 3.2 -60.8 9.6 -16 3.2 -35.2 9.6 -51.2 22.4 -35.2 19.2 -60.8 44.8 -80 80 -12.8 16 -19.2 35.2 -25.6 51.2C35.2 214.4 32 236.8 32 256c0 19.2 3.2 41.6 6.4 60.8 6.4 16 12.8 35.2 25.6 51.2 9.6 16 22.4 32 35.2 44.8 12.8 16 28.8 25.6 44.8 35.2 16 9.6 35.2 16 54.4 22.4 16 6.4 38.4 9.6 57.6 9.6 19.2 0 41.6 -3.2 60.8 -6.4 19.2 -6.4 35.2 -12.8 54.4 -22.4 32 -19.2 60.8 -48 80 -80 9.6 -16 16 -35.2 22.4 -54.4 3.2 -19.2 6.4 -41.6 6.4 -60.8s-3.2 -41.6 -9.6 -60.8zM275.2 352H236.8v-32h38.4v32zm0 -64H236.8V160h38.4v128z"]},od={prefix:"dh",iconName:"warning-filled",icon:[512,512,[],"f000","M268.8 32h-25.6L32 425.6l12.8 22.4h419.2l12.8 -22.4L268.8 32zm6.4 352H236.8v-32h38.4v32zm0 -64H236.8V192h38.4v128z"]};const Ai=Q.forwardRef((e,t)=>{var b;function n(C){const{menuItem:w,onMenuItemClick:T}=e;T(w,C)}function s(C){const{menuItem:w,onMenuItemMouseMove:T}=e;T(w,C)}function i(C){const{menuItem:w,onMenuItemContextMenu:T}=e;T(w,C)}function o(C,w,T){if(typeof C.type=="string")return C;const{closeMenu:y,menuItem:S,isKeyboardSelected:E,isMouseSelected:I,"data-testid":D}=e,k={menuItem:S,closeMenu:y,isKeyboardSelected:E,isMouseSelected:I,iconElement:w,displayShortcut:T,"data-testid":D};return Q.cloneElement(C,{forwardedProps:k})}const{children:r,menuItem:l,isKeyboardSelected:a,isMouseSelected:c,"data-testid":d}=e,h=(b=l.shortcut)==null?void 0:b.getDisplayText();let m=null;if(l.icon){const C=l.icon;if(Q.isValidElement(C))m=C;else{let w;l.iconColor&&!l.disabled&&(w={color:l.iconColor}),m=u(G,{icon:C,style:w})}}let p=null;const g=!!r;l.actions&&(p=u(G,{icon:ml}));let f=null;if(l.menuElement)f=u("div",{className:"custom-menu-item",onMouseMove:s,children:o(l.menuElement,m,h)});else{const C=l.disabled,w=l.iconOutline;f=u("button",{type:"button",className:W("btn-context-menu",{disabled:C},{active:(g||c)&&!C},{"keyboard-active":a&&!C}),onClick:n,onMouseMove:s,onContextMenu:i,title:l.description||"",children:v("div",{className:"btn-context-menu-wrapper",children:[u("span",{className:W("icon",{outline:w}),children:m}),u("span",{className:"title",children:l.title}),h&&u("span",{className:"shortcut",children:h}),p&&u("span",{className:W("submenu-indicator",{disabled:C}),children:p})]})})}return v("div",{className:"context-menu-item",ref:t,"data-testid":d,children:[r,f]})});Ai.displayName="ContextMenuItem";Ai.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};class hs extends Error{constructor(){super(...arguments),this.isCanceled=!0}}class Ho{static isDark(t){const n=document.createElement("div");n.style.display="none",n.style.color=t;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),Ho.getBrightness(o)<125}static getBrightness(t){return Math.round((t[0]*299+t[1]*587+t[2]*114)/1e3)}}const rd="table_",Tl="column_",ld=new Set(["in","not","i","ii","k"]),ad=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),cd=/[^a-zA-Z0-9_$+@-]/g,dd=/[^A-Za-z0-9_$]/g,fs=class{};let Nn=fs;Nn.legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(ld.has(o)||ad.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};Nn.legalizeTableName=e=>fs.legalize(e,rd,cd,!1,0);Nn.legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=fs.legalizeColumnName(n,s);t.includes(i)&&(i=Tl+s),t.push(i)}),t};Nn.legalizeColumnName=(e,t=0)=>fs.legalize(e,Tl,dd,!0,t);Nn.isValidTableName=e=>fs.legalizeTableName(e)===e;Nn.isValidColumnName=e=>fs.legalizeColumnName(e)===e;function hd(e,t){return e?e.closest(`.${t}`):null}const ud={getClosestByClassName:hd};class ve extends CustomEvent{constructor(t,n){super(t,n)}}class El extends Error{constructor(){super(...arguments),this.isTimeout=!0}}class Le{static makeCancelable(t,n){let s=!1,i;const o=new Promise((r,l)=>{Promise.resolve(t).then(a=>{s?(n&&n(a),l(new hs)):(i=a,r(a))},a=>l(s?new hs:a))});return o.cancel=()=>{s=!0,i!=null&&n&&n(i)},o}static isCanceled(t){return t instanceof hs}static isTimedOut(t){return t instanceof El}}class Li{constructor(){this.pending=[],this.resolved=[]}add(t,n){const s=Le.makeCancelable(t,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(t){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===t){this.pending.splice(n,1);return}}resolve(t){this.remove(t),this.resolved.push(t)}cancel(){const t=[...this.pending,...this.resolved];for(let n=0;n<t.length;n+=1)t[n].cancel();this.pending=[],this.resolved=[]}}function O(e){if(e==null)throw new Error("Value is null or undefined")}class _t{static isValidRange(t){return t!=null&&t.length===2&&Number.isInteger(t[0])&&Number.isInteger(t[1])&&t[0]<=t[1]}static validateRange(t){if(!_t.isValidRange(t))throw new Error(`Invalid range! ${t}`)}static isSelected(t,n){for(let s=0;s<t.length;s+=1){const i=t[s],o=i[0],r=i[1];if(o<=n&&n<=r)return!0}return!1}static selectRange(t,n){let[s,i]=n;const o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(a<=s&&i<=c)return o;s<=c&&a<=i&&(s=Math.min(s,a),i=Math.max(i,c),o.splice(r,1))}return o.push([s,i]),o}static deselectRange(t,n){const[s,i]=n,o=[...t];for(let r=o.length-1;r>=0;r-=1){const l=o[r],a=l[0],c=l[1];if(!(i<a||c<s))if(a<s&&i<c){o[r]=[a,s-1],o.splice(r+1,0,[i+1,c]);break}else s<=a&&c<=i?o.splice(r,1):a<s?o[r]=[a,s-1]:o[r]=[i+1,c]}return o}static count(t){return t.reduce((n,s)=>n+(s[1]-s[0]+1),0)}}class Po{static join(t,n="and"){if(t==null||t.length===0)return"";if(t.length===1)return t[0];if(t.length===2)return`${t[0]} ${n} ${t[1]}`;const s=t.slice(0,t.length-1).join(", "),i=t[t.length-1];return`${s}, ${n} ${i}`}static toLower(t,n=!0){if(t==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return t.toLowerCase()}static sort(t,n,s=!0){return t<n?s?-1:1:t>n?s?1:-1:0}}const Rl=class{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"),i=n%60,o=String(Math.ceil(i)).padStart(2,"0");return`${t}:${s}:${o}`}static isTimeString(e){return new RegExp(Rl.TIME_PATTERN).test(e)}static parseTime(e){if(!e||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])}};let Bt=Rl;Bt.TIME_PATTERN="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]";Bt.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\xB10 No DST",value:"UTC"},{label:"London UTC\xB10",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\u22125",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"}]);class md extends Error{constructor(){super(...arguments),this.isInvalid=!0}}const Ft=({className:e="","data-testid":t})=>v("div",{className:W("loading-spinner fa-layers",e),"data-testid":t,children:[u(G,{icon:Tc,className:"text-white-50"}),u(G,{icon:xc,className:"text-primary",spin:!0})]}),yr=ee.module("ContextMenu"),So=class extends R.exports.PureComponent{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=Q.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=Q.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}}static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e,t){var i,o,r;const{actions:n}=this.props,{activeSubMenu:s}=this.state;s!==t.activeSubMenu&&(s==null?(i=this.container.current)==null||i.focus():this.setActiveSubMenuPosition()),e.actions!==n&&(this.initMenu(),(o=this.container.current)!=null&&o.contains(document.activeElement)||(r=this.container.current)==null||r.focus()),this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;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=we.getMenuItems(n),i=[];for(let o=s.length-1;o>=0;o-=1){const r=s[o];r instanceof Promise?this.initMenuPromise(r):i.push(r)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:we.sortActions(i)})}initMenuPromise(e){const t=Le.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{menuItems:we.sortActions(s.menuItems.concat(n)),pendingItems:o}}return null})},n=>{Le.isCanceled(n)||(this.setState(s=>{const i=s.pendingItems.indexOf(t);if(i>=0){const o=s.pendingItems.slice();return o.splice(i,1),{pendingItems:o}}return null}),yr.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(){var h,m,p,g;const{options:e,updatePosition:t,subMenuParentWidth:n,subMenuParentHeight:s,top:i,left:o}=this.props;if(!this.container.current||e.doNotVerifyPosition)return;let{top:r,left:l}=this.initialPosition;const{width:a,height:c}=(m=(h=this.container.current)==null?void 0:h.getBoundingClientRect())!=null?m:{width:0,height:0},d=((g=(p=this.container.current)==null?void 0:p.scrollHeight)!=null?g:0)>window.innerHeight;c===0||a===0||(r+c>window.innerHeight&&(r-c-s>0?r-=c-s:r=window.innerHeight-c),l+a>window.innerWidth&&(l=l-a-n),(o!==l||i!==r)&&(this.setState({hasOverflow:d}),t(r,l)))}handleWindowResize(){!this.container.current||this.closeMenu(!0)}handleBlur(e){if(!this.container.current){yr.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,i=!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?i=!0:s=0:this.isEscapeKey(e.key)?s=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?s=we.getNextMenuItem(s,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(s=we.getNextMenuItem(s,1,t)),i){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&&(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&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{top:t,left:n}=this.props,{activeSubMenu:s,hasOverflow:i,keyboardIndex:o,menuItems:r,mouseIndex:l,pendingItems:a,subMenuTop:c,subMenuLeft:d,subMenuParentWidth:h,subMenuParentHeight:m}=this.state;for(let C=0;C<r.length;C+=1){const w=r[C];C>0&&w.group!==r[C-1].group&&e.push(u("hr",{},`${C}.separator`));const T=u(Ai,{ref:s===C?this.activeSubMenuRef:null,isKeyboardSelected:o===C,isMouseSelected:l===C,menuItem:w,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},C);e.push(T)}let p=null;a.length>0&&(p=u("div",{className:"loading",children:u(Ft,{})}));const{menuStyle:g,"data-testid":f}=this.props,b=s!==null&&c!==null&&d!==null;return v(Ie,{children:[v("div",{className:W({"has-overflow":i},"context-menu-container"),style:{top:t,left:n,...g},ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:So.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":f,children:[e,p]}),b&&s!==null&&c!==null&&d!==null&&u(So,{actions:r[s].actions||[],closeMenu:this.handleCloseSubMenu,top:c,left:d,updatePosition:(C,w)=>{this.setState({subMenuTop:C,subMenuLeft:w})},subMenuParentWidth:h,subMenuParentHeight:m},`sub-${s}`)]})}};let yl=So;yl.defaultProps={subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class pd extends R.exports.Component{constructor(t){super(t),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=Q.createRef(),this.openMenu=Q.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var t;(t=this.container.current)!=null&&t.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(t){if(!we.isContextActionEvent(t)||!this.container.current||t.metaKey||t.ctrlKey)return;const n=we.getMenuItems(t.contextActions),s=this.container.current.getBoundingClientRect(),i=t.clientY-s.top,o=t.clientX-s.left;if(n.length===0){if(t.target===this.container.current){t.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:t.clientX,clientY:t.clientY,bubbles:!0,cancelable:!0});r==null||r.dispatchEvent(l)});return}return}t.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(t){t===this.openMenu.current&&this.setState({actions:null})}render(){let t=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(t=u(yl,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),u("div",{className:W("context-menu-root",{active:s}),ref:this.container,children:t})}}const Wn=class extends R.exports.Component{static handleEnter(e){const t=e;t.style.height="0"}static handleEntering(e){const t=e;t.style.height=`${Wn.getHeight(t)}px`}static handleExiting(e){const t=e;t.style.height="0"}static handleExit(e){const t=e;t.style.height=`${Wn.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){const s=t.querySelector("input, select, textarea");s&&s.focus()}}render(){const{children:e,className:t,in:n,"data-testid":s}=this.props;return u(tt,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Wn.handleEnter,onEntering:Wn.handleEntering,onEntered:this.handleEntered,onExit:Wn.handleExit,onExiting:Wn.handleExiting,timeout:350,children:i=>u("div",{className:W({collapse:i==="exited"},t),"data-testid":s,children:e})})}};let Il=Wn;Il.propTypes={className:M.exports.string,in:M.exports.bool.isRequired,children:M.exports.node.isRequired,autoFocusOnShow:M.exports.bool,"data-testid":M.exports.string};Il.defaultProps={className:"",autoFocusOnShow:!1,"data-testid":void 0};function _o(e){const t=R.exports.useRef();return R.exports.useEffect(function(){t.current=e}),t.current}function Ml(e){const t=R.exports.useRef(null);return R.exports.useEffect(function(){!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t}const St=Q.forwardRef((e,t)=>{const{checked:n=!1,children:s,className:i,disabled:o,inputClassName:r,isInvalid:l,labelClassName:a,onChange:c,"data-testid":d}=e,[h]=R.exports.useState(zt()),m=Ml(t);R.exports.useEffect(function(){m.current&&(m.current.indeterminate=n===null)},[m,n]);const p=R.exports.useCallback(g=>{m.current&&(m.current.indeterminate=n===null),c&&c(g)},[m,n,c]);return v("div",{className:W("custom-control custom-checkbox",i),children:[u("input",{type:"checkbox",ref:m,checked:n!=null?n:!1,className:W("custom-control-input",r,{"is-invalid":l}),disabled:o,id:h,onChange:p,"data-testid":d}),u("label",{className:W("custom-control-label",a),htmlFor:h,children:s})]})});St.displayName="Checkbox";St.propTypes={checked:(e,t)=>{const{[t]:n}=e;return n!==null&&typeof n!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:M.exports.node.isRequired,className:M.exports.string,disabled:M.exports.bool,inputClassName:M.exports.string,isInvalid:M.exports.bool,labelClassName:M.exports.string,onChange:M.exports.func,"data-testid":M.exports.string};St.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",onChange:void 0,"data-testid":void 0};class Dn extends R.exports.PureComponent{constructor(t){super(t),this.inputField=Q.createRef()}focus(){var t;(t=this.inputField.current)==null||t.focus()}render(){const{value:t,placeholder:n,onChange:s,className:i,matchCount:o,id:r,onKeyDown:l,"data-testid":a}=this.props;return v("div",{className:W("search-group",i),children:[u("input",{type:"search",value:t,onChange:s,onKeyDown:l,className:"form-control",placeholder:n,ref:this.inputField,id:r,"data-testid":a}),o!=null&&u("span",{className:"search-match",children:o}),u("span",{className:"search-icon",children:u(G,{icon:Sl})})]})}}Dn.defaultProps={placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0};var Nl=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Nl||{});const xs=class extends R.exports.Component{constructor(e){super(e),this.getCachedFilteredOptions=pe((t,n)=>t.filter(s=>s.title.toLowerCase().indexOf(n.toLowerCase())>=0||s.value.toLowerCase().indexOf(n.toLowerCase())>=0)),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=Q.createRef(),this.cbContainer=Q.createRef(),this.toggleButton=Q.createRef(),this.menuContainer=Q.createRef(),this.input=Q.createRef(),this.searchInput=Q.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var r,l;const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,o=t?n:i;switch(e.key){case"Enter":((r=o[s])==null?void 0:r.value)!=null&&this.updateInputValue(o[s].value),this.closeMenu(),(l=this.input.current)==null||l.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(xs.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(xs.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===o.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:s}=this.state,{options:i}=this.props,r=(t?n:i).length;let l=0;switch(e){case xs.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case xs.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){var r;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:s}=this.state,{options:i}=this.props,o=n?s:i;this.updateInputValue(o[t].value),this.closeMenu(),(r=this.input.current)==null||r.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var i;const{options:t}=this.props,n=e.target.value,s=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:s,keyboardOptionIndex:0}),(i=this.popper.current)==null||i.scheduleUpdate()}handleMenuBlur(e){var t;e.relatedTarget instanceof Element&&((t=this.popper.current)==null?void 0:t.element.contains(e.relatedTarget))||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){var n;const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&((n=this.popper.current)==null?void 0:n.element.contains(e.relatedTarget))||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:s}=this.props,o=(t?n:s).findIndex(r=>r.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return v("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:s=>{s.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[u("div",{className:"cb-search-input-container",children:u(Dn,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),u("div",{className:"cb-options-container",children:u("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((o,r)=>{const l=`option-${r}-${o.value}`;return u("button",{type:"button",value:r,className:W("cb-option-btn",{"keyboard-active":t===r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:s,defaultValue:i,spellCheck:o,"data-testid":r}=this.props,{value:l}=this.state;let{popperOptions:a}=this.props;return a={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...a},v("div",{className:"input-group cb-container",ref:this.cbContainer,children:[u("input",{value:l||i,className:W("form-control",s,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0]&&e[0].title,disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":r?`${r}-input`:void 0}),u("div",{className:"input-group-append cb-dropdown",children:v("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":r?`${r}-btn`:void 0,children:[u(G,{icon:Tn}),u(dn,{ref:this.popper,options:a,className:W("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let Cs=xs;Cs.MENU_NAVIGATION_DIRECTION=Nl;Cs.DROP_DOWN_MENU_HEIGHT=200;Cs.propTypes={options:M.exports.arrayOf(M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired})).isRequired,popperOptions:M.exports.shape({title:M.exports.string.isRequired,value:M.exports.string.isRequired}),onChange:M.exports.func,inputPlaceholder:M.exports.string,searchPlaceholder:M.exports.string,disabled:M.exports.bool,className:M.exports.string,defaultValue:M.exports.string,spellCheck:M.exports.bool,onEnter:M.exports.func,"data-testid":M.exports.string};Cs.defaultProps={onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0};const It=ee.module("MaskedInput"),ys={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},so="\u2007";function Vo(e,t,n){return e.substring(0,t)+n+e.substring(t+1)}const Dl=Q.forwardRef((e,t)=>{const{className:n,example:s,getNextSegmentValue:i=(H,A,N)=>N,getPreferredReplacementString:o=Vo,onChange:r=()=>!1,onSelect:l=()=>!1,pattern:a,selection:c,value:d,onFocus:h=()=>!1,onBlur:m=()=>!1,"data-testid":p}=e,g=Ml(t),f=R.exports.useMemo(()=>Array.isArray(s)?s:[s],[s]);R.exports.useEffect(function(){var A;if(c!=null){It.debug("setting selection...",c);const{selectionStart:N,selectionEnd:B,selectionDirection:U}=c;(A=g.current)==null||A.setSelectionRange(N,B,U),It.debug("selection set!")}},[c,g]);function b(H){let A=H,N=H;const B=f.length>0?f[0]:d;for(let L=A-1;L>=0&&/[a-zA-Z0-9]/g.test(B.charAt(L));L-=1)A=L;for(let L=N;L<B.length&&/[a-zA-Z0-9]/g.test(B.charAt(L));L+=1)N=L+1;const U=A===N?ys.NONE:ys.BACKWARD;return{selectionStart:A,selectionEnd:N,selectionDirection:U}}function C(H,A,N=H.length){let B="";for(let U=0;U<N;U+=1)H.charAt(U)!==so?B=B.concat(H[U]):B=B.concat(A[U]);return B=B.concat(A.substring(N)),B}function w(H,A=H.length){const N=new RegExp(a);if(N.test(H))return!0;for(let B=0;B<f.length;B+=1){const U=C(H,f[B],A);if(N.test(U))return!0}return!1}function T(H){const A=b(H),N=A.selectionEnd+1;return N>=d.length?A:b(N)}function y(H){const A=b(H),N=A.selectionStart-1;return N<=0?A:b(N)}function S(H,A){const N=b(H),B=d.substring(N.selectionStart,N.selectionEnd),U=i(N,A,B,d),L=d.substring(0,N.selectionStart)+U+d.substring(N.selectionEnd);w(L,N.selectionEnd)&&(r(L),l(N))}function E(H){const{selectionStart:A=0,selectionEnd:N=0,selectionDirection:B="none"}=H.target;if(A===null||N===null||B===null){It.error("Selection attempted on non-text input element",H.target);return}if(It.debug2("handleSelect",A,N,B),!(c!=null&&A===c.selectionStart&&N===c.selectionEnd))if(A===N){const U=b(A);It.debug("Selection segment from ",A,N,"=>",U),l(U)}else l({selectionStart:A,selectionEnd:N,selectionDirection:B})}function I(H){if(!g.current)return;It.debug("handleSelectCapture",H);const A=g.current.selectionStart||0;A===d.length&&c!=null&&A!==c.selectionStart&&(H.preventDefault(),H.stopPropagation())}function D(H){if(H.preventDefault(),H.stopPropagation(),!g.current)return;const{key:A}=H,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){It.error("Selection arrow nvaigation attempted on non-text input element",H.target);return}A==="ArrowLeft"?l(y(N)):A==="ArrowRight"?l(T(B)):A==="ArrowUp"?S(N,-1):A==="ArrowDown"&&S(N,1)}function k(H){if(!g.current)return;It.debug("handleKeyDown",H);const{key:A}=H,{selectionStart:N=0,selectionEnd:B=0}=g.current;if(N===null||B===null){It.error("Selection key event on non-text input element",H.target);return}if(A.startsWith("Arrow")){D(H);return}if(A==="Delete"||A==="Backspace"){if(H.preventDefault(),H.stopPropagation(),N!==B){const L=d.substring(0,N)+d.substring(N,B).replace(/[a-zA-Z0-9]/g,so)+d.substring(B);It.debug("Range ",N,B,"deleted, setting value",L),r(L),l({selectionStart:N,selectionEnd:N,selectionDirection:ys.NONE})}else if(N>0)for(let L=N-1;L>=0;L-=1){const _=d.substring(0,L)+d.substring(L,N).replace(/[a-zA-Z0-9]/g,so)+d.substring(N);if(_!==d){r(_),l({selectionStart:L,selectionEnd:L,selectionDirection:ys.NONE});return}}return}if(H.altKey||H.metaKey||H.ctrlKey||A.length>1)return;H.preventDefault(),H.stopPropagation();const U=Array.from(new Set([A,A.toUpperCase(),A.toLowerCase()]));for(let L=0;L<U.length;L+=1){const _=U[L],$=/[a-zA-Z0-9]/g.test(_)?d.length-1:N;for(let K=N;K<=$;K+=1){const j=o(d,K,_,N,B);if(w(j,K+1)){const oe=b(K),te=K+1;let me={selectionStart:te,selectionEnd:te,selectionDirection:ys.NONE};if(te>=oe.selectionEnd){const ae=T(K);ae.selectionStart!==oe.selectionStart&&(me=ae)}It.debug("handleKeyDown",A,"=>",j,me),r(j),l(me);return}}}}return u("input",{ref:g,className:W("form-control masked-input",n),type:"text",pattern:a,value:d,onChange:()=>{},onKeyDown:k,onSelect:E,onSelectCapture:I,onFocus:h,onBlur:m,"data-testid":p})});Dl.defaultProps={className:"",onChange(){},onSelect(){},getNextSegmentValue:(e,t,n)=>n,getPreferredReplacementString:Vo,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const gd=ee.module("TimeInput"),fd="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Cd=["00:00:00","12:34:56","23:59:59"],Fl=Q.forwardRef((e,t)=>{const{allowValueWrapping:n=!0,className:s="",onChange:i=()=>!1,value:o=0,onFocus:r=()=>!1,onBlur:l=()=>!1,"data-testid":a}=e,[c,d]=R.exports.useState(Bt.formatTime(o)),[h,m]=R.exports.useState();R.exports.useEffect(function(){d(Bt.formatTime(o))},[o]);function p(C,w,T){const y=C.selectionStart===0?24:60;let S=parseInt(T,10)-w;return Number.isNaN(S)?S=0:n?S=(S%y+y)%y:S=Math.min(Math.max(0,S),y-1),`${S}`.padStart(2,"0")}function g(C,w,T,y,S){return y===0&&S===2&&w===1&&parseInt(T,10)>1?`0${T}${C.substring(2)}`:Vo(C,w,T)}function f(C){gd.debug("handleChange",C),d(C),Bt.isTimeString(C)&&i(Bt.parseTime(C))}function b(C){m(C)}return u(Dl,{ref:t,className:s,example:Cd,getNextSegmentValue:p,getPreferredReplacementString:g,onChange:f,onSelect:b,pattern:fd,selection:h,value:c,onFocus:r,onBlur:l,"data-testid":a})});Fl.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};class xl extends R.exports.PureComponent{constructor(t){var i;super(t),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=Q.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:n}=t,s=(i=n.initialKeyboardIndex)!=null?i:-1;this.state={menuItems:[],keyboardIndex:s,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var n;(n=this.container.current)==null||n.focus();const{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(t){const{actions:n}=this.props;t.actions!==n&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:t}=this.props;if(t.separateKeyboardMouse){const{keyboardIndex:n}=this.state;return n}return this.getMouseIndex()}setKeyboardIndex(t){const{options:n}=this.props;n.separateKeyboardMouse?this.setState({keyboardIndex:t}):this.setMouseIndex(t)}getMouseIndex(){const{mouseIndex:t}=this.state;return t}setMouseIndex(t){this.setState({mouseIndex:t})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:t}=this.props,n=we.getMenuItems(t,!1);n.length>0&&this.setState(s=>({menuItems:we.sortActions(s.menuItems.concat(n))}))}handleKeyDown(t){const{menuItems:n}=this.state,s=this.getKeyboardIndex();let i=s;if(t.key==="Enter"||t.key===" "){s!=null&&s>=0&&s<n.length&&this.handleMenuItemClick(n[s],t);return}t.key==="Escape"?i=null:t.key==="ArrowUp"||t.key==="Tab"&&t.shiftKey===!0?i=we.getNextMenuItem(i!=null?i:0,-1,n):(t.key==="ArrowDown"||t.key==="Tab"&&t.shiftKey===!1)&&(i=we.getNextMenuItem(i!=null?i:0,1,n)),s!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),t.preventDefault(),t.stopPropagation())}closeMenu(t=!1){const{closeMenu:n,onMenuClosed:s}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{n(t),s(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(t,n){n.preventDefault(),n.stopPropagation(),t!=null&&!t.disabled&&t.action!=null&&(t.action(),this.closeMenu(!0))}handleMenuItemMouseMove(t){const{menuItems:n}=this.state,s=n.indexOf(t);this.setMouseIndex(s)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const t=[],{"data-testid":n}=this.props,{keyboardIndex:s,menuItems:i,mouseIndex:o}=this.state;for(let l=0;l<i.length;l+=1){const a=i[l];l>0&&a.group!==i[l-1].group&&t.push(u("hr",{},`${l}.separator`));const c=u(Ai,{isKeyboardSelected:s===l,isMouseSelected:o===l,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},l);t.push(c)}const{menuStyle:r}=this.props;return u("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":n,children:t})}}xl.defaultProps={closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0};class yn extends R.exports.PureComponent{constructor(t){super(t),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=Q.createRef(),this.parent=null,this.popper=Q.createRef(),this.isOpen=!1}componentDidMount(){var n;const{isShown:t}=this.props;t===null?(n=this.container.current)!=null&&n.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):t&&this.openMenu()}componentDidUpdate(t){const{isShown:n}=this.props;t.isShown!==n&&(n?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var t;(t=this.popper.current)==null||t.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var t;(t=this.popper.current)==null||t.scheduleUpdate()}handleClick(t){t.preventDefault(),t.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:t}=this.props;t()}render(){const{actions:t,onMenuOpened:n,popperClassName:s,"data-testid":i}=this.props,{menuStyle:o}=this.props;let{options:r,popperOptions:l}=this.props;return l={placement:"bottom",...l},r={separateKeyboardMouse:!0,...r},u("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u(dn,{ref:this.popper,options:l,className:W("menu-popper",s),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u(xl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:n,options:r,menuStyle:o})})})}}yn.defaultProps={isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0};const Ir=-1;var Ol=(e=>(e.UP="UP",e.DOWN="DOWN",e))(Ol||{});const Zt=class extends R.exports.Component{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=Q.createRef(),this.menuContainer=Q.createRef(),this.button=Q.createRef(),this.input=Q.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:s}=this.state;if(t===null)return n;for(let i=0;i<e.length;i+=1){const o=e[i];if(o.value===t)return o.title}return Bt.formatTime(s)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var i;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(),(i=this.button.current)==null||i.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Zt.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Zt.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,i=s.length;let o=t;switch(e){case Zt.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(o=(o-1)%i,this.setState({keyboardOptionIndex:o})):t===0&&(o=i-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case Zt.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(o=(o+1)%i,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:s}=this.props,{customTime:i}=this.state;if(t===Ir){const o=s(i);this.updateAndClose(o)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var o;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const s=(o=this.menuContainer.current)==null?void 0:o.querySelector(".cs-option-btn.keyboard-active");if(s instanceof HTMLElement&&s.focus(),t===null)return;e.map(r=>r.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(s=>s.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children){const s=t.children.item(e);s instanceof HTMLElement&&s.offsetTop>Zt.DROP_DOWN_MENU_HEIGHT?t.scrollTop=s.offsetTop-Zt.DROP_DOWN_MENU_HEIGHT:(s instanceof HTMLElement&&s.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return u("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u("div",{className:"cs-options-container",children:u("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:s}=this.props,{keyboardOptionIndex:i,customTime:o,inputFocused:r}=this.state;let l=!1;const a=[];for(let c=0;c<e.length;c+=1){const d=e[c],h=`option-${c}-${d.value}`;l=l||d.value===t,a.push(v("button",{type:"button",value:c,className:W("cs-option-btn",{"keyboard-active":i===c&&!r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[d.value===t&&u(G,{icon:n,className:"mr-2"}),d.value!==t&&u("span",{className:"mr-4"}),d.title]},h))}return a.push(u("hr",{className:"cs-divider"},"option-divider")),a.push(v("button",{type:"button",value:Ir,className:W("cs-option-btn",{"keyboard-active":r}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u(G,{icon:n,className:"mr-2"}):u("span",{className:"mr-4"}),s]},"option-custom-label")),a.push(v("div",{className:"cs-custom-container",children:[u("span",{className:"mr-2"}),u(Fl,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u("span",{className:"ml-2"})]},"cs-custom-container")),a.push(u("hr",{className:"mb-2"},"option-end")),a}render(){const{disabled:e,invalid:t,value:n,"data-testid":s}=this.props,{menuIsOpen:i}=this.state;let{popperOptions:o}=this.props;return o={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...o},u("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":s,children:u("div",{className:W("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:v("button",{type:"button",className:W("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u("span",{className:W({"text-muted":n===null}),children:this.getSelectedText()}),u("span",{children:u(G,{icon:Ao,className:"cs-caret"})}),u(yn,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let Uo=Zt;Uo.MENU_NAVIGATION_DIRECTION=Ol;Uo.DROP_DOWN_MENU_HEIGHT=125;Uo.defaultProps={onChange(){},value:null,disabled:!1,popperOptions:{},icon:Qn,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};class bd extends R.exports.PureComponent{constructor(t){super(t),this.searchInput=Q.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=wt(this.sendUpdate.bind(this),t.debounceMs),this.state={value:t.value}}componentDidUpdate(t){const{value:n}=this.props;t.value!==n&&this.setState({value:n})}focus(){var t;(t=this.searchInput.current)==null||t.focus()}handleChange(t){this.setState({value:t.target.value},this.sendUpdate)}sendUpdate(){const{onChange:t}=this.props,{value:n}=this.state;t(n)}render(){const{placeholder:t,className:n,matchCount:s,id:i,"data-testid":o}=this.props,{value:r}=this.state;return u(Dn,{value:r,placeholder:t,onChange:this.handleChange,className:n,matchCount:s,ref:this.searchInput,id:i,"data-testid":o})}}bd.defaultProps={placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0};const wd=({className:e="",show:t=!0,"data-testid":n})=>v("div",{className:W("dh-loader",e,{show:t}),"data-testid":n,children:[u("svg",{className:"dh-outer-shape",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("path",{d:"M82.7429,0L82.7429,41.3714L45.2571,41.3714L45.2571,0L0,0L0,128L45.2571,128L45.2571,86.6286L82.5143,86.6286L82.5143,128L128,128L128,0L82.7429,0ZM41.3714,124.114L4.11429,124.114L4.11429,86.6286L41.3714,86.6286L41.3714,124.114ZM41.3714,82.7429L4.11429,82.7429L4.11429,45.2571L41.3714,45.2571L41.3714,82.7429ZM41.3714,41.3714L4.11429,41.3714L4.11429,4.11429L41.3714,4.11429L41.3714,41.3714ZM45.2571,82.7429L45.2571,45.2571L82.5143,45.2571L82.5143,82.5143L45.2571,82.5143ZM124.114,124.114L86.6286,124.114L86.6286,86.6286L123.886,86.6286L123.886,124.114ZM124.114,82.7429L86.6286,82.7429L86.6286,45.2571L123.886,45.2571L123.886,82.7429ZM86.6286,41.3714L86.6286,4.11429L123.886,4.11429L123.886,41.3714L86.6286,41.3714Z",fill:"#f0f0ee"})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-3",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3438",height:"37.6389",fill:"#5189e5",transform:"translate(-21.9838,29.7957) translate(21.9838,15.3027)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-2",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2755",height:"37.4675",fill:"#5189e5",transform:"translate(-21.9838,69.7957) translate(22.0822,16.7783)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-5",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.3512",height:"41.3781",fill:"#35618c",transform:"translate(18.0162,72.7957) translate(23.1643,13.7278)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-6",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2483",height:"37.5869",fill:"#35618c",transform:"translate(59.0162,29.7957) translate(23.6379,15.3564)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-7",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.5664",height:"41.2747",fill:"#35618c",transform:"translate(17.0162,-13.2043) translate(24.2531,13.2043)"})})})}),u("svg",{className:"dh-loader-tile dh-loader-tile-4",viewBox:"0 0 182 182",children:u("g",{transform:"translate(91,91.0033) translate(-64,-64.0033)",children:u("g",{transform:"translate(63.9589,64.0492) translate(-59.9751,-63.9508)",children:u("rect",{width:"37.2854",height:"37.3014",fill:"#5189e5",transform:"translate(-21.9838,-13.2043) translate(22.0822,17.1792)"})})})})]});const Sd=ee.module("ItemListItem"),kl=class extends R.exports.Component{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=Q.createRef()}static handleKeyDown(){return Sd.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:s,children:i,"data-testid":o}=this.props;return u("div",{className:W("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:kl.handleKeyDown,onContextMenu: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:"presentation",style:s,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:i})}};let Al=kl;Al.defaultProps={children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,disableSelect:!1,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}};const Mr=ee.module("ItemList"),us=class extends R.exports.PureComponent{constructor(e){super(e),this.getItemSelected=pe((s,i)=>_t.isSelected(i,s),{max:us.CACHE_SIZE}),this.getCachedItem=pe((s,i,o,r,l,a,c,d)=>{const h=a({item:o,itemIndex:s,isFocused:r,isSelected:l,style:c});return u(Al,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:d,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:r,isSelected:l,itemIndex:s,style:c,children:h},i)},{max:us.CACHE_SIZE}),this.getOuterElement=pe(s=>{const i=Q.forwardRef((o,r)=>u("div",{ref:r,tabIndex:-1,onKeyDown:s,role:"presentation",...o}));return i.displayName="ItemListOuterElement",i}),this.getInnerElement=pe(()=>{const s=Q.forwardRef((i,o)=>u("div",{className:"item-list-inner-element",ref:o,...i}));return s.displayName="ItemListInnerElement",s}),this.getItemData=pe((s,i,o)=>({items:s,selectedRanges:i,renderItem:o})),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=Q.createRef(),this.listContainer=Q.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}}static renderItem({item:e}){return u("div",{className:"item-list-item-content",children:e&&(e.displayValue||e.value||`${e}`)})}componentDidMount(){const{isStickyBottom:e}=this.props;e&&!this.isListAtBottom()&&this.scrollToBottom()}componentDidUpdate(e,t){const{selectedRanges:n}=this.props,{focusIndex:s,isStuckToBottom:i,scrollOffset:o,height:r,selectedRanges:l}=this.state;if(i&&!this.isListAtBottom()&&this.scrollToBottom(),(o!==t.scrollOffset||r!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==l)this.setSelectedRanges(n);else if(l!==t.selectedRanges){const{onSelectionChange:a}=this.props;a(l)}if(s!==t.focusIndex){const{onFocusChange:a}=this.props;a(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,s=this.listContainer.current.querySelectorAll(t),i=e-n;return s[i]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,i=_t.isSelected(n,e)||we.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,i,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:s}=this.props;n&&this.setState(({selectedRanges:i})=>({selectedRanges:_t.selectRange(i,[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}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Mr.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){Mr.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:i}=this.props,{mouseDownIndex:o,selectedRanges:r}=this.state;o==null||i||(this.setState({isDragging:!0}),(n||o===e)&&(this.focusItem(e),s?(!n&&!this.getItemSelected(e,r)&&!we.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,we.isModifierKeyDown(t),!1)))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:s,onSelect:i}=this.props,{mouseDownIndex:o,isDragging:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!r){const l=t.shiftKey,a=we.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,a,n),!s&&!l&&!a&&i(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var r;const{isMultiSelect:t,itemCount:n,onSelect:s}=this.props,{focusIndex:i}=this.state;let o=i;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&s(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=n-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,n-1):o=0;else return;if(i!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);const{selectedRanges:l}=this.state;if(e.shiftKey&&l.length>0){const a=l[l.length-1];this.selectRange([Math.min(o,a[0]),Math.max(o,a[1])])}else this.deselectAll(),o!==null?this.selectItem(o):(r=this.listContainer.current)==null||r.focus();this.scrollIntoView(o)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:s}=this.props,{height:i}=n;return{isStuckToBottom:s&&this.isListAtBottom({scrollOffset:t,height:i}),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:i}=this.props,{selectedRanges:o}=this.state;if(i&&t&&o.length>0){const r=o[o.length-1];this.selectRange([Math.min(r[0],e),Math.max(e,r[1])])}else i&&o.length===1&&o[0][0]===e&&o[0][1]===e?s&&this.deselectItem(e):i&&n?this.getItemSelected(e,o)?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){_t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:_t.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){_t.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:_t.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,i=Math.floor(e/s),o=i+Math.ceil(t/s);n(i,o)}}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:i,disableSelect:o}=this.props,{focusIndex:r,selectedRanges:l}=this.state;if(e<s||e>=s+n.length)return null;const a=n[e-s];return this.getCachedItem(e,e,a,e===r&&!o,this.getItemSelected(e,l),i,t,o)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:s,rowHeight:i,"data-testid":o}=this.props,{selectedRanges:r}=this.state;return u(Fa,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:l,height:a})=>u(xa,{className:"item-list-scroll-pane",height:a,width:l,itemCount:t,itemSize:i,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":o,children:this.renderInnerElement})})}};let $t=us;$t.CACHE_SIZE=1e3;$t.DEFAULT_ROW_HEIGHT=20;$t.DEFAULT_OVERSCAN=10;$t.defaultProps={offset:0,items:[],rowHeight:us.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:us.DEFAULT_OVERSCAN,renderItem:us.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0};const Yn=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedDraggableItem=pe((t,n,s,i,o,r,l,a)=>u(Fi,{draggableId:Yn.getDraggableId(t,i),index:i,isDragDisabled:l,children:c=>u("div",{role:"menuitem",className:"draggable-item-list-item",ref:c.innerRef,tabIndex:-1,...c.draggableProps,...c.dragHandleProps,children:n({item:s,itemIndex:i,isFocused:o,isSelected:r,style:a,isClone:!1})})},i),{max:$t.CACHE_SIZE}),this.getCachedRenderDraggableItem=pe((t,n,s)=>({item:i,itemIndex:o,isFocused:r,isSelected:l,style:a})=>this.getCachedDraggableItem(t,s,i,o,r,l,n,a),{max:1}),this.getCachedRenderClone=pe((t,n,s,i)=>(o,r,l)=>{const{selectedCount:a}=this.state,{index:c}=l.source,d=n[c-s];return u("div",{className:W("draggable-item-list-dragging-item-container",t),...o.draggableProps,...o.dragHandleProps,ref:o.innerRef,children:u("div",{className:W("draggable-item-list-dragging-item",{"two-dragged":a===2},{"multiple-dragged":a>2}),children:i({item:d,itemIndex:c,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:a})})})},{max:1}),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=Q.createRef(),this.state={selectedCount:0}}static renderHandle(){return v("div",{children:[u(he,{children:"Drag to re-order"}),u(G,{icon:ki})]})}static renderBadge({text:e}){return e?u("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return v("div",{className:W("item-list-item-content","draggable-item-list-item-content",n),children:[u("span",{className:"title",children:e}),Yn.renderBadge({text:t}),Yn.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const s=e&&(e.displayValue||e.value||`${e}`),i=t?`${n}`:"",o=t?"item-list-item-clone":"";return Yn.renderTextItem({text:s,badgeText:i,className:o})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){return parseInt(e.split("/").pop()||"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:_t.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:s,isDoubleClickSelect:i,isDragDisabled:o,isDropDisabled:r,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,offset:h,onFocusChange:m,onSelect:p,onViewportChange:g,renderItem:f,rowHeight:b,selectedRanges:C,style:w,"data-testid":T}=this.props;return u(Ps,{isDropDisabled:r,droppableId:s,mode:"virtual",renderClone:this.getCachedRenderClone(n,d,h,f),"data-testid":T,children:(y,S)=>u("div",{role:"menu",className:W("draggable-item-list",e,{"is-drop-disabled":r,"is-drag-disabled":o,"is-dragging-from-this":S.draggingFromThisWith,"is-dragging-over":S.isDraggingOver,"is-dropping":S.draggingOverWith}),style:w,ref:y.innerRef,...y.droppableProps,children:u($t,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:i,isDragSelect:!1,isMultiSelect:l,isStickyBottom:a,itemCount:c,items:d,onFocusChange:m,onSelect:p,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:h,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,f),rowHeight:b,selectedRanges:C})})})}};let ut=Yn;ut.DEFAULT_ROW_HEIGHT=30;ut.defaultProps={className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Yn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Yn.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0};class ot{static reorder(t,n,s,i){const o=t===s?ot.adjustDestinationIndex(i,n):i,r=ot.removeItems(t,n);return s.splice(o,0,...r),r}static removeItems(t,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,c]=r;s[l]=t.splice(a,c-a+1)}return Oa(s)}static adjustDestinationIndex(t,n){let s=t;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>t)break;s-=Math.min(r,t-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const fi=class extends R.exports.Component{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),i=Array.from(n.values()).includes(!1);return s&&i?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,i=new Map(n),o=i.get(e);if(o instanceof Map){const l=new Map(o);if(t!=null)l.set(t,!o.get(t));else{const a=!fi.isParentSelected(e,i);o.forEach((c,d)=>l.set(d,a))}i.set(e,l)}else i.set(e,!o);const r=i.get(e);t===void 0&&r!==void 0&&typeof r!="boolean"&&(fi.isParentSelected(e,n)?r.forEach((l,a)=>r.set(a,!1)):r.forEach((l,a)=>r.set(a,!0))),s(i)}setAllValues(e){const{valueMap:t,onUpdateValueMap:n}=this.props,s=new Map;t.forEach((i,o)=>{if(typeof i=="boolean")s.set(o,e);else{const r=new Map;i.forEach((l,a)=>r.set(a,e)),s.set(o,r)}}),n(s)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:e,"data-testid":t}=this.props;return v("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(([n,s])=>v("div",{children:[u(St,{className:"hcm-parent",checked:fi.isParentSelected(n,e),onChange:()=>this.toggleValueFor(n),children:n}),s!==void 0&&typeof s!="boolean"&&Array.from(s.entries()).map(([i,o])=>u(St,{className:"hcm-child",checked:o,onChange:()=>this.toggleValueFor(n,i),children:i},i))]},n)),u("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,"data-testid":t?`${t}-btn-select-all`:void 0,children:"Select All"}),u("button",{type:"button",className:"btn btn-link",onClick:this.clear,"data-testid":t?`${t}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:e,className:t,icon:n,id:s,"data-testid":i}=this.props,{menuIsOpen:o}=this.state;return v("button",{type:"button",className:W("btn hcm-btn",t),onClick:this.toggleMenu,id:s,"data-testid":i,children:[v("span",{children:[n&&u(G,{icon:n,className:"hcm-icon mr-1"}),e]}),u(G,{icon:Ao,className:"hcm-icon ml-1"}),u(dn,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let vd=fi;vd.defaultProps={className:"",icon:null,id:"","data-testid":void 0};const Ll=({isLoaded:e=!1,isLoading:t=!0,errorMessage:n=null,"data-testid":s})=>u(tt,{in:!!n||!e||t,timeout:bt.transitionMs,classNames:e?"fade":"",mountOnEnter:!0,unmountOnExit:!0,children:u("div",{className:"fill-parent-absolute","data-testid":s,children:u("div",{className:W("iris-panel-message-overlay","fill-parent-absolute",{"iris-panel-scrim-background":e}),children:v("div",{className:"message-content",children:[v("div",{className:"message-icon",children:[t&&u(Ft,{}),!t&&n&&u(G,{icon:Zn})]}),u("div",{className:"message-text",children:n})]})})})});const Hl=({on:e,id:t,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r})=>u("button",{type:"button",className:W("btn","btn-switch",n,{active:e},{"is-invalid":s}),id:t,onClick:o,disabled:i,"data-testid":r,children:u("div",{className:"handle"})});function Nr(e){return e.isOn!==void 0}const Td=({item:e,onSelect:t=()=>{},"data-testid":n})=>{const{icon:s,subtitle:i,title:o}=e,r=R.exports.useMemo(()=>Nr(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return v("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s&&u("div",{className:"icon",children:u(G,{icon:s})}),u("div",{className:"title",children:o}),i&&u("div",{className:"shortcut",children:i}),u("div",{className:"accessory","data-testid":n,children:Nr(e)&&u(Hl,{on:e.isOn,onClick:l=>{l.stopPropagation(),r()}})||u(G,{icon:ml})})]})};const Pl=({items:e,onSelect:t=()=>{},"data-testid":n})=>u("div",{className:"navigation-menu-view","data-testid":n,children:u("ul",{className:"navigation-menu-list",children:e.map((s,i)=>u("li",{children:u(Td,{item:s,onSelect:()=>{t(i)}})},s.title))})});const Dr=({children:e,onBack:t,onClose:n,title:s,"data-testid":i})=>v("div",{className:"navigation-page","data-testid":i,children:[v("div",{className:"navigation-title-bar",children:[u("div",{className:"navigation-left-buttons",children:t!==void 0&&v("button",{className:"btn btn-link btn-back","data-testid":"btn-page-back",type:"button",onClick:t,children:[u(G,{icon:Sc}),"Back"]})}),u("div",{className:"navigation-title",children:s}),u("div",{className:"navigation-right-buttons",children:n!==void 0&&u("button",{className:"btn btn-link btn-link-icon btn-close px-2 m-1","data-testid":"btn-page-close",type:"button",onClick:n,children:u(G,{icon:Oi})})})]}),u("div",{className:"navigation-content",children:e})]});const Ed=({children:e,"data-testid":t})=>{const n=R.exports.useMemo(()=>Q.Children.toArray(e),[e]),s=_o(n),[i,o]=R.exports.useState(n[n.length-1]),[r,l]=R.exports.useState(null),[a,c]=R.exports.useState(null);R.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),c(s[s.length-1]))},[n,s,r,a,i]);const d=R.exports.useCallback(()=>{o(r),l(null)},[r]),h=R.exports.useCallback(()=>{c(null)},[]);return v("div",{className:"navigation-stack",children:[u("div",{className:"main-view","data-testid":t,children:i}),u(tt,{in:a!=null,timeout:bt.transitionMidMs,classNames:"slide-right",onEntered:h,children:u(Ie,{children:a&&u("div",{className:"popping-view",children:a})})}),u(tt,{in:r!=null,timeout:bt.transitionMidMs,classNames:"slide-left",onEntered:d,children:u(Ie,{children:r&&u("div",{className:"pushing-view",children:r})})})]})},Rd=({children:e,value:t,"data-testid":n})=>u("option",{value:t,"data-testid":n,children:e}),Bo=e=>{const{children:t,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=e,[l]=R.exports.useState(s||zt());return u(Ie,{children:Q.Children.map(t,a=>a?Q.cloneElement(a,{name:l,onChange:a.props.onChange||i,checked:o===a.props.value,disabled:a.props.disabled||n,"data-testid":r}):null)})},an=Q.forwardRef((e,t)=>{const{checked:n,children:s,className:i="",disabled:o=!1,inputClassName:r="",isInvalid:l=!1,labelClassName:a="",name:c,onChange:d,value:h,"data-testid":m}=e,[p]=R.exports.useState(zt());return v("div",{className:W("custom-control custom-radio",i),children:[u("input",{type:"radio",id:p,"data-testid":m,name:c,ref:t,className:W("custom-control-input",r,{"is-invalid":l}),checked:n,disabled:o,value:h,onChange:d}),u("label",{className:W("custom-control-label",a),htmlFor:p,children:s})]})});an.displayName="RadioItem";an.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const yd=({children:e,onChange:t,className:n,defaultValue:s,value:i,disabled:o,"data-testid":r})=>{const l=R.exports.useCallback(a=>{t(a.target.value)},[t]);return u("select",{className:W("custom-select",n),onChange:l,defaultValue:s,value:i,disabled:o,"data-testid":r,children:e})};class _l extends R.exports.PureComponent{constructor(t){super(t),this.getCachedItem=pe((n,s,i,o,r,l,a)=>{const c={height:r},d=o!=null?o:i;return u("li",{className:"value-list-item",style:c,children:u(St,{checked:l,disabled:a,onChange:()=>this.handleSelect(n),children:d})},s)},{max:1e3}),this.getCachedItems=pe((n,s,i,o)=>{const r=[];for(let l=0;l<n.length;l+=1){const a=n[l],{value:c,displayValue:d,isSelected:h}=a,m=i+l,p=m,g=this.getCachedItem(m,p,c,d,s,h,o);r.push(g)}return r},{max:1}),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=Q.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleScroll(){this.sendViewportUpdate()}handleSelect(t){const{items:n,offset:s,onSelect:i}=this.props,o=t-s;if(o>=0&&o<n.length){const r=n[o],{value:l}=r;i(t,l)}else i(t,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:t,rowHeight:n}=this.props,s=this.list.current.scrollTop,i=s+this.list.current.clientHeight,o=Math.floor(s/n),r=Math.ceil(i/n);(this.topRow!==o||this.bottomRow!==r)&&(this.topRow=o,this.bottomRow=r,t(o,r))}render(){const{disabled:t,items:n,itemCount:s,offset:i,rowHeight:o,"data-testid":r}=this.props,l=this.getCachedItems(n,o,i,t);return u("div",{className:"select-value-list-scroll-pane h-100 w-100",onScroll:this.handleScroll,ref:this.list,"data-testid":r,children:u("div",{className:"select-value-list",style:{height:s*o},children:u("ol",{className:"select-value-list-content",style:{position:"absolute",height:n.length*o,top:i*o,left:0},children:l})})})}}_l.defaultProps={disabled:!1,rowHeight:21,"data-testid":void 0};const Fr=ee.module("Shortcut");var se=(e=>(e.CTRL="MODIFIER_CTRL",e.CMD="MODIFIER_CMD",e.ALT="MODIFIER_ALT",e.OPTION="MODIFIER_OPTION",e.SHIFT="MODIFIER_SHIFT",e))(se||{}),le=(e=>(e.A="A",e.B="B",e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.H="H",e.I="I",e.J="J",e.K="K",e.L="L",e.M="M",e.N="N",e.O="O",e.P="P",e.Q="Q",e.R="R",e.S="S",e.T="T",e.U="U",e.V="V",e.W="W",e.X="X",e.Y="Y",e.Z="Z",e.ZERO="0",e.ONE="1",e.TWO="2",e.THREE="3",e.FOUR="4",e.FIVE="5",e.SIX="6",e.SEVEN="7",e.EIGHT="8",e.NINE="9",e.BACKSPACE="Backspace",e.ESCAPE="Escape",e.ENTER="Enter",e.DELETE="Delete",e.SLASH="/",e.QUESTION_MARK="?",e.BACKSLASH="\\",e.PIPE="|",e.MINUS="-",e.UNDERSCORE="_",e.EQUALS="=",e.PLUS="+",e.BACKTICK="`",e.TILDE="~",e.COMMA=",",e.LEFT_CHEVRON="<",e.PERIOD=".",e.RIGHT_CHEVRON=">",e.SEMICOLON=";",e.COLON=":",e.SINGLE_QUOTE="'",e.DOUBLE_QUOTE='"',e.LEFT_BRACKET="[",e.RIGHT_BRACKET="]",e.LEFT_CURLY="{",e.RIGHT_CURLY="}",e.F1="F1",e.F2="F2",e.F3="F3",e.F4="F4",e.F5="F5",e.F6="F6",e.F7="F7",e.F8="F8",e.F9="F9",e.F10="F10",e.F11="F11",e.F12="F12",e))(le||{});const Id=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),$e=class extends Mo{constructor({id:e,shortcut:t,macShortcut:n,isEditable:s=!0,name:i,tooltip:o}){super(),this.id=e,this.name=i,this.tooltip=o,this.isEditable=s;const l=$e.isMacPlatform?n:t;this.defaultKeyState=$e.createKeyState(l),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(le).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!$e.isMacPlatform&&e.metaKey||!$e.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Id.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let s="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?s="":!$e.isAllowedKey(t)&&$e.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+="\u2303"),e.altKey&&(t+="\u2325"),e.shiftKey&&(t+="\u21E7"),e.metaKey&&(t+="\u2318"),e.keyValue){case"Enter":t+="\u23CE";break;case"Escape":t+="\u238B";break;case"Backspace":t+="\u232B";break;case"Delete":t+="\u2326";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,s;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((s=t.keyValue)==null?void 0:s.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":$e.isMacPlatform?$e.getMacDisplayText(e):$e.getWindowsDisplayText(e)}getDisplayText(){return $e.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){$e.isValidKeyState(e)?(Fr.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new ve("onUpdate",{detail:this}))):Fr.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return $e.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState($e.NULL_KEY_STATE)}isNull(){return $e.doKeyStatesMatch(this.keyState,$e.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return $e.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState($e.getKeyStateFromEvent(e))}};let Wo=$e;Wo.NULL_KEY_STATE={metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null};Wo.isMacPlatform=we.isMacPlatform();const xr=ee.module("ShortcutRegistry");class Md extends Mo{constructor(){super(...arguments),this.shortcutMap=new Map,this.shortcutsByCategory=new Map}createAndAdd(t){const n=new Wo(t);return this.add(n)}add(t){var i;const n=this.shortcutMap.get(t.id);if(n)return xr.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${t.id}`),n;xr.debug2(`Adding shortcut to registry: ${t.id}`),t.addEventListener("onUpdate",({detail:o})=>this.dispatchEvent(new ve("onUpdate",{detail:o})));const s=t.id.split(".")[0];return this.shortcutMap.set(t.id,t),this.shortcutsByCategory.has(s)?(i=this.shortcutsByCategory.get(s))==null||i.push(t):this.shortcutsByCategory.set(s,[t]),t}get(t){return this.shortcutMap.get(t)}getConflictingShortcuts(t){return Array.from(this.shortcutMap.values()).filter(n=>!n.isNull()&&n.matchesKeyState(t))}}const ye=Object.freeze(new Md),zo={COPY:ye.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[se.CTRL,le.C],macShortcut:[se.CMD,le.C],isEditable:!1}),PASTE:ye.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[se.CTRL,le.V],macShortcut:[se.CMD,le.V],isEditable:!1}),SAVE:ye.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[se.CTRL,le.S],macShortcut:[se.CMD,le.S],isEditable:!1}),SELECT_ALL:ye.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[se.CTRL,le.A],macShortcut:[se.CMD,le.A],isEditable:!1}),LINKER:ye.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[se.CTRL,le.L],macShortcut:[se.CMD,le.L]}),LINKER_CLOSE:ye.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[le.ESCAPE],macShortcut:[le.ESCAPE],isEditable:!1})};const Vl=Q.forwardRef((e,t)=>{const{children:n,className:s,disabled:i,isLinked:o,isLinkedSource:r,isInvalid:l,onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,"data-testid":m}=e;return v("button",{ref:t,type:"button",className:W("btn-socketed",{"btn-socketed-linked":o||r},{"btn-socketed-linked-source":r},{"is-invalid":l},s),onClick:a,onMouseEnter:c,onMouseLeave:d,style:h,disabled:i,"data-testid":m,children:[n,u(G,{icon:Cl,className:"linked btn-socketed-icon",transform:"down-1"}),u(G,{icon:Gc,className:"is-invalid btn-socketed-icon"})]})});Vl.displayName="SocketedButton";Vl.defaultProps={children:void 0,className:"",disabled:!1,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Nd="_track_xvu02_28",Dd="_handle_xvu02_11",Fd="_ticks_xvu02_96",Ul={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_xvu02_1","time-slider-popovers":"_time-slider-popovers_xvu02_6","handle-popper":"_handle-popper_xvu02_11","flex-spacer":"_flex-spacer_xvu02_24",track:Nd,"track-fills":"_track-fills_xvu02_35","track-fill":"_track-fill_xvu02_35","track-fill-start":"_track-fill-start_xvu02_53","track-fill-middle":"_track-fill-middle_xvu02_54","track-fill-end":"_track-fill-end_xvu02_57","handle-track":"_handle-track_xvu02_60",handle:Dd,ticks:Fd,"tick-labels":"_tick-labels_xvu02_114","tick-label":"_tick-label_xvu02_114","tick-label-wrapper":"_tick-label-wrapper_xvu02_130"};parseInt(Ul["handle-size"],10);parseInt(Ul["popover-width"],10);Object.freeze({ERROR:"error"});window.$=ll;window.jQuery=ll;var Jn=(e=>(e.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",e.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters",e))(Jn||{});Object.freeze([[Jn.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[Jn.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);var be=(e=>(e.COUNT="Count",e.MIN="Min",e.MAX="Max",e.SUM="Sum",e.ABS_SUM="AbsSum",e.VAR="Var",e.AVG="Avg",e.STD="Std",e.FIRST="First",e.LAST="Last",e.SKIP="Skip",e.COUNT_DISTINCT="CountDistinct",e.DISTINCT="Distinct",e.UNIQUE="Unique",e))(be||{});class Oe{static isValid(t){return!0}static isSameFormat(t,n){throw new Error("isSameFormat not implemented")}static makeFormat(t,n,s){return{label:t,formatString:n,type:s}}format(t,n){return""}}Oe.TYPE_GLOBAL="type-window";Oe.TYPE_CONTEXT_PRESET="type-context-preset";Oe.TYPE_CONTEXT_CUSTOM="type-context-custom";class xd extends Oe{format(t){switch(t){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class Od extends Oe{format(t){return String.fromCharCode(t)}}const{dh:P}=globalThis,Hi=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Bl=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),kd=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:Hi.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Ad=M.exports.shape({columns:M.exports.arrayOf(Hi).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Bl),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),Ld=M.exports.shape({columns:M.exports.arrayOf(Hi),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Ci=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),Hd=M.exports.shape({created:M.exports.arrayOf(Ci).isRequired,updated:M.exports.arrayOf(Ci).isRequired,removed:M.exports.arrayOf(Ci).isRequired}),Pd=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),_d=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:Hi,FilterCondition:Bl,IdeSession:_d,RollupConfig:Pd,Sort:kd,Table:Ad,TreeTable:Ld,VariableChanges:Hd,VariableDefinition:Ci});const Or=ee.module("DateTimeColumnFormatter"),zn=class extends Oe{constructor({timeZone:e="",showTimeZone:t=!0,showTSeparator:n=!1,defaultDateTimeFormatString:s=zn.DEFAULT_DATETIME_FORMAT_STRING}={}){super();const i=e||zn.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=P.i18n.TimeZone.getTimeZone(i)}catch{Or.error("Unsupported time zone id",i),this.dhTimeZone=P.i18n.TimeZone.getTimeZone(zn.DEFAULT_TIME_ZONE_ID)}this.defaultDateTimeFormatString=s,this.showTimeZone=t,this.showTSeparator=n,this.formatStringMap=zn.makeFormatStringMap(t,n)}static isValid(e){try{return P.i18n.DateTimeFormat.format(e.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t,n=Oe.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 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[...zn.makeGlobalFormatStringMap(e,t).keys()]}static makeFormatStringMap(e,t){const n=t?"'T'":" ",s=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[...zn.makeFormatStringMap(e,t).keys()]}getEffectiveFormatString(e){return this.formatStringMap.get(e)||e}format(e,t){const n=t&&t.formatString||this.defaultDateTimeFormatString,s=this.getEffectiveFormatString(n);try{return P.i18n.DateTimeFormat.format(s,e,this.dhTimeZone)}catch{Or.error("Invalid format arguments")}return""}};let In=zn;In.DEFAULT_DATETIME_FORMAT_STRING="yyyy-MM-dd HH:mm:ss.SSS";In.DEFAULT_TIME_ZONE_ID="America/New_York";const Vd=ee.module("DecimalColumnFormatter"),Wt=class extends Oe{constructor({defaultFormatString:e=Wt.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return P.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=Oe.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return Wt.makeFormat(e,t,Oe.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return Wt.makeFormat("Custom Format",e,Oe.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}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return P.i18n.NumberFormat.format(n,s)}catch{Vd.error("Invalid format arguments")}return""}};let Be=Wt;Be.DEFAULT_FORMAT_STRING="###,##0.0000";Be.FORMAT_PERCENT=Wt.makePresetFormat("Percent","##0.00%");Be.FORMAT_BASIS_POINTS=Wt.makePresetFormat("Basis Points","###,##0 bp",1e4);Be.FORMAT_MILLIONS=Wt.makePresetFormat("Millions","###,##0.000 mm",1e-6);Be.FORMAT_ROUND=Wt.makePresetFormat("Round","###,##0");Be.FORMAT_ROUND_TWO_DECIMALS=Wt.makePresetFormat("0.00","###,##0.00");Be.FORMAT_ROUND_FOUR_DECIMALS=Wt.makePresetFormat("0.0000","###,##0.0000");class Ud extends Oe{format(t){return`${t}`}}const Bd=ee.module("IntegerColumnFormatter"),As=class extends Oe{constructor({defaultFormatString:e=As.DEFAULT_FORMAT_STRING}={}){super(),this.defaultFormatString=e}static isValid(e){try{return P.i18n.NumberFormat.format(e.formatString,0),!0}catch{return!1}}static makeFormat(e,t,n=Oe.TYPE_CONTEXT_PRESET,s){return{label:e,type:n,formatString:t,multiplier:s}}static makePresetFormat(e,t="",n){return As.makeFormat(e,t,Oe.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(e="",t){return As.makeFormat("Custom Format",e,Oe.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}format(e,t){const n=t&&t.formatString||this.defaultFormatString,s=t&&t.multiplier?e*t.multiplier:e;try{return P.i18n.NumberFormat.format(n,s)}catch{Bd.error("Invalid format arguments")}return""}};let on=As;on.DEFAULT_FORMAT_STRING="###,##0";on.FORMAT_MILLIONS=As.makePresetFormat("Millions","###,##0.000 mm",1e-6);class Wd extends Oe{format(t){return t}}const it=class{static makeDateWrapper(e,t,n=0,s=1,i=0,o=0,r=0,l=0){if(!e)throw new Error("No timezone provided");const a=`${t}`.padStart(4,"0"),c=`${n+1}`.padStart(2,"0"),d=`${s}`.padStart(2,"0"),h=`${i}`.padStart(2,"0"),m=`${o}`.padStart(2,"0"),p=`${r}`.padStart(2,"0"),g=`${l}`.padStart(9,"0"),f=`${a}-${c}-${d} ${h}:${m}:${p}.${g}`;return P.i18n.DateTimeFormat.parse(it.FULL_DATE_FORMAT,f,P.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:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}=t;if(e.nanos!=null){if(e.nanos.length===9)return null;c=it.getNextNanos(e.nanos),c>999999999&&(a+=1,c=0)}else e.seconds!=null?a+=1:e.minutes!=null?l+=1:e.hours!=null?r+=1:e.date!=null?o+=1:e.month!=null?i+=1:s+=1;const d=new Date(s,i,o,r,l,a);return it.makeDateWrapper(n,d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),c)}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<it.months.length;s+=1)if(it.months[s].startsWith(n))return s}return NaN}static parseDateValues(e,t,n,s,i,o,r){const l=parseInt(e,10),a=t!=null?this.parseMonth(t):0,c=n!=null?parseInt(n,10):1,d=s!=null?parseInt(s,10):0,h=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,p=r!=null?parseInt(r.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(a)||Number.isNaN(c)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(m)||Number.isNaN(p)?null:{year:l,month:a,date:c,hours:d,minutes:h,seconds:m,nanos:p}}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,,i,,o,,r,,l,,a,,c,d]=n;if(d!=null&&d.length>0)throw new Error(`Unexpected characters after date string '${e}': ${d}`);return{year:s,month:i,date:o,hours:r,minutes:l,seconds:a,nanos:c}}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()),a=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()),c=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()+1);return[a,c]}if(n==="yesterday"){const l=new Date(Date.now()),a=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate()-1),c=it.makeDateWrapper(t,l.getFullYear(),l.getMonth(),l.getDate());return[a,c]}if(n==="now"){const l=new Date(Date.now());return[P.DateWrapper.ofJsDate(l),null]}const s=it.parseDateTimeString(n);if(s.year==null&&s.month==null&&s.date==null)throw new Error(`Unable to extract year, month, or day ${n}`);const i=it.parseDateValues(s.year,s.month,s.date,s.hours,s.minutes,s.seconds,s.nanos);if(i==null)throw new Error(`Unable to extract date values from ${s}`);const o=it.makeDateWrapper(t,i.year,i.month,i.date,i.hours,i.minutes,i.seconds,i.nanos),r=it.getNextDate(s,i,t);return[o,r]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}};let es=it;es.FULL_DATE_FORMAT="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";es.months=["january","february","march","april","may","june","july","august","september","october","november","december"];class Ut{}Ut.not="not";Ut.and="and";Ut.or="or";function zd(e){if(!(e==="not"||e==="and"||e==="or"))throw new Error("operator is not a valid FilterOperatorValue")}class z{}z.eq="eq";z.eqIgnoreCase="eqIgnoreCase";z.notEq="notEq";z.notEqIgnoreCase="notEqIgnoreCase";z.greaterThan="greaterThan";z.greaterThanOrEqualTo="greaterThanOrEqualTo";z.lessThan="lessThan";z.lessThanOrEqualTo="lessThanOrEqualTo";z.in="in";z.inIgnoreCase="inIgnoreCase";z.notIn="notIn";z.notInIgnoreCase="notInIgnoreCase";z.isTrue="isTrue";z.isFalse="isFalse";z.isNull="isNull";z.invoke="invoke";z.contains="contains";z.notContains="notContains";z.startsWith="startsWith";z.endsWith="endsWith";z.containsAny="containsAny";function $d(e){switch(e){case z.eq:return"is exactly";case z.eqIgnoreCase:return"is exactly (ignore case)";case z.notEq:return"is not exactly";case z.notEqIgnoreCase:return"is not exactly (ignore case)";case z.contains:return"contains";case z.notContains:return"does not contain";case z.startsWith:return"starts with";case z.endsWith:return"ends with";default:throw new Error(`Unrecognized text filter type ${e}`)}}function Gd(e){switch(e){case z.eq:return"is equal to";case z.notEq:return"is not equal to";case z.greaterThan:return"greater than";case z.greaterThanOrEqualTo:return"greater than or equal to";case z.lessThan:return"less than";case z.lessThanOrEqualTo:return"less than or equal to";default:throw new Error(`Unrecognized number filter type ${e}`)}}function qd(e){switch(e){case z.eq:return"date is";case z.notEq:return"date is not";case z.notEqIgnoreCase:case z.greaterThan:return"date is after";case z.greaterThanOrEqualTo:return"date is after or equal";case z.lessThan:return"date is before";case z.lessThanOrEqualTo:return"date is before or equal";default:throw new Error(`Unrecognized date filter type ${e}`)}}function Kd(e){switch(e){case z.isTrue:return"Is True";case z.isFalse:return"Is False";case z.isNull:return"Is Null";default:throw new Error(`Unrecognized boolean filter type ${e}`)}}const Qt=ee.module("TableUtils"),Y=class{static getSortIndex(e,t){var n;for(let s=0;s<e.length;s+=1)if(((n=e[s].column)==null?void 0:n.index)===t)return s;return null}static getSortForColumn(e,t){const n=Y.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return Y.isBooleanType(e)?[z.isTrue,z.isFalse,z.isNull]:Y.isCharType(e)?[z.eq,z.notEq]:Y.isNumberType(e)||Y.isDateType(e)?[z.eq,z.notEq,z.greaterThan,z.greaterThanOrEqualTo,z.lessThan,z.lessThanOrEqualTo]:Y.isTextType(e)?[z.eq,z.eqIgnoreCase,z.notEq,z.notEqIgnoreCase,z.contains,z.notContains,z.startsWith,z.endsWith]:[]}static getNextSort(e,t,n){if(!e||n<0||n>=e.length)return null;const s=Y.getSortForColumn(t,n);return s===null?e[n].sort().asc():s.direction===Y.sortDirection.ascending?s.desc():null}static makeColumnSort(e,t,n,s){if(!e||t<0||t>=e.length||n===Y.sortDirection.none)return null;let i=e[t].sort();switch(n){case Y.sortDirection.ascending:i=i.asc();break;case Y.sortDirection.descending:i=i.desc();break}return s&&(i=i.abs()),i}static toggleSortForColumn(e,t,n,s=!1){if(n<0||n>=t.length)return[];const i=Y.getNextSort(t,e,n);return Y.setSortForColumn(e,n,i,s)}static sortColumn(e,t,n,s,i,o){if(!e||n<0||n>=t.length)return[];const r=Y.makeColumnSort(t,n,s,i);return Y.setSortForColumn(e,n,r,o)}static setSortForColumn(e,t,n,s=!1){const i=Y.getSortIndex(e,t);let o=[];return s&&(o=o.concat(e.filter(({direction:r})=>r!==Y.sortDirection.reverse)),i!==null&&o.splice(i,1)),n!==null&&o.push(n),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case Y.dataType.BOOLEAN:return Y.dataType.BOOLEAN;case"char":case"java.lang.Character":case Y.dataType.CHAR:return Y.dataType.CHAR;case"java.lang.String":case Y.dataType.STRING:return Y.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case Y.dataType.DATETIME:return Y.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case Y.dataType.DECIMAL:return Y.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 Y.dataType.INT:return Y.dataType.INT;default:return Y.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"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return Y.isIntegerType(e)||Y.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 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 Y.getNormalizedType(e)===Y.getNormalizedType(t)}static makeQuickFilter(e,t,n){const s=t.split("||");let i=null;for(let o=0;o<s.length;o+=1){const l=s[o].split("&&");let a=null;for(let c=0;c<l.length;c+=1){const d=l[c].trim();if(d.length>0){const h=Y.makeQuickFilterFromComponent(e,d,n);if(h)a?a=a.and(h):a=h;else throw new Error(`Unable to parse quick filter from text ${t}`)}}i&&a?i=i.or(a):i=a}return i}static makeQuickFilterFromComponent(e,t,n){const{type:s}=e;return Y.isNumberType(s)?this.makeQuickNumberFilter(e,t):Y.isBooleanType(s)?this.makeQuickBooleanFilter(e,t):n&&Y.isDateType(s)?this.makeQuickDateFilter(e,t,n):Y.isCharType(s)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}static makeQuickNumberFilter(e,t){if(t==null)return null;const n=e.filter();let s=null;const o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i.exec(t);let r=null,l=null,a=null,c=null,d=null;if(o!==null&&o.length>3&&([,r,l,a,c,d]=o),d!=null&&d.trim().length>0)return null;if(r==null&&(r="="),c!=null){if(!(r==="="||r==="!"||r==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":s=n.isNull();break;case"nan":s=P.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"\u221E":l!=null?s=P.FilterCondition.invoke("isInf",n).and(n.lessThan(P.FilterValue.ofNumber(0))):s=P.FilterCondition.invoke("isInf",n).and(n.greaterThan(P.FilterValue.ofNumber(0)));break}return s!==null&&(r==="!"||r==="!=")&&(s=s.not()),s}if(a==null)return null;if(a=Y.removeCommas(a),Y.isLongType(e.type))try{a=P.FilterValue.ofNumber(P.LongWrapper.ofString(`${l!=null?"-":""}${a}`))}catch(h){return Qt.warn("Unable to create long filter",h),null}else{if(a=parseFloat(a),a==null||Number.isNaN(a))return null;a=P.FilterValue.ofNumber(l!=null?0-a:a)}return s=e.filter(),Y.makeRangeFilterWithOperation(s,r,a)}static makeQuickTextFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!~|!=|~|=|!)?(.*)/.exec(n);let o=null,r=null;if(i!==null&&i.length>2&&([,o,r]=i,r!=null&&(r=r.trim())),r==null||r.length===0)return null;o==null&&(o="=");const l=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return l.isNull();case"!=":case"!":return l.isNull().not();default:return null}let a=null,c=null;switch(r.startsWith("*")?(a="*",r=r.substring(1)):r.endsWith("*")&&!r.endsWith("\\*")&&(c="*",r=r.substring(0,r.length-1)),r=r.replace("\\",""),o){case"~":return l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)));case"!~":return l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E.*`)).not());case"!=":return a==="*"?l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`)).not()):c==="*"?l.isNull().or(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`)).not()):l.notEqIgnoreCase(P.FilterValue.ofString(r.toLowerCase()));case"=":return a==="*"?l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${r}\\E$`))):c==="*"?l.isNull().not().and(l.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${r}\\E.*`))):l.eqIgnoreCase(P.FilterValue.ofString(r.toLowerCase()))}return null}static makeQuickBooleanFilter(e,t){if(t==null)return null;const s=/^(!=|=|!)?(.*)/.exec(`${t}`.trim());if(s===null)return null;const[,i,o]=s,r=i==="!"||i==="!=",l=o.trim().toLowerCase();let a=e.filter();try{const c=Y.makeBooleanValue(l);return c?a=a.isTrue():c===null?a=a.isNull():a=a.isFalse(),r?a.not():a}catch{return null}}static makeQuickDateFilter(e,t,n){const s=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/.exec(s);if(o==null||o.length<=2)throw new Error(`Unable to parse date filter: ${t}`);let r=null,l=null;[,r,l]=o;let a=z.eq;switch(r){case"<":a=z.lessThan;break;case"<=":case"=<":a=z.lessThanOrEqualTo;break;case">":a=z.greaterThan;break;case">=":case"=>":a=z.greaterThanOrEqualTo;break;case"!=":case"!":a=z.notEq;break;case"=":case"==":default:a=z.eq;break}return Y.makeQuickDateFilterWithOperation(e,l,a,n)}static makeQuickDateFilterWithOperation(e,t,n=z.eq,s){if(e==null)throw new Error("Column is null");const[i,o]=es.parseDateRange(t,s),r=i!=null?P.FilterValue.ofNumber(i):null,l=o!=null?P.FilterValue.ofNumber(o):null,a=e.filter();if(r==null)return n===z.notEq?a.isNull().not():a.isNull();switch(n){case z.eq:{if(l!=null){const c=a.greaterThanOrEqualTo(r),d=a.lessThan(l);return c.and(d)}return a.eq(r)}case z.lessThan:return a.lessThan(r);case z.lessThanOrEqualTo:return l!=null?a.lessThan(l):a.lessThanOrEqualTo(r);case z.greaterThan:return l!=null?a.greaterThanOrEqualTo(l):a.greaterThan(r);case z.greaterThanOrEqualTo:return a.greaterThanOrEqualTo(r);case z.notEq:{if(l!=null){const c=a.lessThan(r),d=a.greaterThanOrEqualTo(l);return c.or(d)}return a.notEq(r)}default:throw new Error(`Invalid operator: ${n}`)}}static makeQuickCharFilter(e,t){if(t==null)return null;const n=`${t}`.trim(),i=/^(!=|=|!)?(null|.)?(.*)/.exec(n);let o=null,r=null,l=null;if(i!==null&&i.length>3&&([,o,r,l]=i),l!=null&&l.trim().length>0||r==null||r.length===0)return null;o==null&&(o="=");const a=e.filter();if(r.toLowerCase()==="null")switch(o){case"=":return a.isNull();case"!=":case"!":return a.isNull().not();default:return null}return Y.makeRangeFilterWithOperation(a,o,P.FilterValue.ofString(r))}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 i,o,r=!0;const l=new Promise((a,c)=>{o=setTimeout(()=>{i(),r=!1,c(new El(`Event "${t}" timed out.`))},n),i=e.addEventListener(t,d=>{if(s!=null&&!s(d)){Qt.debug2("Event triggered, but matcher returned false.");return}Qt.debug2("Event triggered, resolving."),i(),clearTimeout(o),r=!1,a(d)})});return l.cancel=()=>{if(r){Qt.debug2("Pending promise cleanup."),i(),clearTimeout(o),r=!1;return}Qt.debug2("Ignoring non-pending promise cancel.")},l}static makeAdvancedFilter(e,t,n){const{filterItems:s,filterOperators:i,invertSelection:o,selectedValues:r}=t;let l=null;for(let c=0;c<s.length;c+=1){const d=s[c],{selectedType:h,value:m}=d;if(h!=null&&h.length>0&&m!=null&&m.length>0)try{const p=Y.makeAdvancedValueFilter(e,h,m,n);if(p!=null){if(c===0)l=p;else if(l!==null&&c-1<i.length){const g=i[c-1];if(g===Ut.and)l=l.and(p);else if(g===Ut.or)l=l.or(p);else{Qt.error("Unexpected filter operator",g,p),l=null;break}}}else Qt.debug2("Empty filter ignored for",h,m)}catch(p){Qt.error("Unable to create filter",p),l=null;break}}const a=Y.makeSelectValueFilter(e,r,o);return a!=null&&(l!=null?l=l.and(a):l=a),l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeFilterValue(e,t){const n=Y.getBaseType(e);return Y.isTextType(n)?P.FilterValue.ofString(t):Y.isLongType(n)?P.FilterValue.ofNumber(P.LongWrapper.ofString(Y.removeCommas(t))):P.FilterValue.ofNumber(Y.removeCommas(t))}static makeFilterRawValue(e,t){return Y.isTextType(e)?P.FilterValue.ofString(t):Y.isBooleanType(e)?P.FilterValue.ofBoolean(t):P.FilterValue.ofNumber(t)}static makeValue(e,t,n){if(t==null||t==="null")return null;if(Y.isTextType(e))return t;if(Y.isLongType(e))return P.LongWrapper.ofString(Y.removeCommas(t));if(Y.isBooleanType(e))return Y.makeBooleanValue(t,!0);if(Y.isDateType(e)){const[s]=es.parseDateRange(t,n);return s}return Y.isNumberType(e)?Y.makeNumberValue(t):(Qt.error("Unexpected column type",e),null)}static makeBooleanValue(e,t=!1){if(e===""&&t)return null;switch(e==null?void 0: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==="null"||e==="")return null;const t=e.toLowerCase().trim();if(t==="\u221E"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-\u221E"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;const n=Y.removeCommas(t);if(Y.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error(`Invalid number '${e}'`)}static makeAdvancedValueFilter(e,t,n,s){if(Y.isDateType(e.type))return Y.makeQuickDateFilterWithOperation(e,n,t,s);const i=Y.makeFilterValue(e.type,n),o=e.filter();switch(t){case z.eq:return o.eq(i);case z.eqIgnoreCase:return o.eqIgnoreCase(i);case z.notEq:return o.notEq(i);case z.notEqIgnoreCase:return o.notEqIgnoreCase(i);case z.greaterThan:return o.greaterThan(i);case z.greaterThanOrEqualTo:return o.greaterThanOrEqualTo(i);case z.lessThan:return o.lessThan(i);case z.lessThanOrEqualTo:return o.lessThanOrEqualTo(i);case z.isTrue:return o.isTrue();case z.isFalse:return o.isFalse();case z.isNull:return o.isNull();case z.contains:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)));case z.notContains:return o.isNull().or(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E.*`)).not());case z.startsWith:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i)^\\Q${n}\\E.*`)));case z.endsWith:return o.isNull().not().and(o.invoke("matches",P.FilterValue.ofString(`(?s)(?i).*\\Q${n}\\E$`)));case z.in:case z.inIgnoreCase:case z.notIn:case z.notInIgnoreCase:case z.invoke:default:throw new Error(`Unexpected filter operation: ${t}`)}}static makeSelectValueFilter(e,t,n){if(t.length===0){if(n)return null;let o=null;Y.isTextType(e.type)?o=P.FilterValue.ofString("a"):Y.isBooleanType(e.type)?o=P.FilterValue.ofBoolean(!0):Y.isDateType(e.type)?o=P.FilterValue.ofNumber(P.DateWrapper.ofJsDate(new Date)):o=P.FilterValue.ofNumber(0);const r=e.filter().eq(o),l=e.filter().notEq(o);return r.and(l)}const s=[];let i=!1;for(let o=0;o<t.length;o+=1){const r=t[o];r==null?i=!0:Y.isTextType(e.type)?s.push(P.FilterValue.ofString(typeof r=="number"?String.fromCharCode(r):r)):Y.isBooleanType(e.type)?s.push(P.FilterValue.ofBoolean(!!r)):s.push(P.FilterValue.ofNumber(r))}return i?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 i=n.name.toUpperCase(),o=s.name.toUpperCase();return Po.sort(i,o,t)})}};let F=Y;F.dataType={BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"};F.sortDirection={ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null};F.REVERSE_TYPE=Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"});F.NUMBER_REGEX=/^-?\d+(\.\d+)?$/;class cn{static makeColumnFormatMap(t){return t==null?new Map:t.reduce((n,s)=>{const i=F.getNormalizedType(s.columnType);if(i===null)return n;n.has(i)||n.set(i,new Map);const o=n.get(i);return o==null||o.set(s.columnName,s.format),n},new Map)}static makeColumnFormattingRule(t,n,s){return{columnType:t,columnName:n,format:s}}constructor(t=[],n,s,i,o=!1){this.defaultColumnFormatter=new Ud,this.typeFormatterMap=new Map([[F.dataType.BOOLEAN,new xd],[F.dataType.CHAR,new Od],[F.dataType.DATETIME,new In(n)],[F.dataType.DECIMAL,new Be(s)],[F.dataType.INT,new on(i)],[F.dataType.STRING,new Wd]]),this.columnFormatMap=cn.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(t,n=!1){const s=F.getNormalizedType(t);if(s!==null)return n&&!this.columnFormatMap.has(s)&&this.columnFormatMap.set(s,new Map),this.columnFormatMap.get(s)}getColumnFormat(t,n){var i;const s=this.getColumnFormatMapForType(t);return(i=s==null?void 0:s.get(n))!=null?i:null}getColumnTypeFormatter(t){var i;const n=F.getNormalizedType(t);let s=this.defaultColumnFormatter;return n&&(s=(i=this.typeFormatterMap.get(n))!=null?i:s),s}getFormattedString(t,n,s="",i){if(t==null)return"";const o=this.getColumnTypeFormatter(n),r=i||this.getColumnFormat(n,s);return o.format(t,r!=null?r:void 0)}get timeZone(){var n;const t=this.typeFormatterMap.get(F.dataType.DATETIME);return(n=t==null?void 0:t.dhTimeZone)==null?void 0:n.id}}class vi{static getColumnFormats(t){if(t&&t.formatter){const{formatter:n}=t;return n}}static getDateTimeFormatterOptions(t){return{timeZone:t==null?void 0:t.timeZone,defaultDateTimeFormatString:t==null?void 0:t.defaultDateTimeFormat,showTimeZone:t==null?void 0:t.showTimeZone,showTSeparator:t==null?void 0:t.showTSeparator}}static isCustomColumnFormatDefined(t,n,s){const i=t.getColumnFormat(s,n);return i!=null&&(i.type===Oe.TYPE_CONTEXT_PRESET||i.type===Oe.TYPE_CONTEXT_CUSTOM)}}const Yd=e=>{switch(e){default:return!1}},Xd=(e,t)=>{switch(e){case be.COUNT:case be.FIRST:case be.LAST:case be.COUNT_DISTINCT:case be.DISTINCT:case be.UNIQUE:return!0;case be.MIN:case be.MAX:return F.isNumberType(t)||F.isDateType(t)||F.isTextType(t);case be.SUM:case be.ABS_SUM:case be.VAR:case be.AVG:case be.STD:return F.isNumberType(t);case be.SKIP:return!1}},$o=(e,t)=>e.filter(n=>Xd(t,n.type)),Qd=(e,t,n,s)=>$o(e,t).map(({name:i})=>i).filter(i=>n.includes(i)?!s:s),En={isRollupOperation:Yd,filterValidColumns:$o,getOperationColumnNames:Qd};const kr=ee.module("Aggregations"),jd=[be.SUM,be.ABS_SUM,be.MIN,be.MAX,be.VAR,be.AVG,be.STD,be.FIRST,be.LAST,be.COUNT_DISTINCT,be.DISTINCT,be.COUNT,be.UNIQUE],Zd=({isRollup:e,settings:t,onChange:n,onEdit:s})=>{const{aggregations:i,showOnTop:o}=t,r=R.exports.useMemo(()=>jd.filter(k=>!i.some(H=>H.operation===k)),[i]),[l,a]=R.exports.useState(r[0]),[c,d]=R.exports.useState([]),h=R.exports.useCallback(k=>{n({...t,...k})},[n,t]),m=R.exports.useCallback(k=>{h({aggregations:k})},[h]),p=R.exports.useCallback(k=>{h({showOnTop:k})},[h]),g=R.exports.useCallback(()=>{kr.debug("handleDragStart"),ot.startDragging()},[]),f=R.exports.useCallback(({destination:k,source:H})=>{if(kr.debug("handleDragEnd",k,H),ot.stopDragging(),k===null)return;let A=k.index;H.index<k.index&&(A+=1);const N=[...i],B=ot.reorder(N,c,N,A),U=ot.adjustDestinationIndex(A,c),L=[[U,U+B.length-1]];m(N),d(L)},[m,i,c,d]),b=R.exports.useCallback(k=>{a(k)},[a]),C=R.exports.useCallback(()=>{m([...i,{operation:l,selected:[],invert:!0}])},[i,l,m]),w=R.exports.useCallback(k=>{m(i.filter((H,A)=>A!==k))},[i,m]),T=R.exports.useCallback(k=>{d(k)},[d]),y=R.exports.useCallback(k=>{const H=i[k];En.isRollupOperation(H.operation)||s(H)},[i,s]),S=R.exports.useCallback(k=>{p(k.target.value==="true")},[p]);R.exports.useEffect(function(){r.length>0&&!r.includes(l)&&a(r[0])},[r,l]);const E=R.exports.useCallback(({item:k,itemIndex:H,isClone:A,selectedCount:N})=>{const B=k.operation,U=A?`${N}`:void 0,L=A?"item-list-item-clone":void 0,_=En.isRollupOperation(k.operation),$=!A&&!_;return v(Ie,{children:[v("div",{className:W("item-list-item-content","draggable-item-list-item-content",L),children:[v("span",{className:"title",children:[B,!e&&_&&v("span",{className:"small text-warning",children:[u(G,{icon:od})," Requires rollup"]})]}),ut.renderBadge({text:U}),ut.renderHandle()]}),!A&&v(Ie,{children:[u(Re,{kind:"ghost",className:"btn-edit",icon:gl,tooltip:"Edit Columns",onClick:()=>s(k),disabled:!$}),u(Re,{kind:"ghost",className:"btn-delete",icon:Mn,tooltip:"Delete Aggregation",onClick:()=>w(H)})]})]})},[w,s,e]),I=r.length>0,D=i.length>0;return v("div",{className:"aggregations",children:[I&&v("div",{className:"form-inline",children:[u(yd,{onChange:b,value:l,children:r.map(k=>u(Rd,{value:k,children:k},k))}),v("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[u(G,{icon:gs}),"Add Aggregation"]})]}),I&&D&&u("hr",{}),D&&v(Ie,{children:[!e&&v("div",{className:"form-inline",children:[u("label",{children:"Placement:\xA0"}),v(Bo,{onChange:S,value:`${o}`,children:[u(an,{value:"true",children:"Top"}),u(an,{value:"false",children:"Bottom"})]})]}),u(_s,{onDragStart:g,onDragEnd:f,children:u(ut,{className:"selected-aggregations",itemCount:i.length,items:i,renderItem:E,offset:0,onSelectionChange:T,onSelect:y,selectedRanges:c,isMultiSelect:!0})})]})]})};const Jd=30,eh=({aggregation:e,columns:t,onChange:n})=>{const[s,i]=R.exports.useState(-1),[o,r]=R.exports.useState(-1),[l,a]=R.exports.useState(0),{invert:c,selected:d}=e,h=R.exports.useRef(null),m=R.exports.useCallback(S=>d.includes(S)?!c:c,[c,d]),p=R.exports.useMemo(()=>{let S=$o(t,e.operation);return l!==0&&(S=F.sortColumns(S,l===1)),S},[t,e.operation,l]),g=R.exports.useMemo(()=>s>=0?p.slice(s,o+1).map(S=>({value:S.name,displayValue:S.name,isSelected:m(S.name)})):[],[p,m,o,s]),f=R.exports.useCallback(S=>{const{name:E}=p[S],I=d.indexOf(E);let D=[...d],k=c;I>=0?D.splice(I,1):(D.push(E),D.length===p.length&&(D=[],k=!c)),n({...e,selected:D,invert:k})},[e,c,p,d,n]),b=R.exports.useCallback(()=>{a(0),n({...e,selected:[],invert:!0})},[e,n]),C=R.exports.useCallback((S,E)=>{i(S),r(E)},[i,r]),w=R.exports.useCallback(()=>{d.length===0?n({...e,invert:!c}):n({...e,selected:[],invert:!0})},[e,c,n,d]),T=d.length===0?c:null,y=d.length!==0||!c||l!==0;return v("div",{role:"menu",className:"aggregation-edit",children:[u("div",{className:"top-menu",children:v("div",{className:"form-inline",children:[u(St,{checked:T,onChange:w,children:"Toggle All"}),u("div",{className:"spacer"}),u(tt,{in:y,timeout:bt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u(Re,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),u(Re,{kind:"ghost",className:W({active:l===1}),icon:Oo,tooltip:"Sort ascending",onClick:()=>a(1)}),u(Re,{kind:"ghost",className:W({active:l===2}),icon:ko,tooltip:"Sort descending",onClick:()=>a(2)})]})}),u("div",{className:"aggregation-edit-item-list",children:u($t,{itemCount:p.length,items:g,offset:s,renderItem:({item:S})=>u(St,{checked:m(S.value),children:S.displayValue}),onSelect:f,onViewportChange:C,rowHeight:Jd,focusSelector:"input",ref:h})})]})};function th(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})})}function nh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})})}function sh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),u("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),u("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})})}function ih(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),u("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})})}function oh(e){return u("svg",{width:48,height:48,xmlns:"http://www.w3.org/2000/svg",...e,children:v("g",{fill:"none",fillRule:"evenodd",children:[u("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),u("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),u("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),u("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})})}function rh(e){return v("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),u("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),u("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]})}function lh(e){return v("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u("rect",{width:"48",height:"48",fill:"none"}),u("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),u("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),u("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]})}const Ar=ee.module("ChartBuilder"),Ge=class extends R.exports.PureComponent{static getTypeName(e){switch(e){case P.plot.SeriesPlotStyle.LINE:return"Line";case P.plot.SeriesPlotStyle.BAR:return"Bar";case P.plot.SeriesPlotStyle.SCATTER:return"Scatter";case P.plot.SeriesPlotStyle.PIE:return"Pie";case P.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}static getTypeIcon(e){switch(e){case P.plot.SeriesPlotStyle.LINE:return u(sh,{});case P.plot.SeriesPlotStyle.BAR:return u(th,{});case P.plot.SeriesPlotStyle.SCATTER:return u(oh,{});case P.plot.SeriesPlotStyle.PIE:return u(ih,{});case P.plot.SeriesPlotStyle.HISTOGRAM:return u(nh,{});default:return null}}static getMaxSeriesCount(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return 1;case P.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static getXAxisLabel(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return"Labels";case P.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}static getSeriesLabel(e){switch(e){case P.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}static makeSeriesItem(e){return{id:zt.generate(),value:e}}static makeDefaultSeriesItems(e,t){if(Ge.getMaxSeriesCount(e)===0||t==null||t.length===0)return[];const s=t.length>1?t[1].name:t[0].name;return[Ge.makeSeriesItem(s)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);const{model:t}=e,{columns:n}=t,s=Ge.types[0],i=Ge.getDefaultXAxis(s,n),o=Ge.makeDefaultSeriesItems(s,n);this.state={type:s,seriesItems:o,xAxis:i,isLinked:!0}}handleAddSeries(){this.setState(e=>{let{seriesItems:t}=e;t=[...t];const{model:n}=this.props,{columns:s}=n;return t.push({id:zt.generate(),value:s[0].name}),{seriesItems:t}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){const{model:e}=this.props,{columns:t}=e,n=Ge.types[0],s=Ge.getDefaultXAxis(n,t),i=Ge.makeDefaultSeriesItems(n,t),o=!0;this.setState({type:n,seriesItems:i,xAxis:s,isLinked:o},this.sendChange)}handleSeriesChange(e){const{value:t}=e.target,n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o[s].value=t,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10);this.setState(i=>{let{seriesItems:o}=i;return o=[...o],o.splice(s,1),{seriesItems:o}},this.sendChange)}handleSubmit(e){e.preventDefault();const{onSubmit:t}=this.props,{type:n,seriesItems:s,xAxis:i,isLinked:o}=this.state,r=s.map(l=>l.value);t({type:`${n}`,series:r,xAxis:i,isLinked:o})}handleTypeClick(e){const n=e.target.getAttribute("data-index"),s=parseInt(n,10),i=Ge.types[s];Ar.debug2("handleTypeSelect",i),this.setState(o=>{const r=Ge.getMaxSeriesCount(i);let{seriesItems:l}=o;if(l=l.slice(0,r),l.length===0&&r>0){const{model:a}=this.props,{columns:c}=a;l=Ge.makeDefaultSeriesItems(i,c)}return{type:i,seriesItems:l}},this.sendChange)}handleXAxisChange(e){const t=e.target.value;Ar.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){const{onChange:e}=this.props,{isLinked:t,type:n,seriesItems:s,xAxis:i}=this.state,o=s.map(r=>r.value);e({type:n,series:o,xAxis:i,isLinked:t})}render(){const{model:e}=this.props,{columns:t}=e,{seriesItems:n,type:s,xAxis:i,isLinked:o}=this.state,r=Ge.getMaxSeriesCount(s),l=Ge.getXAxisLabel(s),a=Ge.getSeriesLabel(s),c=n.length>0,d=n.length<r;return u("div",{className:"chart-builder",children:v("form",{onSubmit:this.handleSubmit,children:[v("div",{className:"form-row",children:[u("label",{children:"Select Chart Type"}),u("div",{className:"form-row",children:Ge.types.map((h,m)=>{const p=h;return u("div",{className:"col col-chart-type",children:v("button",{type:"button",className:W("btn","btn-icon","btn-chart-type",{active:h===s}),"data-index":m,onClick:this.handleTypeClick,children:[Ge.getTypeIcon(h),Ge.getTypeName(h)]})},p)})})]}),u("hr",{}),v("div",{className:"form-row form-inline",children:[u("label",{className:"col-2 label-left",children:l}),u("select",{className:"form-control custom-select select-x-axis col",value:i,onChange:this.handleXAxisChange,children:t.map(h=>u("option",{value:h.name,children:h.name},h.name))})]}),c&&u("hr",{}),n.map((h,m)=>v("div",{className:"form-row form-inline form-series-item","data-testid":`form-series-item-${m}`,children:[u("label",{className:"col-2 label-left",children:m===0?a:""}),u("select",{className:"form-control custom-select select-series col",value:h.value,onChange:this.handleSeriesChange,"data-testid":`select-series-item-${m}`,"data-index":m,children:t.map(p=>u("option",{value:p.name,"data-index":m,children:p.name},p.name))}),n.length>1&&u("button",{type:"button",className:"btn btn-link btn-link-icon btn-delete-series ml-2 px-2","data-index":m,"data-testid":`delete-series-${m}`,onClick:this.handleSeriesDeleteClick,children:u(G,{icon:Mn})})]},h.id)),d&&v("div",{className:"form-row",children:[u("div",{className:"col-2"}),v("button",{type:"button",className:"btn btn-link btn-add-series mt-1",onClick:this.handleAddSeries,children:[u(G,{icon:gs}),"Add Series"]})]}),v("div",{className:"form-row chart-builder-link",children:[u("label",{className:"col-2 label-right",children:v("div",{className:"fa-md fa-layers",children:[u(G,{mask:Lo,icon:Fo,transform:"right-5 down-5"}),u(G,{icon:o?Cl:id,transform:"grow-2 right-8 down-6"})]})}),v(Bo,{onChange:this.handleLinkStateChange,value:`${o}`,children:[u(an,{value:"true",children:"Sync State"}),u(an,{value:"false",children:"Freeze State"})]})]}),v("div",{className:"form-row",children:[u("div",{className:"col-2 label-right"}),u("div",{className:"col chart-builder-link-info",children:o?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),v("div",{className:W("form-row","justify-content-end","my-3"),children:[u("button",{type:"button",className:"btn btn-outline-primary btn-reset",onClick:this.handleReset,children:"Reset"}),u("button",{type:"submit",className:"btn btn-primary btn-submit",children:"Create"})]})]})})}};let Wl=Ge;Wl.types=[P.plot.SeriesPlotStyle.LINE,P.plot.SeriesPlotStyle.BAR,P.plot.SeriesPlotStyle.SCATTER,P.plot.SeriesPlotStyle.PIE];class zl extends R.exports.Component{constructor(t){super(t),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var i;const{value:t,editorSettings:n}=this.props,s={copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0,...n};if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=ln.create(this.editorContainer,s),this.editor.layout(),(i=this.editor.getModel())==null||i.updateOptions({tabSize:0}),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var t;(t=this.editor)==null||t.dispose(),this.editor=void 0}handleContentChanged(){var s,i;const{onContentChanged:t}=this.props,n=(i=(s=this.editor)==null?void 0:s.getModel())==null?void 0:i.getValue();n&&this.setState({isEditorEmpty:n.length===0}),t(n)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var n,s;const t=(s=(n=this.editor)==null?void 0:n.getModel())==null?void 0:s.getValue();if(!t)throw new Error("value is undefined");this.setState({isEditorEmpty:t.length===0,isEditorFocused:!1})}handleContainerClick(){var n;const{isEditorFocused:t}=this.state;t||(n=this.editor)==null||n.focus()}handleKeyDown(t){const{onTab:n,editorIndex:s}=this.props;t.key==="Tab"&&n(s,t.shiftKey)}render(){const{value:t,invalid:n}=this.props,{isEditorFocused:s,isEditorEmpty:i}=this.state;return v("div",{className:W("input-editor-wrapper",{focused:s,invalid:n}),onKeyDown:this.handleKeyDown,role:"presentation",onClick:this.handleContainerClick,children:[u("div",{className:"editor-container",ref:o=>{this.editorContainer=o}}),i&&!t&&u("div",{className:"editor-placeholder text-muted",children:"Column Formula"})]})}}zl.defaultProps={value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1};const vo=class extends R.exports.PureComponent{constructor(e){super(e),this.handleFormulaEditorContentChanged=this.handleFormulaEditorContentChanged.bind(this)}handleFormulaEditorContentChanged(e){const{onChange:t,eventKey:n}=this.props;e&&(e.replace(/(\r\n|\n|\r)/gm,""),t(n,vo.INPUT_TYPE.FORMULA,e))}render(){const{eventKey:e,name:t,formula:n,onChange:s,onDeleteColumn:i,inputIndex:o,onTabInEditor:r,invalid:l}=this.props;return u(Fi,{draggableId:e,index:o,disableInteractiveElementBlocking:!0,children:(a,c)=>v("div",{className:W("draggable-container",{dragging:c.isDragging}),ref:a.innerRef,...a.draggableProps,children:[v("div",{className:"custom-column-input-container",children:[v("div",{className:"d-flex flex-row pb-3 custom-column-name",children:[u("input",{className:W("form-control custom-column-input",{"is-invalid":l}),placeholder:"Column Name",value:t,onChange:d=>{s(e,vo.INPUT_TYPE.NAME,d.target.value)}}),v("button",{type:"button",className:"btn btn-link btn-link-icon ml-1 px-2",onClick:()=>{i(e)},children:[u(he,{children:"Delete custom column"}),u(G,{icon:Mn})]}),v("button",{type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",...a.dragHandleProps,children:[u(he,{children:"Drag column to re-order"}),u(G,{icon:ki})]})]}),u(zl,{editorSettings:{language:"deephavenDb"},editorIndex:o,value:n,onContentChanged:this.handleFormulaEditorContentChanged,onTab:r,invalid:l})]}),u("hr",{})]})})}};let Go=vo;Go.INPUT_TYPE={NAME:"name",FORMULA:"formula"};Go.defaultProps={name:"",inputIndex:0,formula:"",onChange:()=>{},onDeleteColumn:()=>{},onTabInEditor:()=>{},invalid:!1};class $l extends Error{constructor(){super(...arguments),this.isAssertionFailed=!0}}function Lr(e){if(e==null)throw new $l(`Expected 'val' to be defined, but received ${e}`)}class io extends Error{constructor(){super(...arguments),this.isPasteError=!0}}function Fe(e){return(e==null?void 0:e.isEditable)!==void 0}function Hr(e){if(!Fe(e))throw new $l(`Expected 'model' to be editable, but received ${e}`)}function qe(e){return(e==null?void 0:e.hasExpandableRows)!==void 0}var Dt=(e=>(e.DOWN="DOWN",e.UP="UP",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Dt||{});const ce=class{static normalize(e,t,n,s){let i=e,o=t,r=n,l=s;return i!=null&&r!=null&&r<i&&(i=r,r=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[i,o,r,l]}static makeNormalized(e,t,n,s){return new ce(...ce.normalize(e,t,n,s))}static makeCell(e,t){return new ce(e,t,e,t)}static makeColumn(e){return new ce(e,null,e,null)}static makeRow(e){return new ce(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){const t=e.slice();let n=!0;for(;n;){n=!1;for(let s=0;s<t.length&&!n;s+=1){const i=t[s];for(let o=t.length-1;o>s;o-=1){const r=t[o];if(i.contains(r))t.splice(o,1);else if(r.contains(i)){n=!0,t[s]=r,t.splice(o,1);break}else if(i.startRow===r.startRow&&i.endRow===r.endRow){if(i.touches(r)){const{startRow:l,endRow:a}=i,c=ce.minOrNull(i.startColumn,r.startColumn),d=ce.maxOrNull(i.endColumn,r.endColumn);n=!0,t[s]=new ce(c,l,d,a),t.splice(o,1);break}}else if(i.startColumn===r.startColumn&&i.endColumn===r.endColumn&&i.touches(r)){const{startColumn:l,endColumn:a}=i,c=ce.minOrNull(i.startRow,r.startRow),d=ce.maxOrNull(i.endRow,r.endRow);n=!0,t[s]=new ce(l,c,a,d),t.splice(o,1);break}}}}return t}static isAxisRangeTouching(e,t,n,s){return e==null?t==null||n==null?!0:n<=t+1:t==null?s==null?!0:s>=e-1:n==null?s==null?!0:e<=s+1:s==null?t>=n-1:n>=e-1?n<=t+1:s>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!e[n].equals(t[n]))return!1;return!0}static intersection(e,t){if(e.equals(t))return e;let{startColumn:n,startRow:s,endColumn:i,endRow:o}=e;return n=n!=null&&t.startColumn!=null?Math.max(n,t.startColumn):n!=null?n:t.startColumn,i=i!=null&&t.endColumn!=null?Math.min(i,t.endColumn):i!=null?i:t.endColumn,s=s!=null&&t.startRow!=null?Math.max(s,t.startRow):s!=null?s:t.startRow,o=o!=null&&t.endRow!=null?Math.min(o,t.endRow):o!=null?o:t.endRow,n!=null&&n>(i!=null?i:-1)||s!=null&&s>(o!=null?o:-1)?null:new ce(n,s,i,o)}static subtractFromRange(e,t){const n=[],s=ce.intersection(e,t);return s==null?[e]:(s.startRow!=null&&(e.startRow==null||e.startRow<s.startRow)&&n.push(new ce(e.startColumn,e.startRow,e.endColumn,s.startRow-1)),s.startColumn!=null&&(e.startColumn==null||e.startColumn<s.startColumn)&&n.push(new ce(e.startColumn,s.startRow,s.startColumn-1,s.endRow)),s.endColumn!=null&&(e.endColumn==null||e.endColumn>s.endColumn)&&n.push(new ce(s.endColumn+1,s.startRow,e.endColumn,s.endRow)),s.endRow!=null&&(e.endRow==null||e.endRow>s.endRow)&&n.push(new ce(e.startColumn,s.endRow+1,e.endColumn,e.endRow)),n)}static subtractFromRanges(e,t){const n=[];for(let s=0;s<e.length;s+=1)n.push(...ce.subtractFromRange(e[s],t));return n}static subtractRangesFromRanges(e,t){if(!t||t.length===0)return e;let n=[...e];for(let s=0;s<t.length;s+=1)n=ce.subtractFromRanges(n,t[s]);return n}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,n){var s,i,o,r;return ce.isBounded(e)?e:new ce((s=e.startColumn)!=null?s:0,(i=e.startRow)!=null?i:0,(o=e.endColumn)!=null?o:t-1,(r=e.endRow)!=null?r:n-1)}static boundedRanges(e,t,n){return e.map(s=>ce.boundedRange(s,t,n))}static offset(e,t,n){return new ce(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+n:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+n:null)}static nextCell(e,t=null,n=null,s=ce.SELECTION_DIRECTION.DOWN){if(e.length===0)return null;let i=-1;if(t!=null&&n!=null&&(i=e.findIndex(o=>o.containsCell(t,n)),i>=0)){const r=e[i].nextCell(t,n,s);if(r!=null)return r}switch(s){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:{const o=i<e.length-1?i+1:0;return e[o].startCell(s)}case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:{const o=i>0?i-1:e.length-1;return e[o].startCell(s)}default:throw new Error(`Invalid direction: ${s}`)}}static cellCount(e){return e.reduce((t,n)=>{var s,i,o,r;return t+(((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1)*(((o=n.endColumn)!=null?o:NaN)-((r=n.startColumn)!=null?r:NaN)+1)},0)}static rowCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endRow)!=null?s:NaN)-((i=n.startRow)!=null?i:NaN)+1},0)}static columnCount(e){return e.reduce((t,n)=>{var s,i;return t+((s=n.endColumn)!=null?s:NaN)-((i=n.startColumn)!=null?i:NaN)+1},0)}static containsCell(e,t,n){for(let s=0;s<e.length;s+=1)if(e[s].containsCell(t,n))return!0;return!1}static forEachCell(e,t,n=ce.SELECTION_DIRECTION.RIGHT){for(let s=0;s<e.length;s+=1)e[s].forEach(t,n)}constructor(e,t,n,s){this.startColumn=e,this.startRow=t,this.endColumn=n,this.endRow=s}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return ce.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&ce.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return ce.subtractFromRange(this,e)}startCell(e=ce.SELECTION_DIRECTION.DOWN){if(!ce.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case ce.SELECTION_DIRECTION.DOWN:case ce.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case ce.SELECTION_DIRECTION.LEFT:case ce.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error(`Invalid direction: ${e}`)}}nextCell(e,t,n){if(!ce.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");const{startColumn:s,endColumn:i,startRow:o,endRow:r}=this;switch(n){case ce.SELECTION_DIRECTION.DOWN:if(t<r)return{column:e,row:Math.max(t+1,o)};if(e<i)return{column:Math.max(e+1,s),row:o};break;case ce.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,r)};if(e>s)return{column:Math.min(e-1,i),row:r};break;case ce.SELECTION_DIRECTION.RIGHT:if(e<i)return{column:Math.max(e+1,s),row:t};if(t<r)return{column:s,row:Math.max(t+1,o)};break;case ce.SELECTION_DIRECTION.LEFT:if(e>s)return{column:Math.min(e-1,i),row:t};if(t>o)return{column:i,row:Math.min(t-1,r)};break;default:throw new Error(`Invalid direction: ${n}`)}return null}forEach(e,t=ce.SELECTION_DIRECTION.RIGHT){var o;let n=0,{column:s,row:i}=this.startCell(t);for(;s!=null&&i!=null;)e(s,i,n),n+=1,{column:s,row:i}=(o=this.nextCell(s,i,t))!=null?o:{}}};let X=ce;X.SELECTION_DIRECTION=Dt;function ah(e){return Array.isArray(e)&&e.length===2&&(e[0]===null||typeof e[0]=="number")&&(e[1]===null||typeof e[1]=="number")}function oo(e){return ah(e)&&e[0]!=null&&e[1]!=null}const fe=class{static getGridPointFromXY(e,t,n){const s=fe.getColumnAtX(e,n),i=fe.getRowAtY(t,n),o=fe.getColumnHeaderDepthAtY(t,n);return{x:e,y:t,row:i,column:s,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,n){const{row:s,column:i}=fe.getGridPointFromXY(e,t,n),{visibleColumnWidths:o,visibleRowHeights:r,visibleColumnXs:l,visibleRowYs:a,modelColumns:c,modelRows:d}=n,h=s!==null?d.get(s):null,m=i!==null?c.get(i):null,p=i!==null?l.get(i):null,g=s!==null?a.get(s):null,f=i!==null?o.get(i):null,b=s!==null?r.get(s):null;return{row:s,column:i,modelRow:h!=null?h:null,modelColumn:m!=null?m:null,left:p!=null?p:null,top:g!=null?g:null,columnWidth:f!=null?f:null,rowHeight:b!=null?b:null}}static getColumnHeaderDepthAtY(e,t){const n=fe.getRowAtY(e,t),{columnHeaderHeight:s,columnHeaderMaxDepth:i}=t;if(n===null&&e<=s*i)return nt(i-Math.ceil(e/s),0,i-1)}static iterateFloatingStart(e,t,n){for(let s=0;s<e&&s<t;s+=1){const i=n(s);if(i!==void 0)return i}}static iterateFloatingEnd(e,t,n){for(let s=0;s<e&&t-(e-s)>=0;s+=1){const i=n(t-(e-s));if(i!==void 0)return i}}static iterateFloating(e,t,n,s){const i=fe.iterateFloatingStart(e,n,s);return i!==void 0?i:fe.iterateFloatingEnd(t,n,s)}static iterateAllItems(e,t,n,s,i,o){const r=Math.max(e,n),l=Math.min(t,i-s-1);let a=fe.iterateFloating(n,s,i,o);if(a!==void 0)return a;for(let c=r;c<=l;c+=1)if(a=o(c),a!==void 0)return a}static isInItem(e,t,n,s){var r,l;const i=(r=t.get(e))!=null?r:0,o=(l=n.get(e))!=null?l:0;return i<=s&&s<=i+o}static getItemAtOffset(e,t,n,s,i,o,r,l=!1){const a=l?void 0:fe.iterateFloating(n,s,t,c=>{if(fe.isInItem(c,o,r,e))return c});if(!l&&a!==void 0)return a;for(let c=0;c<i.length;c+=1){const d=i[c];if(fe.isInItem(d,o,r,e))return d}return null}static getColumnAtX(e,t,n=!1){const{columnCount:s,floatingLeftColumnCount:i,floatingRightColumnCount:o,visibleColumns:r,visibleColumnXs:l,visibleColumnWidths:a,gridX:c}=t;return e<c?null:this.getItemAtOffset(e-c,s,i,o,r,l,a,n)}static getRowAtY(e,t){const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i,visibleRows:o,visibleRowYs:r,visibleRowHeights:l,gridY:a}=t;return e<a?null:this.getItemAtOffset(e-a,i,n,s,o,r,l)}static getNextShownItem(e,t,n,s){let i=n.findIndex(o=>o===e)||0;for(i-=1;i!=null&&i>=0;){const o=n[i],r=t.get(o);if(r!=null&&s.get(r)!==0)return o;i-=1}return null}static getNextShownColumn(e,t){const{modelColumns:n,visibleColumns:s,userColumnWidths:i}=t;return fe.getNextShownItem(e,n,s,i)}static getNextShownRow(e,t){const{modelRows:n,visibleRows:s,userRowHeights:i}=t;return fe.getNextShownItem(e,n,s,i)}static getColumnSeparatorIndex(e,t,n,s){var C,w,T,y;const{rowHeaderWidth:i,columnHeaderHeight:o,floatingColumns:r,floatingLeftWidth:l,visibleColumns:a,visibleColumnXs:c,visibleColumnWidths:d,columnHeaderMaxDepth:h}=n,{allowColumnResize:m,headerSeparatorHandleSize:p}=s;if(h*o<t||!m||p<=0)return null;const g=e-i,f=p*.5;let b=!1;for(let S=r.length-1;S>=0;S-=1){const E=r[S],I=(C=c.get(E))!=null?C:0,D=(w=d.get(E))!=null?w:0,k=D===0;if(!b||!k){let H=I+D;k?H+=f:b&&(H-=f);const A=H-f,N=H+f;if(A<=g&&g<=N)return E;b=k}}b=!1;for(let S=a.length-1;S>=0;S-=1){const E=a[S],I=(T=c.get(E))!=null?T:0,D=(y=d.get(E))!=null?y:0,k=D===0;if(I<l-D)return null;if(!b||!k){let H=I+D;k?H+=f:b&&(H-=f);const A=H-f,N=H+f;if(A<=g&&g<=N)return E;b=k}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){const{visibleColumnWidths:n}=t;return fe.isItemHidden(e,n)}static isFloatingRow(e,t){if(e==null)return!1;const{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t;return e<n||e>=i-s}static isFloatingColumn(e,t){if(e==null)return!1;const{floatingLeftColumnCount:n,floatingRightColumnCount:s,columnCount:i}=t;return e<n||e>=i-s}static getHiddenItems(e,t,n){if(!fe.isItemHidden(e,t))return[];const s=[e],i=n.findIndex(o=>o===e);for(let o=i-1;o>=0;o-=1){const r=n[o];if(!fe.isItemHidden(r,t))break;s.push(r)}return s}static getHiddenColumns(e,t){const{visibleColumns:n,visibleColumnWidths:s}=t;return fe.getHiddenItems(e,s,n)}static getRowSeparatorIndex(e,t,n,s){var g,f;const{rowHeaderWidth:i,columnHeaderHeight:o,visibleRows:r,visibleRowYs:l,visibleRowHeights:a}=n,{allowRowResize:c,headerSeparatorHandleSize:d}=s;if(i<e||!c||d<=0)return null;const h=t-o,m=d*.5;let p=!1;for(let b=r.length-1;b>=0;b-=1){const C=r[b],w=(g=l.get(C))!=null?g:0,T=(f=a.get(C))!=null?f:0,y=T===0;if(!p||!y){let S=w+T;y?S+=m:p&&(S-=m);const E=S-m,I=S+m;if(E<=h&&h<=I)return C;p=y}}return null}static isRowHidden(e,t){const{visibleRowHeights:n}=t;return fe.isItemHidden(e,n)}static getHiddenRows(e,t){const{visibleRows:n,visibleRowHeights:s}=t;return fe.getHiddenItems(e,s,n)}static moveItem(e,t,n){if(e===t)return n;const s=[...n],i=s[s.length-1];return i&&!oo(i.from)&&i.to===e?i.from===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s}static moveRange(e,t,n){if(e[0]===t)return n;const s=[...n],i=s[s.length-1];return i&&oo(i.from)&&i.from[1]-i.from[0]===e[1]-e[0]&&i.to===e[0]?i.from[0]===t?s.pop():s[s.length-1]={...i,to:t}:s.push({from:e,to:t}),s[s.length-1].from===s[s.length-1].to&&s.pop(),s}static applyItemMoves(e,t,n,s=!1){var o,r;let i=[[e,t]];for(let l=s?n.length-1:0;s?l>=0:l<n.length;s?l-=1:l+=1){const{from:a,to:c}=n[l];let d=1,h;oo(a)?(d=a[1]-a[0]+1,[h]=a):h=a;const m=s?c:h,p=m+d-1,g=s?h:c,f=g-m,b=[];for(let C=0;C<i.length;C+=1){const w=(o=i[C][0])!=null?o:Number.NEGATIVE_INFINITY,T=(r=i[C][1])!=null?r:Number.POSITIVE_INFINITY;let y;const S=[[w,m-1],[m,p],[p+1,T]].map(([E,I])=>[Math.max(E,w),Math.min(I,T)]).filter(([E,I])=>E<=I).map(E=>{const[I,D]=E;return m<=I&&p>=D?(y=[I+f,D+f],y):p<I?[I-d,D-d]:E}).map(E=>{const[I,D]=E;return g>I&&g<=D?[[I,g-1],[g+d,D+d]]:E===y?[E]:g<=I?[[I+d,D+d]]:[E]}).flat();b.push(...S)}i=b.map(([C,w])=>[Number.isFinite(C)?C:null,Number.isFinite(w)?w:null])}return i}static translateRange(e,t,n,s){const i=fe.applyItemMoves(e.startColumn,e.endColumn,t,s),o=fe.applyItemMoves(e.startRow,e.endRow,n,s),r=[];for(let l=0;l<i.length;l+=1){const a=i[l];for(let c=0;c<o.length;c+=1){const d=o[c];r.push(new X(a[0],d[0],a[1],d[1]))}}return r}static getModelIndex(e,t){return fe.applyItemMoves(e,e,t,!0)[0][0]}static getModelIndexes(e,t){return e.map(n=>fe.getModelIndex(n,t))}static getModelRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!0)}static getModelRange(e,t=[],n=[]){return fe.translateRange(e,t,n,!0)}static getModelRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getModelRange(e[i],t,n));return s}static getVisibleRangeIndexes(e,t,n){return fe.applyItemMoves(e,t,n,!1)}static getVisibleRange(e,t=[],n=[]){return this.translateRange(e,t,n,!1)}static getVisibleRanges(e,t=[],n=[]){const s=[];for(let i=0;i<e.length;i+=1)s.push(...fe.getVisibleRange(e[i],t,n));return s}static getVisibleIndex(e,t){return fe.applyItemMoves(e,e,t)[0][0]}static getVisibleIndexes(e,t){return e.map(n=>fe.getVisibleIndex(n,t))}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return fe.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){const t=fe.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(n=>t.get(n)===0)}static getScrollDragBounds(e,t,n){const{gridX:s,gridY:i,width:o,height:r,floatingTopRowCount:l,floatingBottomRowCount:a,floatingLeftColumnCount:c,floatingRightColumnCount:d,floatingLeftWidth:h,floatingRightWidth:m,floatingTopHeight:p,floatingBottomHeight:g,columnCount:f,rowCount:b}=e;let C=s,w=i,T=o,y=r;return n!=null&&(n>c&&(C+=h),n<f-d&&(T-=m)),t!=null&&(t>l&&(w+=p),t<b-a&&(y-=g)),{x1:C,y1:w,x2:T,y2:y}}static getScrollDelta(e,t=1024,n=768,s=20,i=20){let{deltaX:o,deltaY:r}=e;return!fe.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,r=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,r*=n):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(fe.isMacPlatform()?(o=Math.round(o*s),r=Math.round(r*i)):(o=Math.round(o*this.PIXELS_PER_LINE),r=Math.round(r*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:r}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],i=s[0],o=s[1];n===0?t.push([i,o]):i-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([i,o])}return t}};let V=fe;V.PIXELS_PER_LINE=100/3;function x(e,t,n=void 0){var i;const s=(i=e.get(t))!=null?i:n;if(s!==void 0)return s;throw new Error(`Missing value for key ${t}`)}function li(e,t=Vs.CACHE_SIZE,n=Math.floor(t/2)){if(e.size>t){const s=e.keys();for(;e.size>n;)e.delete(s.next().value)}}function Pr(e,t,n,s,i){const o=new Map;let r=0;for(let l=0;l<e&&l<n;l+=1)o.set(l,r),r+=x(i,l);r=s;for(let l=0;l<t&&n-l-1>=0;l+=1)r-=x(i,n-l-1),o.set(n-l-1,r);return o}const Gl=class{constructor({userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:n=new Map,calculatedRowHeights:s=new Map,fontWidths:i=new Map,modelRows:o=new Map,modelColumns:r=new Map,movedRows:l=[],movedColumns:a=[]}={}){this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=s,this.calculatedColumnWidths=n,this.fontWidths=i,this.modelRows=o,this.modelColumns=r,this.movedRows=l,this.movedColumns=a}getMetrics(e){const{left:t,top:n,leftOffset:s,topOffset:i,width:o,height:r,theme:l,model:a,movedRows:c,movedColumns:d,draggingColumn:h}=e,{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,columnWidth:f,columnHeaderHeight:b,minScrollHandleSize:C,scrollBarSize:w}=l;c!==this.movedRows&&(this.movedRows=c,this.modelRows.clear()),d!==this.movedColumns&&(this.movedColumns=d,this.modelColumns.clear());const{columnCount:T,rowCount:y,floatingTopRowCount:S,floatingBottomRowCount:E,floatingLeftColumnCount:I,floatingRightColumnCount:D,columnHeaderMaxDepth:k}=a,H=this.getFirstRow(e),A=this.getFirstColumn(e),N=this.getGridX(e),B=this.getGridY(e),U=qe(a)&&a.hasExpandableRows?this.calculateTreePaddingX(e):0,L=0;let _=this.getVisibleRowHeights(e),$=this.getVisibleColumnWidths(e,A,U);const K=Array.from(_.keys()),j=Array.from($.keys());_=new Map([..._,...this.getFloatingRowHeights(e)]),$=new Map([...$,...this.getFloatingColumnWidths(e)]);let oe=this.getVisibleColumnXs($,j,s),te=this.getVisibleRowYs(_,K,i);const me=K.length>0?K[K.length-1]:n,ae=j.length>0?j[j.length-1]:t,Me=this.getBottomViewport(e,K,te,_),Ke=this.getRightViewport(e,j,oe,$),We=this.getFloatingTopHeight(e,_),He=this.getFloatingBottomHeight(e,_),_e=this.getFloatingLeftWidth(e,$),Qe=this.getFloatingRightWidth(e,$),ke=Array.from($.values()),xt=Array.from(_.values()),Fn=ke.reduce((Ue,is)=>Ue+is,0)-s,qt=xt.reduce((Ue,is)=>Ue+is,0)-i,Ze=this.getLastLeft(e,null,o-N-w-g),ue=this.getLastTop(e,null,r-B-w-He),ze=s+Fn+g,Ve=i+qt,rt=o-N,vt=r-B,Tt=Ze>0||ze>rt,lt=Tt?w:0,xn=ue>0||Ve>vt-lt,Et=xn?w:0,Rt=o-p-Et,On=r-b-lt,zi=p,$i=b,Gi=T===1?Rt/ze:(T-Ze)/T,$s=y===1?On/Ve:(y-ue)/y,Gs=Tt?nt(Rt*Gi,C,Rt-1):0,qs=xn?nt(On*$s,C,On-1):0,Ks=x($,t,0),Ys=x(_,n,0),Xs=Ks>0?s/Ks:0,Qs=Ys>0?i/Ys:0,qi=T===1?s/(ze-rt):(t+Xs)/Ze,Ki=y===1?i/(Ve-vt):(n+Qs)/ue,kn=Tt?qi*(Rt-Gs):0,Yi=xn?Ki*(On-qs):0;let ss=[];(S>0||E>0)&&(ss=[...Array(S).keys(),...[...Array(E).keys()].map(Ue=>y-Ue-1)],te=new Map([...te,...this.getFloatingRowYs(e,_,Math.floor(r-B-lt))]));let vs=[];(I>0||D>0)&&(vs=[...Array(I).keys(),...[...Array(D).keys()].map(Ue=>T-Ue-1)],oe=new Map([...oe,...this.getFloatingColumnXs(e,$,Math.floor(o-N-Et))]));const js=[];if(h)for(let Ue=h.range[0];Ue<=h.range[1];Ue+=1)js.push(Ue),$.has(Ue)||$.set(Ue,this.getVisibleColumnWidth(Ue,e)),oe.has(Ue)||oe.set(Ue,0);const Zs=K.concat(ss),Ts=j.concat(vs).concat(js),Es=this.getModelRows(Zs,e),Xi=this.getModelColumns(Ts,e),Qi=this.getVisibleRowTreeBoxes(_,Es,e),Js=this.getTopVisible(e,te,_,K),ji=this.getLeftVisible(e,oe,$,j),ei=ue>0?this.getBottomVisible(e,te,_,K,B):me,ti=Ze>0?this.getRightVisible(e,oe,$,j,N):ae,{fontWidths:ni,userColumnWidths:si,userRowHeights:ii,calculatedRowHeights:Zi,calculatedColumnWidths:Ji}=this;return{rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,rowCount:y,columnWidth:f,columnCount:T,columnHeaderHeight:b,floatingTopRowCount:S,floatingBottomRowCount:E,floatingLeftColumnCount:I,floatingRightColumnCount:D,gridX:N,gridY:B,firstRow:H,firstColumn:A,treePaddingX:U,treePaddingY:L,left:t,top:n,bottom:me,right:ae,topOffset:i,leftOffset:s,topVisible:Js,leftVisible:ji,bottomVisible:ei,rightVisible:ti,bottomViewport:Me,rightViewport:Ke,width:o,height:r,maxX:Fn,maxY:qt,lastLeft:Ze,lastTop:ue,barHeight:On,barTop:$i,barWidth:Rt,barLeft:zi,handleHeight:qs,handleWidth:Gs,hasHorizontalBar:Tt,hasVerticalBar:xn,verticalBarWidth:Et,horizontalBarHeight:lt,scrollX:kn,scrollY:Yi,scrollableContentWidth:ze,scrollableContentHeight:Ve,scrollableViewportWidth:rt,scrollableViewportHeight:vt,visibleRows:K,visibleColumns:j,floatingRows:ss,floatingColumns:vs,allRows:Zs,allColumns:Ts,visibleRowHeights:_,visibleColumnWidths:$,floatingTopHeight:We,floatingBottomHeight:He,floatingLeftWidth:_e,floatingRightWidth:Qe,visibleRowYs:te,visibleColumnXs:oe,visibleRowTreeBoxes:Qi,modelRows:Es,modelColumns:Xi,movedRows:c,movedColumns:d,fontWidths:ni,userColumnWidths:si,userRowHeights:ii,calculatedRowHeights:Zi,calculatedColumnWidths:Ji,columnHeaderMaxDepth:k}}getGridX(e){const{theme:t}=e,{rowHeaderWidth:n}=t;return n}getGridY(e){const{theme:t,model:n}=e,{columnHeaderHeight:s}=t,{columnHeaderMaxDepth:i}=n;return i*s}getVisibleHeight(e,t=this.getFloatingRowHeights(e)){const{height:n,theme:s}=e,{scrollBarSize:i}=s,o=this.getGridY(e),r=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return n-r-l-o-i}getVisibleWidth(e,t=this.getFloatingColumnWidths(e)){const{width:n,theme:s}=e,{scrollBarSize:i,rowFooterWidth:o}=s,r=this.getGridX(e),l=this.getFloatingRightWidth(e,t),a=this.getFloatingLeftWidth(e,t);return n-a-l-r-i-o}getFirstIndex(e,t,n){const s=e.size+1;for(let i=0;i<s;i+=1){const o=t(i,n);if(e.get(o)!==0)return i}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t=null,n=this.getVisibleWidth(e)){const{model:s}=e,{columnCount:i}=s;let o=i-1;t!=null&&(o=t);let r=0;for(;o>=0;){if(r+=this.getVisibleColumnWidth(o,e),r>=n)return Math.min(o+1,i-1);o-=1}return 0}getLastTop(e,t=null,n=this.getVisibleHeight(e)){const{model:s}=e,{rowCount:i,floatingBottomRowCount:o}=s;let r=Math.max(0,i-o-1);t!=null&&(r=t);let l=0;for(;r>0;){if(l+=this.getVisibleRowHeight(r,e),l>=n)return Math.min(r+1,i-1);r-=1}return 0}getTopForTopVisible(e,t){const n=this.getFloatingTopHeight(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleRowHeight(s,e);return s}getTopForBottomVisible(e,t){const{height:n}=e,s=this.getGridY(e),i=this.getFloatingBottomHeight(e),o=n-s-i;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){const n=this.getFloatingLeftWidth(e);let s=t,i=0;for(;s>0&&i<n;)s-=1,i+=this.getVisibleColumnWidth(s,e);return s}getLeftForRightVisible(e,t){const{width:n}=e,s=this.getGridX(e),i=this.getFloatingRightWidth(e),o=n-s-i;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){const{model:t}=e,{floatingTopRowCount:n,floatingBottomRowCount:s,rowCount:i}=t,o=new Map;for(let r=0;r<n&&r<i;r+=1)o.set(r,this.getVisibleRowHeight(r,e));for(let r=0;r<s&&i-r-1>=0;r+=1){const l=i-r-1;o.set(l,this.getVisibleRowHeight(l,e))}return o}getVisibleRowHeights(e){const{top:t,topOffset:n,height:s,model:i}=e;let o=0,r=t;const l=new Map,{rowCount:a}=i;for(;o<s+n&&r<a;){const c=this.getVisibleRowHeight(r,e);l.set(r,c),o+=c,r+=1}return l}getFloatingColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s,l=new Map;for(let a=0;a<o&&a<i;a+=1)l.set(a,this.getVisibleColumnWidth(a,e,t,n));for(let a=0;a<r&&i-a-1>=0;a+=1){const c=i-a-1;l.set(c,this.getVisibleColumnWidth(c,e,t,n))}return l}getVisibleColumnWidths(e,t=this.getFirstColumn(e),n=this.calculateTreePaddingX(e)){const{left:s,leftOffset:i,width:o,model:r}=e;let l=0,a=s;const c=new Map,{columnCount:d}=r;for(;l<o+i&&a<d;){const h=this.getVisibleColumnWidth(a,e,t,n);c.set(a,h),l+=h,a+=1}return c}getFloatingColumnXs(e,t,n){const{model:s}=e,{columnCount:i,floatingLeftColumnCount:o,floatingRightColumnCount:r}=s;return Pr(o,r,i,n,t)}getVisibleColumnXs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=x(e,r);s.set(r,i),i+=l}return s}getFloatingRowYs(e,t,n){const{model:s}=e,{floatingTopRowCount:i,floatingBottomRowCount:o,rowCount:r}=s;return Pr(i,o,r,n,t)}getVisibleRowYs(e,t,n){const s=new Map;let i=-n;for(let o=0;o<t.length;o+=1){const r=t[o],l=x(e,r);s.set(r,i),i+=l}return s}getVisibleRowTreeBoxes(e,t,n){const s=new Map,{model:i,theme:o}=n,{treeDepthIndent:r,treeHorizontalPadding:l}=o;return qe(i)&&i.hasExpandableRows&&e.forEach((a,c)=>{const d=x(t,c);if(i.isRowExpandable(d)){const h=i.depthForRow(d),m=h*r+l,p=(h+1)*r+l,g=0,f=a;s.set(c,{x1:m,y1:g,x2:p,y2:f})}}),s}getFloatingLeftWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingLeftColumnCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=x(t,o);return i}getFloatingRightWidth(e,t=this.getFloatingColumnWidths(e)){const{model:n}=e,{floatingRightColumnCount:s,columnCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=x(t,i-r-1);return o}getFloatingTopHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingTopRowCount:s}=n;let i=0;for(let o=0;o<s;o+=1)i+=x(t,o);return i}getFloatingBottomHeight(e,t=this.getFloatingRowHeights(e)){const{model:n}=e,{floatingBottomRowCount:s,rowCount:i}=n;let o=0;for(let r=0;r<s;r+=1)o+=x(t,i-r-1);return o}getTopVisible(e,t,n,s){const i=this.getFloatingTopHeight(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(x(t,r)>=i)return r}return 0}getLeftVisible(e,t,n,s){const i=this.getFloatingLeftWidth(e,n);for(let o=0;o<s.length;o+=1){const r=s[o];if(x(t,r)>=i)return r}return 0}getBottomVisible(e,t,n,s,i){const{height:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingBottomHeight(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=x(t,h),p=x(n,h);if(m+p<=c)return h}return 0}getRightVisible(e,t,n,s,i){const{width:o,theme:r}=e,{scrollBarSize:l}=r,a=this.getFloatingRightWidth(e,n),c=o-i-l-a;for(let d=s.length-1;d>=0;d-=1){const h=s[d],m=x(t,h),p=x(n,h);if(m+p<=c)return h}return 0}getBottomViewport(e,t,n,s){const{height:i,theme:o}=e,{rowHeight:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getRightViewport(e,t,n,s){const{width:i,theme:o}=e,{columnWidth:r}=o;return this.getLastIndexViewport(t,n,s,i,r)}getLastIndexViewport(e,t,n,s,i){let o=0,r=0;return e.length>0&&(o=e[e.length-1],r=x(t,o)+x(n,o)),r<s&&(o+=Math.ceil((s-r)/i)),o}getVisibleItemSize(e,t,n){var i;const s=n();return(i=t.get(e))!=null?i:s}getVisibleRowHeight(e,t){const n=this.getModelRow(e,t);return this.getVisibleItemSize(n,this.userRowHeights,()=>this.calculateRowHeight(e,n,t))}getVisibleColumnWidth(e,t,n=this.getFirstColumn(t),s=this.calculateTreePaddingX(t)){const i=this.getModelColumn(e,t);return this.getVisibleItemSize(i,this.userColumnWidths,()=>this.calculateColumnWidth(e,i,t,n,s))}getModelRows(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelRow(i,t);n.set(i,o)}return n}getModelRow(e,t){if(this.modelRows.has(e))return x(this.modelRows,e);const{movedRows:n}=t,s=V.getModelIndex(e,n);return this.modelRows.set(e,s),s}getModelColumns(e,t){const n=new Map;for(let s=0;s<e.length;s+=1){const i=e[s],o=this.getModelColumn(i,t);n.set(i,o)}return n}getModelColumn(e,t){if(this.modelColumns.has(e))return x(this.modelColumns,e);const{movedColumns:n}=t,s=V.getModelIndex(e,n);return this.modelColumns.set(e,s),s}calculateRowHeight(e,t,n){const{theme:s}=n,{autoSizeRows:i,rowHeight:o}=s;if(!i)return o;const r=this.calculatedRowHeights.get(t);return r!=null?r:(this.calculatedRowHeights.set(t,Math.ceil(o)),li(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,n,s=this.getFirstColumn(n),i=this.calculateTreePaddingX(n)){const{theme:o}=n,{autoSizeColumns:r,minColumnWidth:l}=o;if(!r){const{columnWidth:m}=o;return m}const a=this.calculateColumnHeaderWidth(t,n),c=this.calculateColumnDataWidth(t,n),d=this.calculatedColumnWidths.get(t);let h=Math.ceil(Math.max(a,c));return h=Math.max(l,h),d!=null&&d>h?h=d:(this.calculatedColumnWidths.set(t,h),li(this.calculatedColumnWidths)),e===s&&(h+=i),h}calculateColumnHeaderWidth(e,t){const{model:n,theme:s}=t,{headerFont:i,headerHorizontalPadding:o}=s,r=n.textForColumnHeader(e,0);if(r){const l=this.getWidthForFont(i,t);return r.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){const{top:n,height:s,width:i,model:o,theme:r}=t,{floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c}=o,{font:d,cellHorizontalPadding:h,rowHeight:m,rowHeaderWidth:p,rowFooterWidth:g,scrollBarSize:f}=r;let b=0;const C=this.getWidthForFont(d,t),w=s/m,T=Math.ceil(n+w);return V.iterateAllItems(n,T,l,a,c,y=>{const S=this.getModelRow(y,t),E=o.textForCell(e,S);if(E){const I=h*2;b=Math.max(b,E.length*C+I)}}),b=Math.max(Math.min(b,(i-p-f-g)*Gl.MAX_COLUMN_WIDTH),h*2),b}calculateTreePaddingX(e){const{top:t,height:n,model:s,theme:i}=e,{rowHeight:o,treeDepthIndent:r}=i;if(!qe(s)||!s.hasExpandableRows)return 0;let l=0;const a=n/o,c=Math.ceil(t+a);for(let d=t;d<=c;d+=1){const h=this.getModelRow(d,e),m=s.depthForRow(h);l=Math.max(l,r*(m+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return x(this.fontWidths,e);const{context:n}=t;n.font=e;const s=n.measureText("8"),{width:i}=s;return this.fontWidths.set(e,i),this.fontWidths.set(n.font,i),i}setColumnWidth(e,t){const n=new Map(this.userColumnWidths);n.set(e,Math.ceil(t)),li(n),this.userColumnWidths=n}resetColumnWidth(e){const t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){const n=new Map(this.userRowHeights);n.set(e,Math.ceil(t)),li(n),this.userRowHeights=n}resetRowHeight(e){const t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}};let Vs=Gl;Vs.CACHE_SIZE=1e4;Vs.MAX_COLUMN_WIDTH=.8;const ch=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowColor:"#000000",textColor:"#ffffff",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc"}),Ct=(e,t)=>{let n=!1;const s=pe(e,{...t,dispose:()=>{n||(n=!0,s.clear(),n=!1)}});return s};function hh(e,t,n=6){const s=Co.hex.lab.raw(e);return s[0]=Math.max(s[0]-s[0]/n*t,0),`#${Co.lab.hex(s)}`}function uh(e,t){const[n,s,i]=Co.hex.rgb(e);return`rgba(${n}, ${s}, ${i}, ${t})`}const _r={colorWithAlpha:uh,darkenForDepth:hh};class Xe{constructor(t=5e3){this.cursor=null,this.order=t}onDown(t,n,s){return!1}onMove(t,n,s){return!1}onDrag(t,n,s){return!1}onLeave(t,n,s){return!1}onClick(t,n,s){return!1}onContextMenu(t,n,s){return!1}onDoubleClick(t,n,s){return!1}onUp(t,n,s){return!1}onWheel(t,n,s){return!1}}class ql extends Xe{constructor(){super(...arguments),this.resizingItems=[],this.hiddenItems=[],this.targetSizes=new Map,this.dragOffset=0}onDown(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);if(r!=null){const l=r.index;return this.dragOffset=0,this.draggingIndex=l,this.resizingItems=[l],this.hiddenItems=this.getHiddenItems(l,s).reverse(),this.targetSizes.clear(),this.addTargetSize(s,l),this.updateCursor(s,l),this.updateSeparator(n,r),!0}return!1}onMove(t,n){const{metrics:s}=n,{model:i}=n.props,o=n.getTheme();if(!s)throw new Error("metrics not set");const r=this.getSeparator(t,s,i,o);return r!=null?(this.updateCursor(s,r.index),!0):!1}onDrag(t,n){var f;if(this.draggingIndex==null)return!1;const s=t[this.pointProperty],{metricCalculator:i,metrics:o}=n;if(!o)throw new Error("metrics not set");const r=n.getTheme(),l=o[this.visibleOffsetProperty],a=o[this.marginProperty],c=o[this.calculatedSizesProperty],d=o[this.modelIndexesProperty],h=o[this.firstIndexProperty],m=o[this.treePaddingProperty],p=new Map;let g=this.resizingItems[this.resizingItems.length-1];for(;g!=null;){const b=x(l,g),C=s-a-b-this.dragOffset,w=x(d,g),T=this.targetSizes.get(w),y=this.resizingItems.length>1,S=this.hiddenItems.indexOf(g);let E=x(c,w);g===h&&(E+=m);let I=C;Math.abs(C-E)<=r.headerResizeSnapThreshold?I=null:T!==void 0&&C>T&&(y&&S!==0||S>0)?I=T:C<=r.headerResizeHiddenSnapThreshold&&(I=0),I!==E?p.set(w,I):p.set(w,null),C<-r.headerResizeSnapThreshold&&I===0?S>=0&&y?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(f=this.targetSizes.get(x(d,g)))!=null?f:0):(g=this.getNextShownItem(g,o),g!==null&&(this.resizingItems.push(g),this.addTargetSize(o,g))):T!==void 0&&C>T+r.headerResizeSnapThreshold&&I===T?S>0?(this.dragOffset+=I,g=this.hiddenItems[S-1],this.resizingItems.push(g),this.addTargetSize(o,g)):y?(this.resizingItems.pop(),this.removeTargetSize(o,g),g=this.resizingItems[this.resizingItems.length-1]):g=null:g=null}return p.forEach((b,C)=>{b!==null?this.setSize(i,C,b):this.resetSize(i,C)}),this.updateCursor(o,this.draggingIndex),!0}onUp(t,n){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(n,null)),!1}onDoubleClick(t,n){const{metrics:s,metricCalculator:i}=n,{model:o}=n.props,r=n.getTheme();if(!s)throw new Error("metrics not set");const l=this.getSeparator(t,s,o,r);if(l!=null){const a=s[this.modelIndexesProperty],c=x(a,l.index);return this.resetSize(i,c),n.forceUpdate(),!0}return!1}updateCursor(t,n){const s=t[this.visibleSizesProperty];x(s,n)===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(t,n){const s=t[this.modelIndexesProperty],i=t[this.userSizesProperty],o=t[this.calculatedSizesProperty],r=n===0?t[this.treePaddingProperty]:0,l=x(s,n);let a=i.get(l);(a==null||a===0)&&(a=x(o,l)+r),this.targetSizes.set(l,a)}removeTargetSize(t,n){const s=t[this.modelIndexesProperty],i=x(s,n);this.targetSizes.delete(i)}}class Pi extends ql{constructor(){super(...arguments),this.hiddenCursor="e-resize",this.defaultCursor="col-resize",this.pointProperty="x",this.userSizesProperty="userColumnWidths",this.visibleOffsetProperty="visibleColumnXs",this.visibleSizesProperty="visibleColumnWidths",this.marginProperty="rowHeaderWidth",this.calculatedSizesProperty="calculatedColumnWidths",this.modelIndexesProperty="modelColumns",this.firstIndexProperty="firstColumn",this.treePaddingProperty="treePaddingX",this.getHiddenItems=V.getHiddenColumns,this.getNextShownItem=V.getNextShownColumn,this.getSeparator=Pi.getColumnSeparator}static getColumnSeparator(t,n,s,i){if(!i.allowColumnResize)return null;const{x:o,y:r,columnHeaderDepth:l}=t,{modelColumns:a}=n,c=V.getColumnSeparatorIndex(o,r,n,i);return c==null||l==null||l>0?null:a.get(c)!=null?{index:c,depth:0}:null}setSize(t,n,s){t.setColumnWidth(n,s)}resetSize(t,n){t.resetColumnWidth(n)}updateSeparator(t,n){t.setState({draggingColumnSeparator:n,isDragging:n!==null})}}const Jt=class{constructor(){this.getCachedTruncatedString=Ct((e,t,n,s,i)=>Jt.truncateToWidth(e,t,n,s,i),{max:1e4}),this.getCachedBackgroundColors=Ct((e,t)=>e.split(" ").map(n=>{const s=[];for(let i=0;i<t;i+=1)s.push(_r.darkenForDepth(n,i,t));return s}),{max:1e3}),this.getCachedColorWithAlpha=Ct((e,t)=>_r.colorWithAlpha(e,t),{max:1e3})}static truncate(e,t){return t<e.length?e.substr(0,t)+"\u2026":e}static binaryTruncateToWidth(e,t,n,s=0,i=t.length,o){if(i>=t.length&&e.measureText(t).width<=n)return t;if(o){const c=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(n/c)))}let r=s,l=Math.min(t.length-1,i),a=t;for(;l>=r;){const c=Math.ceil((l+r)/2),d=Jt.truncate(t,c);if(e.measureText(d).width<=n){if(a=d,r===c)break;r=c}else if(c===0){a=d;break}else l=c-1}return a}static truncateToWidth(e,t,n,s=Jt.DEFAULT_FONT_WIDTH,i){if(n<=0||t.length<=0)return"";const o=Math.min(Math.max(0,Math.floor(n/s/2)-5),t.length),r=Math.min(Math.ceil(n/s*2),t.length);return Jt.binaryTruncateToWidth(e,t,n,o,r,i)}drawCanvas(e){const{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){const{theme:n}=t;e.font=n.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){const{theme:n,metrics:s}=t,{width:i,height:o}=s;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i,o)}drawGrid(e,t){const{metrics:n,draggingRow:s,draggingColumn:i}=t,{gridX:o,gridY:r}=n;e.translate(o,r),this.drawGridBackground(e,t,s==null&&i==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-r)}drawFloatingRows(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingTopRowCount:r,floatingBottomRowCount:l,floatingRows:a,rowCount:c,visibleColumns:d,visibleRowYs:h,visibleRowHeights:m}=i;if(a.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,a,o.floatingRowBackgroundColors),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,d,a,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,d,a),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{top:0,bottom:r-1,maxY:x(h,r-1)+x(m,r-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:c-l-1,bottom:c-1,minY:x(h,c-l)+.5,maxY:x(h,c-1)+x(m,c-1)-.5});for(let p=0;p<d.length;p+=1){const g=d[p];for(let f=0;f<a.length;f+=1){const b=a[f];this.drawCellContent(e,t,g,b)}}}}drawFloatingColumns(e,t){const{draggingRow:n,draggingColumn:s,metrics:i,theme:o}=t,{floatingLeftColumnCount:r,floatingRightColumnCount:l,floatingLeftWidth:a,floatingRightWidth:c,floatingColumns:d,gridX:h,maxX:m,columnCount:p,visibleRows:g,visibleColumnXs:f,visibleColumnWidths:b,width:C,height:w}=i;if(d.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,a),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,C-h-c,m)),n==null&&s==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,a,w),e.clip(),this.drawGridLinesForItems(e,t,d,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,d,g),this.drawFloatingBorders(e,t),r>0&&this.drawSelectedRanges(e,t,{left:0,maxX:x(f,r-1)+x(b,r-1)}),l>0&&this.drawSelectedRanges(e,t,{left:p-l,right:p-1,minX:x(f,p-l)+.5,maxX:x(f,p-1)+x(b,p-1)});for(let T=0;T<d.length;T+=1){const y=d[T];for(let S=0;S<g.length;S+=1){const E=g[S];this.drawCellContent(e,t,y,E)}}}}drawFloatingBorders(e,t){const{metrics:n,theme:s}=t,{floatingTopRowCount:i,floatingBottomRowCount:o,floatingLeftColumnCount:r,floatingRightColumnCount:l,rowCount:a,columnCount:c,visibleRowYs:d,visibleColumnXs:h,visibleRowHeights:m,visibleColumnWidths:p,maxX:g,maxY:f}=n,{floatingDividerOuterColor:b,floatingDividerInnerColor:C}=s;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,i>0){const w=x(d,i-1)+x(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=x(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=x(h,r-1)+x(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=x(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=C,i>0){const w=x(d,i-1)+x(m,i-1)+.5;e.moveTo(0,w),e.lineTo(g,w)}if(o>0){const w=x(d,a-o)-.5;e.moveTo(0,w),e.lineTo(g,w)}if(r>0){const w=x(h,r-1)+x(p,r-1)+.5;e.moveTo(w,0),e.lineTo(w,f)}if(l>0){const w=x(h,c-l)-.5;e.moveTo(w,0),e.lineTo(w,f)}e.stroke()}drawGridBackground(e,t,n=!1){this.drawRowStripes(e,t),n&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);const{metrics:s}=t,{bottom:i,right:o,floatingBottomRowCount:r,floatingLeftColumnCount:l,floatingRightColumnCount:a,floatingTopRowCount:c,columnCount:d,rowCount:h,visibleRowHeights:m,visibleRowYs:p,visibleColumnXs:g,visibleColumnWidths:f,width:b,height:C}=s;this.drawSelectedRanges(e,t,{bottom:Math.min(i,h-r-1),right:Math.min(o,d-a-1),minX:l>0&&g.has(l+1)?x(g,l+1):-10,minY:c>0&&p.has(c+1)?x(p,c+1):-10,maxX:a>0&&g.has(d-a-1)?x(g,d-a-1)+x(f,d-a-1)-.5:b+10,maxY:r>0&&p.has(h-r-1)?x(p,h-r-1)+x(m,h-r-1)-.5:C+10})}drawRowStripes(e,t){const{metrics:n,theme:s}=t,{visibleRows:i}=n,{rowBackgroundColors:o}=s;!o||this.drawRowStripesForRows(e,t,i,o)}drawRowStripesForRows(e,t,n,s,i=0,o=t.metrics.maxX){const{theme:r,metrics:l,model:a}=t,{maxDepth:c,shadowBlur:d,shadowColor:h}=r,m=this.getCachedBackgroundColors(s,c),{visibleRowYs:p,visibleRowHeights:g}=l,f=new Map,b=[],C=[],w=(T,y)=>{const S=qe(a)?a.depthForRow(T):0,E=m[T%m.length],I=E[Math.min(S,E.length-1)];if(f.has(I)||f.set(I,[]),f.get(I).push(T),y!=null){const D=qe(a)?a.depthForRow(y):0;D<S?b.push(T):D>S&&C.push(y)}};for(let T=0;T<n.length;T+=1){const y=n[T],S=T>0?n[T-1]:void 0;w(y,S)}if(f.forEach((T,y)=>{e.fillStyle=y,e.beginPath();for(let S=0;S<T.length;S+=1){const E=T[S],I=x(p,E),D=x(g,E);e.rect(i,I,o,D)}e.fill()}),b.length>0){e.save();const T=this.getCachedColorWithAlpha(h,.15),y=this.getCachedColorWithAlpha(h,0),S=e.createLinearGradient(0,0,0,d);S.addColorStop(0,T),S.addColorStop(1,y),e.fillStyle=S;for(let E=0;E<b.length;E+=1){const I=b[E],D=x(p,I);e.translate(0,D),e.fillRect(i,0,o,d),e.translate(0,-D)}e.restore()}if(C.length>0){e.save();const T=this.getCachedColorWithAlpha(h,0),y=this.getCachedColorWithAlpha(h,.15),S=e.createLinearGradient(0,0,0,d);S.addColorStop(0,T),S.addColorStop(1,y),e.fillStyle=S;for(let E=0;E<C.length;E+=1){const I=C[E],D=x(p,I),k=x(g,I),H=D+k-d;e.translate(0,H),e.fillRect(i,0,o,d),e.translate(0,-H)}e.restore()}}drawMouseColumnHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const r=V.getColumnAtX(n,o);if(r==null||!i.columnHoverBackgroundColor)return;const{visibleColumnWidths:l,visibleColumnXs:a,maxY:c}=o;if(s>c)return;const d=x(a,r),h=x(l,r);e.fillStyle=i.columnHoverBackgroundColor,e.fillRect(d,0,h,c)}drawMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t;if(n==null||s==null)return;const{maxX:r}=o;if(n>r||!i.rowHoverBackgroundColor)return;const l=V.getRowAtY(s,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}drawFloatingMouseRowHover(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o}=t,{maxX:r,floatingTopRowCount:l,floatingBottomRowCount:a,rowCount:c,rowFooterWidth:d}=o;if(n==null||s==null||n>r+d||!i.rowHoverBackgroundColor)return;const h=V.getRowAtY(s,o);h!=null&&(h<l||c-a<=h)&&this.drawMouseRowHoverForRow(e,t,h)}drawMouseRowHoverForRow(e,t,n){const{metrics:s,selectedRanges:i,theme:o}=t,{visibleRowHeights:r,visibleRowYs:l,maxX:a}=s,c=x(l,n),d=x(r,n);o.rowHoverBackgroundColor&&(e.fillStyle=o.rowHoverBackgroundColor);for(let h=0;h<i.length;h+=1){const{startRow:m,endRow:p}=i[h];if(m!=null&&p!=null&&m<=n&&p>=n){o.selectedRowHoverBackgroundColor&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,c,a,d)}drawGridLines(e,t){const{metrics:n,theme:s}=t,{visibleColumns:i,visibleRows:o}=n;this.drawGridLinesForItems(e,t,i,o,s.gridColumnColor,s.gridRowColor)}drawGridLinesForItems(e,t,n,s,i,o){!i&&!o||(e.lineWidth=1,e.beginPath(),i&&(e.strokeStyle=i,this.drawGridLinesForColumns(e,t,n)),o&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,s)),e.stroke())}drawGridLinesForColumns(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,maxY:o}=s;for(let r=0;r<n.length;r+=1){const l=n[r],a=x(i,l)+.5;e.moveTo(a,0),e.lineTo(a,o)}}drawGridLinesForRows(e,t,n){const{metrics:s}=t,{visibleRowYs:i,maxX:o}=s,r=o;for(let l=0;l<n.length;l+=1){const a=n[l],c=x(i,a)+.5;e.moveTo(.5,c),e.lineTo(r-.5,c)}}drawCellBackgrounds(e,t){const{metrics:n}=t,{visibleColumns:s,visibleRows:i}=n;this.drawCellBackgroundsForItems(e,t,s,i)}drawCellBackgroundsForItems(e,t,n,s){e.save();for(let i=0;i<n.length;i+=1){const o=n[i];for(let r=0;r<s.length;r+=1){const l=s[r],a=r+1<s.length?s[r+1]:void 0;this.drawCellBackground(e,t,o,l,a)}}e.restore()}drawCellBackground(e,t,n,s,i){const{metrics:o,model:r,theme:l}=t,{firstColumn:a,modelColumns:c,modelRows:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g}=o,f=x(d,s),b=x(c,n),C=r.backgroundColorForCell(b,f,l),w=n===a,T=qe(r)&&r.hasExpandableRows;if(C){const y=x(h,n)+1,S=x(p,s)+1,E=x(m,n)-1,I=x(g,s)-1;e.fillStyle=C,e.fillRect(y,S,E,I)}w&&T&&this.drawCellRowTreeDepthLines(e,t,s,i)}drawCellContents(e,t){const{metrics:n}=t,{visibleColumns:s}=n;for(let i=0;i<s.length;i+=1){const o=s[i];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,n){const{metrics:s}=t,{visibleColumnXs:i,visibleColumnWidths:o,visibleRows:r,height:l}=s,a=x(i,n),c=x(o,n);e.save(),e.beginPath(),e.rect(a,0,c,l),e.clip();for(let d=0;d<r.length;d+=1){const h=r[d];this.drawCellContent(e,t,n,h)}e.restore()}getTextRenderMetrics(e,t,n,s){const{textAlign:i}=e,{metrics:o,model:r,theme:l}=t,{firstColumn:a,visibleColumnXs:c,visibleColumnWidths:d,visibleRowYs:h,visibleRowHeights:m}=o,{cellHorizontalPadding:p,treeDepthIndent:g,treeHorizontalPadding:f}=l,b=x(c,n),C=x(h,s),w=x(d,n),T=x(m,s),y=n===a;let S=0;qe(r)&&r.hasExpandableRows&&y&&(S=g*(r.depthForRow(s)+1)+f);const E=w-S;let I=b+p;const D=C+T*.5;return i==="right"?I=b+E-p:i==="center"&&(I=b+E*.5),I+=S,{width:E-p*2,x:I,y:D}}drawCellContent(e,t,n,s,i){var y;const{metrics:o,model:r,theme:l}=t,{firstColumn:a,fontWidths:c,modelColumns:d,modelRows:h,visibleRowHeights:m}=o,{textColor:p}=l,g=x(m,s),f=x(h,s),b=x(d,n),C=i!=null?i:r.textForCell(b,f),w=r.truncationCharForCell(b,f),T=n===a;if(C&&g>0){const S=r.textAlignForCell(b,f)||"left";e.textAlign=S;const E=r.colorForCell(b,f,l)||p;e.fillStyle=E;const{width:I,x:D,y:k}=this.getTextRenderMetrics(e,t,n,s),H=(y=c.get(e.font))!=null?y:Jt.DEFAULT_FONT_WIDTH,A=this.getCachedTruncatedString(e,C,I,H,w);A&&e.fillText(A,D,k)}T&&qe(r)&&r.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,s)}drawCellRowTreeMarker(e,t,n){const{metrics:s,model:i,mouseX:o,mouseY:r,theme:l}=t,{firstColumn:a,gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowYs:p,visibleRowHeights:g,visibleRowTreeBoxes:f}=s,{treeMarkerColor:b,treeMarkerHoverColor:C}=l,w=x(h,a),T=x(m,a),y=x(p,n),S=x(g,n);if(!qe(i)||!i.isRowExpandable(n))return;const E=x(f,n),I=o!=null&&r!=null&&o>=c+w&&o<=c+w+T&&r>=d+y&&r<=d+y+S?C:b;this.drawTreeMarker(e,t,w,y,E,I,i.isRowExpanded(n))}drawTreeMarker(e,t,n,s,i,o,r){const{x1:l,y1:a,x2:c,y2:d}=i,h=r?"\u229F":"\u229E",m=n+(l+c)*.5+.5,p=s+(a+d)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(h,m,p)}drawCellRowTreeDepthLines(e,t,n,s){const{metrics:i,model:o,theme:r}=t;if(!qe(o))return;const l=o.depthForRow(n);if(l===0)return;const{firstColumn:a,visibleColumnXs:c,visibleRowYs:d,visibleRowHeights:h}=i,{treeDepthIndent:m,treeHorizontalPadding:p,treeLineColor:g}=r,f=x(c,a),b=x(d,n),C=x(h,n),w=s!==void 0?o.depthForRow(s):0,T=l>w?l-w:0;if(e.strokeStyle=g,e.lineWidth=1,l-T>0){e.beginPath();for(let y=0;y<l-T;y+=1){const S=f+y*m+m*.5+p+.5;e.moveTo(S,b),e.lineTo(S,b+C)}e.stroke()}if(T>0){e.beginPath();for(let y=l-T;y<l;y+=1){const S=f+y*m+m*.5+p+.5;e.moveTo(S,b),e.lineTo(S,b+Math.ceil(C/2)),e.moveTo(S-.5,b+Math.ceil(C/2)+.5),e.lineTo(S+m-.5,b+Math.ceil(C/2)+.5)}e.stroke()}}drawHeaders(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){const{theme:n}=t;e.font=n.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){const{mouseX:n,mouseY:s,theme:i,metrics:o,draggingColumnSeparator:r,isDragging:l,model:a}=t,{columnHeaderHeight:c,floatingColumns:d,gridX:h,width:m,visibleColumns:p,visibleColumnWidths:g,visibleColumnXs:f,floatingLeftColumnCount:b,floatingLeftWidth:C,floatingRightWidth:w,modelColumns:T,columnHeaderMaxDepth:y}=o;if(c<=0)return;const{headerHiddenSeparatorSize:S,headerHiddenSeparatorHoverColor:E,headerSeparatorColor:I,headerSeparatorHoverColor:D}=i,k=c*.5,H=c*(y-1)+c*.5-k*.5,A=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[p[0],p[p.length-1]],{minX:h+C,maxX:m-w}),A&&this.drawColumnHeadersForRange(e,t,[d[0],d[d.length-1]],{minX:h,maxX:h+C}),I){e.strokeStyle=I;const N=[...g.entries()].filter(([B,U])=>U===0).map(([B])=>B);e.beginPath(),e.fillStyle=I;for(let B=0;B<N.length;B+=1){const U=N[B],L=x(f,U),_=x(g,U),$=h+L+_+.5-S*.5;e.rect($,H,S,k)}e.fill()}if(D){let{index:N,depth:B}=r!=null?r:{};if(N==null&&n!=null&&s!=null){const L=Pi.getColumnSeparator(V.getGridPointFromXY(n,s,o),o,a,i);N=L==null?void 0:L.index,B=L==null?void 0:L.depth}let U;if(N==null)U=!1;else{const L=T.get(N),_=T.get(N+1);L==null||_==null?U=!1:U=a.textForColumnHeader(L,B)!==a.textForColumnHeader(_,B)}if(U&&N!=null&&B!=null&&(!l||r!=null)){e.strokeStyle=D;const L=x(f,N),_=x(g,N),$=h+L+_+.5,K=p.indexOf(N),j=K<p.length-1?p[K+1]:null,oe=j!=null?g.get(j):null,te=_===0,me=oe!=null&&oe===0;te?(e.strokeStyle=E,e.fillStyle=E,e.fillRect($,H,S*.5,k)):me&&(e.fillStyle=D,e.fillRect($-S*.5,H,S*.5,k)),e.beginPath(),e.moveTo($,(y-B-1)*c),e.lineTo($,(y-B)*c-1),e.stroke()}}e.restore()}drawColumnHeadersForRange(e,t,n,s){const{model:i}=t,{columnHeaderMaxDepth:o}=i;if(o!==0)for(let r=0;r<=o;r+=1)this.drawColumnHeadersAtDepth(e,t,n,s,r)}drawColumnHeadersAtDepth(e,t,n,s,i){var H,A,N,B,U,L;const{metrics:o,model:r,theme:l}=t,{modelColumns:a,visibleColumnXs:c,gridX:d,calculatedColumnWidths:h,userColumnWidths:m,visibleColumnWidths:p,movedColumns:g}=o,{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C,columnHeaderHeight:w,columnWidth:T}=l,{columnHeaderMaxDepth:y}=r,{minX:S,maxX:E}=s,I=E-S;if(y===0)return;const D=n[0],k=n[1];if(e.save(),e.translate(0,(y-i-1)*w),i===0){this.drawColumnHeader(e,t,"",S,E,{backgroundColor:f,separatorColor:C});for(let _=D;_<=k;_+=1)this.drawColumnHeaderAtIndex(e,t,_,s)}if(i>0){let _=D;for(;_<=k;){const{columnCount:$}=o,K=x(a,_),j=r.textForColumnHeader(K,i),oe=r.colorForColumnHeader(K,i);let te=x(c,_)+d,me=te+x(p,_);if(j!=null){let ae=_-1;for(;ae>=0&&(me-te<I||te>S);){const He=(H=a.get(ae))!=null?H:V.getModelIndex(ae,g);if(He==null||r.textForColumnHeader(He,i)!==j)break;te-=(N=(A=m.get(He))!=null?A:h.get(He))!=null?N:T,ae-=1}let Me=_+1;for(;Me<$&&(me-te<I||me<E);){const He=(B=a.get(Me))!=null?B:V.getModelIndex(Me,g);if(r.textForColumnHeader(He,i)!==j)break;me+=(L=(U=m.get(He))!=null?U:h.get(He))!=null?L:T,Me+=1}_=Me-1;const Ke=me-te>=I;let We=te;Ke&&(me<E?We=me-I:te<S&&(We=S)),this.drawColumnHeader(e,t,j,We,Math.min(me-te,I),{backgroundColor:oe!=null?oe:f,textColor:b,separatorColor:C},s)}_+=1}}e.restore()}drawColumnHeaderAtIndex(e,t,n,s){var w;const{metrics:i,model:o,theme:r}=t,{modelColumns:l,visibleColumnWidths:a,visibleColumnXs:c,gridX:d}=i,h=x(a,n),m=x(c,n)+d,p=x(l,n),g=o.textForColumnHeader(p),{headerBackgroundColor:f,headerColor:b,headerSeparatorColor:C}=r;g!=null&&this.drawColumnHeader(e,t,g,m,h,{backgroundColor:(w=o.colorForColumnHeader(p))!=null?w:f,textColor:b,separatorColor:C},s)}drawColumnHeader(e,t,n,s,i,o,r){if(i<=0)return;const{metrics:l,theme:a}=t,{headerHorizontalPadding:c,columnHeaderHeight:d}=a,{fontWidths:h,width:m}=l,p=h.get(e.font)||Jt.DEFAULT_FONT_WIDTH,f=(i-c*2)/p,{backgroundColor:b,textColor:C="#ffffff",separatorColor:w}=o!=null?o:{};let{minX:T=0,maxX:y=m}=r!=null?r:{};e.save(),e.rect(T,0,y-T,d),e.clip(),b&&(e.fillStyle=b,e.fillRect(s,0,i,d)),w&&(e.strokeStyle=w,e.beginPath(),s>0&&(e.moveTo(s+.5,0),e.lineTo(s+.5,d)),e.moveTo(s+i+.5,0),e.lineTo(s+i+.5,d),e.moveTo(s,d-.5),e.lineTo(s+i,d-.5),e.stroke()),e.beginPath(),e.rect(s,0,i,d),e.clip(),e.fillStyle=C;let S=n;f<=0?S="":S.length>f&&(S=`${S.substring(0,f-1)}\u2026`);const E=S.length*p;let I=s+i*.5;const D=d*.5;T+=c,y-=c;const k=s+c,H=nt(k,T,y),A=s+i-c,B=nt(A,T,y)-H,U=I-E*.5<T,L=I+E*.5>y;U?E<B?I=T+E*.5:I=A-E*.5:L&&(E<B?I=y-E*.5:I=k+E*.5),e.textAlign="center",e.fillText(S,I,D),e.restore()}drawRowHeaders(e,t){const{mouseX:n,mouseY:s,metrics:i,theme:o,draggingRowSeparator:r}=t,{gridY:l,rowHeaderWidth:a,height:c,visibleRows:d,visibleRowHeights:h,visibleRowYs:m}=i;if(a<=0)return;const{headerBackgroundColor:p,headerColor:g,headerHiddenSeparatorSize:f,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:C,headerSeparatorHoverColor:w}=o,T=a*.5,y=a*.5-T*.5;if(e.save(),e.beginPath(),e.fillStyle=p,e.fillRect(0,0,a,c),C){e.strokeStyle=C,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(a,l+.5);const S=[];let E=!1;for(let I=0;I<d.length;I+=1){const D=d[I],k=x(m,D),H=x(h,D);if(H>0){const A=l+k+H+.5;e.moveTo(0,A),e.lineTo(a,A),E=!1}else E||(E=!0,S.push(D))}e.moveTo(a-.5,0),e.lineTo(a-.5,c),e.stroke(),e.beginPath(),e.fillStyle=C;for(let I=0;I<S.length;I+=1){const D=S[I],k=x(m,D),H=x(h,D),A=l+k+H+.5-f*.5;e.rect(y,A,T,f)}e.fill()}if(w){let{index:S=null}=r!=null?r:{};if(S==null&&n!=null&&s!=null&&(S=V.getRowSeparatorIndex(n,s,i,o)),S!=null){e.strokeStyle=w;const E=x(m,S),I=x(h,S),D=l+E+I+.5,k=d.indexOf(S),H=k<d.length-1?d[k+1]:null,A=H!=null?h.get(H):null,N=I===0,B=A!=null&&A===0;N?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(y,D,T,f*.5)):B&&(e.fillStyle=w,e.fillRect(y,D-f*.5,T,f*.5)),e.beginPath(),e.moveTo(.5,D),e.lineTo(a+.5,D),e.stroke()}}e.beginPath(),e.rect(0,l,a,c),e.clip(),e.fillStyle=g,e.textAlign="right";for(let S=0;S<d.length;S+=1){const E=d[S],I=x(h,E),D=x(m,E)+l;this.drawRowHeader(e,t,E,D,I)}e.restore()}drawRowHeader(e,t,n,s,i){if(i<=0)return;const{metrics:o,model:r,theme:l}=t,{modelRows:a,rowHeaderWidth:c}=o,d=x(a,n),h=c-l.cellHorizontalPadding,m=s+i*.5;e.fillText(r.textForRowHeader(d),h,m)}drawRowFooters(e,t){const{mouseX:n,mouseY:s,metrics:i,model:o,theme:r,draggingRowSeparator:l}=t,{gridY:a,gridX:c,maxX:d,modelRows:h,rowFooterWidth:m,height:p,verticalBarWidth:g,visibleRows:f,visibleRowHeights:b,visibleRowYs:C,width:w}=i;if(m<=0)return;const{cellHorizontalPadding:T,headerBackgroundColor:y,headerColor:S,headerHiddenSeparatorSize:E,headerHiddenSeparatorHoverColor:I,headerSeparatorColor:D,headerSeparatorHoverColor:k}=r,H=m*.5,A=m*.5-H*.5,N=Math.min(c+d,w-m-g);if(e.save(),e.beginPath(),e.fillStyle=y,e.fillRect(N,a,m,p),D){e.strokeStyle=D,e.beginPath(),e.moveTo(N,a+.5),e.lineTo(m,a+.5);const U=[];let L=!1;for(let _=0;_<f.length;_+=1){const $=f[_],K=x(C,$),j=x(b,$);if(j>0){const oe=a+K+j+.5;e.moveTo(N+.5,oe),e.lineTo(N+m-.5,oe),L=!1}else L||(L=!0,U.push($))}e.moveTo(N+.5,a),e.lineTo(N+.5,p),e.stroke(),e.beginPath(),e.fillStyle=D;for(let _=0;_<U.length;_+=1){const $=U[_],K=x(C,$),j=x(b,$),oe=a+K+j+.5-E*.5;e.rect(N+A,oe,H,E)}e.fill()}if(k){let{index:U=null}=l!=null?l:{};if(U==null&&n!=null&&s!=null&&(U=V.getRowSeparatorIndex(n,s,i,r)),U!=null){e.strokeStyle=k;const L=x(C,U),_=x(b,U),$=a+L+_+.5,K=f.indexOf(U),j=K<f.length-1?f[K+1]:null,oe=j!=null?b.get(j):null,te=_===0,me=oe!=null&&oe===0;te?(e.strokeStyle=I,e.fillStyle=I,e.fillRect(A,$,H,E*.5)):me&&(e.fillStyle=k,e.fillRect(A,$-E*.5,H,E*.5)),e.beginPath(),e.moveTo(N+.5,$),e.lineTo(N+m+.5,$),e.stroke()}}e.beginPath(),e.rect(N,a,m,p),e.clip(),e.fillStyle=S,e.textAlign="left";const B=N+T;for(let U=0;U<f.length;U+=1){const L=f[U],_=x(b,L);if(_>0){const $=x(C,L)+a,K=x(h,L),j=$+_*.5;e.fillText(o.textForRowFooter(K),B,j)}}e.restore()}drawSelectedRanges(e,t,n={}){const{cursorColumn:s,cursorRow:i,draggingRow:o,draggingColumn:r,editingCell:l,metrics:a,model:c,selectedRanges:d,theme:h}=t,{visibleColumnWidths:m,visibleColumnXs:p,visibleRowHeights:g,visibleRowYs:f,width:b,height:C}=a,{left:w=a.left,top:T=a.top,right:y=a.right,bottom:S=a.bottom,minY:E=-10,maxY:I=C+10,minX:D=-10,maxX:k=b+10}=n;if(d.length===0)return;const H=Fe(c)&&c.isEditable&&l==null&&o==null&&r==null&&s!=null&&i!=null&&p.has(s)&&f.has(i);if(H){const A=x(p,s),N=x(f,i),B=x(m,s),U=x(g,i);e.save(),e.beginPath(),e.rect(0,0,b,C),e.rect(A,N,B,U),e.clip("evenodd")}e.beginPath();for(let A=0;A<d.length;A+=1){const N=d[A],B=N.startColumn!==null?N.startColumn:w,U=N.startRow!==null?N.startRow:T,L=N.endColumn!==null?N.endColumn:y,_=N.endRow!==null?N.endRow:S;if(_>=T&&S>=U&&L>=w&&y>=B){const $=B>=w&&p.has(B)?Math.round(x(p,B))+.5:D,K=U>=T&&f.has(U)?Math.max(Math.round(x(f,U))+.5,.5):E,j=L<=y&&p.has(L)?Math.round(x(p,L)+x(m,L))-.5:k,oe=_<=S&&f.has(_)?Math.round(x(f,_)+x(g,_))-.5:I;e.rect($,K,j-$,oe-K)}e.fillStyle=h.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=h.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=h.selectionOutlineColor,e.lineWidth=1,e.stroke()}H&&s!=null&&i!=null&&(e.restore(),this.drawActiveCell(e,t,s,i))}drawActiveCell(e,t,n,s,i=Jt.ACTIVE_CELL_BORDER_WIDTH){const{metrics:o,theme:r}=t,{visibleColumnWidths:l,visibleColumnXs:a,visibleRowHeights:c,visibleRowYs:d}=o,h=x(a,n),m=x(d,s),p=x(l,n),g=x(c,s);let f=h-i*.5,b=m-i*.5,C=p+i,w=g+i;f<=0&&(C+=f-1,f=1),b<=0&&(w+=b-1,b=1);const{lineWidth:T}=e;e.beginPath(),e.lineWidth=i,e.strokeStyle=r.selectionOutlineColor,this.drawRoundedRect(e,f,b,C,w),e.stroke(),e.lineWidth=T}drawRoundedRect(e,t,n,s,i,o=Jt.DEFAULT_EDGE_RADIUS){e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+s-o,n),e.quadraticCurveTo(t+s,n,t+s,n+o),e.lineTo(t+s,n+i-o),e.quadraticCurveTo(t+s,n+i,t+s-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}drawDraggingColumn(e,t){var oe;const{draggingColumn:n,metrics:s,mouseX:i,theme:o,model:r}=t;if(n==null||i==null)return;const{range:l,depth:a}=n,{gridX:c,gridY:d,visibleColumnXs:h,visibleColumnWidths:m,height:p,width:g,columnHeaderMaxDepth:f,columnHeaderHeight:b,movedColumns:C,modelColumns:w,floatingLeftWidth:T}=s,y=(oe=w.get(l[0]))!=null?oe:V.getModelIndex(l[0],C),S=r.getColumnHeaderGroup(y,a);if(a>0&&!S)return;const[E,I]=l,D=x(h,E),H=x(h,I)+x(m,I)-D,A=n.left,{backgroundColor:N,font:B,headerFont:U,reorderOffset:L,shadowBlur:_,shadowColor:$}=o,K=(f-a-1)*b;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(T,0,g,p),e.clip(),e.fillStyle=N,e.fillRect(D,K,H,p),e.restore(),e.translate(0,L),e.save(),e.shadowColor=$,e.shadowBlur=_,e.fillStyle=N,e.fillRect(n.left,K+L,n.width,p),e.restore(),e.beginPath(),e.rect(n.left,K,n.width+1,p),e.clip(),e.translate(A-D,0),e.font=U;const j=[];for(let te=n.range[0];te<=n.range[1];te+=1)j.push(te);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[j[0],j[j.length-1]],{minX:D,maxX:g}),e.translate(0,d),e.font=B,this.drawGridBackground(e,t);for(let te=E;te<=I;te+=1)this.drawColumnCellContents(e,t,te);e.restore()}drawDraggingRow(e,t){const{draggingRow:n,draggingRowOffset:s,metrics:i,mouseY:o,theme:r}=t;if(n==null||o==null)return;const{gridX:l,gridY:a,visibleRowYs:c,visibleRowHeights:d,width:h}=i,m=x(c,n),p=x(d,n)+1,{backgroundColor:g,font:f,headerFont:b,reorderOffset:C,shadowBlur:w,shadowColor:T}=r;e.save(),e.translate(0,a),e.fillStyle=g,e.fillRect(0,m,h,p),e.translate(l+C,o-m-a-(s!=null?s:0)),e.save(),e.shadowColor=T,e.shadowBlur=w,e.fillStyle=g,e.fillRect(-l,m,h,p),e.restore(),e.beginPath(),e.rect(-l,m,h,p),e.clip(),e.font=f,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-a),e.font=b,this.drawRowHeaders(e,t),e.restore()}drawScrollBars(e,t){const{isDraggingHorizontalScrollBar:n,isDraggingVerticalScrollBar:s,isDragging:i,metrics:o,mouseX:r,mouseY:l,theme:a}=t;if(a.scrollBarSize<=0)return;const{rowHeaderWidth:c,columnHeaderHeight:d,width:h,height:m,handleHeight:p,handleWidth:g,scrollX:f,scrollY:b,hasHorizontalBar:C,hasVerticalBar:w,barWidth:T,barHeight:y}=o,{scrollBarBackgroundColor:S,scrollBarHoverBackgroundColor:E,scrollBarCasingColor:I,scrollBarCornerColor:D,scrollBarColor:k,scrollBarHoverColor:H,scrollBarActiveColor:A,scrollBarSize:N,scrollBarHoverSize:B,scrollBarCasingWidth:U,scrollBarSelectionTick:L,scrollBarSelectionTickColor:_,scrollBarActiveSelectionTickColor:$,autoSelectRow:K,autoSelectColumn:j}=a,oe=r!=null&&l!=null&&r<=h&&l<=m,te=s||w&&!n&&!i&&r!=null&&l!=null&&r>=h-B&&l<=y+d&&oe,me=n||C&&!s&&!i&&!te&&r!=null&&l!=null&&l>=m-B&&r<=T-c&&oe,ae=me?B:N,Me=te?B:N;if(e.translate(c,d),C&&w&&(e.fillStyle=I,e.fillRect(h-c-N,m-d-N,N,N),e.fillStyle=D,e.fillRect(h-c-N+U,m-d-N+U,N-U,N-U)),C){const Ke=f,We=m-d-ae;if(e.fillStyle=I,e.fillRect(0,We,T,ae-U),e.fillStyle=me?E:S,e.fillRect(0,We+U,T,ae-U),n?e.fillStyle=A:me?e.fillStyle=H:e.fillStyle=k,e.fillRect(Ke,We+U,g,ae-U),!K&&L&&_!=null&&$!=null){e.fillStyle=_;const{selectedRanges:He,cursorColumn:_e}=t,{lastLeft:Qe,columnCount:ke}=o,Fn=[...He].filter(ue=>ue.startColumn!=null&&ue.endColumn!=null).map(ue=>[ue.startColumn,ue.endColumn]).sort(V.compareRanges),qt=V.mergeSortedRanges(Fn),Ze=ue=>ue<=Qe?ue/Qe*(T-g):T-g+(ue-Qe)/(ke-Qe)*g;for(let ue=0;ue<qt.length;ue+=1){const ze=qt[ue],Ve=ze[0],rt=ze[1];if(Ve!=null&&rt!=null&&(Ve!==_e||rt!==_e)){const vt=Ze(Ve),Tt=Math.max(1,Math.round(Ze(rt+1)-vt)),lt=ae-U;e.fillRect(vt,We+U+Math.round(lt/3),Tt,Math.round(lt/3))}}if(_e!=null){const ue=Ze(_e),ze=2,Ve=ae-U;e.fillStyle=$,e.fillRect(ue,We+U,ze,Ve)}}}if(w){const Ke=h-c-Me,We=b;if(e.fillStyle=I,e.fillRect(Ke,0,Me-U,y),e.fillStyle=te?E:S,e.fillRect(Ke+U,0,Me-U,y),s?e.fillStyle=A:te?e.fillStyle=H:e.fillStyle=k,e.fillRect(Ke+U,We,Me-U,p),!j&&L&&_!=null&&$!=null){const{selectedRanges:He,cursorRow:_e}=t,{lastTop:Qe,rowCount:ke}=o,xt=ue=>ue<=Qe?ue/Qe*(y-p):y-p+(ue-Qe)/(ke-Qe)*p;e.fillStyle=_;const qt=[...He].filter(ue=>ue.startRow!=null&&ue.endRow!=null).map(ue=>[ue.startRow,ue.endRow]).sort(V.compareRanges),Ze=V.mergeSortedRanges(qt);for(let ue=0;ue<Ze.length;ue+=1){const ze=Ze[ue],Ve=ze[0],rt=ze[1];if(Ve!=null&&rt!=null&&(Ve!==_e||rt!==_e)){const vt=xt(Ve),Tt=Me-U,lt=Math.max(1,Math.round(xt(rt+1)-vt));e.fillRect(Ke+U+Math.round(Tt/3),vt,Math.round(Tt/3),lt)}}if(_e!=null){const ue=Math.round(xt(_e)),ze=Me-U,Ve=2;e.fillStyle=$,e.fillRect(Ke+U,ue,ze,Ve)}}}e.translate(-c,-d)}};let ms=Jt;ms.DEFAULT_FONT_WIDTH=10;ms.DEFAULT_EDGE_RADIUS=2;ms.ACTIVE_CELL_BORDER_WIDTH=2;const Vr=100;class mh extends Xe{constructor(){super(...arguments),this.hasExtendedFloating=!1}onDown(t,n,s){const{x:i,y:o,column:r,row:l}=t,{metrics:a}=n;if(!a)throw new Error("metrics not set");const{gridX:c,gridY:d,maxX:h,maxY:m}=a,p=i-c,g=o-d;if(p<0||g<0||r==null&&p>h||l==null&&g>m)return!1;const f=V.isModifierKeyDown(s),b=s.shiftKey;f||(b?n.trimSelectedRanges():n.clearSelectedRanges());const C=n.getTheme(),{autoSelectRow:w,autoSelectColumn:T}=C;return(r!==null||!T)&&(l!==null||!w)&&(n.focus(),n.moveCursorToPosition(r,l,b,!1,b&&f)),this.startPoint=t,this.hasExtendedFloating=!1,this.dragBounds=V.getScrollDragBounds(a,l,r),!0}onDrag(t,n){if(this.startPoint===void 0)return!1;this.stopTimer();const{row:s,column:i}=this.startPoint,{x:o,y:r}=t;let{row:l,column:a}=t;const{metrics:c}=n;if(!c)throw new Error("metrics not set");const{left:d,lastLeft:h,top:m,lastTop:p,columnWidth:g,rowHeight:f}=c,b=V.getScrollDragBounds(c,s,i);let C=0,w=0;if(d<h&&(o<b.x1?C=o-b.x1:o>b.x2&&(C=o-b.x2)),m<p&&(r<b.y1?w=r-b.y1:r>b.y2&&(w=r-b.y2)),C!==0||w!==0)this.startTimer(n,t,C>0?Math.ceil(C/g):Math.floor(C/g),w>0?Math.ceil(w/f):Math.floor(w/f));else if(l!=null&&a!=null){const{floatingTopRowCount:T,floatingBottomRowCount:y,floatingLeftColumnCount:S,floatingRightColumnCount:E,columnCount:I,rowCount:D,bottom:k,right:H,topVisible:A,bottomVisible:N,leftVisible:B,rightVisible:U}=c;this.hasExtendedFloating||(s!==null&&s<T&&l>=T?(l=T,this.hasExtendedFloating=!0):s!==null&&s>=D-y&&l<D-y&&(l=D-y-1,this.hasExtendedFloating=!0),i!==null&&i<S&&a>=S?(a=S,this.hasExtendedFloating=!0):i!==null&&i>=I-E&&a<I-E&&(a=I-E-1,this.hasExtendedFloating=!0)),s!==null&&!V.isFloatingRow(s,c)&&V.isFloatingRow(l,c)&&(s>l&&l<m?l=A-1:s<l&&l>k&&(l=N+1)),i!==null&&!V.isFloatingColumn(i,c)&&V.isFloatingColumn(a,c)&&(i>a&&a<d?a=B-1:i<a&&a>H&&(a=U+1)),n.moveCursorToPosition(a,l,!0,!0)}return!0}onUp(t,n){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),n.commitSelection()),!1}moveSelection(t,n,s,i){const{row:o,column:r}=n,{metrics:l}=t;if(!l)throw new Error("metrics not set");const{selectionEndRow:a,selectionEndColumn:c}=t.state;if(a==null||c==null)throw new Error("selection not set");const{rowCount:d,columnCount:h}=l,m=s<0&&r!=null?r:0,p=s>0&&r!=null?r:h-1,g=i<0&&o!=null?o:0,f=i>0&&o!=null?o:d-1;t.moveCursorToPosition(Math.min(Math.max(m,c+s),p),Math.min(Math.max(g,a+i),f),!0),this.lastTriggerTime=Date.now()}startTimer(t,n,s,i){this.stopTimer();const o=this.lastTriggerTime!=null?Vr-Math.min(Vr,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(t,n,s,i),this.startTimer(t,n,s,i)},o)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const Ur=5,ph=1e3/60,ai=10;function mn(e,t,n,s){var T,y,S,E,I,D,k;const{modelColumns:i,movedColumns:o,visibleColumnXs:r,columnCount:l,visibleColumnWidths:a,userColumnWidths:c,calculatedColumnWidths:d,floatingLeftWidth:h,maxX:m}=n;if(t==null||e==null||e>l||e<0)return null;const p=(T=i.get(e))!=null?T:V.getModelIndex(e,o),g=s.getColumnHeaderGroup(p,t),f=g!=null;let b,C,w;if(g!=null){const[H,A]=g.getVisibleRange(o);b=(y=r.get(H))!=null?y:h,C=((S=r.get(A))!=null?S:m)+((E=a.get(A))!=null?E:0),w=[H,A]}else{const H=r.get(e);if(H==null)return null;b=H,C=b+((k=(D=(I=a.get(e))!=null?I:c.get(p))!=null?D:d.get(p))!=null?k:0),w=[e,e]}return{visibleIndex:e,modelIndex:p,left:b,right:C,width:C-b,isColumnGroup:f,range:w,depth:t}}class gh extends Xe{constructor(){super(...arguments),this.cursor=null,this.draggingColumn=null}setScrollInterval(t,n){this.scrollingInterval!=null&&n===this.scrollingDirection||(this.scrollingDirection=n,this.scrollingInterval=window.setInterval(()=>{var f,b;const{metrics:s}=t;if(!s)return;const{left:i,lastLeft:o,leftOffset:r,userColumnWidths:l,calculatedColumnWidths:a,movedColumns:c,visibleColumnWidths:d}=s;let h=i,m=r;if(n==="left")for(m-=ai;m<0;){h-=1;const C=V.getModelIndex(i-1,c),w=(f=l.get(C))!=null?f:a.get(C);w===void 0?m=0:m+=w,h<0&&(m=0,h=0)}else{m+=ai;let C=d.get(i);for(;C!==void 0&&m>C;){h+=1,m-=C;const w=V.getModelIndex(i+1,c);C=(b=l.get(w))!=null?b:a.get(w),h>o&&(m=0,h=o)}}const{mouseX:p,mouseY:g}=t.state;!s||p==null||g==null||(this.moveDraggingColumn(p,t,n==="left"?-ai:ai),t.setState({left:h,leftOffset:m}),(n==="left"&&h===0&&r===0||n==="right"&&h===o)&&this.clearScrollInterval())},ph))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(t,n){const{model:s}=n.props,{x:i,column:o,columnHeaderDepth:r}=t,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const a=mn(o,r,l,s);if(o==null||a==null||r==null||r>0&&!a.isColumnGroup)return!1;const{rowHeaderWidth:c}=l;return this.initialGridPoint=t,this.draggingColumn=null,this.cursor=null,a.modelIndex!=null&&r!=null&&s.isColumnMovable(a.modelIndex,r)&&(this.draggingOffset=i-a.left-c,this.initialOffset=this.draggingOffset),!1}onDrag(t,n,s){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;const{x:i,y:o}=t,{columnHeaderDepth:r}=this.initialGridPoint,{model:l}=n.props;let{draggingColumn:a}=this;const{metrics:c}=n;if(!c)throw new Error("Metrics not set");if(!a&&Math.abs(this.initialGridPoint.x-i)<Ur&&Math.abs(this.initialGridPoint.y-o)<Ur)return!1;if(a==null){const d=mn(this.initialGridPoint.column,r,c,l);if(!d||r==null||!l.isColumnMovable(d.modelIndex)||r>0&&!d.isColumnGroup||d.range[0]==null)return!1;a={range:d.range,depth:r,left:d.left,width:d.width};const h=mn(a.range[0],0,c,l),m=mn(a.range[1],0,c,l);if(!h||!m)return!1;this.draggingColumn=a,n.setState({draggingColumn:a,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(t.x,n,s.movementX),!0}moveDraggingColumn(t,n,s){var I,D,k,H,A;if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||s===0)return;if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+s||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+s?this.draggingOffset=this.initialOffset:this.draggingOffset+=s,this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}const{depth:i}=this.draggingColumn,{model:o}=n.props,{movedColumns:r}=n.state,{metrics:l}=n;if(!l)throw new Error("Metrics not set");const{floatingLeftWidth:a,width:c,columnHeaderMaxDepth:d,visibleColumnXs:h}=l,m=s<0,p=mn(this.draggingColumn.range[0],i,l,o);if(!p)return;const g=t-this.draggingOffset,f=g+p.width;this.draggingColumn={...this.draggingColumn,left:g},n.setState({draggingColumn:this.draggingColumn});const b=mn(V.getColumnAtX(nt(m?g:f,a,c),l,!0),i,l,o),C=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);if(!b)return;if(C){const N=C.getVisibleRange(r);if(b.visibleIndex<N[0]){const B=this.moveColumn(p,N[0],r);this.draggingOffset=t-((I=h.get(N[0]))!=null?I:0),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}if(b.visibleIndex>N[1]){const B=this.moveColumn(p,N[1]-(p.range[1]-p.range[0]),r),{right:U=0}=(D=mn(N[1],0,l,o))!=null?D:{};this.draggingOffset=t-(U-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},this.clearScrollInterval(),n.setState({draggingColumn:this.draggingColumn,movedColumns:B});return}}if(!o.isColumnMovable(b.modelIndex)){let N=b.visibleIndex;if(m)for(N+=1;N<p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N+=1;else for(N-=1;N>p.visibleIndex&&!o.isColumnMovable(V.getModelIndex(N,r));)N-=1;if(N!==p.visibleIndex){m||(N-=p.range[1]-p.range[0]);const U=this.moveColumn(p,N,r);n.setState({movedColumns:U,draggingColumn:this.draggingColumn})}const B=mn(N,0,l,o);m?this.draggingOffset=t-((k=B==null?void 0:B.left)!=null?k:0):this.draggingOffset=t-(((H=B==null?void 0:B.right)!=null?H:0)-p.width),this.draggingColumn={...this.draggingColumn,left:t-this.draggingOffset},n.setState({draggingColumn:this.draggingColumn});return}if(g<=a?this.setScrollInterval(n,"left"):f>c?this.setScrollInterval(n,"right"):this.clearScrollInterval(),b.visibleIndex===p.visibleIndex||m&&p.visibleIndex<b.visibleIndex||!m&&p.visibleIndex>b.visibleIndex)return;const w=b.left+b.width*.5,T=o.getColumnHeaderParentGroup(p.modelIndex,p.depth);let y,S=((A=T==null?void 0:T.depth)!=null?A:d)-1;for(;S>=0&&y===void 0;)y=o.getColumnHeaderGroup(b.modelIndex,S),S-=1;let E;m&&g<w&&(!y||b.visibleIndex===y.getVisibleRange(r)[0])&&(E=this.moveColumn(p,b.range[0],r)),!m&&f>w&&(!y||b.visibleIndex===y.getVisibleRange(r)[1])&&(E=this.moveColumn(p,b.range[1]-(p.range[1]-p.range[0]),r)),E&&(this.draggingColumn={...this.draggingColumn,left:g},n.setState({movedColumns:E,draggingColumn:this.draggingColumn}))}moveColumn(t,n,s){const i=t.isColumnGroup?V.moveRange(t.range,n,s):V.moveItem(t.visibleIndex,n,s),o=n-t.range[0],r=[t.range[0]+o,t.range[1]+o];return this.draggingColumn&&(this.draggingColumn={...this.draggingColumn,range:r}),i}onUp(t,n){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,n.setState({draggingColumn:null,isDragging:!1}),!0):!1}}class qo extends Xe{constructor(){super(...arguments),this.cursor="default"}static getLeftWithOffsetFromRawLeft(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToColumn)return{left:Math.round(n),leftOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleColumnWidths.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleColumnWidth(r,d)}const c=a*l;return{left:r,leftOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barLeft:c,barWidth:d,height:h,hasHorizontalBar:m}=r;return m&&i>0&&a>=h-o&&a<h&&l>c&&l<c+d}getLeftWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{barWidth:o,handleWidth:r,lastLeft:l,barLeft:a,columnCount:c,scrollableContentWidth:d,scrollableViewportWidth:h}=s,m=i-a,p=nt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{left:0,leftOffset:p*(d-h)};const g=p*l;return qo.getLeftWithOffsetFromRawLeft(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{x:i}=t,{handleWidth:o,barLeft:r,scrollX:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;const{left:c,leftOffset:d}=this.getLeftWithOffset(t,n);n.setViewState({left:c,leftOffset:d,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(t,n){if(this.dragOffset!=null){const{left:s,leftOffset:i}=this.getLeftWithOffset(t,n);return n.setViewState({left:s,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(t,n){return this.isInScrollBar(t,n)}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class fh extends Xe{constructor(){super(...arguments),this.cursor="move"}onDown(t,n){const{model:s}=n.props,{x:i,y:o,row:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{columnHeaderHeight:a,rowHeaderWidth:c,visibleRowYs:d}=l;if(i<=c&&r!==null&&s.isRowMovable(r)){const h=x(d,r);this.draggingOffset=o-h-a,n.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(t,n){if(this.draggingOffset==null)return!1;const{model:s}=n.props;let{draggingRow:i}=n.state;const{mouseX:o,mouseY:r}=n.state;if(o==null||r==null)return!1;if(i==null){const{row:E}=n.getGridPointFromXY(o,r);if(E!=null&&!s.isRowMovable(E)||(i=E,n.setState({draggingRow:i,isDragging:!0}),i==null))return!1}const{metrics:l}=n;if(!l)throw new Error("metrics not set");const{top:a,lastTop:c,bottom:d,bottomVisible:h,rowCount:m,columnHeaderHeight:p,visibleRowHeights:g,visibleRowYs:f,height:b}=l;let C=p;if(a<i){const E=i-1;C=x(f,E)+x(g,E)*.5+p}let w=b;if(i<d){const E=i+1;w=x(f,E)+x(g,E)*.5+p}let{movedRows:T}=n.state;r<C&&i>0&&s.isRowMovable(i-1)?(T=V.moveItem(i,i-1,T),i-=1):w<r&&i<m-1&&s.isRowMovable(i+1)&&(T=V.moveItem(i,i+1,T),i+=1),n.setState({movedRows:T,draggingRow:i});const y=p+x(g,a)*.5,S=p+x(f,h)+x(g,h)*.5;return r<y&&a>0?n.setState({top:a-1}):r>S&&a<c&&n.setState({top:a+1}),!0}onUp(t,n){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,n.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}class Ko extends ql{constructor(){super(...arguments),this.hiddenCursor="s-resize",this.defaultCursor="row-resize",this.pointProperty="y",this.userSizesProperty="userRowHeights",this.visibleOffsetProperty="visibleRowYs",this.visibleSizesProperty="visibleRowHeights",this.marginProperty="columnHeaderHeight",this.calculatedSizesProperty="calculatedRowHeights",this.modelIndexesProperty="modelRows",this.firstIndexProperty="firstRow",this.treePaddingProperty="treePaddingY",this.getHiddenItems=V.getHiddenRows,this.getNextShownItem=V.getNextShownRow,this.getSeparator=Ko.getRowSeparator}static getRowSeparator(t,n,s,i){if(!i.allowRowResize)return null;const{x:o,y:r}=t,l=V.getRowSeparatorIndex(o,r,n,i);return l!=null?{index:l,depth:0}:null}setSize(t,n,s){t.setRowHeight(n,s)}resetSize(t,n){t.resetRowHeight(n)}updateSeparator(t,n){t.setState({draggingRowSeparator:n,isDragging:n!==null})}}class Ti extends Xe{static isInTreeBox(t,n){const{column:s,row:i,x:o,y:r}=t,{metrics:l}=n;if(!l)throw new Error("metrics not set");const{gridX:a,gridY:c,firstColumn:d,visibleColumnXs:h,visibleColumnWidths:m,visibleRowHeights:p,visibleRowYs:g,visibleRowTreeBoxes:f}=l;if(s===d&&i!=null&&f.get(i)!=null&&o>a&&r>c){const b=x(h,s),C=x(m,s),w=x(g,i),T=x(p,i);if(o>=a+b&&o<=a+b+C&&r>=c+w&&r<=c+w+T)return!0}return!1}onDown(t,n){return Ti.isInTreeBox(t,n)}onClick(t,n){if(Ti.isInTreeBox(t,n)){const{row:s}=t;if(s!==null)return n.toggleRowExpanded(s),!0}return!1}}class Ch extends Xe{isInCorner(t,n){const s=n.getTheme(),{scrollBarSize:i}=s,{metrics:o}=n;if(!o)throw new Error("metrics not set");const{x:r,y:l}=t,{width:a,height:c,hasVerticalBar:d,hasHorizontalBar:h}=o;return i>0&&d&&h&&r>=a-i&&l>=c-i&&r<=a&&l<=c}onDown(t,n){return this.isInCorner(t,n)}onUp(t,n){return this.isInCorner(t,n)}onClick(t,n){return this.isInCorner(t,n)}}class Yo extends Xe{constructor(){super(...arguments),this.cursor="default"}static getTopWithOffsetFromRawTop(t,n){const s=t.getTheme(),{metrics:i,metricCalculator:o}=t;if(!i)throw new Error("metrics not set");if(s.scrollSnapToRow)return{top:Math.round(n),topOffset:0};const r=Math.floor(n),l=n-r;let a=i.visibleRowHeights.get(r);if(a==null){const d=t.getMetricState();a=o.getVisibleRowHeight(r,d)}const c=a*l;return{top:r,topOffset:c}}isInScrollBar(t,n){const s=n.getTheme(),{scrollBarSize:i,scrollBarHoverSize:o}=s,{metrics:r}=n;if(!r)throw new Error("metrics not set");const{x:l,y:a}=t,{barTop:c,barHeight:d,width:h,hasVerticalBar:m}=r;return m&&i>0&&l>=h-o&&l<h&&a>c&&a<c+d}getTopWithOffset(t,n){var f;const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{barHeight:o,handleHeight:r,lastTop:l,barTop:a,rowCount:c,scrollableContentHeight:d,scrollableViewportHeight:h}=s,m=i-a,p=nt((m-((f=this.dragOffset)!=null?f:0))/(o-r),0,1);if(c===1)return{top:0,topOffset:p*(d-h)};const g=p*l;return Yo.getTopWithOffsetFromRawTop(n,g)}onDown(t,n){const{metrics:s}=n;if(!s)throw new Error("metrics not set");const{y:i}=t,{handleHeight:o,barTop:r,scrollY:l}=s;if(!this.isInScrollBar(t,n))return!1;const a=i-r;if(a>=l&&a<=l+o)this.dragOffset=a-l,n.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;const{top:c,topOffset:d}=this.getTopWithOffset(t,n);n.setViewState({top:c,topOffset:d,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(t,n){return this.isInScrollBar(t,n)}onDrag(t,n){if(this.dragOffset!=null){const{top:s,topOffset:i}=this.getTopWithOffset(t,n);return n.setViewState({top:s,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(t,n){return this.dragOffset!==void 0&&(this.dragOffset=void 0,n.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(t,n)}onClick(t,n){return this.isInScrollBar(t,n)}}class bh extends Xe{onDoubleClick({column:t,row:n},s){const{model:i}=s.props;return Fe(i)&&t!=null&&n!=null&&i.isEditableRange(X.makeCell(t,n))?(s.startEditing(t,n),!0):!1}}class ns{constructor(t=5e3){this.order=t}onDown(t,n){return!1}}class wh extends ns{onDown(t,n){switch(t.key){case"a":if(V.isModifierKeyDown(t))return n.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,t,n);case"ArrowDown":return this.handleArrowMove(0,1,t,n);case"ArrowRight":return this.handleArrowMove(1,0,t,n);case"ArrowLeft":return this.handleArrowMove(-1,0,t,n);case"k":case"K":return V.isModifierKeyDown(t)?!1:this.handlePageUp(t,n);case"j":case"J":return V.isModifierKeyDown(t)?!1:this.handlePageDown(t,n);case"h":case"H":return V.isModifierKeyDown(t)?!1:(t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(0,n.state.cursorRow,t.shiftKey),!0);case"l":case"L":{if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{columnCount:i}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(i-1,n.state.cursorRow,t.shiftKey),!0}case"PageDown":return this.handlePageDown(t,n);case"PageUp":return this.handlePageUp(t,n);case"Home":return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:0,V.isModifierKeyDown(t)?0:n.state.cursorRow,t.shiftKey,!0,!0),!0;case"End":{const{model:s}=n.props,{columnCount:i,rowCount:o}=s;return t.shiftKey||n.clearSelectedRanges(),n.moveCursorToPosition(V.isModifierKeyDown(t)?n.state.cursorColumn:i-1,V.isModifierKeyDown(t)?o-1:n.state.cursorRow,t.shiftKey,!0,!0),!0}case"Escape":return n.clearSelectedRanges(),!0;case"Enter":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?X.SELECTION_DIRECTION.UP:X.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(n.state.selectedRanges.length>0)return n.moveCursorInDirection(t.shiftKey?X.SELECTION_DIRECTION.LEFT:X.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(t,n,s,i){const o=s.shiftKey,r=V.isModifierKeyDown(s);o?i.trimSelectedRanges():i.clearSelectedRanges();const{cursorRow:l,cursorColumn:a,selectionEndColumn:c,selectionEndRow:d}=i.state,h=o?c:a,m=o?d:l;if(r){const{model:p}=i.props,{columnCount:g,rowCount:f}=p,b=r&&o;let C=null,w=null;t<0?(C=0,w=m):t>0?(C=g-1,w=m):n<0?(C=h,w=0):n>0&&(C=h,w=f-1),C!=null&&w!=null&&i.moveCursorToPosition(C,w,o,!0,b)}else{if(!i.metrics)throw new Error("grid.metrics are not set");const{theme:p}=i.props,{autoSelectRow:g,autoSelectColumn:f}=p;if(g&&t!==0){const{lastLeft:b}=i.metrics;let{left:C}=i.state;C=nt(C+t,0,b),i.moveCursorToPosition(C,l,o,!1),i.setViewState({left:C})}else if(f&&n!==0){const{lastTop:b}=i.metrics;let{top:C}=i.state;C=nt(C+n,0,b),i.moveCursorToPosition(C,a,o,!1),i.setViewState({top:C})}else i.moveCursor(t,n,o)}return!0}handlePageUp(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{cursorColumn:i,selectionEndRow:o}=n.state,r=o,l=i;if(r==null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m}=c.getMetrics(a);let p=r-(d-h);p-=m?0:1,p=Math.max(p,0);const g=Math.max(p-(r-h),0);return n.moveCursorToPosition(l,p,s,!1),n.setViewState({top:g}),!0}handlePageDown(t,n){const s=t.shiftKey;s?n.trimSelectedRanges():n.clearSelectedRanges();const{selectionEndRow:i,cursorColumn:o}=n.state,r=i,l=o;if(r===null)return!1;const a=n.getMetricState(),{metricCalculator:c}=n,{bottomVisible:d,topVisible:h,hasHorizontalBar:m,rowCount:p,lastTop:g}=c.getMetrics(a),f=p-1;let b=d-h+r;b+=m?0:1,b=Math.min(b,f);const C=Math.min(g,b-(r-h));return n.moveCursorToPosition(l,b,s,!1),n.setViewState({top:C}),!0}}class Sh extends ns{onDown(t,n){switch(t.key){case"Enter":case" ":return this.handleExpandKey(t,n)}return!1}handleExpandKey(t,n){const{selectedRanges:s}=n.state;if(s.length===1){const i=s[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!n.metrics)throw new Error("grid.metrics not set");const{model:o}=n.props,{startRow:r,startColumn:l}=i;if(r!=null){const a=n.getModelRow(r);if((l===0||l==null)&&qe(o)&&o.isRowExpandable(a))return n.toggleRowExpanded(r),!0}}}return!1}}class vh extends ns{onDown(t,n){if(V.isModifierKeyDown(t))return!1;const{model:s}=n.props,{cursorColumn:i,cursorRow:o}=n.state;if(i==null||o==null||!Fe(s)||!s.isEditableRange(X.makeCell(i,o)))return!1;const r=i,l=o;return r==null||l==null?!1:t.key.length===1?(n.startEditing(r,l,!0,[1,1],t.key),!0):t.key==="F2"?(n.startEditing(r,l),!0):t.key==="Backspace"?(n.startEditing(r,l,!0,void 0,""),!0):t.key==="Delete"?(n.setValueForCell(r,l,""),!0):!1}}function Th(e){var s,i;const t=[],n=e.querySelectorAll("tr");for(let o=0;o<n.length;o+=1){const l=n[o].querySelectorAll("td"),a=[];for(let c=0;c<l.length;c+=1){const d=l[c];a.push((i=(s=d.textContent)==null?void 0:s.trim())!=null?i:"")}t.push(a)}return t}function Eh(e){const t=[];return e.forEach(n=>{var i;const s=(i=n.textContent)!=null?i:"";s.length>0&&t.push(s.split(/\t|\u00a0\u00a0 \u00a0/))}),t}function Rh(e){var s,i,o;const t=e.querySelector("table");if(t!=null)return Th(t);const n=(i=(s=e.textContent)==null?void 0:s.trim())!=null?i:"";if(n.length>0){const{childNodes:r}=e,l=n.includes(" "),a=n.includes("\xA0\xA0 \xA0");return l&&r.length!==0&&(r.length===1||r.length>1&&!((o=r[0].textContent)!=null&&o.includes(" ")))?n.split(`
|
|
2
2
|
`).map(c=>c.split(" ")):r.length>1||a?Eh(e.childNodes):n}return null}class yh extends ns{onDown(t,n){switch(t.key){case"v":if(V.isModifierKeyDown(t)){const s=document.createElement("div");document.body.appendChild(s),s.setAttribute("contenteditable","true"),s.setAttribute("style",'clip-path: "inset(50%)"; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding 0; position: absolute;');const i=()=>{s.removeEventListener("input",i),s.remove(),n.focus();const o=Rh(s);o!=null&&n.pasteValue(o)};return s.addEventListener("input",i),s.focus(),{preventDefault:!1,stopPropagation:!0}}break}return!1}}const Ih=e=>{switch(e){case"ArrowDown":return Dt.DOWN;case"ArrowUp":return Dt.UP;case"ArrowLeft":return Dt.LEFT;case"ArrowRight":return Dt.RIGHT;default:return}},Xo=({selectionRange:e=void 0,className:t="",disabled:n=!1,value:s="",isQuickEdit:i=!0,onChange:o=()=>{},onCancel:r=()=>{},onDone:l=()=>{},onContextMenu:a=()=>{},style:c={}})=>{const d=R.exports.useRef(null),h=R.exports.useRef(!1),[m]=R.exports.useState(s),[p,g]=R.exports.useState(!1),[f,b]=R.exports.useState(i),[C,w]=R.exports.useState(s);R.exports.useEffect(function(){const{current:N}=d;N!=null&&(N.focus(),e?N.setSelectionRange(e[0],e[1]):N.setSelectionRange(N.value.length,N.value.length))},[e]);const T=R.exports.useCallback(A=>{o(A)},[o]),y=R.exports.useCallback(A=>{const{value:N}=A.target;w(N),g(!0),T(N)},[T,w,g]),S=R.exports.useCallback(()=>{h.current=!0,p&&T(m),g(!1),r()},[m,p,r,T]),E=R.exports.useCallback(()=>{b(!1)},[b]),I=R.exports.useCallback((A,N=!1)=>{l(C,{direction:A,fillRange:N})},[l,C]),D=R.exports.useCallback(()=>{h.current||I(null)},[h,I]),k=R.exports.useCallback(A=>{switch(A.stopPropagation(),A.key){case"Escape":A.preventDefault(),S();break;case"Enter":if(A.preventDefault(),V.isModifierKeyDown(A))I(void 0,!0);else if(A.altKey){const N=`${C}
|
|
3
3
|
`;w(N),g(!0),T(N)}else I(A.shiftKey?Dt.UP:Dt.DOWN);break;case"Tab":A.preventDefault(),I(A.shiftKey?Dt.LEFT:Dt.RIGHT);break;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":f&&(A.preventDefault(),I(Ih(A.key)));break}},[S,I,f,w,g,T,C]),H=R.exports.useCallback(A=>{a(A)},[a]);return u("textarea",{ref:d,className:W("grid-cell-input-field",t),value:C,onBlur:D,onChange:y,onKeyDown:k,onContextMenu:H,onClick:E,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:n,style:c})};Xo.propTypes={selectionRange:M.exports.arrayOf(M.exports.number),className:M.exports.string,disabled:M.exports.bool,isQuickEdit:M.exports.bool,value:M.exports.string,onChange:M.exports.func,onCancel:M.exports.func,onDone:M.exports.func,onContextMenu:M.exports.func,style:M.exports.shape({})};Xo.defaultProps={selectionRange:null,className:"",disabled:!1,value:"",isQuickEdit:!0,onChange:()=>{},onCancel:()=>{},onDone:()=>{},onContextMenu:()=>{},style:{}};const Mh=Q.createContext({}),$n=class extends R.exports.PureComponent{constructor(e){super(e),this.getCachedKeyHandlers=xe(l=>[...l,...this.keyHandlers].sort((a,c)=>a.order-c.order)),this.getCachedMouseHandlers=xe(l=>[...l,...this.mouseHandlers].sort((a,c)=>a.order-c.order)),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleEditCellCancel=this.handleEditCellCancel.bind(this),this.handleEditCellChange=this.handleEditCellChange.bind(this),this.handleEditCellCommit=this.handleEditCellCommit.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseDrag=this.handleMouseDrag.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleResize=this.handleResize.bind(this),this.handleWheel=this.handleWheel.bind(this);const{isStuckToBottom:t,isStuckToRight:n,metricCalculator:s,movedColumns:i,movedRows:o,renderer:r}=e;this.renderer=r||new ms,this.metricCalculator=s||new Vs,this.canvas=null,this.canvasContext=null,this.animationFrame=null,this.prevMetrics=null,this.metrics=null,this.documentCursor=null,this.dragTimer=null,this.keyHandlers=[new vh(400),new yh(450),new wh(500),new Sh(900)],this.mouseHandlers=[new Ko(100),new Pi(200),new fh(300),new gh(400),new bh(450),new Yo(500),new qo(600),new Ch(700),new Ti(800),new mh(900)],this.state={top:0,left:0,topOffset:0,leftOffset:0,draggingColumn:null,draggingRow:null,draggingRowOffset:null,draggingColumnSeparator:null,draggingRowSeparator:null,isDraggingHorizontalScrollBar:!1,isDraggingVerticalScrollBar:!1,isDragging:!1,mouseX:null,mouseY:null,movedColumns:i,movedRows:o,cursorRow:null,cursorColumn:null,selectionStartRow:null,selectionStartColumn:null,selectionEndRow:null,selectionEndColumn:null,selectedRanges:[],lastSelectedRanges:[],cursor:null,editingCell:null,isStuckToBottom:t,isStuckToRight:n}}static getScale(e){const t=window.devicePixelRatio||1,n=e,s=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return t/s}static getCursorClassName(e){return e?`grid-cursor-${e}`:null}componentDidMount(){var e;this.initContext(),(e=this.canvas)==null||e.addEventListener("wheel",this.handleWheel,{passive:!1}),window.addEventListener("resize",this.handleResize),this.updateCanvasScale(),this.updateCanvas()}componentDidUpdate(e,t){const{isStickyBottom:n,isStickyRight:s,movedColumns:i,movedRows:o,onMovedColumnsChanged:r,onMoveColumnComplete:l,onMovedRowsChanged:a,onMoveRowComplete:c}=this.props,{isStickyBottom:d,isStickyRight:h,movedColumns:m,movedRows:p}=e,{movedColumns:g,movedRows:f}=t,{draggingColumn:b,draggingRow:C,movedColumns:w,movedRows:T}=this.state;if(m!==i&&this.setState({movedColumns:i}),p!==o&&this.setState({movedRows:o}),g!==w&&r(w),t.draggingColumn!=null&&b==null&&l(w),f!==T&&a(T),t.draggingRow!=null&&C==null&&c(T),n!==d&&this.setState({isStuckToBottom:!1}),s!==h&&this.setState({isStuckToRight:!1}),this.updateMetrics(),this.requestUpdateCanvas(),!this.metrics||!this.prevMetrics)return;const{bottomVisible:y,rightVisible:S,rowCount:E,columnCount:I,top:D,left:k,height:H,width:A}=this.metrics,{rowCount:N,columnCount:B,height:U,width:L}=this.prevMetrics,_=this.getMetricState();if(N!==E||H!==U){const $=this.metricCalculator.getLastTop(_),{isStuckToBottom:K}=this.state;(K&&y<E-1&&y>0||D>$)&&this.setState({top:$})}if(B!==I||A!==L){const $=this.metricCalculator.getLastLeft(_),{isStuckToRight:K}=this.state;(K&&S<I-1&&S>0||k>$)&&this.setState({left:$})}this.validateSelection()&&this.checkSelectionChange(t)}componentWillUnmount(){var e;this.animationFrame!=null&&cancelAnimationFrame(this.animationFrame),(e=this.canvas)==null||e.removeEventListener("wheel",this.handleWheel),window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("resize",this.handleResize),this.stopDragTimer()}getTheme(){const{theme:e}=this.props;return $n.getTheme(this.context,e)}getGridPointFromEvent(e){Lr(this.canvas);const t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return this.getGridPointFromXY(n,s)}getGridPointFromXY(e,t){if(!this.metrics)throw new Error("metrics must be set");return V.getGridPointFromXY(e,t,this.metrics)}getMetricState(e=this.state){const t=this.getTheme(),{model:n,stateOverride:s}=this.props;if(!this.canvasContext||!this.canvas)throw new Error("Canvas and context must be defined to get metrics");const i=this.canvasContext,o=this.canvas.clientWidth,r=this.canvas.clientHeight,{left:l,top:a,leftOffset:c,topOffset:d,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f}=e;return{left:l,top:a,leftOffset:c,topOffset:d,width:o,height:r,context:i,theme:t,model:n,movedColumns:h,movedRows:m,isDraggingHorizontalScrollBar:p,isDraggingVerticalScrollBar:g,draggingColumn:f,...s}}getKeyHandlers(){const{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}getMouseHandlers(){const{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getModelColumn(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelColumns)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for column ${e}`);return t}getModelRow(e){var n,s;const t=(s=(n=this.metrics)==null?void 0:n.modelRows)==null?void 0:s.get(e);if(t===void 0)throw new Error(`Unable to get ModelIndex for row ${e}`);return t}toggleRowExpanded(e){const t=this.getModelRow(e),{model:n}=this.props;qe(n)&&n.isRowExpandable(t)&&n.setRowExpanded(t,!n.isRowExpanded(t)),this.clearSelectedRanges(),this.commitSelection(),this.moveCursorToPosition(0,e),this.commitSelection(),this.setState({isStuckToBottom:!1})}setSelectedRanges(e){const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state;if(this.setState({selectedRanges:e,lastSelectedRanges:r}),e.length>0){const l=X.boundedRange(e[0],n,s);let a=i,c=o;l.containsCell(o,i)||({row:a,column:c}=l.startCell()),this.setState({selectionStartColumn:l.startColumn,selectionStartRow:l.startRow,selectionEndColumn:l.endColumn,selectionEndRow:l.endRow,cursorColumn:c,cursorRow:a})}}initContext(){const{canvas:e}=this,{canvasOptions:t}=this.props;if(!e)throw new Error("Canvas not set");this.canvasContext=e.getContext("2d",t)}requestUpdateCanvas(){this.animationFrame==null&&(this.animationFrame=requestAnimationFrame(()=>{if(this.animationFrame=null,!this.metrics)throw new Error("Metrics not set");this.updateCanvas(this.metrics)}))}updateCanvas(e=this.updateMetrics()){this.updateCanvasScale();const{onViewChanged:t}=this.props;t(e),this.drawCanvas(e)}updateCanvasScale(){const{canvas:e,canvasContext:t}=this;if(!e)throw new Error("canvas not set");if(!t)throw new Error("canvasContext not set");if(!e.parentElement)throw new Error("Canvas has no parent element");const n=$n.getScale(t),s=e.parentElement.getBoundingClientRect(),i=Math.floor(s.width),o=Math.floor(s.height);e.style.width=`${i}px`,e.style.height=`${o}px`,e.width=i*n,e.height=o*n,t.scale(n,n)}updateMetrics(e=this.state){this.prevMetrics=this.metrics;const{metricCalculator:t}=this,n=this.getMetricState(e);return this.metrics=t.getMetrics(n),this.metrics}checkSelectionChange(e){const{selectedRanges:t}=e,{selectedRanges:n}=this.state;if(n!==t){const{onSelectionChanged:s}=this.props;s(n)}}validateSelection(){const{model:e}=this.props,{selectedRanges:t}=this.state,{columnCount:n,rowCount:s}=e;for(let i=0;i<t.length;i+=1){const o=t[i];if(o.endColumn!=null&&o.endColumn>=n||o.endRow!=null&&o.endRow>=s)return this.setState({selectedRanges:[],lastSelectedRanges:[]}),!1}return!0}clearSelectedRanges(){const{selectedRanges:e}=this.state;this.setState({selectedRanges:[],lastSelectedRanges:e})}trimSelectedRanges(){const{selectedRanges:e}=this.state;e.length>0&&this.setState({selectedRanges:e.slice(e.length-1)})}beginSelection(e,t){this.setState({selectionStartColumn:e,selectionStartRow:t,selectionEndColumn:e,selectionEndRow:t,cursorColumn:e,cursorRow:t})}moveSelection(e,t,n=!1,s=!1){this.setState(i=>{var g,f,b,C;const{selectedRanges:o,selectionStartRow:r,selectionStartColumn:l}=i,{theme:a}=this.props,{autoSelectRow:c,autoSelectColumn:d}=a;if(n&&o.length>0){const w=o[o.length-1];let T=null,y=null,S=null,E=null;s?(T=c?null:Math.min(e!=null?e:0,(g=w.startColumn)!=null?g:0),y=d?null:Math.min(t!=null?t:0,(f=w.startRow)!=null?f:0),S=c?null:Math.max(e!=null?e:0,(b=w.endColumn)!=null?b:0),E=d?null:Math.max(t!=null?t:0,(C=w.endRow)!=null?C:0)):(T=w.startColumn,y=w.startRow,(l!=null||r!=null)&&(c||(T=l),d||(y=r)),S=c?null:e,E=d?null:t);const I=X.makeNormalized(T,y,S,E);if(w.equals(I))return null;const D=[...o];return D[D.length-1]=I,{selectedRanges:D,selectionEndColumn:e,selectionEndRow:t}}const h=[...o],m=c?null:e,p=d?null:t;return h.push(X.makeNormalized(m,p,m,p)),{selectedRanges:h,selectionEndColumn:e,selectionEndRow:t}})}commitSelection(){this.setState(e=>{const{theme:t}=this.props,{autoSelectRow:n}=t,{selectedRanges:s,lastSelectedRanges:i,cursorRow:o,cursorColumn:r}=e;if(s.length===1&&(n?X.rowCount(s)===1:X.cellCount(s)===1)&&X.rangeArraysEqual(s,i))return{selectedRanges:[],lastSelectedRanges:[],cursorColumn:r,cursorRow:o};let l=s.slice();if(l.length>1){const d=l[l.length-1];for(let h=0;h<l.length-1;h+=1){const m=l[h];if(m.contains(d)){const p=m.subtract(d);l.pop(),l.splice(h,1),l=l.concat(p);break}}l=X.consolidate(l)}let a=r,c=o;if(!X.containsCell(l,r,o)){const{model:d}=this.props,{columnCount:h,rowCount:m}=d,p=X.nextCell(X.boundedRanges(s,h,m));p!=null?{column:a,row:c}=p:(a=null,c=null)}return{cursorRow:c,cursorColumn:a,selectedRanges:l,lastSelectedRanges:s}})}setFocusRow(e){var h;if(!this.metrics||!this.prevMetrics)return;const{gridY:t,height:n,lastTop:s,userRowHeights:i,rowHeight:o}=this.metrics,r=n-t,l=Math.round(r/2)+((h=i.get(e))!=null?h:o),a=this.getMetricState(),c=this.metricCalculator.getLastTop(a,e+1,l);this.setState({top:Math.min(s,c),selectedRanges:[new X(null,e,null,e)]});const{cursorColumn:d}=this.state;this.moveCursorToPosition(d,e,!1,!1)}selectAll(){const{model:e,theme:t}=this.props,{autoSelectRow:n,autoSelectColumn:s}=t,i=s?null:0,o=s?null:e.rowCount-1,r=n?null:0,l=n?null:e.columnCount-1;this.setSelectedRanges([new X(r,i,l,o)])}moveCursor(e,t,n){const{cursorRow:s,cursorColumn:i,selectionEndColumn:o,selectionEndRow:r}=this.state,l=n?o:i,a=n?r:s;if(a===null||l===null){const{left:c,top:d}=this.state;this.moveCursorToPosition(c,d,n)}else{const{model:c}=this.props,{columnCount:d,rowCount:h}=c,m=nt(l+e,0,d-1),p=nt(a+t,0,h-1);this.moveCursorToPosition(m,p,n)}}moveCursorInDirection(e=X.SELECTION_DIRECTION.DOWN){var c;const{model:t}=this.props,{columnCount:n,rowCount:s}=t,{cursorRow:i,cursorColumn:o,selectedRanges:r}=this.state,l=r.length>0?r:[X.makeCell(o,i)];let a=null;if(l.length===1&&X.cellCount(l)===1){const d=new X(0,0,n-1,s-1);a=(c=d.nextCell(o,i,e))!=null?c:d.startCell(e)}else a=X.nextCell(X.boundedRanges(l,n,s),o,i,e);if(a!=null){const{column:d,row:h}=a;this.setState({cursorColumn:d,cursorRow:h}),X.containsCell(r,d,h)||this.setState({selectedRanges:[X.makeCell(d,h)],selectionStartColumn:d,selectionStartRow:h,selectionEndColumn:d,selectionEndRow:h}),this.moveViewToCell(a.column,a.row)}}moveCursorToPosition(e,t,n=!1,s=!0,i=!1){n||this.beginSelection(e,t),this.moveSelection(e,t,n,i),s&&this.moveViewToCell(e,t)}moveViewToCell(e,t){if(!this.metrics)throw new Error("metrics not set");const{metricCalculator:n}=this,{bottomVisible:s,rightVisible:i,topVisible:o,leftVisible:r}=this.metrics,l=this.getMetricState(this.state);let{top:a,left:c,topOffset:d,leftOffset:h}=this.state;t!=null&&!V.isFloatingRow(t,this.metrics)&&(t<o?(a=n.getTopForTopVisible(l,t),d=0):t>s&&(a=n.getTopForBottomVisible(l,t),d=0)),e!=null&&!V.isFloatingColumn(e,this.metrics)&&(e<r?(c=n.getLeftForLeftVisible(l,e),h=0):e>i&&(c=n.getLeftForRightVisible(l,e),h=0)),this.setViewState({top:a,left:c,topOffset:d,leftOffset:h})}setViewState(e,t=!1){if(!this.metrics)throw new Error("metrics not set");const{isStickyBottom:n,isStickyRight:s}=this.props,{top:i,left:o}=e,{lastTop:r,lastLeft:l}=this.metrics;i!=null&&this.setState({isStuckToBottom:n&&i>=r}),o!=null&&this.setState({isStuckToRight:s&&o>=l}),this.setState(e),t&&this.forceUpdate()}startEditing(e,t,n=!1,s,i){const{model:o}=this.props;if(!Fe(o))throw new Error("model is not editable");const r=this.getModelColumn(e),l=this.getModelRow(t),a={column:e,row:t,selectionRange:s,value:i!==void 0?i:o.editValueForCell(r,l),isQuickEdit:n};this.setState({editingCell:a,cursorColumn:e,cursorRow:t}),this.moveViewToCell(e,t)}isValidForCell(e,t,n){const{model:s}=this.props,i=this.getModelColumn(e),o=this.getModelRow(t);return Fe(s)&&s.isValidForCell(i,o,n)}async pasteValue(e){const{model:t}=this.props,{movedColumns:n,movedRows:s,selectedRanges:i}=this.state;try{if(Hr(t),!t.isEditable||!i.every(h=>t.isEditableRange(h)))throw new io("Can't paste in to read-only area.");if(i.length<=0)throw new io("Select an area to paste to.");if(typeof e=="string"){const h=[],m=V.getModelRanges(i,n,s);X.forEachCell(m,(p,g)=>{h.push({column:p,row:g,text:e})}),await t.setValues(h);return}const o=e.length,r=e[0].length,{columnCount:l,rowCount:a}=t;let c=i;if(c.every(h=>{var m,p;return X.cellCount([h])===1&&((m=h.startColumn)!=null?m:0)+r<=l&&((p=h.startRow)!=null?p:0)+o<=a})&&(c=c.map(h=>{var m,p;return new X(h.startColumn,h.startRow,((m=h.startColumn)!=null?m:0)+r-1,((p=h.startRow)!=null?p:0)+o-1)}),this.setSelectedRanges(c)),!c.every(h=>X.rowCount([h])===o&&X.columnCount([h])===r))throw new io("Copy and paste area are not same size.");const d=[];c.forEach(h=>{var m,p;for(let g=0;g<r;g+=1)for(let f=0;f<o;f+=1)d.push({column:((m=h.startColumn)!=null?m:0)+g,row:((p=h.startRow)!=null?p:0)+f,text:e[f][g]})}),await t.setValues(d)}catch(o){const{onError:r}=this.props;r(o instanceof Error?o:new Error(`${o}`))}}setValueForCell(e,t,n){const{model:s}=this.props;Hr(s);const i=this.getModelColumn(e),o=this.getModelRow(t);return s.isValidForCell(i,o,n)?(s.setValueForCell(i,o,n),!0):!1}setValueForRanges(e,t){const{model:n}=this.props,{movedColumns:s,movedRows:i}=this.state,o=V.getModelRanges(e,s,i);Fe(n)&&n.setValueForRanges(o,t)}isSelected(e,t){var s,i;const{selectedRanges:n}=this.state;for(let o=0;o<n.length;o+=1){const r=n[o],l=r.startRow===null||r.startRow<=e&&e<=((s=r.endRow)!=null?s:0),a=r.startColumn===null||r.startColumn<=t&&t<=((i=r.endColumn)!=null?i:0);if(l&&a)return!0}return!1}addDocumentCursor(e=null){this.documentCursor!==$n.getCursorClassName(e)&&(this.documentCursor&&document.documentElement.classList.remove(this.documentCursor),this.documentCursor=$n.getCursorClassName(e),this.documentCursor&&document.documentElement.classList.add(this.documentCursor),document.documentElement.classList.add("grid-block-events"))}removeDocumentCursor(){this.documentCursor&&(document.documentElement.classList.remove(this.documentCursor),document.documentElement.classList.remove("grid-block-events"),this.documentCursor=null)}startDragTimer(e){this.stopDragTimer();const t=new MouseEvent("custom",e.nativeEvent);this.dragTimer=setTimeout(()=>{this.handleMouseDrag(t)},$n.dragTimeout)}stopDragTimer(){this.dragTimer&&(clearTimeout(this.dragTimer),this.dragTimer=null)}drawCanvas(e=this.updateMetrics()){if(!this.canvas)throw new Error("canvas is not set");if(!this.canvasContext)throw new Error("context not set");const{left:t,top:n,cursorColumn:s,cursorRow:i,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,mouseX:g,mouseY:f,selectedRanges:b}=this.state,{model:C,stateOverride:w}=this.props,{renderer:T}=this,y=this.canvasContext,S=this.getTheme(),E=this.canvas.clientWidth,I=this.canvas.clientHeight,D={left:t,top:n,width:E,height:I,context:y,theme:S,model:C,metrics:e,mouseX:g,mouseY:f,selectedRanges:b,draggingColumn:o,draggingColumnSeparator:r,draggingRow:l,draggingRowOffset:a,draggingRowSeparator:c,editingCell:d,isDraggingHorizontalScrollBar:h,isDraggingVerticalScrollBar:m,isDragging:p,cursorColumn:s,cursorRow:i,...w};y.save(),T.drawCanvas(D),y.restore()}focus(){var e;(e=this.canvas)==null||e.focus()}isFocused(){return document.activeElement===this.canvas}handleClick(e){var s;const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let i=0;i<n.length;i+=1)if(n[i].onClick(t,this,e)){e.stopPropagation(),e.preventDefault();break}(s=this.canvas)==null||s.focus()}handleContextMenu(e){const t=this.getGridPointFromEvent(e),n=this.getMouseHandlers();for(let s=0;s<n.length;s+=1)if(n[s].onContextMenu(t,this,e)){e.stopPropagation(),e.preventDefault();break}}handleKeyDown(e){var n,s;const t=this.getKeyHandlers();for(let i=0;i<t.length;i+=1){const r=t[i].onDown(e,this);if(r){const l=r;((n=l==null?void 0:l.stopPropagation)==null||n)&&e.stopPropagation(),((s=l==null?void 0:l.preventDefault)==null||s)&&e.preventDefault();break}}}notifyMouseHandlers(e,t,n=!0,s=!1){var l,a;const i=this.getGridPointFromEvent(t),o=this.getMouseHandlers();let r=null;for(let c=0;c<o.length;c+=1){const d=o[c],h=d[e]&&d[e](i,this,t);if(h){d.cursor!=null&&({cursor:r}=d,s&&this.addDocumentCursor(r));const m=h;((l=m==null?void 0:m.stopPropagation)==null||l)&&t.stopPropagation(),((a=m==null?void 0:m.preventDefault)==null||a)&&t.preventDefault();break}}if(this.setState({cursor:r}),n){const{x:c,y:d}=i;this.setState({mouseX:c,mouseY:d})}}handleMouseDown(e){window.addEventListener("mousemove",this.handleMouseDrag,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onDown",e),this.startDragTimer(e))}handleDoubleClick(e){this.notifyMouseHandlers("onDoubleClick",e)}handleMouseMove(e){this.notifyMouseHandlers("onMove",e)}handleMouseLeave(e){this.notifyMouseHandlers("onLeave",e,!1),this.setState({mouseX:null,mouseY:null})}handleMouseDrag(e){this.setState({isDragging:!0}),this.notifyMouseHandlers("onDrag",e,!0,!0),this.stopDragTimer()}handleMouseUp(e){window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onUp",e,!1),this.stopDragTimer(),this.removeDocumentCursor())}handleResize(){if(this.updateCanvasScale(),this.updateCanvas(),!this.metrics)throw new Error("metrics not set");const{left:e,top:t}=this.state,{lastLeft:n,lastTop:s}=this.metrics;e>n&&this.setState({left:n,leftOffset:0}),t>s&&this.setState({top:s,topOffset:0}),this.forceUpdate()}handleWheel(e){var S,E,I,D;if(this.notifyMouseHandlers("onWheel",e),e.defaultPrevented)return;const{metricCalculator:t,metrics:n}=this,s=this.getMetricState();if(!n)throw new Error("metrics not set");const{lastTop:i,lastLeft:o,columnCount:r,rowCount:l,scrollableContentWidth:a,scrollableViewportWidth:c,scrollableContentHeight:d,scrollableViewportHeight:h,hasHorizontalBar:m,hasVerticalBar:p}=n;let{top:g,left:f,topOffset:b,leftOffset:C}=n;const w=this.getTheme();let{deltaX:T,deltaY:y}=V.getScrollDelta(e,n.barWidth,n.barHeight,n.rowHeight,n.rowHeight);for(;m&&T!==0;){if(C+=T,T=0,r>1){if(C>0&&f>=o||C<0&&f<=0){C=0;break}}else{if(C<=0){C=0;break}const k=a-c;if(C>=k){C=k;break}}if(C>0){const k=(S=n.visibleColumnWidths.get(f))!=null?S:t.getVisibleColumnWidth(f,s);C>=k?(T=C-k,C=0,f+=1):w.scrollSnapToColumn&&r>1&&(C=0,f+=1)}else if(C<0){const k=(E=n.visibleColumnWidths.get(f-1))!=null?E:t.getVisibleColumnWidth(f-1,s);Math.abs(C)<=k&&w.scrollSnapToColumn&&r>1?(C=0,f-=1):(T=C+k,C=0,f-=1)}}for(;p&&y!==0;){if(b+=y,y=0,l>1){if(b>0&&g>=i||b<0&&g<=0){b=0;break}}else{if(b<=0){b=0;break}const k=d-h;if(b>=k){b=k;break}}if(b>0){const k=(I=n.visibleRowHeights.get(g))!=null?I:t.getVisibleRowHeight(g,s);b>=k?(y=b-k,b=0,g+=1):w.scrollSnapToRow&&l>1&&(b=0,g+=1)}else if(b<0){const k=(D=n.visibleRowHeights.get(g-1))!=null?D:t.getVisibleRowHeight(g-1,s);Math.abs(b)<=k&&w.scrollSnapToRow&&l>1?(b=0,g-=1):(y=b+k,b=0,g-=1)}}this.setViewState({top:g,left:f,leftOffset:C,topOffset:b}),e.stopPropagation(),e.preventDefault()}handleEditCellCancel(){this.setState({editingCell:null}),this.focus()}handleEditCellChange(e){this.setState(({editingCell:t})=>{try{return Lr(t),{editingCell:{...t,value:e}}}catch(n){const{onError:s}=this.props;return s(n instanceof Error?n:new Error(`${n}`)),null}})}handleEditCellCommit(e,{direction:t=Dt.DOWN,fillRange:n=!1}={}){const{editingCell:s,selectedRanges:i}=this.state;if(!s)throw new Error("editingCell not set");const{column:o,row:r}=s;if(!this.isValidForCell(o,r,e)){t===null&&this.setState({editingCell:null});return}n?this.setValueForRanges(i,e):this.setValueForCell(o,r,e),t!==null&&this.moveCursorInDirection(t),this.setState({editingCell:null}),this.focus()}renderInputField(){const{model:e}=this.props,{editingCell:t}=this.state,{metrics:n}=this;if(t==null||n==null||!Fe(e))return null;const{selectionRange:s,value:i,isQuickEdit:o}=t,{column:r,row:l}=t,{gridX:a,gridY:c,visibleColumnXs:d,visibleRowYs:h,visibleColumnWidths:m,visibleRowHeights:p}=n,g=d.get(r),f=h.get(l),b=m.get(r),C=p.get(l),w=g!=null&&f!=null&&b!=null&&C!=null?{position:"absolute",left:a+g,top:c+f,width:b,height:C}:{opacity:0},T=this.getModelColumn(r),y=this.getModelRow(l),S=T!=null&&y!=null?{textAlign:e.textAlignForCell(T,y)}:void 0,E=e.isValidForCell(T,y,i);return u("div",{style:w,children:u(Xo,{selectionRange:s,className:W({error:!E}),onCancel:this.handleEditCellCancel,onChange:this.handleEditCellChange,onDone:this.handleEditCellCommit,isQuickEdit:o,style:S,value:i},`${r},${l}`)})}render(){const{cursor:e}=this.state;return v(Ie,{children:[u("canvas",{className:W("grid-canvas",$n.getCursorClassName(e)),ref:t=>{this.canvas=t},onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDoubleClick:this.handleDoubleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,tabIndex:0,children:"Your browser does not support HTML canvas. Update your browser?"}),this.renderInputField()]})}};let bs=$n;bs.contextType=Mh;bs.defaultProps={canvasOptions:{alpha:!1},isStickyBottom:!1,isStickyRight:!1,isStuckToBottom:!1,isStuckToRight:!1,keyHandlers:[],mouseHandlers:[],movedColumns:[],movedRows:[],onError:()=>{},onSelectionChanged:()=>{},onMovedColumnsChanged:e=>{},onMoveColumnComplete:()=>{},onMovedRowsChanged:()=>{},onMoveRowComplete:()=>{},onViewChanged:()=>{},stateOverride:{},theme:{autoSelectColumn:!1,autoSelectRow:!1}};bs.pixelsPerLine=100/3;bs.dragTimeout=1e3;bs.getTheme=xe((e,t)=>({...ch,...e,...t}));class Kl extends Mo{get floatingTopRowCount(){return 0}get floatingBottomRowCount(){return 0}get floatingLeftColumnCount(){return 0}get floatingRightColumnCount(){return 0}get columnHeaderMaxDepth(){return 1}truncationCharForCell(t,n){}textAlignForCell(t,n){return"left"}colorForCell(t,n,s){return s.textColor}backgroundColorForCell(t,n,s){return null}colorForColumnHeader(t,n=0){return null}textForRowHeader(t){return""}textForRowFooter(t){return""}isColumnMovable(t,n=0){return!0}isRowMovable(t){return!0}getColumnHeaderGroup(t,n){}getColumnHeaderParentGroup(t,n){}}class Nh extends Kl{constructor({rowCount:t=1e9,columnCount:n=100,floatingTopRowCount:s=0,floatingBottomRowCount:i=0,floatingLeftColumnCount:o=0,floatingRightColumnCount:r=0,isEditable:l=!1,editedData:a=[]}={}){super(),this.numRows=t,this.numColumns=n,this.floatingTop=s,this.floatingBottom=i,this.floatingLeft=o,this.floatingRight=r,this.editable=l,this.editedData=a}get rowCount(){return this.numRows}get columnCount(){return this.numColumns}get floatingTopRowCount(){return this.floatingTop}get floatingBottomRowCount(){return this.floatingBottom}get floatingLeftColumnCount(){return this.floatingLeft}get floatingRightColumnCount(){return this.floatingRight}get isEditable(){return this.editable}textForCell(t,n){var s,i;return(i=(s=this.editedData[t])==null?void 0:s[n])!=null?i:`${t},${n}`}colorForCell(t,n,s){return s.textColor}textForColumnHeader(t,n=0){return`${t}`}textForRowHeader(t){return`${t}`}textForRowFooter(t){return`${t}`}async setValueForCell(t,n,s){this.editedData[t]==null&&(this.editedData[t]=[]),this.editedData[t][n]=`${s}`}async setValueForRanges(t,n){X.forEachCell(t,(s,i)=>{this.setValueForCell(s,i,n)})}async setValues(t){var n,s;for(let i=0;i<t.length;i+=1){const o=t[i];this.setValueForCell((n=o.column)!=null?n:o.x,(s=o.row)!=null?s:o.y,o.text)}}editValueForCell(t,n){return this.textForCell(t,n)}isValidForCell(t,n,s){return!0}isEditableRange(t){return this.isEditable}delete(t){throw new Error("Method not implemented.")}}const Gn=class extends Nh{constructor({rowCount:e=Gn.DEFAULT_ROW_COUNT,columnCount:t=Gn.DEFAULT_COLUMN_COUNT,children:n=new Map,childRowCount:s=Math.ceil(Math.max(Gn.MIN_CHILD_ROW_COUNT,e*Gn.DEFAULT_CHILD_ROW_COUNT_FACTOR)),maxDepth:i=Gn.MAX_DEPTH}={}){super({rowCount:e,columnCount:t}),this.getCachedModelRowOffset=Ct((o,r)=>{let l=null,a=r;const c=[...o].sort((d,h)=>d[0]-h[0]);for(let d=0;d<c.length;d+=1){const[h,m]=c[d];if(a<=h)break;const p=m.rowCount;if(a<=h+p){l=h,a=a-h-1;break}a-=p}return{key:l,offsetRow:a}}),this.getCachedTextForRowHeader=Ct((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return`${l}.${c.textForRowHeader(a)}`}return`${a}`}),this.getCachedTextForCell=Ct((o,r,l)=>{const{key:a,offsetRow:c}=this.getCachedModelRowOffset(o,l);if(a!=null){const d=o.get(a);if(d!==void 0)return`${a}.${d.textForCell(r,c)}`}return`${r},${c}`}),this.getCachedIsRowExpandable=Ct((o,r,l)=>this.getCachedDepthForRow(o,r)<l),this.getCachedIsRowExpanded=Ct((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.isRowExpanded(a)}return o.has(a)}),this.getCachedDepthForRow=Ct((o,r)=>{const{key:l,offsetRow:a}=this.getCachedModelRowOffset(o,r);if(l!=null){const c=o.get(l);if(c!==void 0)return c.depthForRow(a)+1}return 0}),this.children=n,this.childRowCount=s,this.maxDepth=i}textForCell(e,t){return this.getCachedTextForCell(this.children,e,t)}textForRowHeader(e){return this.getCachedTextForRowHeader(this.children,e)}isRowMovable(e){return!1}get hasExpandableRows(){return!0}get floatingBottomRowCount(){return 0}isRowExpandable(e){return this.getCachedIsRowExpandable(this.children,e,this.maxDepth)}isRowExpanded(e){return this.getCachedIsRowExpanded(this.children,e)}setRowExpanded(e,t){const{key:n,offsetRow:s}=this.getCachedModelRowOffset(this.children,e),i=new Map(this.children);if(n!=null){const o=this.children.get(n);if(o!==void 0){const{rowCount:r}=o;o.setRowExpanded(s,t),this.numRows+=o.rowCount-r}}else if(t){const o=new Gn({rowCount:this.childRowCount,columnCount:this.numColumns});i.set(s,o),this.numRows+=o.rowCount}else{const o=i.get(s);o!==void 0&&(this.numRows-=o.rowCount,i.delete(s))}this.children=i}depthForRow(e){return this.getCachedDepthForRow(this.children,e)}};let Us=Gn;Us.DEFAULT_ROW_COUNT=1e9;Us.DEFAULT_COLUMN_COUNT=100;Us.DEFAULT_CHILD_ROW_COUNT_FACTOR=.01;Us.MIN_CHILD_ROW_COUNT=10;Us.MAX_DEPTH=10;class de extends Kl{constructor(){super(),this.listenerCount=0}addEventListener(t,n,s){super.addEventListener(t,n,s),this.listenerCount+=1,this.listenerCount===1&&this.startListening()}removeEventListener(t,n,s){super.removeEventListener(t,n,s),this.listenerCount-=1,this.listenerCount===0&&this.stopListening()}startListening(){}stopListening(){}get originalColumns(){return this.columns}get movedColumns(){return[]}get movedRows(){return[]}get layoutHints(){return null}get frontColumns(){return[]}get backColumns(){return[]}get frozenColumns(){return[]}isColumnFrozen(t){return!1}get isFilterRequired(){return!1}get isReversible(){return!0}get isColumnStatisticsAvailable(){return!1}get description(){return""}get isCustomColumnsAvailable(){return!1}get isFormatColumnsAvailable(){return!1}get isExportAvailable(){return!1}get isValuesTableAvailable(){return!1}get isChartBuilderAvailable(){return!1}get isRollupAvailable(){return!1}get isSelectDistinctAvailable(){return!1}get isTotalsAvailable(){return!1}isFilterable(t){return!1}close(){}isRowMovable(){return!1}}de.EVENT=Object.freeze({UPDATED:"UPDATED",FORMATTER_UPDATED:"FORMATTER_UPDATED",REQUEST_FAILED:"REQUEST_FAILED",COLUMNS_CHANGED:"COLUMNS_CHANGED",TABLE_CHANGED:"TABLE_CHANGED",FILTERS_CHANGED:"FILTERS_CHANGED",SORTS_CHANGED:"SORTS_CHANGED",DISCONNECT:"DISCONNECT",RECONNECT:"RECONNECT",TOTALS_UPDATED:"TOTALS_UPDATED",PENDING_DATA_UPDATED:"PENDING_DATA_UPDATED"});const cs=class extends R.exports.Component{constructor(e){super(e),this.getInput=xe((t,n)=>t.find(s=>s.eventKey===n)),this.getInputIndex=xe((t,n)=>t.findIndex(s=>s.eventKey===n)),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}static makeCustomColumnInputEventKey(){return zt.generate()}static createCustomColumnInput(){return{eventKey:zt.generate(),name:"",formula:""}}componentDidMount(){const{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.messageTimer&&clearTimeout(this.messageTimer),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){const{model:e}=this.props;e.addEventListener(de.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(de.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(de.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){const{model:e}=this.props;e.removeEventListener(de.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(de.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(de.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){const t=e.map(n=>{const s=n.split(/=(.+)/,2);return{eventKey:cs.makeCustomColumnInputEventKey(),name:s[0],formula:s[1]}});this.setState({inputs:t})}else this.setState({inputs:[cs.createCustomColumnInput()]})}handleAddColumnClick(){const{inputs:e}=this.state,t=[...e];t.push(cs.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){const{inputs:t}=this.state,n=this.getInputIndex(t,e),s=[...t];s.splice(n,1),s.length===0&&s.push(cs.createCustomColumnInput()),this.setState({inputs:s})}handleInputChange(e,t,n){const{inputs:s}=this.state,i=this.getInputIndex(s,e),r={...this.getInput(s,e)};r[t]=n;const l=[...s];l.splice(i,1,r),this.setState({inputs:l})}handleCustomColumnUpdated(){const{isCustomColumnApplying:e}=this.state;!e||this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),cs.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){const t=e,{isCustomColumnApplying:n}=this.state;!n||this.setState({isCustomColumnApplying:!1,errorMessage:v(Ie,{children:[v("p",{children:[u(G,{icon:Zn})," Failed to apply custom columns."]}),v("div",{className:"error-box",children:[t.detail.errorMessage,u("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(ot.stopDragging(),!e.destination)return;const{inputs:t}=this.state,n=e.source.index,s=e.destination.index,i=[...t],o=t[n];i.splice(n,1),i.splice(s,0,o),this.setState({inputs:i})}handleEditorTabNavigation(e,t){var s,i,o;const{inputs:n}=this.state;if(t){((s=this.container)==null?void 0:s.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===n.length-1)((i=this.container)==null?void 0:i.querySelectorAll(".btn-add-column")[e]).focus();else{const r=e+1;((o=this.container)==null?void 0:o.querySelectorAll(".custom-column-input")[r]).focus()}}handleSaveClick(){const{onSave:e}=this.props,{inputs:t,isCustomColumnApplying:n}=this.state;if(n)return;const s=[];t.forEach(i=>{const{name:o,formula:r}=i;o&&r&&s.push(`${o}=${r}`)}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:!0}),e(s)}resetRequestFailed(){this.setState(({hasRequestFailed:e})=>e?{hasRequestFailed:!1}:null)}renderInputs(){const{inputs:e,hasRequestFailed:t}=this.state;return e.map((n,s)=>{const{eventKey:i,name:o,formula:r}=n;return u(Go,{inputIndex:s,eventKey:i,name:o,formula:r,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:t},i)})}renderSaveButton(){const{inputs:e,isCustomColumnApplying:t,isSuccessShowing:n}=this.state,s=e.length>1?"Save Columns":"Save Column";return v("button",{type:"button",className:W("btn btn-apply",{"btn-spinner":t},n?"btn-success":"btn-primary"),disabled:n||t,onClick:this.handleSaveClick,children:[t&&v("span",{children:[u(Ft,{}),u("span",{className:"btn-normal-content",children:"Applying"}),u("span",{className:"btn-hover-content",children:"Applying"})]}),!n&&!t&&s,n&&v(Ie,{children:[u(G,{icon:wl})," Success"]})]})}render(){const{onCancel:e}=this.props,{errorMessage:t}=this.state;return v("div",{role:"presentation",className:"custom-column-builder-container",ref:n=>{this.container=n},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[u("div",{className:"section-title",children:"Custom Column Name and Formula"}),u("hr",{}),u(_s,{onDragStart:ot.startDragging,onDragEnd:this.handleDragEnd,children:u(Ps,{droppableId:"droppable-custom-columns",children:(n,s)=>v("div",{ref:n.innerRef,...n.droppableProps,className:W("droppable-container",{dragging:s.draggingFromThisWith}),children:[this.renderInputs(),n.placeholder]})})}),u("div",{className:"pt-1 px-3",children:v("button",{type:"button",className:"btn btn-link btn-add-column",onClick:this.handleAddColumnClick,children:[u(G,{icon:gs}),"Add Another Column"]})}),v("div",{className:"custom-column-builder-footer",children:[t&&u("div",{className:"error-message",children:t}),v("div",{className:"d-flex justify-content-end",children:[u("button",{type:"button",className:"btn btn-outline-primary mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}};let Qo=cs;Qo.SUCCESS_SHOW_DURATION=750;Qo.defaultProps={customColumns:[],onSave:()=>{},onCancel:()=>{}};var Ce=(e=>(e.ADVANCED_SETTINGS="ADVANCED_SETTINGS",e.AGGREGATIONS="AGGREGATIONS",e.AGGREGATION_EDIT="AGGREGATIONS_EDIT",e.CHART_BUILDER="CHART_BUILDER",e.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",e.QUICK_FILTERS="QUICK_FILTERS",e.ROLLUP_ROWS="ROLLUP_ROWS",e.SEARCH_BAR="SEARCH_BAR",e.SELECT_DISTINCT="SELECT_DISTINCT",e.TABLE_EXPORTER="TABLE_EXPORTER",e.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",e.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",e.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",e.GOTO="GOTO",e))(Ce||{});const Is=ee.module("RollupRows"),Dh=150,ci="grouped-rollup-rows",di="ungrouped-rollup-rows",Mt=class extends R.exports.Component{constructor(e){super(e),this.search=wt(o=>{const r=this.getSortedUngroupedColumns(),l=[];let a=null;for(let c=0;c<r.length;c+=1)r[c].name.toLowerCase().includes(o.toLowerCase())&&(a==null&&(a=c),l.push([c,c]));O(a),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(a)},Dh),this.getCachedUngroupedColumns=pe((o,r)=>o.filter(l=>Mt.isGroupable(l)&&!r.find(a=>a===l.name))),this.getCachedSortedColumns=pe((o,r)=>r==null?[...o]:F.sortColumns(o,r===Mt.SORT.ASCENDING)),this.search=this.search.bind(this),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=Q.createRef(),this.groupedList=Q.createRef();const{config:t}=e,{columns:n=[],showConstituents:s=!0,showNonAggregatedColumns:i=!0}=t!=null?t:{};this.state={ungroupedSelectedRanges:[],columns:n,groupedSelectedRanges:[],searchFilter:"",showConstituents:s,showNonAggregatedColumns:i,dragSource:null,sort:null}}static renderColumn({item:e,isClone:t,selectedCount:n}){const s=e&&e.name,i=t?`${n}`:void 0,o=t?"item-list-item-clone":"";return ut.renderTextItem({text:s,badgeText:i,className:o})}static addGroupings(e,t,n=e.length){if(t==null||t.length===0)return e;let s=n;const i=e.filter((o,r)=>t.includes(o)?(r<s&&(s-=1),!1):!0);return i.splice(s,0,...t),i}static isGroupable(e){return!F.isDecimalType(e.type)}componentDidUpdate(e,t){const{config:n}=this.props,{columns:s,showConstituents:i,showNonAggregatedColumns:o}=this.state;n!==e.config?this.updateFromConfig():(s!==t.columns||i!==t.showConstituents||o!==t.showNonAggregatedColumns)&&(n==null||s!==n.columns||i!==n.showConstituents||o!==n.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){const t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(({sort:e})=>({sort:e===Mt.SORT.ASCENDING?null:Mt.SORT.ASCENDING}))}handleSortDescending(){this.setState(({sort:e})=>({sort:e===Mt.SORT.DESCENDING?null:Mt.SORT.DESCENDING}))}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){Is.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){Is.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});const{destination:t,source:n}=e;if(t==null||n==null)return;if(t.droppableId===di){this.setState(({groupedSelectedRanges:o,columns:r})=>{const l=[...r];return ot.reorder(l,o,[],0),{columns:l,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}const s=n.droppableId===ci;let i=t.index;s&&n.index<t.index&&(i+=1),this.setState(({columns:o,ungroupedSelectedRanges:r,groupedSelectedRanges:l})=>{const a=[...o],c=s?a:this.getSortedUngroupedColumns().map(g=>g.name),d=s?l:r,h=ot.reorder(c,d,a,i),m=s?ot.adjustDestinationIndex(i,l):i,p=[[m,m+h.length-1]];return{columns:a,ungroupedSelectedRanges:[],groupedSelectedRanges:p}}),this.resetSelection()}handleUngroupedSelect(e){Is.debug("handleUngroupedSelect"),this.setState(({columns:t})=>({columns:Mt.addGroupings(t,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}))}handleUngroupedSelectionChange(e){Is.debug2("handleUngroupedSelectionChange",e),this.setState(({ungroupedSelectedRanges:t})=>e===t?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]})}handleGroupedSelectionChange(e){Is.debug2("handleGroupedSelectedRanges",e),this.setState(({groupedSelectedRanges:t})=>e===t?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]})}handleDeleteClicked(e){this.setState(({columns:t})=>{const n=t.slice();return n.splice(e,1),{columns:n}})}handleShowConstituentsChange(){this.setState(({showConstituents:e})=>({showConstituents:!e}))}handleShowNonAggregatedColumnsChange(){this.setState(({showNonAggregatedColumns:e})=>({showNonAggregatedColumns:!e}))}updateFromConfig(){const{config:e}=this.props,{columns:t=[],showConstituents:n=!0,showNonAggregatedColumns:s=!0}=e!=null?e:{};this.setState({columns:t,showConstituents:n,showNonAggregatedColumns:s})}sendChange(){const{onChange:e}=this.props,{columns:t,showConstituents:n,showNonAggregatedColumns:s}=this.state;e({columns:t,showConstituents:n,showNonAggregatedColumns:s})}getUngroupedColumns(){const{model:e}=this.props,{columns:t}=this.state,{originalColumns:n}=e;return this.getCachedUngroupedColumns(n,t)}getSortedUngroupedColumns(){const{sort:e}=this.state,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem({item:e,itemIndex:t,isClone:n,selectedCount:s}){const o=`${n?"":"\xA0\xA0".repeat(t)}${e}`,r=n?`${s}`:void 0,l=n?"item-list-item-clone":"";return v(Ie,{children:[ut.renderTextItem({text:o,badgeText:r,className:l}),!n&&u(Re,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(t),children:u(G,{icon:Mn})})]})}render(){const{columns:e,dragSource:t,searchFilter:n,groupedSelectedRanges:s,ungroupedSelectedRanges:i,showConstituents:o,showNonAggregatedColumns:r,sort:l}=this.state,a=this.getSortedUngroupedColumns();let c=e.length*ut.DEFAULT_ROW_HEIGHT;(t==null?void 0:t.droppableId)===di&&(c+=ut.DEFAULT_ROW_HEIGHT);const d=a.length*ut.DEFAULT_ROW_HEIGHT+10,h=Math.min(3*ut.DEFAULT_ROW_HEIGHT,d);return u("div",{role:"menu",className:W("rollup-rows",{"is-dragging":t!=null}),tabIndex:0,children:v(_s,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[v("div",{className:"rollup-rows-group-by",children:[u("div",{className:"section-title",children:"Group By"}),e.length===0&&u(Ps,{isDropDisabled:!0,droppableId:"placeholder",children:(m,p)=>u("div",{className:W("placeholder","text-muted",{"is-dragging-from-this":p.draggingFromThisWith,"is-dragging-over":p.isDraggingOver,"is-dropping":p.draggingOverWith}),ref:m.innerRef,...m.droppableProps,children:"Create rollup by dragging columns here, from the available columns list below."})}),e.length>0&&u(ut,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:ci,droppableId:ci,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:s,style:{height:c},isMultiSelect:!0})]}),v("div",{className:"rollup-rows-available-columns",children:[u("div",{className:"section-title",children:"Available Grouping Columns"}),v("div",{className:"top-menu",children:[u(Dn,{className:"w-100",value:n,matchCount:n?i.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),v(Re,{kind:"ghost",className:W("btn-link btn-link-icon",{active:l===Mt.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[u(G,{icon:Oo}),u(he,{children:"Sort ascending"})]}),v(Re,{kind:"ghost",className:W("btn-link btn-link-icon",{active:l===Mt.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[u(G,{icon:ko}),u(he,{children:"Sort descending"})]})]}),u(ut,{className:"rollup-available-grouping-columns",draggablePrefix:di,droppableId:di,itemCount:a.length,items:a,renderItem:Mt.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:i,style:{maxHeight:d,minHeight:h},isDropDisabled:(t==null?void 0:t.droppableId)!==ci,isMultiSelect:!0}),v("div",{className:"bottom-menu",children:[u("div",{className:"label",children:"Show:"}),u(St,{checked:o,onChange:this.handleShowConstituentsChange,children:"Constituents"}),u(St,{checked:r,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}};let jo=Mt;jo.SORT=Object.freeze({ASCENDING:"ASCENDING",DESCENDING:"DESCENDING"});jo.defaultProps={config:null,onChange:()=>{}};const Te=class extends R.exports.Component{static getDateString(){return P.i18n.DateTimeFormat.format(Te.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadOptionChanged=this.handleDownloadOptionChanged.bind(this),this.handleCustomizedDownloadOptionChanged=this.handleCustomizedDownloadOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this);const{name:t}=e;this.state={fileName:`${t}-${Te.getDateString()}.csv`,downloadOption:Te.DOWNLOAD_OPTIONS.ALL_ROWS,customizedDownloadOption:Te.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:Te.DEFAULT_DOWNLOAD_ROWS,errorMessage:null,id:zt.generate()}}getSnapshotRanges(){const{model:e,selectedRanges:t}=this.props,{downloadOption:n,customizedDownloadOption:s,customizedDownloadRows:i}=this.state,{rowCount:o}=e;let r=[];switch(n){case Te.DOWNLOAD_OPTIONS.ALL_ROWS:r.push(new X(null,0,null,o-1));break;case Te.DOWNLOAD_OPTIONS.SELECTED_ROWS:r=[...t].sort((l,a)=>l.startRow&&a.startRow?l.startRow-a.startRow:0);break;case Te.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS:switch(s){case Te.CUSTOMIZED_ROWS_OPTIONS.FIRST:r.push(new X(null,0,null,Math.min(i-1,o-1)));break;case Te.CUSTOMIZED_ROWS_OPTIONS.LAST:r.push(new X(null,Math.max(0,o-i),null,o-1));break}break}return r}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){const{model:e,isDownloading:t,onDownloadStart:n,onDownload:s,onCancel:i}=this.props,{fileName:o}=this.state;if(t){i();return}this.resetDownloadState();const r=this.getSnapshotRanges();this.validateOptionInput()&&(n(),e.export().then(l=>{const a=l.setViewport(0,0);a.getViewportData().then(()=>{s(o,l,a,r)})}))}handleDownloadOptionChanged(e){this.setState({downloadOption:e.target.value})}handleCustomizedDownloadOptionChanged(e){this.setState({customizedDownloadOption:e.target.value})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}validateOptionInput(){const{selectedRanges:e}=this.props,{downloadOption:t,customizedDownloadRows:n}=this.state;return t===Te.DOWNLOAD_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:v("p",{children:[u(G,{icon:Zn})," No rows selected. Please select some rows in the table."]})}),!1):t===Te.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS&&n<=0?(this.setState({errorMessage:v("p",{children:[u(G,{icon:Zn})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){const{model:e,isDownloading:t,tableDownloadProgress:n,tableDownloadEstimatedTime:s,selectedRanges:i,tableDownloadStatus:o}=this.props,{fileName:r,downloadOption:l,customizedDownloadOption:a,customizedDownloadRows:c,errorMessage:d,id:h}=this.state,{rowCount:m}=e;return v("div",{className:"table-csv-exporter",children:[u("div",{className:"section-title",children:"Download Rows"}),u("div",{className:"form-group",children:v(Bo,{onChange:this.handleDownloadOptionChanged,value:l,disabled:t,children:[v(an,{value:Te.DOWNLOAD_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",u("span",{className:"text-muted ml-2",children:`(${m.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`})]}),v(an,{value:Te.DOWNLOAD_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",u("span",{className:"text-muted ml-2",children:i.length>0?`(${X.rowCount(i).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")} rows)`:null})]}),u(an,{value:Te.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:v("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadOption:Te.DOWNLOAD_OPTIONS.CUSTOMIZED_ROWS})},children:[v("select",{value:a,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:t,onChange:this.handleCustomizedDownloadOptionChanged,children:[u("option",{value:"FIRST",children:"First"}),u("option",{value:"LAST",children:"Last"})]}),u("input",{type:"number",className:"form-control",id:`customizedRows-${h}`,"data-testid":"input-csv-exporter-customized-rows",name:`customizedRows-${h}`,placeholder:"100",value:c,disabled:t,onChange:this.handleCustomizedDownloadRowsChanged}),u("div",{children:"Rows"})]})})]})}),v("div",{className:"form-group",children:[u("label",{htmlFor:`customizedRows-${h}`,children:"File Name"}),u("input",{type:"text",className:"form-control",id:`filename-${h}`,"data-testid":"input-csv-exporter-file-name",name:`filename-${h}`,value:r,onChange:p=>{this.setState({fileName:p.target.value})},disabled:t})]}),v("div",{className:"section-footer flex-column",children:[d&&u("div",{className:"error-message",children:d}),o&&v("div",{className:"download-status",children:[(o===Te.DOWNLOAD_STATUS.DOWNLOADING||o===Te.DOWNLOAD_STATUS.INITIATING)&&v(Ie,{children:[o===Te.DOWNLOAD_STATUS.INITIATING&&u("div",{className:"text-muted",children:"Starting Download..."}),o===Te.DOWNLOAD_STATUS.DOWNLOADING&&v("div",{className:"text-muted d-flex justify-content-between",children:[u("span",{children:s||s===0?`Estimated time: ${Bt.formatElapsedTime(s)}`:null}),u("span",{children:`${n}%`})]})]}),o===Te.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"text-muted text-right",children:"Download Completed"}),o===Te.DOWNLOAD_STATUS.CANCELED&&u("div",{className:"text-muted",children:"Download Canceled"}),(o===Te.DOWNLOAD_STATUS.DOWNLOADING||o===Te.DOWNLOAD_STATUS.INITIATING)&&u("div",{className:"progress",children:u("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:`${n}%`}})}),o===Te.DOWNLOAD_STATUS.FINISHED&&u("div",{className:"progress",children:u("div",{className:"progress-bar bg-success",style:{width:`${n}%`}})})]}),v("button",{type:"button","data-testid":"btn-csv-exporter-download",className:W("btn btn-primary btn-downloading",{"btn-spinner btn-cancelable":t}),onClick:this.handleDownloadClick,children:[t&&v("span",{children:[u(Ft,{}),u("span",{className:"btn-normal-content",children:"Downloading"}),u("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Download"]})]})]})}};let pt=Te;pt.FILENAME_DATE_FORMAT="yyyy-MM-dd-HHmmss";pt.DOWNLOAD_STATUS={INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"};pt.DOWNLOAD_OPTIONS={ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"};pt.CUSTOMIZED_ROWS_OPTIONS={FIRST:"FIRST",LAST:"LAST"};pt.DEFAULT_DOWNLOAD_ROWS=100;pt.defaultProps={onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]};const jt=ee.module("TableSaver");function Fh(e){return e.added!==void 0}function xh(e){if(!Fh(e))throw new Error("event is not UpdateEventData")}const vn=class extends R.exports.PureComponent{constructor(e){super(e),this.WritableStream=window.WritableStream||pr,this.getCachedCustomColumnFormatFlag=Ct(vi.isCustomColumnFormatDefined,{max:1e4}),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.WritableStream=window.WritableStream||pr,this.iframes=[],this.useBlobFallback=!1}static csvEscapeString(e){return`"${e.replace(/"/g,'""')}"`}componentDidMount(){const{getDownloadWorker:e}=this.props;e().then(t=>{jt.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{jt.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.iframes.length>0&&this.iframes.forEach(e=>{e.remove()}),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){const t=this.useBlobFallback,n=[];let s=null;t&&(s=TextEncoder.prototype.encode.bind(new TextEncoder));const{fileName:i}=this,o={};return t?(o.write=r=>{O(s),r.header!==void 0&&n.push(s(r.header)),r.rows!==void 0&&n.push(s(r.rows))},o.close=()=>{O(i);const r=new Blob(n,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(r),l.download=i,l.click()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(o.write=r=>{e.postMessage(r)},o.close=()=>{e.postMessage({end:!0}),e.close()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new this.WritableStream(o)}startDownload(e,t,n,s){const{isDownloading:i}=this.props;if(i)return;this.downloadStartTime=Date.now(),jt.info(`start downloading ${e}`),this.table=t,this.columns=t.columns,this.tableSubscription=n,this.gridRanges=s;const o=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),r=new MessageChannel;if(this.port=r.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable();return}this.sw&&this.sw.postMessage({encodedFileName:o},[r.port2]),this.port.onmessage=this.handlePortMessage}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();const{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime&&jt.info(`download finished, total elapsed time ${(Date.now()-this.downloadStartTime)/1e3} seconds`)}cancelDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.abort(),this.cancelableSnapshots.forEach(t=>{t&&(t.catch(()=>null),t.cancel())});const{onDownloadCanceled:e}=this.props;e(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){jt.info("download canceled"),this.cancelDownload()}writeTableHeader(){var t;let e="";if(this.columns)for(let n=0;n<this.columns.length;n+=1)e+=this.columns[n].name,e+=n===this.columns.length-1?`
|
|
4
4
|
`:",";(t=this.fileWriter)==null||t.write({header:e}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges&&(this.chunkRows=Math.floor(vn.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(O(e.endRow),O(e.startRow),O(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),jt.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(vn.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(){this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,n){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){const s=this.snapshotsBuffer.get(this.currentSnapshotIndex);O(s),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(s)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(jt.debug2(`
|