@deephaven/code-studio 0.60.0 → 0.60.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/assets/AppRoot-78d4d9e3.js +5 -0
  2. package/build/assets/AppRoot-78d4d9e3.js.map +1 -0
  3. package/build/assets/{ControlType-aed38d2a.js → ControlType-6564be64.js} +14 -14
  4. package/build/assets/ControlType-6564be64.js.map +1 -0
  5. package/build/assets/{FontBootstrap-03312de4.js → FontBootstrap-7c2011d9.js} +2 -2
  6. package/build/assets/{FontBootstrap-03312de4.js.map → FontBootstrap-7c2011d9.js.map} +1 -1
  7. package/build/assets/{IrisGrid-95f2b562.js → IrisGrid-9b7bdb62.js} +7 -7
  8. package/build/assets/{IrisGrid-95f2b562.js.map → IrisGrid-9b7bdb62.js.map} +1 -1
  9. package/build/assets/{IrisGridModelFactory-83f4e8e3.js → IrisGridModelFactory-13cf501d.js} +3 -3
  10. package/build/assets/{IrisGridModelFactory-83f4e8e3.js.map → IrisGridModelFactory-13cf501d.js.map} +1 -1
  11. package/build/assets/{StyleGuideRoot-f74fbaec.js → StyleGuideRoot-1e7a89ef.js} +2 -2
  12. package/build/assets/{StyleGuideRoot-f74fbaec.js.map → StyleGuideRoot-1e7a89ef.js.map} +1 -1
  13. package/build/assets/index-110a15f5.js +2 -0
  14. package/build/assets/index-110a15f5.js.map +1 -0
  15. package/build/assets/{index-8f18b8a1.js → index-4799bb94.js} +2 -2
  16. package/build/assets/{index-8f18b8a1.js.map → index-4799bb94.js.map} +1 -1
  17. package/build/assets/{index-aeb6c8aa.js → index-cdb214b1.js} +2 -2
  18. package/build/assets/{index-aeb6c8aa.js.map → index-cdb214b1.js.map} +1 -1
  19. package/build/assets/usePlugins-d26d6337.js +3 -0
  20. package/build/assets/usePlugins-d26d6337.js.map +1 -0
  21. package/build/assets/{useUser-2b2d3085.js → useUser-3f49dc07.js} +2 -2
  22. package/build/assets/{useUser-2b2d3085.js.map → useUser-3f49dc07.js.map} +1 -1
  23. package/build/index.html +1 -1
  24. package/package.json +31 -31
  25. package/build/assets/AppRoot-4e766647.js +0 -5
  26. package/build/assets/AppRoot-4e766647.js.map +0 -1
  27. package/build/assets/ControlType-aed38d2a.js.map +0 -1
  28. package/build/assets/index-e5c706d4.js +0 -2
  29. package/build/assets/index-e5c706d4.js.map +0 -1
  30. package/build/assets/usePlugins-ed18184b.js +0 -3
  31. package/build/assets/usePlugins-ed18184b.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import{r as y,H as T,aD as Ki,C as h,D as Hi,F as B,R as $n,N as v,G as ot,S as rt,E as jn,L as zi,M as ct,aE as Ui,aF as Vi,aG as Gi,aH as qi,aI as Xi,aJ as Zi,ab as Ir,as as ir,aK as C,aL as Or,aM as Qi,ag as Yi,ah as Ji}from"./vendor-755ebba4.js";import{T as eo,L as N,M as to,b as ro,c as no,ai as io,I as oo,aC as ao,aS as so,aT as lo,aU as uo,aQ as co,a2 as ho,a5 as mo,P as fo,a1 as go,a6 as vo,Z as po,ab as bo,S as yo,ae as _o,a9 as Bn,e as Be,a3 as wo,aV as Co,B as So,a4 as Po,x as Eo}from"./index-8f18b8a1.js";import{e as ke,l as Ye,a as fe,K as or,b as xr,R as Mo}from"./monaco-0fb6bb22.js";import{c as Jt,P as Wn,b as To,h as Io,p as Oo,o as xo,s as Do,t as Ao}from"./plotly-45de66f8.js";var Ph=Object.freeze([]),Eh=new Map,Mh=()=>{};function er(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(n=>n!=null)}function ko(r,e,t){return e=No(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function No(r){var e=Fo(r,"string");return typeof e=="symbol"?e:String(e)}function Fo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Lo extends Error{constructor(){super(...arguments),ko(this,"isCanceled",!0)}}const Dr=Lo;function Ro(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=$o(r,e);t.forEach(n=>{r[n]=r[n].bind(r)})}function $o(r,e){for(var t=new Set,n=r,i=0;n!=null&&n!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(n))o!=="constructor"&&typeof n[o]=="function"&&t.add(o);n=Object.getPrototypeOf(n),i+=1}return[...t.keys()]}function Ar(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function jo(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Ar(o,n,i,a,s,"next",l)}function s(l){Ar(o,n,i,a,s,"throw",l)}a(void 0)})}}function Bo(r){return ar.apply(this,arguments)}function ar(){return ar=jo(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(r)}catch{return kr(r)}kr(r)}),ar.apply(this,arguments)}function kr(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function at(r,e,t){return e=Wo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wo(r){var e=Ko(r,"string");return typeof e=="symbol"?e:String(e)}function Ko(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ho="table_",Kn="column_",zo=new Set(["in","not","i","ii","k"]),Uo=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"]),Vo=/[^a-zA-Z0-9_$+@-]/g,Go=/[^A-Za-z0-9_$]/g;class ce{}at(ce,"legalize",(r,e,t,n,i)=>{var o=r.trim().replace(/[- ]/g,"_");return n&&(zo.has(o)||Uo.has(o))&&(o=e+o),o=o.replace(t,""),o||(o=e+i),Number.isNaN(Number(o.charAt(0)))||(o=e+o),o});at(ce,"legalizeTableName",r=>ce.legalize(r,Ho,Vo,!1,0));at(ce,"legalizeColumnNames",r=>{var e=[];return r.forEach((t,n)=>{var i=ce.legalizeColumnName(t,n);e.includes(i)&&(i=Kn+n),e.push(i)}),e});at(ce,"legalizeColumnName",function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ce.legalize(r,Kn,Go,!0,e)});at(ce,"isValidTableName",r=>ce.legalizeTableName(r)===r);at(ce,"isValidColumnName",r=>ce.legalizeColumnName(r)===r);const Th=ce;class Hn extends CustomEvent{constructor(e,t){super(e,t)}}function qo(r,e,t){return e=Xo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xo(r){var e=Zo(r,"string");return typeof e=="symbol"?e:String(e)}function Zo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qo extends Error{constructor(){super(...arguments),qo(this,"isTimeout",!0)}}const zn=Qo;class Bt{static makeCancelable(e,t){var n=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{n?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{n=!0,o(new Dr),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Dr}static isTimedOut(e){return e instanceof zn}static withTimeout(e,t){return new Promise((n,i)=>{setTimeout(()=>{try{n(t())}catch(o){i(o)}},e)})}}function Nr(r,e,t){return e=Yo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yo(r){var e=Jo(r,"string");return typeof e=="symbol"?e:String(e)}function Jo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ea{constructor(){Nr(this,"pending",[]),Nr(this,"resolved",[])}add(e,t){var n=Bt.makeCancelable(e,t);return this.pending.push(n),n.then(()=>{this.resolve(n)},()=>{this.resolve(n)}),n}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const Ih=ea;class gr{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!gr.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var n=0;n<e.length;n+=1){var i=e[n],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var[n,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],u=s[1];if(l<=n&&i<=u)return o;n<=u&&l<=i&&(n=Math.min(n,l),i=Math.max(i,u),o.splice(a,1))}return o.push([n,i]),o}static deselectRange(e,t){for(var[n,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],u=s[1];if(!(i<l||u<n))if(l<n&&i<u){o[a]=[l,n-1],o.splice(a+1,0,[i+1,u]);break}else n<=l&&u<=i?o.splice(a,1):l<n?o[a]=[l,n-1]:o[a]=[i+1,u]}return o}static count(e){return e.reduce((t,n)=>t+(n[1]-n[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((n,i)=>{for(var o=[...n],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}const We=gr;function*Oh(r,e){for(var t=r;t<=e;++t)yield t}class ta{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var n=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(n,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?n?-1:1:e>t?n?1:-1:0}}const ra=ta;function Un(r,e,t){return e=na(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function na(r){var e=ia(r,"string");return typeof e=="symbol"?e:String(e)}function ia(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ct{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(n>0||t>0?"".concat(n,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),n=e%(60*60),i=String(Math.floor(n/60)).padStart(2,"0"),o=n%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(Ct.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}Un(Ct,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Un(Ct,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const xh=Ct;function oa(r,e,t){return e=aa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function aa(r){var e=sa(r,"string");return typeof e=="symbol"?e:String(e)}function sa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class la extends Error{constructor(){super(...arguments),oa(this,"isInvalid",!0)}}const Dh=la;function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ua(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(n){nt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function nt(r,e,t){return e=da(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function da(r){var e=ca(r,"string");return typeof e=="symbol"?e:String(e)}function ca(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vr extends y.Component{constructor(e){super(e),nt(this,"element",void 0),nt(this,"container",void 0),nt(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=T.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:n}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=ua({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new Ki(n||o,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var a=this.element.firstElementChild;a instanceof HTMLElement&&a.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:n,interactive:i,closeOnBlur:o}=this.props,{show:a}=this.state;return h.jsx(Hi,{in:a,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:h.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:B("popper",{interactive:i},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:h.jsxs("div",{className:"popper-content",children:[t,h.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return h.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&$n.createPortal(this.renderContent(),this.element)})}}nt(vr,"propTypes",{children:v.node.isRequired,options:v.shape({}),className:v.string,timeout:v.number,onEntered:v.func,onExited:v.func,isShown:v.bool,closeOnBlur:v.bool,interactive:v.bool,referenceObject:v.shape({}),"data-testid":v.string});nt(vr,"defaultProps",{options:{},className:"",timeout:eo.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Vn=vr;function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ha(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(n){ge(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ge(r,e,t){return e=ma(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ma(r){var e=fa(r,"string");return typeof e=="symbol"?e:String(e)}function fa(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ga=N.module("Tooltip");class $ extends y.Component{static handleHidden(){$.shownTooltipCount-=1,$.shownTooltipCount===0&&($.lastHiddenTime=Date.now())}static handleShown(){$.shownTooltipCount+=1}constructor(e){super(e),ge(this,"container",void 0),ge(this,"popper",void 0),ge(this,"parent",void 0),ge(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=T.createRef(),this.popper=T.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:n}=t,{isShown:i}=this.state;i!==n&&(i?$.handleShown():$.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&$.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){ga.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,n=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;($.shownTooltipCount>0||Date.now()-$.lastHiddenTime<$.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:n,popperClassName:i,"data-testid":o,onEntered:a}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=ha({placement:"bottom"},l),h.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:h.jsx(Vn,{className:B(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:h.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}ge($,"defaultTimeout",500);ge($,"defaultReshowTimeout",100);ge($,"triggerReshowThreshold",300);ge($,"shownTooltipCount",0);ge($,"lastHiddenTime",Date.now());ge($,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:$.defaultReshowTimeout,timeout:$.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const va=$;function pa(){var r=y.useRef(!1);return y.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function Rr(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ba(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Rr(o,n,i,a,s,"next",l)}function s(l){Rr(o,n,i,a,s,"throw",l)}a(void 0)})}}var ya=N.module("useAsyncInterval");function Ah(r,e){var t=pa(),n=y.useRef(0),i=y.useRef(0),o=y.useRef(null),a=y.useCallback(ba(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield r()}catch(c){ya.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);n.current=window.setTimeout(a,d)}}),[r,t,e]);y.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(n.current)}),[e,a])}function St(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=y.useContext(r);if(t==null)throw new Error(e);return t}function _a(r){var e=y.useRef();return y.useEffect(function(){e.current=r}),e.current}function Gn(r){var e=y.useRef(null);return y.useEffect(function(){r&&(typeof r=="function"?r(e.current):r.current=e.current)}),e}var wa=3500,Ca=N.module("useCopyToClipboard");function Sa(){var[r,e]=y.useState(!1),t=y.useRef(null),n=y.useCallback(i=>{Bo(i).then(()=>{e(!0)}).catch(o=>Ca.error("Unable to copy ".concat(i),`
2
- `,o))},[]);return y.useEffect(()=>(t.current&&clearTimeout(t.current),r&&(t.current=setTimeout(()=>{e(!1)},wa)),()=>{t.current&&clearTimeout(t.current)}),[r]),[r,n]}function Gt(r){var{children:e,className:t,style:n,"data-testid":i}=r;return h.jsx("div",{className:B("btn-group",t),style:n,role:"group","data-testid":i,children:e})}Gt.displayName="ButtonGroup";Gt.propTypes={children:v.node.isRequired,className:v.string,style:v.object,"data-testid":v.string};Gt.defaultProps={className:null,style:{},"data-testid":void 0};var Pa=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function jr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){Ea(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ea(r,e,t){return e=Ma(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ma(r){var e=Ta(r,"string");return typeof e=="symbol"?e:String(e)}function Ta(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ia(r,e){if(r==null)return{};var t=Oa(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Oa(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var xa=["primary","secondary","tertiary","success","danger","inline","ghost"],Da=["group-end"];function Aa(r,e){switch(r){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 B("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function ka(r){switch(r){case"group-end":return B("pl-2","pr-3")}}var qt=T.forwardRef((r,e)=>{var{kind:t,variant:n,type:i,tooltip:o,icon:a,disabled:s=!1,active:l,onClick:u,onContextMenu:d,onMouseDown:c,onMouseUp:m,onMouseEnter:g,onMouseLeave:b,onKeyDown:_,className:E,style:D,children:A,tabIndex:M,"data-testid":ne,"aria-label":K}=r,oe=Ia(r,Pa),H;n&&(H=ka(n));var V;a&&(V=T.isValidElement(a)?a:h.jsx(ot,{icon:a}));var G=V!=null&&A==null,ae=Aa(t,G),q;o!==void 0&&(q=typeof o=="string"?h.jsx(va,{children:o}):o);var Oe=K;K===void 0&&G&&o!=null&&typeof o=="string"&&(Oe=o);var J=h.jsxs("button",jr(jr({"data-testid":ne,ref:e,type:i,className:B("btn",ae,H,{active:l},E),onClick:u,onContextMenu:d,onMouseUp:m,onMouseDown:c,onMouseEnter:g,onMouseLeave:b,onKeyDown:_,style:D,disabled:s,tabIndex:M,"aria-label":Oe},oe),{},{children:[a&&V,A,o!=null&&!s&&q]}));return s&&o!=null?h.jsxs("span",{className:"btn-disabled-wrapper",children:[J,q]}):J});qt.displayName="Button";qt.propTypes={kind:v.oneOf(xa).isRequired,variant:v.oneOf(Da),type:v.oneOf(["submit","reset","button"]),tooltip(r){var{tooltip:e,icon:t,children:n}=r;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){var{children:e,icon:t}=r;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!T.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:v.bool,active:v.bool,onClick(r){var{onClick:e,type:t}=r;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:v.func,onMouseUp:v.func,onMouseDown:v.func,onMouseEnter:v.func,onMouseLeave:v.func,onKeyDown:v.func,tabIndex:v.number,children:v.node,className:v.string,style:v.object,"data-testid":v.string};qt.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const it=qt;function Na(r){var{className:e="modal-footer",children:t,"data-testid":n}=r;return h.jsx("div",{className:e,"data-testid":n,children:t})}function qn(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:i,onConfirm:o,onDiscard:a,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:d="Discard",isConfirmDanger:c=!1,children:m,"data-testid":g}=r,b=y.useRef(null),_=y.useRef(null),E=y.useCallback(()=>{_.current!==null&&_.current.checked&&s&&s(),o()},[o,s]),D=y.useCallback(()=>{var M;(M=b.current)===null||M===void 0||M.focus()},[]),A="";return e&&(A=typeof n=="function"?n():n),h.jsxs(to,{isOpen:e,onOpened:D,children:[h.jsx(ro,{closeButton:!1,children:t}),h.jsx(no,{children:A}),h.jsxs(Na,{children:[s&&h.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[h.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:_,"data-testid":g!==void 0?"".concat(g,"-checkbox-confirm"):void 0}),h.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&h.jsx(it,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":g!==void 0?"".concat(g,"-btn-discard"):void 0,children:d}),i&&h.jsx(it,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":g!==void 0?"".concat(g,"-btn-cancel"):void 0,children:l}),h.jsxs(Gt,{children:[h.jsx(it,{kind:c?"danger":"primary",onClick:E,ref:b,"data-testid":g!==void 0?"".concat(g,"-btn-confirm"):void 0,children:u}),m]})]})]})}qn.propTypes={isOpen:v.bool.isRequired,headerText:v.string.isRequired,bodyText:v.oneOfType([v.string,v.func]).isRequired,onCancel:v.func,onConfirm:v.func.isRequired,onDiscard:v.func,onModalDisable:v.func,cancelButtonText:v.string,confirmButtonText:v.string,discardButtonText:v.string,children:v.node,"data-testid":v.string};qn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function Fa(r,e,t){return e=La(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function La(r){var e=Ra(r,"string");return typeof e=="symbol"?e:String(e)}function Ra(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function tr(r){return r.then!==void 0}class $e{static disableAllActions(){$e.actionsDisabled=!0}static enableAllActions(){$e.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var n,i;return((n=e.group)!==null&&n!==void 0?n:0)>((i=t.group)!==null&&i!==void 0?i:0)?1:-1}if(e.order!==t.order){var o,a;return((o=e.order)!==null&&o!==void 0?o:0)>((a=t.order)!==null&&a!==void 0?a:0)?1:-1}if(e.title!==t.title){var s,l;return((s=e.title)!==null&&s!==void 0?s:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort($e.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return $e.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=$e.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=[],i=e;Array.isArray(i)||(i=[i]);for(var o=0;o<i.length;o+=1){var a=i[o],s=void 0;typeof a=="function"?s=a():s=a,s!=null&&(s instanceof Promise?t&&n.push(s):Array.isArray(s)?n=n.concat(s):n.push(s))}return n=n.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),n}static getNextMenuItem(e,t,n){var i=e;i<0&&t<0&&(i=n.length);for(var o=1;o<n.length+1;o+=1){var a=(i+t*o+n.length)%n.length,s=n[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}Fa($e,"actionsDisabled",!1);const j=$e;var Br=N.module("GlobalContextAction");class $a extends y.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:n}=this.props;n.title==null&&!n.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(n),Br.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!j.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var n;Br.debug("Global hotkey matched!",e),(n=t.action)===null||n===void 0||n.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const ja=$a;class Ba extends y.Component{render(){for(var{actions:e,"data-testid":t}=this.props,n=[],i=0;i<e.length;i+=1){var o=e[i],{shortcut:a}=o;if(o.title!=null||o.menuElement||a){var s=h.jsx(ja,{action:o,"data-testid":t},"".concat(o.title,".").concat(a?.id));n.push(s)}}return n}}const Wa=Ba;function Xn(r,e,t){return e=Ka(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ka(r){var e=Ha(r,"string");return typeof e=="symbol"?e:String(e)}function Ha(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ot=N.module("ContextActions");class Zn extends y.Component{static triggerMenu(e,t,n,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),Xn(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=T.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!tr(i)&&typeof i!="function"&&i.isGlobal),n=e.actions.filter(i=>!tr(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:n}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var n=e.target,i=function(){var{classList:u}=n,d=t.find(c=>u.contains(c));if(d!==void 0)return Ot.debug2('Contextmenu event ignored based on the target className "'.concat(d,'"')),{v:void 0};n=n.parentElement};n!=null;){var o=i();if(typeof o=="object")return o.v}if(j.isContextActionEvent(e)||(e.contextActions=[]),!!j.isContextActionEvent(e)){var{actions:a}=this.props;if(a!=null){var s=a;Array.isArray(s)&&(s=s.filter(l=>tr(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}Ot.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,n=0;n<t.length;n+=1){var i=t[n];if(!j.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;Ot.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),Ot.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return h.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:h.jsx(Wa,{actions:t})})}}Xn(Zn,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const za=Zn;var pr=T.forwardRef((r,e)=>{var t,n;function i(H){var{menuItem:V,onMenuItemClick:G}=r;G(V,H)}function o(H){var{menuItem:V,onMenuItemMouseMove:G}=r;G(V,H)}function a(H){var{menuItem:V,onMenuItemContextMenu:G}=r;G(V,H)}function s(H,V,G){if(typeof H.type=="string")return H;var{closeMenu:ae,menuItem:q,isKeyboardSelected:Oe,isMouseSelected:J,"data-testid":pe}=r,he={menuItem:q,closeMenu:ae,isKeyboardSelected:Oe,isMouseSelected:J,iconElement:V,displayShortcut:G,"data-testid":pe};return T.cloneElement(H,{forwardedProps:he})}var{children:l,menuItem:u,isKeyboardSelected:d=!1,isMouseSelected:c=!1,"data-testid":m}=r,g=(t=u.shortcutText)!==null&&t!==void 0?t:(n=u.shortcut)===null||n===void 0?void 0:n.getDisplayText(),b=null;if(u.icon){var _=u.icon;if(T.isValidElement(_))b=_;else{var E;u.iconColor!=null&&(u.disabled===void 0||!u.disabled)&&(E={color:u.iconColor}),b=h.jsx(ot,{icon:_,style:E})}}var D=null,A=!!l;u.actions&&(D=h.jsx(ot,{icon:io}));var M=null;if(u.menuElement)M=h.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:s(u.menuElement,b,g)});else{var ne,K=u.disabled,oe=u.iconOutline;M=h.jsx("button",{type:"button",className:B("btn-context-menu",{disabled:K},{active:(A||c)&&(K===void 0||!K)},{"keyboard-active":d&&(K===void 0||!K)}),onClick:i,onMouseMove:o,onContextMenu:a,title:(ne=u.description)!==null&&ne!==void 0?ne:"",children:h.jsxs("div",{className:"btn-context-menu-wrapper",children:[h.jsx("span",{className:B("icon",{outline:oe}),children:b}),h.jsx("span",{className:"title",children:u.title}),g!==void 0&&h.jsx("span",{className:"shortcut",children:g}),D&&h.jsx("span",{className:B("submenu-indicator",{disabled:K}),children:D})]})})}return h.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[l,M]})});pr.displayName="ContextMenuItem";pr.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const Qn=pr;function Wr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ua(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(t),!0).forEach(function(n){Ne(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Wr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ne(r,e,t){return e=Va(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Va(r){var e=Ga(r,"string");return typeof e=="symbol"?e:String(e)}function Ga(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Kr=N.module("ContextMenu");class pt extends y.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),Ne(this,"container",void 0),Ne(this,"oldFocus",void 0),Ne(this,"activeSubMenuRef",void 0),Ne(this,"subMenuTimer",void 0),Ne(this,"rAF",void 0),Ne(this,"initialPosition",void 0),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=T.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=T.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:n}=this.props,{activeSubMenu:i}=this.state;if(i!==t.activeSubMenu)if(i==null){var o;(o=this.container.current)===null||o===void 0||o.focus()}else this.setActiveSubMenuPosition();if(e.actions!==n&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var a;(a=this.container.current)===null||a===void 0||a.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:n}=this.props,i=j.getMenuItems(n),o=[],a=i.length-1;a>=0;a-=1){var s=i[a];s instanceof Promise?this.initMenuPromise(s):o.push(s)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:j.sortActions(o)})}initMenuPromise(e){var t=Bt.makeCancelable(e);this.setState(n=>({pendingItems:n.pendingItems.concat(t)})),t.then(n=>{this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var a=i.pendingItems.slice();return a.splice(o,1),{menuItems:j.sortActions(i.menuItems.concat(n)),pendingItems:a}}return null})},n=>{Bt.isCanceled(n)||(this.setState(i=>{var o=i.pendingItems.indexOf(t);if(o>=0){var a=i.pendingItems.slice();return a.splice(o,1),{pendingItems:a}}return null}),Kr.error(n))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,n,i,{options:o,updatePosition:a,subMenuParentWidth:s,subMenuParentHeight:l,top:u,left:d}=this.props;if(!(!this.container.current||o.doNotVerifyPosition!=null&&o.doNotVerifyPosition)){var{top:c,left:m}=this.initialPosition,{width:g,height:b}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},_=((n=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&n!==void 0?n:0)>window.innerHeight;b===0||g===0||(c+b>window.innerHeight&&(c-b-l>0?c-=b-l:c=window.innerHeight-b),m+g>window.innerWidth&&(m=m-g-s),(d!==m||u!==c)&&(this.setState({hasOverflow:_}),a(c,m)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Kr.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,n=!1;t&&!n;)n=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;n||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n,o=!1;if(e.key==="Enter"||e.key===" "){n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="ArrowRight"?n>=0&&n<=t.length?o=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=j.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=j.getNextMenuItem(i,1,t)),o){this.openSubMenu(n),e.preventDefault(),e.stopPropagation();return}n!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:n}=this.state,i=t[e].actions?e:null;n!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{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();var{menuItems:n}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(n.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n),n>=0&&n<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:n}=this.props,{activeSubMenu:i,hasOverflow:o,keyboardIndex:a,menuItems:s,mouseIndex:l,pendingItems:u,subMenuTop:d,subMenuLeft:c,subMenuParentWidth:m,subMenuParentHeight:g}=this.state,b=0;b<s.length;b+=1){var _=s[b];b>0&&_.group!==s[b-1].group&&e.push(h.jsx("hr",{},"".concat(b,".separator")));var E=h.jsx(Qn,{ref:i===b?this.activeSubMenuRef:null,isKeyboardSelected:a===b,isMouseSelected:l===b,menuItem:_,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},b);e.push(E)}var D=null;u.length>0&&(D=h.jsx("div",{className:"loading",children:h.jsx(oo,{className:"loading-spinner-vertical-align"})}));var{menuStyle:A,"data-testid":M}=this.props,ne=i!==null&&d!==null&&c!==null;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:B({"has-overflow":o},"context-menu-container"),style:Ua({top:t,left:n},A),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:pt.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":M,children:[e,D]}),ne&&i!==null&&d!==null&&c!==null&&h.jsx(pt,{actions:s[i].actions||[],closeMenu:this.handleCloseSubMenu,top:d,left:c,updatePosition:(K,oe)=>{this.setState({subMenuTop:K,subMenuLeft:oe})},subMenuParentWidth:m,subMenuParentHeight:g},"sub-".concat(i))]})}}Ne(pt,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const qa=pt;function Hr(r,e,t){return e=Xa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xa(r){var e=Za(r,"string");return typeof e=="symbol"?e:String(e)}function Za(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qa extends y.Component{constructor(e){super(e),Hr(this,"container",void 0),Hr(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=T.createRef(),this.openMenu=T.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),n=e.clientY-t.top,i=e.clientX-t.left,{actions:o}=this.state;if(o!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var s=document.elementFromPoint(i,n),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});s?.dispatchEvent(l)});return}if(j.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var a=j.getMenuItems(e.contextActions);a.length!==0&&(e.preventDefault(),this.setState({actions:a,top:n,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:n,top:i,left:o}=this.state;return n&&(e=h.jsx(qa,{ref:this.openMenu,actions:n,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(a,s)=>{this.setState({top:a,left:s})},"data-testid":t})),h.jsx("div",{className:B("context-menu-root",{active:n}),ref:this.container,children:e})}}const kh=Qa;var Xt=T.forwardRef((r,e)=>{var{checked:t=!1,children:n,className:i,disabled:o,inputClassName:a,isInvalid:s,labelClassName:l,name:u,onChange:d,"data-testid":c}=r,[m]=y.useState(rt()),g=Gn(e);y.useEffect(function(){g.current&&(g.current.indeterminate=t===null)},[g,t]);var b=y.useCallback(_=>{g.current&&(g.current.indeterminate=t===null),d&&d(_)},[g,t,d]);return h.jsxs("div",{className:B("custom-control custom-checkbox",i),children:[h.jsx("input",{type:"checkbox",ref:g,checked:t??!1,className:B("custom-control-input",a,{"is-invalid":s}),disabled:o,id:m,name:u,onChange:b,"data-testid":c}),h.jsx("label",{className:B("custom-control-label",l),htmlFor:m,children:n})]})});Xt.displayName="Checkbox";Xt.propTypes={checked:(r,e)=>{var{[e]:t}=r;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:v.node.isRequired,className:v.string,disabled:v.bool,inputClassName:v.string,isInvalid:v.bool,labelClassName:v.string,name:v.string,onChange:v.func,"data-testid":v.string};Xt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Nh=Xt;function Fe(r,e,t){return e=Ya(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ya(r){var e=Ja(r,"string");return typeof e=="symbol"?e:String(e)}function Ja(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var zr=N.module("Shortcut"),P;(function(r){r.CTRL="MODIFIER_CTRL",r.CMD="MODIFIER_CMD",r.ALT="MODIFIER_ALT",r.OPTION="MODIFIER_OPTION",r.SHIFT="MODIFIER_SHIFT"})(P||(P={}));var w;(function(r){r.A="A",r.B="B",r.C="C",r.D="D",r.E="E",r.F="F",r.G="G",r.H="H",r.I="I",r.J="J",r.K="K",r.L="L",r.M="M",r.N="N",r.O="O",r.P="P",r.Q="Q",r.R="R",r.S="S",r.T="T",r.U="U",r.V="V",r.W="W",r.X="X",r.Y="Y",r.Z="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9",r.BACKSPACE="Backspace",r.ESCAPE="Escape",r.ENTER="Enter",r.DELETE="Delete",r.SLASH="/",r.QUESTION_MARK="?",r.BACKSLASH="\\",r.PIPE="|",r.MINUS="-",r.UNDERSCORE="_",r.EQUALS="=",r.PLUS="+",r.BACKTICK="`",r.TILDE="~",r.COMMA=",",r.LEFT_CHEVRON="<",r.PERIOD=".",r.RIGHT_CHEVRON=">",r.SEMICOLON=";",r.COLON=":",r.SINGLE_QUOTE="'",r.DOUBLE_QUOTE='"',r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.LEFT_CURLY="{",r.RIGHT_CURLY="}",r.F1="F1",r.F2="F2",r.F3="F3",r.F4="F4",r.F5="F5",r.F6="F6",r.F7="F7",r.F8="F8",r.F9="F9",r.F10="F10",r.F11="F11",r.F12="F12"})(w||(w={}));var es=new Set([w.ENTER,w.DELETE,w.F1,w.F2,w.F3,w.F4,w.F5,w.F6,w.F7,w.F8,w.F9,w.F10,w.F11,w.F12]);class R extends jn{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!R.isMacPlatform&&e.metaKey||!R.isAllowedKey(t))return!1;var n=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!n||es.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case P.CTRL:t.ctrlKey=!0;break;case P.ALT:case P.OPTION:t.altKey=!0;break;case P.CMD:t.metaKey=!0;break;case P.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:n}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!R.isAllowedKey(t)&&R.isAllowedKey(String.fromCharCode(n))?i=String.fromCharCode(n):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===w.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case w.ENTER:t+="⏎";break;case w.ESCAPE:t+="⎋";break;case w.BACKSPACE:t+="⌫";break;case w.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,i;return((n=e.keyValue)===null||n===void 0?void 0:n.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":R.isMacPlatform?R.getMacDisplayText(e):R.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:n,macShortcut:i,isEditable:o=!0,name:a,tooltip:s}=e;super(),Fe(this,"id",void 0),Fe(this,"name",void 0),Fe(this,"tooltip",void 0),Fe(this,"isEditable",void 0),Fe(this,"defaultKeyState",void 0),Fe(this,"keyState",void 0),this.id=t,this.name=a,this.tooltip=s,this.isEditable=o;var l=R.isMacPlatform,u=l?i:n;this.defaultKeyState=R.createKeyState(u),this.keyState=this.defaultKeyState}getDisplayText(){return R.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){R.isValidKeyState(e)?(zr.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Hn("onUpdate",{detail:this}))):zr.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return R.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(R.NULL_KEY_STATE)}isNull(){return R.doKeyStatesMatch(this.keyState,R.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return R.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(R.getKeyStateFromEvent(e))}}Fe(R,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Fe(R,"isMacPlatform",j.isMacPlatform());function Ur(r,e,t){return e=ts(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ts(r){var e=rs(r,"string");return typeof e=="symbol"?e:String(e)}function rs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vr=N.module("ShortcutRegistry");class ns extends jn{constructor(){super(...arguments),Ur(this,"shortcutMap",new Map),Ur(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new R(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Vr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Vr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:a}=o;return this.dispatchEvent(new Hn("onUpdate",{detail:a}))});var n=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)){var i;(i=this.shortcutsByCategory.get(n))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(n,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var is=Object.freeze(new ns);const Q=is;var os={COPY:Q.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[P.CTRL,w.C],macShortcut:[P.CMD,w.C],isEditable:!1}),PASTE:Q.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[P.CTRL,w.V],macShortcut:[P.CMD,w.V],isEditable:!1}),SAVE:Q.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[P.CTRL,w.S],macShortcut:[P.CMD,w.S],isEditable:!1}),SELECT_ALL:Q.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[P.CTRL,w.A],macShortcut:[P.CMD,w.A],isEditable:!1}),LINKER:Q.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[P.CTRL,w.L],macShortcut:[P.CMD,w.L]}),LINKER_CLOSE:Q.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:Q.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[P.CTRL,P.ALT,w.I],macShortcut:[P.CMD,P.SHIFT,w.I],isEditable:!0}),NEXT:Q.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:Q.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[P.SHIFT,w.ENTER],macShortcut:[P.SHIFT,w.ENTER],isEditable:!1})};const xt=os;function sr(r,e,t){return e=as(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function as(r){var e=ss(r,"string");return typeof e=="symbol"?e:String(e)}function ss(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Yn extends y.PureComponent{constructor(e){super(e),sr(this,"inputField",void 0),sr(this,"searchChangeSelection",void 0),this.inputField=T.createRef(),this.searchChangeSelection=T.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var n=t.getBoundingClientRect().width;e.style.paddingRight="".concat(n,"px")}}render(){var{value:e,placeholder:t,onBlur:n,onChange:i,className:o,disabled:a,matchCount:s,id:l,onKeyDown:u,"data-testid":d,cursor:c}=this.props,m,g=[{action:()=>c?.next("forward"),shortcut:xt.NEXT},{action:()=>c?.next("back"),shortcut:xt.PREVIOUS}];return c&&s>1?m=h.jsxs(h.Fragment,{children:[h.jsx(it,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:ao,tooltip:"Previous match (".concat(xt.PREVIOUS.getDisplayText(),")")}),h.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),h.jsx(it,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:so,tooltip:"Next match (".concat(xt.NEXT.getDisplayText(),")")})]}):m=s>0&&h.jsx("span",{className:"search-match",children:s}),h.jsxs("div",{className:B("search-group",o),children:[h.jsx("input",{type:"search",value:e,onBlur:n,onChange:i,onKeyDown:u,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:l,"data-testid":d}),s!=null?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:m}),h.jsx(za,{actions:g})]}):h.jsx("span",{className:"search-icon",children:h.jsx(ot,{icon:lo})})]})}}sr(Yn,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const ls=Yn;function Fh(r){var{copy:e,kind:t="ghost",tooltip:n="Copy",className:i,style:o,"data-testid":a,children:s}=r,[l,u]=Sa();return h.jsx(it,{kind:t,className:i,style:o,"data-testid":a,icon:l?uo:co,tooltip:l?"Copied":n,onClick:()=>{u(typeof e=="function"?e():e)},children:s})}function Gr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function us(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(t),!0).forEach(function(n){vt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function vt(r,e,t){return e=ds(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ds(r){var e=cs(r,"string");return typeof e=="symbol"?e:String(e)}function cs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Jn extends y.PureComponent{constructor(e){var t;super(e),vt(this,"container",void 0),vt(this,"oldFocus",void 0),vt(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=T.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:n}=e,i=(t=n.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=j.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:j.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;i=j.getNextMenuItem((o=i)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var a;i=j.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,1,t)}n!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:n,menuItems:i,mouseIndex:o}=this.state,a=0;a<i.length;a+=1){var s=i[a];a>0&&s.group!==i[a-1].group&&e.push(h.jsx("hr",{},"".concat(a,".separator")));var l=h.jsx(Qn,{isKeyboardSelected:n===a,isMouseSelected:o===a,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},a);e.push(l)}var{menuStyle:u}=this.props;return h.jsx("div",{className:"context-menu-container",style:us({},u),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}vt(Jn,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const hs=Jn;function qr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(t),!0).forEach(function(n){Je(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Je(r,e,t){return e=ms(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ms(r){var e=fs(r,"string");return typeof e=="symbol"?e:String(e)}function fs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ei extends y.PureComponent{constructor(e){super(e),Je(this,"container",void 0),Je(this,"parent",void 0),Je(this,"popper",void 0),Je(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=T.createRef(),this.parent=null,this.popper=T.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:n,"data-testid":i}=this.props,{menuStyle:o}=this.props,{options:a,popperOptions:s}=this.props;return s=Xr({placement:"bottom"},s),a=Xr({separateKeyboardMouse:!0},a),h.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:h.jsx(Vn,{ref:this.popper,options:s,className:B("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:h.jsx(hs,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:a,menuStyle:o})})})}}Je(ei,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const Lh=ei;function ti(r,e,t){return e=gs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gs(r){var e=vs(r,"string");return typeof e=="symbol"?e:String(e)}function vs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ri extends y.PureComponent{constructor(e){super(e),ti(this,"searchInput",void 0),this.searchInput=T.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=zi(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:i,"data-testid":o}=this.props,{value:a}=this.state;return h.jsx(ls,{value:a,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:i,"data-testid":o})}}ti(ri,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Rh=ri;function ni(r,e,t){return e=ps(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ps(r){var e=bs(r,"string");return typeof e=="symbol"?e:String(e)}function bs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ys=N.module("ItemListItem");class Zt extends y.Component{static handleKeyDown(){return ys.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),ni(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=T.createRef()}handleBlur(e){var{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){var{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){var{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){var{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){var{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:n,style:i,children:o,"data-testid":a}=this.props;return h.jsx("div",{className:B("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:Zt.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":a,children:o})}}ni(Zt,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const _s=Zt;function Zr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(n){ue(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ue(r,e,t){return e=ws(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ws(r){var e=Cs(r,"string");return typeof e=="symbol"?e:String(e)}function Cs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Yr=N.module("ItemList"),Jr=5;class _e extends y.PureComponent{static renderItem(e){var t,n,{item:i}=e;return h.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(n=i.displayValue)!==null&&n!==void 0?n:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),ue(this,"list",void 0),ue(this,"listContainer",void 0),ue(this,"getItemSelected",ct((i,o)=>We.isSelected(o,i),{max:_e.CACHE_SIZE})),ue(this,"getCachedItem",ct((i,o,a,s,l,u,d,c)=>{var m=u({item:a,itemIndex:i,isFocused:s,isSelected:l,style:d});return h.jsx(_s,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:d,children:m},o)},{max:_e.CACHE_SIZE})),ue(this,"getOuterElement",ct(i=>{var o=T.forwardRef((a,s)=>h.jsx("div",Qr({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o})),ue(this,"getInnerElement",ct(()=>{var i=T.forwardRef((o,a)=>h.jsx("div",Qr({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i})),ue(this,"getItemData",ct((i,o,a)=>({items:i,selectedRanges:o,renderItem:a}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=T.createRef(),this.listContainer=T.createRef();var{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:n,itemCount:i}=this.props,{focusIndex:o,isStuckToBottom:a,scrollOffset:s,height:l,selectedRanges:u}=this.state;if(a&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==u)this.setSelectedRanges(n);else if(u!==t.selectedRanges){var{onSelectionChange:d}=this.props;d(u)}if(o!==t.focusIndex){var{onFocusChange:c}=this.props;c(o)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-n;return i[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var n=this.getElement(e);n instanceof HTMLElement&&n.focus()}}scrollToItem(e){var t=this.getElement(e);t?.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:n}=this.state,i=We.isSelected(n,e),o=i||j.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:n,onSelect:i}=this.props;n&&this.setState(o=>{var{selectedRanges:a}=o;return{selectedRanges:We.selectRange(a,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Yr.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){Yr.debug2("item focus",e,t.target),this.setState(n=>{var{focusIndex:i}=n;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:n,isMultiSelect:i,disableSelect:o}=this.props,{mouseDownIndex:a,selectedRanges:s,mouseX:l,mouseY:u}=this.state;if(!(a==null||o)){var d=Math.abs(t.clientX-(l??0)),c=Math.abs(t.clientY-(u??0));d>Jr&&c>Jr&&this.setState({isDragging:!0}),(n||a===e)&&(this.focusItem(e),i?(!n&&!this.getItemSelected(e,s)&&!j.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(a,e),Math.max(a,e)])):this.toggleSelect(e,t.shiftKey,j.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:n,isDoubleClickSelect:i,onSelect:o}=this.props,{mouseDownIndex:a,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(a===e&&!s){var l=t.shiftKey,u=j.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,u,n),!i&&!l&&!u&&o(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:n,onSelect:i}=this.props,{focusIndex:o}=this.state,a=o;if(e.key==="Enter"||e.key===" "){!t&&a!=null&&this.setState({selectedRanges:[[a,a]]},()=>{a!=null&&i(a,e)});return}if(e.key==="ArrowUp")a!=null&&a>=0?a=Math.max(0,a-1):a=n-1;else if(e.key==="ArrowDown")a!=null&&a>=0?a=Math.min(a+1,n-1):a=0;else return;if(o!==a){e.stopPropagation(),e.preventDefault(),this.focusItem(a);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(a,l[0]),Math.max(a,l[1])])}else if(this.deselectAll(),a!==null)this.selectItem(a);else{var u;(u=this.listContainer.current)===null||u===void 0||u.focus()}this.scrollIntoView(a)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:n}=e;this.setState(i=>{if(t)return{scrollOffset:n};var{isStickyBottom:o}=this.props,{height:a}=i,s=o&&this.isListAtBottom({scrollOffset:n,height:a});return{isStuckToBottom:s,scrollOffset:n}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:a}=this.state;if(o&&t&&a.length>0){var s=a[a.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else o&&a.length===1&&a[0][0]===e&&a[0][1]===e?i&&this.deselectItem(e):o&&n?this.getItemSelected(e,a)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){We.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:We.deselectRange(n,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){We.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:We.selectRange(n,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:n,rowHeight:i}=this.props,o=Math.floor(e/i),a=o+Math.ceil(t/i);n(o,a)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:n,rowHeight:i}=this.props;return e+t>=n*i}renderInnerElement(e){var{index:t,style:n}=e,{items:i,offset:o,renderItem:a,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:u}=this.state;if(t<o||t>=o+i.length)return null;var d=i[t-o];return this.getCachedItem(t,t,d,t===l&&!s,this.getItemSelected(t,u),a,n,s)}render(){var{items:e,itemCount:t,overscanCount:n,renderItem:i,rowHeight:o,"data-testid":a}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return h.jsx(Ui,{className:"item-list-auto-sizer",onResize:this.handleResize,children:u=>{var{width:d,height:c}=u;return h.jsx(Vi,{className:"item-list-scroll-pane",height:c,width:d,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,s,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":a,children:this.renderInnerElement})}})}}ue(_e,"CACHE_SIZE",1e3);ue(_e,"DEFAULT_ROW_HEIGHT",20);ue(_e,"DEFAULT_OVERSCAN",10);ue(_e,"defaultProps",{offset:0,items:[],rowHeight:_e.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:_e.DEFAULT_OVERSCAN,renderItem:_e.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});class Wt{static reorder(e,t,n,i){var o=e===n?Wt.adjustDestinationIndex(i,t):i,a=Wt.removeItems(e,t);return n.splice(o,0,...a),a}static removeItems(e,t){for(var n=[],i=t.map((d,c)=>({range:d,index:c})).sort((d,c)=>c.range[0]-d.range[0]),o=0;o<i.length;o+=1){var{range:a,index:s}=i[o],[l,u]=a;n[s]=e.splice(l,u-l+1)}return Gi(n)}static adjustDestinationIndex(e,t){for(var n=e,i=0;i<t.length;i+=1){var[o,a]=t[i];if(o>e)break;n-=Math.min(a,e-1)-o+1}return n}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const $h=Wt;function jh(r){var{on:e,id:t,className:n,isInvalid:i,disabled:o=!1,onClick:a,"data-testid":s}=r;return h.jsx("button",{type:"button",className:B("btn","btn-switch",n,{active:e},{"is-invalid":i}),id:t,onClick:a,disabled:o,"data-testid":s,children:h.jsx("div",{className:"handle"})})}const Ss={"dh-spectrum-palette":"_dh-spectrum-palette_1mcqx_1"},Ps={"dh-spectrum-alias":"_dh-spectrum-alias_9ny19_1"};function en(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?en(Object(t),!0).forEach(function(n){Es(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Es(r,e,t){return e=Ms(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ms(r){var e=Ts(r,"string");return typeof e=="symbol"?e:String(e)}function Ts(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var rn=tn(tn({},Ss),Ps);function nn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Dt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nn(Object(t),!0).forEach(function(n){Is(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Is(r,e,t){return e=Os(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Os(r){var e=xs(r,"string");return typeof e=="symbol"?e:String(e)}function xs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var{global:Ds,light:As,dark:ks,medium:Ns,large:Fs}=qi,Ls={global:Ds,light:Dt(Dt({},As),rn),dark:Dt(Dt({},ks),rn),medium:Ns,large:Fs};function Rs(r){var{children:e,isPortal:t=!1,theme:n=Ls,colorScheme:i}=r,[o]=y.useState(t?rt():null);return h.jsx(Xi,{UNSAFE_className:"spectrum-theme-provider",theme:n,colorScheme:i,"data-unique-id":o,children:e})}var $s=N.module("ThemeProvider"),ii=y.createContext(null);function Bh(r){var{themes:e,defaultPreloadValues:t=yo,children:n}=r,i=y.useMemo(()=>ho(),[]),[o,a]=y.useState(null),[s,l]=y.useState(()=>{var c,m;return(c=(m=mo())===null||m===void 0?void 0:m.themeKey)!==null&&c!==void 0?c:fo}),u=y.useMemo(()=>e==null?null:go(s,{base:i,custom:e??[]}),[i,s,e]),d=y.useMemo(()=>[...i,...e??[]],[i,e]);return y.useEffect(function(){if(!(u==null||e==null)){vo(t);var m=po(t);$s.debug2("updateThemePreloadData:",{active:u.map(g=>g.themeKey),custom:e.map(g=>g.themeKey),preloadStyleContent:m,selectedThemeKey:s}),bo({themeKey:s,preloadStyleContent:m})}},[u,s,e,t]),y.useEffect(()=>{a({activeThemes:u,selectedThemeKey:s,themes:d,setSelectedThemeKey:l})},[u,s,d]),h.jsxs(h.Fragment,{children:[u==null?null:h.jsx(h.Fragment,{children:u.map(c=>h.jsx("style",{"data-theme-key":c.themeKey,children:c.styleContent},c.themeKey))}),o==null?null:h.jsx(ii.Provider,{value:o,children:h.jsx(Rs,{children:n})})]})}function js(){return St(ii,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var Bs=["children","className","onChange","data-testid"];function on(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function an(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?on(Object(t),!0).forEach(function(n){Ws(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ws(r,e,t){return e=Ks(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ks(r){var e=Hs(r,"string");return typeof e=="symbol"?e:String(e)}function Hs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function zs(r,e){if(r==null)return{};var t=Us(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Us(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var oi=T.forwardRef((r,e)=>{var{children:t,className:n,onChange:i,"data-testid":o}=r,a=zs(r,Bs),s=Gn(e),l=y.useCallback(u=>{i(u.target.value)},[i]);return h.jsx("select",an(an({ref:s,className:B("custom-select",n),onChange:l,"data-testid":o},a),{},{children:t}))});oi.displayName="Select";const Wh=oi;function Kh(){return St(_o,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}const Vs="var(--dh-color-editor-bg)",Gs="var(--dh-color-editor-fg)",qs="var(--dh-color-editor-string)",Xs="var(--dh-color-editor-delimiter)",Zs="var(--dh-color-editor-predefined)",Qs="var(--dh-color-editor-keyword)",Ys="var(--dh-color-editor-storage)",Js="var(--dh-color-editor-number)",el="var(--dh-color-editor-operator)",tl="var(--dh-color-editor-identifier)",rl="var(--dh-color-editor-comment)",sn={"error-foreground":"var(--dh-color-editor-error-fg)",background:Vs,foreground:Gs,"line-height":"19px",string:qs,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:Xs,predefined:Zs,keyword:Qs,storage:Ys,number:Js,operator:el,identifier:tl,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:rl,"editor-bracket-foreground1":"var(--dh-color-editor-bracket-fg1)","editor-bracket-foreground2":"var(--dh-color-editor-bracket-fg2)","editor-bracket-foreground3":"var(--dh-color-editor-bracket-fg3)","editor-bracket-foreground4":"var(--dh-color-editor-bracket-fg4)","editor-bracket-foreground5":"var(--dh-color-editor-bracket-fg5)","editor-bracket-foreground6":"var(--dh-color-editor-bracket-fg6)","editor-unexpected-bracket-foreground":"var(--dh-color-editor-unexpected-bracket-fg)","input-option-active-border":"var(--dh-color-editor-input-option-active-border)","focus-border":"var(--dh-color-editor-focus-border)","input-background":"var(--dh-color-editor-input-bg)","input-foreground":"var(--dh-color-editor-input-fg)","input-border":"var(--dh-color-editor-input-border)","editor-line-number-foreground":"var(--dh-color-editor-line-number-fg)","editor-selection-background":"var(--dh-color-editor-selection-bg)","editor-inactive-selection-background":"var(--dh-color-editor-inactive-selection-bg)","editor-selection-highlight-background":"var(--dh-color-editor-selection-highlight-bg)","editor-line-highlight-background":"var(--dh-color-editor-line-highlight-bg)","editor-word-highlight-background":"var(--dh-color-editor-word-highlight-bg)","context-menu-background":"var(--dh-color-editor-context-menu-bg)","context-menu-foreground":"var(--dh-color-editor-context-menu-fg)","menu-selection-background":"var(--dh-color-editor-menu-selection-bg)","menu-selection-foreground":"var(--dh-color-editor-menu-selection-fg)","log-date":"var(--dh-color-editor-log-date)","log-error":"var(--dh-color-editor-log-error)","log-info":"var(--dh-color-editor-log-info)","log-stdout":"var(--dh-color-editor-log-stdout)","log-warn":"var(--dh-color-editor-log-warn)","log-debug":"var(--dh-color-editor-log-debug)","log-trace":"var(--dh-color-editor-log-trace)","editor-find-match-background":"var(--dh-color-editor-find-match-bg)","editor-find-match-highlight-background":"var(--dh-color-editor-find-match-highlight-bg)","editor-widget-background":"var(--dh-color-editor-find-bg)","input-option-active-background":"var(--dh-color-editor-find-option-active-bg)","input-option-active-foreground":"var(--dh-color-editor-find-option-active-fg)","editor-suggest-widget-background":"var(--dh-color-editor-suggest-bg)","editor-suggest-widget-border":"var(--dh-color-editor-suggest-border)","editor-suggest-widget-foreground":"var(--dh-color-editor-suggest-fg)","editor-suggest-widget-selected-background":"var(--dh-color-editor-suggest-selected-bg)","editor-suggest-widget-selected-foreground":"var(--dh-color-editor-suggest-selected-fg)","editor-suggest-widget-highlightForeground":"var(--dh-color-editor-suggest-highlight-fg)","editor-suggest-widget-focus-highlight-foreground":"var(--dh-color-editor-suggest-focus-highlight-fg)","list-hover-background":"var(--dh-color-editor-suggest-hover-bg)","text-link-foreground":"var(--dh-color-editor-link-foreground)","text-link-active-foreground":"var(--dh-color-editor-link-active-fg)","editor-link-active-foreground":"var(--dh-color-editor-link-active-fg)"};var nl="python",il={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},ol={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","exec","in","raise","continue","finally","is","return","for","try",":","=","isinstance","__debug__"],storage:["class","def","async","lambda"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@storage":"storage","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]]}},al={id:nl,conf:il,language:ol};const sl=al;var ll="groovy",ul={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},dl={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","println","class","exec","in","raise","continue","finally","is","return","def","for","lambda","try",":","=","isinstance","__debug__"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doccomment:[[/[^/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]]}},cl={id:ll,conf:ul,language:dl};const hl=cl;var ml="scala",fl={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:/^\s*\/\/\s*(?:(?:#?region\b)|(?:<editor-fold\b))/,end:/^\s*\/\/\s*(?:(?:#?endregion\b)|(?:<\/editor-fold>))/}}},gl={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=><!~?:&|+\-*/^\\%@#]+/,digits:/\d+(_+\d+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,escapes:/\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,fstring_conv:/[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,tokenizer:{root:[[/\braw"""/,{token:"string.quote",bracket:"@open",next:"@rawstringt"}],[/\braw"/,{token:"string.quote",bracket:"@open",next:"@rawstring"}],[/\bs"""/,{token:"string.quote",bracket:"@open",next:"@sstringt"}],[/\bs"/,{token:"string.quote",bracket:"@open",next:"@sstring"}],[/\bf""""/,{token:"string.quote",bracket:"@open",next:"@fstringt"}],[/\bf"/,{token:"string.quote",bracket:"@open",next:"@fstring"}],[/"""/,{token:"string.quote",bracket:"@open",next:"@stringt"}],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/0[xX](@hexdigits)[Ll]?/,"number.hex","@allowMethod"],[/(@digits)[fFdD]/,"number.float","@allowMethod"],[/(@digits)[lL]?/,"number","@allowMethod"],[/\b_\*/,"key"],[/\b(_)\b/,"keyword","@allowMethod"],[/\bimport\b/,"keyword","@import"],[/\b(case)([ \t]+)(class)\b/,["keyword.modifier","white","keyword"]],[/\bcase\b/,"keyword","@case"],[/\bva[lr]\b/,"keyword","@vardef"],[/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,["keyword","white","identifier"]],[/@name(?=[ \t]*:(?!:))/,"variable"],[/(\.)(@name|@symbols)/,[{token:"operator"},{token:"@rematch",next:"@allowMethod"}]],[/([{(])(\s*)(@name(?=\s*=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,[{token:"string"},{token:"string.escape"},{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},vl={id:ml,conf:fl,language:gl};const pl=vl;var bl="deephavenDb",yl={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},_l={tokenPostfix:".js",keywords:["boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with"],builtins:["define","require","window","document","undefined"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[~!@#%\^&*-+=|\\:`<>.?\/]+/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,exponent:/[eE][\-+]?[0-9]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/([a-zA-Z_\$][\w\$]*)(\s*)(:?)/,{cases:{"$1@keywords":["keyword","white","delimiter"],$3:["key.identifier","white","delimiter"],"$1@builtins":["predefined.identifier","white","delimiter"],"@default":["identifier","white","delimiter"]}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash",bracket:"@open",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/[;,.]/,"delimiter"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d+\.\d*(@exponent)?/,"number.float"],[/\.\d+(@exponent)?/,"number.float"],[/\d+@exponent/,"number.float"],[/0[xX][\da-fA-F]+/,"number.hex"],[/0[0-7]+/,"number.octal"],[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment.invalid"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[{token:"@brackets.regexp.escape.control"},{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],["/",{token:"regexp.slash",bracket:"@close"},"@pop"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]]}},wl={id:bl,conf:yl,language:_l};const Cl=wl;var Sl="log",Pl={},El={tokenizer:{root:[[/ FATAL[\s\S]*/,{token:"error",next:"@error"}],[/ ERROR[\s\S]*/,{token:"error",next:"@error"}],[/ STDERR[\s\S]*/,{token:"error",next:"@error"}],[/ STDOUT.*/,{token:"stdout",next:"@stdout"}],[/ INFO[\s\S]*/,{token:"info",next:"@info"}],[/ WARN.*/,{token:"warn",next:"@warn"}],[/ TRACE[\s\S]*/,{token:"trace",next:"@trace"}],[/ DEBUG[.\s\S]*/,{token:"debug",next:"@debug"}],[/^\d{2}:\d{2}:\d{2}.\d{3}/,"date"]],error:[{include:"@body"}],info:[{include:"@body"}],warn:[{include:"@body"}],stdout:[{include:"@body"}],trace:[{include:"@body"}],debug:[{include:"@body"}],body:[[/^\d{2}:\d{2}:\d{2}.\d{3}/,{token:"date",next:"@pop"}],[/[\s\S]*/,{token:"$S0"}]]}},Ml={id:Sl,conf:Pl,language:El};const Tl=Ml;function ln(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function un(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ln(Object(t),!0).forEach(function(n){Il(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Il(r,e,t){return e=Ol(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ol(r){var e=xl(r,"string");return typeof e=="symbol"?e:String(e)}function xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Se=N.module("MonacoUtils");class Te{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Se.debug("Initializing Monaco..."),e!==void 0&&Te.registerGetWorker(e);var{initTheme:t,registerLanguages:n}=Te;t(),n([Cl,sl,hl,Tl,pl]),Te.removeConflictingKeybindings(),Se.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:n}=Te,i=Bn(sn);Se.debug2("Monaco theme:",sn),Se.debug2("Monaco theme derived:",i);var o=[{token:"",foreground:n(i.foreground)},{token:"string",foreground:n(i.string)},{token:"string.delim",foreground:n(i["string-delim"])},{token:"keyword",foreground:n(i.keyword)},{token:"identifier.js",foreground:n(i["identifier-js"])},{token:"delimiter",foreground:n(i.delimiter)},{token:"comment",foreground:n(i.comment)},{token:"number",foreground:n(i.number)},{token:"storage",foreground:n(i.storage)},{token:"identifier",foreground:n(i.identifier)},{token:"namespace.identifier",foreground:n(i["namespace-identifier"])},{token:"operator",foreground:n(i.operator)},{token:"predefined",foreground:n(i.predefined)},{token:"error.log",foreground:(e=(t=i["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:n(i["log-warn"])},{token:"info.log",foreground:n(i["log-info"])},{token:"stdout.log",foreground:n(i["log-stdout"])},{token:"trace.log",foreground:n(i["log-trace"])},{token:"debug.log",foreground:n(i["log-debug"])},{token:"date.log",foreground:n(i["log-date"])}],a={foreground:i.foreground,errorForeground:i["error-foreground"],"inputOption.activeBorder":i["input-option-active-border"],"editor.background":i.background,"editor.foreground":i.foreground,"editor.lineHighlightBackground":i["editor-line-highlight-background"],"editorLineNumber.foreground":i["editor-line-number-foreground"],"editor.selectionBackground":i["editor-selection-background"],"editor.inactiveSelectionBackground":i["editor-inactive-selection-background"],"editor.selectionHighlightBackground":i["editor-selection-highlight-background"],"editor.wordHighlightBackground":i["editor-word-highlight-background"],"editor.findMatchBackground":i["editor-find-match-background"],"editor.findMatchHighlightBackground":i["editor-find-match-highlight-background"],"editorSuggestWidget.background":i["editor-suggest-widget-background"],"editorSuggestWidget.border":i["editor-suggest-widget-border"],"editorSuggestWidget.foreground":i["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":i["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":i["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":i["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":i["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":i["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":i["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":i["list-hover-background"],"dropdown.background":i["context-menu-background"],"dropdown.foreground":i["context-menu-foreground"],"menu.selectionBackground":i["menu-selection-background"],"menu.selectionForeground":i["menu-selection-foreground"],"keybindingLabel.foreground":i["menu-selection-foreground"],"list.focusBackground":i["menu-selection-background"],"editorWidget.background":i["editor-widget-background"],"inputOption.activeBackground":i["input-option-active-background"],"inputOption.activeForeground":i["input-option-active-foreground"],focusBorder:i["focus-border"],"input.background":i["input-background"],"input.foreground":i["input-foreground"],"input.border":i["input-border"],"textLink.foreground":i["text-link-foreground"],"textLink.activeForeground":i["text-link-active-foreground"],"editorLink.activeForeground":i["editor-link-active-foreground"],"editorBracketHighlight.foreground1":i["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":i["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":i["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":i["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":i["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":i["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":i["editor-unexpected-bracket-foreground"]};ke.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:a});try{ke.setTheme("dh-dark")}catch(s){Se.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),ke.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=un(un({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e?.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(n=>{var{id:i}=n;return i});Ye.getLanguages().filter(n=>{var{id:i}=n;return t.includes(i)}).forEach(n=>{var i=n;Se.debug2("Overriding default language loader:",i.id)}),e.forEach(n=>{Te.registerLanguage(n)})}static registerLanguage(e){Se.debug2("Registering language: ",e.id),Ye.register(e),Ye.onLanguage(e.id,()=>{Ye.setLanguageConfiguration(e.id,e.conf),Ye.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(n)}static openDocument(e,t){var n=e.getModel();Be(n);var i={textDocument:{uri:"".concat(n.uri),languageId:n.getLanguageId(),version:n.getVersionId(),text:n.getValue()}};Se.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var o=e.onDidChangeModelContent(a=>{for(var{changes:s,versionId:l}=a,u=[],d=0;d<s.length;d+=1){var c=s[d],{range:m,rangeLength:g,text:b}=c,_={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:g,text:b};u.push(_)}if(u.length>0){var E={textDocument:{version:l,uri:"".concat(n.uri)},contentChanges:u};Se.debug2("didChangeDocumentParams",E),t.changeDocument(E)}});return o}static closeDocument(e,t){var n=e.getModel();Be(n);var i={textDocument:{uri:"".concat(n.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var n=/“|”/g,i=/\u200b/g,o=/\u00A0/g,a=e.getModel();Be(a);var s=a.getValueInRange(t.range);(n.test(s)||i.test(s)||o.test(s))&&a.applyEdits([{range:t.range,text:s.replace(n,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){ke.addKeybindingRule({keybinding:fe.CtrlCmd|or.KeyD,command:null}),Te.isMacPlatform()||ke.addKeybindingRule({keybinding:fe.CtrlCmd|or.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(rt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:n}=t;if(n===null)return 0;var i=Te.isMacPlatform();return i?(t.metaKey?fe.CtrlCmd:0)|(t.shiftKey?fe.Shift:0)|(t.altKey?fe.Alt:0)|(t.ctrlKey?fe.WinCtrl:0)|xr.fromString(n):(t.ctrlKey?fe.CtrlCmd:0)|(t.shiftKey?fe.Shift:0)|(t.altKey?fe.Alt:0)|(t.metaKey?fe.WinCtrl:0)|xr.fromString(n)}static provideLinks(e){for(var t=[],n=function(a){var s=e.getLineContent(a),l=Zi(s),u=l.filter(d=>d.type==="url"?/^https?:\/\//.test(d.value):!0);u.forEach(d=>{t.push({url:d.href,range:new Mo(a,d.start+1,a,d.end+1)})})},i=1;i<=e.getLineCount();i+=1)n(i);return{links:t}}}const Dl=Te;function dn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Al(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dn(Object(t),!0).forEach(function(n){Kt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Kt(r,e,t){return e=kl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kl(r){var e=Nl(r,"string");return typeof e=="symbol"?e:String(e)}function Nl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ai extends y.Component{constructor(e){super(e),Kt(this,"container",void 0),Kt(this,"editor",void 0),this.handleResize=this.handleResize.bind(this),this.container=null,this.state={}}componentDidMount(){this.initEditor(),window.addEventListener("resize",this.handleResize)}componentWillUnmount(){window.removeEventListener("resize",this.handleResize),this.destroyEditor()}setLanguage(e){if(this.editor){var t=this.editor.getModel();Be(t),ke.setModelLanguage(t,e)}}handleResize(){this.updateDimensions()}toggleFind(){this.editor&&(this.editor.focus(),this.editor.trigger("toggleFind","actions.find",void 0))}updateDimensions(){var e;(e=this.editor)===null||e===void 0||e.layout()}initEditor(){var{onEditorInitialized:e}=this.props,{settings:t}=this.props;t=Al({copyWithSyntaxHighlighting:!1,fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"python",lineNumbersMinChars:3,minimap:{enabled:!1},scrollBeyondLastLine:!1,tabCompletion:"on",value:"",wordWrap:"off",links:!0},t),Be(this.container),this.editor=ke.create(this.container,t),this.editor.addAction({id:"find",label:"Find",keybindings:[fe.CtrlCmd|or.KeyF],precondition:void 0,keybindingContext:void 0,contextMenuGroupId:"navigation",contextMenuOrder:1,run:()=>{this.toggleFind()}}),this.editor.layout(),Ye.registerLinkProvider("plaintext",{provideLinks:Dl.provideLinks}),e(this.editor)}destroyEditor(){var{onEditorWillDestroy:e}=this.props;Be(this.editor),e(this.editor),this.editor.dispose(),this.editor=void 0}render(){var{className:e}=this.props;return h.jsx("div",{className:B("editor-container",e),ref:t=>{this.container=t}})}}Kt(ai,"defaultProps",{className:"fill-parent-absolute",onEditorInitialized:()=>{},onEditorWillDestroy:()=>{},settings:{}});const Hh=ai;function br(r,e,t){return e=Fl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fl(r){var e=Ll(r,"string");return typeof e=="symbol"?e:String(e)}function Ll(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qt{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}br(Qt,"TYPE_GLOBAL","type-global");br(Qt,"TYPE_CONTEXT_PRESET","type-context-preset");br(Qt,"TYPE_CONTEXT_CUSTOM","type-context-custom");const re=Qt;class Rl extends re{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const $l=Rl;class jl extends re{format(e){return String.fromCharCode(e)}}const Bl=jl;function Le(r,e,t){return e=Wl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wl(r){var e=Kl(r,"string");return typeof e=="symbol"?e:String(e)}function Kl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cn=N.module("DateTimeColumnFormatter");class ye extends re{static isValid(e,t){try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re.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){var n=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var n=ye.makeGlobalFormatStringMap(e,t);return[...n.keys()]}static makeFormatStringMap(e,t){var n=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var n=ye.makeFormatStringMap(e,t);return[...n.keys()]}constructor(e){var{timeZone:t="",showTimeZone:n=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=ye.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Le(this,"dh",void 0),Le(this,"dhTimeZone",void 0),Le(this,"defaultDateTimeFormatString",void 0),Le(this,"showTimeZone",void 0),Le(this,"showTSeparator",void 0),Le(this,"formatStringMap",void 0);var a=t||ye.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{cn.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ye.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=n,this.showTSeparator=i,this.formatStringMap=ye.makeFormatStringMap(n,i)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(n);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{cn.error("Invalid format arguments")}return""}}Le(ye,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Le(ye,"DEFAULT_TIME_ZONE_ID","America/New_York");function Ce(r,e,t){return e=Hl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hl(r){var e=zl(r,"string");return typeof e=="symbol"?e:String(e)}function zl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ul=N.module("DecimalColumnFormatter");class W extends re{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return W.makeFormat(e,t,re.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return W.makeFormat("Custom Format",e,re.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}constructor(e){var{defaultFormatString:t=W.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ce(this,"defaultFormatString",void 0),Ce(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,i)}catch{Ul.error("Invalid format arguments")}return""}}Ce(W,"DEFAULT_FORMAT_STRING","###,##0.0000");Ce(W,"FORMAT_PERCENT",W.makePresetFormat("Percent","##0.00%"));Ce(W,"FORMAT_BASIS_POINTS",W.makePresetFormat("Basis Points","###,##0 bp",1e4));Ce(W,"FORMAT_MILLIONS",W.makePresetFormat("Millions","###,##0.000 mm",1e-6));Ce(W,"FORMAT_SCIENTIFIC_NOTATION",W.makePresetFormat("Scientific Notation","0.0000E0"));Ce(W,"FORMAT_ROUND",W.makePresetFormat("Round","###,##0"));Ce(W,"FORMAT_ROUND_TWO_DECIMALS",W.makePresetFormat("0.00","###,##0.00"));Ce(W,"FORMAT_ROUND_FOUR_DECIMALS",W.makePresetFormat("0.0000","###,##0.0000"));class Vl extends re{format(e){return"".concat(e)}}const Gl=Vl;function bt(r,e,t){return e=ql(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ql(r){var e=Xl(r,"string");return typeof e=="symbol"?e:String(e)}function Xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Zl=N.module("IntegerColumnFormatter");class we extends re{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return we.makeFormat(e,t,re.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return we.makeFormat("Custom Format",e,re.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}constructor(e){var{defaultFormatString:t=we.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bt(this,"dh",void 0),bt(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(n,i)}catch{Zl.error("Invalid format arguments")}return""}}bt(we,"DEFAULT_FORMAT_STRING","###,##0");bt(we,"FORMAT_MILLIONS",we.makePresetFormat("Millions","###,##0.000 mm",1e-6));bt(we,"FORMAT_SCIENTIFIC_NOTATION",we.makePresetFormat("Scientific Notation","0.0000E0"));class Ql extends re{format(e){return e}}function si(r,e,t){return e=Yl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yl(r){var e=Jl(r,"string");return typeof e=="symbol"?e:String(e)}function Jl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Z{static makeDateWrapper(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var d="".concat(n).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),m="".concat(o).padStart(2,"0"),g="".concat(a).padStart(2,"0"),b="".concat(s).padStart(2,"0"),_="".concat(l).padStart(2,"0"),E="".concat(u).padStart(9,"0"),D="".concat(d,"-").concat(c,"-").concat(m," ").concat(g,":").concat(b,":").concat(_,".").concat(E);return e.i18n.DateTimeFormat.parse(Z.FULL_DATE_FORMAT,D,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),n="0".repeat(9-e.length),i="".concat(t+1).concat(n);return parseInt(i,10)}static getNextDate(e,t,n,i){var{year:o,month:a,date:s,hours:l,minutes:u,seconds:d,nanos:c}=n;if(t.nanos!=null){if(t.nanos.length===9)return null;c=Z.getNextNanos(t.nanos),c>999999999&&(d+=1,c=0)}else t.seconds!=null?d+=1:t.minutes!=null?u+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?a+=1:o+=1;var m=new Date(o,a,s,l,u,d);return Z.makeDateWrapper(e,i,m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes(),m.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var n=e.trim().toLowerCase();if(n.length>=3){for(var i=0;i<Z.months.length;i+=1)if(Z.months[i].startsWith(n))return i}return NaN}static parseDateValues(e,t,n,i,o,a,s){var l=parseInt(e,10),u=t!=null?this.parseMonth(t):0,d=n!=null?parseInt(n,10):1,c=i!=null?parseInt(i,10):0,m=o!=null?parseInt(o,10):0,g=a!=null?parseInt(a,10):0,b=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(u)||Number.isNaN(d)||Number.isNaN(c)||Number.isNaN(m)||Number.isNaN(g)||Number.isNaN(b)?null:{year:l,month:u,date:d,hours:c,minutes:m,seconds:g,nanos:b}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,n=t.exec(e);if(n==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,o,,a,,s,,l,,u,,d,c]=n;if(c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));return{year:i,month:o,date:a,hours:s,minutes:l,seconds:u,nanos:d}}static parseDateRange(e,t,n){var i=t.trim().toLowerCase();if(i.length===0)throw new Error("Cannot parse date range from empty string");if(i==="null")return[null,null];if(i==="today"){var o=new Date(Date.now()),a=Z.makeDateWrapper(e,n,o.getFullYear(),o.getMonth(),o.getDate()),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),l=Z.makeDateWrapper(e,n,s.getFullYear(),s.getMonth(),s.getDate());return[a,l]}if(i==="yesterday"){var u=new Date(Date.now()),d=new Date(u.getFullYear(),u.getMonth(),u.getDate()-1),c=Z.makeDateWrapper(e,n,d.getFullYear(),d.getMonth(),d.getDate()),m=Z.makeDateWrapper(e,n,u.getFullYear(),u.getMonth(),u.getDate());return[c,m]}if(i==="now"){var g=new Date(Date.now()),b=e.DateWrapper.ofJsDate(g);return[b,null]}var _=Z.parseDateTimeString(i);if(_.year==null&&_.month==null&&_.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var E=Z.parseDateValues(_.year,_.month,_.date,_.hours,_.minutes,_.seconds,_.nanos);if(E==null)throw new Error("Unable to extract date values from ".concat(_));var D=Z.makeDateWrapper(e,n,E.year,E.month,E.date,E.hours,E.minutes,E.seconds,E.nanos),A=Z.getNextDate(e,_,E,n);return[D,A]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}si(Z,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");si(Z,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);const hn=Z;function zh(r,e){return r===e?{operator:"notEq",value:""}:{operator:"eq",value:r}}function Uh(r,e,t){return function(i){var o=t.trim();if(o==="")return null;var a=li(e,s=>s.filter().containsIgnoreCase(r.makeFilterValue(s.type,o)),"or");return a(i)}}function li(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var o=i?.findColumns(typeof r=="string"?[r]:r);if(o==null||o.length===0)return null;var a=o.map(e);return a.reduce((s,l)=>s[t](l))}}function eu(r,e,t,n){return li(e,i=>i.filter()[n](r.makeFilterValue(i.type,t)),"or")}function Vh(r,e,t,n,i){return function(a){var s=a?.findColumn(e),l=t==="all"||n&&t.size===0;return s==null||l?null:r.makeSelectValueFilter(s,[...t.keys()],i)}}function Gh(r){return function(t){return t.filter().isNull().not().and(t.filter().notEq(r.makeFilterValue(t.type,"")))}}function qh(r,e){return function(n){var i=n.filter(),o=r.makeFilterValue(n.type,""),a=i.eq(o);return e?i.isNull().or(a):a.or(i.notEq(o))}}function yr(r,e,t){return e=tu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tu(r){var e=ru(r,"string");return typeof e=="symbol"?e:String(e)}function ru(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt{}yr(yt,"not","not");yr(yt,"and","and");yr(yt,"or","or");function Xh(r){if(!(r==="not"||r==="and"||r==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function F(r,e,t){return e=nu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=iu(r,"string");return typeof e=="symbol"?e:String(e)}function iu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class p{}F(p,"eq","eq");F(p,"eqIgnoreCase","eqIgnoreCase");F(p,"notEq","notEq");F(p,"notEqIgnoreCase","notEqIgnoreCase");F(p,"greaterThan","greaterThan");F(p,"greaterThanOrEqualTo","greaterThanOrEqualTo");F(p,"lessThan","lessThan");F(p,"lessThanOrEqualTo","lessThanOrEqualTo");F(p,"in","in");F(p,"inIgnoreCase","inIgnoreCase");F(p,"notIn","notIn");F(p,"notInIgnoreCase","notInIgnoreCase");F(p,"isTrue","isTrue");F(p,"isFalse","isFalse");F(p,"isNull","isNull");F(p,"invoke","invoke");F(p,"contains","contains");F(p,"notContains","notContains");F(p,"containsIgnoreCase","containsIgnoreCase");F(p,"startsWith","startsWith");F(p,"endsWith","endsWith");F(p,"containsAny","containsAny");var mn=N.module("ViewportDataUtils");function ou(r,e){return String(r.offsetInSnapshot+e)}function Zh(r,e){var{bulkUpdate:t}=r;return function(i){var{columns:o,offset:a,rows:s}=i.detail;mn.debug("table updated",i.detail);var l=new Map;s.forEach(u=>{var d=e(u,o),c=ou(u,a);l.set(c,{key:c,item:d})}),mn.debug("update keys",l),t(l)}}function Qh(r,e){return e.reduce((t,n)=>(t[n.name]=r.get(n),t),{})}function*Yh(r,e){for(var t=r;t<=e;++t)yield{key:String(t)}}function au(r){return r==null||su(r)?0:r.size}function su(r){return"isClosed"in r?r.isClosed:!1}function Jh(r,e,t,n){var i=r+e-1,[o,a]=[0,n-1],s=Ir(r-t,o,a),l=Ir(i+t,o,a);return[s,l]}function fn(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Ae(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){fn(o,n,i,a,s,"next",l)}function s(l){fn(o,n,i,a,s,"throw",l)}a(void 0)})}}function ze(r,e,t){return e=lu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lu(r){var e=uu(r,"string");return typeof e=="symbol"?e:String(e)}function uu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pe=N.module("TableUtils");class f{static copyTableAndApplyFilters(e){var t=arguments;return Ae(function*(){if(e==null)return null;for(var n=yield e.copy(),i=t.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=t[a];return n.applyFilter(er(...o.map(s=>s(n)))),n})()}static getSortIndex(e,t){for(var n=0;n<e.length;n+=1){var i,o=e[n];if(((i=o.column)===null||i===void 0?void 0:i.name)===t)return n}return null}static getSortForColumn(e,t){var n=f.getSortIndex(e,t);return n!=null?e[n]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return f.isBooleanType(e)?[p.isTrue,p.isFalse,p.isNull]:f.isCharType(e)||f.isNumberType(e)||f.isDateType(e)?[p.eq,p.notEq,p.greaterThan,p.greaterThanOrEqualTo,p.lessThan,p.lessThanOrEqualTo]:f.isTextType(e)?[p.eq,p.eqIgnoreCase,p.notEq,p.notEqIgnoreCase,p.contains,p.notContains,p.startsWith,p.endsWith]:[]}static getNextSort(e,t,n){if(n<0||n>=e.length)return null;var i=f.getSortForColumn(t,e[n].name);return i===null?e[n].sort().asc():i.direction===f.sortDirection.ascending?i.desc():null}static makeColumnSort(e,t,n,i){if(t<0||t>=e.length||n===f.sortDirection.none)return null;var o=e[t].sort();switch(n){case f.sortDirection.ascending:o=o.asc();break;case f.sortDirection.descending:o=o.desc();break}return i&&(o=o.abs()),o}static toggleSortForColumn(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n<0||n>=t.length)return[];var o=f.getNextSort(t,e,n);return f.setSortForColumn(e,t[n].name,o,i)}static sortColumn(e,t,n,i,o,a){if(n<0||n>=t.length)return[];var s=f.makeColumnSort(t,n,i,o);return f.setSortForColumn(e,t[n].name,s,a)}static setSortForColumn(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=f.getSortIndex(e,t),a=[];return i&&(a=a.concat(e.filter(s=>{var{direction:l}=s;return l!==f.sortDirection.reverse})),o!==null&&a.splice(o,1)),n!==null&&a.push(n),a}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case f.dataType.BOOLEAN:return f.dataType.BOOLEAN;case"char":case"java.lang.Character":case f.dataType.CHAR:return f.dataType.CHAR;case"java.lang.String":case f.dataType.STRING:return f.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case f.dataType.DATETIME:return f.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case f.dataType.DECIMAL:return f.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 f.dataType.INT:return f.dataType.INT;default:return f.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return f.isIntegerType(e)||f.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return f.getNormalizedType(e)===f.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}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 Bt.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o,a,s=!0,l=new Promise((u,d)=>{a=setTimeout(()=>{o(),s=!1,d(new zn('Event "'.concat(t,'" timed out.')))},n),o=e.addEventListener(t,c=>{if(i!=null&&!i(c)){Pe.debug2("Event triggered, but matcher returned false.");return}Pe.debug2("Event triggered, resolving."),o(),clearTimeout(a),s=!1,u(c)})});return l.cancel=()=>{if(s){Pe.debug2("Pending promise cleanup."),o(),clearTimeout(a),s=!1;return}Pe.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e?.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var n=f.removeCommas(t);if(f.NUMBER_REGEX.test(n))return parseFloat(n);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case p.eq:return"=";case p.notEq:return"!=";case p.greaterThan:return">";case p.greaterThanOrEqualTo:return">=";case p.lessThan:return"<";case p.lessThanOrEqualTo:return"<=";case p.contains:return"~";case p.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((n,i)=>{var o=n.name.toUpperCase(),a=i.name.toUpperCase();return ra.sort(o,a,t)})}constructor(e){ze(this,"dh",void 0),this.dh=e,Ro(this)}createDistinctSortedColumnTable(e,t,n){var i=arguments,o=this;return Ae(function*(){if(e==null)return null;for(var a=e,s=i.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=i[u];l.length>0&&(a=yield e.copy(),yield a.applyFilter(er(...l.map(g=>g(a)))));var d=a.findColumn(t),c=yield a.selectDistinct([d]);a!==e&&a.close();var m=c.findColumn(t).sort()[n]();return o.applySort(c,[m])})()}doesColumnValueExist(e,t,n,i){var o=this;return Ae(function*(){if(e==null)return null;var a=eu(o,t,n,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield o.applyFilter(s,er(a(s)));var l=au(s);return s.close(),l>0})()}makeQuickFilter(e,t,n){for(var i=t.split("||"),o=null,a=0;a<i.length;a+=1){for(var s=i[a],l=s.split("&&"),u=null,d=0;d<l.length;d+=1){var c=l[d].trim();if(c.length>0){var m=this.makeQuickFilterFromComponent(e,c,n);if(m)u?u=u.and(m):u=m;else throw new Error("Unable to parse quick filter from text ".concat(t))}}o&&u?o=o.or(u):o=u}return o}makeQuickFilterFromComponent(e,t,n){var{type:i}=e;return f.isNumberType(i)?this.makeQuickNumberFilter(e,t):f.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):n!=null&&f.isDateType(i)?this.makeQuickDateFilter(e,t,n):f.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var n=e.filter(),{dh:i}=this,o=null,a=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=a.exec(t),l=null,u=null,d=null,c=null,m=null;if(s!==null&&s.length>3&&([,l,u,d,c,m]=s),m!=null&&m.trim().length>0)return null;if(l==null&&(l="="),c!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":o=n.isNull();break;case"nan":o=i.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"∞":u!=null?o=i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0))):o=i.FilterCondition.invoke("isInf",n).and(n.greaterThan(i.FilterValue.ofNumber(0)));break}return o!==null&&(l==="!"||l==="!=")&&(o=o.not()),o}if(d==null)return null;if(d=f.removeCommas(d),f.isLongType(e.type))try{d=i.FilterValue.ofNumber(i.LongWrapper.ofString("".concat(u!=null?"-":"").concat(d)))}catch(g){return Pe.warn("Unable to create long filter",g),null}else{if(d=parseFloat(d),d==null||Number.isNaN(d))return null;d=i.FilterValue.ofNumber(u!=null?0-d:d)}return o=e.filter(),f.makeRangeFilterWithOperation(o,l,d)}static escapeQuickTextFilter(e){var t,n;if(e==null)return null;var i=/^(!~|!=|~|=|!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a),s!=null){var u;return"\\".concat(s).concat((u=l)!==null&&u!==void 0?u:"")}return l!=null&&o.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((n=l)!==null&&n!==void 0?n:"")}static unescapeQuickTextFilter(e){var t,n,i=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;return a!==null&&a.length>2&&([,s,l]=a),s!=null&&(s=s.replace("\\","")),l!=null&&o.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((n=l)!==null&&n!==void 0?n:"")}makeQuickTextFilter(e,t){var{dh:n}=this,i="".concat(t).trim(),o=/^(!~|!=|~|=|!)?(.*)/,a=o.exec(i),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var u=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return u.isNull();case"!=":case"!":return u.isNull().not()}var d=null,c=null;switch(l.startsWith("*")?(d="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(c="*",l=l.substring(0,l.length-1)),l=f.unescapeQuickTextFilter(l),s){case"~":return u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return d==="*"?u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?u.isNull().or(u.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):u.notEqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()));case"=":return d==="*"?u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?u.isNull().not().and(u.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):u.eqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var n=/^(!=|=|!)?(.*)/,i=n.exec("".concat(t).trim());if(i===null)return null;var[,o,a]=i,s=o==="!"||o==="!=",l=a.trim().toLowerCase(),u=e.filter();try{var d=f.makeBooleanValue(l);return d!=null&&d?u=u.isTrue():d===null?u=u.isNull():u=u.isFalse(),s?u.not():u}catch{return null}}makeQuickDateFilter(e,t,n){var i=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,a=o.exec(i);if(a==null||a.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=a;var u=p.eq;switch(s){case"<":u=p.lessThan;break;case"<=":case"=<":u=p.lessThanOrEqualTo;break;case">":u=p.greaterThan;break;case">=":case"=>":u=p.greaterThanOrEqualTo;break;case"!=":case"!":u=p.notEq;break;case"=":case"==":default:u=p.eq;break}return this.makeQuickDateFilterWithOperation(e,l,u,n)}makeQuickDateFilterWithOperation(e,t,n,i){var{dh:o}=this,[a,s]=hn.parseDateRange(o,t,i),l=a!=null?o.FilterValue.ofNumber(a):null,u=s!=null?o.FilterValue.ofNumber(s):null,d=e.filter();if(l==null)return n===p.notEq?d.isNull().not():d.isNull();switch(n){case p.eq:{if(u!=null){var c=d.greaterThanOrEqualTo(l),m=d.lessThan(u);return c.and(m)}return d.eq(l)}case p.lessThan:return d.lessThan(l);case p.lessThanOrEqualTo:return u!=null?d.lessThan(u):d.lessThanOrEqualTo(l);case p.greaterThan:return u!=null?d.greaterThanOrEqualTo(u):d.greaterThan(l);case p.greaterThanOrEqualTo:return d.greaterThanOrEqualTo(l);case p.notEq:{if(u!=null){var g=d.lessThan(l),b=d.greaterThanOrEqualTo(u);return g.or(b)}return d.notEq(l)}default:throw new Error("Invalid operator: ".concat(n))}}makeQuickCharFilter(e,t){var{dh:n}=this,i="".concat(t).trim(),o=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,a=o.exec(i),s=null,l=null,u=null;if(a!==null&&a.length>3&&([,s,l,u]=a),u!=null&&u.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var d=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return d.isNull();case"!=":case"!":return d.isNull().not();default:return null}var c=n.FilterValue.ofString(f.isRangeOperation(s)?f.quoteValue(l):l);return f.makeRangeFilterWithOperation(d,s,c)}makeAdvancedFilter(e,t,n){for(var{filterItems:i,filterOperators:o,invertSelection:a,selectedValues:s}=t,l=null,u=0;u<i.length;u+=1){var d=i[u],{selectedType:c,value:m}=d;if(c!=null&&c.length>0&&m!=null&&m.length>0)try{var g=this.makeAdvancedValueFilter(e,c,m,n);if(g!=null){if(u===0)l=g;else if(l!==null&&u-1<o.length){var b=o[u-1];if(b===yt.and)l=l.and(g);else if(b===yt.or)l=l.or(g);else{Pe.error("Unexpected filter operator",b,g),l=null;break}}}else Pe.debug2("Empty filter ignored for",c,m)}catch(E){Pe.error("Unable to create filter",E),l=null;break}}var _=this.makeSelectValueFilter(e,s,a);return _!=null&&(l!=null?l=l.and(_):l=_),l}makeAdvancedValueFilter(e,t,n,i){var{dh:o}=this;if(f.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,n,t,i);if(f.isNumberType(e.type)||f.isCharType(e.type))return this.makeQuickFilter(e,"".concat(f.getFilterOperatorString(t)).concat(n));var a=this.makeFilterValue(e.type,n),s=e.filter();switch(t){case p.eq:return s.eq(a);case p.eqIgnoreCase:return s.eqIgnoreCase(a);case p.notEq:return s.notEq(a);case p.notEqIgnoreCase:return s.notEqIgnoreCase(a);case p.greaterThan:return s.greaterThan(a);case p.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(a);case p.lessThan:return s.lessThan(a);case p.lessThanOrEqualTo:return s.lessThanOrEqualTo(a);case p.isTrue:return s.isTrue();case p.isFalse:return s.isFalse();case p.isNull:return s.isNull();case p.contains:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))));case p.notContains:return s.isNull().or(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))).not());case p.startsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i)^\\Q".concat(n,"\\E.*"))));case p.endsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E$"))));case p.in:case p.inIgnoreCase:case p.notIn:case p.notInIgnoreCase:case p.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var n=arguments,i=this;return Ae(function*(){var o=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var a=e.findColumn(t),s=[i.makeNeverFilter(a)];return yield i.applyFilter(e,s,o),e})()}applyCustomColumns(e,t){var n=arguments,i=this;return Ae(function*(){var o=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return f.executeAndWaitForEvent(s=>s?.applyCustomColumns(t),e,a.Table.EVENT_CUSTOMCOLUMNSCHANGED,o)})()}applyFilter(e,t){var n=arguments,i=this;return Ae(function*(){var o=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return f.executeAndWaitForEvent(s=>s?.applyFilter(t),e,a.Table.EVENT_FILTERCHANGED,o)})()}applySort(e,t){var n=arguments,i=this;return Ae(function*(){var o=n.length>2&&n[2]!==void 0?n[2]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return f.executeAndWaitForEvent(s=>s?.applySort(t),e,a.Table.EVENT_SORTCHANGED,o)})()}makeNeverFilter(e){var{dh:t}=this,n=null;f.isTextType(e.type)?n=t.FilterValue.ofString("a"):f.isBooleanType(e.type)?n=t.FilterValue.ofBoolean(!0):f.isDateType(e.type)?n=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):n=t.FilterValue.ofNumber(0);var i=e.filter().eq(n),o=e.filter().notEq(n);return i.and(o)}makeFilterValue(e,t){var{dh:n}=this,i=f.getBaseType(e);return f.isTextType(i)?n.FilterValue.ofString(t):f.isLongType(i)?n.FilterValue.ofNumber(n.LongWrapper.ofString(f.removeCommas(t))):n.FilterValue.ofNumber(f.removeCommas(t))}makeFilterRawValue(e,t){var{dh:n}=this;return f.isCharType(e)?n.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):f.isTextType(e)?n.FilterValue.ofString(t):f.isBooleanType(e)?n.FilterValue.ofBoolean(t):n.FilterValue.ofNumber(t)}makeValue(e,t,n){var{dh:i}=this;if(t==="null")return null;if(f.isTextType(e))return t;if(f.isLongType(e))return i.LongWrapper.ofString(f.removeCommas(t));if(f.isBooleanType(e))return f.makeBooleanValue(t,!0);if(f.isDateType(e)){var[o]=hn.parseDateRange(i,t,n);return o}return f.isNumberType(e)?f.makeNumberValue(t):(Pe.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,n){var{dh:i}=this;if(t.length===0)return n?null:this.makeNeverFilter(e);for(var o=[],a=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?a=!0:f.isTextType(e.type)?o.push(i.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):f.isBooleanType(e.type)?o.push(i.FilterValue.ofBoolean(!!l)):o.push(i.FilterValue.ofNumber(l))}return a?o.length>0?n?e.filter().isNull().not().and(e.filter().notIn(o)):e.filter().isNull().or(e.filter().in(o)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(o):e.filter().in(o)}}ze(f,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});ze(f,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});ze(f,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);ze(f,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));ze(f,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);ze(f,"executeAndWaitForEvent",function(){var r=Ae(function*(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var o=f.makeCancelableTableEventPromise(t,n,i);return e(t),yield o,t});return function(e,t,n){return r.apply(this,arguments)}}());function At(r,e,t){return e=du(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function du(r){var e=cu(r,"string");return typeof e=="symbol"?e:String(e)}function cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ui{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{var i=f.getNormalizedType(n.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var o=t.get(i);return o?.set(n.columnName,n.format),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1;At(this,"defaultColumnFormatter",void 0),At(this,"typeFormatterMap",void 0),At(this,"columnFormatMap",void 0),At(this,"truncateNumbersWithPound",void 0),this.defaultColumnFormatter=new Gl,this.typeFormatterMap=new Map([[f.dataType.BOOLEAN,new $l],[f.dataType.CHAR,new Bl],[f.dataType.DATETIME,new ye(e,n)],[f.dataType.DECIMAL,new W(e,i)],[f.dataType.INT,new we(e,o)],[f.dataType.STRING,new Ql]]),this.columnFormatMap=ui.makeColumnFormatMap(t),this.truncateNumbersWithPound=a}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=f.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){var n,i=this.getColumnFormatMapForType(e);return(n=i?.get(t))!==null&&n!==void 0?n:null}getColumnTypeFormatter(e){var t=f.getNormalizedType(e),n=this.defaultColumnFormatter;if(t){var i;n=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:n}return n}getFormattedString(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var o=this.getColumnTypeFormatter(t),a=i||this.getColumnFormat(t,n);return o.format(e,a??void 0)}get timeZone(){var e,t=this.typeFormatterMap.get(f.dataType.DATETIME);return t==null||(e=t.dhTimeZone)===null||e===void 0?void 0:e.id}}const hu=typeof Jt=="function"?Jt:Jt.default;Wn.register([To,Io,Oo,xo,Do,Ao]);const mu="var(--dh-color-chart-colorway)",fu="var(--dh-color-chart-grid)",gu="var(--dh-color-chart-axis-line)",vu="var(--dh-color-chart-axis-line-zero)",gn={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-color)",colorway:mu,gridcolor:fu,linecolor:gu,zerolinecolor:vu,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var vn=N.module("ChartTheme");function pu(){var r,e=Bn(gn);return e.colorway=wo((r=e.colorway)!==null&&r!==void 0?r:"").map(t=>{var[n,i]=t;return Co.normalizeCssColor(e.colorway.substring(n,i+1))}).join(" "),vn.debug2("Chart theme:",gn),vn.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"]})}const em=hu(Wn);var di=y.createContext(null);function tm(r){var{children:e}=r,{activeThemes:t}=js(),n=y.useMemo(pu,[t]);return h.jsx(di.Provider,{value:n,children:e})}function rm(){return St(di,"No ChartThemeContext value found.")}var bu="SET_ACTIVE_TOOL",yu="SET_API",_u="SET_COMMAND_HISTORY_STORAGE",wu="SET_FILE_STORAGE",Cu="SET_PLUGINS",Su="SET_USER",Pu="SET_WORKSPACE",Eu="SET_DEFAULT_WORKSPACE_SETTINGS",Mu="SET_WORKSPACE_STORAGE",Tu="SET_SERVER_CONFIG_VALUES";function pn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ke(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pn(Object(t),!0).forEach(function(n){Iu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Iu(r,e,t){return e=Ou(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ou(r){var e=xu(r,"string");return typeof e=="symbol"?e:String(e)}function xu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var nm=r=>({type:Su,payload:r}),im=r=>({type:yu,payload:r}),Du=r=>({type:Pu,payload:r}),om=r=>({type:Eu,payload:r}),am=r=>({type:Mu,payload:r}),sm=r=>({type:_u,payload:r}),lm=r=>({type:wu,payload:r}),Au=r=>(e,t)=>{e(Du(r));var{storage:n}=t(),{workspaceStorage:i}=n;return i.save(r)},ku=r=>(e,t)=>{var{workspace:n}=t(),{data:i}=n,o=Ke(Ke({},n),{},{data:Ke(Ke(Ke({},i),r),{},{settings:Ke(Ke({},i.settings),r.settings)})});return e(Au(o))},um=r=>e=>e(ku({settings:r})),dm=r=>({type:bu,payload:r}),cm=r=>({type:Cu,payload:r}),hm=r=>({type:Tu,payload:r});function bn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function yn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bn(Object(t),!0).forEach(function(n){Nu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Nu(r,e,t){return e=Fu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fu(r){var e=Lu(r,"string");return typeof e=="symbol"?e:String(e)}function Lu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ru(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case r:{var{id:o,payload:a}=i;return t&&ir({payload:a},{payload:n[o]})?n:yn(yn({},n),{},{[o]:a})}default:return n}}}function _n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(n){lr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function lr(r,e,t){return e=$u(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function $u(r){var e=ju(r,"string");return typeof e=="symbol"?e:String(e)}function ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bu{constructor(){lr(this,"reducers",{}),lr(this,"listener",null)}register(e,t){var n;this.reducers=wn(wn({},this.reducers),{},{[e]:t}),(n=this.listener)===null||n===void 0||n.call(this,this.reducers)}setListener(e){this.listener=e}}var Wu=new Bu;const Ku=Wu;var Hu={TOGGLE_QUICK_FILTER:Q.createAndAdd({id:"TABLE.TOGGLE_QUICK_FILTER",name:"Toggle Quick Filter",shortcut:[P.CTRL,w.F],macShortcut:[P.CMD,w.F]}),CLEAR_ALL_FILTERS:Q.createAndAdd({id:"TABLE.CLEAR_ALL_FILTERS",name:"Clear All Table Filters",shortcut:[P.CTRL,w.E],macShortcut:[P.CMD,w.E]}),CLEAR_FILTERS:Q.createAndAdd({id:"TABLE.CLEAR_FILTERS",name:"Clear Active Table Filters",shortcut:[P.CTRL,P.SHIFT,w.E],macShortcut:[P.CMD,P.SHIFT,w.E]}),REVERSE:Q.createAndAdd({id:"TABLE.REVERSE",name:"Reverse",shortcut:[P.CTRL,w.I],macShortcut:[P.CMD,w.I]}),TOGGLE_SEARCH:Q.createAndAdd({id:"TABLE.TOGGLE_SEARCH",name:"Toggle Search",shortcut:[P.CTRL,P.SHIFT,w.F],macShortcut:[P.CMD,P.SHIFT,w.F]}),GOTO_ROW:Q.createAndAdd({id:"TABLE.GOTO_ROW",name:"Go to Row",shortcut:[P.CTRL,w.G],macShortcut:[P.CMD,w.G]})},zu={COMMIT:Q.createAndAdd({id:"INPUT_TABLE.COMMIT",name:"Commit",shortcut:[P.CTRL,w.S],macShortcut:[P.CMD,w.S]}),DISCARD:Q.createAndAdd({id:"INPUT_TABLE.DISCARD",name:"Discard",shortcut:[P.CTRL,P.ALT,w.S],macShortcut:[P.CMD,P.OPTION,w.S]})},Uu={TABLE:Hu,INPUT_TABLE:zu};const mm=Uu;function Cn(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Vu(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Cn(o,n,i,a,s,"next",l)}function s(l){Cn(o,n,i,a,s,"throw",l)}a(void 0)})}}function Gu(r,e,t){return e=qu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qu(r){var e=Xu(r,"string");return typeof e=="symbol"?e:String(e)}function Xu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var kt=N.module("DownloadServiceWorkerUtils");class je{static register(e){je.serviceWorkerRegistration&&je.unregisterSW(),"serviceWorker"in navigator?navigator.serviceWorker.register(e).then(t=>{t.update(),je.serviceWorkerRegistration=t,kt.info("Registering service worker on ",e,t)}).catch(t=>{kt.error("Failed to register service worker",t)}):kt.info("Service worker is not supported.")}static getServiceWorker(){return Vu(function*(){if("serviceWorker"in navigator){var e=je.serviceWorkerRegistration;if(e&&e.active)return kt.info("Download service worker is active."),e.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")})()}static unregisterSW(){var e;(e=je.serviceWorkerRegistration)===null||e===void 0||e.unregister()}}Gu(je,"serviceWorkerRegistration",null);const fm=je;var Zu=y.createContext(null);function gm(){return St(Zu,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}var ci=Object.freeze({openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:10,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"Close",maximise:"Maximize",minimise:"Minimize",popout:"Open in new window",popin:"Pop in",tabDropdown:"Additional tabs",tabNextLabel:"Next",tabPreviousLabel:"Previous"},content:[]});function hi(r){return r.componentName!==void 0}function Qu(r){return r.component!==void 0}var mi=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Yu=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:ci,isGLComponentConfig:hi,isReactComponentConfig:Qu,itemDefaultConfig:mi},Symbol.toStringTag,{value:"Module"}));function jt(r,e,t){return e=Ju(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ju(r){var e=ed(r,"string");return typeof e=="symbol"?e:String(e)}function ed(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _t{constructor(){jt(this,"_mSubscriptions",void 0),jt(this,"off",this.unbind),jt(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[_t.ALL_EVENT]=[]}on(e,t,n){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:n})}emit(e){for(var t=this._mSubscriptions[e],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];if(t)for(var a=0;a<t.length;a++){var s=t[a].ctx||{};try{t[a].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[_t.ALL_EVENT],u=0;u<l.length;u++){var d=l[u].ctx||{};try{l[u].fn.apply(d,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,n){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!n||n===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}jt(_t,"ALL_EVENT","__all");const ve=_t;function me(r,e,t){return e=td(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function td(r){var e=rd(r,"string");return typeof e=="symbol"?e:String(e)}function rd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ur extends ve{constructor(e,t,n){super(),me(this,"width",void 0),me(this,"height",void 0),me(this,"title",void 0),me(this,"parent",void 0),me(this,"layoutManager",void 0),me(this,"tab",void 0),me(this,"_config",void 0),me(this,"isHidden",!1),me(this,"beforeCloseHandler",void 0),me(this,"_element",C(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),me(this,"_contentElement",void 0),this.title=hi(e)?e.componentName:"",this.parent=t,this.layoutManager=n,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var n,i,o,a=this.parent,s=null;a&&!a.isColumn&&!a.isRow;){var l;if(s=a,a=a.parent,(l=a)!==null&&l!==void 0&&l.isRoot)return!1}if(!a||!s)return!1;for(var u=a.isColumn?"height":"width",d=u==="height"?t:e,c=((n=this[u])!==null&&n!==void 0?n:0)*(1/(((i=s.config[u])!==null&&i!==void 0?i:0)/100)),m=d/c*100,g=(((o=s.config[u])!==null&&o!==void 0?o:0)-m)/(a.contentItems.length-1),b=0;b<a.contentItems.length;b++)if(a.contentItems[b]===s)a.contentItems[b].config[u]=m;else{var _;a.contentItems[b].config[u]=((_=a.contentItems[b].config[u])!==null&&_!==void 0?_:0)+g}return a.callDownwards("setSize"),!0}close(e){var t,n;this._config.isClosable&&(!((t=(n=this.beforeCloseHandler)===null||n===void 0?void 0:n.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}extendState(e){this.setState(C.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var n=this._contentElement[0],i=n.offsetWidth-n.clientWidth,o=n.offsetHeight-n.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const nd=Object.freeze(Object.defineProperty({__proto__:null,Container:ur,ItemContainer:ur},Symbol.toStringTag,{value:"Module"}));function fi(r){var e=location.hash.match(new RegExp(r+"=([^&]*)"));return e?e[1]:null}function gi(r){if(window.location.hash)return fi(r);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},n,i;for(i=0;i<e.length;i++)n=e[i].split("="),t[n[0]]=n[1];return t[r]||null}function _r(r){return window.requestAnimationFrame(r)}function id(r,e){var t=e.indexOf(r);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function wr(){return(Math.random()*1e15).toString(36).replace(".","")}function od(r,e){var t=r.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return e===!0?t:t.replace(/>/g,"&gt;").replace(/</g,"&lt;")}function Cr(r){return C.trim(r.replace(/(<([^>]+)>)/gi,""))}function ie(r,e,t){return e=ad(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ad(r){var e=sd(r,"string");return typeof e=="symbol"?e:String(e)}function sd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ld extends ve{constructor(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),ie(this,"_eElement",void 0),ie(this,"_oDocument",void 0),ie(this,"_eBody",void 0),ie(this,"_destroyAfterMouseUp",void 0),ie(this,"_nDelay",400),ie(this,"_timeout",void 0),ie(this,"timeout",void 0),ie(this,"_nDistance",10),ie(this,"_nX",0),ie(this,"_nY",0),ie(this,"_nOriginalX",0),ie(this,"_nOriginalY",0),ie(this,"_bDragging",!1),this._eElement=e,this._oDocument=C(document),this._eBody=C(document.body),this._destroyAfterMouseUp=n,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,n,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(n=a.y)!==null&&n!==void 0?n:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,n;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((n=i.y)!==null&&n!==void 0?n:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,n,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(n=this._oDocument)===null||n===void 0||n.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(o=i.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(a=this._eBody)===null||a===void 0||a.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,n,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(n=this._oDocument)===null||n===void 0||(i=n.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,n;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(n=e.pageY)!==null&&n!==void 0?n:0}}}const Pt=ld;function Xe(r,e,t){return e=ud(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ud(r){var e=dd(r,"string");return typeof e=="symbol"?e:String(e)}function dd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vi{constructor(e,t){Xe(this,"_container",void 0),Xe(this,"_reactComponent",null),Xe(this,"_portalComponent",null),Xe(this,"_originalComponentWillUpdate",null),Xe(this,"_initialState",void 0),Xe(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=null,this._container=e,this._initialState=t,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}_key(){var e=this._container._config.id;if(!e)throw new Error("Cannot mount panel without id");return Array.isArray(e)?e.join(","):e}_render(){var e=this._key();this._portalComponent=$n.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var n;this._container.setState(t),(n=this._originalComponentWillUpdate)===null||n===void 0||n.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=C.extend(e,this._container._config.props);return T.createElement(this._reactClass,t)}}var Ht=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],cd=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Sr(r){if(Ht.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pr(r,e,"_min"),e}function dr(r){if(Ht.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pr(r,e,"_max"),e}function Pr(r,e,t){var n=t==="_min"?hd:md;for(var i in r)if(r.hasOwnProperty(i)){var o=Array.isArray(r)?r[Number.parseInt(i,10)]:r[i];if(typeof o=="object"&&o!=null){var a=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=a;else{var s=n(i,Ht);e[s]=a}Pr(o,a,t)}else{var l=n(o,cd);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=n(i,Ht);e[u]=l}}}}function hd(r,e){if(typeof r=="string"&&r.length===1)return"___"+r;var t=e.indexOf(r);return t===-1?r:t.toString(36)}function md(r,e){return typeof r=="string"&&r.length===1?e[parseInt(r,36)]:typeof r=="string"&&r.substr(0,3)==="___"?r[3]:r}function rr(r,e,t){return e=fd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fd(r){var e=gd(r,"string");return typeof e=="symbol"?e:String(e)}function gd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cr{constructor(e,t){rr(this,"name",void 0),rr(this,"origin",void 0),rr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Nt(r,e,t){return e=vd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vd(r){var e=pd(r,"string");return typeof e=="symbol"?e:String(e)}function pd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}let bd=class extends ve{constructor(e){super(),Nt(this,"_layoutManager",void 0),Nt(this,"_dontPropagateToParent",void 0),Nt(this,"_childEventSource",void 0),Nt(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(ve.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),C(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,n="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(n,!0,!0),i.eventName=n,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var n=this._layoutManager.openPopouts[t].getGlInstance();n&&n!==this._childEventSource&&n.eventHub._$onEventFromParent(e)}}destroy(){C(window).off("gl_child_event",this._boundOnEventFromChild)}};const pi=bd,yd=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:cr,DragListener:Pt,EventEmitter:ve,EventHub:pi,ReactComponentHandler:vi,animFrame:_r,filterXss:od,getHashValue:fi,getQueryStringParam:gi,getUniqueId:wr,minifyConfig:Sr,removeFromArray:id,stripTags:Cr,unminifyConfig:dr},Symbol.toStringTag,{value:"Module"}));function xe(r,e,t){return e=_d(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _d(r){var e=wd(r,"string");return typeof e=="symbol"?e:String(e)}function wd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class bi extends ve{constructor(e,t,n,i,o){super(),xe(this,"isInitialised",!1),xe(this,"_config",void 0),xe(this,"_dimensions",void 0),xe(this,"_parentId",void 0),xe(this,"_indexInParent",void 0),xe(this,"_layoutManager",void 0),xe(this,"_popoutWindow",null),xe(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=n,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,n,i,o,a,s,l,u,d,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(n=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(a=this._popoutWindow)===null||a===void 0?void 0:a.screenLeft)!==null&&n!==void 0?n:0,top:(s=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(d=this._popoutWindow)===null||d===void 0?void 0:d.screenTop)!==null&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,n=null;if(this._parentId){var i;if(t=C.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],n=this._layoutManager.root.getItemsById(this._parentId)[0],!n){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?n=this._layoutManager.root.contentItems[0]:n=this._layoutManager.root}}t&&((e=n)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),n=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,n),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;C(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var a;(a=this._popoutWindow)!==null&&a!==void 0&&a.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},10)}_serializeWindowOptions(e){var t=[],n;for(n in e)t.push(n+"="+e[n]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+wr();e=Sr(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var n=document.location.href.split("?");return n.length===1?n[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function X(r,e,t){return e=Cd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cd(r){var e=Sd(r,"string");return typeof e=="symbol"?e:String(e)}function Sd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ue extends ve{constructor(e,t,n,i,o,a){var s,l,u,d,c,m,g,b;if(super(),X(this,"_dragListener",void 0),X(this,"_layoutManager",void 0),X(this,"_contentItem",void 0),X(this,"_originalParent",void 0),X(this,"_area",null),X(this,"_lastValidArea",null),X(this,"_minX",void 0),X(this,"_maxX",void 0),X(this,"_minY",void 0),X(this,"_maxY",void 0),X(this,"_width",void 0),X(this,"_height",void 0),X(this,"_sided",void 0),X(this,"element",void 0),X(this,"childElementContainer",void 0),X(this,"_proxyTab",void 0),this._dragListener=n,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var _,E;this._layoutManager.tabDropPlaceholder.width((_=this._contentItem.tab.element.outerWidth(!0))!==null&&_!==void 0?_:0),this._layoutManager.tabDropPlaceholder.height((E=this._contentItem.tab.element.outerHeight(!0))!==null&&E!==void 0?E:0)}if(this.element=C(Ue._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",Cr((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),C(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var D,A;this._layoutManager.tabDropPlaceholder.width((D=this._proxyTab.outerWidth(!0))!==null&&D!==void 0?D:0),this._layoutManager.tabDropPlaceholder.height((A=this._proxyTab.outerHeight(!0))!==null&&A!==void 0?A:0)}var M=this._layoutManager.container.offset();this._minX=(u=M?.left)!==null&&u!==void 0?u:0,this._minY=(d=M?.top)!==null&&d!==void 0?d:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(g=this.element.width())!==null&&g!==void 0?g:0,this._height=(b=this.element.height())!==null&&b!==void 0?b:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,n){var i,o,a=(i=n.pageX)!==null&&i!==void 0?i:0,s=(o=n.pageY)!==null&&o!==void 0?o:0,l=a>this._minX&&a<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(a,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}X(Ue,"_template",'<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>');function Ft(r,e,t){return e=Pd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pd(r){var e=Ed(r,"string");return typeof e=="symbol"?e:String(e)}function Ed(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yi{constructor(e,t,n){Ft(this,"_element",void 0),Ft(this,"_itemConfig",void 0),Ft(this,"_layoutManager",void 0),Ft(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=n,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Pt(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(C.extend(!0,{},n));new Ue(e,t,this._dragListener,this._layoutManager,i,null)}}function Lt(r,e,t){return e=Md(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Md(r){var e=Td(r,"string");return typeof e=="symbol"?e:String(e)}function Td(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _i{constructor(e,t,n){Lt(this,"_element",C(window)),Lt(this,"_itemConfig",void 0),Lt(this,"_layoutManager",void 0),Lt(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(n)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Pt(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(C.extend(!0,{},n));new Ue(e,t,this._dragListener,this._layoutManager,i,null)}}}function wi(r,e,t){return e=Id(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Id(r){var e=Od(r,"string");return typeof e=="symbol"?e:String(e)}function Od(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Et{constructor(){wi(this,"element",C(Et._template)),C(document.body).append(this.element)}destroy(){this.element.remove()}highlightArea(e){this.element.css({left:e.x1,top:e.y1,width:Math.floor(e.x2-e.x1),height:Math.floor(e.y2-e.y1)}).show()}hide(){this.element.hide()}}wi(Et,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function nr(r,e,t){return e=xd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xd(r){var e=Dd(r,"string");return typeof e=="symbol"?e:String(e)}function Dd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class gt{constructor(e,t,n,i){nr(this,"element",void 0),nr(this,"_header",void 0),nr(this,"_action",void 0),this._header=e,this.element=C('<li class="'+n+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Ad(r,e,t){return e=kd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kd(r){var e=Nd(r,"string");return typeof e=="symbol"?e:String(e)}function Nd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Fd extends Error{constructor(e,t){super(),Ad(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const He=Fd,Ld=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:He},Symbol.toStringTag,{value:"Module"}));function z(r,e,t){return e=Rd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rd(r){var e=$d(r,"string");return typeof e=="symbol"?e:String(e)}function $d(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function wt(r){return r.isStack}function de(r){return r.isComponent}function Ci(r){return r.isRoot}class Y extends ve{constructor(e,t,n,i){super(),z(this,"config",void 0),z(this,"type",void 0),z(this,"contentItems",void 0),z(this,"parent",void 0),z(this,"layoutManager",void 0),z(this,"element",void 0),z(this,"childElementContainer",void 0),z(this,"componentName",void 0),z(this,"isInitialised",!1),z(this,"isMaximised",!1),z(this,"isRoot",!1),z(this,"isRow",!1),z(this,"isColumn",!1),z(this,"isStack",!1),z(this,"isComponent",!1),z(this,"tab",void 0),z(this,"_pendingEventPropagations",void 0),z(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=n,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(ve.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;n!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,n);n===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(n!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var o;(o=this.parent)===null||o===void 0||o.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o?.replaceChild(t.element[0],e.element[0]),n===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,wt(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],n=function i(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),i(o.contentItems[a])};return n(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),n=[],i=0;i<t.length;i++)n.push(t[i].instance);return n}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,n){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(n)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),n=null,i=0;i<t.length;i++)n=t[i].getActiveContentItem(),n&&de(n)&&n.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,n,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(n=e.width())!==null&&n!==void 0?n:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:o.left,y1:o.top,x2:o.left+a,y2:o.top+s,surface:a*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new cr(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new He("content must be an Array",e);for(var n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,n]of Object.entries(mi)){var i=t;e[i]===void 0&&(e[i]=n)}return e}_propagateEvent(e,t){t instanceof cr&&t.isPropagationStopped===!1&&this.isInitialised===!0&&(this.isRoot===!1&&this.parent?this.parent.emit.apply(this.parent,[e,t]):this._scheduleEventPropagationToLayoutManager(e,t))}_scheduleEventPropagationToLayoutManager(e,t){this._throttledEvents.indexOf(e)===-1?this.layoutManager.emit(e,t.origin):this._pendingEventPropagations[e]!==!0&&(this._pendingEventPropagations[e]=!0,_r(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function ht(r,e,t){return e=jd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jd(r){var e=Bd(r,"string");return typeof e=="symbol"?e:String(e)}function Bd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Si extends Y{constructor(e,t,n){super(e,t,n,C()),ht(this,"config",void 0),ht(this,"componentName",void 0),ht(this,"container",void 0),ht(this,"parent",void 0),ht(this,"instance",void 0),this.config=t,this.parent=n;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),o=C.extend(!0,{},this.config.componentState||{});if(i==null)throw new He('Unknown component "'+this.config.componentName+'"');o.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ur(this.config,this,e),this.instance=new i(this.container,o),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Y.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Y.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Y.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Y.prototype._$destroy.call(this)}_$getArea(){return null}}function se(r,e,t){return e=Wd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wd(r){var e=Kd(r,"string");return typeof e=="symbol"?e:String(e)}function Kd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class zt extends Y{constructor(e,t,n,i){super(t,n,i,C('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),se(this,"isRow",void 0),se(this,"isColumn",void 0),se(this,"childElementContainer",void 0),se(this,"parent",void 0),se(this,"_splitter",[]),se(this,"_splitterSize",void 0),se(this,"_splitterGrabSize",void 0),se(this,"_isColumn",void 0),se(this,"_dimension",void 0),se(this,"_splitterPosition",null),se(this,"_splitterMinPosition",null),se(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,n){var i,o,a,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),Y.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,n===!0){this.emitBubblingEvent("stateChanged");return}for(a=0;a<this.contentItems.length;a++)if(this.contentItems[a]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[a].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[a].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var n,i=(n=e.config[this._dimension])!==null&&n!==void 0?n:0,o=this.contentItems.indexOf(e),a=Math.max(o-1,0),s,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var u;this.contentItems[s].config[this._dimension]=((u=this.contentItems[s].config[this._dimension])!==null&&u!==void 0?u:0)+i/(this.contentItems.length-1)}Y.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var n=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=n,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(Y.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,n=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,o=(t=this.element.height())!==null&&t!==void 0?t:0,a=0,s=[];this._isColumn?o-=n:i-=n;for(var l=0;l<this.contentItems.length;l++){var u,d,c=this._isColumn?Math.floor(o*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(i*(((d=this.contentItems[l].config.width)!==null&&d!==void 0?d:0)/100));a+=c,s.push(c)}var m=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:m,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],n=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[n];o!=null?e+=o:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var a=0;a<t.length;a++)t[a].config[n]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[n]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[n]=((u=this.contentItems[l].config[n])!==null&&u!==void 0?u:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,n=[],i=0,o=0,a=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),d=0;d<this.contentItems.length;d++){this.contentItems[d];var c=u.itemSizes[d];c<t?(o+=t-c,l={width:t}):(i+=c-t,l={width:c},n.push(l)),s.push(l)}if(!(o===0||o>i)){var m=o/i;a=o;for(var g=0;g<n.length;g++){l=n[g];var b=Math.round((l.width-t)*m);a-=b,l.width-=b}a!==0&&(s[s.length-1].width-=a);for(var _=0;_<this.contentItems.length;_++)this.contentItems[_].config.width=s[_].width/u.totalWidth*100}}}_createSplitter(e){var t;return t=new Pi(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,n=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),n=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,n)}return{horizontal:t,vertical:n}}_onSplitterDragStart(e){var t,n,i,o,a=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=a.before.config.content)!==null&&t!==void 0?t:[]),u=this._isColumn?l.vertical:l.horizontal,d=this._getMinimumDimensions((n=a.after.config.content)!==null&&n!==void 0?n:[]),c=this._isColumn?d.vertical:d.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=a.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(u||s)),this._splitterMaxPosition=((o=a.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(c||s)}_onSplitterDrag(e,t,n){var i=this._isColumn?n:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,n,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(n=s.after.element[this._dimension]())!==null&&n!==void 0?n:0,d=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+u),c=((o=s.before.config[this._dimension])!==null&&o!==void 0?o:0)+((a=s.after.config[this._dimension])!==null&&a!==void 0?a:0);s.before.config[this._dimension]=d*c,s.after.config[this._dimension]=(1-d)*c,e.element.css({top:0,left:0}),_r(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Sn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sn(Object(t),!0).forEach(function(n){hr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Sn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function hr(r,e,t){return e=Hd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hd(r){var e=zd(r,"string");return typeof e=="symbol"?e:String(e)}function zd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class mr extends Y{constructor(e,t,n){super(e,Pn(Pn({},t),{},{type:"root"}),null,C('<div class="lm_goldenlayout lm_item lm_root"></div>')),hr(this,"childElementContainer",void 0),hr(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var n,i;e=typeof e>"u"?(n=this._containerElement.width())!==null&&n!==void 0?n:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,n){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,n)}_$onDrop(e,t){var n;if(de(e)&&(n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),n._$init(),n.addChild(e),e=n),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,o=i==="left"||i==="right"?"row":"column",a=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof zt)||l.type!=o){var u=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,u),u.addChild(e,s?0:void 0,!0),u.addChild(l,s?void 0:0,!0),l.config[a]=50,e.config[a]=50,u.callDownwards("setSize")}else{var d,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[a]=((d=c.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=c.config[a],l.callDownwards("setSize")}}}}function En(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?En(Object(t),!0).forEach(function(n){te(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):En(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function te(r,e,t){return e=Ud(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ud(r){var e=Vd(r,"string");return typeof e=="symbol"?e:String(e)}function Vd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fr extends Y{constructor(e,t,n){var i,o,a,s,l,u,d,c,m;super(e,t,n,C('<div class="lm_item lm_stack"></div>')),te(this,"_activeContentItem",null),te(this,"_header",void 0),te(this,"childElementContainer",C('<div class="lm_items"></div>')),te(this,"header",void 0),te(this,"parent",void 0),te(this,"isStack",!0),te(this,"_dropZones",{}),te(this,"_dropSegment",null),te(this,"_contentAreaDimensions",null),te(this,"_dropIndex",void 0),te(this,"_side",void 0),te(this,"_sided",!1),te(this,"config",void 0),this.parent=n,this.config=t;var g=e.config;this._side=!1,this._header={show:((i=g.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=g.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=g.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=g.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=g.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=g.settings)!==null&&u!==void 0&&u.showCloseIcon?(d=g.labels)===null||d===void 0?void 0:d.close:void 0,minimise:(c=(m=g.labels)===null||m===void 0?void 0:m.minimise)!==null&&c!==void 0?c:void 0},g.header&&(this._header=Ze(Ze({},this._header),g.header)),t.header&&(this._header=Ze(Ze({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Ze(Ze({},this._header),t.content[0].header)),this.header=new Ie(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,n,i,o,a=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((n=this.element.width())!==null&&n!==void 0?n:0)-(this._sided?a:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:a);for(this.childElementContainer.width(s),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,n=this.contentItems.length;t<n;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Y.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",n=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=t&&this.parent.isColumn||n&&this.parent.isRow,a=t?"column":"row",s=t?"height":"width";if(de(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var u,d=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?d:d+1,!0),this.config[s]=((u=this.config[s])!==null&&u!==void 0?u:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:a},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[n,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){n==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var n=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+n*.25,y1:t.y1,x2:t.x1+n*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+n*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+n*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+n*.25,y1:t.y1+i*.5,x2:t.x1+n*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,n,i,o,a,s,l,u,d,c,m,g,b,_,E,D,A=this.header.tabs.length;if(A===0){var M,ne,K,oe,H,V,G,ae,q=this.header.element.offset();(M=this.layoutManager.dropTargetIndicator)===null||M===void 0||M.highlightArea({x1:(ne=q?.left)!==null&&ne!==void 0?ne:0,x2:((K=q?.left)!==null&&K!==void 0?K:0)+100,y1:(oe=(H=this.header.element.offset())===null||H===void 0?void 0:H.top)!==null&&oe!==void 0?oe:0,y2:((V=(G=this.header.element.offset())===null||G===void 0?void 0:G.top)!==null&&V!==void 0?V:0)+((ae=this.header.element.innerHeight())!==null&&ae!==void 0?ae:0)});return}var Oe=this.header.tabsContainer,J=(t=Oe.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),pe=(n=this.layoutManager.tabDropPlaceholder.get(0))===null||n===void 0?void 0:n.getBoundingClientRect();if(!(!J||!pe)){e<J.left?e=J.left+1:e>J.right&&(e=J.right-1);var he,be;if(!(pe.left<e&&e<pe.right)){for(var Ve=0;Ve<A;Ve++){var lt;if(he=this.header.tabs[Ve].element,be=(lt=he.get(0))===null||lt===void 0?void 0:lt.getBoundingClientRect(),be&&be.left<e&&e<be.right){this._dropIndex=Ve;break}}if(he&&be&&e<be.left+be.width*.5)he.before(this.layoutManager.tabDropPlaceholder);else if(he){var ut;this._dropIndex=Math.min(((ut=this._dropIndex)!==null&&ut!==void 0?ut:0)+1,A),he.after(this.layoutManager.tabDropPlaceholder)}}var Ge=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;Ge=Math.max(Ge,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var qe=Ge+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);qe=Math.min(qe,((u=(d=this.header.tabsContainer.offset())===null||d===void 0?void 0:d.left)!==null&&u!==void 0?u:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Ge,x2:qe,y1:(g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0,y2:((_=(E=this.header.element.offset())===null||E===void 0?void 0:E.top)!==null&&_!==void 0?_:0)+((D=this.header.element.innerHeight())!==null&&D!==void 0?D:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(n=>n===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,n,i=(t=this._contentAreaDimensions)===null||t===void 0||(n=t[e])===null||n===void 0?void 0:n.highlightArea;if(i){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(i)}this._dropSegment=e}}const Gd=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Y,Component:Si,ContentItem:Y,Root:mr,RowOrColumn:zt,Stack:fr,isComponent:de,isRoot:Ci,isStack:wt},Symbol.toStringTag,{value:"Module"}));function Me(r,e,t){return e=qd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qd(r){var e=Xd(r,"string");return typeof e=="symbol"?e:String(e)}function Xd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Mt{constructor(e,t){var n;Me(this,"header",void 0),Me(this,"contentItem",void 0),Me(this,"element",C(Mt._template)),Me(this,"titleElement",void 0),Me(this,"closeElement",void 0),Me(this,"isActive",!1),Me(this,"_layoutManager",void 0),Me(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(n=this._layoutManager.config.settings)!==null&&n!==void 0&&n.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Pt(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),de(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),de(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var n;(n=this.contentItem.parent)!==null&&n!==void 0&&n.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Ue(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){C(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){de(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,n=this.header.parent.getActiveContentItem();this.contentItem!==n&&de(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):de(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),de(this.contentItem)&&this.contentItem.container.emit("tabClicked",e),this.header._hideAdditionalTabsDropdown(),(t=this.element.get(0))===null||t===void 0||t.scrollIntoView({inline:"nearest"})}else e.button===1&&this.contentItem.config.isClosable&&this._onCloseClick(e)}_onCloseClick(e){e.stopPropagation(),de(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}Me(Mt,"_template",['<li class="lm_tab">','<span class="lm_title_before"></span>','<span class="lm_title"></span>','<div class="lm_close_tab" aria-label="Close tab"></div>',"</li>"].join(""));function O(r,e,t){return e=Zd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zd(r){var e=Qd(r,"string");return typeof e=="symbol"?e:String(e)}function Qd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ie extends ve{constructor(e,t){var n,i;super(),O(this,"layoutManager",void 0),O(this,"element",C(Ie._template)),O(this,"tabsContainer",void 0),O(this,"tabDropdownContainer",void 0),O(this,"tabDropdownSearch",void 0),O(this,"tabDropdownList",null),O(this,"controlsContainer",void 0),O(this,"parent",void 0),O(this,"tabs",[]),O(this,"activeContentItem",null),O(this,"closeButton",null),O(this,"tabDropdownButton",null),O(this,"tabNextButton",C(Ie._nextButtonTemplate)),O(this,"tabPreviousButton",C(Ie._previousButtonTemplate)),O(this,"holdTimer",null),O(this,"rAF",null),O(this,"CLICK_TIMEOUT",500),O(this,"START_SPEED",.01),O(this,"ACCELERATION",5e-4),O(this,"PADDING",10),O(this,"SCROLL_LEFT","left"),O(this,"SCROLL_RIGHT","right"),O(this,"isDraggingTab",!1),O(this,"isOverflowing",!1),O(this,"isDropdownShown",!1),O(this,"dropdownKeyIndex",0),O(this,"_lastVisibleTabIndex",-1),O(this,"_tabControlOffset",void 0),this.layoutManager=e,(n=this.layoutManager.config.settings)!==null&&n!==void 0&&n.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var n=0;n<this.tabs.length;n++)if(this.tabs[n].contentItem===e)return;var i=new Mt(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,n,i,o,a=0;a<this.tabs.length;a++)o=this.tabs[a].contentItem===e,this.tabs[a].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=a);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(n=t.scrollIntoView)===null||n===void 0||n.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var n=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;n*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=100/3);t.scrollLeft+=Math.round(n)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var n,i,o,a,s;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n:0)>((o=(a=this.tabsContainer.get(0))===null||a===void 0?void 0:a.offsetWidth)!==null&&o!==void 0?o:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var u,d;l.scrollLeft=(u=(d=this.tabsContainer.get(0))===null||d===void 0?void 0:d.scrollWidth)!==null&&u!==void 0?u:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var n,i,o;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var a=this.tabsContainer.get(0);a&&(a.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,n;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((n=this.tabsContainer.get(0))===null||n===void 0?void 0:n.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,a=this.tabsContainer.get(0);if(a){var s=a.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,u;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((u=this.tabsContainer.innerWidth())!==null&&u!==void 0?u:0)===a.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((n=this.rAF)!==null&&n!==void 0?n:-1),this.rAF=window.requestAnimationFrame(d=>{var c,m,g=o||d,b=d-g,_=this.START_SPEED*b+.5*this.ACCELERATION*(b*b);_=Math.min(_,(c=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,_,g)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),C(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,n,i,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new gt(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),n=this._getHeaderSetting("popout"),new gt(this,n,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var a=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new gt(this,a,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",a??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),n=this._getHeaderSetting("close"),this.closeButton=new gt(this,n,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),C(document.body).append(this.tabDropdownContainer),this.tabDropdownContainer.show(),this.isDropdownShown=!0,this.element.addClass("lm_dropdown_open"),this.tabDropdownSearch.val("").focus(),this.dropdownKeyIndex=0,this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active"),C(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(s,l,u){if(u==null||u.length<2)return-1;for(var d=(s+l+u.length)%u.length;d!==s;){if(u.eq(d).css("display")!=="none")return d;d=(d+l+u.length)%u.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var n,i;e.preventDefault(),(n=this.tabDropdownList)===null||n===void 0||n.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,a;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(a=this.tabDropdownList)===null||a===void 0||a.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var n,i;((n=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&n!==void 0?n:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,n;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((n=this.tabDropdownButton)===null||n===void 0?void 0:n.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),C(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,n,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var a=this.tabDropdownContainer[0].getBoundingClientRect(),s=(n=C(window).height())!==null&&n!==void 0?n:0,l=(i=C(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var u=this.tabDropdownButton.element[0].getBoundingClientRect(),d=o<s-u.bottom,c=!d&&u.bottom>s*.6,m=Math.min(u.left+(c?u.width:0),l-a.width-this.PADDING),g=c?Math.max(u.top-o,this.PADDING):u.bottom,b=s-g-this.PADDING;this.tabDropdownContainer.css({"max-height":b,top:g,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var n;(n=this.tabDropdownButton)===null||n===void 0||n.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}O(Ie,"_template",['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list">','<li class="lm_tabdropdown_search"><input type="text" placeholder="Find tab..."></li>',"</ul>","</div>"].join(""));O(Ie,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));O(Ie,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function mt(r,e,t){return e=Yd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yd(r){var e=Jd(r,"string");return typeof e=="symbol"?e:String(e)}function Jd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pi{constructor(e,t,n){mt(this,"_isVertical",void 0),mt(this,"_size",void 0),mt(this,"_grabSize",void 0),mt(this,"_dragListener",void 0),mt(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=n<t?t:n,this.element=this._createElement(),this._dragListener=new Pt(this.element)}on(e,t,n){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,n)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=C('<div class="lm_drag_handle"></div>'),t=C('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}const ec=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:bi,DragProxy:Ue,DragSource:yi,DragSourceFromEvent:_i,DropTargetIndicator:Et,Header:Ie,HeaderButton:gt,Splitter:Pi,Tab:Mt},Symbol.toStringTag,{value:"Module"}));var tc={config:Yu,container:nd,controls:ec,errors:Ld,items:Gd,utils:yd};const rc=tc;function Mn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ee(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mn(Object(t),!0).forEach(function(n){x(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Mn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function x(r,e,t){return e=nc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nc(r){var e=ic(r,"string");return typeof e=="symbol"?e:String(e)}function ic(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ei extends ve{static minifyConfig(e){return Sr(e)}static unminifyConfig(e){return dr(e)}constructor(e,t){super(),x(this,"isInitialised",!1),x(this,"_isFullPage",!1),x(this,"_resizeTimeoutId",void 0),x(this,"_components",{"lm-react-component":vi}),x(this,"_fallbackComponent",void 0),x(this,"_itemAreas",[]),x(this,"_maximisedItem",null),x(this,"_maximisePlaceholder",C('<div class="lm_maximise_place"></div>')),x(this,"_creationTimeoutPassed",!1),x(this,"_subWindowsCreated",!1),x(this,"_dragSources",[]),x(this,"_updatingColumnsResponsive",!1),x(this,"_firstLoad",!0),x(this,"_reactChildMap",new Map),x(this,"_reactChildren",null),x(this,"width",null),x(this,"height",null),x(this,"root",void 0),x(this,"openPopouts",[]),x(this,"selectedItem",null),x(this,"isSubWindow",!1),x(this,"eventHub",new pi(this)),x(this,"config",void 0),x(this,"container",void 0),x(this,"_originalContainer",void 0),x(this,"dropTargetIndicator",null),x(this,"tabDropPlaceholder",C('<div class="lm_drop_tab_placeholder"></div>')),x(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this.isSubWindow&&C("body").css("visibility","hidden"),this._typeToItem={column:zt.bind(this,!0),row:zt.bind(this,!1),stack:fr,component:Si}}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var n=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return n}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof Y))throw new Error("Root must be a ContentItem");var t={settings:ee({},this.config.settings),dimensions:ee({},this.config.dimensions),labels:ee({},this.config.labels),content:[]},n=function o(a,s){for(var l in s.config)l!=="content"&&(a[l]=s.config[l]);if(a.componentName==="lm-react-component"&&(a.type="react-component"),s.contentItems.length){a.content=[];for(var u=0;u<s.contentItems.length;u++)a.content[u]={},o(a.content[u],s.contentItems[u])}};e?n(t,{contentItems:[e]}):n(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){C(document).ready(this.init.bind(this));return}if(this.isSubWindow===!0&&this._creationTimeoutPassed===!1){setTimeout(this.init.bind(this),7),this._creationTimeoutPassed=!0;return}this.isSubWindow===!0&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new Et,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var n=this._reactChildMap.get(e);n===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}updateSize(e,t){var n,i;if(this.width=(n=e??this.container.width())!==null&&n!==void 0?n:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var o,a;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((a=this.container.height())!==null&&a!==void 0?a:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),C(window).off("resize",this._onResize),C(window).off("unload beforeunload",this._onUnload),C(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var n,i;if(typeof e.type!="string")throw new He("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw n="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new He(n);return e.type==="component"&&!(t instanceof fr)&&t&&!(this.isSubWindow===!0&&t instanceof mr)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,n,i){var o=[],a=e instanceof Y,s=this;if(a){var l;o=this.toConfig(e).content,n=wr();for(var u=e.parent,d=e;((c=u)===null||c===void 0?void 0:c.contentItems.length)===1&&!u.isRoot;){var c;d=u,u=u.parent}if((l=u)===null||l===void 0||l.addId(n),i==null||Number.isNaN(i)){var m;i=(m=u)===null||m===void 0?void 0:m.contentItems.indexOf(d)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var g,b,_,E=window.screenX||window.screenLeft,D=window.screenY||window.screenTop,A=(g=e.element.offset())!==null&&g!==void 0?g:{left:0,top:0};t={left:E+A.left,top:D+A.top,width:(b=e.element.width())!==null&&b!==void 0?b:0,height:(_=e.element.height())!==null&&_!==void 0?_:0}}if(!t&&!a&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),a&&e.remove(),!(!t||!n||i===void 0)){var M=new bi(o,t,n,i,this);return M.on("initialised",function(){s.emit("windowOpened",M)}),M.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(M),M}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var n=new yi(e,t,this);return this._dragSources.push(n),n}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new _i(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,n;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((n=this.container.height())!==null&&n!==void 0?n:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var n=1/0,i=null,o=0;o<this._itemAreas.length;o++){var a=this._itemAreas[o];e>a.x1&&e<a.x2&&t>a.y1&&t<a.y2&&n>a.surface&&(n=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=ee({},this.root._$getArea()),n=[ee(ee({},t),{},{side:"left",x2:t.x1+e}),ee(ee({},t),{},{side:"right",x1:t.x2-e}),ee(ee({},t),{},{side:"top",y2:t.y1+e}),ee(ee({},t),{},{side:"bottom",y1:t.y2-e})];n.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...n)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var n=e[t];if(wt(n)){var i=n._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=ee(ee({},i),(o=i.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);a.surface=(a.x2-a.x1)*(a.y2-a.y1),this._itemAreas.push(a)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof Y)return e;if(C.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t);return n.callDownwards("_$init"),n}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var n;((n=this.openPopouts[t].getWindow())===null||n===void 0?void 0:n.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=n=>{if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&C(window).resize(this._onResize),C(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,n=gi("gl-window");n&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(n)||"{}"),e=dr(e),localStorage.removeItem(n)),e=C.extend(!0,{},ci,e);var i=function o(a){for(var s in a){var l=a[s];s!=="props"&&typeof l=="object"&&l!=null?o(l):s==="type"&&l==="react-component"&&(a.type="component",a.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=C('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(()=>{this.emit("popIn")}),document.title=Cr((e=this.config.content[0].title)!==null&&e!==void 0?e:""),C("head").append(C("body link, body style, template, .gl_keep")),this.container=C("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this}_createSubWindows(){if(this.config.openPopouts)for(var e=0;e<this.config.openPopouts.length;e++){var t=this.config.openPopouts[e];this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}}_getContainer(){var e=this._originalContainer?C(this._originalContainer):C("body");if(e.length===0)throw new Error("GoldenLayout container not found");if(e.length>1)throw new Error("GoldenLayout more than one container element specified");return e}_setContainer(){var e=this._getContainer();e[0]===document.body&&(this._isFullPage=!0,C("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}_create(e){var t;if(!(e.content instanceof Array))throw e.content===void 0?t="Missing setting 'content' on top level of configuration":t="Configuration parameter 'content' must be an array",new He(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new He(t,e);this.root=new mr(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,n=e*t;if(!(this.width==null||n<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),o=e-i,a=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<o;l++){var u=a.contentItems[a.contentItems.length-1];this._addChildContentItemsToContainer(s,u)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach(n=>{this._addChildContentItemsToContainer(e,n)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(n=>{wt(n)?e.push(n):n.isComponent||this._findAllStackContainersRecursive(e,n)})}}x(Ei,"__lm",rc);const oc=Ei,ac="_lm_dragging_4iylo_1",sc="_lm_goldenlayout_4iylo_1",lc="_lm_header_4iylo_1",uc="_lm_controls_4iylo_1",dc="_lm_tabpreviousbutton_4iylo_1",cc="_lm_tabnextbutton_4iylo_1",hc="_lm_tab_4iylo_1",mc="_lm_active_4iylo_1",fc="_lm_close_tab_4iylo_1",gc="_lm_content_4iylo_1",vc="_lm_dragProxy_4iylo_1",pc="_lm_dropTargetIndicator_4iylo_1",bc="_march_4iylo_1",yc="_lm_inner_4iylo_1",_c="_lm_splitter_4iylo_1",wc="_lm_selectable_4iylo_1",Cc="_lm_tabdropdown_list_4iylo_1",Sc="_lm_title_4iylo_1",Pc="_lm_title_before_4iylo_1",Ec="_lm_selected_4iylo_1",Mc="_lm_focusin_4iylo_1",Tc="_lm_window_blur_4iylo_1",Ic="_lm_popout_4iylo_1",Oc="_lm_maximise_4iylo_1",xc="_lm_tabdropdown_4iylo_1",Dc="_lm_close_4iylo_1",Ac="_lm_tabdropdown_search_4iylo_1",kc="_lm_tabs_4iylo_1",Nc="_lm_keyboard_active_4iylo_1",Fc="_lm_maximised_4iylo_1",Lc="_lm_items_4iylo_1",Tn={"tab-height":"28px","drag-border-width":"5px",lm_dragging:ac,lm_goldenlayout:sc,lm_header:lc,lm_controls:uc,lm_tabpreviousbutton:dc,lm_tabnextbutton:cc,lm_tab:hc,lm_active:mc,lm_close_tab:fc,lm_content:gc,lm_dragProxy:vc,lm_dropTargetIndicator:pc,march:bc,lm_inner:yc,lm_splitter:_c,lm_selectable:wc,lm_tabdropdown_list:Cc,lm_title:Sc,lm_title_before:Pc,lm_selected:Ec,lm_focusin:Mc,lm_window_blur:Tc,lm_popout:Ic,lm_maximise:Oc,lm_tabdropdown:xc,lm_close:Dc,lm_tabdropdown_search:Ac,lm_tabs:kc,lm_keyboard_active:Nc,lm_maximised:Fc,lm_items:Lc},In=Object.freeze({tabHeight:parseInt(Tn["tab-height"],10),dragBorderWidth:parseInt(Tn["drag-border-width"],10)});function On(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ee(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?On(Object(t),!0).forEach(function(n){Mi(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):On(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Mi(r,e,t){return e=Rc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rc(r){var e=$c(r,"string");return typeof e=="symbol"?e:String(e)}function $c(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var De=N.module("LayoutUtils");function Ti(r){return r.componentName!==void 0}function et(r){var e=r;return(Ti(r)&&r.componentName==="lm-react-component"||r.type==="react-component")&&e.component!==void 0}function Rt(r){return r.focus!==void 0}function xn(r){return r.type==="stack"}class S{static activateTab(e,t){var n=S.getStackForRoot(e,t,!1);if(!n){De.error("Could not find stack for config",t);return}var i=S.getContentItemInStack(n,t);i&&n.setActiveContentItem(i)}static isActiveTab(e,t){var n=S.getStackForRoot(e,t,!1);if(!n)return De.error("Could not find stack for config",t),!1;var i=S.getContentItemInStack(n,t),o=n.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=t?"column":"row";if(Ci(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:n});var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild({type:n});var a=document.activeElement;e.contentItems[0].addChild(i),a&&a.focus!=null&&a.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n&&wt(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=e.contentItems[i];if(o.isComponent&&o.config!=null&&Or(o.config,t))return e;var a=this.getStackForConfig(o,t,n);if(a)return a}return null}static getStackForRoot(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=this.getStackForConfig(e,t);return!a&&i&&(a=this.getStackForConfig(e,{component:t.component},o)),!a&&n&&(a=this.addStack(e)),a}static getStackForComponentTypes(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=0;a<t.length;a+=1){var s=t[a],l=a===t.length-1,u=S.getStackForRoot(e,{component:s},n&&l,i,o);if(u)return u}return null}static getContentItemInStack(e,t){if(!e)return null;for(var n=0;n<e.contentItems.length;n+=1){var i=e.contentItems[n];if(i.isComponent&&i.config!=null&&Or(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var o=e[i],{component:a,content:s}=o;if(a){var l=t(a,o);l!=null?n.push(l):De.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(a,'"'))}else if(s){var u=Ee(Ee({},o),{},{content:S.dehydrateLayoutConfig(s,t)});n.push(u)}else n.push(o)}return n}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var n=t.element[0].getBoundingClientRect();return[n.left+n.width*.5,n.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var n=e[t],{content:i}=n;i!==void 0?(xn(n)&&delete n.activeItemIndex,S.dropLayoutMinorChange(i)):et(n)&&n.component==="IrisGridPanel"&&n.props.panelState!=null&&(delete n.id,n.props.panelState.irisGridState.sorts=[],n.props.panelState.irisGridState.quickFilters=[],n.props.panelState.gridState.isStuckToBottom=!1,n.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n){var i=S.cloneLayout(e),o=S.cloneLayout(t);return S.dropLayoutMinorChange(i),S.dropLayoutMinorChange(o),ir(i,o)}return ir(e,t)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var o=e[i];if(et(o)){var a,{component:s,props:l={}}=o;n.push(Ee(Ee({},o),{},{id:(a=o?.id)!==null&&a!==void 0?a:rt(),props:t(s,l)}))}else if(o.content!==void 0){var u=S.hydrateLayoutConfig(o.content,t);xn(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=u.length&&(De.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),n.push(Ee(Ee({},o),{},{content:u}))}else n.push(o)}return n}static openComponent(){var{root:e,config:t,replaceExisting:n=!0,replaceConfig:i=void 0,createNewStack:o=!1,focusElement:a=void 0,dragEvent:s=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,u=Ee({},t);if(u.id==null&&(u.id=rt.generate()),s!=null){e?.layoutManager.createDragSourceFromEvent(u,s);return}var d=i||{id:u.id,component:u.component};Be(e);var c=o?S.addStack(e):S.getStackForRoot(e,d);Be(c);var m=S.getContentItemInStack(c,d);if(a!=null){var g=_=>{De.debug("Component created, focusing element",a),c.off("componentCreated",g);var{element:E}=_.origin;requestAnimationFrame(()=>{S.focusElement(E[0],a)})};c.on("componentCreated",g)}if(n&&m){var b=c.contentItems.indexOf(m);c.addChild(u,b+1),c.removeChild(m),c.setActiveContentItem(c.contentItems[b])}else c.addChild(u);a==null&&l&&Rt(l)&&l.focus()}static openComponentInStack(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=S.getContentItemInStack(e,o);if(n&&a&&e){var s=e?.contentItems.indexOf(a);e.addChild(t,s+1),e.removeChild(a),e.setActiveContentItem(e.contentItems[s])}else e?.addChild(t);i&&Rt(i)&&i.focus()}static closeComponent(e,t,n){var i=S.getStackForRoot(e,t,!1,!1,!1);if(!i){De.warn("Cannot find stack for component, ignoring close",t);return}var o=S.getContentItemInStack(i,t),a=document.activeElement;o&&(de(o)?o.container.close(n):i.removeChild(o)),a&&document.contains(a)&&Rt(a)&&a.focus()}static renameComponent(e,t,n){var i=S.getStackForRoot(e,t,!1);if(!i){De.error("Could not find stack for config",t);return}var o=S.getContentItemInStack(i,t);o&&o.setTitle(n)}static cloneComponent(e,t){var n=S.getStackForRoot(e,t,!1);if(!n)return De.error("Could not find stack for config",t),null;var{props:i={}}=t,o=S.getPanelComponentState(t),a={type:"react-component",component:t.component,props:Ee(Ee({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:rt.generate()};return S.openComponentInStack(n,a),a}static getPanelComponentState(e){if(Ti(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(et(e)){var n;return(n=e.props)===null||n===void 0?void 0:n.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:In.tabHeight,borderWidth:In.dragBorderWidth,borderGrabWidth:10},settings:{showPopoutIcon:!1,showCloseIcon:!1,constrainDragToContainer:!1}}}static getRootFromContainer(e){return e.layoutManager.root}static getComponentConfigFromContainer(e){return e?e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config:e._config:null}static getTitleFromContainer(e){return e!=null&&e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config.title:null}static getTitleFromTab(e){return e!=null&&e.contentItem!=null?e.contentItem.config.title:null}static getIdFromContainer(e){var t=S.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return S.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,n=S.getComponentConfigFromContainer(t);if(n&&et(n)){var i;return(i=n.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,n,i=(t=(n=e.WrappedComponent)===null||n===void 0?void 0:n.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var n=e.querySelector(t);return n==null?null:(Rt(n)&&n.focus(),n)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var n=()=>{e.off("initialised",n),t()};e.on("initialised",n)})}}Mi(S,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var jc=T.forwardRef((r,e)=>{var t=S.getComponentNameFromPanel({props:r});return h.jsx("div",{ref:e,className:"panel-placeholder",children:h.jsxs("div",{children:['Component "',t,'" is not registered.']})})});jc.displayName="PanelPlaceholder";const U=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function Ut(r){return r?.WrappedComponent!==void 0}function Bc(r){return typeof r.id=="string"&&r.layout instanceof oc&&r.panelManager instanceof Er&&typeof r.registerComponent=="function"}function pm(r){if(!Bc(r))throw new Error("Expected dashboard plugin props, but instead received ".concat(r))}function Dn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function An(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dn(Object(t),!0).forEach(function(n){Re(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Re(r,e,t){return e=Wc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wc(r){var e=Kc(r,"string");return typeof e=="symbol"?e:String(e)}function Kc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var le=N.module("PanelManager");class Er{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Re(this,"layout",void 0),Re(this,"hydrateComponent",void 0),Re(this,"dehydrateComponent",void 0),Re(this,"onPanelsUpdated",void 0),Re(this,"closed",void 0),Re(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleDeleted=this.handleDeleted.bind(this),this.handleClosed=this.handleClosed.bind(this),this.handleControlClose=this.handleControlClose.bind(this),this.layout=e,this.hydrateComponent=t,this.dehydrateComponent=n,this.onPanelsUpdated=a,this.openedMap=new Map(i),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(U.FOCUS,this.handleFocus),e.on(U.MOUNT,this.handleMount),e.on(U.UNMOUNT,this.handleUnmount),e.on(U.REOPEN,this.handleReopen),e.on(U.DELETE,this.handleDeleted),e.on(U.CLOSED,this.handleClosed),e.on(U.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(U.FOCUS,this.handleFocus),e.off(U.MOUNT,this.handleMount),e.off(U.UNMOUNT,this.handleUnmount),e.off(U.REOPEN,this.handleReopen),e.off(U.DELETE,this.handleDeleted),e.off(U.CLOSED,this.handleClosed),e.off(U.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return S.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&et(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,n=S.getStackForConfig(this.layout.root,{id:e});return(t=n&&S.getContentItemInStack(n,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),n=t.length-1;n>=0;n-=1){var i=t[n];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(n=>Ut(n)&&t instanceof n.WrappedComponent||!Ut(n)&&t instanceof n))}updatePanel(e){var t=S.getIdFromPanel(e);if(t==null){le.error("updatePanel Panel did not have an ID",e);return}le.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=S.getIdFromPanel(e);if(t==null){le.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){le.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){le.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}le.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(n=>n===e||n.id!=null&&e.id!=null&&n.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){le.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){le.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){le.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){le.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:n}=e,{props:i}=e;i=this.hydrateComponent(n,i);var o=An(An({},e),{},{props:i}),{root:a}=this.layout;S.openComponent({root:a,config:o,replaceConfig:t})}handleDeleted(e){le.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){le.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:n}=this.layout;S.closeComponent(n,t)}addClosedPanel(e){var t=S.getComponentConfigFromContainer(e);if(t&&et(t)){var n=this.dehydrateComponent(t.component,t);n!=null&&this.closed.push(n)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Re(Er,"MAX_CLOSED_PANEL_COUNT",100);var Hc=N.module("PanelErrorBoundary");class zc extends y.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,n=S.getIdFromContainer(e);Hc.debug("componentWillUnmount",n),t.emit(U.CLOSED,n,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?h.jsx("div",{className:"panel-error-boundary",children:h.jsx(So,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function kn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kn(Object(t),!0).forEach(function(n){Uc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Uc(r,e,t){return e=Vc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vc(r){var e=Gc(r,"string");return typeof e=="symbol"?e:String(e)}function Gc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ii(r){var{props:e,componentState:t}=r,{metadata:n}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return n!=null&&(o.metadata=n),i!=null&&(o.panelState=i),Vt(Vt({},r),{},{componentState:null,props:o,type:"react-component"})}function Oi(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Vt(Vt({metadata:{}},r),{},{localDashboardId:e})}function qc(r){var e=Ut(r)&&r.WrappedComponent.prototype!=null&&r.WrappedComponent.prototype.isReactComponent!=null||r.prototype!=null&&r.prototype.isReactComponent!=null,t=!Ut(r)&&"$$typeof"in r&&r.$$typeof===Qi.ForwardRef;return e||t}const bm={dehydrate:Ii,hydrate:Oi};var ym=T.createContext(void 0),Xc=v.shape({on:v.func,off:v.func,isHidden:v.bool,tab:v.shape({header:v.shape({tabs:v.arrayOf(v.shape({contentItem:v.shape({})}))})}),title:v.string,setTitle:v.func,close:v.func}),xi=v.shape({on:v.func,off:v.func,emit:v.func}),Zc=v.shape({registerComponent:v.func,root:v.shape({addChild:v.func}),on:v.func,off:v.func,eventHub:xi}),Qc=Object.freeze({Container:Xc,EventHub:xi,Layout:Zc});function Qe(r,e,t){y.useEffect(function(){return r.on(e,t),()=>{r.off(e,t)}},[r,e,t])}function _m(r,e,t,n){var i,o=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(o==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");T.useEffect(()=>{var a=r(o,e,t,n);return()=>{a()}},[e,n,t,o,r])}var Di="SET_DASHBOARD_DATA";const Yc=Ru(Di,{},!1),Jc={dashboardData:Yc};var eh=new Map,Ai=Object.freeze({}),th=Object.freeze([]),rh=r=>r.dashboardData,st=(r,e)=>{var t;return(t=rh(r)[e])!==null&&t!==void 0?t:Ai},wm=(r,e)=>{var t;return(t=st(r,e).closed)!==null&&t!==void 0?t:th},Cm=(r,e)=>{var t;return(t=st(r,e).openedMap)!==null&&t!==void 0?t:eh},ki=(r,e)=>{var t;return(t=st(r,e).pluginDataMap)!==null&&t!==void 0?t:Ai},Sm=(r,e,t)=>ki(r,e)[t];function Nn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(t),!0).forEach(function(n){nh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function nh(r,e,t){return e=ih(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ih(r){var e=oh(r,"string");return typeof e=="symbol"?e:String(e)}function oh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ni=(r,e)=>({type:Di,id:r,payload:e}),ah=(r,e)=>(t,n)=>t(Ni(r,tt(tt({},st(n(),r)),e))),Pm=(r,e,t)=>(n,i)=>n(Ni(r,tt(tt({},st(i(),r)),{},{pluginDataMap:tt(tt({},ki(i(),r)),{},{[e]:t})})));Object.entries(Jc).map(r=>{var[e,t]=r;return Ku.register(e,t)});function sh(r){var{children:e}=r;return h.jsx(h.Fragment,{children:e})}function Fn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ft(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fn(Object(t),!0).forEach(function(n){lh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function lh(r,e,t){return e=uh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uh(r){var e=dh(r,"string");return typeof e=="symbol"?e:String(e)}function dh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var $t=N.module("DashboardLayout"),ch=Object.freeze({}),hh=[],Ln=()=>{},Rn=r=>r;function mh(r){var e,t,{id:n,children:i,emptyDashboard:o=h.jsx("div",{children:"Dashboard is empty."}),layout:a,layoutConfig:s=hh,onLayoutChange:l=Ln,onLayoutInitialized:u=Ln,hydrate:d=Oi,dehydrate:c=Ii,panelWrapper:m=sh}=r,g=Yi(),b=(e=Ji(I=>st(I,n)))!==null&&e!==void 0?e:ch,[_,E]=y.useState(!1),[D,A]=y.useState(!1),[M,ne]=y.useState(),[K]=y.useState((t=b?.closed)!==null&&t!==void 0?t:[]),[oe,H]=y.useState(!1),[V,G]=y.useState(a.getReactChildren()),ae=y.useMemo(()=>new Map,[]),q=y.useMemo(()=>new Map,[]),Oe=y.useCallback(function(I,L){var k,dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d,Mr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;$t.debug2("registerComponent",I,L,dt,Mr);function Tr(It,Ri){var Yt=L,$i=m,ji=qc(Yt),{glContainer:Bi,glEventHub:Wi}=It;return h.jsx(zc,{glContainer:Bi,glEventHub:Wi,children:h.jsx($i,ft(ft({},It),{},{children:ji?h.jsx(Yt,ft(ft({},It),{},{ref:Ri})):h.jsx(Yt,ft({},It))}))})}Tr.displayName="DashboardWrapper(".concat((k=L.displayName)!==null&&k!==void 0?k:I,")");var Li=a.registerComponent(I,T.forwardRef(Tr));return ae.set(I,dt),q.set(I,Mr),Li},[d,c,ae,q,a,m]),J=y.useCallback((I,L)=>{var k;return((k=ae.get(I))!==null&&k!==void 0?k:Rn)(L,n)},[ae,n]),pe=y.useCallback((I,L)=>{var k;return((k=q.get(I))!==null&&k!==void 0?k:Rn)(L,n)},[q,n]),he=y.useMemo(()=>new Er(a,J,pe,new Map,K,I=>{var{closed:L,openedMap:k}=I;g(ah(n,{closed:L,openedMap:k}))}),[pe,g,J,n,K,a]),be=y.useCallback(()=>{if(!D){oe||(u(),H(!0));var I=a.toConfig(),L=I.content,k=S.dehydrateLayoutConfig(L,pe),dt=M==null||!S.isEqual(M,k);$t.debug("handleLayoutStateChanged",dt,L,k),dt&&(E(a.root.contentItems.length===0),ne(k),l(k),G(a.getReactChildren()))}},[pe,oe,D,M,a,l,u]),Ve=y.useCallback(I=>{var L=S.getIdFromContainer(I);a.eventHub.emit(U.DRAGGING,L),A(!0)},[a.eventHub]),lt=y.useCallback(I=>{var L=S.getIdFromContainer(I);a.eventHub.emit(U.DROPPED,L),A(!1)},[a.eventHub]),ut=y.useCallback(I=>{if($t.debug2("handleComponentCreated",I),!(I==null||I.config==null||I.config.component==null||I.element==null)){var L=I.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),k="".concat(L,"-component");I.element.addClass(k)}},[]),Ge=y.useCallback(()=>{G(a.getReactChildren())},[a]);Qe(a,"stateChanged",be),Qe(a,"itemPickedUp",Ve),Qe(a,"itemDropped",lt),Qe(a,"componentCreated",ut),Qe(a.eventHub,U.TITLE_CHANGED,be),Qe(a,"reactChildrenChanged",Ge);var qe=_a(s);return y.useEffect(function(){if(qe!==s&&s!==M){$t.debug("Setting new layout content...");for(var L=S.hydrateLayoutConfig(s,J);a.root.contentItems.length>0;)a.root.contentItems[0].remove();for(var k=0;k<L.length;k+=1)a.root.addChild(L[k]);E(a.root.contentItems.length===0)}},[J,a,s,M,he,qe]),h.jsxs(h.Fragment,{children:[_&&o,V,T.Children.map(i,I=>I!=null?T.cloneElement(I,{id:n,layout:a,panelManager:he,registerComponent:Oe}):null)]})}mh.propTypes={id:v.string.isRequired,children:v.node,data:v.shape({}),emptyDashboard:v.node,layout:Qc.Layout.isRequired,layoutConfig:v.arrayOf(v.shape({})),onLayoutChange:v.func,onLayoutInitialized:v.func};var Em="default",fh=y.createContext(null),Tt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function gh(r){return"DashboardPlugin"in r}function vh(r){return"AuthPlugin"in r}function ph(r){return"TablePlugin"in r}function Mm(r){return gh(r)||vh(r)||ph(r)}function Tm(r){return"type"in r&&r.type===Tt.DASHBOARD_PLUGIN}function Fi(r){return"type"in r&&r.type===Tt.WIDGET_PLUGIN}function Im(r){return"type"in r&&r.type===Tt.TABLE_PLUGIN}function Om(r){return"type"in r&&r.type===Tt.AUTH_PLUGIN}function bh(r){return"type"in r&&r.type===Tt.THEME_PLUGIN}var yh=N.module("@deephaven/plugin.PluginUtils");function xm(r,e){return r==null||!Fi(r)?!1:[r.supportedTypes].flat().some(t=>t===e)}function Dm(r){var e=h.jsx(ot,{icon:Eo});if(!Fi(r))return e;var{icon:t}=r;return t==null?e:y.isValidElement(t)?t:h.jsx(ot,{icon:t})}function Am(r){var e=[...r.entries()].filter(t=>bh(t[1]));return yh.debug("Getting theme data from plugins",e),e.map(t=>{var[n,i]=t,o=Array.isArray(i.themes)?i.themes:[i.themes];return o.map(a=>{var{name:s,baseTheme:l,styleContent:u}=a;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:Po(n,s),name:s,styleContent:u}})}).flat()}function km(){return St(fh,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}export{Du as $,Ro as A,it as B,Nh as C,Th as D,Bo as E,ui as F,xt as G,U as H,we as I,Ph as J,w as K,Vn as L,za as M,qn as N,yt as O,Bt as P,Tm as Q,gh as R,Wh as S,p as T,kh as U,Dr as V,im as W,sm as X,lm as Y,cm as Z,nm as _,W as a,Er as a$,om as a0,am as a1,hm as a2,km as a3,fm as a4,Dl as a5,Oh as a6,Ah as a7,St as a8,Sa as a9,Gh as aA,Zh as aB,Uh as aC,Vh as aD,qh as aE,eu as aF,Qh as aG,Yh as aH,au as aI,su as aJ,Jh as aK,di as aL,tm as aM,em as aN,pu as aO,rm as aP,Mh as aQ,er as aR,Zu as aS,S as aT,_m as aU,Qe as aV,ym as aW,Sm as aX,mh as aY,Qc as aZ,zc as a_,Gn as aa,pa as ab,_a as ac,We as ad,_e as ae,Gt as af,Qn as ag,Rh as ah,$h as ai,_s as aj,P as ak,Na as al,Bh as am,jh as an,Ls as ao,js as ap,zn as aq,$l as ar,Bl as as,Z as at,Gl as au,Ql as av,re as aw,zh as ax,li as ay,ou as az,ye as b,Di as b0,pm as b1,qc as b2,Ii as b3,wm as b4,Cm as b5,ki as b6,Oi as b7,Bc as b8,Ut as b9,Pu as bA,Eu as bB,Tu as bC,Dh as bD,de as bE,Hn as bF,Eh as bG,hu as bH,Xh as bI,Jc as ba,Fi as bb,Tt as bc,fh as bd,Dm as be,Am as bf,Om as bg,vh as bh,Mm as bi,ph as bj,Im as bk,bh as bl,xm as bm,oc as bn,jc as bo,ra as bp,Ih as bq,Hh as br,sn as bs,yu as bt,bu,Cu as bv,_u as bw,wu as bx,Mu as by,Su as bz,f as c,xh as d,um as e,R as f,Q as g,va as h,j as i,ii as j,Fh as k,mm as l,Lh as m,ls as n,gm as o,bm as p,Em as q,Ku as r,dm as s,Ni as t,Kh as u,Pm as v,ah as w,ku as x,rh as y,st as z};
3
- //# sourceMappingURL=usePlugins-ed18184b.js.map