@deephaven/embed-widget 1.23.1-alpha-pivot-builder.5e6a5fd.0 → 1.24.0

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 (36) hide show
  1. package/build/assets/{App-BvuWvKlE.js → App-WbT4PZ7h.js} +2 -2
  2. package/build/assets/{App-BvuWvKlE.js.map → App-WbT4PZ7h.js.map} +1 -1
  3. package/build/assets/{Chart-DWgEX7af.js → Chart-Do7O4T6U.js} +2 -2
  4. package/build/assets/{Chart-DWgEX7af.js.map → Chart-Do7O4T6U.js.map} +1 -1
  5. package/build/assets/{IrisGrid-DglTgMOp.js → IrisGrid-fI-xRu3X.js} +2 -2
  6. package/build/assets/{IrisGrid-DglTgMOp.js.map → IrisGrid-fI-xRu3X.js.map} +1 -1
  7. package/build/assets/{IrisGridThemeProvider-CtHzFeLc.js → IrisGridThemeProvider-DW8JrkAj.js} +2 -2
  8. package/build/assets/{IrisGridThemeProvider-CtHzFeLc.js.map → IrisGridThemeProvider-DW8JrkAj.js.map} +1 -1
  9. package/build/assets/{LocalWorkspaceStorage-BR1VbrKD.js → LocalWorkspaceStorage-D7nM6Uc0.js} +2 -2
  10. package/build/assets/{LocalWorkspaceStorage-BR1VbrKD.js.map → LocalWorkspaceStorage-D7nM6Uc0.js.map} +1 -1
  11. package/build/assets/LogPanel-C1V6_183.css +1 -0
  12. package/build/assets/{LogPanel-CoRvBQjW.js → LogPanel-DzqyvYDR.js} +40 -40
  13. package/build/assets/LogPanel-DzqyvYDR.js.map +1 -0
  14. package/build/assets/{MarkdownEditor-BNwkOYs0.js → MarkdownEditor-qZLPf--d.js} +2 -2
  15. package/build/assets/{MarkdownEditor-BNwkOYs0.js.map → MarkdownEditor-qZLPf--d.js.map} +1 -1
  16. package/build/assets/{MarkdownNotebook-C3qGE62a.js → MarkdownNotebook-CZKR3cna.js} +2 -2
  17. package/build/assets/{MarkdownNotebook-C3qGE62a.js.map → MarkdownNotebook-CZKR3cna.js.map} +1 -1
  18. package/build/assets/Plot-CxolyxAB.js +2 -0
  19. package/build/assets/{Plot-BOusvhev.js.map → Plot-CxolyxAB.js.map} +1 -1
  20. package/build/assets/{Plotly-C1DmK1JJ.js → Plotly-CrH1R1wr.js} +2 -2
  21. package/build/assets/{Plotly-C1DmK1JJ.js.map → Plotly-CrH1R1wr.js.map} +1 -1
  22. package/build/assets/{index-aUgTMo-T.js → index-BIotQEOH.js} +2 -2
  23. package/build/assets/{index-aUgTMo-T.js.map → index-BIotQEOH.js.map} +1 -1
  24. package/build/assets/{index-C23Z3kqm.js → index-CQm54PSx.js} +36 -36
  25. package/build/assets/index-CQm54PSx.js.map +1 -0
  26. package/build/assets/{index-DTgWnYGf.js → index-jF_4wnuH.js} +3 -3
  27. package/build/assets/{index-DTgWnYGf.js.map → index-jF_4wnuH.js.map} +1 -1
  28. package/build/assets/plotly-g-Pezqd_.js +7 -0
  29. package/build/assets/{plotly-XNdqftXi.js.map → plotly-g-Pezqd_.js.map} +1 -1
  30. package/build/index.html +2 -2
  31. package/package.json +17 -17
  32. package/build/assets/LogPanel-CoRvBQjW.js.map +0 -1
  33. package/build/assets/LogPanel-D9n6wQ18.css +0 -1
  34. package/build/assets/Plot-BOusvhev.js +0 -2
  35. package/build/assets/index-C23Z3kqm.js.map +0 -1
  36. package/build/assets/plotly-XNdqftXi.js +0 -7
@@ -1,46 +1,46 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-BOusvhev.js","./Plotly-C1DmK1JJ.js","./plotly-XNdqftXi.js","./helpers-BosuxZz1.js","./vendor-Iv4yoqlt.js","./vendor-BSYTbjlr.css"])))=>i.map(i=>d[i]);
2
- import{ao as Iu,a as H,aO as js,T as Du,X as Mu,Y as ju,V as Au,a4 as ku,O as Nu,z as Lu,a8 as Ru,d as As,G as ks,e as Ns,q as $u,aP as Fu,aH as Hu,aQ as Ls,aR as Uu,aS as Bu,L as Un,ac as Wu,_ as Ku,aT as Rs,u as B,t as $s,Z as zu,aU as Vu,aN as Gu,aJ as Fs,aK as qu,f as Hs,n as Xu,aL as ii,aV as Zu,aW as Yu,aX as eo,aY as Qu,aZ as Ju,a_ as ed,a$ as td,v as nd,k as Us,aF as rd,h as zr,aA as id,b0 as od,b1 as to,aD as ad,b2 as no,b3 as Bs,b4 as sd,au as ld,b5 as ud,b6 as dd,b7 as cd,b8 as hd,b9 as md,ba as pd}from"./index-DTgWnYGf.js";import{r as h,as as Bn,bE as Ir,D as d,bU as fd,J as j,G as U,bV as Ws,bW as oi,H as vd,R as Oi,bX as gd,bG as bd,I as me,C as Pt,bY as yd,aj as Cd,ak as Sd,E as Ks,ar as fn,bZ as wd,b_ as _d,b$ as Ed,c0 as Pd,bR as ai,c1 as x,c2 as ro,bT as pe,L as zs,N as Vs,c3 as Td,bS as Wn,bO as Cn,_ as Od,bp as Le,c4 as xd,an as Id,aH as Dd,bs as io,c5 as Md,c6 as oo,br as rt,c7 as Gs,c8 as jd,bP as nt,bQ as en,c9 as ao,bq as Ad,bN as kd,ca as Nn}from"./vendor-Iv4yoqlt.js";var Nd=Object.freeze([]),yC=new Map,qs=()=>{};function CC(n){return Array.isArray(n)?n:[n]}function SC(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function Ld(n,e,t){return(e=Rd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rd(n){var e=$d(n,"string");return typeof e=="symbol"?e:e+""}function $d(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class so extends Error{constructor(){super(...arguments),Ld(this,"isCanceled",!0)}}function Fd(n,e,t){return(e=Hd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hd(n){var e=Ud(n,"string");return typeof e=="symbol"?e:e+""}function Ud(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bd extends Error{constructor(){super(...arguments),Fd(this,"isClipboardPermissionsDeniedError",!0)}}function Wd(n,e,t){return(e=Kd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kd(n){var e=zd(n,"string");return typeof e=="symbol"?e:e+""}function zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vr extends Error{constructor(){super(...arguments),Wd(this,"isClipboardUnavailableError",!0)}}function Vd(n,e,t){return(e=Gd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gd(n){var e=qd(n,"string");return typeof e=="symbol"?e:e+""}function qd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xs extends Error{constructor(){super(...arguments),Vd(this,"isPermissionUnsupported",!0)}}function lo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Xd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){lo(o,r,i,a,s,"next",l)}function s(l){lo(o,r,i,a,s,"throw",l)}a(void 0)})}}function uo(n){return si.apply(this,arguments)}function si(){return si=Xd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Xs:t}}),si.apply(this,arguments)}function co(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Zs(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){co(o,r,i,a,s,"next",l)}function s(l){co(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ys(n){return li.apply(this,arguments)}function li(){return li=Zs(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}Zd(n)}),li.apply(this,arguments)}function Zd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function wC(){return ui.apply(this,arguments)}function ui(){return ui=Zs(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Vr;var t=yield uo("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield uo("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new Bd}catch(o){throw o instanceof Xs?new Vr:o}throw new Vr}),ui.apply(this,arguments)}var In;function rn(n,e,t){return(e=Yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yd(n){var e=Qd(n,"string");return typeof e=="symbol"?e:e+""}function Qd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Jd="table_",Qs="column_",ec=new Set(["in","not","i","ii","k"]),tc=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"]),nc=/[^a-zA-Z0-9_$\-+@]/g,rc=/[^A-Za-z0-9_$]/g,ic=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,oc=/[^a-zA-Z0-9_]/g;function ac(n){return n.replace(/[ -]/g,"_")}function sc(n){return n.replace(/\s/g,"_")}class gt{}In=gt;rn(gt,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(ec.has(a)||tc.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});rn(gt,"legalizeTableName",n=>In.legalize(n,sc,Jd,nc,!1,0));rn(gt,"makeVariableName",n=>In.legalizeTableName(n).replace(oc,"_"));rn(gt,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=In.legalizeColumnName(t,r);e.includes(i)&&(i=Qs+r),e.push(i)}),e});rn(gt,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return In.legalize(n,ac,Qs,rc,!0,e)});rn(gt,"isValidTableName",n=>ic.test(n));rn(gt,"isValidColumnName",n=>In.legalizeColumnName(n)===n);class Js extends CustomEvent{constructor(e,t){super(e,t)}}class Ye{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new so),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof so}static isTimedOut(e){return e instanceof Iu}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function ho(n,e,t){return(e=lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lc(n){var e=uc(n,"string");return typeof e=="symbol"?e:e+""}function uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dr{constructor(){ho(this,"pending",[]),ho(this,"resolved",[])}add(e,t){var r=Ye.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}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=[]}}function _C(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function mo(n,e){return mc(n)||hc(n,e)||cc(n,e)||dc()}function dc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cc(n,e){if(n){if(typeof n=="string")return po(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?po(n,e):void 0}}function po(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function hc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function mc(n){if(Array.isArray(n))return n}class lt{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(!lt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=mo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(u<=i&&o<=c)return a;i<=c&&u<=o&&(i=Math.min(i,u),o=Math.max(o,c),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=mo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(!(o<u||c<i))if(u<i&&o<c){a[s]=[u,i-1],a.splice(s+1,0,[o+1,c]);break}else i<=u&&c<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+1,c]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*EC(n,e){for(var t=n;t<=e;++t)yield t}var PC=" ";class pc{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 r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var Kn;function Bt(n,e,t){return(e=fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fc(n){var e=vc(n,"string");return typeof e=="symbol"?e:e+""}function vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(Fe.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])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}Kn=Fe;Bt(Fe,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Bt(Fe,"MILLIS_PER_SECOND",1e3);Bt(Fe,"NANOS_PER_SECOND",1e9);Bt(Fe,"NANOS_PER_MIN",60*Kn.NANOS_PER_SECOND);Bt(Fe,"NANOS_PER_HOUR",60*Kn.NANOS_PER_MIN);Bt(Fe,"MILLIS_PER_MIN",60*Kn.MILLIS_PER_SECOND);Bt(Fe,"MILLIS_PER_HOUR",60*Kn.MILLIS_PER_MIN);Bt(Fe,"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"}]));function gc(n,e,t){return(e=bc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bc(n){var e=yc(n,"string");return typeof e=="symbol"?e:e+""}function yc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ln extends Error{constructor(){super(...arguments),gc(this,"isInvalid",!0)}}function el(){var n=h.useRef(!1);return h.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function fo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Cc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){fo(o,r,i,a,s,"next",l)}function s(l){fo(o,r,i,a,s,"throw",l)}a(void 0)})}}var Sc=H.module("useAsyncInterval");function wc(n,e){var t=el(),r=h.useRef(0),i=h.useRef(0),o=h.useRef(null),a=h.useCallback(Cc(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(m){Sc.error("A tick error occurred:",m)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),c=Math.max(0,e-u);r.current=window.setTimeout(a,c)}}),[n,t,e]);h.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function zn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=h.useContext(n);if(t==null)throw new Error(e);return t}function _c(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=h.useMemo(()=>Bn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return h.useEffect(()=>()=>l.cancel(),[l]),l}function Ec(n){var e=h.useRef();return h.useEffect(function(){e.current=n}),e.current}function Pc(n,e,t){var r=h.useRef(t),i=h.useRef(n);i.current=n;var o=h.useMemo(()=>Ir(function(){return i.current(...arguments)},e,r.current),[e]);return h.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function tl(n){var e=h.useRef(null);return h.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Tc(n,e){return Dc(n)||Ic(n,e)||xc(n,e)||Oc()}function Oc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xc(n,e){if(n){if(typeof n=="string")return vo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vo(n,e):void 0}}function vo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ic(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Dc(n){if(Array.isArray(n))return n}var Mc=3500,jc=H.module("useCopyToClipboard");function Ac(){var n=h.useState(!1),e=Tc(n,2),t=e[0],r=e[1],i=h.useRef(null),o=h.useCallback(a=>{Ys(a).then(()=>{r(!0)}).catch(s=>jc.error("Unable to copy ".concat(a),`
5
- `,s))},[]);return h.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},Mc)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var kc=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function Nc(n){return typeof n=="string"&&kc.includes(n)}function nl(n){return n!=null&&Nc(n)?"var(--dh-color-".concat(n,")"):n}var Lc=["color","UNSAFE_style"];function go(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ir(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?go(Object(t),!0).forEach(function(r){Rc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):go(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rc(n,e,t){return(e=$c(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $c(n){var e=Fc(n,"string");return typeof e=="symbol"?e:e+""}function Fc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Hc(n,e){if(n==null)return{};var t,r,i=Uc(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Uc(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var rl=h.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=Hc(n,Lc),o=h.useMemo(()=>ir(ir({},r),{},{color:nl(t)}),[t,r]);return d.jsx(fd,ir(ir({},i),{},{ref:e,UNSAFE_style:o}))});rl.displayName="Text";function bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Mt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bo(Object(t),!0).forEach(function(r){vn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vn(n,e,t){return(e=Bc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bc(n){var e=Wc(n,"string");return typeof e=="symbol"?e:e+""}function Wc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yo="popper",Kc="popper-container",zc={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Ws.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class Mr extends h.Component{constructor(e){super(e),vn(this,"element",void 0),vn(this,"container",void 0),vn(this,"nodeRef",j.createRef()),vn(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.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=j.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=U(Kc,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,c=u?zc:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},m=Mt(Mt(Mt({},c),l),{},{modifiers:Mt(Mt(Mt({},c.modifiers),l.modifiers),{},{preventOverflow:Mt(Mt({},(e=c.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var p=this.getVisibleElement(this.container.current);p==null&&(p=this.container.current);var f=new Ws(a||p,this.element,m);f.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var v=this.element.querySelector(".".concat(yo));v instanceof HTMLElement&&!v.contains(document.activeElement)&&v.focus()}}),oi.flushSync(()=>{this.setState({popper:f})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),oi.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=this.state.show;return d.jsx(js,{isPortal:!0,children:d.jsx(vd,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:d.jsx("div",{ref:this.nodeRef,onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:U(yo,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[r,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Oi.createPortal(this.renderContent(),this.element)})}}vn(Mr,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:Du.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var di;function Co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=Gc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gc(n){var e=qc(n,"string");return typeof e=="symbol"?e:e+""}function qc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xc=H.module("Tooltip");class le extends h.Component{static handleHidden(){le.shownTooltipCount-=1,le.shownTooltipCount===0&&(le.lastHiddenTime=Date.now())}static handleShown(){le.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(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=j.createRef(),this.popper=j.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?le.handleShown():le.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&le.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Xc.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 e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;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&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(le.shownTooltipCount>0||Date.now()-le.lastHiddenTime<le.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),oi.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=Vc({placement:"bottom"},u),d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:d.jsx(Mr,{className:U(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:d.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}di=le;ut(le,"defaultTimeout",500);ut(le,"defaultReshowTimeout",100);ut(le,"triggerReshowThreshold",300);ut(le,"shownTooltipCount",0);ut(le,"lastHiddenTime",Date.now());ut(le,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:di.defaultReshowTimeout,timeout:di.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function So(n,e){return Jc(n)||Qc(n,e)||Yc(n,e)||Zc()}function Zc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yc(n,e){if(n){if(typeof n=="string")return wo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wo(n,e):void 0}}function wo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Qc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Jc(n){if(Array.isArray(n))return n}var eh=H.module("ThemeProvider"),xi=h.createContext(null);xi.displayName="ThemeContext";function TC(n){var e=n.themes,t=n.waitForActivation,r=t===void 0?!1:t,i=n.defaultPreloadValues,o=i===void 0?Lu:i,a=n.children,s=h.useMemo(()=>Mu(),[]),l=h.useState(null),u=So(l,2),c=u[0],m=u[1],p=h.useState(ju),f=So(p,2),v=f[0],g=f[1],b=h.useMemo(()=>e==null?null:Au(v,{base:s,custom:e??[]}),[s,v,e]),y=h.useMemo(()=>[...s,...e??[]],[s,e]);return h.useEffect(function(){if(!(b==null||e==null)){ku(o);var S=Nu(o);eh.debug2("updateThemePreloadData:",{active:b.map(_=>_.themeKey),custom:e.map(_=>_.themeKey),preloadStyleContent:S,selectedThemeKey:v}),Ru({themeKey:v,preloadStyleContent:S})}},[b,v,e,o]),h.useEffect(()=>{m({activeThemes:b,selectedThemeKey:v,themes:y,setSelectedThemeKey:g})},[b,v,y]),r&&b==null?null:d.jsxs(d.Fragment,{children:[b==null?null:d.jsx(d.Fragment,{children:b.map(C=>d.jsx("style",{"data-theme-key":C.themeKey,children:C.styleContent},C.themeKey))}),c==null?null:d.jsx(xi.Provider,{value:c,children:d.jsx(js,{children:a})})]})}function il(){return zn(xi,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var th=["color","UNSAFE_style"];function _o(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(t),!0).forEach(function(r){nh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nh(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oh(n,e){if(n==null)return{};var t,r,i=ah(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function ah(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var ol=h.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=oh(n,th),o=h.useMemo(()=>or(or({},r),{},{color:nl(t)}),[t,r]);return d.jsx(gd,or(or({},i),{},{ref:e,UNSAFE_style:o}))});ol.displayName="Heading";function sh(n){var e=n.children,t=n.className,r=n.style,i=n["data-testid"];return d.jsx("div",{className:U("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var lh=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Eo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Po(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(t),!0).forEach(function(r){uh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uh(n,e,t){return(e=dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=ch(n,"string");return typeof e=="symbol"?e:e+""}function ch(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hh(n,e){if(n==null)return{};var t,r,i=mh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function mh(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function ph(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return U("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function fh(n){switch(n){case"group-end":return U("pl-2","pr-3")}}var ne=j.forwardRef((n,e)=>{var t=n.kind,r=n.variant,i=n.type,o=i===void 0?"button":i,a=n.tooltip,s=n.icon,l=n.disabled,u=l===void 0?!1:l,c=n.active,m=n.onClick,p=n.onContextMenu,f=n.onMouseDown,v=n.onMouseUp,g=n.onMouseEnter,b=n.onMouseLeave,y=n.onKeyDown,C=n.className,S=n.style,_=n.children,E=n.tabIndex,D=n["data-testid"],W=n["aria-label"],N=hh(n,lh),I=bd({},"button"),k=I.UNSAFE_className,$;r&&($=fh(r));var ae;s&&(ae=j.isValidElement(s)?s:d.jsx(me,{icon:s}));var A=ae!=null&&_==null,X=ph(t,A),de;a!==void 0&&(de=typeof a=="string"?d.jsx(le,{children:a}):a);var se=W;W===void 0&&A&&a!=null&&typeof a=="string"&&(se=a);var be=d.jsxs("button",Po(Po({"data-testid":D,ref:e,type:o,className:U("btn",X,$,{active:c},C,k),onClick:m,onContextMenu:p,onMouseUp:v,onMouseDown:f,onMouseEnter:g,onMouseLeave:b,onKeyDown:y,style:S,disabled:u,tabIndex:E,"aria-label":se},N),{},{children:[s&&ae,_,a!=null&&!u&&de]}));return u&&a!=null?d.jsxs("span",{className:"btn-disabled-wrapper",children:[be,de]}):be});ne.displayName="Button";function al(n){var e=n.className,t=n.children,r=n["data-testid"];return d.jsx("div",{className:U("modal-footer",e),"data-testid":r,children:t})}function ci(n){var e=n.isOpen,t=n.headerText,r=n.bodyText,i=n.onCancel,o=n.onConfirm,a=n.onDiscard,s=n.onModalDisable,l=n.cancelButtonText,u=l===void 0?"Cancel":l,c=n.confirmButtonText,m=c===void 0?"Okay":c,p=n.discardButtonText,f=p===void 0?"Discard":p,v=n.isConfirmDanger,g=v===void 0?!1:v,b=n.children,y=n["data-testid"],C=h.useRef(null),S=h.useRef(null),_=h.useCallback(()=>{S.current!==null&&S.current.checked&&s&&s(),o()},[o,s]),E=h.useCallback(()=>{var W;(W=C.current)===null||W===void 0||W.focus()},[]),D="";return e&&(D=typeof r=="function"?r():r),d.jsxs(As,{isOpen:e,onOpened:E,children:[d.jsx(ks,{closeButton:!1,children:t}),d.jsx(Ns,{children:D}),d.jsxs(al,{children:[s&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:S,"data-testid":y!==void 0?"".concat(y,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&d.jsx(ne,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":y!==void 0?"".concat(y,"-btn-discard"):void 0,children:f}),i&&d.jsx(ne,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":y!==void 0?"".concat(y,"-btn-cancel"):void 0,children:u}),d.jsxs(sh,{children:[d.jsx(ne,{kind:g?"danger":"primary",onClick:_,ref:C,"data-testid":y!==void 0?"".concat(y,"-btn-confirm"):void 0,children:m}),b]})]})]})}function vh(n,e,t){return(e=gh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gh(n){var e=bh(n,"string");return typeof e=="symbol"?e:e+""}function bh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Gr(n){return n.then!==void 0}class ge{static disableAllActions(){ge.actionsDisabled=!0}static enableAllActions(){ge.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,i;return((r=e.group)!==null&&r!==void 0?r: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(ge.compareActions),t}static isMacPlatform(){var e=window.navigator.platform;return e.startsWith("Mac")}static getModifierKey(){return ge.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ge.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],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&&r.push(s):Array.isArray(s)?r=r.concat(s):r.push(s))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var o=1;o<r.length+1;o+=1){var a=(i+t*o+r.length)%r.length,s=r[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}vh(ge,"actionsDisabled",!1);var To=H.module("GlobalContextAction");class yh extends h.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 r=this.props.action;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),To.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var t=this.props.action;if(!ge.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;To.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class Ch extends h.Component{render(){for(var e=this.props,t=e.actions,r=e["data-testid"],i=[],o=0;o<t.length;o+=1){var a=t[o],s=a.shortcut;if(a.title!=null||a.menuElement||s){var l=d.jsx(yh,{action:a,"data-testid":r},"".concat(a.title,".").concat(s==null?void 0:s.id));i.push(l)}}return i}}function sl(n,e,t){return(e=Sh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sh(n){var e=wh(n,"string");return typeof e=="symbol"?e:e+""}function wh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ar=H.module("ContextActions");class ue extends h.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),sl(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=j.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=>!Gr(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!Gr(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var t=this.props.ignoreClassNames,r=t===void 0?[]:t;if(r.length>0){for(var i=e.target,o=function(){var c=i,m=c.classList,p=r.find(f=>m.contains(f));if(p!==void 0)return ar.debug2('Contextmenu event ignored based on the target className "'.concat(p,'"')),{v:void 0};i=i.parentElement},a;i!=null;)if(a=o(),a)return a.v}if(ge.isContextActionEvent(e)||(e.contextActions=[]),!!ge.isContextActionEvent(e)){var s=this.props.actions;if(s!=null){var l=s;Array.isArray(l)&&(l=l.filter(u=>Gr(u)||typeof u=="function"||u.isGlobal===void 0||!u.isGlobal)),e.contextActions=e.contextActions.concat(l)}ar.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var t=this.state.keyboardActions,r=0;r<t.length;r+=1){var i=t[r];if(!ge.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;ar.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),ar.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var e=this.props["data-testid"],t=this.state.globalActions;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(Ch,{actions:t})})}}sl(ue,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var ll=j.forwardRef((n,e)=>{var t,r,i=n.closeMenu,o=n.children,a=n.menuItem,s=n.onMenuItemClick,l=n.onMenuItemMouseMove,u=n.onMenuItemContextMenu,c=n.isKeyboardSelected,m=c===void 0?!1:c,p=n.isMouseSelected,f=p===void 0?!1:p,v=n["data-testid"],g=h.useCallback(A=>{s(a,A)},[a,s]),b=h.useCallback(A=>{l(a,A)},[a,l]),y=h.useCallback(A=>{u(a,A)},[a,u]);function C(A,X,de){if(typeof A.type=="string")return A;var se={menuItem:a,closeMenu:i,isKeyboardSelected:m,isMouseSelected:f,iconElement:X,displayShortcut:de,"data-testid":v};return j.cloneElement(A,{forwardedProps:se})}var S=(t=a.shortcutText)!==null&&t!==void 0?t:(r=a.shortcut)===null||r===void 0?void 0:r.getDisplayText(),_=null;if(a.icon){var E=a.icon;if(j.isValidElement(E))_=E;else{var D;a.iconColor!=null&&(a.disabled===void 0||!a.disabled)&&(D={color:a.iconColor}),_=d.jsx(me,{icon:E,style:D})}}var W=null,N=!!o;a.actions&&(W=d.jsx(me,{icon:$u}));var I=null;if(a.menuElement)I=d.jsx("div",{className:"custom-menu-item",onMouseMove:b,children:C(a.menuElement,_,S)});else{var k,$=a.disabled,ae=a.iconOutline;I=d.jsx("button",{type:"button",className:U("btn-context-menu",{disabled:$},{active:(N||f)&&($===void 0||!$)},{"keyboard-active":m&&($===void 0||!$)}),onClick:g,onMouseMove:b,onContextMenu:y,title:(k=a.description)!==null&&k!==void 0?k:"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:U("icon",{outline:ae}),children:_}),d.jsx("span",{className:"title",children:a.title}),S!==void 0&&d.jsx("span",{className:"shortcut",children:S}),W&&d.jsx("span",{className:U("submenu-indicator",{disabled:$}),children:W})]})})}return d.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":v,children:[o,I]})});ll.displayName="ContextMenuItem";function _h(n,e){return Oh(n)||Th(n,e)||Ph(n,e)||Eh()}function Eh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ph(n,e){if(n){if(typeof n=="string")return Oo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Oo(n,e):void 0}}function Oo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Th(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Oh(n){if(Array.isArray(n))return n}var ul=j.forwardRef((n,e)=>{var t=n.checked,r=t===void 0?!1:t,i=n.children,o=n.className,a=n.disabled,s=a===void 0?!1:a,l=n.inputClassName,u=n.isInvalid,c=u===void 0?!1:u,m=n.labelClassName,p=n.name,f=n.onChange,v=n["data-testid"],g=h.useState(Pt()),b=_h(g,1),y=b[0],C=tl(e);h.useEffect(function(){C.current&&(C.current.indeterminate=r===null)},[C,r]);var S=h.useCallback(_=>{C.current&&(C.current.indeterminate=r===null),f&&f(_)},[C,r,f]);return d.jsxs("div",{className:U("custom-control custom-checkbox",o),children:[d.jsx("input",{type:"checkbox",ref:C,checked:r??!1,className:U("custom-control-input",l,{"is-invalid":c}),disabled:s,id:y,name:p,onChange:S,"data-testid":v}),d.jsx("label",{className:U("custom-control-label",m),htmlFor:y,children:i})]})});ul.displayName="Checkbox";function Sr(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function dl(n){return Sr(n)&&dl(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function xh(n){return!Sr(n)&&"$$typeof"in n&&n.$$typeof===yd.ForwardRef}function cl(n){return dl(n)||xh(n)}var Ih=["copy","tooltip","children"];function xo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Io(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xo(Object(t),!0).forEach(function(r){Dh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Dh(n,e,t){return(e=Mh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mh(n){var e=jh(n,"string");return typeof e=="symbol"?e:e+""}function jh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ah(n,e){return Rh(n)||Lh(n,e)||Nh(n,e)||kh()}function kh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nh(n,e){if(n){if(typeof n=="string")return Do(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Do(n,e):void 0}}function Do(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Lh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Rh(n){if(Array.isArray(n))return n}function $h(n,e){if(n==null)return{};var t,r,i=Fh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Fh(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var Mo="Copy";function hl(n){var e=n.copy,t=n.tooltip,r=t===void 0?Mo:t,i=n.children,o=$h(n,Ih),a=Ac(),s=Ah(a,2),l=s[0],u=s[1],c=l?"Copied":r;return d.jsxs(Cd,Io(Io({},o),{},{"aria-label":c,onPress:()=>{u(typeof e=="function"?e():e)},children:[d.jsx(Sd,{UNSAFE_className:i==null?"action-button-icon-with-tooltip":void 0,children:d.jsx(me,{icon:l?Fu:Hu})}),i!=null&&d.jsx(rl,{children:i}),(i==null||c!==Mo)&&d.jsx(le,{children:c})]}))}hl.displayName="CopyButton";function jo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jo(Object(t),!0).forEach(function(r){Rn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rn(n,e,t){return(e=Uh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uh(n){var e=Bh(n,"string");return typeof e=="symbol"?e:e+""}function Bh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ml extends h.PureComponent{constructor(e){var t;super(e),Rn(this,"container",void 0),Rn(this,"oldFocus",void 0),Rn(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=j.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var r=e.options,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var t=this.props.onMenuOpened;t(this)})}componentDidUpdate(e){var t=this.props.actions;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var e=this.props.options;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var t=this.state.keyboardIndex;return t}return this.getMouseIndex()}setKeyboardIndex(e){var t=this.props.options;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var e=this.state.mouseIndex;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var e=this.props.actions,t=ge.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:ge.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var t=this.state.menuItems,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=ge.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=ge.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.props,r=t.closeMenu,i=t.onMenuClosed;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r(e),i(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 t=this.state.menuItems,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],t=this.props["data-testid"],r=this.state,i=r.keyboardIndex,o=r.menuItems,a=r.mouseIndex,s=0;s<o.length;s+=1){var l=o[s];s>0&&l.group!==o[s-1].group&&e.push(d.jsx("hr",{},"".concat(s,".separator")));var u=d.jsx(ll,{isKeyboardSelected:i===s,isMouseSelected:a===s,menuItem:l,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(u)}var c=this.props.menuStyle;return d.jsx("div",{className:"context-menu-container",style:Hh({},c),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}Rn(ml,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ko(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ao(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ao(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gn(n,e,t){return(e=Wh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wh(n){var e=Kh(n,"string");return typeof e=="symbol"?e:e+""}function Kh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jr extends h.PureComponent{constructor(e){super(e),gn(this,"container",void 0),gn(this,"parent",void 0),gn(this,"popper",void 0),gn(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=j.createRef(),this.parent=null,this.popper=j.createRef(),this.isOpen=!1}componentDidMount(){var e=this.props.isShown;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 t=this.props.isShown;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 e=this.props.onMenuClosed;e()}render(){var e=this.props,t=e.actions,r=e.onMenuOpened,i=e.popperClassName,o=e["data-testid"],a=this.props.menuStyle,s=this.props,l=s.options,u=s.popperOptions;return u=ko({placement:"bottom"},u),l=ko({separateKeyboardMouse:!0},l),d.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":o,children:d.jsx(Mr,{ref:this.popper,options:u,className:U("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:d.jsx(ml,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:r,options:l,menuStyle:a})})})}}gn(jr,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function Nt(n,e,t){return(e=zh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zh(n){var e=Vh(n,"string");return typeof e=="symbol"?e:e+""}function Vh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var No=H.module("Shortcut"),P=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),w=function(n){return n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12",n}({}),Gh=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 fe extends Ks{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var t=e.keyValue;if(t===null)return!0;if(!fe.isMacPlatform&&e.metaKey||!fe.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||Gh.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case 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 t=e.key,r=e.keyCode,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!fe.isAllowedKey(t)&&fe.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===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 r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":fe.isMacPlatform?fe.getMacDisplayText(e):fe.getWindowsDisplayText(e)}constructor(e){var t=e.id,r=e.shortcut,i=e.macShortcut,o=e.isEditable,a=o===void 0?!0:o,s=e.name,l=e.tooltip;super(),Nt(this,"id",void 0),Nt(this,"name",void 0),Nt(this,"tooltip",void 0),Nt(this,"isEditable",void 0),Nt(this,"defaultKeyState",void 0),Nt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=l,this.isEditable=a;var u=fe.isMacPlatform,c=u?i:r;this.defaultKeyState=fe.createKeyState(c),this.keyState=this.defaultKeyState}getDisplayText(){return fe.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){fe.isValidKeyState(e)?(No.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Js("onUpdate",{detail:this}))):No.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return fe.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(fe.NULL_KEY_STATE)}isNull(){return fe.doKeyStatesMatch(this.keyState,fe.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return fe.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(fe.getKeyStateFromEvent(e))}}Nt(fe,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Nt(fe,"isMacPlatform",ge.isMacPlatform());function Lo(n,e,t){return(e=qh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qh(n){var e=Xh(n,"string");return typeof e=="symbol"?e:e+""}function Xh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ro=H.module("ShortcutRegistry");class Zh extends Ks{constructor(){super(...arguments),Lo(this,"shortcutMap",new Map),Lo(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new fe(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Ro.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Ro.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var a=o.detail;return this.dispatchEvent(new Js("onUpdate",{detail:a}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var oe=Object.freeze(new Zh),bn={COPY:oe.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[P.CTRL,w.C],macShortcut:[P.CMD,w.C],isEditable:!1}),PASTE:oe.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[P.CTRL,w.V],macShortcut:[P.CMD,w.V],isEditable:!1}),SAVE:oe.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[P.CTRL,w.S],macShortcut:[P.CMD,w.S],isEditable:!1}),SELECT_ALL:oe.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[P.CTRL,w.A],macShortcut:[P.CMD,w.A],isEditable:!1}),REOPEN_CLOSED_PANEL:oe.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[P.ALT,P.SHIFT,w.T],macShortcut:[P.OPTION,P.SHIFT,w.T],isEditable:!0}),LINKER:oe.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[P.CTRL,w.L],macShortcut:[P.CMD,w.L]}),LINKER_CLOSE:oe.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:oe.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}),EXPORT_LOGS:oe.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[P.CTRL,P.ALT,P.SHIFT,w.L],macShortcut:[P.CMD,P.OPTION,P.SHIFT,w.L],isEditable:!0}),OPEN_DASHBOARD_LIST:oe.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[P.ALT,P.SHIFT,w.D],macShortcut:[P.OPTION,P.SHIFT,w.D],isEditable:!0}),NEXT:oe.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:oe.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[P.SHIFT,w.ENTER],macShortcut:[P.SHIFT,w.ENTER],isEditable:!1}),UNDO:oe.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[P.CTRL,w.Z],macShortcut:[P.CMD,w.Z],isEditable:!1}),REDO:oe.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[P.CTRL,P.SHIFT,w.Z],macShortcut:[P.CMD,P.SHIFT,w.Z],isEditable:!1})};function hi(n,e,t){return(e=Yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yh(n){var e=Qh(n,"string");return typeof e=="symbol"?e:e+""}function Qh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ar extends h.PureComponent{constructor(e){super(e),hi(this,"inputField",void 0),hi(this,"searchChangeSelection",void 0),this.inputField=j.createRef(),this.searchChangeSelection=j.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var e=this.props,t=e.value,r=e.placeholder,i=e.endPlaceholder,o=e.onBlur,a=e.onChange,s=e.className,l=e.disabled,u=e.matchCount,c=e.id,m=e.onKeyDown,p=e["data-testid"],f=e.cursor,v,g=[{action:()=>f==null?void 0:f.next("forward"),shortcut:bn.NEXT},{action:()=>f==null?void 0:f.next("back"),shortcut:bn.PREVIOUS}];return f&&u>1?v=d.jsxs(d.Fragment,{children:[d.jsx(ne,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{f.next("back")},icon:Ls,tooltip:"Previous match (".concat(bn.PREVIOUS.getDisplayText(),")")}),d.jsxs("span",{className:"search-change-text",children:[f.index!==void 0&&"".concat(f.index+1," of "),u]}),d.jsx(ne,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{f.next("forward")},icon:Uu,tooltip:"Next match (".concat(bn.NEXT.getDisplayText(),")")})]}):v=u>0&&d.jsx("span",{className:"search-match",children:u}),d.jsxs("div",{className:U("search-group",s),children:[d.jsx("input",{type:"search",value:t,onBlur:o,onChange:a,onKeyDown:m,className:"form-control",disabled:l,placeholder:r,ref:this.inputField,id:c,"data-testid":p}),u!=null?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),d.jsx(ue,{actions:g})]}):d.jsxs("span",{className:"search-end-content",children:[(i??"")!==""&&t===""&&d.jsx("span",{className:"search-end-placeholder",children:i}),d.jsx(me,{icon:Bu})]})]})}}hi(Ar,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function pl(n,e,t){return(e=Jh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jh(n){var e=em(n,"string");return typeof e=="symbol"?e:e+""}function em(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class fl extends h.PureComponent{constructor(e){super(e),pl(this,"searchInput",void 0),this.searchInput=j.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Bn(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var t=this.props.value;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 e=this.props.onChange,t=this.state.value;e(t)}render(){var e=this.props,t=e.placeholder,r=e.className,i=e.matchCount,o=e.id,a=e["data-testid"],s=this.state.value;return d.jsx(Ar,{value:s,placeholder:t,onChange:this.handleChange,className:r,matchCount:i,ref:this.searchInput,id:o,"data-testid":a})}}pl(fl,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function vl(n,e,t){return(e=tm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tm(n){var e=nm(n,"string");return typeof e=="symbol"?e:e+""}function nm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rm=H.module("ItemListItem");class kr extends h.Component{static handleKeyDown(){return rm.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),vl(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=j.createRef()}handleBlur(e){var t=this.props,r=t.itemIndex,i=t.onBlur;i(r,e)}handleFocus(e){var t=this.props,r=t.itemIndex,i=t.onFocus;i(r,e)}handleClick(e){var t=this.props,r=t.itemIndex,i=t.onClick;i(r,e)}handleContextMenu(e){var t=this.props,r=t.itemIndex,i=t.onContextMenu;i(r,e)}handleDragStart(e){var t=this.props,r=t.itemIndex,i=t.onDragStart;i(r,e)}handleDrag(e){var t=this.props,r=t.itemIndex,i=t.onDrag;i(r,e)}handleDragOver(e){e.preventDefault();var t=this.props,r=t.itemIndex,i=t.onDragOver;i(r,e)}handleDragEnd(e){var t=this.props,r=t.itemIndex,i=t.onDragEnd;i(r,e)}handleDrop(e){var t=this.props,r=t.itemIndex,i=t.onDrop;i(r,e)}handleDoubleClick(e){var t=this.props,r=t.itemIndex,i=t.onDoubleClick;i(r,e)}handleMouseMove(e){var t=this.props,r=t.itemIndex,i=t.onMouseMove;i(r,e)}handleMouseDown(e){var t=this.props,r=t.itemIndex,i=t.onMouseDown;i(r,e)}handleMouseUp(e){var t=this.props,r=t.itemIndex,i=t.onMouseUp;i(r,e)}render(){var e=this.props,t=e.isDraggable,r=e.isFocused,i=e.isSelected,o=e.style,a=e.children,s=e["data-testid"];return d.jsx("div",{className:U("item-list-item",{active:i},{"is-focused":r},{"is-draggable":t}),onKeyDown:kr.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:o,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:t,"data-testid":s,children:a})}}vl(kr,"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:{}});var br;function $o(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$o(Object(t),!0).forEach(function(r){it(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$o(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function it(n,e,t){return(e=im(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function im(n){var e=om(n,"string");return typeof e=="symbol"?e:e+""}function om(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ho=H.module("ItemList"),Uo=5;class ct extends h.PureComponent{static renderItem(e){var t,r,i=e.item;return d.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),it(this,"list",void 0),it(this,"listContainer",void 0),it(this,"getItemSelected",fn((i,o)=>lt.isSelected(o,i),{max:ct.CACHE_SIZE})),it(this,"getCachedItem",fn((i,o,a,s,l,u,c,m)=>{var p=u({item:a,itemIndex:i,isFocused:s,isSelected:l,style:c});return d.jsx(kr,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:m,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:c,children:p},o)},{max:ct.CACHE_SIZE})),it(this,"getOuterElement",fn(i=>{var o=j.forwardRef((a,s)=>d.jsx("div",Fo({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o},{max:1e3})),it(this,"getInnerElement",fn(()=>{var i=j.forwardRef((o,a)=>d.jsx("div",Fo({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i},{max:1e3})),it(this,"getItemData",fn((i,o,a)=>({items:i,selectedRanges:o,renderItem:a}),{max:1e3})),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=j.createRef(),this.listContainer=j.createRef();var t=e.isStickyBottom,r=e.selectedRanges;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var r=this.props,i=r.selectedRanges,o=r.itemCount,a=this.state,s=a.focusIndex,l=a.isStuckToBottom,u=a.scrollOffset,c=a.height,m=a.selectedRanges;if(l&&!this.isListAtBottom()&&o>0&&this.scrollToBottom(),(u!==t.scrollOffset||c!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==m)this.setSelectedRanges(i);else if(m!==t.selectedRanges){var p=this.props.onSelectionChange;p(m)}if(s!==t.focusIndex){var f=this.props.onFocusChange;f(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var e=this.state.scrollOffset;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 t=this.props.focusSelector,r=this.state.overscanStartIndex,i=this.listContainer.current.querySelectorAll(t),o=e-r;return i[o]}focusItem(e){var t=this.props.disableSelect;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var r=this.state.selectedRanges,i=lt.isSelected(r,e),o=i||ge.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var r=this.props,i=r.isDoubleClickSelect,o=r.onSelect;i&&this.setState(a=>{var s=a.selectedRanges;return{selectedRanges:lt.selectRange(s,[e,e])}},()=>{o(e,t)})}handleItemMouseDown(e,t){var r=this.state.selectedRanges;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Ho.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){Ho.debug2("item focus",e,t.target),this.setState(r=>{var i=r.focusIndex;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var r=this.props,i=r.isDragSelect,o=r.isMultiSelect,a=r.disableSelect,s=this.state,l=s.mouseDownIndex,u=s.selectedRanges,c=s.mouseX,m=s.mouseY;if(!(l==null||a)){var p=Math.abs(t.clientX-(c??0)),f=Math.abs(t.clientY-(m??0));p>Uo&&f>Uo&&this.setState({isDragging:!0}),(i||l===e)&&(this.focusItem(e),o?(!i&&!this.getItemSelected(e,u)&&!ge.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(l,e),Math.max(l,e)])):this.toggleSelect(e,t.shiftKey,ge.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var r=this.props,i=r.isDeselectOnClick,o=r.isDoubleClickSelect,a=r.onSelect,s=this.state,l=s.mouseDownIndex,u=s.isDragging;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(l===e&&!u){var c=t.shiftKey,m=ge.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,c,m,i),!o&&!c&&!m&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var t=e.overscanStartIndex;this.setState({overscanStartIndex:t})}handleResize(e){var t=e.height;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var t=this.props,r=t.isMultiSelect,i=t.itemCount,o=t.onSelect,a=this.state.focusIndex,s=a;if(e.key==="Enter"||e.key===" "){!r&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&o(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(a!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var l=this.state.selectedRanges;if(e.shiftKey&&l.length>0){var u=l[l.length-1];this.selectRange([Math.min(s,u[0]),Math.max(s,u[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var c;(c=this.listContainer.current)===null||c===void 0||c.focus()}this.scrollIntoView(s)}}handleScroll(e){var t=e.scrollUpdateWasRequested,r=e.scrollOffset;this.setState(i=>{if(t)return{scrollOffset:r};var o=this.props.isStickyBottom,a=i.height,s=o&&this.isListAtBottom({scrollOffset:r,height:a});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var e=this.props.itemCount;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=this.props.isMultiSelect,a=this.state.selectedRanges;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&&r?this.getItemSelected(e,a)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var e=this.props.itemCount;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){lt.validateRange(e),this.setState(t=>{var r=t.selectedRanges;return{selectedRanges:lt.deselectRange(r,e)}})}selectItem(e){var t=this.props.disableSelect;t||this.selectRange([e,e])}selectRange(e){lt.validateRange(e),this.setState(t=>{var r=t.selectedRanges;return{selectedRanges:lt.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var e=this.state,t=e.scrollOffset,r=e.height;if(t!=null&&r!=null){var i=this.props,o=i.onViewportChange,a=i.rowHeight,s=Math.floor(t/a),l=s+Math.ceil(r/a);o(s,l)}}isListAtBottom(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state,t=e.scrollOffset,r=e.height;if(r==null||t==null)return!1;var i=this.props,o=i.itemCount,a=i.rowHeight;return t+r>=o*a}renderInnerElement(e){var t=e.index,r=e.style,i=this.props,o=i.items,a=i.offset,s=i.renderItem,l=i.disableSelect,u=this.state,c=u.focusIndex,m=u.selectedRanges;if(t<a||t>=a+o.length)return null;var p=o[t-a];return this.getCachedItem(t,t,p,t===c&&!l,this.getItemSelected(t,m),s,r,l)}render(){var e=this.props,t=e.items,r=e.itemCount,i=e.overscanCount,o=e.renderItem,a=e.rowHeight,s=e["data-testid"],l=this.state,u=l.selectedRanges,c=l.isStuckToBottom;return d.jsx(wd,{className:"item-list-auto-sizer",onResize:this.handleResize,children:m=>{var p=m.width,f=m.height;return d.jsx(_d,{className:"item-list-scroll-pane",height:f,width:p,initialScrollOffset:c?r*a:0,itemCount:r,itemSize:a,itemData:this.getItemData(t,u,o),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}br=ct;it(ct,"CACHE_SIZE",1e3);it(ct,"DEFAULT_ROW_HEIGHT",20);it(ct,"DEFAULT_OVERSCAN",10);it(ct,"defaultProps",{offset:0,items:[],rowHeight:br.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:br.DEFAULT_OVERSCAN,renderItem:br.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var am=H.module("ErrorBoundary");class sm extends h.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var r=this.props.onError;am.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var e=this.props,t=e.children,r=e.className,i=e.fallback,o=this.state.error;return o!=null?i??d.jsx("div",{className:r,children:d.jsx(Un,{errorMessage:"".concat(o),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):t??null}}function lm(n){var e=n.on,t=n.id,r=n.className,i=n.isInvalid,o=n.disabled,a=o===void 0?!1:o,s=n.onClick,l=n["data-testid"];return d.jsx("button",{type:"button",className:U("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:a,"data-testid":l,children:d.jsx("div",{className:"handle"})})}var um=["children","className","isInvalid","onChange","data-testid"];function Bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bo(Object(t),!0).forEach(function(r){dm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dm(n,e,t){return(e=cm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cm(n){var e=hm(n,"string");return typeof e=="symbol"?e:e+""}function hm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function mm(n,e){if(n==null)return{};var t,r,i=pm(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function pm(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var gl=j.forwardRef((n,e)=>{var t=n.children,r=n.className,i=n.isInvalid,o=n.onChange,a=n["data-testid"],s=mm(n,um),l=tl(e),u=h.useCallback(c=>{o(c.target.value)},[o]);return d.jsx("select",Wo(Wo({ref:l,className:U("custom-select",r,{"is-invalid":i}),onChange:u,"data-testid":a},s),{},{children:t}))});gl.displayName="Select";var Ii=j.createContext(new Map);Ii.displayName="XComponentMapContext";var OC=Ii.Provider;function fm(n){var e,t=h.useContext(Ii);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Ko(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ko(Object(t),!0).forEach(function(r){vm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ko(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vm(n,e,t){return(e=gm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gm(n){var e=bm(n,"string");return typeof e=="symbol"?e:e+""}function bm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function bl(n){var e,t;function r(i,o){var a=fm(t);return cl(n)?d.jsx(a,qr(qr({},i),{},{ref:o})):d.jsx(a,qr({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=h.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function ym(){return zn(Wu,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function yl(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Cl(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function xC(n){return yl(n)||Cl(n)}var Sl=h.createContext(null);Sl.displayName="ObjectFetcherContext";function IC(n){if(Cl(n))return{id:n.id,type:n.type};if(yl(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Cm(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function DC(){return zn(Sl,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Di(n,e,t){return(e=Sm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sm(n){var e=wm(n,"string");return typeof e=="symbol"?e:e+""}function wm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ze{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}Di(Ze,"TYPE_GLOBAL","type-global");Di(Ze,"TYPE_CONTEXT_PRESET","type-context-preset");Di(Ze,"TYPE_CONTEXT_CUSTOM","type-context-custom");function Lt(n,e,t){return(e=_m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _m(n){var e=Em(n,"string");return typeof e=="symbol"?e:e+""}function Em(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zo=H.module("DateTimeColumnFormatter");class Et extends Ze{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ze.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=Et.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=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(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=Et.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.timeZone,i=r===void 0?"":r,o=t.showTimeZone,a=o===void 0?!0:o,s=t.showTSeparator,l=s===void 0?!1:s,u=t.defaultDateTimeFormatString,c=u===void 0?Et.DEFAULT_DATETIME_FORMAT_STRING:u;super(),Lt(this,"dh",void 0),Lt(this,"dhTimeZone",void 0),Lt(this,"defaultDateTimeFormatString",void 0),Lt(this,"showTimeZone",void 0),Lt(this,"showTSeparator",void 0),Lt(this,"formatStringMap",void 0);var m=i||Et.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(m)}catch{zo.error("Unsupported time zone id",m),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(Et.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=c,this.showTimeZone=a,this.showTSeparator=l,this.formatStringMap=Et.makeFormatStringMap(a,l)}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]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{zo.error("Invalid format arguments")}return""}}Lt(Et,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Lt(Et,"DEFAULT_TIME_ZONE_ID","America/New_York");var xt;function ht(n,e,t){return(e=Pm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pm(n){var e=Tm(n,"string");return typeof e=="symbol"?e:e+""}function Tm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Om=H.module("DecimalColumnFormatter");class ze extends Ze{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ze.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return ze.makeFormat(e,t,Ze.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return ze.makeFormat("Custom Format",e,Ze.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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.defaultFormatString,i=r===void 0?ze.DEFAULT_FORMAT_STRING:r;super(),ht(this,"defaultFormatString",void 0),ht(this,"dh",void 0),this.dh=e,this.defaultFormatString=i}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=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(r,i)}catch{Om.error("Invalid format arguments")}return""}}xt=ze;ht(ze,"DEFAULT_FORMAT_STRING","###,##0.0000");ht(ze,"FORMAT_PERCENT",xt.makePresetFormat("Percent","##0.00%"));ht(ze,"FORMAT_BASIS_POINTS",xt.makePresetFormat("Basis Points","###,##0 bp",1e4));ht(ze,"FORMAT_THOUSANDS",xt.makePresetFormat("Thousands","##0.000 k",.001));ht(ze,"FORMAT_MILLIONS",xt.makePresetFormat("Millions","###,##0.000 mm",1e-6));ht(ze,"FORMAT_SCIENTIFIC_NOTATION",xt.makePresetFormat("Scientific Notation","0.0000E0"));ht(ze,"FORMAT_ROUND",xt.makePresetFormat("Round","###,##0"));ht(ze,"FORMAT_ROUND_TWO_DECIMALS",xt.makePresetFormat("0.00","###,##0.00"));ht(ze,"FORMAT_ROUND_FOUR_DECIMALS",xt.makePresetFormat("0.0000","###,##0.0000"));var Nr;function En(n,e,t){return(e=xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xm(n){var e=Im(n,"string");return typeof e=="symbol"?e:e+""}function Im(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Dm=H.module("IntegerColumnFormatter");class Tt extends Ze{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ze.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Tt.makeFormat(e,t,Ze.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Tt.makeFormat("Custom Format",e,Ze.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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.defaultFormatString,i=r===void 0?Tt.DEFAULT_FORMAT_STRING:r;super(),En(this,"dh",void 0),En(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=i}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=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(r,i)}catch{Dm.error("Invalid format arguments")}return""}}Nr=Tt;En(Tt,"DEFAULT_FORMAT_STRING","###,##0");En(Tt,"FORMAT_THOUSANDS",Nr.makePresetFormat("Thousands","##0.000 k",.001));En(Tt,"FORMAT_MILLIONS",Nr.makePresetFormat("Millions","###,##0.000 mm",1e-6));En(Tt,"FORMAT_SCIENTIFIC_NOTATION",Nr.makePresetFormat("Scientific Notation","0.0000E0"));function on(n,e,t){return(e=Mm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mm(n){var e=jm(n,"string");return typeof e=="symbol"?e:e+""}function jm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class K{}on(K,"INTEGER","int");on(K,"LONG","long");on(K,"DOUBLE","double");on(K,"BOOLEAN","bool");on(K,"STRING","string");on(K,"DATE_TIME","datetime");on(K,"LOCAL_TIME","localtime");var Am=Object.freeze({}),km=new Map,MC=n=>n.api,jC=n=>n.user,wl=n=>n.storage,_l=n=>wl(n).commandHistoryStorage,Nm=n=>wl(n).fileStorage,Lm=n=>n.defaultWorkspaceSettings,El=n=>{var e=n.workspace;return e},Mi=Ed(n=>{var e,t,r=(e=(t=El(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=Lm(n),o=Pd({},i,r,(a,s)=>{if(Array.isArray(a)&&Array.isArray(s))return s});return o}),Rm=n=>Mi(n).timeZone,AC=n=>{var e;return(e=Mi(n).notebookSettings)!==null&&e!==void 0?e:Am},kC=n=>n.activeTool,$m=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:km},Fm="SET_ACTIVE_TOOL",Hm="SET_API",NC="SET_COMMAND_HISTORY_STORAGE",LC="SET_FILE_STORAGE",RC="SET_PLUGINS",Um="SET_USER",Bm="SET_WORKSPACE",Wm="SET_DEFAULT_WORKSPACE_SETTINGS",$C="SET_WORKSPACE_STORAGE",Km="SET_SERVER_CONFIG_VALUES";function Vo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vo(Object(t),!0).forEach(function(r){zm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zm(n,e,t){return(e=Vm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vm(n){var e=Gm(n,"string");return typeof e=="symbol"?e:e+""}function Gm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var FC=n=>({type:Um,payload:n}),HC=n=>({type:Hm,payload:n}),Pl=n=>({type:Bm,payload:n}),UC=n=>({type:Wm,payload:n}),qm=n=>(e,t)=>{e(Pl(n));var r=t(),i=r.storage,o=i.workspaceStorage;return o==null?void 0:o.save(n)},Xm=n=>(e,t)=>{var r=t(),i=r.workspace,o=i??{},a=o.data,s=wt(wt({},i),{},{data:wt(wt(wt({},a),n),{},{settings:wt(wt({},a==null?void 0:a.settings),n.settings)})});return e(qm(s))},BC=n=>(e,t)=>{var r=Mi(t()),i=r.notebookSettings,o=wt(wt({},i),n);return e(Zm({notebookSettings:o}))},Zm=n=>e=>e(Xm({settings:n})),WC=n=>({type:Fm,payload:n}),KC=n=>({type:Km,payload:n});function Go(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Go(Object(t),!0).forEach(function(r){Ym(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Go(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ym(n,e,t){return(e=Qm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qm(n){var e=Jm(n,"string");return typeof e=="symbol"?e:e+""}function Jm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ep(n){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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var o=i.id,a=i.payload;return t&&ai({payload:a},{payload:r[o]})?r:qo(qo({},r),{},{[o]:a})}default:return r}}}function Xo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xo(Object(t),!0).forEach(function(r){mi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function mi(n,e,t){return(e=tp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tp(n){var e=np(n,"string");return typeof e=="symbol"?e:e+""}function np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rp{constructor(){mi(this,"reducers",{}),mi(this,"listener",null)}register(e,t){var r;this.reducers=Zo(Zo({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var ip=new rp,Tl=h.createContext(null);Tl.displayName="PluginsContext";var Wt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",ELEMENT_PLUGIN:"ElementPlugin",MIDDLEWARE_PLUGIN:"MiddlewarePlugin",MULTI_PLUGIN:"MultiPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",WIDGET_PLUGIN:"WidgetPlugin"});function op(n){return"DashboardPlugin"in n}function ap(n){return"AuthPlugin"in n}function sp(n){return"TablePlugin"in n}function lp(n){return op(n)||ap(n)||sp(n)}function up(n){return"type"in n&&n.type===Wt.DASHBOARD_PLUGIN}function pi(n){return"type"in n&&n.type===Wt.MIDDLEWARE_PLUGIN}function Vn(n){return"type"in n&&n.type===Wt.WIDGET_PLUGIN}function Ol(n){return Vn(n)&&"dashboardTypes"in n&&n.dashboardTypes!=null}function dp(n){return"type"in n&&n.type===Wt.TABLE_PLUGIN}function cp(n){return"type"in n&&n.type===Wt.AUTH_PLUGIN}function xl(n){return"type"in n&&n.type===Wt.THEME_PLUGIN}function Il(n){return"type"in n&&n.type===Wt.ELEMENT_PLUGIN}function Dl(n){return"type"in n&&n.type===Wt.MULTI_PLUGIN}function fi(n){return up(n)||cp(n)||Il(n)||Dl(n)||dp(n)||xl(n)||Vn(n)||pi(n)}var hp=["metadata"],mp=["metadata"],pp=["Component"],fp=["Component"];function Yo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yo(Object(t),!0).forEach(function(r){vp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vp(n,e,t){return(e=gp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gp(n){var e=bp(n,"string");return typeof e=="symbol"?e:e+""}function bp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lr(n,e){if(n==null)return{};var t,r,i=yp(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function yp(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ml(n,e){return _p(n)||wp(n,e)||Sp(n,e)||Cp()}function Cp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sp(n,e){if(n){if(typeof n=="string")return Qo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Qo(n,e):void 0}}function Qo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function wp(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function _p(n){if(Array.isArray(n))return n}var Ke=H.module("@deephaven/plugin.PluginUtils");function Sn(n){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Component";return(e=(t=n.displayName)!==null&&t!==void 0?t:n.name)!==null&&e!==void 0?e:r}function Jo(n,e){return n==null||!Vn(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function zC(n,e){return n==null||!Ol(n)?!1:[n.dashboardTypes].flat().some(t=>t===e)}function Ep(n){var e=d.jsx(me,{icon:Rs});if(!Vn(n))return e;var t=n.icon;return t==null?e:h.isValidElement(t)?t:d.jsx(me,{icon:t})}function VC(n){var e=[...n.entries()].filter(t=>xl(t[1]));return Ke.debug("Getting theme data from plugins",e),e.map(t=>{var r=Ml(t,2),i=r[0],o=r[1],a=Array.isArray(o.themes)?o.themes:[o.themes];return a.map(s=>{var l=s.name,u=s.baseTheme,c=s.styleContent;return{baseThemeKey:"default-".concat(u??"dark"),themeKey:Ku(i,l),name:l,styleContent:c}})}).flat()}function GC(n){var e=[...n.entries()].filter(t=>Il(t[1])&&t[1].mapping!=null);return Ke.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var r=Ml(t,2),i=r[1];return Object.entries(i.mapping)}))}function Pp(n,e){return e.length===0?(Ke.debug("No middleware to chain for component",Sn(n)),n):(Ke.debug("Chaining component middleware",Sn(n),e.map(t=>t.name)),[...e].reverse().reduce((t,r)=>{var i=r.component,o=[r.supportedTypes].flat();function a(s){var l=s.metadata,u=Lr(s,hp);return(l==null?void 0:l.type)!=null&&!o.includes(l.type)?d.jsx(t,xe(xe({},u),{},{metadata:l})):d.jsx(i,xe(xe({},u),{},{metadata:l,Component:t}))}return a.displayName="".concat(r.name,"(").concat(Sn(t),")"),a},n))}function qC(n,e){var t=e.filter(r=>r.panelComponent!=null);return t.length===0?(Ke.debug("No panel middleware to chain for panel component",Sn(n)),n):(Ke.debug("Chaining panel middleware",Sn(n),t.map(r=>r.name)),[...t].reverse().reduce((r,i)=>{var o=i.panelComponent,a=[i.supportedTypes].flat(),s=j.forwardRef((l,u)=>{var c=l.metadata,m=Lr(l,mp),p=u!=null?{ref:u}:{};return(c==null?void 0:c.type)!=null&&!a.includes(c.type)?d.jsx(r,xe(xe(xe({},p),m),{},{metadata:c})):d.jsx(o,xe(xe(xe({},p),m),{},{metadata:c,Component:r}))});return s.displayName="".concat(i.name,"Panel(").concat(Sn(r,"Panel"),")"),s},n))}function XC(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"PanelMiddleware",t=j.forwardRef((r,i)=>{var o=r.Component,a=Lr(r,pp),s=n(a),l=s.inject,u=s.wrap,c=o,m=d.jsx(c,xe(xe({ref:i},a),l));return u!=null?u(m):m});return t.displayName=e,t}function ZC(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"WidgetMiddleware";function t(r){var i=r.Component,o=Lr(r,fp),a=n(o),s=a.inject,l=a.wrap,u=i,c=d.jsx(u,xe(xe({},o),s));return l!=null?l(c):c}return t.displayName=e,t}function Tp(n){return typeof n=="object"&&n!=null&&n.default!=null&&typeof n.default=="object"}function Op(n){return fi(n)?n:Tp(n)&&fi(n.default)?n.default:lp(n)?n:null}function ea(n,e,t,r){if(n.has(e)){Ke.warn("Plugin '".concat(e,"' is already registered. Skipping duplicate."));return}n.set(e,xe(xe({},t),{},{version:r}))}function YC(n,e,t,r,i,o){i!=null&&(e[i]=t,Ke.debug("Registered plugin '".concat(i,"' in module resolve map")));var a=Op(t);if(a==null){Ke.error("Plugin '".concat(r,"' is missing an exported value."));return}Dl(a)?(Ke.debug("MultiPlugin '".concat(r,"' contains ").concat(a.plugins.length," plugins")),a.plugins.forEach(s=>{if(!fi(s)){Ke.warn("Skipping invalid inner plugin from MultiPlugin '".concat(r,"'"),s);return}var l=typeof s.name=="string"?s.name.trim():"";if(l.length===0){Ke.warn("Skipping unnamed inner plugin from MultiPlugin '".concat(r,"'"),s);return}ea(n,l,s,o)})):ea(n,r,a,o)}function QC(n){var e=new Map;n.forEach(s=>{var l;((l=s.loader)===null||l===void 0?void 0:l.package)!=null&&e.set(s.loader.package,s)});var t=new Map;n.forEach(s=>{var l,u=new Set;((l=s.loader)===null||l===void 0?void 0:l.dependencies)!=null&&s.loader.dependencies.forEach(c=>{var m=e.get(c);m!=null?u.add(m):Ke.warn("Plugin '".concat(s.name,"' depends on '").concat(c,"' which is not in the manifest"))}),t.set(s,u)});for(var r=[],i=new Set(n),o=new Set,a=function(){var l=[];if(i.forEach(c=>{var m=t.get(c);if(m==null||m.size===0){l.push(c);return}var p=!0;m.forEach(f=>{o.has(f)||(p=!1)}),p&&l.push(c)}),l.length===0){var u=[...i].map(c=>c.name);return Ke.error("Circular plugin dependency detected among: ".concat(u.join(", "),". Loading remaining plugins together.")),r.push([...i]),1}r.push(l),l.forEach(c=>{i.delete(c),o.add(c)})};i.size>0&&!a(););return r}function xp(n,e){var t;return(t=[...n.values()].find(r=>Ol(r)&&[r.dashboardTypes].flat().some(i=>i===e)))!==null&&t!==void 0?t:null}function Ip(){return zn(Tl,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var ta=H.module("@deephaven/plugin.WidgetView");function JC(n){var e=n.fetch,t=n.type,r=Ip(),i=h.useMemo(()=>{var l,u=[];return r.forEach(c=>{if(!(!Vn(c)&&!pi(c))){var m=[c.supportedTypes].flat().includes(t);m&&(pi(c)?u.push(c):(l!=null&&ta.warn("Multiple base plugins for type ".concat(t,". Replacing ").concat(l.name," with ").concat(c.name)),l=c))}}),{basePlugin:l,middleware:u}},[r,t]),o=i.basePlugin,a=i.middleware,s=h.useMemo(()=>o==null?(ta.debug("No base plugin found for widget type ".concat(t)),null):Pp(o.component,a),[o,a,t]);if(s!=null)return d.jsx(s,{fetch:e});throw new Error("Unknown widget type '".concat(t,"'"))}var jl=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 Al(n){return n.componentName!==void 0}function Dp(n){return n.component!==void 0}var kl=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Mp=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:jl,isGLComponentConfig:Al,isReactComponentConfig:Dp,itemDefaultConfig:kl},Symbol.toStringTag,{value:"Module"}));function yr(n,e,t){return(e=jp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jp(n){var e=Ap(n,"string");return typeof e=="symbol"?e:e+""}function Ap(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He{constructor(){yr(this,"_mSubscriptions",void 0),yr(this,"off",this.unbind),yr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[He.ALL_EVENT]=[]}on(e,t,r){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:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;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(m){console.error("Error while emitting event:",m)}}i.unshift(e);for(var l=this._mSubscriptions[He.ALL_EVENT],u=0;u<l.length;u++){var c=l[u].ctx||{};try{l[u].fn.apply(c,i)}catch(m){console.error("Error while emitting event to allEventSubs:",m)}}}unbind(e,t,r){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)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}yr(He,"ALL_EVENT","__all");function at(n,e,t){return(e=kp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kp(n){var e=Np(n,"string");return typeof e=="symbol"?e:e+""}function Np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vi extends He{constructor(e,t,r){super(),at(this,"width",void 0),at(this,"height",void 0),at(this,"title",void 0),at(this,"parent",void 0),at(this,"layoutManager",void 0),at(this,"tab",void 0),at(this,"_config",void 0),at(this,"isHidden",!1),at(this,"beforeCloseHandler",void 0),at(this,"_element",x(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),at(this,"_contentElement",void 0),this.title=Al(e)?e.componentName:"",this.parent=t,this.layoutManager=r,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 r,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",c=u==="height"?t:e,m=((r=this[u])!==null&&r!==void 0?r:0)*(1/(((i=s.config[u])!==null&&i!==void 0?i:0)/100)),p=c/m*100,f=(((o=s.config[u])!==null&&o!==void 0?o:0)-p)/(a.contentItems.length-1),v=0;v<a.contentItems.length;v++)if(a.contentItems[v]===s)a.contentItems[v].config[u]=p;else{var g;a.contentItems[v].config[u]=((g=a.contentItems[v].config[u])!==null&&g!==void 0?g:0)+f}return a.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setPersistedState(e){this._config.persistedState=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 r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Lp=Object.freeze(Object.defineProperty({__proto__:null,Container:vi,ItemContainer:vi},Symbol.toStringTag,{value:"Module"}));function Nl(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Ll(n){if(window.location.hash)return Nl(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function ji(n){return window.requestAnimationFrame(n)}function Rp(n,e){var t=e.indexOf(n);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 Pt()}function $p(n,e){var t=n.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 Ai(n){return x.trim(n.replace(/(<([^>]+)>)/gi,""))}function Ue(n,e,t){return(e=Fp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fp(n){var e=Hp(n,"string");return typeof e=="symbol"?e:e+""}function Hp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gn extends He{constructor(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;super(),Ue(this,"_eElement",void 0),Ue(this,"_oDocument",void 0),Ue(this,"_eBody",void 0),Ue(this,"_root",void 0),Ue(this,"_destroyAfterMouseUp",void 0),Ue(this,"_nDelay",400),Ue(this,"_timeout",void 0),Ue(this,"timeout",void 0),Ue(this,"_nDistance",10),Ue(this,"_nX",0),Ue(this,"_nY",0),Ue(this,"_nOriginalX",0),Ue(this,"_nOriginalY",0),Ue(this,"_bDragging",!1),this._eElement=e,this._oDocument=x(document),this._eBody=x(document.body),this._root=t,this._destroyAfterMouseUp=i,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(r=this._eElement)===null||r===void 0||r.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,r,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=a.y)!==null&&r!==void 0?r: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,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r: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,r,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),(a=this._root)===null||a===void 0||a.childElementContainer.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,r,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"),(r=this._root)===null||r===void 0||r.childElementContainer.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function dn(n,e,t){return(e=Up(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Up(n){var e=Bp(n,"string");return typeof e=="symbol"?e:e+""}function Bp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rl{constructor(e,t){dn(this,"_container",void 0),dn(this,"_reactComponent",null),dn(this,"_portalComponent",null),dn(this,"_originalComponentWillUpdate",void 0),dn(this,"_initialState",void 0),dn(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=void 0,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=Oi.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e&&(this._reactComponent=e,this._reactComponent instanceof h.Component)){this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate,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 r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t,void 0)}_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=x.extend(e,this._container._config.props);return j.createElement(this._reactClass,t)}}var _r=["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"],Wp=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ki(n){if(_r.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ni(n,e,"_min"),e}function gi(n){if(_r.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ni(n,e,"_max"),e}function Ni(n,e,t){var r=t==="_min"?Kp:zp;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[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=r(i,_r);e[s]=a}Ni(o,a,t)}else{var l=r(o,Wp);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=r(i,_r);e[u]=l}}}}function Kp(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function zp(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Xr(n,e,t){return(e=Vp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vp(n){var e=Gp(n,"string");return typeof e=="symbol"?e:e+""}function Gp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bi{constructor(e,t){Xr(this,"name",void 0),Xr(this,"origin",void 0),Xr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function sr(n,e,t){return(e=qp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qp(n){var e=Xp(n,"string");return typeof e=="symbol"?e:e+""}function Xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let $l=class extends He{constructor(e){super(),sr(this,"_layoutManager",void 0),sr(this,"_dontPropagateToParent",void 0),sr(this,"_childEventSource",void 0),sr(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(He.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),x(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];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,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){x(window).off("gl_child_event",this._boundOnEventFromChild)}};function Fl(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function Hl(n){return(e,t)=>Fl(e,n,t)}function Ul(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function Bl(n){return(e,t)=>{var r=h.useRef(null),i=h.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,h.useEffect(()=>()=>{var a;return(a=r.current)===null||a===void 0?void 0:a.off(n,i.current)},[])}}function mt(n){return{listen:Hl(n),emit:Ul(n),useListener:Bl(n)}}const Zp=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:bi,DragListener:Gn,EventEmitter:He,EventHub:$l,ReactComponentHandler:Rl,animFrame:ji,filterXss:$p,getHashValue:Nl,getQueryStringParam:Ll,getUniqueId:wr,listenForEvent:Fl,makeEmitFunction:Ul,makeEventFunctions:mt,makeListenFunction:Hl,makeUseListenerFunction:Bl,minifyConfig:ki,removeFromArray:Rp,stripTags:Ai,unminifyConfig:gi},Symbol.toStringTag,{value:"Module"}));function jt(n,e,t){return(e=Yp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yp(n){var e=Qp(n,"string");return typeof e=="symbol"?e:e+""}function Qp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wl extends He{constructor(e,t,r,i,o){super(),jt(this,"isInitialised",!1),jt(this,"_config",void 0),jt(this,"_dimensions",void 0),jt(this,"_parentId",void 0),jt(this,"_indexInParent",void 0),jt(this,"_layoutManager",void 0),jt(this,"_popoutWindow",null),jt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,a,s,l,u,c,m;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:(r=(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&&r!==void 0?r:0,top:(s=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(c=this._popoutWindow)===null||c===void 0?void 0:c.screenTop)!==null&&s!==void 0?s:0},content:(m=this.getGlInstance())===null||m===void 0?void 0:m.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,r=null;if(this._parentId){var i;if(t=x.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=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,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;x(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=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+wr();e=ki(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[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 we(n,e,t){return(e=Jp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jp(n){var e=ef(n,"string");return typeof e=="symbol"?e:e+""}function ef(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class an extends He{constructor(e,t,r,i,o,a){var s,l,u,c,m,p,f,v;if(super(),we(this,"_dragListener",void 0),we(this,"_layoutManager",void 0),we(this,"_contentItem",void 0),we(this,"_originalParent",void 0),we(this,"_area",null),we(this,"_lastValidArea",null),we(this,"_minX",void 0),we(this,"_maxX",void 0),we(this,"_minY",void 0),we(this,"_maxY",void 0),we(this,"_width",void 0),we(this,"_height",void 0),we(this,"_sided",void 0),we(this,"element",void 0),we(this,"childElementContainer",void 0),we(this,"_proxyTab",void 0),this._dragListener=r,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 g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=x(an._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",Ai((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").text((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(),x(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var y,C;this._layoutManager.tabDropPlaceholder.width((y=this._proxyTab.outerWidth(!0))!==null&&y!==void 0?y:0),this._layoutManager.tabDropPlaceholder.height((C=this._proxyTab.outerHeight(!0))!==null&&C!==void 0?C:0)}var S=this._layoutManager.container.offset();this._minX=(u=S==null?void 0:S.left)!==null&&u!==void 0?u:0,this._minY=(c=S==null?void 0:S.top)!==null&&c!==void 0?c:0,this._maxX=((m=this._layoutManager.container.width())!==null&&m!==void 0?m:0)+this._minX,this._maxY=((p=this._layoutManager.container.height())!==null&&p!==void 0?p:0)+this._minY,this._width=(f=this.element.width())!==null&&f!==void 0?f:0,this._height=(v=this.element.height())!==null&&v!==void 0?v:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,a=(i=r.pageX)!==null&&i!==void 0?i:0,s=(o=r.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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}we(an,"_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 lr(n,e,t){return(e=tf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tf(n){var e=nf(n,"string");return typeof e=="symbol"?e:e+""}function nf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kl{constructor(e,t,r){lr(this,"_element",void 0),lr(this,"_itemConfig",void 0),lr(this,"_layoutManager",void 0),lr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Gn(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(x.extend(!0,{},r));new an(e,t,this._dragListener,this._layoutManager,i,null)}}function ur(n,e,t){return(e=rf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rf(n){var e=of(n,"string");return typeof e=="symbol"?e:e+""}function of(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zl{constructor(e,t,r){ur(this,"_element",x(window)),ur(this,"_itemConfig",void 0),ur(this,"_layoutManager",void 0),ur(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&this._layoutManager&&(this._dragListener=new Gn(this._element,this._layoutManager.root,!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 r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(x.extend(!0,{},r));new an(e,t,this._dragListener,this._layoutManager,i,null)}}}function Vl(n,e,t){return(e=af(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function af(n){var e=sf(n,"string");return typeof e=="symbol"?e:e+""}function sf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qn{constructor(){Vl(this,"element",x(qn._template)),x(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()}}Vl(qn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Zr(n,e,t){return(e=lf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lf(n){var e=uf(n,"string");return typeof e=="symbol"?e:e+""}function uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class An{constructor(e,t,r,i){Zr(this,"element",void 0),Zr(this,"_header",void 0),Zr(this,"_action",void 0),this._header=e,this.element=x('<li class="'+r+'" 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 df(n,e,t){return(e=cf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cf(n){var e=hf(n,"string");return typeof e=="symbol"?e:e+""}function hf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jt extends Error{constructor(e,t){super(),df(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const mf=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Jt},Symbol.toStringTag,{value:"Module"}));function pf(n,e){return bf(n)||gf(n,e)||vf(n,e)||ff()}function ff(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vf(n,e){if(n){if(typeof n=="string")return na(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?na(n,e):void 0}}function na(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function gf(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function bf(n){if(Array.isArray(n))return n}function Ce(n,e,t){return(e=yf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yf(n){var e=Cf(n,"string");return typeof e=="symbol"?e:e+""}function Cf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tn(n){return n.isStack}function ke(n){return n.isComponent}function Gl(n){return n.isRoot}class Pe extends He{constructor(e,t,r,i){super(),Ce(this,"config",void 0),Ce(this,"type",void 0),Ce(this,"contentItems",void 0),Ce(this,"parent",void 0),Ce(this,"layoutManager",void 0),Ce(this,"element",void 0),Ce(this,"childElementContainer",void 0),Ce(this,"componentName",void 0),Ce(this,"isInitialised",!1),Ce(this,"isMaximised",!1),Ce(this,"isRoot",!1),Ce(this,"isRow",!1),Ce(this,"isColumn",!1),Ce(this,"isStack",!1),Ce(this,"isComponent",!1),Ce(this,"tab",void 0),Ce(this,"_pendingEventPropagations",void 0),Ce(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(He.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=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(r!==!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 r=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==null||o.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,tn(this)&&this.header.tabs[i].setContentItem(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=[],r=function(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),r(o.contentItems[a])};return r(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),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$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"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&ke(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(r=e.width())!==null&&r!==void 0?r: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 bi(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Jt("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var t of Object.entries(kl)){var r=pf(t,2),i=r[0],o=r[1],a=i;e[a]===void 0&&(e[a]=o)}return e}_propagateEvent(e,t){t instanceof bi&&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,ji(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function Sf(n,e){return Pf(n)||Ef(n,e)||_f(n,e)||wf()}function wf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _f(n,e){if(n){if(typeof n=="string")return ra(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ra(n,e):void 0}}function ra(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ef(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Pf(n){if(Array.isArray(n))return n}function Mn(n,e,t){return(e=Tf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tf(n){var e=Of(n,"string");return typeof e=="symbol"?e:e+""}function Of(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ql extends Pe{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(s=>{var l=Sf(s,2),u=l[0],c=l[1];t[u]===void 0&&(t[u]=c)}),super(e,t,r,x()),Mn(this,"config",void 0),Mn(this,"componentName",void 0),Mn(this,"container",void 0),Mn(this,"parent",void 0),Mn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=x.extend(!0,{},this.config.componentState||{});if(o==null)throw new Jt('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new vi(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Pe.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Pe.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),Pe.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Pe.prototype._$destroy.call(this)}_$getArea(){return null}}function Qe(n,e,t){return(e=xf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xf(n){var e=If(n,"string");return typeof e=="symbol"?e:e+""}function If(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fn extends Pe{constructor(e,t,r,i){super(t,r,i,x('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),Qe(this,"isRow",void 0),Qe(this,"isColumn",void 0),Qe(this,"childElementContainer",void 0),Qe(this,"parent",void 0),Qe(this,"_splitter",[]),Qe(this,"_splitterSize",void 0),Qe(this,"_splitterGrabSize",void 0),Qe(this,"_isColumn",void 0),Qe(this,"_dimension",void 0),Qe(this,"_splitterPosition",null),Qe(this,"_splitterMinPosition",null),Qe(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,r){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),Pe.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!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 r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r: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)}if(Pe.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var c;l=this.contentItems[0],this.contentItems=[],(c=this.parent)===null||c===void 0||c.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),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(Pe.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,r=(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-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var u,c,m=this._isColumn?Math.floor(o*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(i*(((c=this.contentItems[l].config.width)!==null&&c!==void 0?c:0)/100));a+=m,s.push(m)}var p=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:p,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];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[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[r]=((u=this.contentItems[l].config[r])!==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,r=[],i=0,o=0,a=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),c=0;c<this.contentItems.length;c++){this.contentItems[c];var m=u.itemSizes[c];m<t?(o+=t-m,l={width:t}):(i+=m-t,l={width:m},r.push(l)),s.push(l)}if(!(o===0||o>i)){var p=o/i;a=o;for(var f=0;f<r.length;f++){l=r[f];var v=Math.round((l.width-t)*p);a-=v,l.width-=v}a!==0&&(s[s.length-1].width-=a);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/u.totalWidth*100}}}_createSplitter(e){var t;return t=new Xl(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,r=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,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,c=this._getMinimumDimensions((r=a.after.config.content)!==null&&r!==void 0?r:[]),m=this._isColumn?c.vertical:c.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)-(m||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r: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,r,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,c=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+u),m=((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]=c*m,s.after.config[this._dimension]=(1-c)*m,e.element.css({top:0,left:0}),ji(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function ia(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function oa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(r){yi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yi(n,e,t){return(e=Df(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Df(n){var e=Mf(n,"string");return typeof e=="symbol"?e:e+""}function Mf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ci extends Pe{constructor(e,t,r){super(e,oa(oa({},t),{},{type:"root"}),null,x('<div class="lm_goldenlayout lm_item lm_root"></div>')),yi(this,"childElementContainer",void 0),yi(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,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 r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r: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,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(ke(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var i=t.side,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 Fn)||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 c,m=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),m.config[a]=((c=m.config[a])!==null&&c!==void 0?c:0)*.5,e.config[a]=m.config[a],l.callDownwards("setSize")}}}}function jf(n,e){return Lf(n)||Nf(n,e)||kf(n,e)||Af()}function Af(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kf(n,e){if(n){if(typeof n=="string")return aa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?aa(n,e):void 0}}function aa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Nf(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Lf(n){if(Array.isArray(n))return n}function sa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sa(Object(t),!0).forEach(function(r){Ge(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ge(n,e,t){return(e=Rf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rf(n){var e=$f(n,"string");return typeof e=="symbol"?e:e+""}function $f(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Si extends Pe{constructor(e,t,r){var i,o,a,s,l,u,c,m,p;super(e,t,r,x('<div class="lm_item lm_stack"></div>')),Ge(this,"_activeContentItem",null),Ge(this,"_header",void 0),Ge(this,"childElementContainer",x('<div class="lm_items"></div>')),Ge(this,"header",void 0),Ge(this,"parent",void 0),Ge(this,"isStack",!0),Ge(this,"_dropSegment",null),Ge(this,"_contentAreaDimensions",null),Ge(this,"_dropIndex",void 0),Ge(this,"_side",void 0),Ge(this,"_sided",!1),Ge(this,"config",void 0),this.parent=r,this.config=t;var f=e.config;this._side=!1,this._header={show:((i=f.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=f.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=f.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=f.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=f.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=f.settings)!==null&&u!==void 0&&u.showCloseIcon?(c=f.labels)===null||c===void 0?void 0:c.close:void 0,minimise:(m=(p=f.labels)===null||p===void 0?void 0:p.minimise)!==null&&m!==void 0?m:void 0},f.header&&(this._header=cn(cn({},this._header),f.header)),t.header&&(this._header=cn(cn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=cn(cn({},this._header),t.content[0].header)),this.header=new Ot(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,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=((r=this.element.width())!==null&&r!==void 0?r: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,t){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),ke(e)?e._$show(t):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,r=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(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Pe.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",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Fn&&(t&&this.parent.isColumn||r&&this.parent.isRow),a=t?"column":"row",s=t?"height":"width";if(ke(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var u,c=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?c:c+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 m,p=this.layoutManager.createContentItem({type:a},this);(m=this.parent)===null||m===void 0||m.replaceChild(this,p),p.addChild(e,i?0:void 0,!0),p.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,p.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var r of Object.entries(this._contentAreaDimensions)){var i=jf(r,2),o=i[0],a=i[1],s=a.hoverArea;if(s.x1<e&&s.x2>e&&s.y1<t&&s.y2>t){o==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(o));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 r=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+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.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+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.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,r,i,o,a,s,l,u,c,m,p,f,v,g,b,y,C=this.header.tabs.length;if(C===0){var S,_,E,D,W,N,I,k,$=this.header.element.offset();(S=this.layoutManager.dropTargetIndicator)===null||S===void 0||S.highlightArea({x1:(_=$==null?void 0:$.left)!==null&&_!==void 0?_:0,x2:((E=$==null?void 0:$.left)!==null&&E!==void 0?E:0)+100,y1:(D=(W=this.header.element.offset())===null||W===void 0?void 0:W.top)!==null&&D!==void 0?D:0,y2:((N=(I=this.header.element.offset())===null||I===void 0?void 0:I.top)!==null&&N!==void 0?N:0)+((k=this.header.element.innerHeight())!==null&&k!==void 0?k:0)});return}var ae=this.header.tabsContainer,A=(t=ae.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),X=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!A||!X)){e<A.left?e=A.left+1:e>A.right&&(e=A.right-1);var de,se;if(!(X.left<e&&e<X.right)){for(var be=0;be<C;be++){var ye;if(de=this.header.tabs[be].element,se=(ye=de.get(0))===null||ye===void 0?void 0:ye.getBoundingClientRect(),se&&se.left<e&&e<se.right){this._dropIndex=be;break}}if(de&&se&&e<se.left+se.width*.5)de.before(this.layoutManager.tabDropPlaceholder);else if(de){var Te;this._dropIndex=Math.min(((Te=this._dropIndex)!==null&&Te!==void 0?Te:0)+1,C),de.after(this.layoutManager.tabDropPlaceholder)}}var Se=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;Se=Math.max(Se,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var ce=Se+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);ce=Math.min(ce,((u=(c=this.header.tabsContainer.offset())===null||c===void 0?void 0:c.left)!==null&&u!==void 0?u:0)+((m=this.header.tabsContainer.innerWidth())!==null&&m!==void 0?m:0)),(p=this.layoutManager.dropTargetIndicator)===null||p===void 0||p.highlightArea({x1:Se,x2:ce,y1:(f=(v=this.header.element.offset())===null||v===void 0?void 0:v.top)!==null&&f!==void 0?f:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((y=this.header.element.innerHeight())!==null&&y!==void 0?y:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===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,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const Ff=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Pe,Component:ql,ContentItem:Pe,Root:Ci,RowOrColumn:Fn,Stack:Si,isComponent:ke,isRoot:Gl,isStack:tn},Symbol.toStringTag,{value:"Module"}));function St(n,e,t){return(e=Hf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hf(n){var e=Uf(n,"string");return typeof e=="symbol"?e:e+""}function Uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xn{constructor(e,t){var r;St(this,"header",void 0),St(this,"contentItem",void 0),St(this,"element",x(Xn._template)),St(this,"titleElement",void 0),St(this,"closeElement",void 0),St(this,"isActive",!1),St(this,"_layoutManager",void 0),St(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,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Gn(this.element,this._layoutManager.root),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.element.on("mouseup",this._onMouseUp),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),ke(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.text(e)}setContentItem(e){var t=this.contentItem;this._dragListener&&(t.off("destroy",this._dragListener.destroy,this._dragListener),e.on("destroy",this._dragListener.destroy,this._dragListener)),t.off("titleChanged",this.setTitle,this),e.on("titleChanged",this.setTitle,this),this.contentItem=e,e.tab=this,this.setTitle(e.config.title)}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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),ke(this.contentItem)&&this.contentItem.container._contentElement.off(),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 r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new an(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(e){ke(this.contentItem)&&(e==null?void 0:e.target)instanceof Element&&this._isInNestedLayout(e.target)||(x(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin"))}_onTabContentFocusOut(){ke(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&ke(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):ke(this.contentItem)&&!this._isFocusDirectlyInContainer()&&this.contentItem.container._contentElement.focus(),ke(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(),ke(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}_isInNestedLayout(e){var t=x(e).closest(".lm_goldenlayout")[0],r=this._layoutManager.root.element[0];return t!=null&&t!==r}_isFocusDirectlyInContainer(){if(!ke(this.contentItem))return!1;var e=document.activeElement;return e==null||!this.contentItem.container._contentElement[0].contains(e)?!1:!this._isInNestedLayout(e)}}St(Xn,"_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 q(n,e,t){return(e=Bf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bf(n){var e=Wf(n,"string");return typeof e=="symbol"?e:e+""}function Wf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ot extends He{constructor(e,t){var r,i;super(),q(this,"layoutManager",void 0),q(this,"element",x(Ot._template)),q(this,"tabsContainer",void 0),q(this,"tabDropdownContainer",void 0),q(this,"tabDropdownSearch",void 0),q(this,"tabDropdownList",null),q(this,"controlsContainer",void 0),q(this,"parent",void 0),q(this,"tabs",[]),q(this,"activeContentItem",null),q(this,"closeButton",null),q(this,"tabDropdownButton",null),q(this,"tabNextButton",x(Ot._nextButtonTemplate)),q(this,"tabPreviousButton",x(Ot._previousButtonTemplate)),q(this,"holdTimer",null),q(this,"rAF",null),q(this,"CLICK_TIMEOUT",500),q(this,"START_SPEED",.01),q(this,"ACCELERATION",5e-4),q(this,"PADDING",10),q(this,"SCROLL_LEFT","left"),q(this,"SCROLL_RIGHT","right"),q(this,"isDraggingTab",!1),q(this,"isOverflowing",!1),q(this,"isDropdownShown",!1),q(this,"dropdownKeyIndex",0),q(this,"_lastVisibleTabIndex",-1),q(this,"_tabControlOffset",void 0),this.layoutManager=e,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.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 r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new Xn(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,r,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||(r=t.scrollIntoView)===null||r===void 0||r.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 r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_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 r,i,o,a,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,c;l.scrollLeft=(u=(c=this.tabsContainer.get(0))===null||c===void 0?void 0:c.scrollWidth)!==null&&u!==void 0?u:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,r;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)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,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((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(c=>{var m,p,f=o||c,v=c-f,g=this.START_SPEED*v+.5*this.ACCELERATION*(v*v);g=Math.min(g,(m=(p=this.tabsContainer.get(0))===null||p===void 0?void 0:p.scrollWidth)!==null&&m!==void 0?m:1/0),this._handleScrollRepeat(e,t,g,f)})}}_$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(),x(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,r,i,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new An(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),r=this._getHeaderSetting("popout"),new An(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var a=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new An(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),r=this._getHeaderSetting("close"),this.closeButton=new An(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),x(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"),x(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 c=(s+l+u.length)%u.length;c!==s;){if(u.eq(c).css("display")!=="none")return c;c=(c+l+u.length)%u.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.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 r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-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,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.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(),x(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,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=(r=x(window).height())!==null&&r!==void 0?r:0,l=(i=x(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var u=this.tabDropdownButton.element[0].getBoundingClientRect(),c=o<s-u.bottom,m=!c&&u.bottom>s*.6,p=Math.min(u.left+(m?u.width:0),l-a.width-this.PADDING),f=m?Math.max(u.top-o,this.PADDING):u.bottom,v=s-f-this.PADDING;this.tabDropdownContainer.css({"max-height":v,top:f,left:p})}}}}_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 r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(Ot,"_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(""));q(Ot,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(Ot,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function jn(n,e,t){return(e=Kf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kf(n){var e=zf(n,"string");return typeof e=="symbol"?e:e+""}function zf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xl{constructor(e,t,r){jn(this,"_isVertical",void 0),jn(this,"_size",void 0),jn(this,"_grabSize",void 0),jn(this,"_dragListener",void 0),jn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Gn(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=x('<div class="lm_drag_handle"></div>'),t=x('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Vf=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Wl,DragProxy:an,DragSource:Kl,DragSourceFromEvent:zl,DropTargetIndicator:qn,Header:Ot,HeaderButton:An,Splitter:Xl,Tab:Xn},Symbol.toStringTag,{value:"Module"}));var Gf={config:Mp,container:Lp,controls:Vf,errors:mf,items:Ff,utils:Zp};function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Be(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){Y(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Y(n,e,t){return(e=qf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qf(n){var e=Xf(n,"string");return typeof e=="symbol"?e:e+""}function Xf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ua=["column","row","stack","component"];class Li extends He{static isLayoutItemConfig(e){return ua.includes(e.type)}static minifyConfig(e){return ki(e)}static unminifyConfig(e){return gi(e)}constructor(e,t){super(),Y(this,"isInitialised",!1),Y(this,"_isFullPage",!1),Y(this,"_resizeTimeoutId",void 0),Y(this,"_components",{"lm-react-component":Rl}),Y(this,"_fallbackComponent",void 0),Y(this,"_itemAreas",[]),Y(this,"_maximisedItem",null),Y(this,"_maximisePlaceholder",x('<div class="lm_maximise_place"></div>')),Y(this,"_creationTimeoutPassed",!1),Y(this,"_subWindowsCreated",!1),Y(this,"_dragSources",[]),Y(this,"_updatingColumnsResponsive",!1),Y(this,"_firstLoad",!0),Y(this,"_reactChildMap",new Map),Y(this,"_reactChildren",null),Y(this,"_initialHeaderHeight",void 0),Y(this,"width",null),Y(this,"height",null),Y(this,"root",void 0),Y(this,"openPopouts",[]),Y(this,"selectedItem",null),Y(this,"isSubWindow",!1),Y(this,"eventHub",new $l(this)),Y(this,"config",void 0),Y(this,"container",void 0),Y(this,"_originalContainer",void 0),Y(this,"dropTargetIndicator",null),Y(this,"tabDropPlaceholder",x('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&x("body").css("visibility","hidden")}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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}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 Pe))throw new Error("Root must be a ContentItem");var t={settings:Be({},this.config.settings),dimensions:Be({},this.config.dimensions),labels:Be({},this.config.labels),content:[]},r=function(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]={},r(a.content[u],s.contentItems[u])}};e?r(t,{contentItems:[e]}):r(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){x(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 qn,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 r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}enableHeaders(){this.config.settings.hasHeaders=!0,this.config.dimensions.headerHeight=this._initialHeaderHeight,this._findAllStackContainers().forEach(e=>{e._header.show=!0,e.header.element.toggle(!0)}),this.updateSize()}disableHeaders(){this.config.settings.hasHeaders=!1,this.config.dimensions.headerHeight=0,this._findAllStackContainers().forEach(e=>{e._header.show=!1,e.header.element.toggle(!1)}),this.updateSize()}updateSize(e,t){var r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r: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(),x(window).off("resize",this._onResize),x(window).off("unload beforeunload",this._onUnload),x(window).off("blur.lm").off("focus.lm"),x(window).off("keydown",this._windowKeydown),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 r,i;if(typeof e.type!="string")throw new Jt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!Li.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+ua.join(","),new Jt(i);return e.type==="component"&&!(t instanceof Si)&&t&&!(this.isSubWindow===!0&&t instanceof Ci)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:wr(),e.type==="stack"?new Si(this,e,t):e.type==="row"?new Fn(!1,this,e,t):e.type==="column"?new Fn(!0,this,e,t):new ql(this,e,t)}createPopout(e,t,r,i){var o=[],a=e instanceof Pe,s=this;if(a){var l;o=this.toConfig(e).content,r=wr();for(var u=e.parent,c=e;((m=u)===null||m===void 0?void 0:m.contentItems.length)===1&&!u.isRoot;){var m;c=u,u=u.parent}if((l=u)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var p;i=(p=u)===null||p===void 0?void 0:p.contentItems.indexOf(c)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var f,v,g,b=window.screenX||window.screenLeft,y=window.screenY||window.screenTop,C=(f=e.element.offset())!==null&&f!==void 0?f:{left:0,top:0};t={left:b+C.left,top:y+C.top,width:(v=e.element.width())!==null&&v!==void 0?v:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!r||i===void 0)){var S=new Wl(o,t,r,i,this);return S.on("initialised",function(){s.emit("windowOpened",S)}),S.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(S),S}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new Kl(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new zl(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,r;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((r=this.container.height())!==null&&r!==void 0?r: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 r=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&&r>a.surface&&(r=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=Be({},this.root._$getArea()),r=[Be(Be({},t),{},{side:"left",x2:t.x1+e}),Be(Be({},t),{},{side:"right",x1:t.x2-e}),Be(Be({},t),{},{side:"top",y2:t.y1+e}),Be(Be({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$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 r=e[t];if(tn(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=Be(Be({},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 Pe)return e;if(x.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.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=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&x(window).resize(this._onResize),x(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=Ll("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=gi(e),localStorage.removeItem(r));var i=x.extend(!0,{},jl,e),o=function(s){for(var l in s){var u=s[l];l!=="props"&&typeof u=="object"&&u!=null?o(u):l==="type"&&u==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return o(i),((t=i.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(i.dimensions.headerHeight=0),i}_adjustToWindowMode(){var e,t=x('<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=Ai((e=this.config.content[0].title)!==null&&e!==void 0?e:""),x("head").append(x("body link, body style, template, .gl_keep")),this.container=x("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?x(this._originalContainer):x("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,x("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 Jt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Jt(t,e);this.root=new Ci(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,r=e*t;if(!(this.width==null||r<=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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{tn(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Y(Li,"__lm",Gf);const da={"tab-height":"28px","drag-border-width":"5px"},ca=Object.freeze({tabHeight:parseInt(da["tab-height"],10),dragBorderWidth:parseInt(da["drag-border-width"],10)});function ha(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ha(Object(t),!0).forEach(function(r){Zl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ha(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Zl(n,e,t){return(e=Zf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zf(n){var e=Yf(n,"string");return typeof e=="symbol"?e:e+""}function Yf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var At=H.module("LayoutUtils");function Yl(n){return n.componentName!==void 0}function Rt(n){var e=n;return(Yl(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function dr(n){return n.focus!==void 0}function ma(n){return n.type==="stack"}class T{static activateTab(e,t){var r=T.getStackForRoot(e,t,!1);if(!r){At.error("Could not find stack for config",t);return}var i=T.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=T.getStackForRoot(e,t,!1);if(!r)return At.error("Could not find stack for config",t),!1;var i=T.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(Gl(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(r);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;if(!l){var u,c,m=e.layoutManager.createContentItem({type:t?"row":"column",height:(u=s.config)===null||u===void 0?void 0:u.height,width:(c=s.config)===null||c===void 0?void 0:c.width},e);e.replaceChild(s,m),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]}return this.addStack(s,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=T.getAllStackContainers(e),r=T.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&tn(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(tn(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var a=this.getStackById(e.contentItems[o],t,i);if(a)return a}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=this.getContentItemById(e.contentItems[i],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&tn(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&&ro(o.config,t))return e;var a=this.getStackForConfig(o,t,r);if(a)return a}return null}static getStackForRoot(e,t){var r=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&&r&&(a=this.addStack(e)),a}static getStackForComponentTypes(e,t){for(var r=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=T.getStackForRoot(e,{component:s},r&&l,i,o);if(u)return u}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&ro(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i],a=o.content;if(Rt(o)){var s=t(o.component,o);s!=null?r.push(s):At.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o.component,'"'))}else if(a){var l=yt(yt({},o),{},{content:T.dehydrateLayoutConfig(a,t)});r.push(l)}else r.push(o)}return r}static getTabPoint(e){var t=e.tab;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],i=r.content;i!==void 0?(ma(r)&&delete r.activeItemIndex,T.dropLayoutMinorChange(i)):Rt(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=T.cloneLayout(e),o=T.cloneLayout(t);return r?(T.dropLayoutMinorChange(i),T.dropLayoutMinorChange(o),ai(i,o)):ai(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i];if(Rt(o)){var a,s=o.component,l=o.props,u=l===void 0?{}:l;r.push(yt(yt({},o),{},{id:(a=o==null?void 0:o.id)!==null&&a!==void 0?a:Pt(),props:t(s,u)}))}else if(o.content!==void 0){var c=T.hydrateLayoutConfig(o.content,t);ma(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=c.length&&(At.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(yt(yt({},o),{},{content:c}))}else r.push(o)}return r}static openComponent(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.root,r=e.config,i=e.stack,o=i===void 0?void 0:i,a=e.replaceExisting,s=a===void 0?!0:a,l=e.replaceConfig,u=l===void 0?void 0:l,c=e.createNewStack,m=c===void 0?!1:c,p=e.focusElement,f=p===void 0?void 0:p,v=e.dragEvent,g=v===void 0?void 0:v,b=document.activeElement,y=yt({},r);if(y.id==null&&(y.id=Pt()),g!=null){t==null||t.layoutManager.createDragSourceFromEvent(y,g);return}var C=u||{id:y.id,component:y.component};B(t);var S=o??(m?T.addStack(t):T.getStackForRoot(t,C));B(S);var _=T.getContentItemInStack(S,C);if(f!=null){var E=W=>{At.debug("Component created, focusing element",f),S.off("componentCreated",E);var N=W.origin.element;requestAnimationFrame(()=>{T.focusElement(N[0],f)})};S.on("componentCreated",E)}if(s&&_){var D=S.contentItems.indexOf(_);S.addChild(y,D+1),S.removeChild(_),S.setActiveContentItem(S.contentItems[D])}else S.addChild(y);f==null&&b&&dr(b)&&b.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=T.getContentItemInStack(e,o);if(r&&a&&e){var s=e==null?void 0:e.contentItems.indexOf(a);e.addChild(t,s+1),e.removeChild(a),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&dr(i)&&i.focus()}static closeComponent(e,t,r){var i=T.getStackForRoot(e,t,!1,!1,!1);if(!i){At.warn("Cannot find stack for component, ignoring close",t);return}var o=T.getContentItemInStack(i,t),a=document.activeElement;o&&(ke(o)?o.container.close(r):i.removeChild(o)),a&&document.contains(a)&&dr(a)&&a.focus()}static renameComponent(e,t,r){var i=T.getStackForRoot(e,t,!1);if(!i){At.error("Could not find stack for config",t);return}var o=T.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=T.getStackForRoot(e,t,!1);if(!r)return At.error("Could not find stack for config",t),null;var i=t.props,o=i===void 0?{}:i,a=T.getPanelComponentState(t),s={type:"react-component",component:t.component,props:yt(yt({},o),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Pt()};return T.openComponentInStack(r,s),s}static getPanelComponentState(e){if(Yl(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Rt(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:ca.tabHeight,borderWidth:ca.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=T.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var t=e.props.glContainer;return T.getIdFromContainer(t)}static getComponentNameFromPanel(e){var t=e.props.glContainer,r=T.getComponentConfigFromContainer(t);if(r&&Rt(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.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]:T.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(dr(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}Zl(T,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Qf=j.forwardRef((n,e)=>{var t=T.getComponentNameFromPanel({props:n});return d.jsx("div",{ref:e,className:"panel-placeholder",children:d.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Qf.displayName="PanelPlaceholder";var ee=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),Ri=mt(ee.OPEN),tS=Ri.listen,Jf=Ri.emit,nS=Ri.useListener,$i=mt(ee.CLOSE),rS=$i.listen,pa=$i.emit,iS=$i.useListener,Rr=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),Fi=mt(Rr.CYCLE_TO_NEXT_STACK),ev=Fi.listen,oS=Fi.emit,aS=Fi.useListener,Hi=mt(Rr.CYCLE_TO_PREVIOUS_STACK),tv=Hi.listen,sS=Hi.emit,lS=Hi.useListener,Ui=mt(Rr.CYCLE_TO_NEXT_TAB),nv=Ui.listen,uS=Ui.emit,dS=Ui.useListener,Bi=mt(Rr.CYCLE_TO_PREVIOUS_TAB),rv=Bi.listen,cS=Bi.emit,hS=Bi.useListener;function fa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function va(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fa(Object(t),!0).forEach(function(r){_t(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _t(n,e,t){return(e=iv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iv(n){var e=ov(n,"string");return typeof e=="symbol"?e:e+""}function ov(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Je=H.module("PanelManager"),Zt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(Zt||{});class Ql{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=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]:()=>{};_t(this,"layout",void 0),_t(this,"hydrateComponent",void 0),_t(this,"dehydrateComponent",void 0),_t(this,"onPanelsUpdated",void 0),_t(this,"closed",void 0),_t(this,"openedMap",void 0),_t(this,"navigationEventListenerRemovers",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.handleReopenLast=this.handleReopenLast.bind(this),this.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=r,this.onPanelsUpdated=a,this.openedMap=new Map(i),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var e=this.layout.eventHub;e.on(ee.FOCUS,this.handleFocus),e.on(ee.MOUNT,this.handleMount),e.on(ee.UNMOUNT,this.handleUnmount),e.on(ee.REOPEN,this.handleReopen),e.on(ee.REOPEN_LAST,this.handleReopenLast),e.on(ee.DELETE,this.handleDeleted),e.on(ee.CLOSED,this.handleClosed),e.on(ee.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(ev(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(tv(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(nv(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(rv(e,this.handleCycleToPreviousTab))}stopListening(){var e=this.layout.eventHub;e.off(ee.FOCUS,this.handleFocus),e.off(ee.MOUNT,this.handleMount),e.off(ee.UNMOUNT,this.handleUnmount),e.off(ee.REOPEN,this.handleReopen),e.off(ee.REOPEN_LAST,this.handleReopenLast),e.off(ee.DELETE,this.handleDeleted),e.off(ee.CLOSED,this.handleClosed),e.off(ee.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var t=e.props.glContainer;return T.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&Rt(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=T.getStackForConfig(this.layout.root,{id:e});return(t=r&&T.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Sr(r)&&t instanceof r.WrappedComponent||!Sr(r)&&t instanceof r))}updatePanel(e){var t=T.getIdFromPanel(e);if(t==null){Je.error("updatePanel Panel did not have an ID",e);return}Je.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=T.getIdFromPanel(e);if(t==null){Je.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Je.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Je.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Je.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Je.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Je.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Je.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=T.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=T.getFocusedStackIndex(t);if(r===-1){var i=t[0],o=i.config.activeItemIndex,a=o!=null?i.contentItems[o]:i.contentItems[0];i.setActiveContentItem(a,!0);return}var s=e===Zt.Next?(r+1)%t.length:(r-1+t.length)%t.length,l=t[s],u=l.config.activeItemIndex,c=u!=null?l.contentItems[u]:l.contentItems[0];l.setActiveContentItem(c,!0)}}handleCycleToNextStack(){this.cycleStack(Zt.Next)}handleCycleToPreviousStack(){this.cycleStack(Zt.Previous)}cycleTab(e){var t,r=T.getFocusedStack(this.layout);if(r!==void 0){var i=r.contentItems;if(!(i.length<=1)){var o=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,a=e===Zt.Next?(o+1)%i.length:(o-1+i.length)%i.length,s=i[a];r.setActiveContentItem(s,!0)}}}handleCycleToNextTab(){this.cycleTab(Zt.Next)}handleCycleToPreviousTab(){this.cycleTab(Zt.Previous)}handleReopen(e,t){Je.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var r=e.component,i=e.props;i=this.hydrateComponent(r,i);var o=va(va({},e),{},{props:i}),a=this.layout.root,s=e.parentStackId===void 0?void 0:T.getStackById(a,e.parentStackId);T.openComponent({root:a,config:o,replaceConfig:t,stack:s??void 0})}handleReopenLast(e){var t;if(this.closed.length!==0){if(e===void 0){this.handleReopen(this.closed[this.closed.length-1]);return}for(var r=(t=T.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var o=this.closed[i];if(o.parentStackId===r){this.handleReopen(o);return}}}}handleDeleted(e){Je.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Je.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},r=this.layout.root;T.closeComponent(r,t)}addClosedPanel(e){var t=T.getComponentConfigFromContainer(e);if(t&&Rt(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var e=this.closed,t=this.openedMap;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}_t(Ql,"MAX_CLOSED_PANEL_COUNT",100);var av=H.module("PanelErrorBoundary");class sv extends h.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=T.getIdFromContainer(t);av.debug("componentWillUnmount",i),r.emit(ee.CLOSED,i,t)}render(){var e=this.props.children,t=this.state.error;return t!=null?d.jsx("div",{className:"panel-error-boundary",children:d.jsx(Un,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ga(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Er(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(t),!0).forEach(function(r){lv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ga(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lv(n,e,t){return(e=uv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uv(n){var e=dv(n,"string");return typeof e=="symbol"?e:e+""}function dv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Jl(n){var e=n.props,t=n.componentState,r=e.metadata,i=e.panelState,o=i===void 0?null:i;t&&(o=t.panelState);var a={};return r!=null&&(a.metadata=r),o!=null&&(a.panelState=o),Er(Er({},n),{},{componentState:null,props:a,type:"react-component"})}function eu(n,e){return Er(Er({},n),{},{localDashboardId:e})}const mS={dehydrate:Jl,hydrate:eu};var tu=j.createContext(void 0);tu.displayName="LayoutManagerContext";var cv=pe.shape({on:pe.func,off:pe.func,isHidden:pe.bool,tab:pe.shape({header:pe.shape({tabs:pe.arrayOf(pe.shape({contentItem:pe.shape({})}))})}),title:pe.string,setTitle:pe.func,close:pe.func}),nu=pe.shape({on:pe.func,off:pe.func,emit:pe.func}),hv=pe.shape({registerComponent:pe.func,root:pe.shape({addChild:pe.func}),on:pe.func,off:pe.func,eventHub:nu}),pS=Object.freeze({Container:cv,EventHub:nu,Layout:hv});function hn(n,e,t){h.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var ru="SET_DASHBOARD_DATA";const mv=ep(ru,{},!1),pv={dashboardData:mv};var fv=new Map,iu=Object.freeze({}),vv=Object.freeze([]),fS=zs,vS=Vs,gS=Td,gv=n=>n.dashboardData,Ie=(n,e)=>{var t;return(t=gv(n)[e])!==null&&t!==void 0?t:iu},bS=(n,e)=>{var t;return(t=Ie(n,e).closed)!==null&&t!==void 0?t:vv},yS=(n,e)=>{var t;return(t=Ie(n,e).openedMap)!==null&&t!==void 0?t:fv},ou=(n,e)=>{var t;return(t=Ie(n,e).pluginDataMap)!==null&&t!==void 0?t:iu},CS=(n,e,t)=>ou(n,e)[t];function ba(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ba(Object(t),!0).forEach(function(r){bv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ba(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bv(n,e,t){return(e=yv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yv(n){var e=Cv(n,"string");return typeof e=="symbol"?e:e+""}function Cv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var au=(n,e)=>({type:ru,id:n,payload:e}),Sv=(n,e)=>(t,r)=>t(au(n,yn(yn({},Ie(r(),n)),e))),SS=(n,e,t)=>(r,i)=>r(au(n,yn(yn({},Ie(i(),n)),{},{pluginDataMap:yn(yn({},ou(i(),n)),{},{[e]:t})})));function wv(n,e){return Tv(n)||Pv(n,e)||Ev(n,e)||_v()}function _v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ev(n,e){if(n){if(typeof n=="string")return ya(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ya(n,e):void 0}}function ya(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Pv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Tv(n){if(Array.isArray(n))return n}Object.entries(pv).map(n=>{var e=wv(n,2),t=e[0],r=e[1];return ip.register(t,r)});function Ov(n,e){return Mv(n)||Dv(n,e)||Iv(n,e)||xv()}function xv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iv(n,e){if(n){if(typeof n=="string")return Ca(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ca(n,e):void 0}}function Ca(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Dv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Mv(n){if(Array.isArray(n))return n}var su=h.createContext(null);su.displayName="PersistentStateContext";function cr(n,e){return"".concat(n,"::").concat(e)}function jv(n){var e=n.initialState,t=n.onChange,r=n.children,i=h.useRef(!0);h.useEffect(()=>()=>{i.current=!1},[]);var o=h.useRef(!1),a=h.useState(()=>Array.isArray(e)&&e.flat().length===2*e.length?new Map(e):(o.current=!0,new Map)),s=Ov(a,1),l=s[0],u=h.useRef(new Map),c=h.useCallback((b,y,C)=>{var S=C.type,_=cr(y,S),E=u.current.get(_);if(E!=null&&E!==b)throw new Error("Detected multiple persistent states of type ".concat(S," for dhId ").concat(y,". Only one state per (dhId, type) pair is allowed."));u.current.set(_,b),i.current&&l.get(_)!==C&&(l.set(_,C),t([...l.entries()]))},[i,t,l]),m=h.useRef(e[Symbol.iterator]()),p=h.useCallback((b,y)=>{var C=cr(b,y),S=l.get(C);if(S==null&&o.current){var _=m.current.next(),E=_.value,D=E;return l.set(C,D),D}return S},[l]),f=h.useCallback((b,y,C)=>{var S=cr(y,C),_=u.current.get(S);_===b&&(l.delete(S),u.current.delete(S),i.current&&t([...l.entries()]))},[i,t,l]),v=h.useCallback((b,y,C)=>{var S=cr(y,C),_=u.current.get(S);_===b&&u.current.delete(S)},[]),g=h.useMemo(()=>({addState:c,removeState:f,deregisterHook:v,getState:p}),[c,p,f,v]);return d.jsx(su.Provider,{value:g,children:r})}function Av(n,e){return Rv(n)||Lv(n,e)||Nv(n,e)||kv()}function kv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nv(n,e){if(n){if(typeof n=="string")return Sa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Sa(n,e):void 0}}function Sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Lv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Rv(n){if(Array.isArray(n))return n}var $v=H.module("DashboardPanelWrapper");function Fv(n){var e=n.glContainer,t=n.children,r=h.useCallback(u=>{e.setPersistedState(u)},[e]),i=e.getConfig(),o=i.persistedState,a=h.useState(()=>o!=null&&!Array.isArray(o)?($v.warn("Persisted state is type ".concat(typeof o,". Expected array. Setting to empty array.")),[]):o??[]),s=Av(a,1),l=s[0];return d.jsx(jv,{initialState:l,onChange:r,children:t})}var Wi=h.createContext(null);Wi.displayName="PanelIdContext";function Hv(){return h.useContext(Wi)}function wa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wa(Object(t),!0).forEach(function(r){Uv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uv(n,e,t){return(e=Bv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bv(n){var e=Wv(n,"string");return typeof e=="symbol"?e:e+""}function Wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hr(n,e){return Gv(n)||Vv(n,e)||zv(n,e)||Kv()}function Kv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zv(n,e){if(n){if(typeof n=="string")return _a(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_a(n,e):void 0}}function _a(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Vv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Gv(n){if(Array.isArray(n))return n}var mn=H.module("DashboardLayout"),qv=Object.freeze({}),Xv=[],Ea=()=>{},Zv=1e3,Pa=n=>n;function wS(n){var e,t,r=n.id,i=n.children,o=n.emptyDashboard,a=o===void 0?d.jsx("div",{className:"dashboard-empty",children:"Dashboard is empty."}):o,s=n.layout,l=n.layoutConfig,u=l===void 0?Xv:l,c=n.onLayoutChange,m=c===void 0?Ea:c,p=n.onLayoutInitialized,f=p===void 0?Ea:p,v=n.hydrate,g=v===void 0?eu:v,b=n.dehydrate,y=b===void 0?Jl:b,C=n.panelWrapper,S=zs(),_=(e=Vs(F=>Ie(F,r)))!==null&&e!==void 0?e:qv,E=h.useState(!1),D=hr(E,2),W=D[0],N=D[1],I=h.useState(!1),k=hr(I,2),$=k[0],ae=k[1],A=h.useRef(),X=h.useState((t=_==null?void 0:_.closed)!==null&&t!==void 0?t:[]),de=hr(X,1),se=de[0],be=h.useState(s.getReactChildren()),ye=hr(be,2),Te=ye[0],Se=ye[1],ce=h.useMemo(()=>new Map,[]),Z=h.useMemo(()=>new Map,[]),V=h.useCallback(function(F,re){var ie,er=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g,tr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:y;mn.debug2("registerComponent",F,re,er,tr);function un(Dt,nr){var bt=re,rr=C,O=cl(bt),z=O?d.jsx(bt,Vt(Vt({},Dt),{},{ref:nr})):d.jsx(bt,Vt({},Dt)),J=Dt.glContainer,De=Dt.glEventHub,Me=T.getIdFromContainer(J);return d.jsx(sv,{glContainer:J,glEventHub:De,children:d.jsx(Wi.Provider,{value:Me,children:d.jsx(Fv,Vt(Vt({},Dt),{},{children:rr==null?z:d.jsx(rr,Vt(Vt({},Dt),{},{children:z}))}))})})}un.displayName="DashboardWrapper(".concat((ie=re.displayName)!==null&&ie!==void 0?ie:F,")");var Dn=s.registerComponent(F,j.forwardRef(un));return ce.set(F,er),Z.set(F,tr),Dn},[g,y,ce,Z,s,C]),te=h.useCallback((F,re)=>{var ie;return((ie=ce.get(F))!==null&&ie!==void 0?ie:Pa)(re,r)},[ce,r]),G=h.useCallback((F,re)=>{var ie;return((ie=Z.get(F))!==null&&ie!==void 0?ie:Pa)(re,r)},[Z,r]),Q=h.useMemo(()=>new Ql(s,te,G,new Map,se,F=>{var re=F.closed,ie=F.openedMap;S(Sv(r,{closed:re,openedMap:ie}))}),[G,S,te,r,se,s]),M=Pc(F=>{var re=A.current,ie=re==null||!T.isEqual(re,F);mn.debug("handleLayoutStateChanged",ie,F),ie&&(mn.debug("Layout config has changed","lastConfig",re,"dehydratedLayoutConfig",F),N(s.root.contentItems.length===0),A.current=F,m(F),Se(s.getReactChildren()))},Zv,{flushOnUnmount:!0});h.useEffect(()=>()=>M.flush(),[M]);var Ve=h.useCallback(()=>{if(!$){var F=s.toConfig(),re=F.content,ie=T.dehydrateLayoutConfig(re,G);M(ie)}},[G,$,s,M]),Qn=h.useCallback(F=>{var re=T.getIdFromContainer(F);s.eventHub.emit(ee.DRAGGING,re),ae(!0)},[s.eventHub]),sn=h.useCallback(F=>{var re=T.getIdFromContainer(F);s.eventHub.emit(ee.DROPPED,re),ae(!1)},[s.eventHub]),Wr=h.useCallback(F=>{if(mn.debug2("handleComponentCreated",F),!(F==null||F.config==null||!Rt(F.config)||F.config.component==null||F.element==null)){var re=F.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),ie="".concat(re,"-component");F.element.addClass(ie)}},[]),Jn=h.useCallback(()=>{Se(s.getReactChildren())},[s]);hn(s,"stateChanged",Ve),hn(s,"itemPickedUp",Qn),hn(s,"itemDropped",sn),hn(s,"componentCreated",Wr),hn(s.eventHub,ee.TITLE_CHANGED,Ve),hn(s,"reactChildrenChanged",Jn);var ln=Ec(u);return h.useEffect(function(){if(ln!==u&&u!==A.current){mn.debug("loadNewConfig effect triggered. previousLayoutConfig",ln,"layoutConfig",u,"lastConfig",A.current),mn.debug("Setting new layout content...");for(var re=T.hydrateLayoutConfig(u,te);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var ie=0;ie<re.length;ie+=1)s.root.addChild(re[ie]);N(s.root.contentItems.length===0)}},[te,s,u,Q,ln]),h.useEffect(()=>f(),[]),d.jsxs(d.Fragment,{children:[W&&a,Te,j.Children.map(i,F=>F!=null?d.jsx(sm,{fallback:[],children:j.cloneElement(F,{id:r,layout:s,panelManager:Q,registerComponent:V})}):null)]})}var lu=h.createContext(null);lu.displayName="DashboardIdContext";function _S(){var n=h.useContext(lu);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function Yv(n,e){return tg(n)||eg(n,e)||Jv(n,e)||Qv()}function Qv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jv(n,e){if(n){if(typeof n=="string")return Ta(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ta(n,e):void 0}}function Ta(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eg(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function tg(n){if(Array.isArray(n))return n}function ng(n,e,t){return(e=rg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rg(n){var e=ig(n,"string");return typeof e=="symbol"?e:e+""}function ig(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function uu(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=uu(r,e,t);if(i)return i;r=r.sibling}}}function og(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var Ki=og(h.createContext(null));Ki.displayName="FiberContext";class ES extends h.Component{constructor(){super(...arguments),ng(this,"_reactInternals",void 0)}render(){var e=this.props.children;return d.jsx(Ki.Provider,{value:this._reactInternals,children:e})}}function ag(){var n=h.useContext(Ki);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var e=h.useState(()=>Pt()),t=Yv(e,1),r=t[0],i=h.useMemo(()=>{for(var o of[n,n==null?void 0:n.alternate].filter(s=>s!=null)){var a=uu(o,!1,s=>{for(var l=s.memoizedState;l!=null;){if(l.memoizedState===r)return!0;l=l.next}});if(a)return a}},[n,r]);return i}var PS="default",sg="CREATE_DASHBOARD",lg="CLOSE_DASHBOARD",zi=mt(sg),TS=zi.listen,ug=zi.emit,OS=zi.useListener,Vi=mt(lg),xS=Vi.listen,dg=Vi.emit,IS=Vi.useListener;function cg(n,e,t){return(e=hg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hg(n){var e=mg(n,"string");return typeof e=="symbol"?e:e+""}function mg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class du extends h.PureComponent{constructor(e){super(e),this.handleCloseTab=this.handleCloseTab.bind(this),this.handleCloseTabsRight=this.handleCloseTabsRight.bind(this),this.handleCloseTabsAll=this.handleCloseTabsAll.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this)}getAllTabs(){var e,t,r=this.props.glContainer;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var e=this.props.glContainer;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var e=this.props.glContainer,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,o,a,s;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;(a=((s=t[r])===null||s===void 0?void 0:s.contentItem).container)===null||a===void 0||a.close()}}handleReopenLast(){var e=this.props,t=e.glContainer,r=e.glEventHub;r.emit(ee.REOPEN_LAST,t)}canCloseTabsRight(){for(var e=this.props.glContainer,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,a,s;if(((o=t[i].contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id)===((a=e.tab)===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0?void 0:a.id))break;var l=!!(!((s=t[i])===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0)&&s.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(o){t=!1;break}}return t}canReopenLast(){var e,t,r=this.props,i=r.workspace,o=r.glContainer,a=(e=T.getStackForConfig(o.layoutManager.root,o.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=i.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===a))}render(){var e,t=this.props,r=t.additionalActions,i=t.glContainer,o=[...r];o.push(()=>({title:"Re-open closed panel",group:ue.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var a=(e=i.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return o.push({title:"Close",order:10,group:ue.groups.low,action:this.handleCloseTab,disabled:a===void 0||!a}),o.push(()=>({title:"Close Tabs to Right",order:20,group:ue.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),o.push(()=>({title:"Close All",order:30,group:ue.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),d.jsx(ue,{actions:o})}}cg(du,"defaultProps",{additionalActions:[]});var pg=n=>({workspace:El(n)}),fg=Wn(pg,{setWorkspace:Pl})(du);function cu(n,e,t){return(e=vg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vg(n){var e=gg(n,"string");return typeof e=="symbol"?e:e+""}function gg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hu extends h.PureComponent{constructor(e){super(e),cu(this,"renameInputRef",void 0),this.handleRenameDialogOpened=this.handleRenameDialogOpened.bind(this),this.handleRenameInputChange=this.handleRenameInputChange.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.renameInputRef=j.createRef();var t=e.value;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var t=e.isShown,r=this.props.isShown;r&&!t&&this.resetState()}resetState(){var e=this.props.value;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var e=this.props.onCancel;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var t=this.state.value,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var i=this.props.onSubmit;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var e=this.props,t=e.isShared,r=e.isOwner,i=e.itemType,o=this.state,a=o.value,s=o.valueWasValidated;return d.jsxs("form",{className:U("p-3",{"was-validated":s}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:l=>{l.stopPropagation()},onMouseUp:l=>{l.stopPropagation()},children:[d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{htmlFor:"rename-dialog-".concat(i,"-input"),children:["Rename ",i]}),d.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(i,"-input"),value:a??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),d.jsxs("div",{className:"invalid-feedback",children:[i," name cannot be empty"]}),(t||!r)&&d.jsxs("div",{className:"pt-2",children:["Renaming this ",i," will rename for all users."]})]}),d.jsxs("div",{className:"text-right",children:[d.jsx(ne,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),d.jsx(ne,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var e=this.props,t=e.isShown,r=e.onCancel;return d.jsx(Mr,{isShown:t,onEntered:this.handleRenameDialogOpened,onExited:r,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}cu(hu,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var mr=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function Oa(n,e,t){return(e=bg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bg(n){var e=yg(n,"string");return typeof e=="symbol"?e:e+""}function yg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cg=H.module("Panel");class Sg extends h.PureComponent{constructor(e){super(e),Oa(this,"ref",void 0),Oa(this,"getAdditionalActions",Cn((r,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...r]})),this.handleCopyPanel=this.handleCopyPanel.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleHide=this.handleHide.bind(this),this.handleResize=this.handleResize.bind(this),this.handleBeforeShow=this.handleBeforeShow.bind(this),this.handleShow=this.handleShow.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.handleShowRenameDialog=this.handleShowRenameDialog.bind(this),this.handleTabClicked=this.handleTabClicked.bind(this),this.handleTab=this.handleTab.bind(this),this.ref=j.createRef();var t=this.props.glContainer;this.state={title:T.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t=this.props,r=t.componentPanel,i=t.glContainer,o=t.glEventHub;i.on("resize",this.handleResize),i.on("show",this.handleBeforeShow),i.on("shown",this.handleShow),i.on("hide",this.handleHide),i.on("tab",this.handleTab),i.on("tabClicked",this.handleTabClicked),o.on(mr.focus,this.handleTabFocus),o.on(mr.blur,this.handleTabBlur),o.emit(ee.MOUNT,r??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var e=this.props,t=e.componentPanel,r=e.glContainer,i=e.glEventHub;r.off("resize",this.handleResize),r.off("show",this.handleBeforeShow),r.off("shown",this.handleShow),r.off("hide",this.handleHide),r.off("tab",this.handleTab),r.off("tabClicked",this.handleTabClicked),i.off(mr.focus,this.handleTabFocus),i.off(mr.blur,this.handleTabBlur),i.emit(ee.UNMOUNT,t??this)}handleTab(e){e!=null&&this.setState({title:T.getTitleFromTab(e)}),this.forceUpdate();var t=this.props.onTab;t==null||t(e)}handleTabClicked(e){var t=this.props.onTabClicked;t==null||t(e)}handleFocus(e){var t=this.props,r=t.componentPanel,i=t.glEventHub;i.emit(ee.FOCUS,r??this);var o=this.props.onFocus;o==null||o(e)}handleBlur(e){var t=this.props.onBlur;t==null||t(e)}handleHide(){for(var e=this.props.onHide,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var e=this.props.onResize,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var e=this.props.onBeforeShow,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var e=this.props.onShow,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var e=this.props.onTabBlur,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var e=this.props.onTabFocus,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var t=this.props.glContainer;this.setState({showRenameDialog:!1,title:e});var r=T.getRootFromContainer(t),i=T.getComponentConfigFromContainer(t);B(i),T.renameComponent(r,i,e)}handleCopyPanel(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=T.getRootFromContainer(t),o=T.getComponentConfigFromContainer(t);if(o==null){Cg.error("Could not get component config from container",t);return}var a=T.cloneComponent(i,o);a!==null&&r.emit(ee.CLONED,this,a)}getCloneAction(){return{title:"Copy Panel",order:10,group:ue.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:ue.groups.medium,action:this.handleShowRenameDialog}}render(){var e=this.props,t=e.children,r=e.className,i=e.renderTabTooltip,o=e.glContainer,a=e.glEventHub,s=e.additionalActions,l=s===void 0?Nd:s,u=e.errorMessage,c=e.isLoaded,m=c===void 0?!0:c,p=e.isLoading,f=p===void 0?!1:p,v=e.isClonable,g=v===void 0?!1:v,b=e.isRenamable,y=b===void 0?!1:b,C=o.tab,S=this.state,_=S.showRenameDialog,E=S.title,D=S.isWithinPanel;return d.jsxs("div",{className:U("h-100 w-100 dh-panel",r),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[t,d.jsx(Un,{"data-testid":"base-panel-loading",errorMessage:u,isLoaded:m,isLoading:f}),!D&&C!=null&&Oi.createPortal(d.jsxs(d.Fragment,{children:[d.jsx(fg,{glContainer:o,glEventHub:a,additionalActions:this.getAdditionalActions(l,g,y)}),y&&d.jsx(hu,{isShown:_,value:E,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),i!=null&&d.jsx(le,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:i()})]}),C.element[0])]})}}var wg=bl(Sg),_g=H.module("useDhId"),Yr="__dhId";function DS(){var n,e,t=(n=(e=ag())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Yr],i=Hv();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Yr," to be a string, but got ").concat(typeof r));return r}return i??(_g.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Yr," prop. Defaulting to null.")),null)}const Eg="var(--dh-color-chart-colorway)",Pg="var(--dh-color-chart-grid)",Tg="var(--dh-color-chart-axis-line)",Og="var(--dh-color-chart-axis-line-zero)",xa={"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-fg)",colorway:Eg,gridcolor:Pg,linecolor:Tg,zerolinecolor:Og,"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)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)","map-style":"var(--dh-color-chart-map-style)"};function xg(n,e){return jg(n)||Mg(n,e)||Dg(n,e)||Ig()}function Ig(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dg(n,e){if(n){if(typeof n=="string")return Ia(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ia(n,e):void 0}}function Ia(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Mg(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jg(n){if(Array.isArray(n))return n}var Da=H.module("ChartTheme");function Ag(){var n,e=$s(xa);return e.colorway=zu((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var r=xg(t,2),i=r[0],o=r[1];return Vu.normalizeCssColor(e.colorway.substring(i,o+1))}).join(" "),Da.debug2("Chart theme:",xa),Da.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"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"],map_style:e["map-style"]})}function Ma(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ma(Object(t),!0).forEach(function(r){Ng(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ma(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ng(n,e,t){return(e=Lg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lg(n){var e=Rg(n,"string");return typeof e=="symbol"?e:e+""}function Rg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $g=h.lazy(()=>Od(()=>import("./Plot-BOusvhev.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Fg(n){return d.jsx(h.Suspense,{fallback:d.jsx(Un,{"data-testid":"lazy-plot-loading"}),children:d.jsx($g,kg({},n))})}var Gi=h.createContext(null);Gi.displayName="ChartThemeContext";function MS(n){var e=n.children,t=il(),r=t.activeThemes,i=h.useMemo(Ag,[r]);return d.jsx(Gi.Provider,{value:i,children:e})}function Hg(){return zn(Gi,"No ChartThemeContext value found.")}function mu(n){var e=n.type,t=ym();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return d.jsx(me,{icon:qu});case t.VariableType.FIGURE:return d.jsx(me,{icon:Fs});case t.VariableType.PANDAS:return d.jsx(me,{icon:Gu});default:return d.jsx(me,{icon:Rs})}}function ja(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ug(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ja(o,r,i,a,s,"next",l)}function s(l){ja(o,r,i,a,s,"throw",l)}a(void 0)})}}function Bg(n,e){return Vg(n)||zg(n,e)||Kg(n,e)||Wg()}function Wg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kg(n,e){if(n){if(typeof n=="string")return Aa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Aa(n,e):void 0}}function Aa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function zg(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Vg(n){if(Array.isArray(n))return n}function pu(n){var e=n.children,t=n.language,r=h.useState(null),i=Bg(r,2),o=i[0],a=i[1],s=il(),l=s.activeThemes;return h.useEffect(()=>{var u=!1;function c(){return m.apply(this,arguments)}function m(){return m=Ug(function*(){if(e!=null&&l!=null){var p=yield Le.colorize(e.toString(),t,{});u||a(p)}}),m.apply(this,arguments)}return c(),()=>{u=!0}},[l,e,t]),d.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:o!=null?{__html:o}:void 0})}class fu{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Pr{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:xd.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Pr.isTableType(e,t)||Pr.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function Gg(n){var e=n.children;return d.jsxs("div",{className:"console-history-item-result",children:[d.jsx("div",{className:"console-history-gutter",children:"-"}),d.jsx("div",{className:"console-history-content",children:e})]})}function wi(n,e,t){return(e=qg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qg(n){var e=Xg(n,"string");return typeof e=="symbol"?e:e+""}function Xg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vu extends h.Component{constructor(e){super(e),wi(this,"timer",void 0),wi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var e=this.props,t=e.disabled,r=e.onCancelClick,i=this.state.elapsed;return d.jsx("div",{className:U("console-history-result-in-progress",{disabled:t}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Hs,{className:"ml-2"}),"Running... ",Fe.formatElapsedTime(i)," ",d.jsx(ne,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Xu,tooltip:"Cancel",onClick:r,disabled:t})]})})}}wi(vu,"defaultProps",{disabled:!1});function $n(n,e,t){return(e=Zg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zg(n){var e=Yg(n,"string");return typeof e=="symbol"?e:e+""}function Yg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pn extends h.PureComponent{constructor(e){super(e),$n(this,"mouseX",void 0),$n(this,"mouseY",void 0),$n(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=Pn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Pn.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var e=this.state,t=e.isExpanded,r=e.isTriggerHovered,i=this.props.message;B(i);var o=i.trimEnd(),a=o.indexOf(`
20
- `),s=a>-1,l=o;s&&(l=o.slice(0,a));var u=o.slice(a),c=r?"error-btn-link error-btn-link--active":"error-btn-link";return d.jsxs("div",{className:U("error-message",{expanded:t}),children:[s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"error-gutter",children:d.jsx("button",{type:"button",onClick:this.handleToggleError,className:c,tabIndex:-1,children:d.jsx(me,{icon:t?ii:Zu,transform:"left-3"})})}),d.jsxs("div",{className:"error-content",children:[d.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:l}),t?u:""]})]}),!s&&d.jsx("div",{className:"error-content",children:d.jsx("div",{className:"console-error-text",children:l})})]},"error")}}$n(Pn,"defaultProps",{message:""});$n(Pn,"mouseDragThreshold",5);var gu=h.memo(n=>{var e=n.item,t=e.startTime,r=e.serverStartTime,i=e.serverEndTime,o=h.useMemo(()=>{var c;return(c=e.endTime)!==null&&c!==void 0?c:Date.now()},[e.endTime]),a=Fe.formatConvertedDuration(t,o),s=!!a,l=null;r!=null&&i!=null&&(l=Fe.formatConvertedDuration(r,i,"ns"));var u=!!l;return d.jsxs(d.Fragment,{children:[d.jsx(ol,{children:"Execution Info"}),d.jsx(Id,{children:d.jsxs("div",{className:"console-history-item-contextual-help-content",children:[s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Elapsed time"}),d.jsx("div",{children:a})]}),u&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Server query time"}),d.jsx("div",{children:l})]})]})})]})});gu.displayName="ConsoleHistoryItemTooltip";var Qg=n=>{if((n==null?void 0:n.command)==null)return null;var e=n.command?n.command.split(`
21
- `).length:0;return e>2?null:"console-history-actions-".concat(e)},bu=h.memo(n=>{var e=n.item,t=n.onCommandSubmit,r=n.handleTooltipVisible,i=h.useMemo(()=>Qg(e),[e]);return d.jsxs("div",{className:U("console-history-actions",i),children:[e.command!=null&&d.jsx(hl,{copy:e.command}),d.jsx(ne,{icon:Yu,kind:"inline",onClick:()=>{var o;return t((o=e.command)!==null&&o!==void 0?o:"")},tooltip:"Rerun",children:null}),d.jsx(Dd,{variant:"info",onOpenChange:r,UNSAFE_className:"console-history-item-contextual-help",children:d.jsx(gu,{item:e})})]})});bu.displayName="ConsoleHistoryItemActions";function Jg(n,e,t){return(e=eb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eb(n){var e=tb(n,"string");return typeof e=="symbol"?e:e+""}function tb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ka=H.module("ConsoleHistoryItem");class yu extends h.PureComponent{constructor(e){super(e),this.state={isTooltipVisible:!1},this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){ka.debug("handleObjectClick",e);var t=this.props.openObject;t(e)}handleCancelClick(){var e=this.props.item;e!=null&&e.cancelResult&&(ka.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var e=this.state.isTooltipVisible,t=this.props,r=t.disabled,i=t.item,o=t.language,a=t.iconForType,s=t.onCommandSubmit,l=i.disabledObjects,u=i.result,c=i.command!=null&&i.command!=="",m=null;c&&(m=d.jsxs("div",{className:U("console-history-item-command",{"console-history-item-command-tooltip-active":e}),children:[d.jsx("div",{className:"console-history-gutter",children:">"}),d.jsxs("div",{className:"console-history-content",children:[d.jsx(pu,{language:o,children:i.command}),d.jsx(bu,{item:i,onCommandSubmit:s,handleTooltipVisible:I=>this.setState({isTooltipVisible:I})})]})]}));var p=[],f=!1;if(u){var v=u.error,g=u.message,b=u.changes;if(b){var y=b.created,C=b.updated;[...y,...C].forEach(I=>{f=!0;var k=I.title,$="".concat(k),ae=r===void 0||r||(l??[]).indexOf($)>=0,A=d.jsx(ne,{kind:"primary",onClick:()=>this.handleObjectClick(I),className:"btn-console-object",disabled:ae,icon:a(I.type),children:k},$);p.push(A)})}if(v!=null&&!c){var S,_="".concat((S=v.message)!==null&&S!==void 0?S:v);_||(_=v);var E=d.jsx(Pn,{message:_},"result-error");p.push(E)}if(g!==void 0&&g!==""){var D=d.jsx("div",{className:"log-message",children:g},"log-message");p.push(D)}}else{f=!0;var W=d.jsx(vu,{onCancelClick:this.handleCancelClick,disabled:r},"in_progress");p.push(W)}var N=null;return p.length>0&&(N=d.jsx(Gg,{children:p})),d.jsxs("div",{className:U("console-command-result",{"console-result-buttons":f}),children:[m,N]})}}Jg(yu,"defaultProps",{disabled:!1});function nb(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var rb=j.forwardRef(function(e,t){for(var r=e.disabled,i=r===void 0?!1:r,o=e.items,a=e.language,s=e.openObject,l=e.supportsType,u=e.iconForType,c=e.onCommandSubmit,m=[],p=0;p<o.length;p+=1){var f=o[p],v=d.jsx(yu,{disabled:i,item:f,openObject:s,language:a,supportsType:l,iconForType:u,onCommandSubmit:c},nb(p,f));m.push(v)}return d.jsx("div",{ref:t,className:"container-fluid console-history",children:m})}),ib={name:"Console",CLEAR:oe.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[P.CTRL,w.L],macShortcut:[P.CTRL,w.C]}),FOCUS_HISTORY:oe.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[P.CTRL,w.H],macShortcut:[P.CTRL,P.OPTION,w.H]})},ob={name:"Command History",FOCUS_HISTORY:oe.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[P.CTRL,w.H],macShortcut:[P.CTRL,P.OPTION,w.H]}),SEND_TO_CONSOLE:oe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[w.ENTER],macShortcut:[w.ENTER]}),SEND_TO_NOTEBOOK:oe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[P.CTRL,w.ENTER],macShortcut:[P.CMD,w.ENTER]}),RUN:oe.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[P.ALT,w.R],macShortcut:[P.OPTION,w.R]})},ab={name:"Notebook",RUN:oe.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[P.ALT,w.R],macShortcut:[P.OPTION,w.R]}),RUN_SELECTED:oe.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[P.ALT,P.SHIFT,w.R],macShortcut:[P.OPTION,P.SHIFT,w.R]}),FIND:oe.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[P.CTRL,w.F],macShortcut:[P.CMD,w.F],isEditable:!1}),MINIMAP:oe.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[P.ALT,w.M],macShortcut:[P.OPTION,w.M]}),WORDWRAP:oe.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[P.ALT,w.Z],macShortcut:[P.OPTION,w.Z]})},wn={CONSOLE:ib,COMMAND_HISTORY:ob,NOTEBOOK:ab};const _e=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),sb="var(--dh-color-editor-bg)",lb="var(--dh-color-editor-fg)",ub="var(--dh-color-editor-string)",db="var(--dh-color-editor-delimiter)",cb="var(--dh-color-editor-predefined)",hb="var(--dh-color-editor-keyword)",mb="var(--dh-color-editor-storage)",pb="var(--dh-color-editor-number)",fb="var(--dh-color-editor-operator)",vb="var(--dh-color-editor-identifier)",gb="var(--dh-color-editor-comment)",_i={"error-foreground":"var(--dh-color-editor-error-fg)",background:sb,foreground:lb,"line-height":"19px",string:ub,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:db,predefined:cb,keyword:hb,storage:mb,number:pb,operator:fb,identifier:vb,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:gb,"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-line-number-active-foreground":"var(--dh-color-editor-line-number-active-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)","diff-editor-inserted-text-background":"var(--dh-color-editor-diff-inserted-text-bg)","diff-editor-removed-text-background":"var(--dh-color-editor-diff-removed-text-bg)","diff-editor-inserted-line-background":"var(--dh-color-editor-diff-inserted-line-bg)","diff-editor-removed-line-background":"var(--dh-color-editor-diff-removed-line-bg)"};var bb="python",yb={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/}}},Cb={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"]]}},Sb={id:bb,conf:yb,language:Cb},wb="groovy",_b={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/}}},Eb={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"]]}},Pb={id:wb,conf:_b,language:Eb},Tb="scala",Ob={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>))/}}},xb={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"]]}},Ib={id:Tb,conf:Ob,language:xb},Db="deephavenDb",Mb={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/}}},jb={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"]]}},Ab={id:Db,conf:Mb,language:jb},kb="log",Nb={},Lb={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"}]]}},Rb={id:kb,conf:Nb,language:Lb},$b={preview:!0,"target-version":"py38","line-length":88,"indent-width":4,format:{"indent-style":"space","quote-style":"double"},lint:{"flake8-implicit-str-concat":{"allow-multiline":!1},ignore:["ISC003"],select:["F","E1","E9","E711","W291","W293","W605","B","A","COM818","ISC","PLE","RUF001","RUF021","RUF027","PLR1704","LOG","ASYNC","RET501","RET502","RET503","PLC2401","PLC2403","NPY","PERF","C4"]}};function Na(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Fb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Na(o,r,i,a,s,"next",l)}function s(l){Na(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ut(n,e,t){return(e=Hb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hb(n){var e=Ub(n,"string");return typeof e=="symbol"?e:e+""}function Ub(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var et=H.module("MonacoCompletionProvider");class L extends h.PureComponent{static initRuff(){return Fb(function*(){if(L.isRuffEnabled)return L.initRuffPromise||(L.initRuffPromise=jd({}).then(()=>{et.debug("Initialized Ruff",io.version()),L.isRuffInitialized=!0,L.updateRuffWorkspace()})),L.initRuffPromise})()}static updateRuffWorkspace(){if(L.isRuffInitialized){var e=console.log;try{console.log=()=>{},L.ruffWorkspace=new io(L.ruffSettings)}finally{console.log=e}L.lintAllPython()}}static setRuffSettings(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L.ruffSettings;if(L.ruffSettings=e,!L.isRuffInitialized){L.initRuff();return}L.updateRuffWorkspace()}static getDiagnostics(e){if(!L.ruffWorkspace)return[];var t=L.ruffWorkspace.check(e.getValue());return Ee.isConsoleModel(e)?t.filter(r=>r.code==null):t}static lintAllPython(){if(!L.isRuffEnabled){Le.removeAllMarkers("ruff");return}Le.getModels().filter(e=>e.getLanguageId()==="python").forEach(L.lintPython)}static lintPython(e){if(L.isRuffEnabled&&L.ruffWorkspace){var t=L.getDiagnostics(e);et.debug("Linting Python document: ".concat(e.uri.toString()),t),Le.setModelMarkers(e,"ruff",t.map(r=>{var i=r.code==="F401"||r.code==="F841",o=r.code==null;return{startLineNumber:r.location.row,startColumn:r.location.column,endLineNumber:r.end_location.row,endColumn:r.end_location.column,message:o?r.message:"".concat(r.code,": ").concat(r.message),severity:o?oo.Error:oo.Warning,tags:i?[Md.Unnecessary]:[]}}))}}static lspToMonacoKind(e){var t=rt.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){var t=e.start,r=e.end;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}static handlePythonCodeActionRequest(e,t){if(!L.isRuffEnabled||!L.ruffWorkspace)return{actions:[],dispose:()=>{}};var r=L.getDiagnostics(e).filter(u=>{var c=new Gs(u.location.row,u.location.column,u.end_location.row,u.end_location.column);return u.code!=null&&c.intersectRanges(t)}),i=r.filter(u=>{var c=u.fix;return c!=null}).map(u=>{var c="Fix";return u.fix!=null&&(u.fix.message!=null&&u.fix.message!==""?c="".concat(u.code,": ").concat(u.fix.message):c="Fix ".concat(u.code)),{title:c,id:"fix-".concat(u.code),kind:"quickfix",edit:u.fix?{edits:u.fix.edits.map(m=>{var p;return{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:m.location.row,startColumn:m.location.column,endLineNumber:m.end_location.row,endColumn:m.end_location.column},text:(p=m.content)!==null&&p!==void 0?p:""}}})}:void 0}}),o=new Set,a=new Set;r.forEach(u=>{u.code!=null&&(o.has(u.code)&&a.add(u.code),o.add(u.code))});var s=r.map(u=>{if(u.code==null)return[];var c=e.getLineContent(u.location.row),m=Le.tokenize(c,e.getLanguageId())[0].at(-1),p={range:{startLineNumber:u.location.row,startColumn:c.length+1,endLineNumber:u.location.row,endColumn:c.length+1},text:" # noqa: ".concat(u.code)};return m!=null&&m.type.startsWith("comment")&&(p.text="# noqa: ".concat(u.code," "),c.startsWith("# noqa:",m.offset)?(p.range.startColumn=m.offset+1,p.range.endColumn=m.offset+9):(p.range.startColumn=m.offset+1,p.range.endColumn=c.startsWith("# ",m.offset)?m.offset+3:m.offset+2)),[{title:"Disable ".concat(u.code," for ").concat(a.has(u.code)?"line ".concat(u.location.row):"this line"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:p}]}}]}).flat().filter((u,c,m)=>m.find(p=>p.title===u.title)===u),l=[...o].map(u=>({title:"Disable ".concat(u," for this file"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:"# ruff: noqa: ".concat(u,`
22
- `)}}]}}));return{actions:[...i,...s,...l],dispose:()=>{}}}static handlePythonFormatRequest(e,t,r){if(L.ruffWorkspace)return et.debug("Formatting Python document: ".concat(e.uri.toString)),[{range:e.getFullModelRange(),text:L.ruffWorkspace.format(e.getValue())}]}constructor(e){super(e),Ut(this,"registeredCompletionProvider",void 0),Ut(this,"registeredSignatureProvider",void 0),Ut(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var e=this.props,t=e.language,r=e.session;this.registeredCompletionProvider=rt.registerCompletionItemProvider(t,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),r.getSignatureHelp!=null&&(this.registeredSignatureProvider=rt.registerSignatureHelpProvider(t,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),r.getHover!=null&&(this.registeredHoverProvider=rt.registerHoverProvider(t,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,r;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(r=this.registeredHoverProvider)===null||r===void 0||r.dispose()}handleCompletionRequest(e,t,r){var i=this.props,o=i.model,a=i.session;if(e!==o)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:L.monacoToLspPosition(t),context:r},l=a.getCompletionItems(s);et.debug("Requested completion items",s);var u=l.then(c=>{et.debug("Completion items received: ",s,c);var m=c.map(p=>{var f=p.label,v=p.kind,g=p.detail,b=p.documentation,y=p.sortText,C=p.filterText,S=p.textEdit,_=p.insertTextFormat;return{label:f,kind:L.lspToMonacoKind(v),detail:g,documentation:(b==null?void 0:b.kind)==="markdown"?b:b==null?void 0:b.value,sortText:y,filterText:C,insertText:S.text,insertTextRules:_===2?4:_,range:L.lspToMonacoRange(S.range)}});return{incomplete:!0,suggestions:m}}).catch(c=>(et.error("There was an error retrieving completion items",c),{suggestions:[]}));return u}handleSignatureRequest(e,t,r,i){var o={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},a=this.props,s=a.model,l=a.session;if(e!==s||l.getSignatureHelp==null)return null;var u={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:L.monacoToLspPosition(t),context:i},c=l.getSignatureHelp(u);et.debug("Requested signature help",u);var m=c.then(p=>{et.debug("Signatures received: ",u,c);var f=p.map(g=>{var b=g.label,y=g.documentation,C=g.parameters;return{documentation:(y==null?void 0:y.kind)==="markdown"?y:y==null?void 0:y.value,label:b,parameters:C??[]}});if(f.length===0)return o;var v=0;return{value:{signatures:f,activeSignature:v,activeParameter:p[v].activeParameter},dispose:()=>{}}}).catch(p=>(et.error("There was an error retrieving completion items",p),o));return m}handleHoverRequest(e,t){var r=this.props,i=r.model,o=r.session;if(e!==i||o.getHover==null)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:L.monacoToLspPosition(t)},s=o.getHover(a);et.debug("Requested hover",a);var l=s.then(u=>{et.debug("Hover received: ",a,u);var c=u.contents;return{contents:c!=null?[c]:[]}}).catch(u=>(et.error("There was an error retrieving hover",u),{contents:[]}));return l}render(){return null}}Ut(L,"ruffWorkspace",void 0);Ut(L,"initRuffPromise",void 0);Ut(L,"isRuffInitialized",!1);Ut(L,"isRuffEnabled",!0);Ut(L,"ruffSettings",$b);function La(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Bb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){La(o,r,i,a,s,"next",l)}function s(l){La(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ra(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $a(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ra(Object(t),!0).forEach(function(r){Wb(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ra(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wb(n,e,t){return(e=Kb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kb(n){var e=zb(n,"string");return typeof e=="symbol"?e:e+""}function zb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ct=H.module("MonacoUtils"),Fa="inmemory://dh-console/";class Ee{static init(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getWorker;Ct.debug("Initializing Monaco..."),t!==void 0&&Ee.registerGetWorker(t);var r=Ee.initTheme,i=Ee.registerLanguages;r(),i([Ab,Sb,Pb,Rb,Ib]),rt.onLanguage("python",()=>{rt.registerCodeActionProvider("python",{provideCodeActions:L.handlePythonCodeActionRequest},{providedCodeActionKinds:["quickfix"]}),rt.registerDocumentFormattingEditProvider("python",{provideDocumentFormattingEdits:L.handlePythonFormatRequest})}),Le.onDidCreateModel(o=>{if(o.getLanguageId()==="python"){L.ruffWorkspace!=null&&L.lintPython(o);var a=Ir(s=>L.lintPython(s),250);o.onDidChangeContent(()=>{a(o)})}}),Ee.removeConflictingKeybindings(),Ct.debug("Monaco initialized.")}static initTheme(){var e,t,r=Ee.removeHashtag,i=$s(_i);Ct.debug2("Monaco theme:",_i),Ct.debug2("Monaco theme derived:",i);var o=[{token:"",foreground:r(i.foreground)},{token:"string",foreground:r(i.string)},{token:"string.delim",foreground:r(i["string-delim"])},{token:"keyword",foreground:r(i.keyword)},{token:"identifier.js",foreground:r(i["identifier-js"])},{token:"delimiter",foreground:r(i.delimiter)},{token:"comment",foreground:r(i.comment)},{token:"number",foreground:r(i.number)},{token:"storage",foreground:r(i.storage)},{token:"identifier",foreground:r(i.identifier)},{token:"namespace.identifier",foreground:r(i["namespace-identifier"])},{token:"operator",foreground:r(i.operator)},{token:"predefined",foreground:r(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:r(i["log-warn"])},{token:"info.log",foreground:r(i["log-info"])},{token:"stdout.log",foreground:r(i["log-stdout"])},{token:"trace.log",foreground:r(i["log-trace"])},{token:"debug.log",foreground:r(i["log-debug"])},{token:"date.log",foreground:r(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"],"editorLineNumber.activeForeground":i["editor-line-number-active-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"],"diffEditor.insertedTextBackground":i["diff-editor-inserted-text-background"],"diffEditor.removedTextBackground":i["diff-editor-removed-text-background"],"diffEditor.insertedLineBackground":i["diff-editor-inserted-line-background"],"diffEditor.removedLineBackground":i["diff-editor-removed-line-background"]};Le.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:a});try{Le.setTheme("dh-dark")}catch(s){Ct.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),Le.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=$a($a({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e==null?void 0:e.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(r=>{var i=r.id;return i});rt.getLanguages().filter(r=>{var i=r.id;return t.includes(i)}).forEach(r=>{var i=r;Ct.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{Ee.registerLanguage(r)})}static registerLanguage(e){Ct.debug2("Registering language: ",e.id),rt.register(e),rt.onLanguage(e.id,()=>{rt.setLanguageConfiguration(e.id,e.conf),rt.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Le.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();B(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};Ct.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var o=e.onDidChangeModelContent(a=>{for(var s=a.changes,l=a.versionId,u=[],c=0;c<s.length;c+=1){var m=s[c],p=m.range,f=m.rangeLength,v=m.text,g={range:{start:{line:p.startLineNumber-1,character:p.startColumn-1},end:{line:p.endLineNumber-1,character:p.endColumn-1}},rangeLength:f,text:v};u.push(g)}if(u.length>0){var b={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:u};Ct.debug2("didChangeDocumentParams",b),t.changeDocument(b)}});return o}static closeDocument(e,t){var r=e.getModel();B(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,o=/\u00A0/g,a=e.getModel();B(a);var s=a.getValueInRange(t.range);(r.test(s)||i.test(s)||o.test(s))&&a.applyEdits([{range:t.range,text:s.replace(r,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var e=window.navigator.platform;return e.startsWith("Mac")}static removeConflictingKeybindings(){Le.addKeybindingRule({keybinding:nt.CtrlCmd|en.KeyD,command:null}),Ee.isMacPlatform()||Le.addKeybindingRule({keybinding:nt.CtrlCmd|en.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(Pt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var t=e.keyState,r=t.keyValue;if(r===null)return 0;var i=Ee.isMacPlatform();return i?(t.metaKey?nt.CtrlCmd:0)|(t.shiftKey?nt.Shift:0)|(t.altKey?nt.Alt:0)|(t.ctrlKey?nt.WinCtrl:0)|ao.fromString(r):(t.ctrlKey?nt.CtrlCmd:0)|(t.shiftKey?nt.Shift:0)|(t.altKey?nt.Alt:0)|(t.metaKey?nt.WinCtrl:0)|ao.fromString(r)}static provideLinks(e){for(var t=[],r=function(a){var s=e.getLineContent(a),l=kd(s),u=l.filter(c=>c.type==="url"?/^https?:\/\//.test(c.value):!0);u.forEach(c=>{t.push({url:c.href,range:new Gs(a,c.start+1,a,c.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}static generateConsoleUri(){return Ad.parse("".concat(Fa).concat(Pt()))}static isConsoleModel(e){return e.uri.toString().startsWith(Fa)}static canFormat(e){var t;return((t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.isSupported())===!0}static formatDocument(e){return Bb(function*(){var t;yield(t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.run()})()}}function Ha(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Vb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ha(o,r,i,a,s,"next",l)}function s(l){Ha(o,r,i,a,s,"throw",l)}a(void 0)})}}function qe(n,e,t){return(e=Gb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gb(n){var e=qb(n,"string");return typeof e=="symbol"?e:e+""}function qb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qr=H.module("ConsoleInput"),Tr=parseInt(_i["line-height"],10),Cu=6,Su=6,Xb=Tr+Cu+Su,Jr=100;class Tn extends h.PureComponent{constructor(e){super(e),qe(this,"cancelListener",void 0),qe(this,"resizeObserver",void 0),qe(this,"commandContainer",void 0),qe(this,"commandEditor",void 0),qe(this,"commandHistoryIndex",void 0),qe(this,"commandSuggestionContainer",void 0),qe(this,"loadingPromise",void 0),qe(this,"timestamp",void 0),qe(this,"bufferIndex",void 0),qe(this,"history",void 0),qe(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=j.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={commandEditorHeight:Tr,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){this.resizeObserver.disconnect(),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(Qr.debug("Command received: ",e),!r){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),r&&this.processCommand(e)}}initCommandEditor(){var e=this.props,t=e.language,r=e.session,i=Le.createModel("",t,Ee.generateConsoleUri()),o={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:t,lineHeight:Tr,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Cu,bottom:Su},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace",model:i},a=this.commandContainer.current;B(a),this.commandEditor=Le.create(a,o),Ee.setEOL(this.commandEditor),Ee.openDocument(this.commandEditor,r),this.commandEditor.onDidChangeModelContent(()=>{var s,l=(s=this.commandEditor)===null||s===void 0?void 0:s.getValue();this.modifiedCommands.set(this.commandHistoryIndex,l??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(s=>{var l=this.commandEditor,u=this.commandHistoryIndex,c=l==null?void 0:l.getPosition();B(c);var m=c.lineNumber;if(!s.altKey&&!s.shiftKey&&!s.metaKey){if(s.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&m===1){u!=null?this.loadCommand(u+1):this.loadCommand(0),this.focusStart(),s.stopPropagation(),s.preventDefault();return}if(s.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&m===(i==null?void 0:i.getLineCount())){u!=null&&u>0?this.loadCommand(u-1):this.loadCommand(null),this.focusEnd(),s.stopPropagation(),s.preventDefault();return}if(s.keyCode===en.Enter&&!this.isSuggestionMenuPopulated()){var p;s.stopPropagation(),s.preventDefault();var f=(p=this.commandEditor)===null||p===void 0?void 0:p.getValue().trim();if(f!==void 0){var v;this.processCommand(f),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}}),Ee.disableKeyBindings(this.commandEditor,[nt.CtrlCmd|en.KeyF]),Ee.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(a),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var e=this.props.session;this.commandEditor&&(Ee.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(t=t.getDomNode())===null||t===void 0?void 0:t.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(t=t.querySelector(".monaco-list-rows"))===null||t===void 0?void 0:t.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,r,i,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();B(a);var s=a.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,s);B(l),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:1,column:s}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,r,i,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();B(a);var s=a.getLineCount(),l=a.getLineLength(s)+1,u=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(s,l);B(u),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:s,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(u),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),i=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(r??i),e!==null&&e>this.history.length-Jr&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Vb(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var t=e.props,r=t.commandHistoryStorage,i=t.language,o=t.scope;e.loadingPromise=Ye.makeCancelable(r.getTable(i,o??"",e.timestamp),l=>l.close());var a=yield e.loadingPromise;a.setReversed(!0),a.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+Jr-1}),e.loadingPromise=Ye.makeCancelable(a.getViewportData(),()=>a.close());var s=yield e.loadingPromise;e.bufferIndex+=Jr,e.bufferIndex>=a.size&&(e.bufferIndex=null),e.history=[...s.items.filter((l,u,c)=>{var m=l.name;return u===0||m!==c[u-1].name}).map(l=>{var u=l.name;return u}).reverse(),...e.history],e.loadingPromise=void 0,a.close()}catch(l){if(e.loadingPromise=void 0,Ye.isCanceled(l)){Qr.debug2("Promise canceled, not loading history");return}Qr.error("Error fetching history",l)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),B(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var t=this.props.onSubmit;t(e)}updateDimensions(){if(this.commandEditor){var e=this.props.maxHeight;B(e);var t=this.commandEditor.getContentHeight(),r=Math.max(Math.min(t,e),Xb),i=t>r,o={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:r},()=>{var a,s;(a=this.commandEditor)===null||a===void 0||a.updateOptions(o),(s=this.commandEditor)===null||s===void 0||s.layout()})}}render(){var e=this.props,t=e.disabled,r=e.language,i=e.session,o=this.state,a=o.commandEditorHeight,s=o.isFocused,l=o.model;return d.jsx("div",{className:U("console-input-wrapper",{disabled:t}),children:d.jsxs("div",{className:U("console-input-inner-wrapper",{focus:s}),children:[d.jsx("div",{className:Tn.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:a}}),l&&d.jsx(L,{model:l,language:r,session:i})]})})}}qe(Tn,"defaultProps",{maxHeight:Tr*10,scope:null,disabled:!1});qe(Tn,"INPUT_CLASS_NAME","console-input");function $t(n,e,t){return(e=Zb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zb(n){var e=Yb(n,"string");return typeof e=="symbol"?e:e+""}function Yb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ua="pasted values",Qb=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],ei=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Ba=[".zip"];class Re extends h.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!Qb.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ei.some(r=>e.endsWith(r))||t&&Ba.some(r=>e.endsWith(r))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===Ua?eo:e.endsWith(".csv")?Qu:e.endsWith(".zip")?Ju:ed}constructor(e){super(e),$t(this,"fileElem",void 0),$t(this,"divElem",void 0),$t(this,"getValidExtensions",Cn(t=>t?[...ei,...Ba]:[...ei])),$t(this,"getAcceptString",Cn(t=>this.getValidExtensions(t).join(", "))),$t(this,"getFileTypeErrorString",Cn(t=>pc.join(this.getValidExtensions(t),"or"))),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=j.createRef(),this.divElem=j.createRef(),this.state={selectedFileName:""}}componentDidMount(){var e,t;(e=this.divElem.current)===null||e===void 0||e.addEventListener("paste",this.handlePasteEvent),(t=this.divElem.current)===null||t===void 0||t.focus()}componentWillUnmount(){var e;(e=this.divElem.current)===null||e===void 0||e.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){if(this.fileElem.current){var e;this.fileElem.current.value="",(e=this.fileElem.current)===null||e===void 0||e.click()}}handleFiles(e){e.stopPropagation(),e.preventDefault();var t=e.target.files;t!=null&&this.handleFile(t[0])}handleDrop(e){var t=this.props,r=t.allowZip,i=t.clearDragError,o=t.dragError;if(e.preventDefault(),e.stopPropagation(),o!=null){i();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var a=e.dataTransfer.items[0].getAsFile();B(a),Re.isValidExtension(a.name,r)?this.handleFile(a):this.setState({dropError:Re.FILE_TYPE_ERROR})}}unstageFile(e){var t=this.props.onCancel;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var t=this.props.onFileOpened;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var e=this.props,t=e.onPaste,r=e.onError,i=e.uploadInProgress;i||navigator.clipboard.readText().then(o=>{t(o),this.setState({selectedFileName:Ua,dropError:void 0})}).catch(o=>r(o))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var e=this.props.uploadInProgress;return[{title:"Paste",icon:eo,action:this.handleMenuPaste,shortcut:bn.PASTE,disabled:e}]}render(){var e=this.props,t=e.allowZip,r=e.dragError,i=e.uploadInProgress,o=this.state,a=o.selectedFileName,s=o.dropError,l=r??s,u=this.makeContextMenuItems();return d.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Re.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[d.jsx(ue,{actions:u}),d.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(t),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!a&&(l===void 0||l==="")&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(me,{icon:td})}),d.jsx("label",{children:"Drop file (or paste values) here to import"}),d.jsx("div",{className:"message-small",children:d.jsx("label",{children:"or"})}),d.jsx(ne,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),a&&(l===void 0||l==="")&&d.jsxs("div",{className:"selected-content",children:[d.jsx("div",{className:"selected-icon",children:d.jsx(me,{icon:Re.getIcon(a)})}),d.jsxs("div",{className:"selected-text",children:[d.jsx("label",{children:"Selected File"}),d.jsxs("label",{className:"selected-name",children:[a,!i&&d.jsx(ne,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:nd,tooltip:"Remove"})]})]})]}),!!l&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(me,{icon:Us})}),d.jsx("label",{children:l}),l===Re.FILE_TYPE_ERROR&&d.jsx("div",{className:"message-small",children:d.jsx("label",{children:this.getFileTypeErrorString(t)})})]})]})}}$t(Re,"defaultProps",{allowZip:!1,dragError:null});$t(Re,"MULTIPLE_FILE_ERROR","Please select only one file");$t(Re,"FILE_TYPE_ERROR","Filetype not supported.");function wu(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(r,i)=>e(i)),t}function Wa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ka(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wa(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return(e=Jb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jb(n){var e=ey(n,"string");return typeof e=="symbol"?e:e+""}function ey(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var za="unknown",ty=2147483647,ny=-2147483648,Va=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,Ga=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Oe{static determineType(e,t,r){if(!e||e===r)return t;switch(t){case K.STRING:return K.STRING;case K.INTEGER:return Oe.checkInteger(e);case K.LONG:return Oe.checkLong(e);case K.DOUBLE:return Oe.checkDouble(e);case K.BOOLEAN:return Oe.checkBoolean(e);case K.DATE_TIME:return Oe.checkDateTime(e);case K.LOCAL_TIME:return Oe.checkLocalTime(e);default:return Oe.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return Oe.isNotParsableNumber(t)?K.STRING:Oe.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return Oe.isNotParsableNumber(t)?K.STRING:t.includes(".")?K.DOUBLE:K.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return Oe.isNotParsableNumber(t)?K.STRING:K.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?K.BOOLEAN:K.STRING}static checkDateTime(e){return Va.test(e)?K.DATE_TIME:K.STRING}static checkLocalTime(e){return Ga.test(e)?K.LOCAL_TIME:K.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(Oe.isNotParsableNumber(t)){var r=e.toLowerCase();return r==="true"||r==="false"?K.BOOLEAN:Va.test(e)&&e.includes(":")?K.DATE_TIME:Ga.test(e)?K.LOCAL_TIME:K.STRING}return Oe.getNumberType(t)}static getNumberType(e){if(e.includes("."))return K.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return K.LONG;var r=parseInt(e,10);return r>ty||r<ny?K.LONG:K.INTEGER}constructor(e,t,r,i,o,a,s,l,u,c){Ae(this,"onFileCompleted",void 0),Ae(this,"file",void 0),Ae(this,"readHeaders",void 0),Ae(this,"nullString",void 0),Ae(this,"onProgress",void 0),Ae(this,"onError",void 0),Ae(this,"types",void 0),Ae(this,"chunks",void 0),Ae(this,"totalChunks",void 0),Ae(this,"rowCount",void 0),Ae(this,"isZip",void 0),Ae(this,"shouldTrim",void 0),Ae(this,"zipProgress",void 0),Ae(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=r,this.nullString=o,this.onProgress=a,this.onError=s,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=u,this.shouldTrim=c,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config=Ka(Ka({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)Nn.parse(this.file,this.config);else{var e=wu(this.file,this.handleNodeUpdate);Nn.parse(e,this.config),e.resume()}}handleChunk(e,t){var r=e.data;if(!this.types){if(r==null||r.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(r[0].length).fill(za),this.readHeaders&&(r=r.slice(1))}this.rowCount+=r.length,B(this.types);var i=[...this.types];r.forEach(s=>{if(s.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=Oe.determineType(this.shouldTrim?s[l].trim():s[l],i[l],this.nullString);this.types=i}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-CxolyxAB.js","./Plotly-CrH1R1wr.js","./plotly-g-Pezqd_.js","./helpers-BosuxZz1.js","./vendor-Iv4yoqlt.js","./vendor-BSYTbjlr.css"])))=>i.map(i=>d[i]);
2
+ import{ao as Mu,a as H,aO as As,T as ju,X as Au,Y as ku,V as Nu,a4 as Lu,O as Ru,z as $u,a8 as Fu,d as ks,G as Ns,e as Ls,q as Hu,aP as Uu,aH as Bu,aQ as Rs,aR as Wu,aS as Ku,L as Kn,ac as zu,_ as Vu,aT as $s,u as W,t as Fs,Z as Gu,aU as qu,aN as Xu,aJ as Hs,aK as Zu,f as Us,n as Yu,aL as ai,aV as Qu,aW as Ju,aX as to,aY as ed,aZ as td,a_ as nd,a$ as rd,v as id,k as Bs,aF as od,h as Gr,aA as ad,b0 as sd,b1 as no,aD as ld,b2 as ro,b3 as Ws,b4 as ud,au as dd,b5 as cd,b6 as hd,b7 as md,b8 as pd,b9 as fd,ba as vd}from"./index-jF_4wnuH.js";import{r as m,as as zn,bE as Mr,D as d,bU as gd,J as k,G as U,bV as Ks,bW as si,H as bd,R as xi,bX as yd,bG as Sd,I as me,C as Pt,bY as Cd,aj as _d,ak as wd,E as zs,ar as vn,bZ as Ed,b_ as Pd,b$ as Td,c0 as Od,bR as li,c1 as O,c2 as io,bT as pe,L as Vs,N as Gs,c3 as Id,bS as Vn,bO as _n,_ as xd,bp as Re,c4 as Dd,an as Md,aH as jd,bs as oo,c5 as Ad,c6 as ao,br as rt,c7 as qs,c8 as kd,bP as nt,bQ as tn,c9 as so,bq as Nd,bN as Ld,ca as Fn}from"./vendor-Iv4yoqlt.js";var Rd=Object.freeze([]),wS=new Map,Xs=()=>{};function ES(n){return Array.isArray(n)?n:[n]}function PS(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function $d(n,e,t){return(e=Fd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fd(n){var e=Hd(n,"string");return typeof e=="symbol"?e:e+""}function Hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lo extends Error{constructor(){super(...arguments),$d(this,"isCanceled",!0)}}function Ud(n,e,t){return(e=Bd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bd(n){var e=Wd(n,"string");return typeof e=="symbol"?e:e+""}function Wd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kd extends Error{constructor(){super(...arguments),Ud(this,"isClipboardPermissionsDeniedError",!0)}}function zd(n,e,t){return(e=Vd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vd(n){var e=Gd(n,"string");return typeof e=="symbol"?e:e+""}function Gd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qr extends Error{constructor(){super(...arguments),zd(this,"isClipboardUnavailableError",!0)}}function qd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zs extends Error{constructor(){super(...arguments),qd(this,"isPermissionUnsupported",!0)}}function uo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Yd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){uo(o,r,i,a,s,"next",l)}function s(l){uo(o,r,i,a,s,"throw",l)}a(void 0)})}}function co(n){return ui.apply(this,arguments)}function ui(){return ui=Yd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Zs:t}}),ui.apply(this,arguments)}function ho(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ys(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ho(o,r,i,a,s,"next",l)}function s(l){ho(o,r,i,a,s,"throw",l)}a(void 0)})}}function Qs(n){return di.apply(this,arguments)}function di(){return di=Ys(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}Qd(n)}),di.apply(this,arguments)}function Qd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function TS(){return ci.apply(this,arguments)}function ci(){return ci=Ys(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new qr;var t=yield co("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield co("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new Kd}catch(o){throw o instanceof Zs?new qr:o}throw new qr}),ci.apply(this,arguments)}var Mn;function on(n,e,t){return(e=Jd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jd(n){var e=ec(n,"string");return typeof e=="symbol"?e:e+""}function ec(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tc="table_",Js="column_",nc=new Set(["in","not","i","ii","k"]),rc=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"]),ic=/[^a-zA-Z0-9_$\-+@]/g,oc=/[^A-Za-z0-9_$]/g,ac=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,sc=/[^a-zA-Z0-9_]/g;function lc(n){return n.replace(/[ -]/g,"_")}function uc(n){return n.replace(/\s/g,"_")}class gt{}Mn=gt;on(gt,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(nc.has(a)||rc.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});on(gt,"legalizeTableName",n=>Mn.legalize(n,uc,tc,ic,!1,0));on(gt,"makeVariableName",n=>Mn.legalizeTableName(n).replace(sc,"_"));on(gt,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Mn.legalizeColumnName(t,r);e.includes(i)&&(i=Js+r),e.push(i)}),e});on(gt,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Mn.legalize(n,lc,Js,oc,!0,e)});on(gt,"isValidTableName",n=>ac.test(n));on(gt,"isValidColumnName",n=>Mn.legalizeColumnName(n)===n);class el extends CustomEvent{constructor(e,t){super(e,t)}}class Qe{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new lo),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof lo}static isTimedOut(e){return e instanceof Mu}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function mo(n,e,t){return(e=dc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jr{constructor(){mo(this,"pending",[]),mo(this,"resolved",[])}add(e,t){var r=Qe.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}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=[]}}function OS(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function po(n,e){return fc(n)||pc(n,e)||mc(n,e)||hc()}function hc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mc(n,e){if(n){if(typeof n=="string")return fo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fo(n,e):void 0}}function fo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function pc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function fc(n){if(Array.isArray(n))return n}class lt{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(!lt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(u<=i&&o<=c)return a;i<=c&&u<=o&&(i=Math.min(i,u),o=Math.max(o,c),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(!(o<u||c<i))if(u<i&&o<c){a[s]=[u,i-1],a.splice(s+1,0,[o+1,c]);break}else i<=u&&c<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+1,c]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*IS(n,e){for(var t=n;t<=e;++t)yield t}var xS=" ";class vc{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 r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var Gn;function Wt(n,e,t){return(e=gc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gc(n){var e=bc(n,"string");return typeof e=="symbol"?e:e+""}function bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(He.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])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}Gn=He;Wt(He,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Wt(He,"MILLIS_PER_SECOND",1e3);Wt(He,"NANOS_PER_SECOND",1e9);Wt(He,"NANOS_PER_MIN",60*Gn.NANOS_PER_SECOND);Wt(He,"NANOS_PER_HOUR",60*Gn.NANOS_PER_MIN);Wt(He,"MILLIS_PER_MIN",60*Gn.MILLIS_PER_SECOND);Wt(He,"MILLIS_PER_HOUR",60*Gn.MILLIS_PER_MIN);Wt(He,"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"}]));function yc(n,e,t){return(e=Sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:e+""}function Cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hn extends Error{constructor(){super(...arguments),yc(this,"isInvalid",!0)}}function tl(){var n=m.useRef(!1);return m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function vo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function _c(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){vo(o,r,i,a,s,"next",l)}function s(l){vo(o,r,i,a,s,"throw",l)}a(void 0)})}}var wc=H.module("useAsyncInterval");function Ec(n,e){var t=tl(),r=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(_c(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(h){wc.error("A tick error occurred:",h)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),c=Math.max(0,e-u);r.current=window.setTimeout(a,c)}}),[n,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function qn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=m.useContext(n);if(t==null)throw new Error(e);return t}function Pc(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=m.useMemo(()=>zn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return m.useEffect(()=>()=>l.cancel(),[l]),l}function Tc(n){var e=m.useRef();return m.useEffect(function(){e.current=n}),e.current}function Oc(n,e,t){var r=m.useRef(t),i=m.useRef(n);i.current=n;var o=m.useMemo(()=>Mr(function(){return i.current(...arguments)},e,r.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function nl(n){var e=m.useRef(null);return m.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Ic(n,e){return jc(n)||Mc(n,e)||Dc(n,e)||xc()}function xc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dc(n,e){if(n){if(typeof n=="string")return go(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?go(n,e):void 0}}function go(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Mc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jc(n){if(Array.isArray(n))return n}var Ac=3500,kc=H.module("useCopyToClipboard");function Nc(){var n=m.useState(!1),e=Ic(n,2),t=e[0],r=e[1],i=m.useRef(null),o=m.useCallback(a=>{Qs(a).then(()=>{r(!0)}).catch(s=>kc.error("Unable to copy ".concat(a),`
5
+ `,s))},[]);return m.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},Ac)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var Lc=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function Rc(n){return typeof n=="string"&&Lc.includes(n)}function rl(n){return n!=null&&Rc(n)?"var(--dh-color-".concat(n,")"):n}var $c=["color","UNSAFE_style"];function bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bo(Object(t),!0).forEach(function(r){Fc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fc(n,e,t){return(e=Hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hc(n){var e=Uc(n,"string");return typeof e=="symbol"?e:e+""}function Uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bc(n,e){if(n==null)return{};var t,r,i=Wc(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Wc(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var il=m.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=Bc(n,$c),o=m.useMemo(()=>ar(ar({},r),{},{color:rl(t)}),[t,r]);return d.jsx(gd,ar(ar({},i),{},{ref:e,UNSAFE_style:o}))});il.displayName="Text";function yo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yo(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gn(n,e,t){return(e=Kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kc(n){var e=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var So="popper",Vc="popper-container",Gc={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Ks.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class Ar extends m.Component{constructor(e){super(e),gn(this,"element",void 0),gn(this,"container",void 0),gn(this,"nodeRef",k.createRef()),gn(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.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=k.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=U(Vc,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,c=u?Gc:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},h=jt(jt(jt({},c),l),{},{modifiers:jt(jt(jt({},c.modifiers),l.modifiers),{},{preventOverflow:jt(jt({},(e=c.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var p=this.getVisibleElement(this.container.current);p==null&&(p=this.container.current);var f=new Ks(a||p,this.element,h);f.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var v=this.element.querySelector(".".concat(So));v instanceof HTMLElement&&!v.contains(document.activeElement)&&v.focus()}}),si.flushSync(()=>{this.setState({popper:f})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),si.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=this.state.show;return d.jsx(As,{isPortal:!0,children:d.jsx(bd,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:d.jsx("div",{ref:this.nodeRef,onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:U(So,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[r,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&xi.createPortal(this.renderContent(),this.element)})}}gn(Ar,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:ju.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var hi;function Co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=Xc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(n){var e=Zc(n,"string");return typeof e=="symbol"?e:e+""}function Zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yc=H.module("Tooltip");class ue extends m.Component{static handleHidden(){ue.shownTooltipCount-=1,ue.shownTooltipCount===0&&(ue.lastHiddenTime=Date.now())}static handleShown(){ue.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(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=k.createRef(),this.popper=k.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?ue.handleShown():ue.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&ue.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Yc.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 e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;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&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(ue.shownTooltipCount>0||Date.now()-ue.lastHiddenTime<ue.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),si.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=qc({placement:"bottom"},u),d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:d.jsx(Ar,{className:U(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:d.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}hi=ue;ut(ue,"defaultTimeout",500);ut(ue,"defaultReshowTimeout",100);ut(ue,"triggerReshowThreshold",300);ut(ue,"shownTooltipCount",0);ut(ue,"lastHiddenTime",Date.now());ut(ue,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:hi.defaultReshowTimeout,timeout:hi.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function _o(n,e){return th(n)||eh(n,e)||Jc(n,e)||Qc()}function Qc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jc(n,e){if(n){if(typeof n=="string")return wo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wo(n,e):void 0}}function wo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function th(n){if(Array.isArray(n))return n}var nh=H.module("ThemeProvider"),Di=m.createContext(null);Di.displayName="ThemeContext";function DS(n){var e=n.themes,t=n.waitForActivation,r=t===void 0?!1:t,i=n.defaultPreloadValues,o=i===void 0?$u:i,a=n.children,s=m.useMemo(()=>Au(),[]),l=m.useState(null),u=_o(l,2),c=u[0],h=u[1],p=m.useState(ku),f=_o(p,2),v=f[0],g=f[1],b=m.useMemo(()=>e==null?null:Nu(v,{base:s,custom:e??[]}),[s,v,e]),y=m.useMemo(()=>[...s,...e??[]],[s,e]);return m.useEffect(function(){if(!(b==null||e==null)){Lu(o);var C=Ru(o);nh.debug2("updateThemePreloadData:",{active:b.map(_=>_.themeKey),custom:e.map(_=>_.themeKey),preloadStyleContent:C,selectedThemeKey:v}),Fu({themeKey:v,preloadStyleContent:C})}},[b,v,e,o]),m.useEffect(()=>{h({activeThemes:b,selectedThemeKey:v,themes:y,setSelectedThemeKey:g})},[b,v,y]),r&&b==null?null:d.jsxs(d.Fragment,{children:[b==null?null:d.jsx(d.Fragment,{children:b.map(S=>d.jsx("style",{"data-theme-key":S.themeKey,children:S.styleContent},S.themeKey))}),c==null?null:d.jsx(Di.Provider,{value:c,children:d.jsx(As,{children:a})})]})}function ol(){return qn(Di,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var rh=["color","UNSAFE_style"];function Eo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function sr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(t),!0).forEach(function(r){ih(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ih(n,e,t){return(e=oh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oh(n){var e=ah(n,"string");return typeof e=="symbol"?e:e+""}function ah(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function sh(n,e){if(n==null)return{};var t,r,i=lh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function lh(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var al=m.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=sh(n,rh),o=m.useMemo(()=>sr(sr({},r),{},{color:rl(t)}),[t,r]);return d.jsx(yd,sr(sr({},i),{},{ref:e,UNSAFE_style:o}))});al.displayName="Heading";function uh(n){var e=n.children,t=n.className,r=n.style,i=n["data-testid"];return d.jsx("div",{className:U("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var dh=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Po(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function To(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Po(Object(t),!0).forEach(function(r){ch(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Po(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ch(n,e,t){return(e=hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ph(n,e){if(n==null)return{};var t,r,i=fh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function fh(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function vh(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return U("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function gh(n){switch(n){case"group-end":return U("pl-2","pr-3")}}var ne=k.forwardRef((n,e)=>{var t=n.kind,r=n.variant,i=n.type,o=i===void 0?"button":i,a=n.tooltip,s=n.icon,l=n.disabled,u=l===void 0?!1:l,c=n.active,h=n.onClick,p=n.onContextMenu,f=n.onMouseDown,v=n.onMouseUp,g=n.onMouseEnter,b=n.onMouseLeave,y=n.onKeyDown,S=n.className,C=n.style,_=n.children,w=n.tabIndex,D=n["data-testid"],B=n["aria-label"],N=ph(n,dh),x=Sd({},"button"),j=x.UNSAFE_className,L;r&&(L=gh(r));var re;s&&(re=k.isValidElement(s)?s:d.jsx(me,{icon:s}));var A=re!=null&&_==null,q=vh(t,A),ie;a!==void 0&&(ie=typeof a=="string"?d.jsx(ue,{children:a}):a);var oe=B;B===void 0&&A&&a!=null&&typeof a=="string"&&(oe=a);var be=d.jsxs("button",To(To({"data-testid":D,ref:e,type:o,className:U("btn",q,L,{active:c},S,j),onClick:h,onContextMenu:p,onMouseUp:v,onMouseDown:f,onMouseEnter:g,onMouseLeave:b,onKeyDown:y,style:C,disabled:u,tabIndex:w,"aria-label":oe},N),{},{children:[s&&re,_,a!=null&&!u&&ie]}));return u&&a!=null?d.jsxs("span",{className:"btn-disabled-wrapper",children:[be,ie]}):be});ne.displayName="Button";function sl(n){var e=n.className,t=n.children,r=n["data-testid"];return d.jsx("div",{className:U("modal-footer",e),"data-testid":r,children:t})}function mi(n){var e=n.isOpen,t=n.headerText,r=n.bodyText,i=n.onCancel,o=n.onConfirm,a=n.onDiscard,s=n.onModalDisable,l=n.cancelButtonText,u=l===void 0?"Cancel":l,c=n.confirmButtonText,h=c===void 0?"Okay":c,p=n.discardButtonText,f=p===void 0?"Discard":p,v=n.isConfirmDanger,g=v===void 0?!1:v,b=n.children,y=n["data-testid"],S=m.useRef(null),C=m.useRef(null),_=m.useCallback(()=>{C.current!==null&&C.current.checked&&s&&s(),o()},[o,s]),w=m.useCallback(()=>{var B;(B=S.current)===null||B===void 0||B.focus()},[]),D="";return e&&(D=typeof r=="function"?r():r),d.jsxs(ks,{isOpen:e,onOpened:w,children:[d.jsx(Ns,{closeButton:!1,children:t}),d.jsx(Ls,{children:D}),d.jsxs(sl,{children:[s&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:C,"data-testid":y!==void 0?"".concat(y,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&d.jsx(ne,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":y!==void 0?"".concat(y,"-btn-discard"):void 0,children:f}),i&&d.jsx(ne,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":y!==void 0?"".concat(y,"-btn-cancel"):void 0,children:u}),d.jsxs(uh,{children:[d.jsx(ne,{kind:g?"danger":"primary",onClick:_,ref:S,"data-testid":y!==void 0?"".concat(y,"-btn-confirm"):void 0,children:h}),b]})]})]})}function bh(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Xr(n){return n.then!==void 0}class ge{static disableAllActions(){ge.actionsDisabled=!0}static enableAllActions(){ge.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,i;return((r=e.group)!==null&&r!==void 0?r: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(ge.compareActions),t}static isMacPlatform(){var e=window.navigator.platform;return e.startsWith("Mac")}static getModifierKey(){return ge.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ge.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],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&&r.push(s):Array.isArray(s)?r=r.concat(s):r.push(s))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var o=1;o<r.length+1;o+=1){var a=(i+t*o+r.length)%r.length,s=r[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}bh(ge,"actionsDisabled",!1);var Oo=H.module("GlobalContextAction");class Ch extends m.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 r=this.props.action;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Oo.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var t=this.props.action;if(!ge.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Oo.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class _h extends m.Component{render(){for(var e=this.props,t=e.actions,r=e["data-testid"],i=[],o=0;o<t.length;o+=1){var a=t[o],s=a.shortcut;if(a.title!=null||a.menuElement||s){var l=d.jsx(Ch,{action:a,"data-testid":r},"".concat(a.title,".").concat(s==null?void 0:s.id));i.push(l)}}return i}}function ll(n,e,t){return(e=wh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wh(n){var e=Eh(n,"string");return typeof e=="symbol"?e:e+""}function Eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var lr=H.module("ContextActions");class de extends m.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),ll(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=k.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=>!Xr(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!Xr(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var t=this.props.ignoreClassNames,r=t===void 0?[]:t;if(r.length>0){for(var i=e.target,o=function(){var c=i,h=c.classList,p=r.find(f=>h.contains(f));if(p!==void 0)return lr.debug2('Contextmenu event ignored based on the target className "'.concat(p,'"')),{v:void 0};i=i.parentElement},a;i!=null;)if(a=o(),a)return a.v}if(ge.isContextActionEvent(e)||(e.contextActions=[]),!!ge.isContextActionEvent(e)){var s=this.props.actions;if(s!=null){var l=s;Array.isArray(l)&&(l=l.filter(u=>Xr(u)||typeof u=="function"||u.isGlobal===void 0||!u.isGlobal)),e.contextActions=e.contextActions.concat(l)}lr.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var t=this.state.keyboardActions,r=0;r<t.length;r+=1){var i=t[r];if(!ge.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;lr.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),lr.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var e=this.props["data-testid"],t=this.state.globalActions;return d.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:d.jsx(_h,{actions:t})})}}ll(de,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var ul=k.forwardRef((n,e)=>{var t,r,i=n.closeMenu,o=n.children,a=n.menuItem,s=n.onMenuItemClick,l=n.onMenuItemMouseMove,u=n.onMenuItemContextMenu,c=n.isKeyboardSelected,h=c===void 0?!1:c,p=n.isMouseSelected,f=p===void 0?!1:p,v=n["data-testid"],g=m.useCallback(A=>{s(a,A)},[a,s]),b=m.useCallback(A=>{l(a,A)},[a,l]),y=m.useCallback(A=>{u(a,A)},[a,u]);function S(A,q,ie){if(typeof A.type=="string")return A;var oe={menuItem:a,closeMenu:i,isKeyboardSelected:h,isMouseSelected:f,iconElement:q,displayShortcut:ie,"data-testid":v};return k.cloneElement(A,{forwardedProps:oe})}var C=(t=a.shortcutText)!==null&&t!==void 0?t:(r=a.shortcut)===null||r===void 0?void 0:r.getDisplayText(),_=null;if(a.icon){var w=a.icon;if(k.isValidElement(w))_=w;else{var D;a.iconColor!=null&&(a.disabled===void 0||!a.disabled)&&(D={color:a.iconColor}),_=d.jsx(me,{icon:w,style:D})}}var B=null,N=!!o;a.actions&&(B=d.jsx(me,{icon:Hu}));var x=null;if(a.menuElement)x=d.jsx("div",{className:"custom-menu-item",onMouseMove:b,children:S(a.menuElement,_,C)});else{var j,L=a.disabled,re=a.iconOutline;x=d.jsx("button",{type:"button",className:U("btn-context-menu",{disabled:L},{active:(N||f)&&(L===void 0||!L)},{"keyboard-active":h&&(L===void 0||!L)}),onClick:g,onMouseMove:b,onContextMenu:y,title:(j=a.description)!==null&&j!==void 0?j:"",children:d.jsxs("div",{className:"btn-context-menu-wrapper",children:[d.jsx("span",{className:U("icon",{outline:re}),children:_}),d.jsx("span",{className:"title",children:a.title}),C!==void 0&&d.jsx("span",{className:"shortcut",children:C}),B&&d.jsx("span",{className:U("submenu-indicator",{disabled:L}),children:B})]})})}return d.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":v,children:[o,x]})});ul.displayName="ContextMenuItem";function Ph(n,e){return xh(n)||Ih(n,e)||Oh(n,e)||Th()}function Th(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oh(n,e){if(n){if(typeof n=="string")return Io(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Io(n,e):void 0}}function Io(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ih(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function xh(n){if(Array.isArray(n))return n}var dl=k.forwardRef((n,e)=>{var t=n.checked,r=t===void 0?!1:t,i=n.children,o=n.className,a=n.disabled,s=a===void 0?!1:a,l=n.inputClassName,u=n.isInvalid,c=u===void 0?!1:u,h=n.labelClassName,p=n.name,f=n.onChange,v=n["data-testid"],g=m.useState(Pt()),b=Ph(g,1),y=b[0],S=nl(e);m.useEffect(function(){S.current&&(S.current.indeterminate=r===null)},[S,r]);var C=m.useCallback(_=>{S.current&&(S.current.indeterminate=r===null),f&&f(_)},[S,r,f]);return d.jsxs("div",{className:U("custom-control custom-checkbox",o),children:[d.jsx("input",{type:"checkbox",ref:S,checked:r??!1,className:U("custom-control-input",l,{"is-invalid":c}),disabled:s,id:y,name:p,onChange:C,"data-testid":v}),d.jsx("label",{className:U("custom-control-label",h),htmlFor:y,children:i})]})});dl.displayName="Checkbox";function wr(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function cl(n){return wr(n)&&cl(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function Dh(n){return!wr(n)&&"$$typeof"in n&&n.$$typeof===Cd.ForwardRef}function hl(n){return cl(n)||Dh(n)}var Mh=["copy","tooltip","children"];function xo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Do(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xo(Object(t),!0).forEach(function(r){jh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function jh(n,e,t){return(e=Ah(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ah(n){var e=kh(n,"string");return typeof e=="symbol"?e:e+""}function kh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Nh(n,e){return Fh(n)||$h(n,e)||Rh(n,e)||Lh()}function Lh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rh(n,e){if(n){if(typeof n=="string")return Mo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Mo(n,e):void 0}}function Mo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function $h(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Fh(n){if(Array.isArray(n))return n}function Hh(n,e){if(n==null)return{};var t,r,i=Uh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Uh(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var jo="Copy";function ml(n){var e=n.copy,t=n.tooltip,r=t===void 0?jo:t,i=n.children,o=Hh(n,Mh),a=Nc(),s=Nh(a,2),l=s[0],u=s[1],c=l?"Copied":r;return d.jsxs(_d,Do(Do({},o),{},{"aria-label":c,onPress:()=>{u(typeof e=="function"?e():e)},children:[d.jsx(wd,{UNSAFE_className:i==null?"action-button-icon-with-tooltip":void 0,children:d.jsx(me,{icon:l?Uu:Bu})}),i!=null&&d.jsx(il,{children:i}),(i==null||c!==jo)&&d.jsx(ue,{children:c})]}))}ml.displayName="CopyButton";function Ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Bh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ao(Object(t),!0).forEach(function(r){Un(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ao(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Un(n,e,t){return(e=Wh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wh(n){var e=Kh(n,"string");return typeof e=="symbol"?e:e+""}function Kh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pl extends m.PureComponent{constructor(e){var t;super(e),Un(this,"container",void 0),Un(this,"oldFocus",void 0),Un(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=k.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var r=e.options,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var t=this.props.onMenuOpened;t(this)})}componentDidUpdate(e){var t=this.props.actions;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var e=this.props.options;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var t=this.state.keyboardIndex;return t}return this.getMouseIndex()}setKeyboardIndex(e){var t=this.props.options;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var e=this.state.mouseIndex;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var e=this.props.actions,t=ge.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:ge.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var t=this.state.menuItems,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=ge.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=ge.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.props,r=t.closeMenu,i=t.onMenuClosed;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r(e),i(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 t=this.state.menuItems,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],t=this.props["data-testid"],r=this.state,i=r.keyboardIndex,o=r.menuItems,a=r.mouseIndex,s=0;s<o.length;s+=1){var l=o[s];s>0&&l.group!==o[s-1].group&&e.push(d.jsx("hr",{},"".concat(s,".separator")));var u=d.jsx(ul,{isKeyboardSelected:i===s,isMouseSelected:a===s,menuItem:l,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(u)}var c=this.props.menuStyle;return d.jsx("div",{className:"context-menu-container",style:Bh({},c),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}Un(pl,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function ko(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function No(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ko(Object(t),!0).forEach(function(r){bn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ko(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bn(n,e,t){return(e=zh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zh(n){var e=Vh(n,"string");return typeof e=="symbol"?e:e+""}function Vh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kr extends m.PureComponent{constructor(e){super(e),bn(this,"container",void 0),bn(this,"parent",void 0),bn(this,"popper",void 0),bn(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=k.createRef(),this.parent=null,this.popper=k.createRef(),this.isOpen=!1}componentDidMount(){var e=this.props.isShown;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 t=this.props.isShown;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 e=this.props.onMenuClosed;e()}render(){var e=this.props,t=e.actions,r=e.onMenuOpened,i=e.popperClassName,o=e["data-testid"],a=this.props.menuStyle,s=this.props,l=s.options,u=s.popperOptions;return u=No({placement:"bottom"},u),l=No({separateKeyboardMouse:!0},l),d.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":o,children:d.jsx(Ar,{ref:this.popper,options:u,className:U("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:d.jsx(pl,{actions:t,closeMenu:this.handleCloseMenu,onMenuOpened:r,options:l,menuStyle:a})})})}}bn(kr,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function Lt(n,e,t){return(e=Gh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gh(n){var e=qh(n,"string");return typeof e=="symbol"?e:e+""}function qh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Lo=H.module("Shortcut"),P=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),E=function(n){return n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12",n}({}),Xh=new Set([E.ENTER,E.DELETE,E.F1,E.F2,E.F3,E.F4,E.F5,E.F6,E.F7,E.F8,E.F9,E.F10,E.F11,E.F12]);class fe extends zs{static isAllowedKey(e){return Object.values(E).includes(e)}static isValidKeyState(e){var t=e.keyValue;if(t===null)return!0;if(!fe.isMacPlatform&&e.metaKey||!fe.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||Xh.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case 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 t=e.key,r=e.keyCode,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!fe.isAllowedKey(t)&&fe.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===E.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 E.ENTER:t+="⏎";break;case E.ESCAPE:t+="⎋";break;case E.BACKSPACE:t+="⌫";break;case E.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":fe.isMacPlatform?fe.getMacDisplayText(e):fe.getWindowsDisplayText(e)}constructor(e){var t=e.id,r=e.shortcut,i=e.macShortcut,o=e.isEditable,a=o===void 0?!0:o,s=e.name,l=e.tooltip;super(),Lt(this,"id",void 0),Lt(this,"name",void 0),Lt(this,"tooltip",void 0),Lt(this,"isEditable",void 0),Lt(this,"defaultKeyState",void 0),Lt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=l,this.isEditable=a;var u=fe.isMacPlatform,c=u?i:r;this.defaultKeyState=fe.createKeyState(c),this.keyState=this.defaultKeyState}getDisplayText(){return fe.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){fe.isValidKeyState(e)?(Lo.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new el("onUpdate",{detail:this}))):Lo.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return fe.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(fe.NULL_KEY_STATE)}isNull(){return fe.doKeyStatesMatch(this.keyState,fe.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return fe.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(fe.getKeyStateFromEvent(e))}}Lt(fe,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Lt(fe,"isMacPlatform",ge.isMacPlatform());function Ro(n,e,t){return(e=Zh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zh(n){var e=Yh(n,"string");return typeof e=="symbol"?e:e+""}function Yh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var $o=H.module("ShortcutRegistry");class Qh extends zs{constructor(){super(...arguments),Ro(this,"shortcutMap",new Map),Ro(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new fe(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return $o.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;$o.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var a=o.detail;return this.dispatchEvent(new el("onUpdate",{detail:a}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var le=Object.freeze(new Qh),yn={COPY:le.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[P.CTRL,E.C],macShortcut:[P.CMD,E.C],isEditable:!1}),PASTE:le.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[P.CTRL,E.V],macShortcut:[P.CMD,E.V],isEditable:!1}),SAVE:le.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[P.CTRL,E.S],macShortcut:[P.CMD,E.S],isEditable:!1}),SELECT_ALL:le.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[P.CTRL,E.A],macShortcut:[P.CMD,E.A],isEditable:!1}),REOPEN_CLOSED_PANEL:le.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[P.ALT,P.SHIFT,E.T],macShortcut:[P.OPTION,P.SHIFT,E.T],isEditable:!0}),LINKER:le.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[P.CTRL,E.L],macShortcut:[P.CMD,E.L]}),LINKER_CLOSE:le.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[E.ESCAPE],macShortcut:[E.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:le.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[P.CTRL,P.ALT,E.I],macShortcut:[P.CMD,P.SHIFT,E.I],isEditable:!0}),EXPORT_LOGS:le.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[P.CTRL,P.ALT,P.SHIFT,E.L],macShortcut:[P.CMD,P.OPTION,P.SHIFT,E.L],isEditable:!0}),OPEN_DASHBOARD_LIST:le.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[P.ALT,P.SHIFT,E.D],macShortcut:[P.OPTION,P.SHIFT,E.D],isEditable:!0}),NEXT:le.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[E.ENTER],macShortcut:[E.ENTER],isEditable:!1}),PREVIOUS:le.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[P.SHIFT,E.ENTER],macShortcut:[P.SHIFT,E.ENTER],isEditable:!1}),UNDO:le.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[P.CTRL,E.Z],macShortcut:[P.CMD,E.Z],isEditable:!1}),REDO:le.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[P.CTRL,P.SHIFT,E.Z],macShortcut:[P.CMD,P.SHIFT,E.Z],isEditable:!1})};function pi(n,e,t){return(e=Jh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jh(n){var e=em(n,"string");return typeof e=="symbol"?e:e+""}function em(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Nr extends m.PureComponent{constructor(e){super(e),pi(this,"inputField",void 0),pi(this,"searchChangeSelection",void 0),this.inputField=k.createRef(),this.searchChangeSelection=k.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var e=this.props,t=e.value,r=e.placeholder,i=e.endPlaceholder,o=e.onBlur,a=e.onChange,s=e.className,l=e.disabled,u=e.matchCount,c=e.id,h=e.onKeyDown,p=e["data-testid"],f=e.cursor,v,g=[{action:()=>f==null?void 0:f.next("forward"),shortcut:yn.NEXT},{action:()=>f==null?void 0:f.next("back"),shortcut:yn.PREVIOUS}];return f&&u>1?v=d.jsxs(d.Fragment,{children:[d.jsx(ne,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{f.next("back")},icon:Rs,tooltip:"Previous match (".concat(yn.PREVIOUS.getDisplayText(),")")}),d.jsxs("span",{className:"search-change-text",children:[f.index!==void 0&&"".concat(f.index+1," of "),u]}),d.jsx(ne,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{f.next("forward")},icon:Wu,tooltip:"Next match (".concat(yn.NEXT.getDisplayText(),")")})]}):v=u>0&&d.jsx("span",{className:"search-match",children:u}),d.jsxs("div",{className:U("search-group",s),children:[d.jsx("input",{type:"search",value:t,onBlur:o,onChange:a,onKeyDown:h,className:"form-control",disabled:l,placeholder:r,ref:this.inputField,id:c,"data-testid":p}),u!=null?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),d.jsx(de,{actions:g})]}):d.jsxs("span",{className:"search-end-content",children:[(i??"")!==""&&t===""&&d.jsx("span",{className:"search-end-placeholder",children:i}),d.jsx(me,{icon:Ku})]})]})}}pi(Nr,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function fl(n,e,t){return(e=tm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tm(n){var e=nm(n,"string");return typeof e=="symbol"?e:e+""}function nm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vl extends m.PureComponent{constructor(e){super(e),fl(this,"searchInput",void 0),this.searchInput=k.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=zn(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var t=this.props.value;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 e=this.props.onChange,t=this.state.value;e(t)}render(){var e=this.props,t=e.placeholder,r=e.className,i=e.matchCount,o=e.id,a=e["data-testid"],s=this.state.value;return d.jsx(Nr,{value:s,placeholder:t,onChange:this.handleChange,className:r,matchCount:i,ref:this.searchInput,id:o,"data-testid":a})}}fl(vl,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function gl(n,e,t){return(e=rm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rm(n){var e=im(n,"string");return typeof e=="symbol"?e:e+""}function im(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var om=H.module("ItemListItem");class Lr extends m.Component{static handleKeyDown(){return om.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),gl(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=k.createRef()}handleBlur(e){var t=this.props,r=t.itemIndex,i=t.onBlur;i(r,e)}handleFocus(e){var t=this.props,r=t.itemIndex,i=t.onFocus;i(r,e)}handleClick(e){var t=this.props,r=t.itemIndex,i=t.onClick;i(r,e)}handleContextMenu(e){var t=this.props,r=t.itemIndex,i=t.onContextMenu;i(r,e)}handleDragStart(e){var t=this.props,r=t.itemIndex,i=t.onDragStart;i(r,e)}handleDrag(e){var t=this.props,r=t.itemIndex,i=t.onDrag;i(r,e)}handleDragOver(e){e.preventDefault();var t=this.props,r=t.itemIndex,i=t.onDragOver;i(r,e)}handleDragEnd(e){var t=this.props,r=t.itemIndex,i=t.onDragEnd;i(r,e)}handleDrop(e){var t=this.props,r=t.itemIndex,i=t.onDrop;i(r,e)}handleDoubleClick(e){var t=this.props,r=t.itemIndex,i=t.onDoubleClick;i(r,e)}handleMouseMove(e){var t=this.props,r=t.itemIndex,i=t.onMouseMove;i(r,e)}handleMouseDown(e){var t=this.props,r=t.itemIndex,i=t.onMouseDown;i(r,e)}handleMouseUp(e){var t=this.props,r=t.itemIndex,i=t.onMouseUp;i(r,e)}render(){var e=this.props,t=e.isDraggable,r=e.isFocused,i=e.isSelected,o=e.style,a=e.children,s=e["data-testid"];return d.jsx("div",{className:U("item-list-item",{active:i},{"is-focused":r},{"is-draggable":t}),onKeyDown:Lr.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:o,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:t,"data-testid":s,children:a})}}gl(Lr,"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:{}});var Sr;function Fo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ho(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fo(Object(t),!0).forEach(function(r){it(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function it(n,e,t){return(e=am(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function am(n){var e=sm(n,"string");return typeof e=="symbol"?e:e+""}function sm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uo=H.module("ItemList"),Bo=5;class ct extends m.PureComponent{static renderItem(e){var t,r,i=e.item;return d.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),it(this,"list",void 0),it(this,"listContainer",void 0),it(this,"getItemSelected",vn((i,o)=>lt.isSelected(o,i),{max:ct.CACHE_SIZE})),it(this,"getCachedItem",vn((i,o,a,s,l,u,c,h)=>{var p=u({item:a,itemIndex:i,isFocused:s,isSelected:l,style:c});return d.jsx(Lr,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:h,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:c,children:p},o)},{max:ct.CACHE_SIZE})),it(this,"getOuterElement",vn(i=>{var o=k.forwardRef((a,s)=>d.jsx("div",Ho({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o},{max:1e3})),it(this,"getInnerElement",vn(()=>{var i=k.forwardRef((o,a)=>d.jsx("div",Ho({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i},{max:1e3})),it(this,"getItemData",vn((i,o,a)=>({items:i,selectedRanges:o,renderItem:a}),{max:1e3})),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=k.createRef(),this.listContainer=k.createRef();var t=e.isStickyBottom,r=e.selectedRanges;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var r=this.props,i=r.selectedRanges,o=r.itemCount,a=this.state,s=a.focusIndex,l=a.isStuckToBottom,u=a.scrollOffset,c=a.height,h=a.selectedRanges;if(l&&!this.isListAtBottom()&&o>0&&this.scrollToBottom(),(u!==t.scrollOffset||c!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==h)this.setSelectedRanges(i);else if(h!==t.selectedRanges){var p=this.props.onSelectionChange;p(h)}if(s!==t.focusIndex){var f=this.props.onFocusChange;f(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var e=this.state.scrollOffset;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 t=this.props.focusSelector,r=this.state.overscanStartIndex,i=this.listContainer.current.querySelectorAll(t),o=e-r;return i[o]}focusItem(e){var t=this.props.disableSelect;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var r=this.state.selectedRanges,i=lt.isSelected(r,e),o=i||ge.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var r=this.props,i=r.isDoubleClickSelect,o=r.onSelect;i&&this.setState(a=>{var s=a.selectedRanges;return{selectedRanges:lt.selectRange(s,[e,e])}},()=>{o(e,t)})}handleItemMouseDown(e,t){var r=this.state.selectedRanges;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Uo.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){Uo.debug2("item focus",e,t.target),this.setState(r=>{var i=r.focusIndex;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var r=this.props,i=r.isDragSelect,o=r.isMultiSelect,a=r.disableSelect,s=this.state,l=s.mouseDownIndex,u=s.selectedRanges,c=s.mouseX,h=s.mouseY;if(!(l==null||a)){var p=Math.abs(t.clientX-(c??0)),f=Math.abs(t.clientY-(h??0));p>Bo&&f>Bo&&this.setState({isDragging:!0}),(i||l===e)&&(this.focusItem(e),o?(!i&&!this.getItemSelected(e,u)&&!ge.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(l,e),Math.max(l,e)])):this.toggleSelect(e,t.shiftKey,ge.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var r=this.props,i=r.isDeselectOnClick,o=r.isDoubleClickSelect,a=r.onSelect,s=this.state,l=s.mouseDownIndex,u=s.isDragging;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(l===e&&!u){var c=t.shiftKey,h=ge.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,c,h,i),!o&&!c&&!h&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var t=e.overscanStartIndex;this.setState({overscanStartIndex:t})}handleResize(e){var t=e.height;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var t=this.props,r=t.isMultiSelect,i=t.itemCount,o=t.onSelect,a=this.state.focusIndex,s=a;if(e.key==="Enter"||e.key===" "){!r&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&o(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(a!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var l=this.state.selectedRanges;if(e.shiftKey&&l.length>0){var u=l[l.length-1];this.selectRange([Math.min(s,u[0]),Math.max(s,u[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var c;(c=this.listContainer.current)===null||c===void 0||c.focus()}this.scrollIntoView(s)}}handleScroll(e){var t=e.scrollUpdateWasRequested,r=e.scrollOffset;this.setState(i=>{if(t)return{scrollOffset:r};var o=this.props.isStickyBottom,a=i.height,s=o&&this.isListAtBottom({scrollOffset:r,height:a});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var e=this.props.itemCount;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=this.props.isMultiSelect,a=this.state.selectedRanges;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&&r?this.getItemSelected(e,a)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var e=this.props.itemCount;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){lt.validateRange(e),this.setState(t=>{var r=t.selectedRanges;return{selectedRanges:lt.deselectRange(r,e)}})}selectItem(e){var t=this.props.disableSelect;t||this.selectRange([e,e])}selectRange(e){lt.validateRange(e),this.setState(t=>{var r=t.selectedRanges;return{selectedRanges:lt.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var e=this.state,t=e.scrollOffset,r=e.height;if(t!=null&&r!=null){var i=this.props,o=i.onViewportChange,a=i.rowHeight,s=Math.floor(t/a),l=s+Math.ceil(r/a);o(s,l)}}isListAtBottom(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state,t=e.scrollOffset,r=e.height;if(r==null||t==null)return!1;var i=this.props,o=i.itemCount,a=i.rowHeight;return t+r>=o*a}renderInnerElement(e){var t=e.index,r=e.style,i=this.props,o=i.items,a=i.offset,s=i.renderItem,l=i.disableSelect,u=this.state,c=u.focusIndex,h=u.selectedRanges;if(t<a||t>=a+o.length)return null;var p=o[t-a];return this.getCachedItem(t,t,p,t===c&&!l,this.getItemSelected(t,h),s,r,l)}render(){var e=this.props,t=e.items,r=e.itemCount,i=e.overscanCount,o=e.renderItem,a=e.rowHeight,s=e["data-testid"],l=this.state,u=l.selectedRanges,c=l.isStuckToBottom;return d.jsx(Ed,{className:"item-list-auto-sizer",onResize:this.handleResize,children:h=>{var p=h.width,f=h.height;return d.jsx(Pd,{className:"item-list-scroll-pane",height:f,width:p,initialScrollOffset:c?r*a:0,itemCount:r,itemSize:a,itemData:this.getItemData(t,u,o),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}Sr=ct;it(ct,"CACHE_SIZE",1e3);it(ct,"DEFAULT_ROW_HEIGHT",20);it(ct,"DEFAULT_OVERSCAN",10);it(ct,"defaultProps",{offset:0,items:[],rowHeight:Sr.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Sr.DEFAULT_OVERSCAN,renderItem:Sr.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var lm=H.module("ErrorBoundary");class um extends m.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var r=this.props.onError;lm.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var e=this.props,t=e.children,r=e.className,i=e.fallback,o=this.state.error;return o!=null?i??d.jsx("div",{className:r,children:d.jsx(Kn,{errorMessage:"".concat(o),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):t??null}}function dm(n){var e=n.on,t=n.id,r=n.className,i=n.isInvalid,o=n.disabled,a=o===void 0?!1:o,s=n.onClick,l=n["data-testid"];return d.jsx("button",{type:"button",className:U("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:s,disabled:a,"data-testid":l,children:d.jsx("div",{className:"handle"})})}var cm=["children","className","isInvalid","onChange","data-testid"];function Wo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ko(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wo(Object(t),!0).forEach(function(r){hm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hm(n,e,t){return(e=mm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mm(n){var e=pm(n,"string");return typeof e=="symbol"?e:e+""}function pm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fm(n,e){if(n==null)return{};var t,r,i=vm(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function vm(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var bl=k.forwardRef((n,e)=>{var t=n.children,r=n.className,i=n.isInvalid,o=n.onChange,a=n["data-testid"],s=fm(n,cm),l=nl(e),u=m.useCallback(c=>{o(c.target.value)},[o]);return d.jsx("select",Ko(Ko({ref:l,className:U("custom-select",r,{"is-invalid":i}),onChange:u,"data-testid":a},s),{},{children:t}))});bl.displayName="Select";var Mi=k.createContext(new Map);Mi.displayName="XComponentMapContext";var MS=Mi.Provider;function gm(n){var e,t=m.useContext(Mi);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function zo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zo(Object(t),!0).forEach(function(r){bm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bm(n,e,t){return(e=ym(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ym(n){var e=Sm(n,"string");return typeof e=="symbol"?e:e+""}function Sm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function yl(n){var e,t;function r(i,o){var a=gm(t);return hl(n)?d.jsx(a,Zr(Zr({},i),{},{ref:o})):d.jsx(a,Zr({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=m.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function Cm(){return qn(zu,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Sl(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Cl(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function jS(n){return Sl(n)||Cl(n)}var _l=m.createContext(null);_l.displayName="ObjectFetcherContext";function AS(n){if(Cl(n))return{id:n.id,type:n.type};if(Sl(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function _m(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function kS(){return qn(_l,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function ji(n,e,t){return(e=wm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wm(n){var e=Em(n,"string");return typeof e=="symbol"?e:e+""}function Em(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ye{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}ji(Ye,"TYPE_GLOBAL","type-global");ji(Ye,"TYPE_CONTEXT_PRESET","type-context-preset");ji(Ye,"TYPE_CONTEXT_CUSTOM","type-context-custom");function Rt(n,e,t){return(e=Pm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pm(n){var e=Tm(n,"string");return typeof e=="symbol"?e:e+""}function Tm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Vo=H.module("DateTimeColumnFormatter");class Et extends Ye{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ye.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=Et.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=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(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=Et.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.timeZone,i=r===void 0?"":r,o=t.showTimeZone,a=o===void 0?!0:o,s=t.showTSeparator,l=s===void 0?!1:s,u=t.defaultDateTimeFormatString,c=u===void 0?Et.DEFAULT_DATETIME_FORMAT_STRING:u;super(),Rt(this,"dh",void 0),Rt(this,"dhTimeZone",void 0),Rt(this,"defaultDateTimeFormatString",void 0),Rt(this,"showTimeZone",void 0),Rt(this,"showTSeparator",void 0),Rt(this,"formatStringMap",void 0);var h=i||Et.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(h)}catch{Vo.error("Unsupported time zone id",h),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(Et.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=c,this.showTimeZone=a,this.showTSeparator=l,this.formatStringMap=Et.makeFormatStringMap(a,l)}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]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Vo.error("Invalid format arguments")}return""}}Rt(Et,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Rt(Et,"DEFAULT_TIME_ZONE_ID","America/New_York");var xt;function ht(n,e,t){return(e=Om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Om(n){var e=Im(n,"string");return typeof e=="symbol"?e:e+""}function Im(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xm=H.module("DecimalColumnFormatter");class Ve extends Ye{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ye.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Ve.makeFormat(e,t,Ye.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Ve.makeFormat("Custom Format",e,Ye.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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.defaultFormatString,i=r===void 0?Ve.DEFAULT_FORMAT_STRING:r;super(),ht(this,"defaultFormatString",void 0),ht(this,"dh",void 0),this.dh=e,this.defaultFormatString=i}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=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(r,i)}catch{xm.error("Invalid format arguments")}return""}}xt=Ve;ht(Ve,"DEFAULT_FORMAT_STRING","###,##0.0000");ht(Ve,"FORMAT_PERCENT",xt.makePresetFormat("Percent","##0.00%"));ht(Ve,"FORMAT_BASIS_POINTS",xt.makePresetFormat("Basis Points","###,##0 bp",1e4));ht(Ve,"FORMAT_THOUSANDS",xt.makePresetFormat("Thousands","##0.000 k",.001));ht(Ve,"FORMAT_MILLIONS",xt.makePresetFormat("Millions","###,##0.000 mm",1e-6));ht(Ve,"FORMAT_SCIENTIFIC_NOTATION",xt.makePresetFormat("Scientific Notation","0.0000E0"));ht(Ve,"FORMAT_ROUND",xt.makePresetFormat("Round","###,##0"));ht(Ve,"FORMAT_ROUND_TWO_DECIMALS",xt.makePresetFormat("0.00","###,##0.00"));ht(Ve,"FORMAT_ROUND_FOUR_DECIMALS",xt.makePresetFormat("0.0000","###,##0.0000"));var Rr;function Tn(n,e,t){return(e=Dm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dm(n){var e=Mm(n,"string");return typeof e=="symbol"?e:e+""}function Mm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jm=H.module("IntegerColumnFormatter");class Tt extends Ye{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ye.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Tt.makeFormat(e,t,Ye.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Tt.makeFormat("Custom Format",e,Ye.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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.defaultFormatString,i=r===void 0?Tt.DEFAULT_FORMAT_STRING:r;super(),Tn(this,"dh",void 0),Tn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=i}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=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(r,i)}catch{jm.error("Invalid format arguments")}return""}}Rr=Tt;Tn(Tt,"DEFAULT_FORMAT_STRING","###,##0");Tn(Tt,"FORMAT_THOUSANDS",Rr.makePresetFormat("Thousands","##0.000 k",.001));Tn(Tt,"FORMAT_MILLIONS",Rr.makePresetFormat("Millions","###,##0.000 mm",1e-6));Tn(Tt,"FORMAT_SCIENTIFIC_NOTATION",Rr.makePresetFormat("Scientific Notation","0.0000E0"));function an(n,e,t){return(e=Am(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Am(n){var e=km(n,"string");return typeof e=="symbol"?e:e+""}function km(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class K{}an(K,"INTEGER","int");an(K,"LONG","long");an(K,"DOUBLE","double");an(K,"BOOLEAN","bool");an(K,"STRING","string");an(K,"DATE_TIME","datetime");an(K,"LOCAL_TIME","localtime");var Nm=Object.freeze({}),Lm=new Map,NS=n=>n.api,LS=n=>n.user,wl=n=>n.storage,El=n=>wl(n).commandHistoryStorage,Rm=n=>wl(n).fileStorage,$m=n=>n.defaultWorkspaceSettings,Pl=n=>{var e=n.workspace;return e},Ai=Td(n=>{var e,t,r=(e=(t=Pl(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=$m(n),o=Od({},i,r,(a,s)=>{if(Array.isArray(a)&&Array.isArray(s))return s});return o}),Fm=n=>Ai(n).timeZone,RS=n=>{var e;return(e=Ai(n).notebookSettings)!==null&&e!==void 0?e:Nm},$S=n=>n.activeTool,Hm=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Lm},Um="SET_ACTIVE_TOOL",Bm="SET_API",FS="SET_COMMAND_HISTORY_STORAGE",HS="SET_FILE_STORAGE",US="SET_PLUGINS",Wm="SET_USER",Km="SET_WORKSPACE",zm="SET_DEFAULT_WORKSPACE_SETTINGS",BS="SET_WORKSPACE_STORAGE",Vm="SET_SERVER_CONFIG_VALUES";function Go(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _t(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Go(Object(t),!0).forEach(function(r){Gm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Go(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gm(n,e,t){return(e=qm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qm(n){var e=Xm(n,"string");return typeof e=="symbol"?e:e+""}function Xm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var WS=n=>({type:Wm,payload:n}),KS=n=>({type:Bm,payload:n}),Tl=n=>({type:Km,payload:n}),zS=n=>({type:zm,payload:n}),Zm=n=>(e,t)=>{e(Tl(n));var r=t(),i=r.storage,o=i.workspaceStorage;return o==null?void 0:o.save(n)},Ym=n=>(e,t)=>{var r=t(),i=r.workspace,o=i??{},a=o.data,s=_t(_t({},i),{},{data:_t(_t(_t({},a),n),{},{settings:_t(_t({},a==null?void 0:a.settings),n.settings)})});return e(Zm(s))},VS=n=>(e,t)=>{var r=Ai(t()),i=r.notebookSettings,o=_t(_t({},i),n);return e(Qm({notebookSettings:o}))},Qm=n=>e=>e(Ym({settings:n})),GS=n=>({type:Um,payload:n}),qS=n=>({type:Vm,payload:n});function qo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Xo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qo(Object(t),!0).forEach(function(r){Jm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Jm(n,e,t){return(e=ep(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ep(n){var e=tp(n,"string");return typeof e=="symbol"?e:e+""}function tp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function np(n){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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var o=i.id,a=i.payload;return t&&li({payload:a},{payload:r[o]})?r:Xo(Xo({},r),{},{[o]:a})}default:return r}}}function Zo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zo(Object(t),!0).forEach(function(r){fi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fi(n,e,t){return(e=rp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rp(n){var e=ip(n,"string");return typeof e=="symbol"?e:e+""}function ip(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class op{constructor(){fi(this,"reducers",{}),fi(this,"listener",null)}register(e,t){var r;this.reducers=Yo(Yo({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var ap=new op,Ol=m.createContext(null);Ol.displayName="PluginsContext";var Kt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",ELEMENT_PLUGIN:"ElementPlugin",MIDDLEWARE_PLUGIN:"MiddlewarePlugin",MULTI_PLUGIN:"MultiPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",WIDGET_PLUGIN:"WidgetPlugin"});function sp(n){return"DashboardPlugin"in n}function lp(n){return"AuthPlugin"in n}function up(n){return"TablePlugin"in n}function dp(n){return sp(n)||lp(n)||up(n)}function cp(n){return"type"in n&&n.type===Kt.DASHBOARD_PLUGIN}function vi(n){return"type"in n&&n.type===Kt.MIDDLEWARE_PLUGIN}function Xn(n){return"type"in n&&n.type===Kt.WIDGET_PLUGIN}function Il(n){return Xn(n)&&"dashboardTypes"in n&&n.dashboardTypes!=null}function hp(n){return"type"in n&&n.type===Kt.TABLE_PLUGIN}function mp(n){return"type"in n&&n.type===Kt.AUTH_PLUGIN}function xl(n){return"type"in n&&n.type===Kt.THEME_PLUGIN}function Dl(n){return"type"in n&&n.type===Kt.ELEMENT_PLUGIN}function Ml(n){return"type"in n&&n.type===Kt.MULTI_PLUGIN}function gi(n){return cp(n)||mp(n)||Dl(n)||Ml(n)||hp(n)||xl(n)||Xn(n)||vi(n)}var pp=["metadata"],fp=["metadata"],vp=["Component"],gp=["Component"];function Qo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qo(Object(t),!0).forEach(function(r){bp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bp(n,e,t){return(e=yp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yp(n){var e=Sp(n,"string");return typeof e=="symbol"?e:e+""}function Sp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function $r(n,e){if(n==null)return{};var t,r,i=Cp(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Cp(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function jl(n,e){return Pp(n)||Ep(n,e)||wp(n,e)||_p()}function _p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wp(n,e){if(n){if(typeof n=="string")return Jo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Jo(n,e):void 0}}function Jo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ep(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Pp(n){if(Array.isArray(n))return n}var ze=H.module("@deephaven/plugin.PluginUtils");function wn(n){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Component";return(e=(t=n.displayName)!==null&&t!==void 0?t:n.name)!==null&&e!==void 0?e:r}function ea(n,e){return n==null||!Xn(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function XS(n,e){return n==null||!Il(n)?!1:[n.dashboardTypes].flat().some(t=>t===e)}function Tp(n){var e=d.jsx(me,{icon:$s});if(!Xn(n))return e;var t=n.icon;return t==null?e:m.isValidElement(t)?t:d.jsx(me,{icon:t})}function ZS(n){var e=[...n.entries()].filter(t=>xl(t[1]));return ze.debug("Getting theme data from plugins",e),e.map(t=>{var r=jl(t,2),i=r[0],o=r[1],a=Array.isArray(o.themes)?o.themes:[o.themes];return a.map(s=>{var l=s.name,u=s.baseTheme,c=s.styleContent;return{baseThemeKey:"default-".concat(u??"dark"),themeKey:Vu(i,l),name:l,styleContent:c}})}).flat()}function YS(n){var e=[...n.entries()].filter(t=>Dl(t[1])&&t[1].mapping!=null);return ze.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var r=jl(t,2),i=r[1];return Object.entries(i.mapping)}))}function Op(n,e){return e.length===0?(ze.debug("No middleware to chain for component",wn(n)),n):(ze.debug("Chaining component middleware",wn(n),e.map(t=>t.name)),[...e].reverse().reduce((t,r)=>{var i=r.component,o=[r.supportedTypes].flat();function a(s){var l=s.metadata,u=$r(s,pp);return(l==null?void 0:l.type)!=null&&!o.includes(l.type)?d.jsx(t,xe(xe({},u),{},{metadata:l})):d.jsx(i,xe(xe({},u),{},{metadata:l,Component:t}))}return a.displayName="".concat(r.name,"(").concat(wn(t),")"),a},n))}function QS(n,e){var t=e.filter(r=>r.panelComponent!=null);return t.length===0?(ze.debug("No panel middleware to chain for panel component",wn(n)),n):(ze.debug("Chaining panel middleware",wn(n),t.map(r=>r.name)),[...t].reverse().reduce((r,i)=>{var o=i.panelComponent,a=[i.supportedTypes].flat(),s=k.forwardRef((l,u)=>{var c=l.metadata,h=$r(l,fp),p=u!=null?{ref:u}:{};return(c==null?void 0:c.type)!=null&&!a.includes(c.type)?d.jsx(r,xe(xe(xe({},p),h),{},{metadata:c})):d.jsx(o,xe(xe(xe({},p),h),{},{metadata:c,Component:r}))});return s.displayName="".concat(i.name,"Panel(").concat(wn(r,"Panel"),")"),s},n))}function JS(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"PanelMiddleware",t=k.forwardRef((r,i)=>{var o=r.Component,a=$r(r,vp),s=n(a),l=s.inject,u=s.wrap,c=o,h=d.jsx(c,xe(xe({ref:i},a),l));return u!=null?u(h):h});return t.displayName=e,t}function eC(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"WidgetMiddleware";function t(r){var i=r.Component,o=$r(r,gp),a=n(o),s=a.inject,l=a.wrap,u=i,c=d.jsx(u,xe(xe({},o),s));return l!=null?l(c):c}return t.displayName=e,t}function Ip(n){return typeof n=="object"&&n!=null&&n.default!=null&&typeof n.default=="object"}function xp(n){return gi(n)?n:Ip(n)&&gi(n.default)?n.default:dp(n)?n:null}function ta(n,e,t,r){if(n.has(e)){ze.warn("Plugin '".concat(e,"' is already registered. Skipping duplicate."));return}n.set(e,xe(xe({},t),{},{version:r}))}function tC(n,e,t,r,i,o){i!=null&&(e[i]=t,ze.debug("Registered plugin '".concat(i,"' in module resolve map")));var a=xp(t);if(a==null){ze.error("Plugin '".concat(r,"' is missing an exported value."));return}Ml(a)?(ze.debug("MultiPlugin '".concat(r,"' contains ").concat(a.plugins.length," plugins")),a.plugins.forEach(s=>{if(!gi(s)){ze.warn("Skipping invalid inner plugin from MultiPlugin '".concat(r,"'"),s);return}var l=typeof s.name=="string"?s.name.trim():"";if(l.length===0){ze.warn("Skipping unnamed inner plugin from MultiPlugin '".concat(r,"'"),s);return}ta(n,l,s,o)})):ta(n,r,a,o)}function nC(n){var e=new Map;n.forEach(s=>{var l;((l=s.loader)===null||l===void 0?void 0:l.package)!=null&&e.set(s.loader.package,s)});var t=new Map;n.forEach(s=>{var l,u=new Set;((l=s.loader)===null||l===void 0?void 0:l.dependencies)!=null&&s.loader.dependencies.forEach(c=>{var h=e.get(c);h!=null?u.add(h):ze.warn("Plugin '".concat(s.name,"' depends on '").concat(c,"' which is not in the manifest"))}),t.set(s,u)});for(var r=[],i=new Set(n),o=new Set,a=function(){var l=[];if(i.forEach(c=>{var h=t.get(c);if(h==null||h.size===0){l.push(c);return}var p=!0;h.forEach(f=>{o.has(f)||(p=!1)}),p&&l.push(c)}),l.length===0){var u=[...i].map(c=>c.name);return ze.error("Circular plugin dependency detected among: ".concat(u.join(", "),". Loading remaining plugins together.")),r.push([...i]),1}r.push(l),l.forEach(c=>{i.delete(c),o.add(c)})};i.size>0&&!a(););return r}function Dp(n,e){var t;return(t=[...n.values()].find(r=>Il(r)&&[r.dashboardTypes].flat().some(i=>i===e)))!==null&&t!==void 0?t:null}function Mp(){return qn(Ol,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var na=H.module("@deephaven/plugin.WidgetView");function rC(n){var e=n.fetch,t=n.type,r=Mp(),i=m.useMemo(()=>{var l,u=[];return r.forEach(c=>{if(!(!Xn(c)&&!vi(c))){var h=[c.supportedTypes].flat().includes(t);h&&(vi(c)?u.push(c):(l!=null&&na.warn("Multiple base plugins for type ".concat(t,". Replacing ").concat(l.name," with ").concat(c.name)),l=c))}}),{basePlugin:l,middleware:u}},[r,t]),o=i.basePlugin,a=i.middleware,s=m.useMemo(()=>o==null?(na.debug("No base plugin found for widget type ".concat(t)),null):Op(o.component,a),[o,a,t]);if(s!=null)return d.jsx(s,{fetch:e});throw new Error("Unknown widget type '".concat(t,"'"))}var Al=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 kl(n){return n.componentName!==void 0}function jp(n){return n.component!==void 0}var Nl=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Ap=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Al,isGLComponentConfig:kl,isReactComponentConfig:jp,itemDefaultConfig:Nl},Symbol.toStringTag,{value:"Module"}));function Cr(n,e,t){return(e=kp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kp(n){var e=Np(n,"string");return typeof e=="symbol"?e:e+""}function Np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ue{constructor(){Cr(this,"_mSubscriptions",void 0),Cr(this,"off",this.unbind),Cr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Ue.ALL_EVENT]=[]}on(e,t,r){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:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;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(h){console.error("Error while emitting event:",h)}}i.unshift(e);for(var l=this._mSubscriptions[Ue.ALL_EVENT],u=0;u<l.length;u++){var c=l[u].ctx||{};try{l[u].fn.apply(c,i)}catch(h){console.error("Error while emitting event to allEventSubs:",h)}}}unbind(e,t,r){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)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Cr(Ue,"ALL_EVENT","__all");function at(n,e,t){return(e=Lp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lp(n){var e=Rp(n,"string");return typeof e=="symbol"?e:e+""}function Rp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bi extends Ue{constructor(e,t,r){super(),at(this,"width",void 0),at(this,"height",void 0),at(this,"title",void 0),at(this,"parent",void 0),at(this,"layoutManager",void 0),at(this,"tab",void 0),at(this,"_config",void 0),at(this,"isHidden",!1),at(this,"beforeCloseHandler",void 0),at(this,"_element",O(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),at(this,"_contentElement",void 0),this.title=kl(e)?e.componentName:"",this.parent=t,this.layoutManager=r,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 r,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",c=u==="height"?t:e,h=((r=this[u])!==null&&r!==void 0?r:0)*(1/(((i=s.config[u])!==null&&i!==void 0?i:0)/100)),p=c/h*100,f=(((o=s.config[u])!==null&&o!==void 0?o:0)-p)/(a.contentItems.length-1),v=0;v<a.contentItems.length;v++)if(a.contentItems[v]===s)a.contentItems[v].config[u]=p;else{var g;a.contentItems[v].config[u]=((g=a.contentItems[v].config[u])!==null&&g!==void 0?g:0)+f}return a.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setPersistedState(e){this._config.persistedState=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 r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const $p=Object.freeze(Object.defineProperty({__proto__:null,Container:bi,ItemContainer:bi},Symbol.toStringTag,{value:"Module"}));function Ll(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Rl(n){if(window.location.hash)return Ll(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function Sn(n){return window.requestAnimationFrame(n)}function Fp(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function Er(){return Pt()}function Hp(n,e){var t=n.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 ki(n){return O.trim(n.replace(/(<([^>]+)>)/gi,""))}function Be(n,e,t){return(e=Up(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Up(n){var e=Bp(n,"string");return typeof e=="symbol"?e:e+""}function Bp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jn extends Ue{constructor(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;super(),Be(this,"_eElement",void 0),Be(this,"_oDocument",void 0),Be(this,"_eBody",void 0),Be(this,"_root",void 0),Be(this,"_destroyAfterMouseUp",void 0),Be(this,"_nDelay",400),Be(this,"_timeout",void 0),Be(this,"timeout",void 0),Be(this,"_nDistance",10),Be(this,"_nX",0),Be(this,"_nY",0),Be(this,"_nOriginalX",0),Be(this,"_nOriginalY",0),Be(this,"_bDragging",!1),this._eElement=e,this._oDocument=O(document),this._eBody=O(document.body),this._root=t,this._destroyAfterMouseUp=i,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(r=this._eElement)===null||r===void 0||r.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,r,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=a.y)!==null&&r!==void 0?r: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,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r: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,r,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),(a=this._root)===null||a===void 0||a.childElementContainer.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,r,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"),(r=this._root)===null||r===void 0||r.childElementContainer.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function cn(n,e,t){return(e=Wp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wp(n){var e=Kp(n,"string");return typeof e=="symbol"?e:e+""}function Kp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $l{constructor(e,t){cn(this,"_container",void 0),cn(this,"_reactComponent",null),cn(this,"_portalComponent",null),cn(this,"_originalComponentWillUpdate",void 0),cn(this,"_initialState",void 0),cn(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=void 0,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=xi.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e&&(this._reactComponent=e,this._reactComponent instanceof m.Component)){this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate,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 r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t,void 0)}_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=O.extend(e,this._container._config.props);return k.createElement(this._reactClass,t)}}var Pr=["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"],zp=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Ni(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Li(n,e,"_min"),e}function yi(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Li(n,e,"_max"),e}function Li(n,e,t){var r=t==="_min"?Vp:Gp;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[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=r(i,Pr);e[s]=a}Li(o,a,t)}else{var l=r(o,zp);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=r(i,Pr);e[u]=l}}}}function Vp(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function Gp(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Yr(n,e,t){return(e=qp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qp(n){var e=Xp(n,"string");return typeof e=="symbol"?e:e+""}function Xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Si{constructor(e,t){Yr(this,"name",void 0),Yr(this,"origin",void 0),Yr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function ur(n,e,t){return(e=Zp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zp(n){var e=Yp(n,"string");return typeof e=="symbol"?e:e+""}function Yp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let Fl=class extends Ue{constructor(e){super(),ur(this,"_layoutManager",void 0),ur(this,"_dontPropagateToParent",void 0),ur(this,"_childEventSource",void 0),ur(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Ue.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),O(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];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,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){O(window).off("gl_child_event",this._boundOnEventFromChild)}};function Hl(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function Ul(n){return(e,t)=>Hl(e,n,t)}function Bl(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function Wl(n){return(e,t)=>{var r=m.useRef(null),i=m.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,m.useEffect(()=>()=>{var a;return(a=r.current)===null||a===void 0?void 0:a.off(n,i.current)},[])}}function mt(n){return{listen:Ul(n),emit:Bl(n),useListener:Wl(n)}}const Qp=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Si,DragListener:jn,EventEmitter:Ue,EventHub:Fl,ReactComponentHandler:$l,animFrame:Sn,filterXss:Hp,getHashValue:Ll,getQueryStringParam:Rl,getUniqueId:Er,listenForEvent:Hl,makeEmitFunction:Bl,makeEventFunctions:mt,makeListenFunction:Ul,makeUseListenerFunction:Wl,minifyConfig:Ni,removeFromArray:Fp,stripTags:ki,unminifyConfig:yi},Symbol.toStringTag,{value:"Module"}));function At(n,e,t){return(e=Jp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jp(n){var e=ef(n,"string");return typeof e=="symbol"?e:e+""}function ef(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kl extends Ue{constructor(e,t,r,i,o){super(),At(this,"isInitialised",!1),At(this,"_config",void 0),At(this,"_dimensions",void 0),At(this,"_parentId",void 0),At(this,"_indexInParent",void 0),At(this,"_layoutManager",void 0),At(this,"_popoutWindow",null),At(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,a,s,l,u,c,h;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:(r=(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&&r!==void 0?r:0,top:(s=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(c=this._popoutWindow)===null||c===void 0?void 0:c.screenTop)!==null&&s!==void 0?s:0},content:(h=this.getGlInstance())===null||h===void 0?void 0:h.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,r=null;if(this._parentId){var i;if(t=O.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=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,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;O(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=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Er();e=Ni(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[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 Ee(n,e,t){return(e=tf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tf(n){var e=nf(n,"string");return typeof e=="symbol"?e:e+""}function nf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sn extends Ue{constructor(e,t,r,i,o,a){var s,l,u,c,h,p,f,v;if(super(),Ee(this,"_dragListener",void 0),Ee(this,"_layoutManager",void 0),Ee(this,"_contentItem",void 0),Ee(this,"_originalParent",void 0),Ee(this,"_area",null),Ee(this,"_lastValidArea",null),Ee(this,"_minX",void 0),Ee(this,"_maxX",void 0),Ee(this,"_minY",void 0),Ee(this,"_maxY",void 0),Ee(this,"_width",void 0),Ee(this,"_height",void 0),Ee(this,"_sided",void 0),Ee(this,"element",void 0),Ee(this,"childElementContainer",void 0),Ee(this,"_proxyTab",void 0),this._dragListener=r,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 g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=O(sn._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",ki((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").text((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(),O(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var y,S;this._layoutManager.tabDropPlaceholder.width((y=this._proxyTab.outerWidth(!0))!==null&&y!==void 0?y:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var C=this._layoutManager.container.offset();this._minX=(u=C==null?void 0:C.left)!==null&&u!==void 0?u:0,this._minY=(c=C==null?void 0:C.top)!==null&&c!==void 0?c:0,this._maxX=((h=this._layoutManager.container.width())!==null&&h!==void 0?h:0)+this._minX,this._maxY=((p=this._layoutManager.container.height())!==null&&p!==void 0?p:0)+this._minY,this._width=(f=this.element.width())!==null&&f!==void 0?f:0,this._height=(v=this.element.height())!==null&&v!==void 0?v:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,a=(i=r.pageX)!==null&&i!==void 0?i:0,s=(o=r.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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}Ee(sn,"_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 dr(n,e,t){return(e=rf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rf(n){var e=of(n,"string");return typeof e=="symbol"?e:e+""}function of(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zl{constructor(e,t,r){dr(this,"_element",void 0),dr(this,"_itemConfig",void 0),dr(this,"_layoutManager",void 0),dr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new jn(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(O.extend(!0,{},r));new sn(e,t,this._dragListener,this._layoutManager,i,null)}}function cr(n,e,t){return(e=af(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function af(n){var e=sf(n,"string");return typeof e=="symbol"?e:e+""}function sf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vl{constructor(e,t,r){cr(this,"_element",O(window)),cr(this,"_itemConfig",void 0),cr(this,"_layoutManager",void 0),cr(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&this._layoutManager&&(this._dragListener=new jn(this._element,this._layoutManager.root,!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 r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(O.extend(!0,{},r));new sn(e,t,this._dragListener,this._layoutManager,i,null)}}}function Gl(n,e,t){return(e=lf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lf(n){var e=uf(n,"string");return typeof e=="symbol"?e:e+""}function uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zn{constructor(){Gl(this,"element",O(Zn._template)),O(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()}}Gl(Zn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Qr(n,e,t){return(e=df(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function df(n){var e=cf(n,"string");return typeof e=="symbol"?e:e+""}function cf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rn{constructor(e,t,r,i){Qr(this,"element",void 0),Qr(this,"_header",void 0),Qr(this,"_action",void 0),this._header=e,this.element=O('<li class="'+r+'" 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 hf(n,e,t){return(e=mf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mf(n){var e=pf(n,"string");return typeof e=="symbol"?e:e+""}function pf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class en extends Error{constructor(e,t){super(),hf(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const ff=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:en},Symbol.toStringTag,{value:"Module"}));function vf(n,e){return Sf(n)||yf(n,e)||bf(n,e)||gf()}function gf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bf(n,e){if(n){if(typeof n=="string")return ra(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ra(n,e):void 0}}function ra(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function yf(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Sf(n){if(Array.isArray(n))return n}function Ce(n,e,t){return(e=Cf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cf(n){var e=_f(n,"string");return typeof e=="symbol"?e:e+""}function _f(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function nn(n){return n.isStack}function Ne(n){return n.isComponent}function ql(n){return n.isRoot}class _e extends Ue{constructor(e,t,r,i){super(),Ce(this,"config",void 0),Ce(this,"type",void 0),Ce(this,"contentItems",void 0),Ce(this,"parent",void 0),Ce(this,"layoutManager",void 0),Ce(this,"element",void 0),Ce(this,"childElementContainer",void 0),Ce(this,"componentName",void 0),Ce(this,"isInitialised",!1),Ce(this,"isMaximised",!1),Ce(this,"isRoot",!1),Ce(this,"isRow",!1),Ce(this,"isColumn",!1),Ce(this,"isStack",!1),Ce(this,"isComponent",!1),Ce(this,"tab",void 0),Ce(this,"_pendingEventPropagations",void 0),Ce(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Ue.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=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(r!==!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 r=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==null||o.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,nn(this)&&this.header.tabs[i].setContentItem(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=[],r=function(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),r(o.contentItems[a])};return r(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),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$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"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Ne(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(r=e.width())!==null&&r!==void 0?r: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 Si(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new en("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var t of Object.entries(Nl)){var r=vf(t,2),i=r[0],o=r[1],a=i;e[a]===void 0&&(e[a]=o)}return e}_propagateEvent(e,t){t instanceof Si&&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,Sn(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function wf(n,e){return Of(n)||Tf(n,e)||Pf(n,e)||Ef()}function Ef(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pf(n,e){if(n){if(typeof n=="string")return ia(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ia(n,e):void 0}}function ia(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Tf(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Of(n){if(Array.isArray(n))return n}function kn(n,e,t){return(e=If(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function If(n){var e=xf(n,"string");return typeof e=="symbol"?e:e+""}function xf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xl extends _e{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(s=>{var l=wf(s,2),u=l[0],c=l[1];t[u]===void 0&&(t[u]=c)}),super(e,t,r,O()),kn(this,"config",void 0),kn(this,"componentName",void 0),kn(this,"container",void 0),kn(this,"parent",void 0),kn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=O.extend(!0,{},this.config.componentState||{});if(o==null)throw new en('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new bi(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){_e.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),_e.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),_e.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),_e.prototype._$destroy.call(this)}_$getArea(){return null}}function Se(n,e,t){return(e=Df(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Df(n){var e=Mf(n,"string");return typeof e=="symbol"?e:e+""}function Mf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ot extends _e{constructor(e,t,r,i){super(t,r,i,O('<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,"_intersectionSplitter",[]),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),Se(this,"_isIntersectionDragging",!1),Se(this,"_activeFourWayPartner",null),Se(this,"_activeFourWaySharedCenterMin",null),Se(this,"_activeFourWaySharedCenterMax",null),Se(this,"_activeFourWayBaseCenter",null),Se(this,"_activeFourWayPartnerBaseCenter",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,r){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),_e.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!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 r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r: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)}if(_e.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var c;l=this.contentItems[0],this.contentItems=[],(c=this.parent)===null||c===void 0||c.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes(),this._scheduleIntersectionRefresh()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(_e.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element);for(e=0;e<this.contentItems.length;e++)this.contentItems[e].isInitialised!==!0&&this.contentItems[e]._$init();this._refreshIntersectionSplitters()}}_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,r=(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-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var u,c,h=this._isColumn?Math.floor(o*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(i*(((c=this.contentItems[l].config.width)!==null&&c!==void 0?c:0)/100));a+=h,s.push(h)}var p=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:p,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];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[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[r]=((u=this.contentItems[l].config[r])!==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,r=[],i=0,o=0,a=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),c=0;c<this.contentItems.length;c++){this.contentItems[c];var h=u.itemSizes[c];h<t?(o+=t-h,l={width:t}):(i+=h-t,l={width:h},r.push(l)),s.push(l)}if(!(o===0||o>i)){var p=o/i;a=o;for(var f=0;f<r.length;f++){l=r[f];var v=Math.round((l.width-t)*p);a-=v,l.width-=v}a!==0&&(s[s.length-1].width-=a);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/u.totalWidth*100}}}_createSplitter(e){var t;return t=new Yl(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,r=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,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,c=this._getMinimumDimensions((r=a.after.config.content)!==null&&r!==void 0?r:[]),h=this._isColumn?c.vertical:c.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)-(h||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r: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){this._applySplitterDragStop(e),this._scheduleSetSize()}_applySplitterDragStop(e){var t,r,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,c=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+u),h=((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]=c*h,s.after.config[this._dimension]=(1-c)*h,e.element.css({top:0,left:0})}_scheduleSetSize(){Sn(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0)),this._scheduleAncestorIntersectionRefresh()}_scheduleIntersectionRefresh(){Sn(()=>{Sn(this._refreshIntersectionSplitters.bind(this))})}_scheduleAncestorIntersectionRefresh(){for(var e=this.parent;e!=null;)e instanceof Ot&&e._scheduleIntersectionRefresh(),e=e.parent}_createIntersectionSplitters(){this.childElementContainer.css("position","relative");for(var e=new Set,t=0;t<this._splitter.length;t++)for(var r=this.contentItems[t],i=this.contentItems[t+1],o=[...this._collectEdgeStemSplitters(r,!1,"b"),...this._collectEdgeStemSplitters(i,!0,"a")],a=0;a<o.length;a++){var s=o[a],l=t+":"+s.path;e.add(l),this._ensureIntersectionSplitter(l,t,s.stemOwner,s.stemSplitterIndex,s.junctionAtNearEdge)}return e}_collectEdgeStemSplitters(e,t,r){if(!(e instanceof Ot))return[];if(e._isColumn!==this._isColumn){for(var i=[],o=0;o<e._splitter.length;o++)i.push({stemOwner:e,stemSplitterIndex:o,junctionAtNearEdge:t,path:r+":"+o});for(var a=0;a<e.contentItems.length;a++)i.push(...this._collectEdgeStemSplitters(e.contentItems[a],t,r+"."+a));return i}var s=t?0:e.contentItems.length-1;return this._collectEdgeStemSplitters(e.contentItems[s],t,r+"."+s)}_refreshIntersectionSplitters(){var e=this._intersectionSplitter.length,t=this._createIntersectionSplitters();this._intersectionSplitter=this._intersectionSplitter.filter(i=>t.has(i.key)?!0:(i.splitter._$destroy(),!1));for(var r=0;r<this._intersectionSplitter.length;r++)this._positionIntersectionSplitter(this._intersectionSplitter[r]);this._intersectionSplitter.length!==e&&Sn(()=>{for(var i=0;i<this._intersectionSplitter.length;i++)this._positionIntersectionSplitter(this._intersectionSplitter[i])})}_destroyIntersectionSplitters(){for(var e=0;e<this._intersectionSplitter.length;e++)this._intersectionSplitter[e].splitter._$destroy();this._intersectionSplitter=[]}_$destroy(){this._destroyIntersectionSplitters();for(var e=0;e<this._splitter.length;e++)this._splitter[e]._$destroy();this._splitter=[],_e.prototype._$destroy.call(this)}static _isAnyDragInProgress(){return O(document.body).hasClass("lm_dragging")||O(document.body).hasClass("lm_intersection_dragging")}_ensureIntersectionSplitter(e,t,r,i,o){var a=this._intersectionSplitter.find(c=>c.key===e);if(a!=null){a.parentSplitterIndex=t,a.stemOwner=r,a.stemSplitterIndex=i,a.junctionAtNearEdge=o;return}var s=new Zl(this._splitterSize,this._splitterGrabSize),l={splitter:s,key:e,parentSplitterIndex:t,stemOwner:r,stemSplitterIndex:i,junctionAtNearEdge:o};s.on("dragStart",()=>this._onIntersectionSplitterDragStart(l)),s.on("drag",(c,h)=>this._onIntersectionSplitterDrag(l,c,h)),s.on("dragStop",()=>this._onIntersectionSplitterDragStop(l));var u=null;s.element.on("mouseenter",()=>{this._isIntersectionDragging||Ot._isAnyDragInProgress()||(this._setIntersectionHighlight(l,!0),u=this._findNearFourWayPartner(l),u!=null&&this._setIntersectionHighlight(u,!0))}),s.element.on("mouseleave",()=>{this._isIntersectionDragging||O(document.body).hasClass("lm_intersection_dragging")||(this._setIntersectionHighlight(l,!1),u!=null&&(this._setIntersectionHighlight(u,!1),u=null))}),s.element.css({position:"absolute",left:0,top:0,transform:"translate(-50%, -50%)",zIndex:60}),this.childElementContainer.append(s.element),this._intersectionSplitter.push(l)}_positionIntersectionSplitter(e){var t=this._getIntersectionPosition(e);t!=null&&e.splitter.element.css({left:t.left,top:t.top})}_getIntersectionPosition(e){var t,r=this._splitter[e.parentSplitterIndex],i=(t=e.stemOwner)===null||t===void 0?void 0:t._splitter[e.stemSplitterIndex],o=this.childElementContainer[0],a=r==null?void 0:r.element[0],s=i==null?void 0:i.element[0];if(o==null||a==null||s==null)return null;var l=o.getBoundingClientRect(),u=a.getBoundingClientRect(),c=s.getBoundingClientRect(),h=u.left+u.width/2-l.left,p=u.top+u.height/2-l.top,f=c.left+c.width/2-l.left,v=c.top+c.height/2-l.top;return this._isColumn?{left:f,top:p}:{left:h,top:v}}_setIntersectionHighlight(e,t){var r,i=this._splitter[e.parentSplitterIndex],o=(r=e.stemOwner)===null||r===void 0?void 0:r._splitter[e.stemSplitterIndex];i==null||i.element.toggleClass("lm_dragging",t),i==null||i.element.toggleClass("lm_intersection_line",t),o==null||o.element.toggleClass("lm_dragging",t),o==null||o.element.toggleClass("lm_intersection_line",t)}_findNearFourWayPartner(e){var t=this.childElementContainer[0],r=t==null?void 0:t.getBoundingClientRect();if(r==null||r.width===0&&r.height===0)return null;var i=this._getIntersectionPosition(e);if(i==null)return null;for(var o=8,a=null,s=Number.POSITIVE_INFINITY,l=0;l<this._intersectionSplitter.length;l++){var u=this._intersectionSplitter[l];if(!(u.key===e.key||u.parentSplitterIndex!==e.parentSplitterIndex)){var c=this._getIntersectionPosition(u);if(c!=null){var h=Math.abs(c.left-i.left),p=Math.abs(c.top-i.top);if(!(h>o||p>o)){var f=h+p;f<s&&(s=f,a=u)}}}}return a}_setSplitterDragOffset(e,t,r){var i=e._splitterMinPosition,o=e._splitterMaxPosition;if(!(i==null||o==null)){var a=Math.max(i,Math.min(o,r));e._splitterPosition=a,t.element.css(e._isColumn?"top":"left",a)}}_getSplitterAxisCenter(e,t){var r=t.element[0];if(r==null)return null;var i=r.getBoundingClientRect();return e._isColumn?i.top+i.height/2:i.left+i.width/2}_onIntersectionSplitterDragStart(e){var t=this._splitter[e.parentSplitterIndex],r=e.stemOwner._splitter[e.stemSplitterIndex],i=this._findNearFourWayPartner(e),o=i?i.stemOwner._splitter[i.stemSplitterIndex]:null;if(this._onSplitterDragStart(t),e.stemOwner._onSplitterDragStart(r),this._activeFourWaySharedCenterMin=null,this._activeFourWaySharedCenterMax=null,this._activeFourWayBaseCenter=null,this._activeFourWayPartnerBaseCenter=null,i!=null&&o!=null){i.stemOwner._onSplitterDragStart(o);var a=this._getSplitterAxisCenter(e.stemOwner,r),s=this._getSplitterAxisCenter(i.stemOwner,o),l=e.stemOwner._splitterMinPosition,u=e.stemOwner._splitterMaxPosition,c=i.stemOwner._splitterMinPosition,h=i.stemOwner._splitterMaxPosition;if(l!=null&&u!=null&&c!=null&&h!=null&&a!=null&&s!=null){var p=a+l,f=a+u,v=s+c,g=s+h,b=Math.max(p,v),y=Math.min(f,g);b<=y?(this._activeFourWayPartner=i,this._activeFourWaySharedCenterMin=b,this._activeFourWaySharedCenterMax=y,this._activeFourWayBaseCenter=a,this._activeFourWayPartnerBaseCenter=s):this._activeFourWayPartner=null}else this._activeFourWayPartner=null}else this._activeFourWayPartner=null;this._isIntersectionDragging=!0,this._setIntersectionHighlight(e,!0),this._activeFourWayPartner!=null&&this._setIntersectionHighlight(this._activeFourWayPartner,!0),O(document.body).addClass("lm_intersection_dragging")}_onIntersectionSplitterDrag(e,t,r){var i,o,a=this._splitter[e.parentSplitterIndex],s=e.stemOwner._splitter[e.stemSplitterIndex],l=this._activeFourWayPartner,u=l?l.stemOwner._splitter[l.stemSplitterIndex]:null;if(this._onSplitterDrag(a,t,r),l!=null&&u!=null){var c=e.stemOwner._isColumn?r:t,h=this._activeFourWaySharedCenterMin,p=this._activeFourWaySharedCenterMax,f=this._activeFourWayBaseCenter,v=this._activeFourWayPartnerBaseCenter;if(h!=null&&p!=null&&f!=null&&v!=null){var g=f+c,b=Math.max(h,Math.min(p,g));this._setSplitterDragOffset(e.stemOwner,s,b-f),this._setSplitterDragOffset(l.stemOwner,u,b-v)}}else e.stemOwner._onSplitterDrag(s,t,r);var y=(i=this._splitterPosition)!==null&&i!==void 0?i:0,S=(o=e.stemOwner.element[this._dimension]())!==null&&o!==void 0?o:0,C=e.junctionAtNearEdge?S-y:S+y,_=Math.max(this._splitterSize,1),w=Math.max(C,_),D=S>0?w/S:1,B=e.junctionAtNearEdge?this._isColumn?"bottom":"right":this._isColumn?"top":"left";if(s.element.css({"transform-origin":B,transform:this._isColumn?"scaleY(".concat(D,")"):"scaleX(".concat(D,")")}),l!=null&&u!=null){var N,x,j=(N=this._splitterPosition)!==null&&N!==void 0?N:0,L=(x=l.stemOwner.element[this._dimension]())!==null&&x!==void 0?x:0,re=l.junctionAtNearEdge?L-j:L+j,A=Math.max(this._splitterSize,1),q=Math.max(re,A),ie=L>0?q/L:1,oe=l.junctionAtNearEdge?this._isColumn?"bottom":"right":this._isColumn?"top":"left";u.element.css({"transform-origin":oe,transform:this._isColumn?"scaleY(".concat(ie,")"):"scaleX(".concat(ie,")")})}}_onIntersectionSplitterDragStop(e){var t=this._splitter[e.parentSplitterIndex],r=e.stemOwner._splitter[e.stemSplitterIndex],i=this._activeFourWayPartner,o=i?i.stemOwner._splitter[i.stemSplitterIndex]:null;if(this._applySplitterDragStop(t),i!=null&&o!=null&&this._activeFourWaySharedCenterMin!=null&&this._activeFourWaySharedCenterMax!=null&&this._activeFourWayBaseCenter!=null&&this._activeFourWayPartnerBaseCenter!=null){var a,s=(a=e.stemOwner._splitterPosition)!==null&&a!==void 0?a:0,l=this._activeFourWayBaseCenter+s,u=Math.max(this._activeFourWaySharedCenterMin,Math.min(this._activeFourWaySharedCenterMax,l));this._setSplitterDragOffset(e.stemOwner,r,u-this._activeFourWayBaseCenter),this._setSplitterDragOffset(i.stemOwner,o,u-this._activeFourWayPartnerBaseCenter)}e.stemOwner._applySplitterDragStop(r),i!=null&&o!=null&&i.stemOwner._applySplitterDragStop(o),r.element.css({transform:"","transform-origin":""}),o!=null&&o.element.css({transform:"","transform-origin":""}),this._isIntersectionDragging=!1,this._setIntersectionHighlight(e,!1),i!=null&&this._setIntersectionHighlight(i,!1),this._activeFourWayPartner=null,this._activeFourWaySharedCenterMin=null,this._activeFourWaySharedCenterMax=null,this._activeFourWayBaseCenter=null,this._activeFourWayPartnerBaseCenter=null,O(document.body).removeClass("lm_intersection_dragging"),this._scheduleSetSize()}}function oa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function aa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oa(Object(t),!0).forEach(function(r){Ci(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ci(n,e,t){return(e=jf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jf(n){var e=Af(n,"string");return typeof e=="symbol"?e:e+""}function Af(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _i extends _e{constructor(e,t,r){super(e,aa(aa({},t),{},{type:"root"}),null,O('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ci(this,"childElementContainer",void 0),Ci(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,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 r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r: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,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Ne(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var i=t.side,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 Ot)||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 c,h=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),h.config[a]=((c=h.config[a])!==null&&c!==void 0?c:0)*.5,e.config[a]=h.config[a],l.callDownwards("setSize")}}}}function kf(n,e){return $f(n)||Rf(n,e)||Lf(n,e)||Nf()}function Nf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lf(n,e){if(n){if(typeof n=="string")return sa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?sa(n,e):void 0}}function sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Rf(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function $f(n){if(Array.isArray(n))return n}function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){qe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qe(n,e,t){return(e=Ff(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ff(n){var e=Hf(n,"string");return typeof e=="symbol"?e:e+""}function Hf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wi extends _e{constructor(e,t,r){var i,o,a,s,l,u,c,h,p;super(e,t,r,O('<div class="lm_item lm_stack"></div>')),qe(this,"_activeContentItem",null),qe(this,"_header",void 0),qe(this,"childElementContainer",O('<div class="lm_items"></div>')),qe(this,"header",void 0),qe(this,"parent",void 0),qe(this,"isStack",!0),qe(this,"_dropSegment",null),qe(this,"_contentAreaDimensions",null),qe(this,"_dropIndex",void 0),qe(this,"_side",void 0),qe(this,"_sided",!1),qe(this,"config",void 0),this.parent=r,this.config=t;var f=e.config;this._side=!1,this._header={show:((i=f.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=f.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=f.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=f.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=f.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=f.settings)!==null&&u!==void 0&&u.showCloseIcon?(c=f.labels)===null||c===void 0?void 0:c.close:void 0,minimise:(h=(p=f.labels)===null||p===void 0?void 0:p.minimise)!==null&&h!==void 0?h:void 0},f.header&&(this._header=hn(hn({},this._header),f.header)),t.header&&(this._header=hn(hn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=hn(hn({},this._header),t.content[0].header)),this.header=new It(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,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=((r=this.element.width())!==null&&r!==void 0?r: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,t){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),Ne(e)?e._$show(t):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,r=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(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){_e.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",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Ot&&(t&&this.parent.isColumn||r&&this.parent.isRow),a=t?"column":"row",s=t?"height":"width";if(Ne(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var u,c=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?c:c+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 h,p=this.layoutManager.createContentItem({type:a},this);(h=this.parent)===null||h===void 0||h.replaceChild(this,p),p.addChild(e,i?0:void 0,!0),p.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,p.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var r of Object.entries(this._contentAreaDimensions)){var i=kf(r,2),o=i[0],a=i[1],s=a.hoverArea;if(s.x1<e&&s.x2>e&&s.y1<t&&s.y2>t){o==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(o));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 r=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+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.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+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.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,r,i,o,a,s,l,u,c,h,p,f,v,g,b,y,S=this.header.tabs.length;if(S===0){var C,_,w,D,B,N,x,j,L=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(_=L==null?void 0:L.left)!==null&&_!==void 0?_:0,x2:((w=L==null?void 0:L.left)!==null&&w!==void 0?w:0)+100,y1:(D=(B=this.header.element.offset())===null||B===void 0?void 0:B.top)!==null&&D!==void 0?D:0,y2:((N=(x=this.header.element.offset())===null||x===void 0?void 0:x.top)!==null&&N!==void 0?N:0)+((j=this.header.element.innerHeight())!==null&&j!==void 0?j:0)});return}var re=this.header.tabsContainer,A=(t=re.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),q=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!A||!q)){e<A.left?e=A.left+1:e>A.right&&(e=A.right-1);var ie,oe;if(!(q.left<e&&e<q.right)){for(var be=0;be<S;be++){var ye;if(ie=this.header.tabs[be].element,oe=(ye=ie.get(0))===null||ye===void 0?void 0:ye.getBoundingClientRect(),oe&&oe.left<e&&e<oe.right){this._dropIndex=be;break}}if(ie&&oe&&e<oe.left+oe.width*.5)ie.before(this.layoutManager.tabDropPlaceholder);else if(ie){var Oe;this._dropIndex=Math.min(((Oe=this._dropIndex)!==null&&Oe!==void 0?Oe:0)+1,S),ie.after(this.layoutManager.tabDropPlaceholder)}}var we=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;we=Math.max(we,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var ce=we+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);ce=Math.min(ce,((u=(c=this.header.tabsContainer.offset())===null||c===void 0?void 0:c.left)!==null&&u!==void 0?u:0)+((h=this.header.tabsContainer.innerWidth())!==null&&h!==void 0?h:0)),(p=this.layoutManager.dropTargetIndicator)===null||p===void 0||p.highlightArea({x1:we,x2:ce,y1:(f=(v=this.header.element.offset())===null||v===void 0?void 0:v.top)!==null&&f!==void 0?f:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((y=this.header.element.innerHeight())!==null&&y!==void 0?y:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===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,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const Uf=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:_e,Component:Xl,ContentItem:_e,Root:_i,RowOrColumn:Ot,Stack:wi,isComponent:Ne,isRoot:ql,isStack:nn},Symbol.toStringTag,{value:"Module"}));function Ct(n,e,t){return(e=Bf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bf(n){var e=Wf(n,"string");return typeof e=="symbol"?e:e+""}function Wf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Yn{constructor(e,t){var r;Ct(this,"header",void 0),Ct(this,"contentItem",void 0),Ct(this,"element",O(Yn._template)),Ct(this,"titleElement",void 0),Ct(this,"closeElement",void 0),Ct(this,"isActive",!1),Ct(this,"_layoutManager",void 0),Ct(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,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new jn(this.element,this._layoutManager.root),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.element.on("mouseup",this._onMouseUp),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),Ne(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.text(e)}setContentItem(e){var t=this.contentItem;this._dragListener&&(t.off("destroy",this._dragListener.destroy,this._dragListener),e.on("destroy",this._dragListener.destroy,this._dragListener)),t.off("titleChanged",this.setTitle,this),e.on("titleChanged",this.setTitle,this),this.contentItem=e,e.tab=this,this.setTitle(e.config.title)}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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),Ne(this.contentItem)&&this.contentItem.container._contentElement.off(),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 r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new sn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(e){Ne(this.contentItem)&&(e==null?void 0:e.target)instanceof Element&&this._isInNestedLayout(e.target)||(O(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin"))}_onTabContentFocusOut(){Ne(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&Ne(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Ne(this.contentItem)&&!this._isFocusDirectlyInContainer()&&this.contentItem.container._contentElement.focus(),Ne(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(),Ne(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}_isInNestedLayout(e){var t=O(e).closest(".lm_goldenlayout")[0],r=this._layoutManager.root.element[0];return t!=null&&t!==r}_isFocusDirectlyInContainer(){if(!Ne(this.contentItem))return!1;var e=document.activeElement;return e==null||!this.contentItem.container._contentElement[0].contains(e)?!1:!this._isInNestedLayout(e)}}Ct(Yn,"_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 X(n,e,t){return(e=Kf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kf(n){var e=zf(n,"string");return typeof e=="symbol"?e:e+""}function zf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class It extends Ue{constructor(e,t){var r,i;super(),X(this,"layoutManager",void 0),X(this,"element",O(It._template)),X(this,"tabsContainer",void 0),X(this,"tabDropdownContainer",void 0),X(this,"tabDropdownSearch",void 0),X(this,"tabDropdownList",null),X(this,"controlsContainer",void 0),X(this,"parent",void 0),X(this,"tabs",[]),X(this,"activeContentItem",null),X(this,"closeButton",null),X(this,"tabDropdownButton",null),X(this,"tabNextButton",O(It._nextButtonTemplate)),X(this,"tabPreviousButton",O(It._previousButtonTemplate)),X(this,"holdTimer",null),X(this,"rAF",null),X(this,"CLICK_TIMEOUT",500),X(this,"START_SPEED",.01),X(this,"ACCELERATION",5e-4),X(this,"PADDING",10),X(this,"SCROLL_LEFT","left"),X(this,"SCROLL_RIGHT","right"),X(this,"isDraggingTab",!1),X(this,"isOverflowing",!1),X(this,"isDropdownShown",!1),X(this,"dropdownKeyIndex",0),X(this,"_lastVisibleTabIndex",-1),X(this,"_tabControlOffset",void 0),this.layoutManager=e,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.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 r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new Yn(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,r,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||(r=t.scrollIntoView)===null||r===void 0||r.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 r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_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 r,i,o,a,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,c;l.scrollLeft=(u=(c=this.tabsContainer.get(0))===null||c===void 0?void 0:c.scrollWidth)!==null&&u!==void 0?u:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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,r;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)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,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((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(c=>{var h,p,f=o||c,v=c-f,g=this.START_SPEED*v+.5*this.ACCELERATION*(v*v);g=Math.min(g,(h=(p=this.tabsContainer.get(0))===null||p===void 0?void 0:p.scrollWidth)!==null&&h!==void 0?h:1/0),this._handleScrollRepeat(e,t,g,f)})}}_$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(),O(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,r,i,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new Rn(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),r=this._getHeaderSetting("popout"),new Rn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var a=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new Rn(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),r=this._getHeaderSetting("close"),this.closeButton=new Rn(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),O(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"),O(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 c=(s+l+u.length)%u.length;c!==s;){if(u.eq(c).css("display")!=="none")return c;c=(c+l+u.length)%u.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.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 r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-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,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.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(),O(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,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=(r=O(window).height())!==null&&r!==void 0?r:0,l=(i=O(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var u=this.tabDropdownButton.element[0].getBoundingClientRect(),c=o<s-u.bottom,h=!c&&u.bottom>s*.6,p=Math.min(u.left+(h?u.width:0),l-a.width-this.PADDING),f=h?Math.max(u.top-o,this.PADDING):u.bottom,v=s-f-this.PADDING;this.tabDropdownContainer.css({"max-height":v,top:f,left:p})}}}}_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 r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}X(It,"_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(""));X(It,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));X(It,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Nn(n,e,t){return(e=Vf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vf(n){var e=Gf(n,"string");return typeof e=="symbol"?e:e+""}function Gf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zl{constructor(e,t){Nn(this,"_size",void 0),Nn(this,"_grabSize",void 0),Nn(this,"_hitAreaSize",void 0),Nn(this,"_dragListener",void 0),Nn(this,"element",void 0),this._size=e,this._grabSize=t<e?e:t,this._hitAreaSize=Math.max(this._grabSize,14),this.element=this._createElement(),this._dragListener=new jn(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=O('<div class="lm_drag_handle"></div>'),t=O('<div class="lm_intersection_splitter"></div>');return t.append(e),t.css({width:this._hitAreaSize,height:this._hitAreaSize}),t.on("mousedown touchstart",r=>{r.stopPropagation()}),t}}function Ln(n,e,t){return(e=qf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qf(n){var e=Xf(n,"string");return typeof e=="symbol"?e:e+""}function Xf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Yl{constructor(e,t,r){Ln(this,"_isVertical",void 0),Ln(this,"_size",void 0),Ln(this,"_grabSize",void 0),Ln(this,"_dragListener",void 0),Ln(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new jn(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=O('<div class="lm_drag_handle"></div>'),t=O('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Zf=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Kl,DragProxy:sn,DragSource:zl,DragSourceFromEvent:Vl,DropTargetIndicator:Zn,Header:It,HeaderButton:Rn,IntersectionSplitter:Zl,Splitter:Yl,Tab:Yn},Symbol.toStringTag,{value:"Module"}));var Yf={config:Ap,container:$p,controls:Zf,errors:ff,items:Uf,utils:Qp};function ua(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function We(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ua(Object(t),!0).forEach(function(r){Y(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ua(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Y(n,e,t){return(e=Qf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qf(n){var e=Jf(n,"string");return typeof e=="symbol"?e:e+""}function Jf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var da=["column","row","stack","component"];class Ri extends Ue{static isLayoutItemConfig(e){return da.includes(e.type)}static minifyConfig(e){return Ni(e)}static unminifyConfig(e){return yi(e)}constructor(e,t){super(),Y(this,"isInitialised",!1),Y(this,"_isFullPage",!1),Y(this,"_resizeTimeoutId",void 0),Y(this,"_components",{"lm-react-component":$l}),Y(this,"_fallbackComponent",void 0),Y(this,"_itemAreas",[]),Y(this,"_maximisedItem",null),Y(this,"_maximisePlaceholder",O('<div class="lm_maximise_place"></div>')),Y(this,"_creationTimeoutPassed",!1),Y(this,"_subWindowsCreated",!1),Y(this,"_dragSources",[]),Y(this,"_updatingColumnsResponsive",!1),Y(this,"_firstLoad",!0),Y(this,"_reactChildMap",new Map),Y(this,"_reactChildren",null),Y(this,"_initialHeaderHeight",void 0),Y(this,"width",null),Y(this,"height",null),Y(this,"root",void 0),Y(this,"openPopouts",[]),Y(this,"selectedItem",null),Y(this,"isSubWindow",!1),Y(this,"eventHub",new Fl(this)),Y(this,"config",void 0),Y(this,"container",void 0),Y(this,"_originalContainer",void 0),Y(this,"dropTargetIndicator",null),Y(this,"tabDropPlaceholder",O('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&O("body").css("visibility","hidden")}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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}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 _e))throw new Error("Root must be a ContentItem");var t={settings:We({},this.config.settings),dimensions:We({},this.config.dimensions),labels:We({},this.config.labels),content:[]},r=function(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]={},r(a.content[u],s.contentItems[u])}};e?r(t,{contentItems:[e]}):r(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){O(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 Zn,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 r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}enableHeaders(){this.config.settings.hasHeaders=!0,this.config.dimensions.headerHeight=this._initialHeaderHeight,this._findAllStackContainers().forEach(e=>{e._header.show=!0,e.header.element.toggle(!0)}),this.updateSize()}disableHeaders(){this.config.settings.hasHeaders=!1,this.config.dimensions.headerHeight=0,this._findAllStackContainers().forEach(e=>{e._header.show=!1,e.header.element.toggle(!1)}),this.updateSize()}updateSize(e,t){var r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r: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(),O(window).off("resize",this._onResize),O(window).off("unload beforeunload",this._onUnload),O(window).off("blur.lm").off("focus.lm"),O(window).off("keydown",this._windowKeydown),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 r,i;if(typeof e.type!="string")throw new en("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!Ri.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+da.join(","),new en(i);return e.type==="component"&&!(t instanceof wi)&&t&&!(this.isSubWindow===!0&&t instanceof _i)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:Er(),e.type==="stack"?new wi(this,e,t):e.type==="row"?new Ot(!1,this,e,t):e.type==="column"?new Ot(!0,this,e,t):new Xl(this,e,t)}createPopout(e,t,r,i){var o=[],a=e instanceof _e,s=this;if(a){var l;o=this.toConfig(e).content,r=Er();for(var u=e.parent,c=e;((h=u)===null||h===void 0?void 0:h.contentItems.length)===1&&!u.isRoot;){var h;c=u,u=u.parent}if((l=u)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var p;i=(p=u)===null||p===void 0?void 0:p.contentItems.indexOf(c)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var f,v,g,b=window.screenX||window.screenLeft,y=window.screenY||window.screenTop,S=(f=e.element.offset())!==null&&f!==void 0?f:{left:0,top:0};t={left:b+S.left,top:y+S.top,width:(v=e.element.width())!==null&&v!==void 0?v:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!r||i===void 0)){var C=new Kl(o,t,r,i,this);return C.on("initialised",function(){s.emit("windowOpened",C)}),C.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new zl(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Vl(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,r;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((r=this.container.height())!==null&&r!==void 0?r: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 r=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&&r>a.surface&&(r=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=We({},this.root._$getArea()),r=[We(We({},t),{},{side:"left",x2:t.x1+e}),We(We({},t),{},{side:"right",x1:t.x2-e}),We(We({},t),{},{side:"top",y2:t.y1+e}),We(We({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$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 r=e[t];if(nn(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=We(We({},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 _e)return e;if(O.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.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=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&O(window).resize(this._onResize),O(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=Rl("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=yi(e),localStorage.removeItem(r));var i=O.extend(!0,{},Al,e),o=function(s){for(var l in s){var u=s[l];l!=="props"&&typeof u=="object"&&u!=null?o(u):l==="type"&&u==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return o(i),((t=i.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(i.dimensions.headerHeight=0),i}_adjustToWindowMode(){var e,t=O('<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=ki((e=this.config.content[0].title)!==null&&e!==void 0?e:""),O("head").append(O("body link, body style, template, .gl_keep")),this.container=O("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?O(this._originalContainer):O("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,O("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 en(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new en(t,e);this.root=new _i(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,r=e*t;if(!(this.width==null||r<=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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{nn(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Y(Ri,"__lm",Yf);const ca={"tab-height":"28px","drag-border-width":"5px"},ha=Object.freeze({tabHeight:parseInt(ca["tab-height"],10),dragBorderWidth:parseInt(ca["drag-border-width"],10)});function ma(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ma(Object(t),!0).forEach(function(r){Ql(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ma(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ql(n,e,t){return(e=ev(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ev(n){var e=tv(n,"string");return typeof e=="symbol"?e:e+""}function tv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=H.module("LayoutUtils");function Jl(n){return n.componentName!==void 0}function $t(n){var e=n;return(Jl(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function hr(n){return n.focus!==void 0}function pa(n){return n.type==="stack"}class T{static activateTab(e,t){var r=T.getStackForRoot(e,t,!1);if(!r){kt.error("Could not find stack for config",t);return}var i=T.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=T.getStackForRoot(e,t,!1);if(!r)return kt.error("Could not find stack for config",t),!1;var i=T.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(ql(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(r);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;if(!l){var u,c,h=e.layoutManager.createContentItem({type:t?"row":"column",height:(u=s.config)===null||u===void 0?void 0:u.height,width:(c=s.config)===null||c===void 0?void 0:c.width},e);e.replaceChild(s,h),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]}return this.addStack(s,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=T.getAllStackContainers(e),r=T.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&nn(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(nn(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var a=this.getStackById(e.contentItems[o],t,i);if(a)return a}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=this.getContentItemById(e.contentItems[i],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&nn(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&&io(o.config,t))return e;var a=this.getStackForConfig(o,t,r);if(a)return a}return null}static getStackForRoot(e,t){var r=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&&r&&(a=this.addStack(e)),a}static getStackForComponentTypes(e,t){for(var r=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=T.getStackForRoot(e,{component:s},r&&l,i,o);if(u)return u}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&io(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i],a=o.content;if($t(o)){var s=t(o.component,o);s!=null?r.push(s):kt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o.component,'"'))}else if(a){var l=yt(yt({},o),{},{content:T.dehydrateLayoutConfig(a,t)});r.push(l)}else r.push(o)}return r}static getTabPoint(e){var t=e.tab;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],i=r.content;i!==void 0?(pa(r)&&delete r.activeItemIndex,T.dropLayoutMinorChange(i)):$t(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=T.cloneLayout(e),o=T.cloneLayout(t);return r?(T.dropLayoutMinorChange(i),T.dropLayoutMinorChange(o),li(i,o)):li(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var o=e[i];if($t(o)){var a,s=o.component,l=o.props,u=l===void 0?{}:l;r.push(yt(yt({},o),{},{id:(a=o==null?void 0:o.id)!==null&&a!==void 0?a:Pt(),props:t(s,u)}))}else if(o.content!==void 0){var c=T.hydrateLayoutConfig(o.content,t);pa(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=c.length&&(kt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(yt(yt({},o),{},{content:c}))}else r.push(o)}return r}static openComponent(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.root,r=e.config,i=e.stack,o=i===void 0?void 0:i,a=e.replaceExisting,s=a===void 0?!0:a,l=e.replaceConfig,u=l===void 0?void 0:l,c=e.createNewStack,h=c===void 0?!1:c,p=e.focusElement,f=p===void 0?void 0:p,v=e.dragEvent,g=v===void 0?void 0:v,b=document.activeElement,y=yt({},r);if(y.id==null&&(y.id=Pt()),g!=null){t==null||t.layoutManager.createDragSourceFromEvent(y,g);return}var S=u||{id:y.id,component:y.component};W(t);var C=o??(h?T.addStack(t):T.getStackForRoot(t,S));W(C);var _=T.getContentItemInStack(C,S);if(f!=null){var w=B=>{kt.debug("Component created, focusing element",f),C.off("componentCreated",w);var N=B.origin.element;requestAnimationFrame(()=>{T.focusElement(N[0],f)})};C.on("componentCreated",w)}if(s&&_){var D=C.contentItems.indexOf(_);C.addChild(y,D+1),C.removeChild(_),C.setActiveContentItem(C.contentItems[D])}else C.addChild(y);f==null&&b&&hr(b)&&b.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=T.getContentItemInStack(e,o);if(r&&a&&e){var s=e==null?void 0:e.contentItems.indexOf(a);e.addChild(t,s+1),e.removeChild(a),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&hr(i)&&i.focus()}static closeComponent(e,t,r){var i=T.getStackForRoot(e,t,!1,!1,!1);if(!i){kt.warn("Cannot find stack for component, ignoring close",t);return}var o=T.getContentItemInStack(i,t),a=document.activeElement;o&&(Ne(o)?o.container.close(r):i.removeChild(o)),a&&document.contains(a)&&hr(a)&&a.focus()}static renameComponent(e,t,r){var i=T.getStackForRoot(e,t,!1);if(!i){kt.error("Could not find stack for config",t);return}var o=T.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=T.getStackForRoot(e,t,!1);if(!r)return kt.error("Could not find stack for config",t),null;var i=t.props,o=i===void 0?{}:i,a=T.getPanelComponentState(t),s={type:"react-component",component:t.component,props:yt(yt({},o),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Pt()};return T.openComponentInStack(r,s),s}static getPanelComponentState(e){if(Jl(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if($t(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:ha.tabHeight,borderWidth:ha.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=T.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var t=e.props.glContainer;return T.getIdFromContainer(t)}static getComponentNameFromPanel(e){var t=e.props.glContainer,r=T.getComponentConfigFromContainer(t);if(r&&$t(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.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]:T.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(hr(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}Ql(T,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var nv=k.forwardRef((n,e)=>{var t=T.getComponentNameFromPanel({props:n});return d.jsx("div",{ref:e,className:"panel-placeholder",children:d.jsxs("div",{children:['Component "',t,'" is not registered.']})})});nv.displayName="PanelPlaceholder";var ee=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),$i=mt(ee.OPEN),oC=$i.listen,rv=$i.emit,aC=$i.useListener,Fi=mt(ee.CLOSE),sC=Fi.listen,fa=Fi.emit,lC=Fi.useListener,Fr=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),Hi=mt(Fr.CYCLE_TO_NEXT_STACK),iv=Hi.listen,uC=Hi.emit,dC=Hi.useListener,Ui=mt(Fr.CYCLE_TO_PREVIOUS_STACK),ov=Ui.listen,cC=Ui.emit,hC=Ui.useListener,Bi=mt(Fr.CYCLE_TO_NEXT_TAB),av=Bi.listen,mC=Bi.emit,pC=Bi.useListener,Wi=mt(Fr.CYCLE_TO_PREVIOUS_TAB),sv=Wi.listen,fC=Wi.emit,vC=Wi.useListener;function va(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ga(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?va(Object(t),!0).forEach(function(r){wt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):va(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function wt(n,e,t){return(e=lv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lv(n){var e=uv(n,"string");return typeof e=="symbol"?e:e+""}function uv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Je=H.module("PanelManager"),Yt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(Yt||{});class eu{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=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]:()=>{};wt(this,"layout",void 0),wt(this,"hydrateComponent",void 0),wt(this,"dehydrateComponent",void 0),wt(this,"onPanelsUpdated",void 0),wt(this,"closed",void 0),wt(this,"openedMap",void 0),wt(this,"navigationEventListenerRemovers",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.handleReopenLast=this.handleReopenLast.bind(this),this.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=r,this.onPanelsUpdated=a,this.openedMap=new Map(i),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var e=this.layout.eventHub;e.on(ee.FOCUS,this.handleFocus),e.on(ee.MOUNT,this.handleMount),e.on(ee.UNMOUNT,this.handleUnmount),e.on(ee.REOPEN,this.handleReopen),e.on(ee.REOPEN_LAST,this.handleReopenLast),e.on(ee.DELETE,this.handleDeleted),e.on(ee.CLOSED,this.handleClosed),e.on(ee.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(iv(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(ov(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(av(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(sv(e,this.handleCycleToPreviousTab))}stopListening(){var e=this.layout.eventHub;e.off(ee.FOCUS,this.handleFocus),e.off(ee.MOUNT,this.handleMount),e.off(ee.UNMOUNT,this.handleUnmount),e.off(ee.REOPEN,this.handleReopen),e.off(ee.REOPEN_LAST,this.handleReopenLast),e.off(ee.DELETE,this.handleDeleted),e.off(ee.CLOSED,this.handleClosed),e.off(ee.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var t=e.props.glContainer;return T.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&$t(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=T.getStackForConfig(this.layout.root,{id:e});return(t=r&&T.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>wr(r)&&t instanceof r.WrappedComponent||!wr(r)&&t instanceof r))}updatePanel(e){var t=T.getIdFromPanel(e);if(t==null){Je.error("updatePanel Panel did not have an ID",e);return}Je.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=T.getIdFromPanel(e);if(t==null){Je.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Je.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Je.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Je.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Je.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Je.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Je.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=T.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=T.getFocusedStackIndex(t);if(r===-1){var i=t[0],o=i.config.activeItemIndex,a=o!=null?i.contentItems[o]:i.contentItems[0];i.setActiveContentItem(a,!0);return}var s=e===Yt.Next?(r+1)%t.length:(r-1+t.length)%t.length,l=t[s],u=l.config.activeItemIndex,c=u!=null?l.contentItems[u]:l.contentItems[0];l.setActiveContentItem(c,!0)}}handleCycleToNextStack(){this.cycleStack(Yt.Next)}handleCycleToPreviousStack(){this.cycleStack(Yt.Previous)}cycleTab(e){var t,r=T.getFocusedStack(this.layout);if(r!==void 0){var i=r.contentItems;if(!(i.length<=1)){var o=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,a=e===Yt.Next?(o+1)%i.length:(o-1+i.length)%i.length,s=i[a];r.setActiveContentItem(s,!0)}}}handleCycleToNextTab(){this.cycleTab(Yt.Next)}handleCycleToPreviousTab(){this.cycleTab(Yt.Previous)}handleReopen(e,t){Je.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var r=e.component,i=e.props;i=this.hydrateComponent(r,i);var o=ga(ga({},e),{},{props:i}),a=this.layout.root,s=e.parentStackId===void 0?void 0:T.getStackById(a,e.parentStackId);T.openComponent({root:a,config:o,replaceConfig:t,stack:s??void 0})}handleReopenLast(e){var t;if(this.closed.length!==0){if(e===void 0){this.handleReopen(this.closed[this.closed.length-1]);return}for(var r=(t=T.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var o=this.closed[i];if(o.parentStackId===r){this.handleReopen(o);return}}}}handleDeleted(e){Je.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Je.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},r=this.layout.root;T.closeComponent(r,t)}addClosedPanel(e){var t=T.getComponentConfigFromContainer(e);if(t&&$t(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var e=this.closed,t=this.openedMap;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}wt(eu,"MAX_CLOSED_PANEL_COUNT",100);var dv=H.module("PanelErrorBoundary");class cv extends m.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=T.getIdFromContainer(t);dv.debug("componentWillUnmount",i),r.emit(ee.CLOSED,i,t)}render(){var e=this.props.children,t=this.state.error;return t!=null?d.jsx("div",{className:"panel-error-boundary",children:d.jsx(Kn,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ba(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ba(Object(t),!0).forEach(function(r){hv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ba(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hv(n,e,t){return(e=mv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mv(n){var e=pv(n,"string");return typeof e=="symbol"?e:e+""}function pv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tu(n){var e=n.props,t=n.componentState,r=e.metadata,i=e.panelState,o=i===void 0?null:i;t&&(o=t.panelState);var a={};return r!=null&&(a.metadata=r),o!=null&&(a.panelState=o),Tr(Tr({},n),{},{componentState:null,props:a,type:"react-component"})}function nu(n,e){return Tr(Tr({},n),{},{localDashboardId:e})}const gC={dehydrate:tu,hydrate:nu};var ru=k.createContext(void 0);ru.displayName="LayoutManagerContext";var fv=pe.shape({on:pe.func,off:pe.func,isHidden:pe.bool,tab:pe.shape({header:pe.shape({tabs:pe.arrayOf(pe.shape({contentItem:pe.shape({})}))})}),title:pe.string,setTitle:pe.func,close:pe.func}),iu=pe.shape({on:pe.func,off:pe.func,emit:pe.func}),vv=pe.shape({registerComponent:pe.func,root:pe.shape({addChild:pe.func}),on:pe.func,off:pe.func,eventHub:iu}),bC=Object.freeze({Container:fv,EventHub:iu,Layout:vv});function mn(n,e,t){m.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var ou="SET_DASHBOARD_DATA";const gv=np(ou,{},!1),bv={dashboardData:gv};var yv=new Map,au=Object.freeze({}),Sv=Object.freeze([]),yC=Vs,SC=Gs,CC=Id,Cv=n=>n.dashboardData,De=(n,e)=>{var t;return(t=Cv(n)[e])!==null&&t!==void 0?t:au},_C=(n,e)=>{var t;return(t=De(n,e).closed)!==null&&t!==void 0?t:Sv},wC=(n,e)=>{var t;return(t=De(n,e).openedMap)!==null&&t!==void 0?t:yv},su=(n,e)=>{var t;return(t=De(n,e).pluginDataMap)!==null&&t!==void 0?t:au},EC=(n,e,t)=>su(n,e)[t];function ya(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Cn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ya(Object(t),!0).forEach(function(r){_v(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ya(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _v(n,e,t){return(e=wv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wv(n){var e=Ev(n,"string");return typeof e=="symbol"?e:e+""}function Ev(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var lu=(n,e)=>({type:ou,id:n,payload:e}),Pv=(n,e)=>(t,r)=>t(lu(n,Cn(Cn({},De(r(),n)),e))),PC=(n,e,t)=>(r,i)=>r(lu(n,Cn(Cn({},De(i(),n)),{},{pluginDataMap:Cn(Cn({},su(i(),n)),{},{[e]:t})})));function Tv(n,e){return Dv(n)||xv(n,e)||Iv(n,e)||Ov()}function Ov(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iv(n,e){if(n){if(typeof n=="string")return Sa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Sa(n,e):void 0}}function Sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function xv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Dv(n){if(Array.isArray(n))return n}Object.entries(bv).map(n=>{var e=Tv(n,2),t=e[0],r=e[1];return ap.register(t,r)});function Mv(n,e){return Nv(n)||kv(n,e)||Av(n,e)||jv()}function jv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Av(n,e){if(n){if(typeof n=="string")return Ca(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ca(n,e):void 0}}function Ca(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function kv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Nv(n){if(Array.isArray(n))return n}var uu=m.createContext(null);uu.displayName="PersistentStateContext";function mr(n,e){return"".concat(n,"::").concat(e)}function Lv(n){var e=n.initialState,t=n.onChange,r=n.children,i=m.useRef(!0);m.useEffect(()=>()=>{i.current=!1},[]);var o=m.useRef(!1),a=m.useState(()=>Array.isArray(e)&&e.flat().length===2*e.length?new Map(e):(o.current=!0,new Map)),s=Mv(a,1),l=s[0],u=m.useRef(new Map),c=m.useCallback((b,y,S)=>{var C=S.type,_=mr(y,C),w=u.current.get(_);if(w!=null&&w!==b)throw new Error("Detected multiple persistent states of type ".concat(C," for dhId ").concat(y,". Only one state per (dhId, type) pair is allowed."));u.current.set(_,b),i.current&&l.get(_)!==S&&(l.set(_,S),t([...l.entries()]))},[i,t,l]),h=m.useRef(e[Symbol.iterator]()),p=m.useCallback((b,y)=>{var S=mr(b,y),C=l.get(S);if(C==null&&o.current){var _=h.current.next(),w=_.value,D=w;return l.set(S,D),D}return C},[l]),f=m.useCallback((b,y,S)=>{var C=mr(y,S),_=u.current.get(C);_===b&&(l.delete(C),u.current.delete(C),i.current&&t([...l.entries()]))},[i,t,l]),v=m.useCallback((b,y,S)=>{var C=mr(y,S),_=u.current.get(C);_===b&&u.current.delete(C)},[]),g=m.useMemo(()=>({addState:c,removeState:f,deregisterHook:v,getState:p}),[c,p,f,v]);return d.jsx(uu.Provider,{value:g,children:r})}function Rv(n,e){return Uv(n)||Hv(n,e)||Fv(n,e)||$v()}function $v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fv(n,e){if(n){if(typeof n=="string")return _a(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_a(n,e):void 0}}function _a(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Hv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Uv(n){if(Array.isArray(n))return n}var Bv=H.module("DashboardPanelWrapper");function Wv(n){var e=n.glContainer,t=n.children,r=m.useCallback(u=>{e.setPersistedState(u)},[e]),i=e.getConfig(),o=i.persistedState,a=m.useState(()=>o!=null&&!Array.isArray(o)?(Bv.warn("Persisted state is type ".concat(typeof o,". Expected array. Setting to empty array.")),[]):o??[]),s=Rv(a,1),l=s[0];return d.jsx(Lv,{initialState:l,onChange:r,children:t})}var Ki=m.createContext(null);Ki.displayName="PanelIdContext";function Kv(){return m.useContext(Ki)}function wa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wa(Object(t),!0).forEach(function(r){zv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zv(n,e,t){return(e=Vv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vv(n){var e=Gv(n,"string");return typeof e=="symbol"?e:e+""}function Gv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pr(n,e){return Yv(n)||Zv(n,e)||Xv(n,e)||qv()}function qv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xv(n,e){if(n){if(typeof n=="string")return Ea(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ea(n,e):void 0}}function Ea(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Zv(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Yv(n){if(Array.isArray(n))return n}var pn=H.module("DashboardLayout"),Qv=Object.freeze({}),Jv=[],Pa=()=>{},eg=1e3,Ta=n=>n;function TC(n){var e,t,r=n.id,i=n.children,o=n.emptyDashboard,a=o===void 0?d.jsx("div",{className:"dashboard-empty",children:"Dashboard is empty."}):o,s=n.layout,l=n.layoutConfig,u=l===void 0?Jv:l,c=n.onLayoutChange,h=c===void 0?Pa:c,p=n.onLayoutInitialized,f=p===void 0?Pa:p,v=n.hydrate,g=v===void 0?nu:v,b=n.dehydrate,y=b===void 0?tu:b,S=n.panelWrapper,C=Vs(),_=(e=Gs(F=>De(F,r)))!==null&&e!==void 0?e:Qv,w=m.useState(!1),D=pr(w,2),B=D[0],N=D[1],x=m.useState(!1),j=pr(x,2),L=j[0],re=j[1],A=m.useRef(),q=m.useState((t=_==null?void 0:_.closed)!==null&&t!==void 0?t:[]),ie=pr(q,1),oe=ie[0],be=m.useState(s.getReactChildren()),ye=pr(be,2),Oe=ye[0],we=ye[1],ce=m.useMemo(()=>new Map,[]),Z=m.useMemo(()=>new Map,[]),V=m.useCallback(function(F,ae){var se,nr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g,rr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:y;pn.debug2("registerComponent",F,ae,nr,rr);function dn(Mt,ir){var bt=ae,or=S,I=hl(bt),z=I?d.jsx(bt,Gt(Gt({},Mt),{},{ref:ir})):d.jsx(bt,Gt({},Mt)),J=Mt.glContainer,Me=Mt.glEventHub,je=T.getIdFromContainer(J);return d.jsx(cv,{glContainer:J,glEventHub:Me,children:d.jsx(Ki.Provider,{value:je,children:d.jsx(Wv,Gt(Gt({},Mt),{},{children:or==null?z:d.jsx(or,Gt(Gt({},Mt),{},{children:z}))}))})})}dn.displayName="DashboardWrapper(".concat((se=ae.displayName)!==null&&se!==void 0?se:F,")");var An=s.registerComponent(F,k.forwardRef(dn));return ce.set(F,nr),Z.set(F,rr),An},[g,y,ce,Z,s,S]),te=m.useCallback((F,ae)=>{var se;return((se=ce.get(F))!==null&&se!==void 0?se:Ta)(ae,r)},[ce,r]),G=m.useCallback((F,ae)=>{var se;return((se=Z.get(F))!==null&&se!==void 0?se:Ta)(ae,r)},[Z,r]),Q=m.useMemo(()=>new eu(s,te,G,new Map,oe,F=>{var ae=F.closed,se=F.openedMap;C(Pv(r,{closed:ae,openedMap:se}))}),[G,C,te,r,oe,s]),M=Oc(F=>{var ae=A.current,se=ae==null||!T.isEqual(ae,F);pn.debug("handleLayoutStateChanged",se,F),se&&(pn.debug("Layout config has changed","lastConfig",ae,"dehydratedLayoutConfig",F),N(s.root.contentItems.length===0),A.current=F,h(F),we(s.getReactChildren()))},eg,{flushOnUnmount:!0});m.useEffect(()=>()=>M.flush(),[M]);var Ge=m.useCallback(()=>{if(!L){var F=s.toConfig(),ae=F.content,se=T.dehydrateLayoutConfig(ae,G);M(se)}},[G,L,s,M]),er=m.useCallback(F=>{var ae=T.getIdFromContainer(F);s.eventHub.emit(ee.DRAGGING,ae),re(!0)},[s.eventHub]),ln=m.useCallback(F=>{var ae=T.getIdFromContainer(F);s.eventHub.emit(ee.DROPPED,ae),re(!1)},[s.eventHub]),zr=m.useCallback(F=>{if(pn.debug2("handleComponentCreated",F),!(F==null||F.config==null||!$t(F.config)||F.config.component==null||F.element==null)){var ae=F.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),se="".concat(ae,"-component");F.element.addClass(se)}},[]),tr=m.useCallback(()=>{we(s.getReactChildren())},[s]);mn(s,"stateChanged",Ge),mn(s,"itemPickedUp",er),mn(s,"itemDropped",ln),mn(s,"componentCreated",zr),mn(s.eventHub,ee.TITLE_CHANGED,Ge),mn(s,"reactChildrenChanged",tr);var un=Tc(u);return m.useEffect(function(){if(un!==u&&u!==A.current){pn.debug("loadNewConfig effect triggered. previousLayoutConfig",un,"layoutConfig",u,"lastConfig",A.current),pn.debug("Setting new layout content...");for(var ae=T.hydrateLayoutConfig(u,te);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var se=0;se<ae.length;se+=1)s.root.addChild(ae[se]);N(s.root.contentItems.length===0)}},[te,s,u,Q,un]),m.useEffect(()=>f(),[]),d.jsxs(d.Fragment,{children:[B&&a,Oe,k.Children.map(i,F=>F!=null?d.jsx(um,{fallback:[],children:k.cloneElement(F,{id:r,layout:s,panelManager:Q,registerComponent:V})}):null)]})}var du=m.createContext(null);du.displayName="DashboardIdContext";function OC(){var n=m.useContext(du);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function tg(n,e){return og(n)||ig(n,e)||rg(n,e)||ng()}function ng(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rg(n,e){if(n){if(typeof n=="string")return Oa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Oa(n,e):void 0}}function Oa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ig(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function og(n){if(Array.isArray(n))return n}function ag(n,e,t){return(e=sg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sg(n){var e=lg(n,"string");return typeof e=="symbol"?e:e+""}function lg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function cu(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=cu(r,e,t);if(i)return i;r=r.sibling}}}function ug(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var zi=ug(m.createContext(null));zi.displayName="FiberContext";class IC extends m.Component{constructor(){super(...arguments),ag(this,"_reactInternals",void 0)}render(){var e=this.props.children;return d.jsx(zi.Provider,{value:this._reactInternals,children:e})}}function dg(){var n=m.useContext(zi);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var e=m.useState(()=>Pt()),t=tg(e,1),r=t[0],i=m.useMemo(()=>{for(var o of[n,n==null?void 0:n.alternate].filter(s=>s!=null)){var a=cu(o,!1,s=>{for(var l=s.memoizedState;l!=null;){if(l.memoizedState===r)return!0;l=l.next}});if(a)return a}},[n,r]);return i}var xC="default",cg="CREATE_DASHBOARD",hg="CLOSE_DASHBOARD",Vi=mt(cg),DC=Vi.listen,mg=Vi.emit,MC=Vi.useListener,Gi=mt(hg),jC=Gi.listen,pg=Gi.emit,AC=Gi.useListener;function fg(n,e,t){return(e=vg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vg(n){var e=gg(n,"string");return typeof e=="symbol"?e:e+""}function gg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hu extends m.PureComponent{constructor(e){super(e),this.handleCloseTab=this.handleCloseTab.bind(this),this.handleCloseTabsRight=this.handleCloseTabsRight.bind(this),this.handleCloseTabsAll=this.handleCloseTabsAll.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this)}getAllTabs(){var e,t,r=this.props.glContainer;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var e=this.props.glContainer;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var e=this.props.glContainer,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,o,a,s;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;(a=((s=t[r])===null||s===void 0?void 0:s.contentItem).container)===null||a===void 0||a.close()}}handleReopenLast(){var e=this.props,t=e.glContainer,r=e.glEventHub;r.emit(ee.REOPEN_LAST,t)}canCloseTabsRight(){for(var e=this.props.glContainer,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,a,s;if(((o=t[i].contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id)===((a=e.tab)===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0?void 0:a.id))break;var l=!!(!((s=t[i])===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0)&&s.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(o){t=!1;break}}return t}canReopenLast(){var e,t,r=this.props,i=r.workspace,o=r.glContainer,a=(e=T.getStackForConfig(o.layoutManager.root,o.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=i.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===a))}render(){var e,t=this.props,r=t.additionalActions,i=t.glContainer,o=[...r];o.push(()=>({title:"Re-open closed panel",group:de.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var a=(e=i.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return o.push({title:"Close",order:10,group:de.groups.low,action:this.handleCloseTab,disabled:a===void 0||!a}),o.push(()=>({title:"Close Tabs to Right",order:20,group:de.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),o.push(()=>({title:"Close All",order:30,group:de.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),d.jsx(de,{actions:o})}}fg(hu,"defaultProps",{additionalActions:[]});var bg=n=>({workspace:Pl(n)}),yg=Vn(bg,{setWorkspace:Tl})(hu);function mu(n,e,t){return(e=Sg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sg(n){var e=Cg(n,"string");return typeof e=="symbol"?e:e+""}function Cg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pu extends m.PureComponent{constructor(e){super(e),mu(this,"renameInputRef",void 0),this.handleRenameDialogOpened=this.handleRenameDialogOpened.bind(this),this.handleRenameInputChange=this.handleRenameInputChange.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.renameInputRef=k.createRef();var t=e.value;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var t=e.isShown,r=this.props.isShown;r&&!t&&this.resetState()}resetState(){var e=this.props.value;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var e=this.props.onCancel;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var t=this.state.value,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var i=this.props.onSubmit;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var e=this.props,t=e.isShared,r=e.isOwner,i=e.itemType,o=this.state,a=o.value,s=o.valueWasValidated;return d.jsxs("form",{className:U("p-3",{"was-validated":s}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:l=>{l.stopPropagation()},onMouseUp:l=>{l.stopPropagation()},children:[d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{htmlFor:"rename-dialog-".concat(i,"-input"),children:["Rename ",i]}),d.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(i,"-input"),value:a??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),d.jsxs("div",{className:"invalid-feedback",children:[i," name cannot be empty"]}),(t||!r)&&d.jsxs("div",{className:"pt-2",children:["Renaming this ",i," will rename for all users."]})]}),d.jsxs("div",{className:"text-right",children:[d.jsx(ne,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),d.jsx(ne,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var e=this.props,t=e.isShown,r=e.onCancel;return d.jsx(Ar,{isShown:t,onEntered:this.handleRenameDialogOpened,onExited:r,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}mu(pu,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var fr=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function Ia(n,e,t){return(e=_g(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _g(n){var e=wg(n,"string");return typeof e=="symbol"?e:e+""}function wg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Eg=H.module("Panel");class Pg extends m.PureComponent{constructor(e){super(e),Ia(this,"ref",void 0),Ia(this,"getAdditionalActions",_n((r,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...r]})),this.handleCopyPanel=this.handleCopyPanel.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleHide=this.handleHide.bind(this),this.handleResize=this.handleResize.bind(this),this.handleBeforeShow=this.handleBeforeShow.bind(this),this.handleShow=this.handleShow.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.handleShowRenameDialog=this.handleShowRenameDialog.bind(this),this.handleTabClicked=this.handleTabClicked.bind(this),this.handleTab=this.handleTab.bind(this),this.ref=k.createRef();var t=this.props.glContainer;this.state={title:T.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t=this.props,r=t.componentPanel,i=t.glContainer,o=t.glEventHub;i.on("resize",this.handleResize),i.on("show",this.handleBeforeShow),i.on("shown",this.handleShow),i.on("hide",this.handleHide),i.on("tab",this.handleTab),i.on("tabClicked",this.handleTabClicked),o.on(fr.focus,this.handleTabFocus),o.on(fr.blur,this.handleTabBlur),o.emit(ee.MOUNT,r??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var e=this.props,t=e.componentPanel,r=e.glContainer,i=e.glEventHub;r.off("resize",this.handleResize),r.off("show",this.handleBeforeShow),r.off("shown",this.handleShow),r.off("hide",this.handleHide),r.off("tab",this.handleTab),r.off("tabClicked",this.handleTabClicked),i.off(fr.focus,this.handleTabFocus),i.off(fr.blur,this.handleTabBlur),i.emit(ee.UNMOUNT,t??this)}handleTab(e){e!=null&&this.setState({title:T.getTitleFromTab(e)}),this.forceUpdate();var t=this.props.onTab;t==null||t(e)}handleTabClicked(e){var t=this.props.onTabClicked;t==null||t(e)}handleFocus(e){var t=this.props,r=t.componentPanel,i=t.glEventHub;i.emit(ee.FOCUS,r??this);var o=this.props.onFocus;o==null||o(e)}handleBlur(e){var t=this.props.onBlur;t==null||t(e)}handleHide(){for(var e=this.props.onHide,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var e=this.props.onResize,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var e=this.props.onBeforeShow,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var e=this.props.onShow,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var e=this.props.onTabBlur,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var e=this.props.onTabFocus,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var t=this.props.glContainer;this.setState({showRenameDialog:!1,title:e});var r=T.getRootFromContainer(t),i=T.getComponentConfigFromContainer(t);W(i),T.renameComponent(r,i,e)}handleCopyPanel(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=T.getRootFromContainer(t),o=T.getComponentConfigFromContainer(t);if(o==null){Eg.error("Could not get component config from container",t);return}var a=T.cloneComponent(i,o);a!==null&&r.emit(ee.CLONED,this,a)}getCloneAction(){return{title:"Copy Panel",order:10,group:de.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:de.groups.medium,action:this.handleShowRenameDialog}}render(){var e=this.props,t=e.children,r=e.className,i=e.renderTabTooltip,o=e.glContainer,a=e.glEventHub,s=e.additionalActions,l=s===void 0?Rd:s,u=e.errorMessage,c=e.isLoaded,h=c===void 0?!0:c,p=e.isLoading,f=p===void 0?!1:p,v=e.isClonable,g=v===void 0?!1:v,b=e.isRenamable,y=b===void 0?!1:b,S=o.tab,C=this.state,_=C.showRenameDialog,w=C.title,D=C.isWithinPanel;return d.jsxs("div",{className:U("h-100 w-100 dh-panel",r),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[t,d.jsx(Kn,{"data-testid":"base-panel-loading",errorMessage:u,isLoaded:h,isLoading:f}),!D&&S!=null&&xi.createPortal(d.jsxs(d.Fragment,{children:[d.jsx(yg,{glContainer:o,glEventHub:a,additionalActions:this.getAdditionalActions(l,g,y)}),y&&d.jsx(pu,{isShown:_,value:w,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),i!=null&&d.jsx(ue,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:i()})]}),S.element[0])]})}}var Tg=yl(Pg),Og=H.module("useDhId"),Jr="__dhId";function kC(){var n,e,t=(n=(e=dg())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Jr],i=Kv();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Jr," to be a string, but got ").concat(typeof r));return r}return i??(Og.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Jr," prop. Defaulting to null.")),null)}const Ig="var(--dh-color-chart-colorway)",xg="var(--dh-color-chart-grid)",Dg="var(--dh-color-chart-axis-line)",Mg="var(--dh-color-chart-axis-line-zero)",xa={"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-fg)",colorway:Ig,gridcolor:xg,linecolor:Dg,zerolinecolor:Mg,"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)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)","map-style":"var(--dh-color-chart-map-style)"};function jg(n,e){return Lg(n)||Ng(n,e)||kg(n,e)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kg(n,e){if(n){if(typeof n=="string")return Da(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Da(n,e):void 0}}function Da(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ng(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Lg(n){if(Array.isArray(n))return n}var Ma=H.module("ChartTheme");function Rg(){var n,e=Fs(xa);return e.colorway=Gu((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var r=jg(t,2),i=r[0],o=r[1];return qu.normalizeCssColor(e.colorway.substring(i,o+1))}).join(" "),Ma.debug2("Chart theme:",xa),Ma.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"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"],map_style:e["map-style"]})}function ja(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $g(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ja(Object(t),!0).forEach(function(r){Fg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ja(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fg(n,e,t){return(e=Hg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hg(n){var e=Ug(n,"string");return typeof e=="symbol"?e:e+""}function Ug(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bg=m.lazy(()=>xd(()=>import("./Plot-CxolyxAB.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Wg(n){return d.jsx(m.Suspense,{fallback:d.jsx(Kn,{"data-testid":"lazy-plot-loading"}),children:d.jsx(Bg,$g({},n))})}var qi=m.createContext(null);qi.displayName="ChartThemeContext";function NC(n){var e=n.children,t=ol(),r=t.activeThemes,i=m.useMemo(Rg,[r]);return d.jsx(qi.Provider,{value:i,children:e})}function Kg(){return qn(qi,"No ChartThemeContext value found.")}function fu(n){var e=n.type,t=Cm();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return d.jsx(me,{icon:Zu});case t.VariableType.FIGURE:return d.jsx(me,{icon:Hs});case t.VariableType.PANDAS:return d.jsx(me,{icon:Xu});default:return d.jsx(me,{icon:$s})}}function Aa(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function zg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Aa(o,r,i,a,s,"next",l)}function s(l){Aa(o,r,i,a,s,"throw",l)}a(void 0)})}}function Vg(n,e){return Zg(n)||Xg(n,e)||qg(n,e)||Gg()}function Gg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qg(n,e){if(n){if(typeof n=="string")return ka(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ka(n,e):void 0}}function ka(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Xg(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Zg(n){if(Array.isArray(n))return n}function vu(n){var e=n.children,t=n.language,r=m.useState(null),i=Vg(r,2),o=i[0],a=i[1],s=ol(),l=s.activeThemes;return m.useEffect(()=>{var u=!1;function c(){return h.apply(this,arguments)}function h(){return h=zg(function*(){if(e!=null&&l!=null){var p=yield Re.colorize(e.toString(),t,{});u||a(p)}}),h.apply(this,arguments)}return c(),()=>{u=!0}},[l,e,t]),d.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:o!=null?{__html:o}:void 0})}class gu{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Or{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:Dd.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Or.isTableType(e,t)||Or.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function Yg(n){var e=n.children;return d.jsxs("div",{className:"console-history-item-result",children:[d.jsx("div",{className:"console-history-gutter",children:"-"}),d.jsx("div",{className:"console-history-content",children:e})]})}function Ei(n,e,t){return(e=Qg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qg(n){var e=Jg(n,"string");return typeof e=="symbol"?e:e+""}function Jg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bu extends m.Component{constructor(e){super(e),Ei(this,"timer",void 0),Ei(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var e=this.props,t=e.disabled,r=e.onCancelClick,i=this.state.elapsed;return d.jsx("div",{className:U("console-history-result-in-progress",{disabled:t}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Us,{className:"ml-2"}),"Running... ",He.formatElapsedTime(i)," ",d.jsx(ne,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Yu,tooltip:"Cancel",onClick:r,disabled:t})]})})}}Ei(bu,"defaultProps",{disabled:!1});function Bn(n,e,t){return(e=eb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eb(n){var e=tb(n,"string");return typeof e=="symbol"?e:e+""}function tb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On extends m.PureComponent{constructor(e){super(e),Bn(this,"mouseX",void 0),Bn(this,"mouseY",void 0),Bn(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=On.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=On.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var e=this.state,t=e.isExpanded,r=e.isTriggerHovered,i=this.props.message;W(i);var o=i.trimEnd(),a=o.indexOf(`
20
+ `),s=a>-1,l=o;s&&(l=o.slice(0,a));var u=o.slice(a),c=r?"error-btn-link error-btn-link--active":"error-btn-link";return d.jsxs("div",{className:U("error-message",{expanded:t}),children:[s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"error-gutter",children:d.jsx("button",{type:"button",onClick:this.handleToggleError,className:c,tabIndex:-1,children:d.jsx(me,{icon:t?ai:Qu,transform:"left-3"})})}),d.jsxs("div",{className:"error-content",children:[d.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:l}),t?u:""]})]}),!s&&d.jsx("div",{className:"error-content",children:d.jsx("div",{className:"console-error-text",children:l})})]},"error")}}Bn(On,"defaultProps",{message:""});Bn(On,"mouseDragThreshold",5);var yu=m.memo(n=>{var e=n.item,t=e.startTime,r=e.serverStartTime,i=e.serverEndTime,o=m.useMemo(()=>{var c;return(c=e.endTime)!==null&&c!==void 0?c:Date.now()},[e.endTime]),a=He.formatConvertedDuration(t,o),s=!!a,l=null;r!=null&&i!=null&&(l=He.formatConvertedDuration(r,i,"ns"));var u=!!l;return d.jsxs(d.Fragment,{children:[d.jsx(al,{children:"Execution Info"}),d.jsx(Md,{children:d.jsxs("div",{className:"console-history-item-contextual-help-content",children:[s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Elapsed time"}),d.jsx("div",{children:a})]}),u&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Server query time"}),d.jsx("div",{children:l})]})]})})]})});yu.displayName="ConsoleHistoryItemTooltip";var nb=n=>{if((n==null?void 0:n.command)==null)return null;var e=n.command?n.command.split(`
21
+ `).length:0;return e>2?null:"console-history-actions-".concat(e)},Su=m.memo(n=>{var e=n.item,t=n.onCommandSubmit,r=n.handleTooltipVisible,i=m.useMemo(()=>nb(e),[e]);return d.jsxs("div",{className:U("console-history-actions",i),children:[e.command!=null&&d.jsx(ml,{copy:e.command}),d.jsx(ne,{icon:Ju,kind:"inline",onClick:()=>{var o;return t((o=e.command)!==null&&o!==void 0?o:"")},tooltip:"Rerun",children:null}),d.jsx(jd,{variant:"info",onOpenChange:r,UNSAFE_className:"console-history-item-contextual-help",children:d.jsx(yu,{item:e})})]})});Su.displayName="ConsoleHistoryItemActions";function rb(n,e,t){return(e=ib(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ib(n){var e=ob(n,"string");return typeof e=="symbol"?e:e+""}function ob(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Na=H.module("ConsoleHistoryItem");class Cu extends m.PureComponent{constructor(e){super(e),this.state={isTooltipVisible:!1},this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Na.debug("handleObjectClick",e);var t=this.props.openObject;t(e)}handleCancelClick(){var e=this.props.item;e!=null&&e.cancelResult&&(Na.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var e=this.state.isTooltipVisible,t=this.props,r=t.disabled,i=t.item,o=t.language,a=t.iconForType,s=t.onCommandSubmit,l=i.disabledObjects,u=i.result,c=i.command!=null&&i.command!=="",h=null;c&&(h=d.jsxs("div",{className:U("console-history-item-command",{"console-history-item-command-tooltip-active":e}),children:[d.jsx("div",{className:"console-history-gutter",children:">"}),d.jsxs("div",{className:"console-history-content",children:[d.jsx(vu,{language:o,children:i.command}),d.jsx(Su,{item:i,onCommandSubmit:s,handleTooltipVisible:x=>this.setState({isTooltipVisible:x})})]})]}));var p=[],f=!1;if(u){var v=u.error,g=u.message,b=u.changes;if(b){var y=b.created,S=b.updated;[...y,...S].forEach(x=>{f=!0;var j=x.title,L="".concat(j),re=r===void 0||r||(l??[]).indexOf(L)>=0,A=d.jsx(ne,{kind:"primary",onClick:()=>this.handleObjectClick(x),className:"btn-console-object",disabled:re,icon:a(x.type),children:j},L);p.push(A)})}if(v!=null&&!c){var C,_="".concat((C=v.message)!==null&&C!==void 0?C:v);_||(_=v);var w=d.jsx(On,{message:_},"result-error");p.push(w)}if(g!==void 0&&g!==""){var D=d.jsx("div",{className:"log-message",children:g},"log-message");p.push(D)}}else{f=!0;var B=d.jsx(bu,{onCancelClick:this.handleCancelClick,disabled:r},"in_progress");p.push(B)}var N=null;return p.length>0&&(N=d.jsx(Yg,{children:p})),d.jsxs("div",{className:U("console-command-result",{"console-result-buttons":f}),children:[h,N]})}}rb(Cu,"defaultProps",{disabled:!1});function ab(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var sb=k.forwardRef(function(e,t){for(var r=e.disabled,i=r===void 0?!1:r,o=e.items,a=e.language,s=e.openObject,l=e.supportsType,u=e.iconForType,c=e.onCommandSubmit,h=[],p=0;p<o.length;p+=1){var f=o[p],v=d.jsx(Cu,{disabled:i,item:f,openObject:s,language:a,supportsType:l,iconForType:u,onCommandSubmit:c},ab(p,f));h.push(v)}return d.jsx("div",{ref:t,className:"container-fluid console-history",children:h})}),lb={name:"Console",CLEAR:le.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[P.CTRL,E.L],macShortcut:[P.CTRL,E.C]}),FOCUS_HISTORY:le.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[P.CTRL,E.H],macShortcut:[P.CTRL,P.OPTION,E.H]})},ub={name:"Command History",FOCUS_HISTORY:le.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[P.CTRL,E.H],macShortcut:[P.CTRL,P.OPTION,E.H]}),SEND_TO_CONSOLE:le.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[E.ENTER],macShortcut:[E.ENTER]}),SEND_TO_NOTEBOOK:le.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[P.CTRL,E.ENTER],macShortcut:[P.CMD,E.ENTER]}),RUN:le.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[P.ALT,E.R],macShortcut:[P.OPTION,E.R]})},db={name:"Notebook",RUN:le.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[P.ALT,E.R],macShortcut:[P.OPTION,E.R]}),RUN_SELECTED:le.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[P.ALT,P.SHIFT,E.R],macShortcut:[P.OPTION,P.SHIFT,E.R]}),FIND:le.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[P.CTRL,E.F],macShortcut:[P.CMD,E.F],isEditable:!1}),MINIMAP:le.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[P.ALT,E.M],macShortcut:[P.OPTION,E.M]}),WORDWRAP:le.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[P.ALT,E.Z],macShortcut:[P.OPTION,E.Z]})},En={CONSOLE:lb,COMMAND_HISTORY:ub,NOTEBOOK:db};const Pe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),cb="var(--dh-color-editor-bg)",hb="var(--dh-color-editor-fg)",mb="var(--dh-color-editor-string)",pb="var(--dh-color-editor-delimiter)",fb="var(--dh-color-editor-predefined)",vb="var(--dh-color-editor-keyword)",gb="var(--dh-color-editor-storage)",bb="var(--dh-color-editor-number)",yb="var(--dh-color-editor-operator)",Sb="var(--dh-color-editor-identifier)",Cb="var(--dh-color-editor-comment)",Pi={"error-foreground":"var(--dh-color-editor-error-fg)",background:cb,foreground:hb,"line-height":"19px",string:mb,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:pb,predefined:fb,keyword:vb,storage:gb,number:bb,operator:yb,identifier:Sb,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:Cb,"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-line-number-active-foreground":"var(--dh-color-editor-line-number-active-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)","diff-editor-inserted-text-background":"var(--dh-color-editor-diff-inserted-text-bg)","diff-editor-removed-text-background":"var(--dh-color-editor-diff-removed-text-bg)","diff-editor-inserted-line-background":"var(--dh-color-editor-diff-inserted-line-bg)","diff-editor-removed-line-background":"var(--dh-color-editor-diff-removed-line-bg)"};var _b="python",wb={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/}}},Eb={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"]]}},Pb={id:_b,conf:wb,language:Eb},Tb="groovy",Ob={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/}}},Ib={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"]]}},xb={id:Tb,conf:Ob,language:Ib},Db="scala",Mb={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>))/}}},jb={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"]]}},Ab={id:Db,conf:Mb,language:jb},kb="deephavenDb",Nb={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/}}},Lb={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"]]}},Rb={id:kb,conf:Nb,language:Lb},$b="log",Fb={},Hb={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"}]]}},Ub={id:$b,conf:Fb,language:Hb},Bb={preview:!0,"target-version":"py38","line-length":88,"indent-width":4,format:{"indent-style":"space","quote-style":"double"},lint:{"flake8-implicit-str-concat":{"allow-multiline":!1},ignore:["ISC003"],select:["F","E1","E9","E711","W291","W293","W605","B","A","COM818","ISC","PLE","RUF001","RUF021","RUF027","PLR1704","LOG","ASYNC","RET501","RET502","RET503","PLC2401","PLC2403","NPY","PERF","C4"]}};function La(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Wb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){La(o,r,i,a,s,"next",l)}function s(l){La(o,r,i,a,s,"throw",l)}a(void 0)})}}function Bt(n,e,t){return(e=Kb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kb(n){var e=zb(n,"string");return typeof e=="symbol"?e:e+""}function zb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var et=H.module("MonacoCompletionProvider");class R extends m.PureComponent{static initRuff(){return Wb(function*(){if(R.isRuffEnabled)return R.initRuffPromise||(R.initRuffPromise=kd({}).then(()=>{et.debug("Initialized Ruff",oo.version()),R.isRuffInitialized=!0,R.updateRuffWorkspace()})),R.initRuffPromise})()}static updateRuffWorkspace(){if(R.isRuffInitialized){var e=console.log;try{console.log=()=>{},R.ruffWorkspace=new oo(R.ruffSettings)}finally{console.log=e}R.lintAllPython()}}static setRuffSettings(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R.ruffSettings;if(R.ruffSettings=e,!R.isRuffInitialized){R.initRuff();return}R.updateRuffWorkspace()}static getDiagnostics(e){if(!R.ruffWorkspace)return[];var t=R.ruffWorkspace.check(e.getValue());return Te.isConsoleModel(e)?t.filter(r=>r.code==null):t}static lintAllPython(){if(!R.isRuffEnabled){Re.removeAllMarkers("ruff");return}Re.getModels().filter(e=>e.getLanguageId()==="python").forEach(R.lintPython)}static lintPython(e){if(R.isRuffEnabled&&R.ruffWorkspace){var t=R.getDiagnostics(e);et.debug("Linting Python document: ".concat(e.uri.toString()),t),Re.setModelMarkers(e,"ruff",t.map(r=>{var i=r.code==="F401"||r.code==="F841",o=r.code==null;return{startLineNumber:r.location.row,startColumn:r.location.column,endLineNumber:r.end_location.row,endColumn:r.end_location.column,message:o?r.message:"".concat(r.code,": ").concat(r.message),severity:o?ao.Error:ao.Warning,tags:i?[Ad.Unnecessary]:[]}}))}}static lspToMonacoKind(e){var t=rt.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){var t=e.start,r=e.end;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}static handlePythonCodeActionRequest(e,t){if(!R.isRuffEnabled||!R.ruffWorkspace)return{actions:[],dispose:()=>{}};var r=R.getDiagnostics(e).filter(u=>{var c=new qs(u.location.row,u.location.column,u.end_location.row,u.end_location.column);return u.code!=null&&c.intersectRanges(t)}),i=r.filter(u=>{var c=u.fix;return c!=null}).map(u=>{var c="Fix";return u.fix!=null&&(u.fix.message!=null&&u.fix.message!==""?c="".concat(u.code,": ").concat(u.fix.message):c="Fix ".concat(u.code)),{title:c,id:"fix-".concat(u.code),kind:"quickfix",edit:u.fix?{edits:u.fix.edits.map(h=>{var p;return{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:h.location.row,startColumn:h.location.column,endLineNumber:h.end_location.row,endColumn:h.end_location.column},text:(p=h.content)!==null&&p!==void 0?p:""}}})}:void 0}}),o=new Set,a=new Set;r.forEach(u=>{u.code!=null&&(o.has(u.code)&&a.add(u.code),o.add(u.code))});var s=r.map(u=>{if(u.code==null)return[];var c=e.getLineContent(u.location.row),h=Re.tokenize(c,e.getLanguageId())[0].at(-1),p={range:{startLineNumber:u.location.row,startColumn:c.length+1,endLineNumber:u.location.row,endColumn:c.length+1},text:" # noqa: ".concat(u.code)};return h!=null&&h.type.startsWith("comment")&&(p.text="# noqa: ".concat(u.code," "),c.startsWith("# noqa:",h.offset)?(p.range.startColumn=h.offset+1,p.range.endColumn=h.offset+9):(p.range.startColumn=h.offset+1,p.range.endColumn=c.startsWith("# ",h.offset)?h.offset+3:h.offset+2)),[{title:"Disable ".concat(u.code," for ").concat(a.has(u.code)?"line ".concat(u.location.row):"this line"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:p}]}}]}).flat().filter((u,c,h)=>h.find(p=>p.title===u.title)===u),l=[...o].map(u=>({title:"Disable ".concat(u," for this file"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:"# ruff: noqa: ".concat(u,`
22
+ `)}}]}}));return{actions:[...i,...s,...l],dispose:()=>{}}}static handlePythonFormatRequest(e,t,r){if(R.ruffWorkspace)return et.debug("Formatting Python document: ".concat(e.uri.toString)),[{range:e.getFullModelRange(),text:R.ruffWorkspace.format(e.getValue())}]}constructor(e){super(e),Bt(this,"registeredCompletionProvider",void 0),Bt(this,"registeredSignatureProvider",void 0),Bt(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var e=this.props,t=e.language,r=e.session;this.registeredCompletionProvider=rt.registerCompletionItemProvider(t,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),r.getSignatureHelp!=null&&(this.registeredSignatureProvider=rt.registerSignatureHelpProvider(t,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),r.getHover!=null&&(this.registeredHoverProvider=rt.registerHoverProvider(t,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,r;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(r=this.registeredHoverProvider)===null||r===void 0||r.dispose()}handleCompletionRequest(e,t,r){var i=this.props,o=i.model,a=i.session;if(e!==o)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:R.monacoToLspPosition(t),context:r},l=a.getCompletionItems(s);et.debug("Requested completion items",s);var u=l.then(c=>{et.debug("Completion items received: ",s,c);var h=c.map(p=>{var f=p.label,v=p.kind,g=p.detail,b=p.documentation,y=p.sortText,S=p.filterText,C=p.textEdit,_=p.insertTextFormat;return{label:f,kind:R.lspToMonacoKind(v),detail:g,documentation:(b==null?void 0:b.kind)==="markdown"?b:b==null?void 0:b.value,sortText:y,filterText:S,insertText:C.text,insertTextRules:_===2?4:_,range:R.lspToMonacoRange(C.range)}});return{incomplete:!0,suggestions:h}}).catch(c=>(et.error("There was an error retrieving completion items",c),{suggestions:[]}));return u}handleSignatureRequest(e,t,r,i){var o={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},a=this.props,s=a.model,l=a.session;if(e!==s||l.getSignatureHelp==null)return null;var u={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:R.monacoToLspPosition(t),context:i},c=l.getSignatureHelp(u);et.debug("Requested signature help",u);var h=c.then(p=>{et.debug("Signatures received: ",u,c);var f=p.map(g=>{var b=g.label,y=g.documentation,S=g.parameters;return{documentation:(y==null?void 0:y.kind)==="markdown"?y:y==null?void 0:y.value,label:b,parameters:S??[]}});if(f.length===0)return o;var v=0;return{value:{signatures:f,activeSignature:v,activeParameter:p[v].activeParameter},dispose:()=>{}}}).catch(p=>(et.error("There was an error retrieving completion items",p),o));return h}handleHoverRequest(e,t){var r=this.props,i=r.model,o=r.session;if(e!==i||o.getHover==null)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:R.monacoToLspPosition(t)},s=o.getHover(a);et.debug("Requested hover",a);var l=s.then(u=>{et.debug("Hover received: ",a,u);var c=u.contents;return{contents:c!=null?[c]:[]}}).catch(u=>(et.error("There was an error retrieving hover",u),{contents:[]}));return l}render(){return null}}Bt(R,"ruffWorkspace",void 0);Bt(R,"initRuffPromise",void 0);Bt(R,"isRuffInitialized",!1);Bt(R,"isRuffEnabled",!0);Bt(R,"ruffSettings",Bb);function Ra(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Vb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ra(o,r,i,a,s,"next",l)}function s(l){Ra(o,r,i,a,s,"throw",l)}a(void 0)})}}function $a(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$a(Object(t),!0).forEach(function(r){Gb(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$a(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gb(n,e,t){return(e=qb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qb(n){var e=Xb(n,"string");return typeof e=="symbol"?e:e+""}function Xb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var St=H.module("MonacoUtils"),Ha="inmemory://dh-console/";class Te{static init(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getWorker;St.debug("Initializing Monaco..."),t!==void 0&&Te.registerGetWorker(t);var r=Te.initTheme,i=Te.registerLanguages;r(),i([Rb,Pb,xb,Ub,Ab]),rt.onLanguage("python",()=>{rt.registerCodeActionProvider("python",{provideCodeActions:R.handlePythonCodeActionRequest},{providedCodeActionKinds:["quickfix"]}),rt.registerDocumentFormattingEditProvider("python",{provideDocumentFormattingEdits:R.handlePythonFormatRequest})}),Re.onDidCreateModel(o=>{if(o.getLanguageId()==="python"){R.ruffWorkspace!=null&&R.lintPython(o);var a=Mr(s=>R.lintPython(s),250);o.onDidChangeContent(()=>{a(o)})}}),Te.removeConflictingKeybindings(),St.debug("Monaco initialized.")}static initTheme(){var e,t,r=Te.removeHashtag,i=Fs(Pi);St.debug2("Monaco theme:",Pi),St.debug2("Monaco theme derived:",i);var o=[{token:"",foreground:r(i.foreground)},{token:"string",foreground:r(i.string)},{token:"string.delim",foreground:r(i["string-delim"])},{token:"keyword",foreground:r(i.keyword)},{token:"identifier.js",foreground:r(i["identifier-js"])},{token:"delimiter",foreground:r(i.delimiter)},{token:"comment",foreground:r(i.comment)},{token:"number",foreground:r(i.number)},{token:"storage",foreground:r(i.storage)},{token:"identifier",foreground:r(i.identifier)},{token:"namespace.identifier",foreground:r(i["namespace-identifier"])},{token:"operator",foreground:r(i.operator)},{token:"predefined",foreground:r(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:r(i["log-warn"])},{token:"info.log",foreground:r(i["log-info"])},{token:"stdout.log",foreground:r(i["log-stdout"])},{token:"trace.log",foreground:r(i["log-trace"])},{token:"debug.log",foreground:r(i["log-debug"])},{token:"date.log",foreground:r(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"],"editorLineNumber.activeForeground":i["editor-line-number-active-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"],"diffEditor.insertedTextBackground":i["diff-editor-inserted-text-background"],"diffEditor.removedTextBackground":i["diff-editor-removed-text-background"],"diffEditor.insertedLineBackground":i["diff-editor-inserted-line-background"],"diffEditor.removedLineBackground":i["diff-editor-removed-line-background"]};Re.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:a});try{Re.setTheme("dh-dark")}catch(s){St.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),Re.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=Fa(Fa({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e==null?void 0:e.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(r=>{var i=r.id;return i});rt.getLanguages().filter(r=>{var i=r.id;return t.includes(i)}).forEach(r=>{var i=r;St.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{Te.registerLanguage(r)})}static registerLanguage(e){St.debug2("Registering language: ",e.id),rt.register(e),rt.onLanguage(e.id,()=>{rt.setLanguageConfiguration(e.id,e.conf),rt.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Re.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();W(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};St.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var o=e.onDidChangeModelContent(a=>{for(var s=a.changes,l=a.versionId,u=[],c=0;c<s.length;c+=1){var h=s[c],p=h.range,f=h.rangeLength,v=h.text,g={range:{start:{line:p.startLineNumber-1,character:p.startColumn-1},end:{line:p.endLineNumber-1,character:p.endColumn-1}},rangeLength:f,text:v};u.push(g)}if(u.length>0){var b={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:u};St.debug2("didChangeDocumentParams",b),t.changeDocument(b)}});return o}static closeDocument(e,t){var r=e.getModel();W(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,o=/\u00A0/g,a=e.getModel();W(a);var s=a.getValueInRange(t.range);(r.test(s)||i.test(s)||o.test(s))&&a.applyEdits([{range:t.range,text:s.replace(r,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var e=window.navigator.platform;return e.startsWith("Mac")}static removeConflictingKeybindings(){Re.addKeybindingRule({keybinding:nt.CtrlCmd|tn.KeyD,command:null}),Te.isMacPlatform()||Re.addKeybindingRule({keybinding:nt.CtrlCmd|tn.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(Pt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var t=e.keyState,r=t.keyValue;if(r===null)return 0;var i=Te.isMacPlatform();return i?(t.metaKey?nt.CtrlCmd:0)|(t.shiftKey?nt.Shift:0)|(t.altKey?nt.Alt:0)|(t.ctrlKey?nt.WinCtrl:0)|so.fromString(r):(t.ctrlKey?nt.CtrlCmd:0)|(t.shiftKey?nt.Shift:0)|(t.altKey?nt.Alt:0)|(t.metaKey?nt.WinCtrl:0)|so.fromString(r)}static provideLinks(e){for(var t=[],r=function(a){var s=e.getLineContent(a),l=Ld(s),u=l.filter(c=>c.type==="url"?/^https?:\/\//.test(c.value):!0);u.forEach(c=>{t.push({url:c.href,range:new qs(a,c.start+1,a,c.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}static generateConsoleUri(){return Nd.parse("".concat(Ha).concat(Pt()))}static isConsoleModel(e){return e.uri.toString().startsWith(Ha)}static canFormat(e){var t;return((t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.isSupported())===!0}static formatDocument(e){return Vb(function*(){var t;yield(t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.run()})()}}function Ua(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Zb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ua(o,r,i,a,s,"next",l)}function s(l){Ua(o,r,i,a,s,"throw",l)}a(void 0)})}}function Xe(n,e,t){return(e=Yb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yb(n){var e=Qb(n,"string");return typeof e=="symbol"?e:e+""}function Qb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ei=H.module("ConsoleInput"),Ir=parseInt(Pi["line-height"],10),_u=6,wu=6,Jb=Ir+_u+wu,ti=100;class In extends m.PureComponent{constructor(e){super(e),Xe(this,"cancelListener",void 0),Xe(this,"resizeObserver",void 0),Xe(this,"commandContainer",void 0),Xe(this,"commandEditor",void 0),Xe(this,"commandHistoryIndex",void 0),Xe(this,"commandSuggestionContainer",void 0),Xe(this,"loadingPromise",void 0),Xe(this,"timestamp",void 0),Xe(this,"bufferIndex",void 0),Xe(this,"history",void 0),Xe(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=k.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={commandEditorHeight:Ir,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){this.resizeObserver.disconnect(),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(ei.debug("Command received: ",e),!r){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),r&&this.processCommand(e)}}initCommandEditor(){var e=this.props,t=e.language,r=e.session,i=Re.createModel("",t,Te.generateConsoleUri()),o={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:t,lineHeight:Ir,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:_u,bottom:wu},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace",model:i},a=this.commandContainer.current;W(a),this.commandEditor=Re.create(a,o),Te.setEOL(this.commandEditor),Te.openDocument(this.commandEditor,r),this.commandEditor.onDidChangeModelContent(()=>{var s,l=(s=this.commandEditor)===null||s===void 0?void 0:s.getValue();this.modifiedCommands.set(this.commandHistoryIndex,l??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(s=>{var l=this.commandEditor,u=this.commandHistoryIndex,c=l==null?void 0:l.getPosition();W(c);var h=c.lineNumber;if(!s.altKey&&!s.shiftKey&&!s.metaKey){if(s.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&h===1){u!=null?this.loadCommand(u+1):this.loadCommand(0),this.focusStart(),s.stopPropagation(),s.preventDefault();return}if(s.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&h===(i==null?void 0:i.getLineCount())){u!=null&&u>0?this.loadCommand(u-1):this.loadCommand(null),this.focusEnd(),s.stopPropagation(),s.preventDefault();return}if(s.keyCode===tn.Enter&&!this.isSuggestionMenuPopulated()){var p;s.stopPropagation(),s.preventDefault();var f=(p=this.commandEditor)===null||p===void 0?void 0:p.getValue().trim();if(f!==void 0){var v;this.processCommand(f),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}}),Te.disableKeyBindings(this.commandEditor,[nt.CtrlCmd|tn.KeyF]),Te.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(a),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var e=this.props.session;this.commandEditor&&(Te.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(t=t.getDomNode())===null||t===void 0?void 0:t.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(t=t.querySelector(".monaco-list-rows"))===null||t===void 0?void 0:t.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,r,i,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();W(a);var s=a.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,s);W(l),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:1,column:s}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,r,i,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();W(a);var s=a.getLineCount(),l=a.getLineLength(s)+1,u=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(s,l);W(u),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:s,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(u),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),i=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(r??i),e!==null&&e>this.history.length-ti&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Zb(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var t=e.props,r=t.commandHistoryStorage,i=t.language,o=t.scope;e.loadingPromise=Qe.makeCancelable(r.getTable(i,o??"",e.timestamp),l=>l.close());var a=yield e.loadingPromise;a.setReversed(!0),a.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+ti-1}),e.loadingPromise=Qe.makeCancelable(a.getViewportData(),()=>a.close());var s=yield e.loadingPromise;e.bufferIndex+=ti,e.bufferIndex>=a.size&&(e.bufferIndex=null),e.history=[...s.items.filter((l,u,c)=>{var h=l.name;return u===0||h!==c[u-1].name}).map(l=>{var u=l.name;return u}).reverse(),...e.history],e.loadingPromise=void 0,a.close()}catch(l){if(e.loadingPromise=void 0,Qe.isCanceled(l)){ei.debug2("Promise canceled, not loading history");return}ei.error("Error fetching history",l)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),W(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var t=this.props.onSubmit;t(e)}updateDimensions(){if(this.commandEditor){var e=this.props.maxHeight;W(e);var t=this.commandEditor.getContentHeight(),r=Math.max(Math.min(t,e),Jb),i=t>r,o={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:r},()=>{var a,s;(a=this.commandEditor)===null||a===void 0||a.updateOptions(o),(s=this.commandEditor)===null||s===void 0||s.layout()})}}render(){var e=this.props,t=e.disabled,r=e.language,i=e.session,o=this.state,a=o.commandEditorHeight,s=o.isFocused,l=o.model;return d.jsx("div",{className:U("console-input-wrapper",{disabled:t}),children:d.jsxs("div",{className:U("console-input-inner-wrapper",{focus:s}),children:[d.jsx("div",{className:In.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:a}}),l&&d.jsx(R,{model:l,language:r,session:i})]})})}}Xe(In,"defaultProps",{maxHeight:Ir*10,scope:null,disabled:!1});Xe(In,"INPUT_CLASS_NAME","console-input");function Ft(n,e,t){return(e=ey(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ey(n){var e=ty(n,"string");return typeof e=="symbol"?e:e+""}function ty(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ba="pasted values",ny=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],ni=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Wa=[".zip"];class $e extends m.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!ny.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ni.some(r=>e.endsWith(r))||t&&Wa.some(r=>e.endsWith(r))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===Ba?to:e.endsWith(".csv")?ed:e.endsWith(".zip")?td:nd}constructor(e){super(e),Ft(this,"fileElem",void 0),Ft(this,"divElem",void 0),Ft(this,"getValidExtensions",_n(t=>t?[...ni,...Wa]:[...ni])),Ft(this,"getAcceptString",_n(t=>this.getValidExtensions(t).join(", "))),Ft(this,"getFileTypeErrorString",_n(t=>vc.join(this.getValidExtensions(t),"or"))),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=k.createRef(),this.divElem=k.createRef(),this.state={selectedFileName:""}}componentDidMount(){var e,t;(e=this.divElem.current)===null||e===void 0||e.addEventListener("paste",this.handlePasteEvent),(t=this.divElem.current)===null||t===void 0||t.focus()}componentWillUnmount(){var e;(e=this.divElem.current)===null||e===void 0||e.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){if(this.fileElem.current){var e;this.fileElem.current.value="",(e=this.fileElem.current)===null||e===void 0||e.click()}}handleFiles(e){e.stopPropagation(),e.preventDefault();var t=e.target.files;t!=null&&this.handleFile(t[0])}handleDrop(e){var t=this.props,r=t.allowZip,i=t.clearDragError,o=t.dragError;if(e.preventDefault(),e.stopPropagation(),o!=null){i();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var a=e.dataTransfer.items[0].getAsFile();W(a),$e.isValidExtension(a.name,r)?this.handleFile(a):this.setState({dropError:$e.FILE_TYPE_ERROR})}}unstageFile(e){var t=this.props.onCancel;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var t=this.props.onFileOpened;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var e=this.props,t=e.onPaste,r=e.onError,i=e.uploadInProgress;i||navigator.clipboard.readText().then(o=>{t(o),this.setState({selectedFileName:Ba,dropError:void 0})}).catch(o=>r(o))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var e=this.props.uploadInProgress;return[{title:"Paste",icon:to,action:this.handleMenuPaste,shortcut:yn.PASTE,disabled:e}]}render(){var e=this.props,t=e.allowZip,r=e.dragError,i=e.uploadInProgress,o=this.state,a=o.selectedFileName,s=o.dropError,l=r??s,u=this.makeContextMenuItems();return d.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:$e.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[d.jsx(de,{actions:u}),d.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(t),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!a&&(l===void 0||l==="")&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(me,{icon:rd})}),d.jsx("label",{children:"Drop file (or paste values) here to import"}),d.jsx("div",{className:"message-small",children:d.jsx("label",{children:"or"})}),d.jsx(ne,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),a&&(l===void 0||l==="")&&d.jsxs("div",{className:"selected-content",children:[d.jsx("div",{className:"selected-icon",children:d.jsx(me,{icon:$e.getIcon(a)})}),d.jsxs("div",{className:"selected-text",children:[d.jsx("label",{children:"Selected File"}),d.jsxs("label",{className:"selected-name",children:[a,!i&&d.jsx(ne,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:id,tooltip:"Remove"})]})]})]}),!!l&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(me,{icon:Bs})}),d.jsx("label",{children:l}),l===$e.FILE_TYPE_ERROR&&d.jsx("div",{className:"message-small",children:d.jsx("label",{children:this.getFileTypeErrorString(t)})})]})]})}}Ft($e,"defaultProps",{allowZip:!1,dragError:null});Ft($e,"MULTIPLE_FILE_ERROR","Please select only one file");Ft($e,"FILE_TYPE_ERROR","Filetype not supported.");function Eu(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(r,i)=>e(i)),t}function Ka(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function za(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ka(Object(t),!0).forEach(function(r){ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ka(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ke(n,e,t){return(e=ry(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ry(n){var e=iy(n,"string");return typeof e=="symbol"?e:e+""}function iy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Va="unknown",oy=2147483647,ay=-2147483648,Ga=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,qa=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Ie{static determineType(e,t,r){if(!e||e===r)return t;switch(t){case K.STRING:return K.STRING;case K.INTEGER:return Ie.checkInteger(e);case K.LONG:return Ie.checkLong(e);case K.DOUBLE:return Ie.checkDouble(e);case K.BOOLEAN:return Ie.checkBoolean(e);case K.DATE_TIME:return Ie.checkDateTime(e);case K.LOCAL_TIME:return Ie.checkLocalTime(e);default:return Ie.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return Ie.isNotParsableNumber(t)?K.STRING:Ie.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return Ie.isNotParsableNumber(t)?K.STRING:t.includes(".")?K.DOUBLE:K.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return Ie.isNotParsableNumber(t)?K.STRING:K.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?K.BOOLEAN:K.STRING}static checkDateTime(e){return Ga.test(e)?K.DATE_TIME:K.STRING}static checkLocalTime(e){return qa.test(e)?K.LOCAL_TIME:K.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(Ie.isNotParsableNumber(t)){var r=e.toLowerCase();return r==="true"||r==="false"?K.BOOLEAN:Ga.test(e)&&e.includes(":")?K.DATE_TIME:qa.test(e)?K.LOCAL_TIME:K.STRING}return Ie.getNumberType(t)}static getNumberType(e){if(e.includes("."))return K.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return K.LONG;var r=parseInt(e,10);return r>oy||r<ay?K.LONG:K.INTEGER}constructor(e,t,r,i,o,a,s,l,u,c){ke(this,"onFileCompleted",void 0),ke(this,"file",void 0),ke(this,"readHeaders",void 0),ke(this,"nullString",void 0),ke(this,"onProgress",void 0),ke(this,"onError",void 0),ke(this,"types",void 0),ke(this,"chunks",void 0),ke(this,"totalChunks",void 0),ke(this,"rowCount",void 0),ke(this,"isZip",void 0),ke(this,"shouldTrim",void 0),ke(this,"zipProgress",void 0),ke(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=r,this.nullString=o,this.onProgress=a,this.onError=s,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=u,this.shouldTrim=c,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config=za(za({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)Fn.parse(this.file,this.config);else{var e=Eu(this.file,this.handleNodeUpdate);Fn.parse(e,this.config),e.resume()}}handleChunk(e,t){var r=e.data;if(!this.types){if(r==null||r.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(r[0].length).fill(Va),this.readHeaders&&(r=r.slice(1))}this.rowCount+=r.length,W(this.types);var i=[...this.types];r.forEach(s=>{if(s.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=Ie.determineType(this.shouldTrim?s[l].trim():s[l],i[l],this.nullString);this.types=i}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
23
23
  Expected length `.concat(i.length," but found ").concat(s.length,`.
24
- Row = `).concat(s))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2);var a=this.onProgress(o);a&&t.abort()}handleComplete(e){var t=this.types,r=this.onFileCompleted;B(t),(e==null||!e.meta.aborted)&&r(t.map(i=>i===za||i===K.LOCAL_TIME?K.STRING:i),this.rowCount)}handleError(e){var t=this.onError;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}var _u;function he(n,e,t){return(e=ry(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ry(n){var e=iy(n,"string");return typeof e=="symbol"?e:e+""}function iy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var pr=H.module("CsvParser"),oy=650;class On{static generateHeaderRecursive(e){var t="",r=e;return e>=26&&(t=t.concat(On.generateHeaderRecursive(Math.floor(e/26)-1)),r=e%26),t.concat(String.fromCharCode(65+r))}constructor(e){var t=e.onFileCompleted,r=e.session,i=e.file,o=e.type,a=e.readHeaders,s=a===void 0?!0:a,l=e.onProgress,u=e.onError,c=e.timeZone,m=e.isZip;he(this,"onFileCompleted",void 0),he(this,"session",void 0),he(this,"file",void 0),he(this,"isZip",void 0),he(this,"type",void 0),he(this,"readHeaders",void 0),he(this,"timeZone",void 0),he(this,"onProgress",void 0),he(this,"onError",void 0),he(this,"tables",void 0),he(this,"headers",void 0),he(this,"types",void 0),he(this,"rowCount",void 0),he(this,"rowsProcessed",void 0),he(this,"chunks",void 0),he(this,"totalChunks",void 0),he(this,"isComplete",void 0),he(this,"zipProgress",void 0),he(this,"consolidatedChunks",void 0),he(this,"numConsolidated",void 0),he(this,"isCancelled",void 0),he(this,"config",void 0),this.onFileCompleted=t,this.session=r,this.file=i,this.isZip=m,this.type=o,this.readHeaders=s,this.timeZone=c,this.onProgress=l,this.onError=u,this.tables=[],this.rowCount=0,this.rowsProcessed=0,this.chunks=0,this.totalChunks=m?0:Math.ceil(i.size/Nn.LocalChunkSize),this.isComplete=!1,this.zipProgress=0,this.numConsolidated=0,this.isCancelled=!1,this.handleChunk=this.handleChunk.bind(this),this.handleError=this.handleError.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.handleCreateTable=this.handleCreateTable.bind(this),this.config={delimiter:o.delimiter,newline:o.newline,escapeChar:o.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:o.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(e,t){for(var r=t.length,i=new Array(e).fill(null).map(()=>new Array(r)),o=0;o<r;o+=1){var a=t[o];if(a.length<e)throw new Error("Insufficient columns. Expected ".concat(e," but found ").concat(a.length,`
25
- `).concat(a));for(var s=0;s<e;s+=1){var l=this.type.shouldTrim?t[o][s].trim():t[o][s];i[s][o]=this.nullCheck(l)}}return i}nullCheck(e){return e===this.type.nullString?"":e}parse(){var e=(r,i)=>{if(this.types=r,this.rowCount=i,this.file instanceof File||this.file instanceof Blob)Nn.parse(this.file,this.config);else{var o=wu(this.file,this.handleNodeUpdate);Nn.parse(o,this.config),o.resume()}},t=new Oe(e,this.file,this.readHeaders,this.config,this.type.nullString,this.onProgress,this.onError,this.totalChunks,this.isZip,this.type.shouldTrim);t.parse()}handleChunk(e,t){var r=this.readHeaders,i=this.onError,o=this.handleCreateTable,a=this.isZip,s=this.tables;if(this.isCancelled){pr.debug2("CSV parser cancelled."),t.abort(),s.forEach(m=>m.close());return}var l=e.data;this.headers||(r?(this.headers=gt.legalizeColumnNames(l[0]),l=l.slice(1)):this.headers=On.generateHeaders(l[0].length));var u=[];try{if(u=this.transpose(this.headers.length,l),a)this.consolidateChunks(u,t);else{var c=this.chunks;this.chunks+=1,o(c,u,t)}}catch(m){i(m)}}consolidateChunks(e,t){if(!this.consolidatedChunks)this.consolidatedChunks=e.slice();else for(var r=0;r<e.length;r+=1)this.consolidatedChunks[r]=this.consolidatedChunks[r].concat(e[r]);this.numConsolidated+=1,(this.numConsolidated>=oy||this.isComplete)&&this.uploadConsolidatedChunks(t)}uploadConsolidatedChunks(e){var t,r=this.handleCreateTable,i=this.chunks;this.chunks+=1;var o=(t=this.consolidatedChunks)===null||t===void 0?void 0:t.slice();this.consolidatedChunks=void 0,this.numConsolidated=0,B(o),r(i,o,e)}handleCreateTable(e,t,r){var i=this.session,o=this.tables,a=this.onFileCompleted,s=this.totalChunks,l=this.types,u=this.onProgress,c=this.onError;r&&r.pause(),B(this.headers),B(l),this.rowsProcessed+=t[0].length,i.newTable(this.headers,l,t,this.timeZone).then(m=>{if(this.isCancelled){pr.debug2("CSV parser cancelled."),r&&r.abort(),o.forEach(f=>f.close());return}r&&r.resume(),o[e]=m;var p=0;s>0?p=Math.round(o.length/s*50)+50:p=Math.round(this.rowsProcessed/this.rowCount*50)+50,pr.debug2("CSV parser progress ".concat(p)),u(p),this.isComplete&&o.length===this.chunks&&(pr.debug2("CSV parser complete."),a(o))}).catch(m=>{!this.isComplete&&r&&r.abort(),c(m)})}handleComplete(e){(e==null||e.meta.aborted==null)&&(this.isComplete=!0,this.consolidatedChunks&&this.uploadConsolidatedChunks(null))}handleError(e){var t=this.onError;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}_u=On;he(On,"generateHeaders",n=>{for(var e=[],t=0;t<n;t+=1)e.push(_u.generateHeaderRecursive(t));return e});function qi(n,e,t){return(e=ay(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ay(n){var e=sy(n,"string");return typeof e=="symbol"?e:e+""}function sy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ft{static fromExtension(e){return e.endsWith(".csv")?"DEFAULT_CSV":e.endsWith(".tsv")||e.endsWith(".tab")?"TSV":e.endsWith(".psv")?"PIPE_SV":"AUTODETECT"}}qi(Ft,"DEFAULT_TYPE","DEFAULT_CSV");qi(Ft,"AUTO","AUTODETECT");qi(Ft,"TYPES",Object.freeze({DEFAULT_CSV:{name:"Default csv (trimmed)",delimiter:",",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},TSV:{name:"Tab seperated (tsv)",delimiter:" ",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},APACHE_COMMON_CSV:{name:"Apache Common csv",delimiter:",",newline:`\r
24
+ Row = `).concat(s))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2);var a=this.onProgress(o);a&&t.abort()}handleComplete(e){var t=this.types,r=this.onFileCompleted;W(t),(e==null||!e.meta.aborted)&&r(t.map(i=>i===Va||i===K.LOCAL_TIME?K.STRING:i),this.rowCount)}handleError(e){var t=this.onError;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}var Pu;function he(n,e,t){return(e=sy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sy(n){var e=ly(n,"string");return typeof e=="symbol"?e:e+""}function ly(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vr=H.module("CsvParser"),uy=650;class xn{static generateHeaderRecursive(e){var t="",r=e;return e>=26&&(t=t.concat(xn.generateHeaderRecursive(Math.floor(e/26)-1)),r=e%26),t.concat(String.fromCharCode(65+r))}constructor(e){var t=e.onFileCompleted,r=e.session,i=e.file,o=e.type,a=e.readHeaders,s=a===void 0?!0:a,l=e.onProgress,u=e.onError,c=e.timeZone,h=e.isZip;he(this,"onFileCompleted",void 0),he(this,"session",void 0),he(this,"file",void 0),he(this,"isZip",void 0),he(this,"type",void 0),he(this,"readHeaders",void 0),he(this,"timeZone",void 0),he(this,"onProgress",void 0),he(this,"onError",void 0),he(this,"tables",void 0),he(this,"headers",void 0),he(this,"types",void 0),he(this,"rowCount",void 0),he(this,"rowsProcessed",void 0),he(this,"chunks",void 0),he(this,"totalChunks",void 0),he(this,"isComplete",void 0),he(this,"zipProgress",void 0),he(this,"consolidatedChunks",void 0),he(this,"numConsolidated",void 0),he(this,"isCancelled",void 0),he(this,"config",void 0),this.onFileCompleted=t,this.session=r,this.file=i,this.isZip=h,this.type=o,this.readHeaders=s,this.timeZone=c,this.onProgress=l,this.onError=u,this.tables=[],this.rowCount=0,this.rowsProcessed=0,this.chunks=0,this.totalChunks=h?0:Math.ceil(i.size/Fn.LocalChunkSize),this.isComplete=!1,this.zipProgress=0,this.numConsolidated=0,this.isCancelled=!1,this.handleChunk=this.handleChunk.bind(this),this.handleError=this.handleError.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.handleCreateTable=this.handleCreateTable.bind(this),this.config={delimiter:o.delimiter,newline:o.newline,escapeChar:o.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:o.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(e,t){for(var r=t.length,i=new Array(e).fill(null).map(()=>new Array(r)),o=0;o<r;o+=1){var a=t[o];if(a.length<e)throw new Error("Insufficient columns. Expected ".concat(e," but found ").concat(a.length,`
25
+ `).concat(a));for(var s=0;s<e;s+=1){var l=this.type.shouldTrim?t[o][s].trim():t[o][s];i[s][o]=this.nullCheck(l)}}return i}nullCheck(e){return e===this.type.nullString?"":e}parse(){var e=(r,i)=>{if(this.types=r,this.rowCount=i,this.file instanceof File||this.file instanceof Blob)Fn.parse(this.file,this.config);else{var o=Eu(this.file,this.handleNodeUpdate);Fn.parse(o,this.config),o.resume()}},t=new Ie(e,this.file,this.readHeaders,this.config,this.type.nullString,this.onProgress,this.onError,this.totalChunks,this.isZip,this.type.shouldTrim);t.parse()}handleChunk(e,t){var r=this.readHeaders,i=this.onError,o=this.handleCreateTable,a=this.isZip,s=this.tables;if(this.isCancelled){vr.debug2("CSV parser cancelled."),t.abort(),s.forEach(h=>h.close());return}var l=e.data;this.headers||(r?(this.headers=gt.legalizeColumnNames(l[0]),l=l.slice(1)):this.headers=xn.generateHeaders(l[0].length));var u=[];try{if(u=this.transpose(this.headers.length,l),a)this.consolidateChunks(u,t);else{var c=this.chunks;this.chunks+=1,o(c,u,t)}}catch(h){i(h)}}consolidateChunks(e,t){if(!this.consolidatedChunks)this.consolidatedChunks=e.slice();else for(var r=0;r<e.length;r+=1)this.consolidatedChunks[r]=this.consolidatedChunks[r].concat(e[r]);this.numConsolidated+=1,(this.numConsolidated>=uy||this.isComplete)&&this.uploadConsolidatedChunks(t)}uploadConsolidatedChunks(e){var t,r=this.handleCreateTable,i=this.chunks;this.chunks+=1;var o=(t=this.consolidatedChunks)===null||t===void 0?void 0:t.slice();this.consolidatedChunks=void 0,this.numConsolidated=0,W(o),r(i,o,e)}handleCreateTable(e,t,r){var i=this.session,o=this.tables,a=this.onFileCompleted,s=this.totalChunks,l=this.types,u=this.onProgress,c=this.onError;r&&r.pause(),W(this.headers),W(l),this.rowsProcessed+=t[0].length,i.newTable(this.headers,l,t,this.timeZone).then(h=>{if(this.isCancelled){vr.debug2("CSV parser cancelled."),r&&r.abort(),o.forEach(f=>f.close());return}r&&r.resume(),o[e]=h;var p=0;s>0?p=Math.round(o.length/s*50)+50:p=Math.round(this.rowsProcessed/this.rowCount*50)+50,vr.debug2("CSV parser progress ".concat(p)),u(p),this.isComplete&&o.length===this.chunks&&(vr.debug2("CSV parser complete."),a(o))}).catch(h=>{!this.isComplete&&r&&r.abort(),c(h)})}handleComplete(e){(e==null||e.meta.aborted==null)&&(this.isComplete=!0,this.consolidatedChunks&&this.uploadConsolidatedChunks(null))}handleError(e){var t=this.onError;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}Pu=xn;he(xn,"generateHeaders",n=>{for(var e=[],t=0;t<n;t+=1)e.push(Pu.generateHeaderRecursive(t));return e});function Xi(n,e,t){return(e=dy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dy(n){var e=cy(n,"string");return typeof e=="symbol"?e:e+""}function cy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ht{static fromExtension(e){return e.endsWith(".csv")?"DEFAULT_CSV":e.endsWith(".tsv")||e.endsWith(".tab")?"TSV":e.endsWith(".psv")?"PIPE_SV":"AUTODETECT"}}Xi(Ht,"DEFAULT_TYPE","DEFAULT_CSV");Xi(Ht,"AUTO","AUTODETECT");Xi(Ht,"TYPES",Object.freeze({DEFAULT_CSV:{name:"Default csv (trimmed)",delimiter:",",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},TSV:{name:"Tab seperated (tsv)",delimiter:" ",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},APACHE_COMMON_CSV:{name:"Apache Common csv",delimiter:",",newline:`\r
26
26
  `,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:null},EXCEL_CSV:{name:"Excel csv (strict)",delimiter:",",newline:`\r
27
27
  `,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!1,nullString:null},MY_SQL_CSV:{name:"MySQL csv",delimiter:" ",newline:`
28
28
  `,escapeChar:"\\",shouldTrim:!0,skipEmptyLines:!1,nullString:"\\N"},RFC4180_CSV:{name:"RFC4180 csv",delimiter:",",newline:`\r
29
- `,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!1,nullString:null},COLON_SV:{name:": colon sv",delimiter:":",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},SEMI_COLON_SV:{name:"; semi-colon sv",delimiter:";",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},PIPE_SV:{name:"| pipe separated (psv)",delimiter:"|",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},SPACE_SV:{name:'" " space sv',delimiter:" ",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},AUTODETECT:{name:"autodetect",delimiter:void 0,newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"}}));function Eu(n,e,t){return(e=ly(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ly(n){var e=uy(n,"string");return typeof e=="symbol"?e:e+""}function uy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function dy(n,e){return py(n)||my(n,e)||hy(n,e)||cy()}function cy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hy(n,e){if(n){if(typeof n=="string")return qa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qa(n,e):void 0}}function qa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function my(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function py(n){if(Array.isArray(n))return n}var Xa=H.module("CsvInputBar"),fy=Object.entries(Ft.TYPES).map(n=>{var e=dy(n,2),t=e[0],r=e[1];return d.jsx("option",{value:t,children:r.name},t)});class Pu extends h.Component{constructor(e){super(e),Eu(this,"inputRef",void 0),this.handleUpload=this.handleUpload.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleError=this.handleError.bind(this),this.handleTableName=this.handleTableName.bind(this),this.toggleFirstRowHeaders=this.toggleFirstRowHeaders.bind(this),this.handleProgress=this.handleProgress.bind(this),this.handleCancelInProgress=this.handleCancelInProgress.bind(this),this.handleQueryTypeChange=this.handleQueryTypeChange.bind(this),this.inputRef=j.createRef(),this.state={tableName:"",tableNameSet:!1,isFirstRowHeaders:!0,showProgress:!1,progressValue:0,type:Ft.DEFAULT_TYPE,parser:null}}componentDidUpdate(e){var t=this.props,r=t.file,i=t.paste,o=this.state,a=o.tableName,s=o.tableNameSet;if(!s&&r!=null&&!a){var l,u=r.name.lastIndexOf("."),c=gt.makeVariableName(r.name.substring(0,u));this.setState({tableName:c,tableNameSet:!0}),(l=this.inputRef.current)===null||l===void 0||l.focus()}else(r==null&&e.file!=null||i==null&&e.paste!=null)&&this.setState({tableName:"",tableNameSet:!1});i!=null&&i!==""&&!a&&this.inputRef.current&&this.inputRef.current.focus(),r!=null&&r!==e.file?this.setState({type:Ft.fromExtension(r.name)}):i!=null&&i!==""&&(e.paste===void 0||e.paste==="")&&this.setState({type:Ft.AUTO})}componentWillUnmount(){var e=this.state.parser;e&&e.cancel()}handleCancel(){var e=this.props.onClose;e()}handleError(e){var t=this.props,r=t.onClose,i=t.onError;Xa.error(e),i(e),r()}handleTableName(e){this.setState({tableName:e.target.value,tableNameSet:!0})}toggleFirstRowHeaders(){var e=this.state.isFirstRowHeaders;this.setState({isFirstRowHeaders:!e})}handleUpload(e){e.stopPropagation(),e.preventDefault();var t=this.props,r=t.file,i=t.paste;r!=null?r.name.endsWith(".zip")?this.handleZipFile(r):this.handleFile(r):i!==void 0&&i!==""&&this.handleFile(new Blob([i],{type:"text/plain"}))}handleFile(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Xa.info("Starting CSV parser for ".concat(e instanceof File?e.name:"pasted values"," ").concat(t?"":e.size," bytes"));var r=this.props,i=r.session,o=r.timeZone,a=r.onInProgress,s=this.state,l=s.tableName,u=s.isFirstRowHeaders,c=s.type,m=f=>{f.length===1?i.bindTableToVariable(f[0],l).then(()=>this.openTable()).catch(v=>this.handleError(v)):i.mergeTables(f).then(v=>{i.bindTableToVariable(v,l).then(()=>this.openTable()).catch(g=>this.handleError(g)),f.forEach(g=>g.close())}).catch(v=>this.handleError(v))},p=new On({onFileCompleted:m,session:i,file:e,type:Ft.TYPES[c],readHeaders:u,onProgress:this.handleProgress,onError:this.handleError,timeZone:o,isZip:t});p.parse(),this.setState({showProgress:!0,parser:p}),a(!0)}handleZipFile(e){var t=this.props,r=t.onUpdate,i=t.unzip;if(i==null){this.handleError(new Error("No support for zip files available."));return}i(e).then(o=>{for(var a=!1,s=0;s<o.length;s+=1){var l=o[s];if(Re.isValidExtension(l.name)){r("Loading ".concat(l.name," as csv from ").concat(e.name)),a=!0,this.handleFile(l,!0);break}}if(!a)throw new Error("No csv file found in ".concat(e.name))}).catch(o=>this.handleError(o))}handleProgress(e){var t=this.state.showProgress;return t&&this.setState({progressValue:e}),!t}handleCancelInProgress(){var e=this.props.onInProgress,t=this.state.parser;t&&t.cancel(),this.setState({showProgress:!1,progressValue:0}),e(!1)}openTable(){var e=this.props,t=e.onOpenTable,r=e.onClose,i=this.state.tableName;t(i),r()}handleQueryTypeChange(e){this.setState({type:e})}render(){var e=this.props,t=e.file,r=e.paste,i=this.state,o=i.tableName,a=i.isFirstRowHeaders,s=i.showProgress,l=i.progressValue,u=i.type,c=!!r&&!o;return d.jsxs("div",{className:"csv-input-bar",children:[!s&&d.jsxs("form",{onSubmit:this.handleUpload,className:"csv-input-bar-container form-inline",children:[d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"tableNameInput",children:"Table name"}),d.jsx("input",{ref:this.inputRef,id:"tableNameInput",type:"text",className:U("form-control",{"is-invalid":c}),value:o,onChange:this.handleTableName})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"formatSelect",children:"File format"}),d.jsx(gl,{id:"formatSelect",className:"custom-select",value:u,onChange:this.handleQueryTypeChange,children:fy})]}),d.jsx(ul,{className:"firstRowHeaders",checked:a,onChange:this.toggleFirstRowHeaders,children:"First row is column headers"}),d.jsxs("div",{className:"csv-input-buttons form-group",children:[d.jsx(ne,{kind:"secondary",onClick:this.handleCancel,children:"Cancel"}),d.jsx(ne,{kind:"primary",type:"submit",disabled:!(t!==null||r!==void 0&&r!=="")||!o,children:"Upload"})]})]}),s&&d.jsxs("div",{className:"csv-progress-container",children:[d.jsx("label",{children:"Uploading Table"}),d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar bg-primary",style:{width:"".concat(l,"%")},"aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":100})}),d.jsxs("label",{children:[l,"%"]}),d.jsx(ne,{kind:"primary",onClick:this.handleCancelInProgress,children:"Cancel"})]})]})}}Eu(Pu,"defaultProps",{file:null,paste:null,unzip:null});function Za(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function vy(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Za(o,r,i,a,s,"next",l)}function s(l){Za(o,r,i,a,s,"throw",l)}a(void 0)})}}function gy(n,e){return Sy(n)||Cy(n,e)||yy(n,e)||by()}function by(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yy(n,e){if(n){if(typeof n=="string")return Ya(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ya(n,e):void 0}}function Ya(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Cy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Sy(n){if(Array.isArray(n))return n}var wy={placement:"bottom-end"};function _y(n){var e=n.children,t=n.dh,r=n.session,i=n.overflowActions,o=h.useState(0),a=gy(o,2),s=a[0],l=a[1],u=h.useCallback(function(){var f=vy(function*(v){l(b=>b+1);try{var g=v.detail.result;yield g}catch{}l(b=>b-1)});return function(v){return f.apply(this,arguments)}}(),[]);h.useEffect(function(){return r.addEventListener(t.IdeSession.EVENT_COMMANDSTARTED,u)},[t,u,r]);var c=null,m=null;s>0?(c="console-status-icon-pending",m="Worker is busy"):(c="console-status-icon-idle",m="Worker is idle");var p=i!=null&&(!Array.isArray(i)||i.length>0);return d.jsxs("div",{className:"console-pane-status-bar",children:[d.jsxs("div",{children:[d.jsx("div",{className:U("console-status-icon",c)}),d.jsx(le,{children:m})]}),e,p&&d.jsx(ne,{kind:"ghost",icon:rd,tooltip:"More Actions...","aria-label":"More Actions...",onClick:qs,children:d.jsx(jr,{actions:i,popperOptions:wy})})]})}function Ey(n,e){return xy(n)||Oy(n,e)||Ty(n,e)||Py()}function Py(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ty(n,e){if(n){if(typeof n=="string")return Qa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Qa(n,e):void 0}}function Qa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Oy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function xy(n){if(Array.isArray(n))return n}var Iy=5e3;function Dy(n){var e=n.openObject,t=n.objects,r=h.useState(""),i=Ey(r,2),o=i[0],a=i[1],s=h.useRef(null),l=_c(()=>{a("")},Iy),u=h.useCallback(()=>{var p;l.cancel(),(p=s.current)===null||p===void 0||p.select()},[l]),c=h.useCallback(()=>{l()},[l]),m=h.useMemo(()=>{if(t.length===0)return[];var p={menuElement:d.jsx(Ar,{value:o,onChange:g=>{a(g.target.value)},className:"console-menu",ref:s})},f=o?t.filter(g=>{var b=g.title;return b!=null&&b.toLowerCase().includes(o.toLowerCase())}):t,v=f.map(g=>({title:g.title,action:()=>{e(g)},icon:d.jsx(mu,{type:g.type})}));return[p,...v]},[t,o,e]);return d.jsx(ne,{"aria-label":"Objects",kind:"ghost",disabled:t.length===0,onClick:qs,tooltip:t.length===0?"No objects available":"Objects",icon:d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(me,{mask:Fs,icon:ii,transform:"right-5 down-5"}),d.jsx(me,{icon:ii,transform:"right-8 down-6"})]}),children:d.jsx(jr,{actions:m,onMenuOpened:u,onMenuClosed:c,options:{initialKeyboardIndex:1},popperOptions:{placement:"bottom-end"}})})}function Ja(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ja(Object(t),!0).forEach(function(r){We(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ja(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function We(n,e,t){return(e=My(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function My(n){var e=jy(n,"string");return typeof e=="symbol"?e:e+""}function jy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tt=H.module("Console"),es={isAutoLaunchPanelsEnabled:!0,isPrintStdOutEnabled:!0,isClosePanelsOnDisconnectEnabled:!0};function Ay(){return!0}function ky(n){return d.jsx(d.Fragment,{})}class Ht extends h.PureComponent{static isErrorLevel(e){return e===_e.STDERR||e===_e.ERROR||e===_e.FATAL}static isOutputLevel(e){return e===_e.STDOUT||Ht.isErrorLevel(e)}constructor(e){super(e),We(this,"cancelListener",void 0),We(this,"consolePane",void 0),We(this,"consoleInput",void 0),We(this,"consoleHistoryScrollPane",void 0),We(this,"consoleHistoryContent",void 0),We(this,"pending",void 0),We(this,"queuedLogMessages",void 0),We(this,"resizeObserver",void 0),We(this,"processLogMessageQueue",Ir(()=>{this.setState(o=>{tt.debug2("processLogMessageQueue",this.queuedLogMessages.length," items");var a=o.consoleHistory;return a=a.concat(this.queuedLogMessages),this.queuedLogMessages=[],{consoleHistory:a}})},Ht.LOG_THROTTLE)),We(this,"getObjects",Cn(o=>Array.from(o.values()))),We(this,"getContextActions",Cn(o=>[...o,{action:this.handleClearShortcut,shortcut:wn.CONSOLE.CLEAR},{action:this.handleFocusHistory,shortcut:wn.CONSOLE.FOCUS_HISTORY}])),this.handleCommandResult=this.handleCommandResult.bind(this),this.handleCommandStarted=this.handleCommandStarted.bind(this),this.handleCommandSubmit=this.handleCommandSubmit.bind(this),this.handleClearShortcut=this.handleClearShortcut.bind(this),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleLogMessage=this.handleLogMessage.bind(this),this.handleOverflowActions=this.handleOverflowActions.bind(this),this.handleScrollPaneScroll=this.handleScrollPaneScroll.bind(this),this.handleHistoryResize=this.handleHistoryResize.bind(this),this.handleToggleAutoLaunchPanels=this.handleToggleAutoLaunchPanels.bind(this),this.handleToggleClosePanelsOnDisconnect=this.handleToggleClosePanelsOnDisconnect.bind(this),this.handleTogglePrintStdout=this.handleTogglePrintStdout.bind(this),this.handleUploadCsv=this.handleUploadCsv.bind(this),this.handleHideCsv=this.handleHideCsv.bind(this),this.handleCsvFileCanceled=this.handleCsvFileCanceled.bind(this),this.handleCsvFileOpened=this.handleCsvFileOpened.bind(this),this.handleCsvPaste=this.handleCsvPaste.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleClearDragError=this.handleClearDragError.bind(this),this.handleOpenCsvTable=this.handleOpenCsvTable.bind(this),this.handleCsvUpdate=this.handleCsvUpdate.bind(this),this.handleCsvError=this.handleCsvError.bind(this),this.handleCsvInProgress=this.handleCsvInProgress.bind(this),this.consolePane=j.createRef(),this.consoleInput=j.createRef(),this.consoleHistoryScrollPane=j.createRef(),this.consoleHistoryContent=j.createRef(),this.pending=new Dr,this.queuedLogMessages=[],this.resizeObserver=new window.ResizeObserver(this.handleHistoryResize);var t=this.props,r=t.objectMap,i=t.settings;this.state=st(st({consoleHistory:[],consoleHeight:0,isScrollDecorationShown:!1,objectHistoryMap:new Map,objectMap:new Map(r),showCsvOverlay:!1,csvFile:null,csvPaste:null,dragError:null,csvUploadInProgress:!1,isStuckToBottom:!0},es),i)}componentDidMount(){this.initConsoleLogging();var e=this.props,t=e.dh,r=e.session;r.addEventListener(t.IdeSession.EVENT_COMMANDSTARTED,this.handleCommandStarted),this.updateDimensions(),this.consoleHistoryScrollPane.current&&this.consoleHistoryContent.current&&(this.resizeObserver.observe(this.consoleHistoryScrollPane.current),this.resizeObserver.observe(this.consoleHistoryContent.current))}componentDidUpdate(e,t){var r=this.props,i=this.state;this.sendSettingsChange(t,i),r.objectMap!==e.objectMap&&this.updateObjectMap(),i.isStuckToBottom&&!this.isAtBottom()&&this.scrollConsoleHistoryToBottom()}componentWillUnmount(){var e=this.props,t=e.dh,r=e.session;r.removeEventListener(t.IdeSession.EVENT_COMMANDSTARTED,this.handleCommandStarted),this.pending.cancel(),this.processLogMessageQueue.cancel(),this.deinitConsoleLogging(),this.resizeObserver.disconnect()}initConsoleLogging(){var e=this.props.session;this.cancelListener=e.onLogMessage(this.handleLogMessage)}deinitConsoleLogging(){this.cancelListener!=null&&(this.cancelListener(),this.cancelListener=void 0)}isAtBottom(){if(this.consoleHistoryScrollPane.current==null)return!1;var e=this.consoleHistoryScrollPane.current,t=e.scrollHeight,r=e.clientHeight,i=e.scrollTop;return Math.abs(t-r-i)<=1}handleClearShortcut(e){var t;e.preventDefault(),e.stopPropagation(),(t=this.consoleInput.current)===null||t===void 0||t.clear()}handleCommandStarted(e){var t=e.detail,r=t.code,i=t.result,o=this.pending.add(i),a={command:r,disabledObjects:[],startTime:Date.now(),cancelResult:()=>{i.cancel()},wrappedResult:o},s=this.props,l=s.commandHistoryStorage,u=s.language,c=s.scope,m=l.addItem(u,c,r,{command:r,startTime:new Date().toJSON()});m.catch(p=>{tt.debug("Error adding workspace item",p)}),this.setState(p=>({consoleHistory:p.consoleHistory.concat(a)}),()=>{this.scrollConsoleHistoryToBottom()}),o.then(p=>{this.handleCommandResult(p,a,m)}).catch(p=>{this.handleCommandError(p,a,m)})}handleCommandResult(e,t,r){var i,o,a=e==null||(i=e.startTimestamp)===null||i===void 0?void 0:i.asNumber(),s=e==null||(o=e.endTimestamp)===null||o===void 0?void 0:o.asNumber(),l=st(st({},t),{},{wrappedResult:void 0,cancelResult:void 0,result:e??t.result,serverStartTime:a,serverEndTime:s});this.setState(u=>{var c=u.consoleHistory,m=c.lastIndexOf(t);if(m<0)return tt.error("historyItem not found in consoleHistory"),null;var p=c.concat();return p[m]=l,{consoleHistory:p}}),e&&(this.scrollConsoleHistoryToBottom(),this.updateHistory(e,l),this.updateKnownObjects(l),this.updateWorkspaceHistoryItem({error:e.error,serverStartTime:a,serverEndTime:s},r),this.closeRemovedItems(e.changes),this.openUpdatedItems(e.changes))}handleCommandError(e,t,r){if(Ye.isCanceled(e)){tt.debug("Called handleCommandError on a cancelled promise result");return}this.updateWorkspaceHistoryItem({error:"".concat(e)},r),this.setState(i=>{var o=i.consoleHistory.concat(),a=o.lastIndexOf(t),s=st({},t);return s.wrappedResult=void 0,s.cancelResult=void 0,s.endTime=Date.now(),s.result={error:e},o[a]=s,{consoleHistory:o}})}handleFocusHistory(e){e.preventDefault(),e.stopPropagation();var t=this.props.focusCommandHistory;t()}handleLogMessage(e){var t=this.state.isPrintStdOutEnabled;t&&Ht.isOutputLevel(e.logLevel)&&this.queueLogMessage(e.message,e.logLevel)}queueLogMessage(e,t){var r={};Ht.isErrorLevel(t)?r.error=e:r.message=e;var i={command:void 0,result:r};this.queuedLogMessages.push(i),this.processLogMessageQueue()}openUpdatedItems(e){tt.debug("openUpdatedItems",e);var t=this.state.isAutoLaunchPanelsEnabled;if(e!=null){var r=this.props.openObject;[...e.created,...e.updated].forEach(i=>r(i,t&&(i.title===void 0||!i.title.startsWith("_"))))}}closeRemovedItems(e){if(!(e==null||e.removed==null||e.removed.length===0)){var t=this.props.closeObject,r=e.removed;r.forEach(i=>t(i))}}updateHistory(e,t){var r=t;e==null||e.changes==null||r==null||(r.endTime=Date.now(),this.setState(i=>{var o=i.consoleHistory.concat();return{consoleHistory:o}}))}updateKnownObjects(e){var t;if(e.result&&(t=e.result.changes),!t||(t.created==null||t.created.length===0)&&(t.updated==null||t.updated.length===0)&&(t.removed==null||t.removed.length===0)){tt.debug2("updateKnownObjects no changes");return}this.setState(r=>{var i,o,a,s=r.consoleHistory,l=s.lastIndexOf(e);if(l<0)return tt.error("historyItem not found in state.consoleHistory"),null;var u=new Map(r.objectHistoryMap),c=new Map(r.objectMap),m=function(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=f.title;B(g);var b=u.get(g);if(b!=null&&b>=0){var y;s===r.consoleHistory&&(s=s.concat());var C=st(st({},s[b]),{},{disabledObjects:[...(y=s[b].disabledObjects)!==null&&y!==void 0?y:[],g]});s[b]=C}u.set(g,l),v?c.delete(g):c.set(g,f)};return(i=t)===null||i===void 0||i.updated.forEach(p=>m(p)),(o=t)===null||o===void 0||o.removed.forEach(p=>m(p,!0)),(a=t)===null||a===void 0||a.created.forEach(p=>{var f=p.title;B(f),u.set(f,l),c.set(f,p)}),{objectHistoryMap:u,objectMap:c,consoleHistory:s}})}updateObjectMap(){var e=this.props.objectMap;this.setState({objectMap:e})}updateWorkspaceHistoryItem(e,t){var r=this.pending.add(t),i=new Date().toJSON();r.then(o=>{var a=st(st({},o),{},{data:st(st({},o.data),{},{endTime:i,result:e})}),s=this.props,l=s.commandHistoryStorage,u=s.language;l.updateItem(u,a).catch(c=>{tt.warn("Error updating command history storage",c)})}).catch(o=>{tt.debug("Error updating workspace history item",o)})}scrollConsoleHistoryToBottom(){var e=this.consoleHistoryScrollPane.current;e!=null&&window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"instant"})})}handleScrollPaneScroll(e){tt.debug("handleScrollPaneScroll",e);var t=this.consoleHistoryScrollPane.current;B(t),this.setState({isScrollDecorationShown:t.scrollTop>0&&t.scrollHeight>t.clientHeight,isStuckToBottom:this.isAtBottom()})}handleHistoryResize(e){tt.debug("handleHistoryResize",e);var t=e[0];if(t.contentRect.height>0&&t.contentRect.width>0){var r=this.state.isStuckToBottom;r&&!this.isAtBottom()&&this.scrollConsoleHistoryToBottom()}}handleToggleAutoLaunchPanels(){this.setState(e=>({isAutoLaunchPanelsEnabled:!e.isAutoLaunchPanelsEnabled}))}handleToggleClosePanelsOnDisconnect(){this.setState(e=>({isClosePanelsOnDisconnectEnabled:!e.isClosePanelsOnDisconnectEnabled}))}handleTogglePrintStdout(){this.setState(e=>({isPrintStdOutEnabled:!e.isPrintStdOutEnabled}))}handleUploadCsv(){this.setState({showCsvOverlay:!0,dragError:null,csvUploadInProgress:!1})}handleHideCsv(){this.setState({showCsvOverlay:!1,csvFile:null,csvPaste:null,dragError:null,csvUploadInProgress:!1})}handleCsvFileCanceled(){this.setState({csvFile:null,csvPaste:null})}handleCsvFileOpened(e){this.setState({csvFile:e,csvPaste:null})}handleCsvPaste(e){this.setState({csvFile:null,csvPaste:e})}handleDragEnter(e){if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0||e.dataTransfer.items[0].kind==="string")){e.preventDefault(),e.stopPropagation(),this.setState({showCsvOverlay:!0});var t=e.dataTransfer.items;if(t.length>1){this.setState({dragError:Re.MULTIPLE_FILE_ERROR});return}var r=t[0];Re.isValidDropItem(r)?this.setState({dragError:null}):this.setState({dragError:Re.FILE_TYPE_ERROR})}}handleDragLeave(e){e.currentTarget==null||e.currentTarget instanceof Element&&e.relatedTarget instanceof Element&&e.currentTarget.contains(e.relatedTarget)||(e.preventDefault(),e.stopPropagation(),this.setState({showCsvOverlay:!1,dragError:null}))}handleClearDragError(){this.setState({dragError:null})}handleOpenCsvTable(e){var t=this.props,r=t.dh,i=t.openObject,o=t.commandHistoryStorage,a=t.language,s=t.scope,l=this.state,u=l.consoleHistory,c=l.objectMap,m={name:e,title:e,type:r.VariableType.TABLE},p=c.has(e),f={startTime:Date.now(),endTime:Date.now(),disabledObjects:[],result:{changes:{created:[],updated:[],removed:[],[p?"updated":"created"]:[m]}}},v=u.concat(f);this.setState({consoleHistory:v}),this.scrollConsoleHistoryToBottom(),this.updateKnownObjects(f),i({name:e,type:r.VariableType.TABLE}),o.addItem(a,s,e,{command:e,startTime:new Date().toJSON(),endTime:new Date().toJSON()})}addConsoleHistoryMessage(e,t){var r=this.state.consoleHistory,i={startTime:Date.now(),endTime:Date.now(),result:{message:e,error:t}},o=r.concat(i);this.setState({consoleHistory:o})}handleCsvUpdate(e){this.addConsoleHistoryMessage(e)}handleCsvError(e){this.addConsoleHistoryMessage(void 0,e!=null?"".concat(e):void 0)}handleCsvInProgress(e){this.setState({csvUploadInProgress:e})}handleOverflowActions(){var e=this.state,t=e.isAutoLaunchPanelsEnabled,r=e.isClosePanelsOnDisconnectEnabled,i=e.isPrintStdOutEnabled,o=this.props.actions;return[...o,{title:"Print Stdout",action:this.handleTogglePrintStdout,group:ue.groups.high,icon:i?zr:void 0,order:10},{title:"Auto Launch Panels",action:this.handleToggleAutoLaunchPanels,group:ue.groups.high,icon:t?zr:void 0,order:20},{title:"Close Panels on Disconnect",action:this.handleToggleClosePanelsOnDisconnect,group:ue.groups.high,icon:r?zr:void 0,order:30},{title:"Upload Table from File",action:this.handleUploadCsv,group:ue.groups.high+10,order:40}]}handleCommandSubmit(e){if(e==="clear"||e==="cls")this.clearConsoleHistory();else if(e.length>0){var t=this.props.session;t.runCode(e).catch(i=>{tt.error("There was an error initiating the command",i)})}else{var r={command:" ",result:{},startTime:Date.now(),endTime:Date.now()};this.scrollConsoleHistoryToBottom(),this.setState(i=>({consoleHistory:i.consoleHistory.concat(r)}))}}clearConsoleHistory(){this.pending.cancel(),this.setState(e=>{var t=new Map([...e.objectHistoryMap.keys()].map(r=>[r,-1]));return{consoleHistory:[],objectHistoryMap:t}})}addCommand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.consoleInput.current&&(this.consoleInput.current.setConsoleText(e,t,r),t&&this.scrollConsoleHistoryToBottom())}focus(){var e;(e=this.consoleInput.current)===null||e===void 0||e.focus()}sendSettingsChange(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Object.keys(es),o={},a=!1,s=0;s<i.length;s+=1){var l=i[s],u=t[l],c=e[l];u!==c&&(a=!0),o[l]=u}if(!(r&&!a)){var m=this.props.onSettingsChange;m(o)}}updateDimensions(){this.consolePane.current&&this.setState({consoleHeight:this.consolePane.current.clientHeight}),this.consoleInput.current&&this.consoleInput.current.updateDimensions()}render(){var e=this.props,t=e.actions,r=e.dh,i=e.historyChildren,o=e.language,a=e.statusBarChildren,s=e.openObject,l=e.session,u=e.scope,c=e.commandHistoryStorage,m=e.timeZone,p=e.disabled,f=e.unzip,v=e.supportsType,g=e.iconForType,b=e.showObjectsMenu,y=this.state,C=y.consoleHeight,S=y.consoleHistory,_=y.isScrollDecorationShown,E=y.objectMap,D=y.showCsvOverlay,W=y.csvFile,N=y.csvPaste,I=y.dragError,k=y.csvUploadInProgress,$=this.getObjects(E),ae=Math.round(C*.7),A=this.getContextActions(t);return d.jsxs("div",{role:"presentation",className:U("iris-console","h-100","w-100",{disabled:p}),children:[d.jsxs("div",{className:"console-pane",ref:this.consolePane,children:[d.jsxs(_y,{dh:r,session:l,overflowActions:this.handleOverflowActions,children:[a,b===!0&&d.jsx(Dy,{openObject:s,objects:$})]}),d.jsxs("div",{className:"console-csv-container",onDragOver:Re.handleDragOver,onDragEnter:this.handleDragEnter,onDragLeave:this.handleDragLeave,children:[d.jsxs("div",{role:"presentation",className:U("scroll-pane no-scroll-x",{"scroll-decoration":_}),onScroll:this.handleScrollPaneScroll,ref:this.consoleHistoryScrollPane,children:[d.jsx(rb,{items:S,openObject:s,language:o,disabled:p,supportsType:v,iconForType:g,ref:this.consoleHistoryContent,onCommandSubmit:this.handleCommandSubmit}),i]}),D&&d.jsx(Re,{onCancel:this.handleCsvFileCanceled,onFileOpened:this.handleCsvFileOpened,onPaste:this.handleCsvPaste,clearDragError:this.handleClearDragError,dragError:I,onError:this.handleCsvError,uploadInProgress:k,allowZip:f!=null})]}),!D&&d.jsx(Tn,{ref:this.consoleInput,session:l,language:o,scope:u,onSubmit:this.handleCommandSubmit,maxHeight:ae,commandHistoryStorage:c}),D&&d.jsx(Pu,{session:l,onOpenTable:this.handleOpenCsvTable,onClose:this.handleHideCsv,onUpdate:this.handleCsvUpdate,onError:this.handleCsvError,file:W??void 0,paste:N??void 0,onInProgress:this.handleCsvInProgress,timeZone:m,unzip:f})]}),d.jsx(ue,{actions:A,ignoreClassNames:[Tn.INPUT_CLASS_NAME]})]})}}We(Ht,"defaultProps",{statusBarChildren:null,settings:{},onSettingsChange:()=>{},scope:null,actions:[],historyChildren:null,timeZone:"America/New_York",objectMap:new Map,disabled:!1,unzip:null,supportsType:Ay,iconForType:ky,showObjectsMenu:!0});We(Ht,"LOG_THROTTLE",500);function kn(n,e,t){return(e=Ny(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ny(n){var e=Ly(n,"string");return typeof e=="symbol"?e:e+""}function Ly(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ry=250,$y=2500;class Tu extends h.Component{constructor(e){super(e),kn(this,"timer",void 0),kn(this,"cleanup",void 0),kn(this,"loadData",Bn(()=>{var t=this.props,r=t.commandHistoryStorage,i=t.item,o=t.language,a=i.id;this.cleanup=r.listenItem(o,a,this.handleUpdate,this.handleError)},Ry)),kn(this,"getPreviewText",fn(t=>t.split(`
33
- `,$y).join(`
34
- `),{max:1})),this.handleUpdate=this.handleUpdate.bind(this),this.handleError=this.handleError.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.state={currentTime:Date.now()}}componentDidMount(){this.loadData()}componentDidUpdate(e,t){var r,i=this.state.data;this.timer==null&&!(i!=null&&i.result)&&(i!=null&&i.startTime)&&!(i==null||i.endTime===void 0)?this.startTimer():(i!=null&&i.result&&!((r=t.data)!==null&&r!==void 0&&r.result)||i!=null&&i.endTime&&!(t.data==null||t.data.endTime===void 0))&&this.stopTimer()}componentWillUnmount(){this.loadData.cancel(),this.cleanup!=null&&this.cleanup(),this.stopTimer()}startTimer(){this.stopTimer(),this.timer=window.setInterval(this.handleTimeout,1e3)}stopTimer(){this.timer!=null&&(clearInterval(this.timer),this.timer=void 0)}updateTime(){this.setState({currentTime:Date.now()})}handleError(e){this.setState({error:"".concat(e)})}handleUpdate(e){var t=e??{},r=t.data;this.setState({data:r});var i=this.props.onUpdate;i==null||i(r)}handleTimeout(){this.updateTime()}render(){var e,t=this.props,r=t.item.name,i=t.language,o=this.state,a=o.currentTime,s=o.data,l=o.error,u=s??{},c=u.result,m=u.startTime,p=u.endTime,f=(e=c==null?void 0:c.error)!==null&&e!==void 0?e:l,v=Fe.formatConvertedDuration(m,p??a),g=this.getPreviewText(r),b=!!v;return d.jsxs("div",{className:"command-history-item-tooltip",children:[d.jsxs("div",{className:"scroll-container",children:[d.jsx(pu,{language:i,children:g}),g.length<r.length&&d.jsx("p",{children:"Preview Truncated..."})]}),d.jsxs("div",{className:"result-info",children:[d.jsxs("div",{className:"d-flex justify-content-between",children:[!!f&&d.jsxs("div",{className:"text-danger mr-1",children:[d.jsx(me,{icon:Us})," Executed with errors"]}),d.jsxs("div",{className:"time-wrapper",children:["Elapsed time:"," ",b?d.jsx("span",{className:"time-string",children:v}):d.jsx(Hs,{className:"loading-spinner-vertical-align"})]})]}),!!f&&d.jsx("div",{className:"error-message",children:f})]})]})}}kn(Tu,"defaultProps",{onUpdate:()=>{}});var Fy=512;function Hy(n){var e=n.item,t=n.language,r=n.isSelected,i=r===void 0?!1:r,o=n.commandHistoryStorage,a=e.name.substring(0,Fy),s=h.useRef(null),l=h.useCallback(()=>{var u;(u=s.current)===null||u===void 0||u.update()},[s]);return d.jsxs("div",{className:U("command-history-item",{selected:i}),children:[a,d.jsx(le,{ref:s,interactive:!0,options:{placement:"left",modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport",order:825}}},popperClassName:"command-history-item-popper",children:d.jsx(Tu,{item:e,language:t,onUpdate:l,commandHistoryStorage:o})})]})}class Or extends h.Component{static itemKey(e,t){return"".concat(t.title)}static renderContent(e){return e.selectionRequired!==void 0&&e.selectionRequired?d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(me,{icon:id,mask:e.icon,transform:"right-5 down-5 shrink-4"}),d.jsx(me,{icon:Ls,transform:"shrink-3 right-7 down-6"})]}):d.jsx(me,{icon:e.icon})}render(){var e=this.props,t=e.actions,r=e.hasSelection;return d.jsx("div",{className:"command-history-actions",children:t.map((i,o)=>d.jsx(ne,{kind:"inline",className:U(i.className),onClick:i.action,tooltip:i.description,disabled:i.selectionRequired!==void 0&&i.selectionRequired&&!r,icon:Or.renderContent(i)},Or.itemKey(o,i)))})}}var Uy=150,ts=3,ns=H.module("CommandHistoryViewportUpdater");function By(n){var e=n.table,t=n.columns,r=n.top,i=r===void 0?0:r,o=n.bottom,a=o===void 0?0:o,s=n.search,l=n.isReversed,u=l===void 0?!1:l,c=n.onUpdate,m=h.useMemo(()=>Ir(p=>{var f=p.bottom-p.top,v=Math.max(0,p.top-f*ts),g=p.bottom+f*ts;e.setViewport({top:v,bottom:g,columns:p.columns})},Uy),[e]);return h.useEffect(function(){var f=e.onUpdate(v=>{var g,b;c({items:(g=v.items)!==null&&g!==void 0?g:[],offset:(b=v.offset)!==null&&b!==void 0?b:0})});return()=>{ns.debug("onUpdate cleanup"),f()}},[e,c]),h.useEffect(function(){e.setSearch(s??"")},[e,s]),h.useEffect(function(){m({top:i,bottom:a,columns:t})},[m,i,a,t,s,u]),h.useEffect(()=>()=>{ns.debug2("Cancel throttledUpdateViewport"),m.cancel()},[m]),null}function rs(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function is(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){rs(o,r,i,a,s,"next",l)}function s(l){rs(o,r,i,a,s,"throw",l)}a(void 0)})}}function ft(n,e,t){return(e=Wy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wy(n){var e=Ky(n,"string");return typeof e=="symbol"?e:e+""}function Ky(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=H.module("CommandHistory");class Ne extends h.Component{static getCommandsFromViewport(e,t,r){for(var i=[],o=0;o<r.length;o+=1)for(var a=r[o],s=a[0];s<=a[1];s+=1)if(s>=t&&s<t+e.length){var l=e[s-t].name;i.push(l)}return i}static getCommandsFromSnapshot(e,t){return is(function*(){var r=yield e.getSnapshot(t);return[...r.values()].map(i=>i.name)})()}constructor(e){super(e),ft(this,"itemActions",void 0),ft(this,"historyActions",void 0),ft(this,"pending",void 0),ft(this,"searchInputRef",void 0),ft(this,"itemListRef",void 0),ft(this,"debouncedSearchChange",Bn(()=>{this.setState(r=>{var i=r.searchText;return{debouncedSearchText:i,selectedRanges:[]}})},Ne.SET_SEARCH_DEBOUNCE_MS)),this.copySelectedCommands=this.copySelectedCommands.bind(this),this.createNotebook=this.createNotebook.bind(this),this.sendToConsole=this.sendToConsole.bind(this),this.renderItem=this.renderItem.bind(this),this.runInConsole=this.runInConsole.bind(this),this.sendToNotebook=this.sendToNotebook.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleViewportUpdate=this.handleViewportUpdate.bind(this),this.itemActions=[{title:"Copy Selection",description:"Copy selected commands to clipboard",icon:od,shortcut:bn.COPY,action:this.copySelectedCommands,group:ue.groups.edit},{title:"Send to Console",description:"Open selected commands in the console",icon:to,shortcut:wn.COMMAND_HISTORY.SEND_TO_CONSOLE,action:this.sendToConsole,group:Ne.menuGroups.send,order:10},{title:"Run in Console",description:"Run selected commands in the console",icon:ad,shortcut:wn.COMMAND_HISTORY.RUN,action:this.runInConsole,group:Ne.menuGroups.send,order:10},{title:"Send to Active Notebook",description:"Open selected commands in a notebook",icon:no,shortcut:wn.COMMAND_HISTORY.SEND_TO_NOTEBOOK,action:this.sendToNotebook,group:Ne.menuGroups.send,order:20},{title:"Send to New Notebook",description:"Open selected commands in a new notebook",icon:Bs,action:this.createNotebook,group:Ne.menuGroups.send,order:30}],this.historyActions=[{title:"Send to Console",icon:to,selectionRequired:!0,description:"Open selected commands in the console",action:this.sendToConsole},{title:"Send to Notebook",icon:no,selectionRequired:!0,description:"Open selected commands in a notebook",action:this.sendToNotebook}],this.pending=new Dr,this.searchInputRef=j.createRef(),this.itemListRef=j.createRef();var t=e.table;this.state={actions:[],historyActions:this.historyActions,top:0,bottom:0,itemCount:t.size,items:[],offset:0,selectedRanges:[],searchText:"",debouncedSearchText:""}}componentWillUnmount(){this.debouncedSearchChange.cancel(),this.pending.cancel()}getSelectedCommands(){var e=this;return is(function*(){var t=e.state,r=t.items,i=t.offset,o=t.selectedRanges,a=o.slice().sort((l,u)=>l[0]-u[0]);if(a.length===0)return[];if(a[0][0]>=i&&a[a.length-1][1]<i+r.length)return Ne.getCommandsFromViewport(r,i,a);var s=e.props.table;return e.pending.add(Ne.getCommandsFromSnapshot(s,a))})()}getSelectedCommandText(){return this.getSelectedCommands().then(e=>e.join(`
35
- `))}updateActions(){this.setState(e=>{var t=e.selectedRanges,r=t.reduce((i,o)=>i+o[1]-o[0]+1,0);return r>0&&r<Ne.MAX_SELECTION_COUNT?(kt.debug("Updating actions",this.itemActions),{actions:this.itemActions}):(kt.debug("Disabling actions",r),{actions:[]})})}copySelectedCommands(){this.getSelectedCommandText().then(Ys).catch(kt.error)}createNotebook(){this.getSelectedCommandText().then(e=>{var t=this.props,r=t.language,i=t.sendToNotebook;i({value:e,language:r},!0)}).catch(kt.error)}sendToNotebook(){this.getSelectedCommandText().then(e=>{var t=this.props,r=t.language,i=t.sendToNotebook;i({value:e,language:r})}).catch(kt.error)}sendToConsole(){var e=this.props.sendToConsole;this.getSelectedCommandText().then(e).catch(kt.error)}runInConsole(){this.getSelectedCommandText().then(e=>{var t=this.props.sendToConsole;t(e,!0,!0)}).catch(kt.error)}handleSelect(e){var t=this.props.sendToConsole,r=this.state,i=r.items,o=r.offset;if(e<o||e>=o+i.length){kt.error("Invalid index!",e);return}var a=i[e-o].name;t(a)}handleSelectionChange(e){this.setState({selectedRanges:e}),this.updateActions()}handleViewportChange(e,t){this.setState({top:e,bottom:t})}handleSearchChange(e){this.setState({searchText:e.target.value}),this.debouncedSearchChange()}handleViewportUpdate(e){var t=e.items,r=e.offset,i=this.props.table,o=i.size;this.setState({items:t,itemCount:o,offset:r})}renderItem(e){var t=e.item;e.itemIndex;var r=e.isSelected,i=this.props,o=i.language,a=i.commandHistoryStorage;return d.jsx(Hy,{isSelected:r,item:t,language:o,commandHistoryStorage:a})}focus(){this.searchInputRef.current&&this.searchInputRef.current.focus()}restoreScrollPosition(){var e;(e=this.itemListRef.current)===null||e===void 0||e.restoreScrollPosition()}render(){var e,t=this.props,r=t.language,i=t.table,o=this.state,a=o.actions,s=o.historyActions,l=o.searchText,u=o.debouncedSearchText,c=o.top,m=o.bottom,p=o.items,f=o.itemCount,v=o.offset,g=o.selectedRanges,b=(e=fu.LANGUAGE_MAP.get(r))!==null&&e!==void 0?e:"";return d.jsxs("div",{className:"command-history",children:[d.jsxs("div",{className:"command-history-search-bar",children:[d.jsx(Ar,{ref:this.searchInputRef,value:l,placeholder:"".concat(b," Command History"),onChange:this.handleSearchChange}),d.jsx(Or,{actions:s,hasSelection:g.length>0})]}),d.jsxs("div",{className:"command-history-list",children:[d.jsx(ct,{ref:this.itemListRef,itemCount:f,items:p,offset:v,selectedRanges:g,onSelect:this.handleSelect,onSelectionChange:this.handleSelectionChange,onViewportChange:this.handleViewportChange,renderItem:this.renderItem,rowHeight:Ne.ITEM_HEIGHT,isDoubleClickSelect:!0,isMultiSelect:!0,isStickyBottom:!0}),d.jsx(By,{table:i,top:c,bottom:m,search:u,onUpdate:this.handleViewportUpdate}),d.jsx(ue,{actions:a})]})]})}}ft(Ne,"ITEM_HEIGHT",29);ft(Ne,"MAX_SELECTION_COUNT",1e4);ft(Ne,"SET_SEARCH_DEBOUNCE_MS",150);ft(Ne,"menuGroups",{send:ue.groups.medium+100});class zy extends h.PureComponent{constructor(e){super(e),this.handleSwitchClick=this.handleSwitchClick.bind(this)}handleSwitchClick(){var e=this.props,t=e.logLevel,r=e.onClick;r(t)}render(){var e=this.props,t=e.logLevel,r=e.on;return d.jsxs("div",{className:U("log-level-menu-item",t),children:[d.jsx(lm,{on:r,onClick:this.handleSwitchClick}),t]})}}function os(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function as(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?os(Object(t),!0).forEach(function(r){Xe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):os(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xe(n,e,t){return(e=Vy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vy(n){var e=Gy(n,"string");return typeof e=="symbol"?e:e+""}function Gy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ve extends h.PureComponent{static getLogText(e){var t=new Date(e.micros/1e3),r=Pr.formatTimestamp(t);return"".concat(r," ").concat(e.logLevel," ").concat(e.message)}constructor(e){super(e),Xe(this,"cancelListener",void 0),Xe(this,"editor",void 0),Xe(this,"editorContainer",void 0),Xe(this,"logLevelMenuItems",void 0),Xe(this,"flushTimer",void 0),Xe(this,"bufferedMessages",void 0),Xe(this,"messages",void 0),this.handleClearClick=this.handleClearClick.bind(this),this.handleFlushTimeout=this.handleFlushTimeout.bind(this),this.handleLogMessage=this.handleLogMessage.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleResetClick=this.handleResetClick.bind(this),this.handleResize=this.handleResize.bind(this),this.handleToggleAllClick=this.handleToggleAllClick.bind(this),this.logLevelMenuItems={},this.editorContainer=null,this.bufferedMessages=[],this.messages=[],this.state={shownLogLevels:{}}}componentDidMount(){this.resetLogLevels(),this.initMonaco(),this.startListening(),window.addEventListener("resize",this.handleResize)}componentDidUpdate(e,t){this.updateDimensions();var r=this.state.shownLogLevels;t.shownLogLevels!==r&&this.refreshLogText();var i=this.props.session;e.session!==i&&(this.stopListening(),this.startListening(),this.clearLogs())}componentWillUnmount(){this.stopFlushTimer(),this.stopListening(),this.destroyMonaco(),window.removeEventListener("resize",this.handleResize)}getMenuActions(e){var t=this,r=[];r.push({menuElement:d.jsx("div",{className:"log-level-menu-title",children:"Display Log Levels"}),group:1,order:10});for(var i=function(){var s=ve.AllLogLevels[o],l=e[s]!=null?e[s]:!1;r.push({title:s,group:1,order:o+100,menuElement:d.jsx(zy,{logLevel:s,on:l,onClick:t.handleMenuItemClick,ref:u=>{u!=null&&(t.logLevelMenuItems[s]=u)}})})},o=0;o<ve.AllLogLevels.length;o+=1)i();return r.push({group:1,order:1e3,menuElement:d.jsxs("div",{className:"log-level-menu-controls",children:[d.jsx(ne,{kind:"ghost",className:"log-level-toggle-all",onClick:this.handleToggleAllClick,children:"Toggle All"}),d.jsx(ne,{kind:"ghost",onClick:this.handleResetClick,children:"Reset"})]})}),r}resetLogLevels(){for(var e={},t=function(){var o=ve.AllLogLevels[r],a=ve.DefaultLogLevels.some(s=>s===o);e[o]=a},r=0;r<ve.AllLogLevels.length;r+=1)t();this.setState({shownLogLevels:e})}startListening(){var e=this.props.session;this.cancelListener=e.onLogMessage(this.handleLogMessage)}stopListening(){this.cancelListener!=null&&(this.cancelListener(),this.cancelListener=void 0)}initMonaco(){B(this.editorContainer),this.editor=Le.create(this.editorContainer,{copyWithSyntaxHighlighting:!1,fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"log",lineDecorationsWidth:0,lineNumbers:"off",lineNumbersMinChars:0,minimap:{enabled:!1},readOnly:!0,renderLineHighlight:"none",scrollBeyondLastLine:!1,value:"",wordWrap:"on"}),[[en.Escape],[nt.Shift|en.Escape]].forEach(e=>{B(this.editor),Ee.disableKeyBindings(this.editor,e),this.editor.addAction({id:"clear-selection-on-escape",label:"",keybindings:[en.Escape],keybindingContext:"findWidgetVisible && editorTextFocus",run:()=>{var t,r,i=(t=this.editor)===null||t===void 0?void 0:t.getPosition();B(i),(r=this.editor)===null||r===void 0||r.setPosition(i)}})})}destroyMonaco(){this.editor&&(this.editor.dispose(),this.editor=void 0)}triggerFindWidget(){var e,t;(e=this.editor)===null||e===void 0||e.focus(),(t=this.editor)===null||t===void 0||t.trigger("keyboard","actions.find",void 0)}toggleAll(){for(var e=this.state.shownLogLevels,t=!0,r=0;r<ve.AllLogLevels.length;r+=1){var i=ve.AllLogLevels[r];if(!e[i]){t=!1;break}}if(t)this.setState({shownLogLevels:{}});else{for(var o={},a=0;a<ve.AllLogLevels.length;a+=1){var s=ve.AllLogLevels[a];o[s]=!0}this.setState({shownLogLevels:o})}}toggleLogLevel(e){var t=this.state.shownLogLevels,r=t[e],i={};i[e]=!r,this.updateLogLevels(i)}updateLogLevels(e){var t=this.state.shownLogLevels;t=as(as({},t),e),this.setState({shownLogLevels:t})}appendLogText(e){if(this.editor){var t=this.editor.getModel(),r=t==null?void 0:t.getLineCount();B(r);var i=t==null?void 0:t.getLineLength(r);B(i);var o=this.isBottomVisible(),a=[];if(i>0&&(a.push({range:{startLineNumber:r,startColumn:i+1,endLineNumber:r,endColumn:i+1},text:`
36
- `,forceMoveMarkers:!0}),r+=1,i=0),a.push({range:{startLineNumber:r,startColumn:i,endLineNumber:r,endColumn:i},text:e,forceMoveMarkers:!0}),t==null||t.applyEdits(a),o){var s=t==null?void 0:t.getLineCount();B(s),this.editor.revealLine(s,1)}}}refreshLogText(){if(this.editor){this.truncateLogIfNecessary();for(var e=this.state.shownLogLevels,t=this.isBottomVisible(),r="",i=0;i<this.messages.length;i+=1){var o=this.messages[i];if(e[o.logLevel]){var a=ve.getLogText(o);a.length>0&&(r+=a,a.charAt(a.length-1)!==`
29
+ `,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!1,nullString:null},COLON_SV:{name:": colon sv",delimiter:":",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},SEMI_COLON_SV:{name:"; semi-colon sv",delimiter:";",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},PIPE_SV:{name:"| pipe separated (psv)",delimiter:"|",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},SPACE_SV:{name:'" " space sv',delimiter:" ",newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"},AUTODETECT:{name:"autodetect",delimiter:void 0,newline:void 0,escapeChar:'"',shouldTrim:!0,skipEmptyLines:!0,nullString:"(null)"}}));function Tu(n,e,t){return(e=hy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hy(n){var e=my(n,"string");return typeof e=="symbol"?e:e+""}function my(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function py(n,e){return by(n)||gy(n,e)||vy(n,e)||fy()}function fy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vy(n,e){if(n){if(typeof n=="string")return Xa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Xa(n,e):void 0}}function Xa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function gy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function by(n){if(Array.isArray(n))return n}var Za=H.module("CsvInputBar"),yy=Object.entries(Ht.TYPES).map(n=>{var e=py(n,2),t=e[0],r=e[1];return d.jsx("option",{value:t,children:r.name},t)});class Ou extends m.Component{constructor(e){super(e),Tu(this,"inputRef",void 0),this.handleUpload=this.handleUpload.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleError=this.handleError.bind(this),this.handleTableName=this.handleTableName.bind(this),this.toggleFirstRowHeaders=this.toggleFirstRowHeaders.bind(this),this.handleProgress=this.handleProgress.bind(this),this.handleCancelInProgress=this.handleCancelInProgress.bind(this),this.handleQueryTypeChange=this.handleQueryTypeChange.bind(this),this.inputRef=k.createRef(),this.state={tableName:"",tableNameSet:!1,isFirstRowHeaders:!0,showProgress:!1,progressValue:0,type:Ht.DEFAULT_TYPE,parser:null}}componentDidUpdate(e){var t=this.props,r=t.file,i=t.paste,o=this.state,a=o.tableName,s=o.tableNameSet;if(!s&&r!=null&&!a){var l,u=r.name.lastIndexOf("."),c=gt.makeVariableName(r.name.substring(0,u));this.setState({tableName:c,tableNameSet:!0}),(l=this.inputRef.current)===null||l===void 0||l.focus()}else(r==null&&e.file!=null||i==null&&e.paste!=null)&&this.setState({tableName:"",tableNameSet:!1});i!=null&&i!==""&&!a&&this.inputRef.current&&this.inputRef.current.focus(),r!=null&&r!==e.file?this.setState({type:Ht.fromExtension(r.name)}):i!=null&&i!==""&&(e.paste===void 0||e.paste==="")&&this.setState({type:Ht.AUTO})}componentWillUnmount(){var e=this.state.parser;e&&e.cancel()}handleCancel(){var e=this.props.onClose;e()}handleError(e){var t=this.props,r=t.onClose,i=t.onError;Za.error(e),i(e),r()}handleTableName(e){this.setState({tableName:e.target.value,tableNameSet:!0})}toggleFirstRowHeaders(){var e=this.state.isFirstRowHeaders;this.setState({isFirstRowHeaders:!e})}handleUpload(e){e.stopPropagation(),e.preventDefault();var t=this.props,r=t.file,i=t.paste;r!=null?r.name.endsWith(".zip")?this.handleZipFile(r):this.handleFile(r):i!==void 0&&i!==""&&this.handleFile(new Blob([i],{type:"text/plain"}))}handleFile(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Za.info("Starting CSV parser for ".concat(e instanceof File?e.name:"pasted values"," ").concat(t?"":e.size," bytes"));var r=this.props,i=r.session,o=r.timeZone,a=r.onInProgress,s=this.state,l=s.tableName,u=s.isFirstRowHeaders,c=s.type,h=f=>{f.length===1?i.bindTableToVariable(f[0],l).then(()=>this.openTable()).catch(v=>this.handleError(v)):i.mergeTables(f).then(v=>{i.bindTableToVariable(v,l).then(()=>this.openTable()).catch(g=>this.handleError(g)),f.forEach(g=>g.close())}).catch(v=>this.handleError(v))},p=new xn({onFileCompleted:h,session:i,file:e,type:Ht.TYPES[c],readHeaders:u,onProgress:this.handleProgress,onError:this.handleError,timeZone:o,isZip:t});p.parse(),this.setState({showProgress:!0,parser:p}),a(!0)}handleZipFile(e){var t=this.props,r=t.onUpdate,i=t.unzip;if(i==null){this.handleError(new Error("No support for zip files available."));return}i(e).then(o=>{for(var a=!1,s=0;s<o.length;s+=1){var l=o[s];if($e.isValidExtension(l.name)){r("Loading ".concat(l.name," as csv from ").concat(e.name)),a=!0,this.handleFile(l,!0);break}}if(!a)throw new Error("No csv file found in ".concat(e.name))}).catch(o=>this.handleError(o))}handleProgress(e){var t=this.state.showProgress;return t&&this.setState({progressValue:e}),!t}handleCancelInProgress(){var e=this.props.onInProgress,t=this.state.parser;t&&t.cancel(),this.setState({showProgress:!1,progressValue:0}),e(!1)}openTable(){var e=this.props,t=e.onOpenTable,r=e.onClose,i=this.state.tableName;t(i),r()}handleQueryTypeChange(e){this.setState({type:e})}render(){var e=this.props,t=e.file,r=e.paste,i=this.state,o=i.tableName,a=i.isFirstRowHeaders,s=i.showProgress,l=i.progressValue,u=i.type,c=!!r&&!o;return d.jsxs("div",{className:"csv-input-bar",children:[!s&&d.jsxs("form",{onSubmit:this.handleUpload,className:"csv-input-bar-container form-inline",children:[d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"tableNameInput",children:"Table name"}),d.jsx("input",{ref:this.inputRef,id:"tableNameInput",type:"text",className:U("form-control",{"is-invalid":c}),value:o,onChange:this.handleTableName})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"formatSelect",children:"File format"}),d.jsx(bl,{id:"formatSelect",className:"custom-select",value:u,onChange:this.handleQueryTypeChange,children:yy})]}),d.jsx(dl,{className:"firstRowHeaders",checked:a,onChange:this.toggleFirstRowHeaders,children:"First row is column headers"}),d.jsxs("div",{className:"csv-input-buttons form-group",children:[d.jsx(ne,{kind:"secondary",onClick:this.handleCancel,children:"Cancel"}),d.jsx(ne,{kind:"primary",type:"submit",disabled:!(t!==null||r!==void 0&&r!=="")||!o,children:"Upload"})]})]}),s&&d.jsxs("div",{className:"csv-progress-container",children:[d.jsx("label",{children:"Uploading Table"}),d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar bg-primary",style:{width:"".concat(l,"%")},"aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":100})}),d.jsxs("label",{children:[l,"%"]}),d.jsx(ne,{kind:"primary",onClick:this.handleCancelInProgress,children:"Cancel"})]})]})}}Tu(Ou,"defaultProps",{file:null,paste:null,unzip:null});function Ya(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Sy(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ya(o,r,i,a,s,"next",l)}function s(l){Ya(o,r,i,a,s,"throw",l)}a(void 0)})}}function Cy(n,e){return Py(n)||Ey(n,e)||wy(n,e)||_y()}function _y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wy(n,e){if(n){if(typeof n=="string")return Qa(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Qa(n,e):void 0}}function Qa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Ey(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Py(n){if(Array.isArray(n))return n}var Ty={placement:"bottom-end"};function Oy(n){var e=n.children,t=n.dh,r=n.session,i=n.overflowActions,o=m.useState(0),a=Cy(o,2),s=a[0],l=a[1],u=m.useCallback(function(){var f=Sy(function*(v){l(b=>b+1);try{var g=v.detail.result;yield g}catch{}l(b=>b-1)});return function(v){return f.apply(this,arguments)}}(),[]);m.useEffect(function(){return r.addEventListener(t.IdeSession.EVENT_COMMANDSTARTED,u)},[t,u,r]);var c=null,h=null;s>0?(c="console-status-icon-pending",h="Worker is busy"):(c="console-status-icon-idle",h="Worker is idle");var p=i!=null&&(!Array.isArray(i)||i.length>0);return d.jsxs("div",{className:"console-pane-status-bar",children:[d.jsxs("div",{children:[d.jsx("div",{className:U("console-status-icon",c)}),d.jsx(ue,{children:h})]}),e,p&&d.jsx(ne,{kind:"ghost",icon:od,tooltip:"More Actions...","aria-label":"More Actions...",onClick:Xs,children:d.jsx(kr,{actions:i,popperOptions:Ty})})]})}function Iy(n,e){return jy(n)||My(n,e)||Dy(n,e)||xy()}function xy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dy(n,e){if(n){if(typeof n=="string")return Ja(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ja(n,e):void 0}}function Ja(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function My(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jy(n){if(Array.isArray(n))return n}var Ay=5e3;function ky(n){var e=n.openObject,t=n.objects,r=m.useState(""),i=Iy(r,2),o=i[0],a=i[1],s=m.useRef(null),l=Pc(()=>{a("")},Ay),u=m.useCallback(()=>{var p;l.cancel(),(p=s.current)===null||p===void 0||p.select()},[l]),c=m.useCallback(()=>{l()},[l]),h=m.useMemo(()=>{if(t.length===0)return[];var p={menuElement:d.jsx(Nr,{value:o,onChange:g=>{a(g.target.value)},className:"console-menu",ref:s})},f=o?t.filter(g=>{var b=g.title;return b!=null&&b.toLowerCase().includes(o.toLowerCase())}):t,v=f.map(g=>({title:g.title,action:()=>{e(g)},icon:d.jsx(fu,{type:g.type})}));return[p,...v]},[t,o,e]);return d.jsx(ne,{"aria-label":"Objects",kind:"ghost",disabled:t.length===0,onClick:Xs,tooltip:t.length===0?"No objects available":"Objects",icon:d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(me,{mask:Hs,icon:ai,transform:"right-5 down-5"}),d.jsx(me,{icon:ai,transform:"right-8 down-6"})]}),children:d.jsx(kr,{actions:h,onMenuOpened:u,onMenuClosed:c,options:{initialKeyboardIndex:1},popperOptions:{placement:"bottom-end"}})})}function es(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?es(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):es(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return(e=Ny(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ny(n){var e=Ly(n,"string");return typeof e=="symbol"?e:e+""}function Ly(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tt=H.module("Console"),ts={isAutoLaunchPanelsEnabled:!0,isPrintStdOutEnabled:!0,isClosePanelsOnDisconnectEnabled:!0};function Ry(){return!0}function $y(n){return d.jsx(d.Fragment,{})}class Ut extends m.PureComponent{static isErrorLevel(e){return e===Pe.STDERR||e===Pe.ERROR||e===Pe.FATAL}static isOutputLevel(e){return e===Pe.STDOUT||Ut.isErrorLevel(e)}constructor(e){super(e),Ke(this,"cancelListener",void 0),Ke(this,"consolePane",void 0),Ke(this,"consoleInput",void 0),Ke(this,"consoleHistoryScrollPane",void 0),Ke(this,"consoleHistoryContent",void 0),Ke(this,"pending",void 0),Ke(this,"queuedLogMessages",void 0),Ke(this,"resizeObserver",void 0),Ke(this,"processLogMessageQueue",Mr(()=>{this.setState(o=>{tt.debug2("processLogMessageQueue",this.queuedLogMessages.length," items");var a=o.consoleHistory;return a=a.concat(this.queuedLogMessages),this.queuedLogMessages=[],{consoleHistory:a}})},Ut.LOG_THROTTLE)),Ke(this,"getObjects",_n(o=>Array.from(o.values()))),Ke(this,"getContextActions",_n(o=>[...o,{action:this.handleClearShortcut,shortcut:En.CONSOLE.CLEAR},{action:this.handleFocusHistory,shortcut:En.CONSOLE.FOCUS_HISTORY}])),this.handleCommandResult=this.handleCommandResult.bind(this),this.handleCommandStarted=this.handleCommandStarted.bind(this),this.handleCommandSubmit=this.handleCommandSubmit.bind(this),this.handleClearShortcut=this.handleClearShortcut.bind(this),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleLogMessage=this.handleLogMessage.bind(this),this.handleOverflowActions=this.handleOverflowActions.bind(this),this.handleScrollPaneScroll=this.handleScrollPaneScroll.bind(this),this.handleHistoryResize=this.handleHistoryResize.bind(this),this.handleToggleAutoLaunchPanels=this.handleToggleAutoLaunchPanels.bind(this),this.handleToggleClosePanelsOnDisconnect=this.handleToggleClosePanelsOnDisconnect.bind(this),this.handleTogglePrintStdout=this.handleTogglePrintStdout.bind(this),this.handleUploadCsv=this.handleUploadCsv.bind(this),this.handleHideCsv=this.handleHideCsv.bind(this),this.handleCsvFileCanceled=this.handleCsvFileCanceled.bind(this),this.handleCsvFileOpened=this.handleCsvFileOpened.bind(this),this.handleCsvPaste=this.handleCsvPaste.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleClearDragError=this.handleClearDragError.bind(this),this.handleOpenCsvTable=this.handleOpenCsvTable.bind(this),this.handleCsvUpdate=this.handleCsvUpdate.bind(this),this.handleCsvError=this.handleCsvError.bind(this),this.handleCsvInProgress=this.handleCsvInProgress.bind(this),this.consolePane=k.createRef(),this.consoleInput=k.createRef(),this.consoleHistoryScrollPane=k.createRef(),this.consoleHistoryContent=k.createRef(),this.pending=new jr,this.queuedLogMessages=[],this.resizeObserver=new window.ResizeObserver(this.handleHistoryResize);var t=this.props,r=t.objectMap,i=t.settings;this.state=st(st({consoleHistory:[],consoleHeight:0,isScrollDecorationShown:!1,objectHistoryMap:new Map,objectMap:new Map(r),showCsvOverlay:!1,csvFile:null,csvPaste:null,dragError:null,csvUploadInProgress:!1,isStuckToBottom:!0},ts),i)}componentDidMount(){this.initConsoleLogging();var e=this.props,t=e.dh,r=e.session;r.addEventListener(t.IdeSession.EVENT_COMMANDSTARTED,this.handleCommandStarted),this.updateDimensions(),this.consoleHistoryScrollPane.current&&this.consoleHistoryContent.current&&(this.resizeObserver.observe(this.consoleHistoryScrollPane.current),this.resizeObserver.observe(this.consoleHistoryContent.current))}componentDidUpdate(e,t){var r=this.props,i=this.state;this.sendSettingsChange(t,i),r.objectMap!==e.objectMap&&this.updateObjectMap(),i.isStuckToBottom&&!this.isAtBottom()&&this.scrollConsoleHistoryToBottom()}componentWillUnmount(){var e=this.props,t=e.dh,r=e.session;r.removeEventListener(t.IdeSession.EVENT_COMMANDSTARTED,this.handleCommandStarted),this.pending.cancel(),this.processLogMessageQueue.cancel(),this.deinitConsoleLogging(),this.resizeObserver.disconnect()}initConsoleLogging(){var e=this.props.session;this.cancelListener=e.onLogMessage(this.handleLogMessage)}deinitConsoleLogging(){this.cancelListener!=null&&(this.cancelListener(),this.cancelListener=void 0)}isAtBottom(){if(this.consoleHistoryScrollPane.current==null)return!1;var e=this.consoleHistoryScrollPane.current,t=e.scrollHeight,r=e.clientHeight,i=e.scrollTop;return Math.abs(t-r-i)<=1}handleClearShortcut(e){var t;e.preventDefault(),e.stopPropagation(),(t=this.consoleInput.current)===null||t===void 0||t.clear()}handleCommandStarted(e){var t=e.detail,r=t.code,i=t.result,o=this.pending.add(i),a={command:r,disabledObjects:[],startTime:Date.now(),cancelResult:()=>{i.cancel()},wrappedResult:o},s=this.props,l=s.commandHistoryStorage,u=s.language,c=s.scope,h=l.addItem(u,c,r,{command:r,startTime:new Date().toJSON()});h.catch(p=>{tt.debug("Error adding workspace item",p)}),this.setState(p=>({consoleHistory:p.consoleHistory.concat(a)}),()=>{this.scrollConsoleHistoryToBottom()}),o.then(p=>{this.handleCommandResult(p,a,h)}).catch(p=>{this.handleCommandError(p,a,h)})}handleCommandResult(e,t,r){var i,o,a=e==null||(i=e.startTimestamp)===null||i===void 0?void 0:i.asNumber(),s=e==null||(o=e.endTimestamp)===null||o===void 0?void 0:o.asNumber(),l=st(st({},t),{},{wrappedResult:void 0,cancelResult:void 0,result:e??t.result,serverStartTime:a,serverEndTime:s});this.setState(u=>{var c=u.consoleHistory,h=c.lastIndexOf(t);if(h<0)return tt.error("historyItem not found in consoleHistory"),null;var p=c.concat();return p[h]=l,{consoleHistory:p}}),e&&(this.scrollConsoleHistoryToBottom(),this.updateHistory(e,l),this.updateKnownObjects(l),this.updateWorkspaceHistoryItem({error:e.error,serverStartTime:a,serverEndTime:s},r),this.closeRemovedItems(e.changes),this.openUpdatedItems(e.changes))}handleCommandError(e,t,r){if(Qe.isCanceled(e)){tt.debug("Called handleCommandError on a cancelled promise result");return}this.updateWorkspaceHistoryItem({error:"".concat(e)},r),this.setState(i=>{var o=i.consoleHistory.concat(),a=o.lastIndexOf(t),s=st({},t);return s.wrappedResult=void 0,s.cancelResult=void 0,s.endTime=Date.now(),s.result={error:e},o[a]=s,{consoleHistory:o}})}handleFocusHistory(e){e.preventDefault(),e.stopPropagation();var t=this.props.focusCommandHistory;t()}handleLogMessage(e){var t=this.state.isPrintStdOutEnabled;t&&Ut.isOutputLevel(e.logLevel)&&this.queueLogMessage(e.message,e.logLevel)}queueLogMessage(e,t){var r={};Ut.isErrorLevel(t)?r.error=e:r.message=e;var i={command:void 0,result:r};this.queuedLogMessages.push(i),this.processLogMessageQueue()}openUpdatedItems(e){tt.debug("openUpdatedItems",e);var t=this.state.isAutoLaunchPanelsEnabled;if(e!=null){var r=this.props.openObject;[...e.created,...e.updated].forEach(i=>r(i,t&&(i.title===void 0||!i.title.startsWith("_"))))}}closeRemovedItems(e){if(!(e==null||e.removed==null||e.removed.length===0)){var t=this.props.closeObject,r=e.removed;r.forEach(i=>t(i))}}updateHistory(e,t){var r=t;e==null||e.changes==null||r==null||(r.endTime=Date.now(),this.setState(i=>{var o=i.consoleHistory.concat();return{consoleHistory:o}}))}updateKnownObjects(e){var t;if(e.result&&(t=e.result.changes),!t||(t.created==null||t.created.length===0)&&(t.updated==null||t.updated.length===0)&&(t.removed==null||t.removed.length===0)){tt.debug2("updateKnownObjects no changes");return}this.setState(r=>{var i,o,a,s=r.consoleHistory,l=s.lastIndexOf(e);if(l<0)return tt.error("historyItem not found in state.consoleHistory"),null;var u=new Map(r.objectHistoryMap),c=new Map(r.objectMap),h=function(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=f.title;W(g);var b=u.get(g);if(b!=null&&b>=0){var y;s===r.consoleHistory&&(s=s.concat());var S=st(st({},s[b]),{},{disabledObjects:[...(y=s[b].disabledObjects)!==null&&y!==void 0?y:[],g]});s[b]=S}u.set(g,l),v?c.delete(g):c.set(g,f)};return(i=t)===null||i===void 0||i.updated.forEach(p=>h(p)),(o=t)===null||o===void 0||o.removed.forEach(p=>h(p,!0)),(a=t)===null||a===void 0||a.created.forEach(p=>{var f=p.title;W(f),u.set(f,l),c.set(f,p)}),{objectHistoryMap:u,objectMap:c,consoleHistory:s}})}updateObjectMap(){var e=this.props.objectMap;this.setState({objectMap:e})}updateWorkspaceHistoryItem(e,t){var r=this.pending.add(t),i=new Date().toJSON();r.then(o=>{var a=st(st({},o),{},{data:st(st({},o.data),{},{endTime:i,result:e})}),s=this.props,l=s.commandHistoryStorage,u=s.language;l.updateItem(u,a).catch(c=>{tt.warn("Error updating command history storage",c)})}).catch(o=>{tt.debug("Error updating workspace history item",o)})}scrollConsoleHistoryToBottom(){var e=this.consoleHistoryScrollPane.current;e!=null&&window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"instant"})})}handleScrollPaneScroll(e){tt.debug("handleScrollPaneScroll",e);var t=this.consoleHistoryScrollPane.current;W(t),this.setState({isScrollDecorationShown:t.scrollTop>0&&t.scrollHeight>t.clientHeight,isStuckToBottom:this.isAtBottom()})}handleHistoryResize(e){tt.debug("handleHistoryResize",e);var t=e[0];if(t.contentRect.height>0&&t.contentRect.width>0){var r=this.state.isStuckToBottom;r&&!this.isAtBottom()&&this.scrollConsoleHistoryToBottom()}}handleToggleAutoLaunchPanels(){this.setState(e=>({isAutoLaunchPanelsEnabled:!e.isAutoLaunchPanelsEnabled}))}handleToggleClosePanelsOnDisconnect(){this.setState(e=>({isClosePanelsOnDisconnectEnabled:!e.isClosePanelsOnDisconnectEnabled}))}handleTogglePrintStdout(){this.setState(e=>({isPrintStdOutEnabled:!e.isPrintStdOutEnabled}))}handleUploadCsv(){this.setState({showCsvOverlay:!0,dragError:null,csvUploadInProgress:!1})}handleHideCsv(){this.setState({showCsvOverlay:!1,csvFile:null,csvPaste:null,dragError:null,csvUploadInProgress:!1})}handleCsvFileCanceled(){this.setState({csvFile:null,csvPaste:null})}handleCsvFileOpened(e){this.setState({csvFile:e,csvPaste:null})}handleCsvPaste(e){this.setState({csvFile:null,csvPaste:e})}handleDragEnter(e){if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0||e.dataTransfer.items[0].kind==="string")){e.preventDefault(),e.stopPropagation(),this.setState({showCsvOverlay:!0});var t=e.dataTransfer.items;if(t.length>1){this.setState({dragError:$e.MULTIPLE_FILE_ERROR});return}var r=t[0];$e.isValidDropItem(r)?this.setState({dragError:null}):this.setState({dragError:$e.FILE_TYPE_ERROR})}}handleDragLeave(e){e.currentTarget==null||e.currentTarget instanceof Element&&e.relatedTarget instanceof Element&&e.currentTarget.contains(e.relatedTarget)||(e.preventDefault(),e.stopPropagation(),this.setState({showCsvOverlay:!1,dragError:null}))}handleClearDragError(){this.setState({dragError:null})}handleOpenCsvTable(e){var t=this.props,r=t.dh,i=t.openObject,o=t.commandHistoryStorage,a=t.language,s=t.scope,l=this.state,u=l.consoleHistory,c=l.objectMap,h={name:e,title:e,type:r.VariableType.TABLE},p=c.has(e),f={startTime:Date.now(),endTime:Date.now(),disabledObjects:[],result:{changes:{created:[],updated:[],removed:[],[p?"updated":"created"]:[h]}}},v=u.concat(f);this.setState({consoleHistory:v}),this.scrollConsoleHistoryToBottom(),this.updateKnownObjects(f),i({name:e,type:r.VariableType.TABLE}),o.addItem(a,s,e,{command:e,startTime:new Date().toJSON(),endTime:new Date().toJSON()})}addConsoleHistoryMessage(e,t){var r=this.state.consoleHistory,i={startTime:Date.now(),endTime:Date.now(),result:{message:e,error:t}},o=r.concat(i);this.setState({consoleHistory:o})}handleCsvUpdate(e){this.addConsoleHistoryMessage(e)}handleCsvError(e){this.addConsoleHistoryMessage(void 0,e!=null?"".concat(e):void 0)}handleCsvInProgress(e){this.setState({csvUploadInProgress:e})}handleOverflowActions(){var e=this.state,t=e.isAutoLaunchPanelsEnabled,r=e.isClosePanelsOnDisconnectEnabled,i=e.isPrintStdOutEnabled,o=this.props.actions;return[...o,{title:"Print Stdout",action:this.handleTogglePrintStdout,group:de.groups.high,icon:i?Gr:void 0,order:10},{title:"Auto Launch Panels",action:this.handleToggleAutoLaunchPanels,group:de.groups.high,icon:t?Gr:void 0,order:20},{title:"Close Panels on Disconnect",action:this.handleToggleClosePanelsOnDisconnect,group:de.groups.high,icon:r?Gr:void 0,order:30},{title:"Upload Table from File",action:this.handleUploadCsv,group:de.groups.high+10,order:40}]}handleCommandSubmit(e){if(e==="clear"||e==="cls")this.clearConsoleHistory();else if(e.length>0){var t=this.props.session;t.runCode(e).catch(i=>{tt.error("There was an error initiating the command",i)})}else{var r={command:" ",result:{},startTime:Date.now(),endTime:Date.now()};this.scrollConsoleHistoryToBottom(),this.setState(i=>({consoleHistory:i.consoleHistory.concat(r)}))}}clearConsoleHistory(){this.pending.cancel(),this.setState(e=>{var t=new Map([...e.objectHistoryMap.keys()].map(r=>[r,-1]));return{consoleHistory:[],objectHistoryMap:t}})}addCommand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.consoleInput.current&&(this.consoleInput.current.setConsoleText(e,t,r),t&&this.scrollConsoleHistoryToBottom())}focus(){var e;(e=this.consoleInput.current)===null||e===void 0||e.focus()}sendSettingsChange(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Object.keys(ts),o={},a=!1,s=0;s<i.length;s+=1){var l=i[s],u=t[l],c=e[l];u!==c&&(a=!0),o[l]=u}if(!(r&&!a)){var h=this.props.onSettingsChange;h(o)}}updateDimensions(){this.consolePane.current&&this.setState({consoleHeight:this.consolePane.current.clientHeight}),this.consoleInput.current&&this.consoleInput.current.updateDimensions()}render(){var e=this.props,t=e.actions,r=e.dh,i=e.historyChildren,o=e.language,a=e.statusBarChildren,s=e.openObject,l=e.session,u=e.scope,c=e.commandHistoryStorage,h=e.timeZone,p=e.disabled,f=e.unzip,v=e.supportsType,g=e.iconForType,b=e.showObjectsMenu,y=this.state,S=y.consoleHeight,C=y.consoleHistory,_=y.isScrollDecorationShown,w=y.objectMap,D=y.showCsvOverlay,B=y.csvFile,N=y.csvPaste,x=y.dragError,j=y.csvUploadInProgress,L=this.getObjects(w),re=Math.round(S*.7),A=this.getContextActions(t);return d.jsxs("div",{role:"presentation",className:U("iris-console","h-100","w-100",{disabled:p}),children:[d.jsxs("div",{className:"console-pane",ref:this.consolePane,children:[d.jsxs(Oy,{dh:r,session:l,overflowActions:this.handleOverflowActions,children:[a,b===!0&&d.jsx(ky,{openObject:s,objects:L})]}),d.jsxs("div",{className:"console-csv-container",onDragOver:$e.handleDragOver,onDragEnter:this.handleDragEnter,onDragLeave:this.handleDragLeave,children:[d.jsxs("div",{role:"presentation",className:U("scroll-pane no-scroll-x",{"scroll-decoration":_}),onScroll:this.handleScrollPaneScroll,ref:this.consoleHistoryScrollPane,children:[d.jsx(sb,{items:C,openObject:s,language:o,disabled:p,supportsType:v,iconForType:g,ref:this.consoleHistoryContent,onCommandSubmit:this.handleCommandSubmit}),i]}),D&&d.jsx($e,{onCancel:this.handleCsvFileCanceled,onFileOpened:this.handleCsvFileOpened,onPaste:this.handleCsvPaste,clearDragError:this.handleClearDragError,dragError:x,onError:this.handleCsvError,uploadInProgress:j,allowZip:f!=null})]}),!D&&d.jsx(In,{ref:this.consoleInput,session:l,language:o,scope:u,onSubmit:this.handleCommandSubmit,maxHeight:re,commandHistoryStorage:c}),D&&d.jsx(Ou,{session:l,onOpenTable:this.handleOpenCsvTable,onClose:this.handleHideCsv,onUpdate:this.handleCsvUpdate,onError:this.handleCsvError,file:B??void 0,paste:N??void 0,onInProgress:this.handleCsvInProgress,timeZone:h,unzip:f})]}),d.jsx(de,{actions:A,ignoreClassNames:[In.INPUT_CLASS_NAME]})]})}}Ke(Ut,"defaultProps",{statusBarChildren:null,settings:{},onSettingsChange:()=>{},scope:null,actions:[],historyChildren:null,timeZone:"America/New_York",objectMap:new Map,disabled:!1,unzip:null,supportsType:Ry,iconForType:$y,showObjectsMenu:!0});Ke(Ut,"LOG_THROTTLE",500);function $n(n,e,t){return(e=Fy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fy(n){var e=Hy(n,"string");return typeof e=="symbol"?e:e+""}function Hy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uy=250,By=2500;class Iu extends m.Component{constructor(e){super(e),$n(this,"timer",void 0),$n(this,"cleanup",void 0),$n(this,"loadData",zn(()=>{var t=this.props,r=t.commandHistoryStorage,i=t.item,o=t.language,a=i.id;this.cleanup=r.listenItem(o,a,this.handleUpdate,this.handleError)},Uy)),$n(this,"getPreviewText",vn(t=>t.split(`
33
+ `,By).join(`
34
+ `),{max:1})),this.handleUpdate=this.handleUpdate.bind(this),this.handleError=this.handleError.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.state={currentTime:Date.now()}}componentDidMount(){this.loadData()}componentDidUpdate(e,t){var r,i=this.state.data;this.timer==null&&!(i!=null&&i.result)&&(i!=null&&i.startTime)&&!(i==null||i.endTime===void 0)?this.startTimer():(i!=null&&i.result&&!((r=t.data)!==null&&r!==void 0&&r.result)||i!=null&&i.endTime&&!(t.data==null||t.data.endTime===void 0))&&this.stopTimer()}componentWillUnmount(){this.loadData.cancel(),this.cleanup!=null&&this.cleanup(),this.stopTimer()}startTimer(){this.stopTimer(),this.timer=window.setInterval(this.handleTimeout,1e3)}stopTimer(){this.timer!=null&&(clearInterval(this.timer),this.timer=void 0)}updateTime(){this.setState({currentTime:Date.now()})}handleError(e){this.setState({error:"".concat(e)})}handleUpdate(e){var t=e??{},r=t.data;this.setState({data:r});var i=this.props.onUpdate;i==null||i(r)}handleTimeout(){this.updateTime()}render(){var e,t=this.props,r=t.item.name,i=t.language,o=this.state,a=o.currentTime,s=o.data,l=o.error,u=s??{},c=u.result,h=u.startTime,p=u.endTime,f=(e=c==null?void 0:c.error)!==null&&e!==void 0?e:l,v=He.formatConvertedDuration(h,p??a),g=this.getPreviewText(r),b=!!v;return d.jsxs("div",{className:"command-history-item-tooltip",children:[d.jsxs("div",{className:"scroll-container",children:[d.jsx(vu,{language:i,children:g}),g.length<r.length&&d.jsx("p",{children:"Preview Truncated..."})]}),d.jsxs("div",{className:"result-info",children:[d.jsxs("div",{className:"d-flex justify-content-between",children:[!!f&&d.jsxs("div",{className:"text-danger mr-1",children:[d.jsx(me,{icon:Bs})," Executed with errors"]}),d.jsxs("div",{className:"time-wrapper",children:["Elapsed time:"," ",b?d.jsx("span",{className:"time-string",children:v}):d.jsx(Us,{className:"loading-spinner-vertical-align"})]})]}),!!f&&d.jsx("div",{className:"error-message",children:f})]})]})}}$n(Iu,"defaultProps",{onUpdate:()=>{}});var Wy=512;function Ky(n){var e=n.item,t=n.language,r=n.isSelected,i=r===void 0?!1:r,o=n.commandHistoryStorage,a=e.name.substring(0,Wy),s=m.useRef(null),l=m.useCallback(()=>{var u;(u=s.current)===null||u===void 0||u.update()},[s]);return d.jsxs("div",{className:U("command-history-item",{selected:i}),children:[a,d.jsx(ue,{ref:s,interactive:!0,options:{placement:"left",modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport",order:825}}},popperClassName:"command-history-item-popper",children:d.jsx(Iu,{item:e,language:t,onUpdate:l,commandHistoryStorage:o})})]})}class xr extends m.Component{static itemKey(e,t){return"".concat(t.title)}static renderContent(e){return e.selectionRequired!==void 0&&e.selectionRequired?d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(me,{icon:ad,mask:e.icon,transform:"right-5 down-5 shrink-4"}),d.jsx(me,{icon:Rs,transform:"shrink-3 right-7 down-6"})]}):d.jsx(me,{icon:e.icon})}render(){var e=this.props,t=e.actions,r=e.hasSelection;return d.jsx("div",{className:"command-history-actions",children:t.map((i,o)=>d.jsx(ne,{kind:"inline",className:U(i.className),onClick:i.action,tooltip:i.description,disabled:i.selectionRequired!==void 0&&i.selectionRequired&&!r,icon:xr.renderContent(i)},xr.itemKey(o,i)))})}}var zy=150,ns=3,rs=H.module("CommandHistoryViewportUpdater");function Vy(n){var e=n.table,t=n.columns,r=n.top,i=r===void 0?0:r,o=n.bottom,a=o===void 0?0:o,s=n.search,l=n.isReversed,u=l===void 0?!1:l,c=n.onUpdate,h=m.useMemo(()=>Mr(p=>{var f=p.bottom-p.top,v=Math.max(0,p.top-f*ns),g=p.bottom+f*ns;e.setViewport({top:v,bottom:g,columns:p.columns})},zy),[e]);return m.useEffect(function(){var f=e.onUpdate(v=>{var g,b;c({items:(g=v.items)!==null&&g!==void 0?g:[],offset:(b=v.offset)!==null&&b!==void 0?b:0})});return()=>{rs.debug("onUpdate cleanup"),f()}},[e,c]),m.useEffect(function(){e.setSearch(s??"")},[e,s]),m.useEffect(function(){h({top:i,bottom:a,columns:t})},[h,i,a,t,s,u]),m.useEffect(()=>()=>{rs.debug2("Cancel throttledUpdateViewport"),h.cancel()},[h]),null}function is(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function os(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){is(o,r,i,a,s,"next",l)}function s(l){is(o,r,i,a,s,"throw",l)}a(void 0)})}}function ft(n,e,t){return(e=Gy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gy(n){var e=qy(n,"string");return typeof e=="symbol"?e:e+""}function qy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nt=H.module("CommandHistory");class Le extends m.Component{static getCommandsFromViewport(e,t,r){for(var i=[],o=0;o<r.length;o+=1)for(var a=r[o],s=a[0];s<=a[1];s+=1)if(s>=t&&s<t+e.length){var l=e[s-t].name;i.push(l)}return i}static getCommandsFromSnapshot(e,t){return os(function*(){var r=yield e.getSnapshot(t);return[...r.values()].map(i=>i.name)})()}constructor(e){super(e),ft(this,"itemActions",void 0),ft(this,"historyActions",void 0),ft(this,"pending",void 0),ft(this,"searchInputRef",void 0),ft(this,"itemListRef",void 0),ft(this,"debouncedSearchChange",zn(()=>{this.setState(r=>{var i=r.searchText;return{debouncedSearchText:i,selectedRanges:[]}})},Le.SET_SEARCH_DEBOUNCE_MS)),this.copySelectedCommands=this.copySelectedCommands.bind(this),this.createNotebook=this.createNotebook.bind(this),this.sendToConsole=this.sendToConsole.bind(this),this.renderItem=this.renderItem.bind(this),this.runInConsole=this.runInConsole.bind(this),this.sendToNotebook=this.sendToNotebook.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleViewportUpdate=this.handleViewportUpdate.bind(this),this.itemActions=[{title:"Copy Selection",description:"Copy selected commands to clipboard",icon:sd,shortcut:yn.COPY,action:this.copySelectedCommands,group:de.groups.edit},{title:"Send to Console",description:"Open selected commands in the console",icon:no,shortcut:En.COMMAND_HISTORY.SEND_TO_CONSOLE,action:this.sendToConsole,group:Le.menuGroups.send,order:10},{title:"Run in Console",description:"Run selected commands in the console",icon:ld,shortcut:En.COMMAND_HISTORY.RUN,action:this.runInConsole,group:Le.menuGroups.send,order:10},{title:"Send to Active Notebook",description:"Open selected commands in a notebook",icon:ro,shortcut:En.COMMAND_HISTORY.SEND_TO_NOTEBOOK,action:this.sendToNotebook,group:Le.menuGroups.send,order:20},{title:"Send to New Notebook",description:"Open selected commands in a new notebook",icon:Ws,action:this.createNotebook,group:Le.menuGroups.send,order:30}],this.historyActions=[{title:"Send to Console",icon:no,selectionRequired:!0,description:"Open selected commands in the console",action:this.sendToConsole},{title:"Send to Notebook",icon:ro,selectionRequired:!0,description:"Open selected commands in a notebook",action:this.sendToNotebook}],this.pending=new jr,this.searchInputRef=k.createRef(),this.itemListRef=k.createRef();var t=e.table;this.state={actions:[],historyActions:this.historyActions,top:0,bottom:0,itemCount:t.size,items:[],offset:0,selectedRanges:[],searchText:"",debouncedSearchText:""}}componentWillUnmount(){this.debouncedSearchChange.cancel(),this.pending.cancel()}getSelectedCommands(){var e=this;return os(function*(){var t=e.state,r=t.items,i=t.offset,o=t.selectedRanges,a=o.slice().sort((l,u)=>l[0]-u[0]);if(a.length===0)return[];if(a[0][0]>=i&&a[a.length-1][1]<i+r.length)return Le.getCommandsFromViewport(r,i,a);var s=e.props.table;return e.pending.add(Le.getCommandsFromSnapshot(s,a))})()}getSelectedCommandText(){return this.getSelectedCommands().then(e=>e.join(`
35
+ `))}updateActions(){this.setState(e=>{var t=e.selectedRanges,r=t.reduce((i,o)=>i+o[1]-o[0]+1,0);return r>0&&r<Le.MAX_SELECTION_COUNT?(Nt.debug("Updating actions",this.itemActions),{actions:this.itemActions}):(Nt.debug("Disabling actions",r),{actions:[]})})}copySelectedCommands(){this.getSelectedCommandText().then(Qs).catch(Nt.error)}createNotebook(){this.getSelectedCommandText().then(e=>{var t=this.props,r=t.language,i=t.sendToNotebook;i({value:e,language:r},!0)}).catch(Nt.error)}sendToNotebook(){this.getSelectedCommandText().then(e=>{var t=this.props,r=t.language,i=t.sendToNotebook;i({value:e,language:r})}).catch(Nt.error)}sendToConsole(){var e=this.props.sendToConsole;this.getSelectedCommandText().then(e).catch(Nt.error)}runInConsole(){this.getSelectedCommandText().then(e=>{var t=this.props.sendToConsole;t(e,!0,!0)}).catch(Nt.error)}handleSelect(e){var t=this.props.sendToConsole,r=this.state,i=r.items,o=r.offset;if(e<o||e>=o+i.length){Nt.error("Invalid index!",e);return}var a=i[e-o].name;t(a)}handleSelectionChange(e){this.setState({selectedRanges:e}),this.updateActions()}handleViewportChange(e,t){this.setState({top:e,bottom:t})}handleSearchChange(e){this.setState({searchText:e.target.value}),this.debouncedSearchChange()}handleViewportUpdate(e){var t=e.items,r=e.offset,i=this.props.table,o=i.size;this.setState({items:t,itemCount:o,offset:r})}renderItem(e){var t=e.item;e.itemIndex;var r=e.isSelected,i=this.props,o=i.language,a=i.commandHistoryStorage;return d.jsx(Ky,{isSelected:r,item:t,language:o,commandHistoryStorage:a})}focus(){this.searchInputRef.current&&this.searchInputRef.current.focus()}restoreScrollPosition(){var e;(e=this.itemListRef.current)===null||e===void 0||e.restoreScrollPosition()}render(){var e,t=this.props,r=t.language,i=t.table,o=this.state,a=o.actions,s=o.historyActions,l=o.searchText,u=o.debouncedSearchText,c=o.top,h=o.bottom,p=o.items,f=o.itemCount,v=o.offset,g=o.selectedRanges,b=(e=gu.LANGUAGE_MAP.get(r))!==null&&e!==void 0?e:"";return d.jsxs("div",{className:"command-history",children:[d.jsxs("div",{className:"command-history-search-bar",children:[d.jsx(Nr,{ref:this.searchInputRef,value:l,placeholder:"".concat(b," Command History"),onChange:this.handleSearchChange}),d.jsx(xr,{actions:s,hasSelection:g.length>0})]}),d.jsxs("div",{className:"command-history-list",children:[d.jsx(ct,{ref:this.itemListRef,itemCount:f,items:p,offset:v,selectedRanges:g,onSelect:this.handleSelect,onSelectionChange:this.handleSelectionChange,onViewportChange:this.handleViewportChange,renderItem:this.renderItem,rowHeight:Le.ITEM_HEIGHT,isDoubleClickSelect:!0,isMultiSelect:!0,isStickyBottom:!0}),d.jsx(Vy,{table:i,top:c,bottom:h,search:u,onUpdate:this.handleViewportUpdate}),d.jsx(de,{actions:a})]})]})}}ft(Le,"ITEM_HEIGHT",29);ft(Le,"MAX_SELECTION_COUNT",1e4);ft(Le,"SET_SEARCH_DEBOUNCE_MS",150);ft(Le,"menuGroups",{send:de.groups.medium+100});class Xy extends m.PureComponent{constructor(e){super(e),this.handleSwitchClick=this.handleSwitchClick.bind(this)}handleSwitchClick(){var e=this.props,t=e.logLevel,r=e.onClick;r(t)}render(){var e=this.props,t=e.logLevel,r=e.on;return d.jsxs("div",{className:U("log-level-menu-item",t),children:[d.jsx(dm,{on:r,onClick:this.handleSwitchClick}),t]})}}function as(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ss(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?as(Object(t),!0).forEach(function(r){Ze(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):as(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ze(n,e,t){return(e=Zy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zy(n){var e=Yy(n,"string");return typeof e=="symbol"?e:e+""}function Yy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ve extends m.PureComponent{static getLogText(e){var t=new Date(e.micros/1e3),r=Or.formatTimestamp(t);return"".concat(r," ").concat(e.logLevel," ").concat(e.message)}constructor(e){super(e),Ze(this,"cancelListener",void 0),Ze(this,"editor",void 0),Ze(this,"editorContainer",void 0),Ze(this,"logLevelMenuItems",void 0),Ze(this,"flushTimer",void 0),Ze(this,"bufferedMessages",void 0),Ze(this,"messages",void 0),this.handleClearClick=this.handleClearClick.bind(this),this.handleFlushTimeout=this.handleFlushTimeout.bind(this),this.handleLogMessage=this.handleLogMessage.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleResetClick=this.handleResetClick.bind(this),this.handleResize=this.handleResize.bind(this),this.handleToggleAllClick=this.handleToggleAllClick.bind(this),this.logLevelMenuItems={},this.editorContainer=null,this.bufferedMessages=[],this.messages=[],this.state={shownLogLevels:{}}}componentDidMount(){this.resetLogLevels(),this.initMonaco(),this.startListening(),window.addEventListener("resize",this.handleResize)}componentDidUpdate(e,t){this.updateDimensions();var r=this.state.shownLogLevels;t.shownLogLevels!==r&&this.refreshLogText();var i=this.props.session;e.session!==i&&(this.stopListening(),this.startListening(),this.clearLogs())}componentWillUnmount(){this.stopFlushTimer(),this.stopListening(),this.destroyMonaco(),window.removeEventListener("resize",this.handleResize)}getMenuActions(e){var t=this,r=[];r.push({menuElement:d.jsx("div",{className:"log-level-menu-title",children:"Display Log Levels"}),group:1,order:10});for(var i=function(){var s=ve.AllLogLevels[o],l=e[s]!=null?e[s]:!1;r.push({title:s,group:1,order:o+100,menuElement:d.jsx(Xy,{logLevel:s,on:l,onClick:t.handleMenuItemClick,ref:u=>{u!=null&&(t.logLevelMenuItems[s]=u)}})})},o=0;o<ve.AllLogLevels.length;o+=1)i();return r.push({group:1,order:1e3,menuElement:d.jsxs("div",{className:"log-level-menu-controls",children:[d.jsx(ne,{kind:"ghost",className:"log-level-toggle-all",onClick:this.handleToggleAllClick,children:"Toggle All"}),d.jsx(ne,{kind:"ghost",onClick:this.handleResetClick,children:"Reset"})]})}),r}resetLogLevels(){for(var e={},t=function(){var o=ve.AllLogLevels[r],a=ve.DefaultLogLevels.some(s=>s===o);e[o]=a},r=0;r<ve.AllLogLevels.length;r+=1)t();this.setState({shownLogLevels:e})}startListening(){var e=this.props.session;this.cancelListener=e.onLogMessage(this.handleLogMessage)}stopListening(){this.cancelListener!=null&&(this.cancelListener(),this.cancelListener=void 0)}initMonaco(){W(this.editorContainer),this.editor=Re.create(this.editorContainer,{copyWithSyntaxHighlighting:!1,fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"log",lineDecorationsWidth:0,lineNumbers:"off",lineNumbersMinChars:0,minimap:{enabled:!1},readOnly:!0,renderLineHighlight:"none",scrollBeyondLastLine:!1,value:"",wordWrap:"on"}),[[tn.Escape],[nt.Shift|tn.Escape]].forEach(e=>{W(this.editor),Te.disableKeyBindings(this.editor,e),this.editor.addAction({id:"clear-selection-on-escape",label:"",keybindings:[tn.Escape],keybindingContext:"findWidgetVisible && editorTextFocus",run:()=>{var t,r,i=(t=this.editor)===null||t===void 0?void 0:t.getPosition();W(i),(r=this.editor)===null||r===void 0||r.setPosition(i)}})})}destroyMonaco(){this.editor&&(this.editor.dispose(),this.editor=void 0)}triggerFindWidget(){var e,t;(e=this.editor)===null||e===void 0||e.focus(),(t=this.editor)===null||t===void 0||t.trigger("keyboard","actions.find",void 0)}toggleAll(){for(var e=this.state.shownLogLevels,t=!0,r=0;r<ve.AllLogLevels.length;r+=1){var i=ve.AllLogLevels[r];if(!e[i]){t=!1;break}}if(t)this.setState({shownLogLevels:{}});else{for(var o={},a=0;a<ve.AllLogLevels.length;a+=1){var s=ve.AllLogLevels[a];o[s]=!0}this.setState({shownLogLevels:o})}}toggleLogLevel(e){var t=this.state.shownLogLevels,r=t[e],i={};i[e]=!r,this.updateLogLevels(i)}updateLogLevels(e){var t=this.state.shownLogLevels;t=ss(ss({},t),e),this.setState({shownLogLevels:t})}appendLogText(e){if(this.editor){var t=this.editor.getModel(),r=t==null?void 0:t.getLineCount();W(r);var i=t==null?void 0:t.getLineLength(r);W(i);var o=this.isBottomVisible(),a=[];if(i>0&&(a.push({range:{startLineNumber:r,startColumn:i+1,endLineNumber:r,endColumn:i+1},text:`
36
+ `,forceMoveMarkers:!0}),r+=1,i=0),a.push({range:{startLineNumber:r,startColumn:i,endLineNumber:r,endColumn:i},text:e,forceMoveMarkers:!0}),t==null||t.applyEdits(a),o){var s=t==null?void 0:t.getLineCount();W(s),this.editor.revealLine(s,1)}}}refreshLogText(){if(this.editor){this.truncateLogIfNecessary();for(var e=this.state.shownLogLevels,t=this.isBottomVisible(),r="",i=0;i<this.messages.length;i+=1){var o=this.messages[i];if(e[o.logLevel]){var a=ve.getLogText(o);a.length>0&&(r+=a,a.charAt(a.length-1)!==`
37
37
  `&&(r+=`
38
- `))}}if(r=r.trimRight(),this.editor.setValue(r),t){var s,l=(s=this.editor.getModel())===null||s===void 0?void 0:s.getLineCount();B(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>ve.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-ve.truncateSize))}scrollToBottom(){var e,t;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.getLineCount();B(r),this.editor.revealLine(r,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e==null?void 0:e.getLineCount();return B(t),this.isLineVisible(t)}isLineVisible(e){var t,r=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(r==null||r.length===0)return!1;for(var i=0;i<r.length;i+=1){var o=r[i];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var t=this.state.shownLogLevels;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var r=this.bufferedMessages[t],i=ve.getLogText(r);e+=i,i.charAt(i.length-1)!==`
38
+ `))}}if(r=r.trimRight(),this.editor.setValue(r),t){var s,l=(s=this.editor.getModel())===null||s===void 0?void 0:s.getLineCount();W(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>ve.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-ve.truncateSize))}scrollToBottom(){var e,t;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.getLineCount();W(r),this.editor.revealLine(r,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e==null?void 0:e.getLineCount();return W(t),this.isLineVisible(t)}isLineVisible(e){var t,r=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(r==null||r.length===0)return!1;for(var i=0;i<r.length;i+=1){var o=r[i];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var t=this.state.shownLogLevels;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var r=this.bufferedMessages[t],i=ve.getLogText(r);e+=i,i.charAt(i.length-1)!==`
39
39
  `&&(e+=`
40
- `)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ve.bufferTimeout))}stopFlushTimer(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)}updateDimensions(){this.editor&&this.editor.layout()}handleClearClick(){this.clearLogs()}clearLogs(){this.messages=[],this.refreshLogText()}handleFlushTimeout(){this.stopFlushTimer(),this.flush()}handleLogMessage(e){this.messages.push(e),this.editor&&this.isLogItemVisible(e)&&this.queue(e)}handleMenuItemClick(e){this.toggleLogLevel(e)}handleResetClick(){this.resetLogLevels()}handleResize(){this.updateDimensions()}handleToggleAllClick(){this.toggleAll()}render(){var e={placement:"bottom-end"},t=this.state.shownLogLevels,r=this.getMenuActions(t);return d.jsxs("div",{className:"log-pane h-100 w-100",children:[d.jsxs("div",{className:"log-pane-menu",children:[d.jsx(ne,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:sd,tooltip:"Clear log"}),d.jsx(ne,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:ld,tooltip:"Log Settings",onClick:()=>{},children:d.jsx(jr,{actions:r,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),d.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Xe(ve,"DefaultLogLevels",[_e.STDOUT,_e.ERROR,_e.FATAL,_e.STDERR,_e.WARN]);Xe(ve,"AllLogLevels",[_e.INFO,_e.STDOUT,_e.ERROR,_e.FATAL,_e.STDERR,_e.WARN,_e.DEBUG,_e.TRACE]);Xe(ve,"bufferTimeout",16);Xe(ve,"maxLogSize",131072);Xe(ve,"truncateSize",65536);function ss(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function qy(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ss(o,r,i,a,s,"next",l)}function s(l){ss(o,r,i,a,s,"throw",l)}a(void 0)})}}function ls(n,e){return Qy(n)||Yy(n,e)||Zy(n,e)||Xy()}function Xy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zy(n,e){if(n){if(typeof n=="string")return us(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?us(n,e):void 0}}function us(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Yy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Qy(n){if(Array.isArray(n))return n}var Jy=H.module("HeapUsage");function e0(n){var e,t=n.connection,r=n.defaultUpdateInterval,i=n.hoverUpdateInterval,o=n.bgMonitoring,a=o===void 0?!0:o,s=n.monitorDuration,l=Hg(),u=h.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),c=ls(u,2),m=c[0],p=c[1],f=h.useState(!1),v=ls(f,2),g=v[0],b=v[1],y=h.useRef({timestamps:[],usages:[]}),C=el(),S=h.useCallback(qy(function*(){try{var ce=yield t.getWorkerHeapInfo();if(!C.current)return;if(p(ce),a||g){for(var Z=(ce.totalHeapSize-ce.freeMemory)/ce.maximumHeapSize,V=Date.now(),te=y.current,G=te.timestamps,Q=te.usages;G.length!==0&&V-G[0]>s*1.5;)G.shift(),Q.shift();G.push(V),Q.push(Z)}else y.current={timestamps:[],usages:[]}}catch(M){Jy.warn("Unable to get heap usage",M)}}),[t,C,a,g,s]);wc(S,g?i:r);var _=(ce,Z)=>Math.round(ce*10**Z)/10**Z,E=2,D=1024**3,W=m.freeMemory,N=m.totalHeapSize,I=m.maximumHeapSize,k=_(W/D,E),$=_(N/D,E),ae=_(I/D,E),A=$-k,X=function(Z,V){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return d.jsxs("div",{className:U("heap-usage-info-row",{"heading-bottom-border":te}),children:[d.jsx("div",{className:"font-weight-bold",children:Z}),d.jsx("div",{children:V})]})},de=y.current,se=de.timestamps,be=de.usages,ye=(e=se[se.length-1])!==null&&e!==void 0?e:0,Te=N/I,Se=(N-W)/I;return d.jsxs("div",{className:"max-memory",children:[d.jsx("div",{className:"total-memory",style:{width:"calc(".concat(Te*100,"% - ").concat(Te*2,"px")}}),d.jsx("div",{className:U("used-memory",{"heap-overflow":(N-W)/I>.95}),style:{width:"calc(".concat(Se*100,"% - ").concat(Se*2,"px")}}),d.jsxs("div",{className:"memory-text",children:[ae.toFixed(1)," GB"]}),d.jsx(le,{onEntered:()=>b(!0),onExited:()=>b(!1),interactive:!0,children:d.jsxs("div",{className:"heap-tooltip",children:[X("In use:","".concat(A.toFixed(E)," of ").concat(ae.toFixed(E)," GB"),!0),X("Free:","".concat(k.toFixed(E)," GB")),X("Total:","".concat($.toFixed(E)," GB")),X("Max:","".concat(ae.toFixed(E)," GB")),d.jsx("div",{className:"heap-plot",children:d.jsx(Fg,{data:[{x:[...se],y:[...be],type:"scatter",mode:"lines"}],config:{staticPlot:!0,responsive:!0},style:{width:"196px",height:"100px"},layout:{margin:{l:2,t:2,r:2,b:2},plot_bgcolor:"transparent",paper_bgcolor:"transparent",colorway:["#4878ea"],xaxis:{dtick:Math.round(s/6),gridcolor:l.linecolor,range:[ye-s,ye],linecolor:l.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:l.linecolor,range:[0,1],linecolor:l.linecolor,linewidth:2,mirror:!0}}})}),d.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}function Zn(n,e,t){return(e=t0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t0(n){var e=n0(n,"string");return typeof e=="symbol"?e:e+""}function n0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ot{}Zn(ot,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");Zn(ot,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");Zn(ot,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");Zn(ot,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");Zn(ot,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Kt(n,e,t){return(e=r0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function r0(n){var e=i0(n,"string");return typeof e=="symbol"?e:e+""}function i0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vt{}Kt(vt,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Kt(vt,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Kt(vt,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Kt(vt,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Kt(vt,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Kt(vt,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Kt(vt,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Kt(vt,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function It(n,e,t){return(e=o0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function o0(n){var e=a0(n,"string");return typeof e=="symbol"?e:e+""}function a0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $e{}It($e,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");It($e,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");It($e,"CLOSE_FILE","NotebookEvent.closeFile");It($e,"RENAME","NotebookEvent.rename");It($e,"RENAME_FILE","NotebookEvent.renameFile");It($e,"REGISTER_FILE","NotebookEvent.registerFile");It($e,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");It($e,"UNREGISTER_FILE","NotebookEvent.unregisterFile");It($e,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");var Xi=mt(ot.SESSION_OPENED),s0=Xi.listen,jS=Xi.emit,AS=Xi.useListener,Zi=mt(ot.SESSION_CLOSED),l0=Zi.listen,kS=Zi.emit,NS=Zi.useListener,u0=["children"];function ds(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ds(Object(t),!0).forEach(function(r){Ei(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ds(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function d0(n,e){if(n==null)return{};var t,r,i=c0(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function c0(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ei(n,e,t){return(e=h0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function h0(n){var e=m0(n,"string");return typeof e=="symbol"?e:e+""}function m0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class p0 extends h.PureComponent{constructor(e){super(e),Ei(this,"stopListenForSessionClosed",void 0),Ei(this,"stopListenForSessionOpened",void 0),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this)}componentDidMount(){var e=this.props.glEventHub;this.stopListenForSessionClosed=l0(e,this.handleSessionClosed),this.stopListenForSessionOpened=s0(e,this.handleSessionOpened),e.on(vt.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}componentWillUnmount(){var e,t,r=this.props.glEventHub;(e=this.stopListenForSessionClosed)===null||e===void 0||e.call(this),(t=this.stopListenForSessionOpened)===null||t===void 0||t.call(this),r.off(vt.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}handleClearAllFilters(){for(var e=this.props.onClearAllFilters,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleSessionClosed(e){var t=this.props.onSessionClose;t==null||t(e)}handleSessionOpened(e){var t=this.props.onSessionOpen;t==null||t(e)}render(){var e=this.props,t=e.children,r=d0(e,u0);return d.jsx(wg,cs(cs({},r),{},{children:t}))}}var $r=bl(p0),f0=Object.freeze({}),v0=new Map,Fr=Object.freeze([]),LS=(n,e)=>{var t;return(t=Ie(n,e).columns)!==null&&t!==void 0?t:Fr},RS=(n,e)=>{var t;return(t=Ie(n,e).filterSets)!==null&&t!==void 0?t:Fr},$S=(n,e)=>{var t;return(t=Ie(n,e).filters)!==null&&t!==void 0?t:Fr},FS=(n,e)=>{var t;return(t=Ie(n,e).tableMap)!==null&&t!==void 0?t:v0},HS=(n,e)=>Ie(n,e).isolatedLinkerPanelId,US=(n,e)=>{var t;return(t=Ie(n,e).links)!==null&&t!==void 0?t:Fr},BS=(n,e)=>Ie(n,e).columnSelectionValidator,WS=(n,e)=>{var t;return(t=Ie(n,e).consoleSettings)!==null&&t!==void 0?t:f0},KS=(n,e)=>Ie(n,e).connection,Hr=(n,e)=>Ie(n,e).sessionWrapper;function xr(n,e,t){return(e=g0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function g0(n){var e=b0(n,"string");return typeof e=="symbol"?e:e+""}function b0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fr=H.module("CommandHistoryPanel");class Yn extends h.Component{static handleError(e){fr.error(e)}constructor(e){super(e),xr(this,"container",void 0),xr(this,"pending",void 0),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSendToConsole=this.handleSendToConsole.bind(this),this.handleSendToNotebook=this.handleSendToNotebook.bind(this),this.container=j.createRef(),this.pending=new Dr;var t=e.session,r=e.sessionId,i=e.language;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:wn.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var e=this.props,t=e.glEventHub,r=e.session;t.on(ot.FOCUS_HISTORY,this.handleFocusHistory),r!=null&&this.loadTable()}componentWillUnmount(){var e=this.props.glEventHub;e.off(ot.FOCUS_HISTORY,this.handleFocusHistory),this.pending.cancel()}handleFocusHistory(){this.container.current&&this.container.current.focus()}handleShow(){var e;(e=this.container.current)===null||e===void 0||e.restoreScrollPosition()}handleSessionOpened(e){var t=e.session,r=e.language,i=e.sessionId;this.setState({session:t,sessionId:i,language:r},()=>{this.loadTable()})}handleSessionClosed(){this.pending.cancel(),this.setState({session:void 0,language:void 0,table:void 0})}handleSendToNotebook(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.state,i=r.session,o=r.language;if(fr.debug("handleSendToNotebook",i,e),!i){fr.error("Session is not connected.");return}var a=this.props.glEventHub;a.emit(t?$e.CREATE_NOTEBOOK:$e.SEND_TO_NOTEBOOK,i,o,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;fr.debug("handleSendToConsole",e);var i=this.props.glEventHub;i.emit(ot.SEND_COMMAND,e,t,r)}loadTable(){var e=this.props.commandHistoryStorage,t=this.state,r=t.language,i=t.sessionId;B(r),B(i),this.pending.add(e.getTable(r,i,Date.now()),o=>o.close()).then(o=>{this.setState({table:o})}).catch(Yn.handleError)}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=e.commandHistoryStorage,o=this.state,a=o.language,s=o.contextActions,l=o.table;return d.jsxs($r,{className:"command-history-pane",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!l&&d.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),l&&a!=null&&d.jsxs(d.Fragment,{children:[d.jsx(Ne,{ref:this.container,language:a,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:l,commandHistoryStorage:i}),d.jsx(ue,{actions:s})]})]})}}xr(Yn,"COMPONENT","CommandHistoryPanel");xr(Yn,"TITLE","Command History");var y0=(n,e)=>{var t=_l(n),r=Hr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a??{},l=s.type,u=s.id;return{commandHistoryStorage:t,language:l,session:o,sessionId:u}},zS=Wn(y0,null,null,{forwardRef:!0})(Yn);function hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(t),!0).forEach(function(r){nn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nn(n,e,t){return(e=C0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function C0(n){var e=S0(n,"string");return typeof e=="symbol"?e:e+""}function S0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var pn=H.module("ConsolePanel"),w0=500,_0=Object.freeze({consoleSettings:{},itemIds:[]});class Ur extends h.PureComponent{constructor(e){super(e),nn(this,"consoleRef",void 0),nn(this,"objectSubscriptionCleanup",void 0),nn(this,"savePanelState",Bn(()=>{var a=this.state,s=a.consoleSettings,l=a.itemIds,u={consoleSettings:s,itemIds:[...l]};pn.debug("Saving panel state",u),this.setState({panelState:u})},w0)),this.handleFocusCommandHistory=this.handleFocusCommandHistory.bind(this),this.handleOpenObject=this.handleOpenObject.bind(this),this.handleCloseObject=this.handleCloseObject.bind(this),this.handleResize=this.handleResize.bind(this),this.handleSettingsChange=this.handleSettingsChange.bind(this),this.handleShow=this.handleShow.bind(this),this.handlePanelMount=this.handlePanelMount.bind(this),this.supportsType=this.supportsType.bind(this),this.iconForType=this.iconForType.bind(this),this.consoleRef=j.createRef();var t=e.panelState,r=vr(vr({},_0),t||{}),i=r.consoleSettings,o=r.itemIds;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var e=this.props.glEventHub;this.closeDisconnectedPanels(),e.on(ee.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var r=this.state,i=r.consoleSettings,o=r.itemIds;(t.consoleSettings!==i||t.itemIds!==o)&&this.savePanelState()}componentWillUnmount(){var e,t=this.props.glEventHub;this.savePanelState.flush(),t.off(ee.MOUNT,this.handlePanelMount),(e=this.objectSubscriptionCleanup)===null||e===void 0||e.call(this)}subscribeToFieldUpdates(){var e=this.props.sessionWrapper;if(e!=null){var t=e.session;this.objectSubscriptionCleanup=t.subscribeToFieldUpdates(r=>{pn.debug("Got updates",r),this.setState(i=>{var o=i.objectMap,a=r.updated,s=r.created,l=r.removed,u=[...a,...l],c=new Map(o);u.forEach(p=>{var f=p.title;f!==void 0&&c.delete(f)});var m=[...a,...s];return m.forEach(p=>{p.title!==void 0&&c.set(p.title,p)}),{objectMap:c}})})}}setItemId(e,t){this.setState(r=>{var i=r.itemIds,o=new Map(i);return o.set(e,t),{itemIds:o}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.state.itemIds,i=r.get(e);return i==null&&t&&(i=Pt(),this.setItemId(e,i)),i}deleteItemId(e){this.setState(t=>{var r=t.itemIds;pn.debug("Delete item",e,r);var i=[...r.keys()].find(a=>r.get(a)===e);if(i===void 0)return null;var o=new Map(r);return o.delete(i),{itemIds:o}})}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,i=this.state.itemIds,o=e==null||(t=e.props)===null||t===void 0?void 0:t.id,a=e==null||(r=e.props)===null||r===void 0||(r=r.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(o&&a){var s=new Set(i.values());s.has(a)&&this.setItemId(o,o)}}handlePanelClosed(e){var t=this.props.glContainer,r=T.getRootFromContainer(t),i=T.getStackForConfig(r,{id:e});i!==null&&T.getContentItemInStack(i,{id:e})!==null||this.deleteItemId(e)}handleFocusCommandHistory(){var e=this.props.glEventHub;e.emit(ot.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;B(this.context);var r=this.context.root,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&T.getStackForRoot(r,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var t=e.title;if(t!==void 0){var r=this.getItemId(t,!1);if(r!=null){var i=this.props.glEventHub;pa(i,r),dg(i,t)}}}handleSettingsChange(e){var t=this.props.glEventHub;pn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(ot.SETTINGS_CHANGED,e)}openWidget(e){var t=this.props,r=t.glEventHub,i=t.plugins,o=e.type,a=xp(i,o);if(a!=null){var s=a.createDashboardPayload(e);pn.debug("openDashboardWidget",s),ug(r,s)}else this.openPanelWidget(e)}openPanelWidget(e){var t=this.props,r=t.glEventHub,i=t.sessionWrapper;B(i);var o=i.config,a=i.session,s=e.title,l=s===void 0?e.name:s;B(l);var u=this.getItemId(l);B(u);var c={fetch:()=>a.getObject(e),panelId:u,widget:vr(vr({},Cm(e)),{},{sessionId:o.id})};pn.debug("openPanelWidget",c),Jf(r,c)}addCommand(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,r,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.state,r=t.consoleSettings,i=t.itemIds,o=r.isClosePanelsOnDisconnectEnabled,a=o===void 0?!0:o;if(!(!a&&!e)){var s=[...i.values()],l=this.props.glEventHub;s.forEach(u=>{pa(l,u)}),this.setState({itemIds:new Map})}}updateDimensions(){var e;(e=this.consoleRef.current)===null||e===void 0||e.updateDimensions()}supportsType(e){var t=this.props.plugins;return[...t.values()].some(r=>Jo(r,e))}iconForType(e){var t=this.props.plugins,r=[...t.values()].find(i=>Jo(i,e));return r!=null?Ep(r):d.jsx(mu,{type:e})}render(){var e=this.props,t=e.commandHistoryStorage,r=e.glContainer,i=e.glEventHub,o=e.sessionWrapper,a=e.timeZone,s=e.unzip;if(o==null)return d.jsx(Un,{isLoading:!1,errorMessage:"Console is disabled.","data-testid":"console-panel-loading-error"});var l=this.state,u=l.consoleSettings,c=l.error,m=l.objectMap,p=o.config,f=o.session,v=o.connection,g=o.details,b=g===void 0?{}:g,y=o.dh,C=b.workerName,S=b.processInfoId,_=p.id,E=p.type;return d.jsx($r,{className:"iris-panel-console",componentPanel:this,glContainer:r,glEventHub:i,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:c!=null?"".concat(c):void 0,children:f!=null&&d.jsx(Ht,{dh:y,ref:this.consoleRef,settings:u,session:f,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:t,onSettingsChange:this.handleSettingsChange,language:E,statusBarChildren:d.jsxs(d.Fragment,{children:[d.jsx("div",{children:fu.LANGUAGE_MAP.get(E)}),C!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),C]}),S!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),S,d.jsx("div",{children:"•"})]}),d.jsx(e0,{connection:v,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),showObjectsMenu:!1,scope:_,timeZone:a,objectMap:m,unzip:s,supportsType:this.supportsType,iconForType:this.iconForType})})}}nn(Ur,"COMPONENT","ConsolePanel");nn(Ur,"TITLE","Console");nn(Ur,"contextType",tu);var E0=(n,e)=>({commandHistoryStorage:_l(n),sessionWrapper:Hr(n,e.localDashboardId),timeZone:Rm(n),plugins:$m(n)}),VS=Wn(E0,null,null,{forwardRef:!0})(Ur);function GS(n){return n==="file"||n==="directory"}function dt(n){return n.type==="directory"}function P0(n,e,t){return(e=T0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function T0(n){var e=O0(n,"string");return typeof e=="symbol"?e:e+""}function O0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Yi extends Error{constructor(){super("No file exists at the path specified"),P0(this,"isFileNotFound",!0)}}function ms(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function ps(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ms(o,r,i,a,s,"next",l)}function s(l){ms(o,r,i,a,s,"throw",l)}a(void 0)})}}var Yt=function(n){return n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN="",n}({});class R{static fileExists(e,t){return ps(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof Yi))throw r;return!1}})()}static fileExtensionToString(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e.length===0?"":".".concat(e)}static getDepth(e){var t;if(!R.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var r=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return r.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var r;return(r=t.pop())!==null&&r!==void 0?r:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),r=null,i=null;t<0?i=e:(i=e.substring(0,t),r=e.substring(t+1));var o=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(o,".").concat(r):o}static getUniqueCopyFileName(e,t){return ps(function*(){for(var r=R.getCopyFileName(t);yield R.fileExists(e,r);)r=R.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return Yt.GROOVY;case"py":return Yt.PYTHON;case"pyc":return Yt.PYTHON_COMPILED;case"scala":return Yt.SCALA;case"txt":return Yt.PLAIN_TEXT;default:return Yt.UNKNOWN}}static getParent(e){if(!R.hasPath(e))throw new Error("Invalid name provided: ".concat(e));for(var t=e.split("/");t.pop()==="";);if(t.length===0)throw new Error("No parent for path provided: ".concat(e));return"".concat(t.join("/"),"/")}static getPath(e){if(!R.hasPath(e))throw new Error("Invalid filename provided: ".concat(e));var t=e.split("/");return t.pop(),"".concat(t.join("/"),"/")}static hasPath(e){return e.startsWith("/")}static isPath(e){return e.startsWith("/")&&e.endsWith("/")}static makePath(e){return e.endsWith("/")?e:"".concat(e,"/")}static replaceExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=e.lastIndexOf("."),i=r>-1?e.substring(0,r):e,o=R.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new Ln("Name cannot be empty");if(t.includes(e))throw new Ln('"'.concat(e,'" is a reserved name'));if(r.test(e)){var o,a;throw new Ln('Invalid characters in name: "'.concat((o=(a=e.match(r))===null||a===void 0?void 0:a.reduce((s,l)=>s.includes(l)?s:[...s,l],[]).map(s=>i.has(s)?i.get(s):s).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(r=>R.isPath(r));return e.filter(r=>!t.some(i=>r!==i&&r.startsWith(i)))}static removeRoot(e,t){if(e.length===0)return t;if(!t.startsWith(e))throw new Error("Filename ".concat(t," does not start with expected root ").concat(e));return t.substring(e.length)}static addRoot(e,t){return"".concat(e).concat(t)}}var Qi=26;function Pi(n){return dt(n)?R.makePath(n.filename):R.getPath(n.filename)}function fs(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=Pi(e);if(n.some(r=>{var i=r.filename;return R.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>dt(r)&&t.startsWith(R.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function x0(n){if(dt(n))return n.isExpanded?ud:dd;var e=R.getMimeType(n.basename);switch(e){case Yt.PYTHON:return hd;default:return cd}}function Ti(n){var e,t=n.children,r=n.draggedItems,i=n.isDragInProgress,o=n.isDropTargetValid,a=n.isSelected,s=n.item,l=n.itemIndex,u=n.dropTargetItem,c=n.onDragStart,m=n.onDragOver,p=n.onDragEnd,f=n.onDragExit,v=n.onDrop,g=(e=r==null?void 0:r.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,b=Pi(s),y=i&&u?Pi(u):null,C=i&&o&&dt(s)&&y===b,S=i&&o&&y===b,_=i&&!o&&y===b,E=x0(s),D=R.getDepth(s.filename),W=Array(D).fill(null).map((N,I)=>d.jsx("span",{className:"file-list-depth-line"},I));return d.jsxs("div",{className:U("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":C,"is-in-drop-target":S,"is-invalid-drop-target":_,"is-selected":a}),onDragStart:N=>c(l,N),onDragOver:N=>m(l,N),onDragEnd:N=>p(l,N),onDragExit:f,onDrop:N=>v(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[W," ",d.jsx(me,{icon:E,className:"item-icon",fixedWidth:!0})," ",d.jsx("span",{className:"truncation-wrapper",children:t??d.jsxs(d.Fragment,{children:[s.basename,d.jsx(le,{children:s.basename})]})})]})}function vs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vs(Object(t),!0).forEach(function(r){I0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function I0(n,e,t){return(e=D0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function D0(n){var e=M0(n,"string");return typeof e=="symbol"?e:e+""}function M0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Gt(n,e){return N0(n)||k0(n,e)||A0(n,e)||j0()}function j0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A0(n,e){if(n){if(typeof n=="string")return gs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gs(n,e):void 0}}function gs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function k0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function N0(n){if(Array.isArray(n))return n}var je=H.module("FileList"),L0=500,bs="item-list-scroll-pane";function R0(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.table,i=n.onFocusChange,o=i===void 0?()=>{}:i,a=n.onMove,s=n.onSelect,l=n.onSelectionChange,u=l===void 0?()=>{}:l,c=n.renderItem,m=c===void 0?Ti:c,p=n.rowHeight,f=p===void 0?Qi:p,v=n.overscanCount,g=v===void 0?ct.DEFAULT_OVERSCAN:v,b=h.useState(()=>({items:[],offset:0,itemCount:0})),y=Gt(b,2),C=y[0],S=y[1],_=h.useState({top:0,bottom:0}),E=Gt(_,2),D=E[0],W=E[1],N=h.useState(),I=Gt(N,2),k=I[0],$=I[1],ae=h.useState(),A=Gt(ae,2),X=A[0],de=A[1],se=h.useState(),be=Gt(se,2),ye=be[0],Te=be[1],Se=h.useState([]),ce=Gt(Se,2),Z=ce[0],V=ce[1],te=h.useRef(),G=h.useRef(null),Q=h.useRef(null),M=h.useCallback(O=>{if(O.length===0||C==null)return[];for(var z=[],J=0;J<O.length;J+=1)for(var De=O[J],Me=De[0];Me<=De[1];Me+=1)Me>=C.offset&&Me<C.offset+C.items.length&&z.push(C.items[Me-C.offset]);return z},[C]),Ve=h.useCallback(O=>{var z=M([[O,O]]);if(z.length>0)return z[0]},[M]),Qn=h.useCallback(()=>{var O=lt.count(Z);if(O===0)return null;if(O===1){var z=Z[0][0],J=Ve(z);if(J!=null)return J.filename}return"".concat(O," items")},[Ve,Z]),sn=h.useCallback(O=>{if(!(!X||!k)){je.debug("dropItems",X,"to",O);try{var z=fs(X,k),J=z.files,De=z.targetPath;if(a==null||a(J,De),O!=null){var Me;V([[O,O]]),(Me=G.current)===null||Me===void 0||Me.focusItem(O)}}catch(zt){je.error("Unable to complete move",zt)}}},[X,k,a]),Wr=h.useCallback((O,z)=>{var J=C.items[O-C.offset];J!==void 0&&(je.debug("handleItemClick",J),s(J,z),dt(J)&&(r==null||r.setExpanded(J.filename,!J.isExpanded)))},[C,s,r]),Jn=h.useCallback((O,z)=>{var J,De;je.debug2("handleItemDragStart",O,Z);var Me=Z;lt.isSelected(Z,O)||(Me=[[O,O]],V(Me)),de(M(Me)),(J=G.current)===null||J===void 0||J.resetMouseState();var zt=document.createElement("div"),Kr=document.createElement("div");Kr.className="dnd-placeholder-content",Kr.innerText=(De=Qn())!==null&&De!==void 0?De:"",zt.appendChild(Kr),zt.className="file-list-dnd-placeholder",document.body.appendChild(zt),z.dataTransfer.setDragImage(zt,0,0),z.dataTransfer.effectAllowed="move",Te(zt)},[Qn,M,Z]),ln=h.useCallback((O,z)=>{z.preventDefault(),je.debug2("handleItemDragOver",z),$(Ve(O))},[Ve]),F=h.useCallback((O,z)=>{je.debug("handleItemDragEnd",O),ye==null||ye.remove(),de(void 0),$(void 0),Te(void 0)},[ye]),re=h.useCallback((O,z)=>{sn(O)},[sn]),ie=h.useCallback(()=>{je.debug2("handleItemDragExit"),$(void 0)},[]),er=h.useCallback(O=>{O.target instanceof Element&&O.target.classList.contains(bs)&&(O.preventDefault(),je.debug2("handleListDragOver",O),$({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),tr=h.useCallback(O=>{O.target instanceof Element&&O.target.classList.contains(bs)&&(je.debug("handleListDrop"),sn())},[sn]),un=h.useCallback(function(O){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(je.debug2("handleSelectionChange",O),z===!0||O!==Z){V(O);var J=M(O);u(J)}},[M,u,Z]),Dn=h.useCallback(O=>{if(je.debug2("handleFocusChange",O),O!=null){var z=M([[O,O]]),J=Gt(z,1),De=J[0];o(De)}else o();te.current=O},[M,o]),Dt=h.useCallback((O,z)=>{je.debug("handleViewportChange",O,z),(O!==D.top||z!==D.bottom)&&W({top:O,bottom:z})},[D]),nr=h.useMemo(()=>{if(!X||!k)return!1;try{return fs(X,k),je.debug("handleValidateDropTarget true"),!0}catch{return je.debug("handleValidateDropTarget false"),!1}},[X,k]),bt=n.focusedPath;h.useEffect(()=>{bt!==void 0&&(bt==="/"?r.collapseAll():(r.setExpanded(bt,!1),r.setExpanded(bt,!0)))},[r,bt]),h.useEffect(function(){je.debug("updating table viewport",D),r==null||r.setViewport({top:Math.max(0,D.top-g),bottom:D.bottom+g})},[g,r,D]),h.useEffect(function(){var z=r.onUpdate(J=>{S({items:J.items.map(De=>gr(gr({},De),{},{itemName:De.basename})),offset:J.offset,itemCount:r.size})});return()=>{z()}},[r]),h.useEffect(function(){te.current!=null&&Dn(te.current),Z.length>0&&un(Z,!0)},[C,Dn,un,Z]),h.useEffect(function(){if(k!=null&&dt(k)&&k.filename!=="/"){var z=setTimeout(()=>{k.isExpanded||r==null||r.setExpanded(k.filename,!0)},L0);return()=>clearTimeout(z)}},[k,r]);var rr=h.useCallback(O=>m(gr(gr({},O),{},{isDragInProgress:X!=null,dropTargetItem:k,draggedItems:X,isDropTargetValid:nr,onDragStart:Jn,onDragEnd:F,onDragOver:ln,onDragExit:ie,onDrop:re})),[F,ie,ln,Jn,re,X,k,nr,m]);return d.jsx("div",{ref:Q,className:U("file-list",{"is-dragging":X!=null}),onDragOver:er,onDrop:tr,children:d.jsx(ct,{ref:G,items:C.items,itemCount:C.itemCount,offset:C.offset,onFocusChange:Dn,onSelect:Wr,onSelectionChange:un,onViewportChange:Dt,selectedRanges:Z,renderItem:rr,rowHeight:f,isMultiSelect:t,isDragSelect:!1,isDeselectOnClick:!1})})}var $0={DELETE:oe.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[w.DELETE],macShortcut:[P.CMD,w.BACKSPACE]}),RENAME:oe.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[w.ENTER],macShortcut:[w.ENTER]})};const ys={FILE_EXPLORER:$0};function ti(n,e){return B0(n)||U0(n,e)||H0(n,e)||F0()}function F0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H0(n,e){if(n){if(typeof n=="string")return Cs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cs(n,e):void 0}}function Cs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function U0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function B0(n){if(Array.isArray(n))return n}var Ss=H.module("FileListItemEditor"),W0=()=>Promise.resolve();function K0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?W0:i,a=h.useRef(null),s=h.useState(e.basename),l=ti(s,2),u=l[0],c=l[1],m=h.useState(),p=ti(m,2),f=p[0],v=p[1],g=h.useState(Promise.resolve()),b=ti(g,2),y=b[0],C=b[1],S=h.useCallback(()=>{var I;(I=a.current)===null||I===void 0||I.focus()},[a]),_=h.useCallback(I=>I.stopPropagation(),[]),E=h.useCallback(()=>{y.then(()=>{r(u)}).catch(I=>Ss.info("Unable to validate name",I))},[r,u,y]);h.useEffect(function(){var k=Ye.makeCancelable(o(u));return k.then(()=>v(void 0)).catch($=>{Ye.isCanceled($)||v($)}),C(k),()=>k.cancel()},[o,u]),h.useEffect(function(){S()},[S]);var D=h.useCallback(()=>{Ss.debug2("handleBlur"),E()},[E]),W=h.useCallback(I=>{var k=I.target.value;c(k)},[]),N=h.useCallback(I=>{I.stopPropagation();var k=I.key;switch(k){case"Enter":{E();break}case"Escape":{t();break}}},[t,E]);return d.jsxs("div",{className:"file-list-item-editor",children:[d.jsx("input",{type:"text",className:U("form-control file-list-item-editor-input",{"is-invalid":f}),value:u,ref:a,onBlur:D,onKeyDown:N,onChange:W,onClick:_,onDoubleClick:_,onMouseDown:_}),f&&d.jsx("div",{className:"invalid-feedback",children:"".concat(f)})]})}function ws(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ni(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ws(Object(t),!0).forEach(function(r){z0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ws(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function z0(n,e,t){return(e=V0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function V0(n){var e=G0(n,"string");return typeof e=="symbol"?e:e+""}function G0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ri(n,e){return Y0(n)||Z0(n,e)||X0(n,e)||q0()}function q0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X0(n,e){if(n){if(typeof n=="string")return _s(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_s(n,e):void 0}}function _s(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Z0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Y0(n){if(Array.isArray(n))return n}function Ou(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,c=n.onMove,m=n.onRename,p=n.onSelect,f=n.onSelectionChange,v=n.table,g=n.rowHeight,b=g===void 0?Qi:g,y=n.validateRename,C=y===void 0?()=>Promise.resolve():y,S=h.useState(),_=ri(S,2),E=_[0],D=_[1],W=h.useState([]),N=ri(W,2),I=N[0],k=N[1],$=h.useState(),ae=ri($,2),A=ae[0],X=ae[1],de=h.useCallback(M=>{k(M),f==null||f(M)},[f]),se=h.useCallback(M=>{X(M)},[]),be=h.useCallback(()=>{A&&(l==null||l(A))},[A,l]),ye=h.useCallback(()=>{I.length>0&&(u==null||u(I))},[u,I]),Te=h.useCallback(()=>{a==null||a()},[a]),Se=h.useCallback(()=>{A&&(s==null||s(R.getPath(A.filename)))},[A,s]),ce=h.useCallback(()=>{A&&D(A)},[A]),Z=h.useCallback(()=>{D(void 0)},[]),V=h.useCallback(M=>{E&&(m==null||m(E,M),D(void 0))},[m,E]),te=h.useMemo(()=>{if(E)return[];var M=[];return a&&M.push({title:"New File",description:"Create new file",action:Te,group:ue.groups.medium}),s&&M.push({title:"New Folder",description:"Create new folder",action:Se,group:ue.groups.medium}),l&&M.push({title:"Copy File",description:"Copy the selected file",action:be,group:ue.groups.low,disabled:A==null||dt(A)}),u&&I.length>0&&M.push({title:"Delete",description:"Delete",shortcut:ys.FILE_EXPLORER.DELETE,action:ye,group:ue.groups.low}),m&&M.push({title:"Rename",description:"Rename",shortcut:ys.FILE_EXPLORER.RENAME,action:ce,group:ue.groups.low,disabled:A==null}),M},[be,ye,Te,Se,ce,A,l,a,s,u,m,I,E]),G=h.useCallback(M=>(B(E),C(E,M)),[E,C]),Q=h.useCallback(M=>{var Ve=M.item;return E&&E.filename===Ve.filename?d.jsx(Ti,ni(ni({},M),{},{children:d.jsx(K0,{item:Ve,validate:G,onSubmit:V,onCancel:Z})})):d.jsx(Ti,ni({},M))},[Z,V,E,G]);return d.jsxs("div",{className:"file-list-container",children:[v!=null&&d.jsx(R0,{onMove:c,onSelect:p,onSelectionChange:de,onFocusChange:se,renderItem:Q,rowHeight:b,table:v,isMultiSelect:t,focusedPath:r}),o&&d.jsx(ue,{actions:te})]})}Ou.displayName="FileListContainer";function Es(n,e,t){return(e=Q0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Q0(n){var e=J0(n,"string");return typeof e=="symbol"?e:e+""}function J0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cr extends Ln{constructor(e){super("Name already exists"),Es(this,"isExistingFile",!0),Es(this,"info",void 0),this.info=e}}function Ps(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ts(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ps(o,r,i,a,s,"next",l)}function s(l){Ps(o,r,i,a,s,"throw",l)}a(void 0)})}}function Os(n,e){return rC(n)||nC(n,e)||tC(n,e)||eC()}function eC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tC(n,e){if(n){if(typeof n=="string")return xs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xs(n,e):void 0}}function xs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function nC(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function rC(n){if(Array.isArray(n))return n}var pt=H.module("FileExplorer");function Ji(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,c=u===void 0?()=>{}:u,m=n.onCreateFile,p=m===void 0?()=>{}:m,f=n.onCreateFolder,v=f===void 0?()=>{}:f,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,C=y===void 0?Qi:y,S=h.useState([]),_=Os(S,2),E=_[0],D=_[1],W=h.useState(),N=Os(W,2),I=N[0],k=N[1];h.useEffect(function(){var te;function G(){return Q.apply(this,arguments)}function Q(){return Q=Ts(function*(){pt.debug("initTable"),te=Ye.makeCancelable(e.getTable(),M=>M.close());try{k(yield te)}catch(M){Ye.isCanceled(M)||pt.error("Unable to initialize table",M)}}),Q.apply(this,arguments)}return G(),()=>{te.cancel()}},[e]);var $=h.useCallback(V=>{Ye.isCanceled(V)||pt.error(V)},[]),ae=h.useCallback(()=>{pt.debug("handleCreateFile"),p()},[p]),A=h.useCallback(()=>{pt.debug("handleCreateFolder"),v()},[v]),X=h.useCallback(V=>{pt.debug("handleCopyFile",V.filename),a(V)},[a]),de=h.useCallback(V=>{pt.debug("handleDelete, pending confirmation",V),D(V)},[]),se=h.useCallback(()=>{pt.debug("handleDeleteConfirm",E),E.forEach(V=>e.deleteFile(dt(V)?R.makePath(V.filename):V.filename)),l(E),D([])},[E,l,e]),be=h.useCallback(()=>{pt.debug("handleDeleteCancel"),D([])},[]),ye=h.useCallback((V,te)=>{var G=R.reducePaths(V.map(Q=>dt(Q)?R.makePath(Q.filename):Q.filename));G.forEach(Q=>{var M=R.isPath(Q)?"".concat(te).concat(R.getBaseName(Q.substring(0,Q.length-1)),"/"):"".concat(te).concat(R.getBaseName(Q));e.moveFile(Q,M).then(()=>{c(Q,M)}).catch($)})},[$,c,e]),Te=h.useCallback((V,te)=>{var G=V.filename,Q=dt(V);Q&&!G.endsWith("/")&&(G="".concat(G,"/"));var M="".concat(R.getParent(G)).concat(te);Q&&!M.endsWith("/")&&(M="".concat(M,"/")),pt.debug2("handleRename",G,M),e.moveFile(G,M).catch($),c(G,M)},[$,c,e]),Se=h.useCallback(function(){var V=Ts(function*(te,G){if(G!==te.basename){R.validateName(G);var Q="".concat(R.getPath(te.filename)).concat(G);try{var M=yield e.info(Q);throw new Cr(M)}catch(Ve){if(!(Ve instanceof Yi))throw Ve}}});return function(te,G){return V.apply(this,arguments)}}(),[e]),ce=E.length>0,Z=h.useMemo(()=>E.length===1?'Are you sure you want to delete "'.concat(E[0].filename,'"?'):"Are you sure you want to delete the selected files?",[E]);return d.jsxs("div",{className:"file-explorer",children:[I&&d.jsx(Ou,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:A,onCreateFile:ae,onMove:ye,onDelete:de,onRename:Te,onSelect:g,onSelectionChange:b,rowHeight:C,table:I,validateRename:Se}),d.jsx(ci,{isOpen:ce,headerText:Z,bodyText:"You cannot undo this action.",onCancel:be,onConfirm:se,confirmButtonText:"Delete"})]})}Ji.displayName="FileExplorer";function Is(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function iC(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Is(o,r,i,a,s,"next",l)}function s(l){Is(o,r,i,a,s,"throw",l)}a(void 0)})}}function Qt(n,e,t){return(e=oC(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oC(n){var e=aC(n,"string");return typeof e=="symbol"?e:e+""}function aC(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qt=H.module("NewItemModal");class _n extends h.PureComponent{static getValidationMessage(e){return e instanceof Cr&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Ye.isCanceled(e)||qt.error(e)}constructor(e){super(e),Qt(this,"inputRef",j.createRef()),Qt(this,"cancelableValidatePromise",void 0),Qt(this,"cancelableExistingItemPromise",void 0),Qt(this,"pending",new Dr),Qt(this,"pathMap",new Map),Qt(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:R.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:R.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.setState({path:r,value:R.getBaseName(t),validationError:void 0,prevExtension:R.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Ye.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return iC(function*(){R.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new Cr(u)}catch(c){if(!(c instanceof Yi))throw c}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(_n.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(qt.debug("handleSelect",e),e.type==="directory")this.setState({path:R.makePath(e.filename)});else{var t=e.basename,r=R.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof Ln))throw e;qt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;qt.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){qt.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=R.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){qt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;qt.debug("submitModal",r,i);var u=R.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(c=>{var m=this.props.onSubmit;m("".concat(o).concat(i))}).catch(c=>{if(c instanceof Cr&&l!=="directory"&&c.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw c}).catch(c=>{throw Ye.isCanceled(c)&&this.setState({isSubmitting:!1}),c}).catch(this.handleValidationError).catch(_n.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),d.jsxs(j.Fragment,{children:[d.jsx(ne,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?d.jsx(me,{icon:md,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,c=l.path,m=l.showExtensionChangeModal,p=l.showOverwriteModal,f=l.validationError,v=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",C=R.fileExtensionToString(g),S=R.fileExtensionToString(b),_=y?"Create":"Save",E=y?"New folder name":"Save file as";return d.jsxs(d.Fragment,{children:[d.jsxs(As,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[d.jsx(ks,{toggle:i,children:a}),d.jsx(Ns,{children:d.jsx("form",{children:d.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[d.jsxs("div",{className:"flex-grow-0 mb-4",children:[d.jsx("label",{htmlFor:"file-name-input",children:E}),d.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:U("form-control",{"is-invalid":f}),value:v,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),f&&d.jsx("div",{className:"invalid-feedback",children:_n.getValidationMessage(f)})]}),d.jsxs("div",{className:"flex-grow-0",children:[d.jsx("label",{children:"Directory: /"}),this.renderPathButtons(c)]}),d.jsx("div",{className:"flex-grow-1 file-explorer-container",children:d.jsx(Ji,{onSelect:this.handleSelect,storage:t,focusedPath:c})})]})})}),d.jsxs(al,{children:[d.jsx(ne,{kind:"secondary",onClick:i,children:"Cancel"}),d.jsx(ne,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:_})]})]}),d.jsx(ci,{isOpen:p,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),d.jsx(ci,{isOpen:m,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(C,'" to "').concat(S,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(C,'"'),confirmButtonText:'Use "'.concat(S,'"')})]})}}Qt(_n,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function sC(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return d.jsxs("div",{className:"file-explorer-toolbar",children:[d.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[d.jsx(ne,{kind:"ghost",icon:Bs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),d.jsx(ne,{kind:"ghost",icon:pd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&d.jsx("div",{className:"file-explorer-toolbar-search",children:d.jsx(fl,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Ds(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lC(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ds(o,r,i,a,s,"next",l)}function s(l){Ds(o,r,i,a,s,"throw",l)}a(void 0)})}}function xu(n,e,t){return(e=uC(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uC(n){var e=dC(n,"string");return typeof e=="symbol"?e:e+""}function dC(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xt=H.module("FileExplorerPanel"),cC=(n,e)=>{var t=Nm(n),r=Hr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},hC=Wn(cC,null,null,{forwardRef:!0});function mC(n){var e=n;return e!=null&&typeof e.button=="number"}class xn extends j.Component{static handleError(e){Xt.error(e)}static isFocusEvent(e){return mC(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Xt.debug("handleCreateFile",r,i,o),e.emit($e.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Xt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Xt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(xn.handleError)}handleCopyFile(e){var t=this;return lC(function*(){var r=t.props.fileStorage;if(dt(e)){Xt.error("Invalid item in handleCopyItem",e);return}var i=yield R.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit($e.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=R.makePath(e[0].filename):t=R.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Xt.debug("fileSelect",e),e.type!=="directory"){var r=xn.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit($e.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Xt.debug("handleRename",e,t),r.emit($e.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return d.jsxs($r,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[d.jsx(sC,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&d.jsx(Ji,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),d.jsx(_n,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}xu(xn,"COMPONENT","FileExplorerPanel");xu(xn,"TITLE","File Explorer");var qS=hC(xn);function Hn(n,e,t){return(e=pC(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pC(n){var e=fC(n,"string");return typeof e=="symbol"?e:e+""}function fC(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ms=H.module("LogPanel");class Br extends h.PureComponent{constructor(e){super(e),Hn(this,"isBottomVisible",void 0),Hn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;Ms.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){Ms.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return d.jsxs($r,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&d.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&d.jsx(ve,{session:i,ref:o=>{this.logView=o}})]})}}Hn(Br,"defaultProps",{session:null});Hn(Br,"COMPONENT","LogPanel");Hn(Br,"TITLE","Log");var vC=(n,e)=>{var t;return{session:(t=Hr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},XS=Wn(vC,null,null,{forwardRef:!0})(Br);export{sh as $,le as A,Ye as B,ge as C,ll as D,Nd as E,Fe as F,jr as G,ol as H,ct as I,ne as J,w as K,hl as L,P as M,ul as N,ue as O,Mr as P,Ar as Q,lt as R,fe as S,rl as T,bn as U,ci as V,kc as W,fl as X,kr as Y,al as Z,gl as _,OS as a,rv as a$,xi as a0,TC as a1,lm as a2,Ii as a3,OC as a4,cl as a5,bl as a6,dl as a7,Nc as a8,xh as a9,tu as aA,sv as aB,ee as aC,Wi as aD,Ql as aE,su as aF,jv as aG,ru as aH,mr as aI,Jl as aJ,dg as aK,ug as aL,oS as aM,uS as aN,sS as aO,cS as aP,pa as aQ,bS as aR,Ie as aS,yS as aT,ou as aU,eu as aV,xS as aW,TS as aX,ev as aY,nv as aZ,tv as a_,Sr as aa,fm as ab,Et as ac,ze as ad,Tt as ae,K as af,Ze as ag,Sl as ah,Cl as ai,yl as aj,xC as ak,IC as al,DC as am,VC as an,T as ao,nS as ap,CS as aq,wg as ar,lg as as,sg as at,PS as au,Yr as av,lu as aw,wS as ax,mS as ay,pS as az,gv as b,Hy as b$,rS as b0,tS as b1,pv as b2,au as b3,Sv as b4,fS as b5,vS as b6,gS as b7,IS as b8,aS as b9,lp as bA,sp as bB,Dl as bC,fi as bD,dp as bE,xl as bF,Ol as bG,pi as bH,Vn as bI,Jo as bJ,zC as bK,YC as bL,ea as bM,_C as bN,so as bO,Ag as bP,Gi as bQ,MS as bR,Fg as bS,Hg as bT,Ee as bU,$b as bV,L as bW,Ht as bX,pu as bY,Ne as bZ,Or as b_,dS as ba,lS as bb,hS as bc,_S as bd,DS as be,hn as bf,iS as bg,Hv as bh,Ip as bi,GC as bj,Wt as bk,Tl as bl,JC as bm,Pp as bn,qC as bo,XC as bp,ZC as bq,Ep as br,Op as bs,xp as bt,QC as bu,cp as bv,up as bw,Il as bx,ap as by,op as bz,sm as c,ot as c$,Tu as c0,fu as c1,rb as c2,yu as c3,Gg as c4,Pn as c5,vu as c6,Tn as c7,_y as c8,Pr as c9,Bm as cA,Wm as cB,Km as cC,ip as cD,Js as cE,yC as cF,Ys as cG,$r as cH,US as cI,mt as cJ,vt as cK,WC as cL,FS as cM,kC as cN,HS as cO,$S as cP,BS as cQ,Dr as cR,MC as cS,LS as cT,jC as cU,RS as cV,BC as cW,Nm as cX,AC as cY,Hr as cZ,$e as c_,e0 as ca,ve as cb,_i as cc,mu as cd,wn as ce,Mi as cf,R as cg,Yi as ch,GS as ci,Li as cj,Qf as ck,ES as cl,Xm as cm,VS as cn,XS as co,zS as cp,qS as cq,pc as cr,SC as cs,Hm as ct,Fm as cu,RC as cv,NC as cw,LC as cx,$C as cy,Um as cz,HC as d,_n as d0,dt as d1,Rm as d2,ke as d3,kS as d4,jS as d5,KS as d6,WS as d7,l0 as d8,s0 as d9,NS as da,AS as db,PC as dc,gt as dd,wC as de,Vr as df,Bd as dg,Ln as dh,Jf as e,KC as f,Cm as g,FC as h,Pl as i,UC as j,EC as k,wc as l,zn as m,Ac as n,_c as o,tl as p,el as q,oe as r,SS as s,Ec as t,ym as u,Pc as v,il as w,qs as x,CC as y,nl as z};
46
- //# sourceMappingURL=LogPanel-CoRvBQjW.js.map
40
+ `)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ve.bufferTimeout))}stopFlushTimer(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)}updateDimensions(){this.editor&&this.editor.layout()}handleClearClick(){this.clearLogs()}clearLogs(){this.messages=[],this.refreshLogText()}handleFlushTimeout(){this.stopFlushTimer(),this.flush()}handleLogMessage(e){this.messages.push(e),this.editor&&this.isLogItemVisible(e)&&this.queue(e)}handleMenuItemClick(e){this.toggleLogLevel(e)}handleResetClick(){this.resetLogLevels()}handleResize(){this.updateDimensions()}handleToggleAllClick(){this.toggleAll()}render(){var e={placement:"bottom-end"},t=this.state.shownLogLevels,r=this.getMenuActions(t);return d.jsxs("div",{className:"log-pane h-100 w-100",children:[d.jsxs("div",{className:"log-pane-menu",children:[d.jsx(ne,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:ud,tooltip:"Clear log"}),d.jsx(ne,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:dd,tooltip:"Log Settings",onClick:()=>{},children:d.jsx(kr,{actions:r,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),d.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Ze(ve,"DefaultLogLevels",[Pe.STDOUT,Pe.ERROR,Pe.FATAL,Pe.STDERR,Pe.WARN]);Ze(ve,"AllLogLevels",[Pe.INFO,Pe.STDOUT,Pe.ERROR,Pe.FATAL,Pe.STDERR,Pe.WARN,Pe.DEBUG,Pe.TRACE]);Ze(ve,"bufferTimeout",16);Ze(ve,"maxLogSize",131072);Ze(ve,"truncateSize",65536);function ls(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Qy(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ls(o,r,i,a,s,"next",l)}function s(l){ls(o,r,i,a,s,"throw",l)}a(void 0)})}}function us(n,e){return n0(n)||t0(n,e)||e0(n,e)||Jy()}function Jy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e0(n,e){if(n){if(typeof n=="string")return ds(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ds(n,e):void 0}}function ds(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function t0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function n0(n){if(Array.isArray(n))return n}var r0=H.module("HeapUsage");function i0(n){var e,t=n.connection,r=n.defaultUpdateInterval,i=n.hoverUpdateInterval,o=n.bgMonitoring,a=o===void 0?!0:o,s=n.monitorDuration,l=Kg(),u=m.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),c=us(u,2),h=c[0],p=c[1],f=m.useState(!1),v=us(f,2),g=v[0],b=v[1],y=m.useRef({timestamps:[],usages:[]}),S=tl(),C=m.useCallback(Qy(function*(){try{var ce=yield t.getWorkerHeapInfo();if(!S.current)return;if(p(ce),a||g){for(var Z=(ce.totalHeapSize-ce.freeMemory)/ce.maximumHeapSize,V=Date.now(),te=y.current,G=te.timestamps,Q=te.usages;G.length!==0&&V-G[0]>s*1.5;)G.shift(),Q.shift();G.push(V),Q.push(Z)}else y.current={timestamps:[],usages:[]}}catch(M){r0.warn("Unable to get heap usage",M)}}),[t,S,a,g,s]);Ec(C,g?i:r);var _=(ce,Z)=>Math.round(ce*10**Z)/10**Z,w=2,D=1024**3,B=h.freeMemory,N=h.totalHeapSize,x=h.maximumHeapSize,j=_(B/D,w),L=_(N/D,w),re=_(x/D,w),A=L-j,q=function(Z,V){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return d.jsxs("div",{className:U("heap-usage-info-row",{"heading-bottom-border":te}),children:[d.jsx("div",{className:"font-weight-bold",children:Z}),d.jsx("div",{children:V})]})},ie=y.current,oe=ie.timestamps,be=ie.usages,ye=(e=oe[oe.length-1])!==null&&e!==void 0?e:0,Oe=N/x,we=(N-B)/x;return d.jsxs("div",{className:"max-memory",children:[d.jsx("div",{className:"total-memory",style:{width:"calc(".concat(Oe*100,"% - ").concat(Oe*2,"px")}}),d.jsx("div",{className:U("used-memory",{"heap-overflow":(N-B)/x>.95}),style:{width:"calc(".concat(we*100,"% - ").concat(we*2,"px")}}),d.jsxs("div",{className:"memory-text",children:[re.toFixed(1)," GB"]}),d.jsx(ue,{onEntered:()=>b(!0),onExited:()=>b(!1),interactive:!0,children:d.jsxs("div",{className:"heap-tooltip",children:[q("In use:","".concat(A.toFixed(w)," of ").concat(re.toFixed(w)," GB"),!0),q("Free:","".concat(j.toFixed(w)," GB")),q("Total:","".concat(L.toFixed(w)," GB")),q("Max:","".concat(re.toFixed(w)," GB")),d.jsx("div",{className:"heap-plot",children:d.jsx(Wg,{data:[{x:[...oe],y:[...be],type:"scatter",mode:"lines"}],config:{staticPlot:!0,responsive:!0},style:{width:"196px",height:"100px"},layout:{margin:{l:2,t:2,r:2,b:2},plot_bgcolor:"transparent",paper_bgcolor:"transparent",colorway:["#4878ea"],xaxis:{dtick:Math.round(s/6),gridcolor:l.linecolor,range:[ye-s,ye],linecolor:l.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:l.linecolor,range:[0,1],linecolor:l.linecolor,linewidth:2,mirror:!0}}})}),d.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}function Qn(n,e,t){return(e=o0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function o0(n){var e=a0(n,"string");return typeof e=="symbol"?e:e+""}function a0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ot{}Qn(ot,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");Qn(ot,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");Qn(ot,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");Qn(ot,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");Qn(ot,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function zt(n,e,t){return(e=s0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function s0(n){var e=l0(n,"string");return typeof e=="symbol"?e:e+""}function l0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vt{}zt(vt,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");zt(vt,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");zt(vt,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");zt(vt,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");zt(vt,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");zt(vt,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");zt(vt,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");zt(vt,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function Dt(n,e,t){return(e=u0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function u0(n){var e=d0(n,"string");return typeof e=="symbol"?e:e+""}function d0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{}Dt(Fe,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");Dt(Fe,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");Dt(Fe,"CLOSE_FILE","NotebookEvent.closeFile");Dt(Fe,"RENAME","NotebookEvent.rename");Dt(Fe,"RENAME_FILE","NotebookEvent.renameFile");Dt(Fe,"REGISTER_FILE","NotebookEvent.registerFile");Dt(Fe,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");Dt(Fe,"UNREGISTER_FILE","NotebookEvent.unregisterFile");Dt(Fe,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");var Zi=mt(ot.SESSION_OPENED),c0=Zi.listen,LC=Zi.emit,RC=Zi.useListener,Yi=mt(ot.SESSION_CLOSED),h0=Yi.listen,$C=Yi.emit,FC=Yi.useListener,m0=["children"];function cs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cs(Object(t),!0).forEach(function(r){Ti(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function p0(n,e){if(n==null)return{};var t,r,i=f0(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function f0(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ti(n,e,t){return(e=v0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function v0(n){var e=g0(n,"string");return typeof e=="symbol"?e:e+""}function g0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class b0 extends m.PureComponent{constructor(e){super(e),Ti(this,"stopListenForSessionClosed",void 0),Ti(this,"stopListenForSessionOpened",void 0),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this)}componentDidMount(){var e=this.props.glEventHub;this.stopListenForSessionClosed=h0(e,this.handleSessionClosed),this.stopListenForSessionOpened=c0(e,this.handleSessionOpened),e.on(vt.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}componentWillUnmount(){var e,t,r=this.props.glEventHub;(e=this.stopListenForSessionClosed)===null||e===void 0||e.call(this),(t=this.stopListenForSessionOpened)===null||t===void 0||t.call(this),r.off(vt.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}handleClearAllFilters(){for(var e=this.props.onClearAllFilters,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleSessionClosed(e){var t=this.props.onSessionClose;t==null||t(e)}handleSessionOpened(e){var t=this.props.onSessionOpen;t==null||t(e)}render(){var e=this.props,t=e.children,r=p0(e,m0);return d.jsx(Tg,hs(hs({},r),{},{children:t}))}}var Hr=yl(b0),y0=Object.freeze({}),S0=new Map,Ur=Object.freeze([]),HC=(n,e)=>{var t;return(t=De(n,e).columns)!==null&&t!==void 0?t:Ur},UC=(n,e)=>{var t;return(t=De(n,e).filterSets)!==null&&t!==void 0?t:Ur},BC=(n,e)=>{var t;return(t=De(n,e).filters)!==null&&t!==void 0?t:Ur},WC=(n,e)=>{var t;return(t=De(n,e).tableMap)!==null&&t!==void 0?t:S0},KC=(n,e)=>De(n,e).isolatedLinkerPanelId,zC=(n,e)=>{var t;return(t=De(n,e).links)!==null&&t!==void 0?t:Ur},VC=(n,e)=>De(n,e).columnSelectionValidator,GC=(n,e)=>{var t;return(t=De(n,e).consoleSettings)!==null&&t!==void 0?t:y0},qC=(n,e)=>De(n,e).connection,Br=(n,e)=>De(n,e).sessionWrapper;function Dr(n,e,t){return(e=C0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function C0(n){var e=_0(n,"string");return typeof e=="symbol"?e:e+""}function _0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var gr=H.module("CommandHistoryPanel");class Jn extends m.Component{static handleError(e){gr.error(e)}constructor(e){super(e),Dr(this,"container",void 0),Dr(this,"pending",void 0),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSendToConsole=this.handleSendToConsole.bind(this),this.handleSendToNotebook=this.handleSendToNotebook.bind(this),this.container=k.createRef(),this.pending=new jr;var t=e.session,r=e.sessionId,i=e.language;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:En.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var e=this.props,t=e.glEventHub,r=e.session;t.on(ot.FOCUS_HISTORY,this.handleFocusHistory),r!=null&&this.loadTable()}componentWillUnmount(){var e=this.props.glEventHub;e.off(ot.FOCUS_HISTORY,this.handleFocusHistory),this.pending.cancel()}handleFocusHistory(){this.container.current&&this.container.current.focus()}handleShow(){var e;(e=this.container.current)===null||e===void 0||e.restoreScrollPosition()}handleSessionOpened(e){var t=e.session,r=e.language,i=e.sessionId;this.setState({session:t,sessionId:i,language:r},()=>{this.loadTable()})}handleSessionClosed(){this.pending.cancel(),this.setState({session:void 0,language:void 0,table:void 0})}handleSendToNotebook(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.state,i=r.session,o=r.language;if(gr.debug("handleSendToNotebook",i,e),!i){gr.error("Session is not connected.");return}var a=this.props.glEventHub;a.emit(t?Fe.CREATE_NOTEBOOK:Fe.SEND_TO_NOTEBOOK,i,o,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;gr.debug("handleSendToConsole",e);var i=this.props.glEventHub;i.emit(ot.SEND_COMMAND,e,t,r)}loadTable(){var e=this.props.commandHistoryStorage,t=this.state,r=t.language,i=t.sessionId;W(r),W(i),this.pending.add(e.getTable(r,i,Date.now()),o=>o.close()).then(o=>{this.setState({table:o})}).catch(Jn.handleError)}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=e.commandHistoryStorage,o=this.state,a=o.language,s=o.contextActions,l=o.table;return d.jsxs(Hr,{className:"command-history-pane",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!l&&d.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),l&&a!=null&&d.jsxs(d.Fragment,{children:[d.jsx(Le,{ref:this.container,language:a,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:l,commandHistoryStorage:i}),d.jsx(de,{actions:s})]})]})}}Dr(Jn,"COMPONENT","CommandHistoryPanel");Dr(Jn,"TITLE","Command History");var w0=(n,e)=>{var t=El(n),r=Br(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a??{},l=s.type,u=s.id;return{commandHistoryStorage:t,language:l,session:o,sessionId:u}},XC=Vn(w0,null,null,{forwardRef:!0})(Jn);function ms(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ms(Object(t),!0).forEach(function(r){rn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ms(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rn(n,e,t){return(e=E0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function E0(n){var e=P0(n,"string");return typeof e=="symbol"?e:e+""}function P0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fn=H.module("ConsolePanel"),T0=500,O0=Object.freeze({consoleSettings:{},itemIds:[]});class Wr extends m.PureComponent{constructor(e){super(e),rn(this,"consoleRef",void 0),rn(this,"objectSubscriptionCleanup",void 0),rn(this,"savePanelState",zn(()=>{var a=this.state,s=a.consoleSettings,l=a.itemIds,u={consoleSettings:s,itemIds:[...l]};fn.debug("Saving panel state",u),this.setState({panelState:u})},T0)),this.handleFocusCommandHistory=this.handleFocusCommandHistory.bind(this),this.handleOpenObject=this.handleOpenObject.bind(this),this.handleCloseObject=this.handleCloseObject.bind(this),this.handleResize=this.handleResize.bind(this),this.handleSettingsChange=this.handleSettingsChange.bind(this),this.handleShow=this.handleShow.bind(this),this.handlePanelMount=this.handlePanelMount.bind(this),this.supportsType=this.supportsType.bind(this),this.iconForType=this.iconForType.bind(this),this.consoleRef=k.createRef();var t=e.panelState,r=br(br({},O0),t||{}),i=r.consoleSettings,o=r.itemIds;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var e=this.props.glEventHub;this.closeDisconnectedPanels(),e.on(ee.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var r=this.state,i=r.consoleSettings,o=r.itemIds;(t.consoleSettings!==i||t.itemIds!==o)&&this.savePanelState()}componentWillUnmount(){var e,t=this.props.glEventHub;this.savePanelState.flush(),t.off(ee.MOUNT,this.handlePanelMount),(e=this.objectSubscriptionCleanup)===null||e===void 0||e.call(this)}subscribeToFieldUpdates(){var e=this.props.sessionWrapper;if(e!=null){var t=e.session;this.objectSubscriptionCleanup=t.subscribeToFieldUpdates(r=>{fn.debug("Got updates",r),this.setState(i=>{var o=i.objectMap,a=r.updated,s=r.created,l=r.removed,u=[...a,...l],c=new Map(o);u.forEach(p=>{var f=p.title;f!==void 0&&c.delete(f)});var h=[...a,...s];return h.forEach(p=>{p.title!==void 0&&c.set(p.title,p)}),{objectMap:c}})})}}setItemId(e,t){this.setState(r=>{var i=r.itemIds,o=new Map(i);return o.set(e,t),{itemIds:o}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.state.itemIds,i=r.get(e);return i==null&&t&&(i=Pt(),this.setItemId(e,i)),i}deleteItemId(e){this.setState(t=>{var r=t.itemIds;fn.debug("Delete item",e,r);var i=[...r.keys()].find(a=>r.get(a)===e);if(i===void 0)return null;var o=new Map(r);return o.delete(i),{itemIds:o}})}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,i=this.state.itemIds,o=e==null||(t=e.props)===null||t===void 0?void 0:t.id,a=e==null||(r=e.props)===null||r===void 0||(r=r.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(o&&a){var s=new Set(i.values());s.has(a)&&this.setItemId(o,o)}}handlePanelClosed(e){var t=this.props.glContainer,r=T.getRootFromContainer(t),i=T.getStackForConfig(r,{id:e});i!==null&&T.getContentItemInStack(i,{id:e})!==null||this.deleteItemId(e)}handleFocusCommandHistory(){var e=this.props.glEventHub;e.emit(ot.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;W(this.context);var r=this.context.root,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&T.getStackForRoot(r,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var t=e.title;if(t!==void 0){var r=this.getItemId(t,!1);if(r!=null){var i=this.props.glEventHub;fa(i,r),pg(i,t)}}}handleSettingsChange(e){var t=this.props.glEventHub;fn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(ot.SETTINGS_CHANGED,e)}openWidget(e){var t=this.props,r=t.glEventHub,i=t.plugins,o=e.type,a=Dp(i,o);if(a!=null){var s=a.createDashboardPayload(e);fn.debug("openDashboardWidget",s),mg(r,s)}else this.openPanelWidget(e)}openPanelWidget(e){var t=this.props,r=t.glEventHub,i=t.sessionWrapper;W(i);var o=i.config,a=i.session,s=e.title,l=s===void 0?e.name:s;W(l);var u=this.getItemId(l);W(u);var c={fetch:()=>a.getObject(e),panelId:u,widget:br(br({},_m(e)),{},{sessionId:o.id})};fn.debug("openPanelWidget",c),rv(r,c)}addCommand(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,r,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.state,r=t.consoleSettings,i=t.itemIds,o=r.isClosePanelsOnDisconnectEnabled,a=o===void 0?!0:o;if(!(!a&&!e)){var s=[...i.values()],l=this.props.glEventHub;s.forEach(u=>{fa(l,u)}),this.setState({itemIds:new Map})}}updateDimensions(){var e;(e=this.consoleRef.current)===null||e===void 0||e.updateDimensions()}supportsType(e){var t=this.props.plugins;return[...t.values()].some(r=>ea(r,e))}iconForType(e){var t=this.props.plugins,r=[...t.values()].find(i=>ea(i,e));return r!=null?Tp(r):d.jsx(fu,{type:e})}render(){var e=this.props,t=e.commandHistoryStorage,r=e.glContainer,i=e.glEventHub,o=e.sessionWrapper,a=e.timeZone,s=e.unzip;if(o==null)return d.jsx(Kn,{isLoading:!1,errorMessage:"Console is disabled.","data-testid":"console-panel-loading-error"});var l=this.state,u=l.consoleSettings,c=l.error,h=l.objectMap,p=o.config,f=o.session,v=o.connection,g=o.details,b=g===void 0?{}:g,y=o.dh,S=b.workerName,C=b.processInfoId,_=p.id,w=p.type;return d.jsx(Hr,{className:"iris-panel-console",componentPanel:this,glContainer:r,glEventHub:i,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:c!=null?"".concat(c):void 0,children:f!=null&&d.jsx(Ut,{dh:y,ref:this.consoleRef,settings:u,session:f,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:t,onSettingsChange:this.handleSettingsChange,language:w,statusBarChildren:d.jsxs(d.Fragment,{children:[d.jsx("div",{children:gu.LANGUAGE_MAP.get(w)}),S!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),S]}),C!=null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"•"}),C,d.jsx("div",{children:"•"})]}),d.jsx(i0,{connection:v,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),showObjectsMenu:!1,scope:_,timeZone:a,objectMap:h,unzip:s,supportsType:this.supportsType,iconForType:this.iconForType})})}}rn(Wr,"COMPONENT","ConsolePanel");rn(Wr,"TITLE","Console");rn(Wr,"contextType",ru);var I0=(n,e)=>({commandHistoryStorage:El(n),sessionWrapper:Br(n,e.localDashboardId),timeZone:Fm(n),plugins:Hm(n)}),ZC=Vn(I0,null,null,{forwardRef:!0})(Wr);function YC(n){return n==="file"||n==="directory"}function dt(n){return n.type==="directory"}function x0(n,e,t){return(e=D0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function D0(n){var e=M0(n,"string");return typeof e=="symbol"?e:e+""}function M0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qi extends Error{constructor(){super("No file exists at the path specified"),x0(this,"isFileNotFound",!0)}}function ps(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function fs(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ps(o,r,i,a,s,"next",l)}function s(l){ps(o,r,i,a,s,"throw",l)}a(void 0)})}}var Qt=function(n){return n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN="",n}({});class ${static fileExists(e,t){return fs(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof Qi))throw r;return!1}})()}static fileExtensionToString(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e.length===0?"":".".concat(e)}static getDepth(e){var t;if(!$.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var r=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return r.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var r;return(r=t.pop())!==null&&r!==void 0?r:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),r=null,i=null;t<0?i=e:(i=e.substring(0,t),r=e.substring(t+1));var o=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(o,".").concat(r):o}static getUniqueCopyFileName(e,t){return fs(function*(){for(var r=$.getCopyFileName(t);yield $.fileExists(e,r);)r=$.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return Qt.GROOVY;case"py":return Qt.PYTHON;case"pyc":return Qt.PYTHON_COMPILED;case"scala":return Qt.SCALA;case"txt":return Qt.PLAIN_TEXT;default:return Qt.UNKNOWN}}static getParent(e){if(!$.hasPath(e))throw new Error("Invalid name provided: ".concat(e));for(var t=e.split("/");t.pop()==="";);if(t.length===0)throw new Error("No parent for path provided: ".concat(e));return"".concat(t.join("/"),"/")}static getPath(e){if(!$.hasPath(e))throw new Error("Invalid filename provided: ".concat(e));var t=e.split("/");return t.pop(),"".concat(t.join("/"),"/")}static hasPath(e){return e.startsWith("/")}static isPath(e){return e.startsWith("/")&&e.endsWith("/")}static makePath(e){return e.endsWith("/")?e:"".concat(e,"/")}static replaceExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=e.lastIndexOf("."),i=r>-1?e.substring(0,r):e,o=$.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new Hn("Name cannot be empty");if(t.includes(e))throw new Hn('"'.concat(e,'" is a reserved name'));if(r.test(e)){var o,a;throw new Hn('Invalid characters in name: "'.concat((o=(a=e.match(r))===null||a===void 0?void 0:a.reduce((s,l)=>s.includes(l)?s:[...s,l],[]).map(s=>i.has(s)?i.get(s):s).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(r=>$.isPath(r));return e.filter(r=>!t.some(i=>r!==i&&r.startsWith(i)))}static removeRoot(e,t){if(e.length===0)return t;if(!t.startsWith(e))throw new Error("Filename ".concat(t," does not start with expected root ").concat(e));return t.substring(e.length)}static addRoot(e,t){return"".concat(e).concat(t)}}var Ji=26;function Oi(n){return dt(n)?$.makePath(n.filename):$.getPath(n.filename)}function vs(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=Oi(e);if(n.some(r=>{var i=r.filename;return $.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>dt(r)&&t.startsWith($.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function j0(n){if(dt(n))return n.isExpanded?cd:hd;var e=$.getMimeType(n.basename);switch(e){case Qt.PYTHON:return pd;default:return md}}function Ii(n){var e,t=n.children,r=n.draggedItems,i=n.isDragInProgress,o=n.isDropTargetValid,a=n.isSelected,s=n.item,l=n.itemIndex,u=n.dropTargetItem,c=n.onDragStart,h=n.onDragOver,p=n.onDragEnd,f=n.onDragExit,v=n.onDrop,g=(e=r==null?void 0:r.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,b=Oi(s),y=i&&u?Oi(u):null,S=i&&o&&dt(s)&&y===b,C=i&&o&&y===b,_=i&&!o&&y===b,w=j0(s),D=$.getDepth(s.filename),B=Array(D).fill(null).map((N,x)=>d.jsx("span",{className:"file-list-depth-line"},x));return d.jsxs("div",{className:U("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":S,"is-in-drop-target":C,"is-invalid-drop-target":_,"is-selected":a}),onDragStart:N=>c(l,N),onDragOver:N=>h(l,N),onDragEnd:N=>p(l,N),onDragExit:f,onDrop:N=>v(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[B," ",d.jsx(me,{icon:w,className:"item-icon",fixedWidth:!0})," ",d.jsx("span",{className:"truncation-wrapper",children:t??d.jsxs(d.Fragment,{children:[s.basename,d.jsx(ue,{children:s.basename})]})})]})}function gs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gs(Object(t),!0).forEach(function(r){A0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function A0(n,e,t){return(e=k0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function k0(n){var e=N0(n,"string");return typeof e=="symbol"?e:e+""}function N0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qt(n,e){return F0(n)||$0(n,e)||R0(n,e)||L0()}function L0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R0(n,e){if(n){if(typeof n=="string")return bs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bs(n,e):void 0}}function bs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function $0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function F0(n){if(Array.isArray(n))return n}var Ae=H.module("FileList"),H0=500,ys="item-list-scroll-pane";function U0(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.table,i=n.onFocusChange,o=i===void 0?()=>{}:i,a=n.onMove,s=n.onSelect,l=n.onSelectionChange,u=l===void 0?()=>{}:l,c=n.renderItem,h=c===void 0?Ii:c,p=n.rowHeight,f=p===void 0?Ji:p,v=n.overscanCount,g=v===void 0?ct.DEFAULT_OVERSCAN:v,b=m.useState(()=>({items:[],offset:0,itemCount:0})),y=qt(b,2),S=y[0],C=y[1],_=m.useState({top:0,bottom:0}),w=qt(_,2),D=w[0],B=w[1],N=m.useState(),x=qt(N,2),j=x[0],L=x[1],re=m.useState(),A=qt(re,2),q=A[0],ie=A[1],oe=m.useState(),be=qt(oe,2),ye=be[0],Oe=be[1],we=m.useState([]),ce=qt(we,2),Z=ce[0],V=ce[1],te=m.useRef(),G=m.useRef(null),Q=m.useRef(null),M=m.useCallback(I=>{if(I.length===0||S==null)return[];for(var z=[],J=0;J<I.length;J+=1)for(var Me=I[J],je=Me[0];je<=Me[1];je+=1)je>=S.offset&&je<S.offset+S.items.length&&z.push(S.items[je-S.offset]);return z},[S]),Ge=m.useCallback(I=>{var z=M([[I,I]]);if(z.length>0)return z[0]},[M]),er=m.useCallback(()=>{var I=lt.count(Z);if(I===0)return null;if(I===1){var z=Z[0][0],J=Ge(z);if(J!=null)return J.filename}return"".concat(I," items")},[Ge,Z]),ln=m.useCallback(I=>{if(!(!q||!j)){Ae.debug("dropItems",q,"to",I);try{var z=vs(q,j),J=z.files,Me=z.targetPath;if(a==null||a(J,Me),I!=null){var je;V([[I,I]]),(je=G.current)===null||je===void 0||je.focusItem(I)}}catch(Vt){Ae.error("Unable to complete move",Vt)}}},[q,j,a]),zr=m.useCallback((I,z)=>{var J=S.items[I-S.offset];J!==void 0&&(Ae.debug("handleItemClick",J),s(J,z),dt(J)&&(r==null||r.setExpanded(J.filename,!J.isExpanded)))},[S,s,r]),tr=m.useCallback((I,z)=>{var J,Me;Ae.debug2("handleItemDragStart",I,Z);var je=Z;lt.isSelected(Z,I)||(je=[[I,I]],V(je)),ie(M(je)),(J=G.current)===null||J===void 0||J.resetMouseState();var Vt=document.createElement("div"),Vr=document.createElement("div");Vr.className="dnd-placeholder-content",Vr.innerText=(Me=er())!==null&&Me!==void 0?Me:"",Vt.appendChild(Vr),Vt.className="file-list-dnd-placeholder",document.body.appendChild(Vt),z.dataTransfer.setDragImage(Vt,0,0),z.dataTransfer.effectAllowed="move",Oe(Vt)},[er,M,Z]),un=m.useCallback((I,z)=>{z.preventDefault(),Ae.debug2("handleItemDragOver",z),L(Ge(I))},[Ge]),F=m.useCallback((I,z)=>{Ae.debug("handleItemDragEnd",I),ye==null||ye.remove(),ie(void 0),L(void 0),Oe(void 0)},[ye]),ae=m.useCallback((I,z)=>{ln(I)},[ln]),se=m.useCallback(()=>{Ae.debug2("handleItemDragExit"),L(void 0)},[]),nr=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(ys)&&(I.preventDefault(),Ae.debug2("handleListDragOver",I),L({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),rr=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(ys)&&(Ae.debug("handleListDrop"),ln())},[ln]),dn=m.useCallback(function(I){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ae.debug2("handleSelectionChange",I),z===!0||I!==Z){V(I);var J=M(I);u(J)}},[M,u,Z]),An=m.useCallback(I=>{if(Ae.debug2("handleFocusChange",I),I!=null){var z=M([[I,I]]),J=qt(z,1),Me=J[0];o(Me)}else o();te.current=I},[M,o]),Mt=m.useCallback((I,z)=>{Ae.debug("handleViewportChange",I,z),(I!==D.top||z!==D.bottom)&&B({top:I,bottom:z})},[D]),ir=m.useMemo(()=>{if(!q||!j)return!1;try{return vs(q,j),Ae.debug("handleValidateDropTarget true"),!0}catch{return Ae.debug("handleValidateDropTarget false"),!1}},[q,j]),bt=n.focusedPath;m.useEffect(()=>{bt!==void 0&&(bt==="/"?r.collapseAll():(r.setExpanded(bt,!1),r.setExpanded(bt,!0)))},[r,bt]),m.useEffect(function(){Ae.debug("updating table viewport",D),r==null||r.setViewport({top:Math.max(0,D.top-g),bottom:D.bottom+g})},[g,r,D]),m.useEffect(function(){var z=r.onUpdate(J=>{C({items:J.items.map(Me=>yr(yr({},Me),{},{itemName:Me.basename})),offset:J.offset,itemCount:r.size})});return()=>{z()}},[r]),m.useEffect(function(){te.current!=null&&An(te.current),Z.length>0&&dn(Z,!0)},[S,An,dn,Z]),m.useEffect(function(){if(j!=null&&dt(j)&&j.filename!=="/"){var z=setTimeout(()=>{j.isExpanded||r==null||r.setExpanded(j.filename,!0)},H0);return()=>clearTimeout(z)}},[j,r]);var or=m.useCallback(I=>h(yr(yr({},I),{},{isDragInProgress:q!=null,dropTargetItem:j,draggedItems:q,isDropTargetValid:ir,onDragStart:tr,onDragEnd:F,onDragOver:un,onDragExit:se,onDrop:ae})),[F,se,un,tr,ae,q,j,ir,h]);return d.jsx("div",{ref:Q,className:U("file-list",{"is-dragging":q!=null}),onDragOver:nr,onDrop:rr,children:d.jsx(ct,{ref:G,items:S.items,itemCount:S.itemCount,offset:S.offset,onFocusChange:An,onSelect:zr,onSelectionChange:dn,onViewportChange:Mt,selectedRanges:Z,renderItem:or,rowHeight:f,isMultiSelect:t,isDragSelect:!1,isDeselectOnClick:!1})})}var B0={DELETE:le.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[E.DELETE],macShortcut:[P.CMD,E.BACKSPACE]}),RENAME:le.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[E.ENTER],macShortcut:[E.ENTER]})};const Ss={FILE_EXPLORER:B0};function ri(n,e){return V0(n)||z0(n,e)||K0(n,e)||W0()}function W0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K0(n,e){if(n){if(typeof n=="string")return Cs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cs(n,e):void 0}}function Cs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function z0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function V0(n){if(Array.isArray(n))return n}var _s=H.module("FileListItemEditor"),G0=()=>Promise.resolve();function q0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?G0:i,a=m.useRef(null),s=m.useState(e.basename),l=ri(s,2),u=l[0],c=l[1],h=m.useState(),p=ri(h,2),f=p[0],v=p[1],g=m.useState(Promise.resolve()),b=ri(g,2),y=b[0],S=b[1],C=m.useCallback(()=>{var x;(x=a.current)===null||x===void 0||x.focus()},[a]),_=m.useCallback(x=>x.stopPropagation(),[]),w=m.useCallback(()=>{y.then(()=>{r(u)}).catch(x=>_s.info("Unable to validate name",x))},[r,u,y]);m.useEffect(function(){var j=Qe.makeCancelable(o(u));return j.then(()=>v(void 0)).catch(L=>{Qe.isCanceled(L)||v(L)}),S(j),()=>j.cancel()},[o,u]),m.useEffect(function(){C()},[C]);var D=m.useCallback(()=>{_s.debug2("handleBlur"),w()},[w]),B=m.useCallback(x=>{var j=x.target.value;c(j)},[]),N=m.useCallback(x=>{x.stopPropagation();var j=x.key;switch(j){case"Enter":{w();break}case"Escape":{t();break}}},[t,w]);return d.jsxs("div",{className:"file-list-item-editor",children:[d.jsx("input",{type:"text",className:U("form-control file-list-item-editor-input",{"is-invalid":f}),value:u,ref:a,onBlur:D,onKeyDown:N,onChange:B,onClick:_,onDoubleClick:_,onMouseDown:_}),f&&d.jsx("div",{className:"invalid-feedback",children:"".concat(f)})]})}function ws(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ws(Object(t),!0).forEach(function(r){X0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ws(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function X0(n,e,t){return(e=Z0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Z0(n){var e=Y0(n,"string");return typeof e=="symbol"?e:e+""}function Y0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oi(n,e){return tS(n)||eS(n,e)||J0(n,e)||Q0()}function Q0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J0(n,e){if(n){if(typeof n=="string")return Es(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Es(n,e):void 0}}function Es(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function tS(n){if(Array.isArray(n))return n}function xu(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,c=n.onMove,h=n.onRename,p=n.onSelect,f=n.onSelectionChange,v=n.table,g=n.rowHeight,b=g===void 0?Ji:g,y=n.validateRename,S=y===void 0?()=>Promise.resolve():y,C=m.useState(),_=oi(C,2),w=_[0],D=_[1],B=m.useState([]),N=oi(B,2),x=N[0],j=N[1],L=m.useState(),re=oi(L,2),A=re[0],q=re[1],ie=m.useCallback(M=>{j(M),f==null||f(M)},[f]),oe=m.useCallback(M=>{q(M)},[]),be=m.useCallback(()=>{A&&(l==null||l(A))},[A,l]),ye=m.useCallback(()=>{x.length>0&&(u==null||u(x))},[u,x]),Oe=m.useCallback(()=>{a==null||a()},[a]),we=m.useCallback(()=>{A&&(s==null||s($.getPath(A.filename)))},[A,s]),ce=m.useCallback(()=>{A&&D(A)},[A]),Z=m.useCallback(()=>{D(void 0)},[]),V=m.useCallback(M=>{w&&(h==null||h(w,M),D(void 0))},[h,w]),te=m.useMemo(()=>{if(w)return[];var M=[];return a&&M.push({title:"New File",description:"Create new file",action:Oe,group:de.groups.medium}),s&&M.push({title:"New Folder",description:"Create new folder",action:we,group:de.groups.medium}),l&&M.push({title:"Copy File",description:"Copy the selected file",action:be,group:de.groups.low,disabled:A==null||dt(A)}),u&&x.length>0&&M.push({title:"Delete",description:"Delete",shortcut:Ss.FILE_EXPLORER.DELETE,action:ye,group:de.groups.low}),h&&M.push({title:"Rename",description:"Rename",shortcut:Ss.FILE_EXPLORER.RENAME,action:ce,group:de.groups.low,disabled:A==null}),M},[be,ye,Oe,we,ce,A,l,a,s,u,h,x,w]),G=m.useCallback(M=>(W(w),S(w,M)),[w,S]),Q=m.useCallback(M=>{var Ge=M.item;return w&&w.filename===Ge.filename?d.jsx(Ii,ii(ii({},M),{},{children:d.jsx(q0,{item:Ge,validate:G,onSubmit:V,onCancel:Z})})):d.jsx(Ii,ii({},M))},[Z,V,w,G]);return d.jsxs("div",{className:"file-list-container",children:[v!=null&&d.jsx(U0,{onMove:c,onSelect:p,onSelectionChange:ie,onFocusChange:oe,renderItem:Q,rowHeight:b,table:v,isMultiSelect:t,focusedPath:r}),o&&d.jsx(de,{actions:te})]})}xu.displayName="FileListContainer";function Ps(n,e,t){return(e=nS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nS(n){var e=rS(n,"string");return typeof e=="symbol"?e:e+""}function rS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _r extends Hn{constructor(e){super("Name already exists"),Ps(this,"isExistingFile",!0),Ps(this,"info",void 0),this.info=e}}function Ts(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Os(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ts(o,r,i,a,s,"next",l)}function s(l){Ts(o,r,i,a,s,"throw",l)}a(void 0)})}}function Is(n,e){return sS(n)||aS(n,e)||oS(n,e)||iS()}function iS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oS(n,e){if(n){if(typeof n=="string")return xs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xs(n,e):void 0}}function xs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sS(n){if(Array.isArray(n))return n}var pt=H.module("FileExplorer");function eo(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,c=u===void 0?()=>{}:u,h=n.onCreateFile,p=h===void 0?()=>{}:h,f=n.onCreateFolder,v=f===void 0?()=>{}:f,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ji:y,C=m.useState([]),_=Is(C,2),w=_[0],D=_[1],B=m.useState(),N=Is(B,2),x=N[0],j=N[1];m.useEffect(function(){var te;function G(){return Q.apply(this,arguments)}function Q(){return Q=Os(function*(){pt.debug("initTable"),te=Qe.makeCancelable(e.getTable(),M=>M.close());try{j(yield te)}catch(M){Qe.isCanceled(M)||pt.error("Unable to initialize table",M)}}),Q.apply(this,arguments)}return G(),()=>{te.cancel()}},[e]);var L=m.useCallback(V=>{Qe.isCanceled(V)||pt.error(V)},[]),re=m.useCallback(()=>{pt.debug("handleCreateFile"),p()},[p]),A=m.useCallback(()=>{pt.debug("handleCreateFolder"),v()},[v]),q=m.useCallback(V=>{pt.debug("handleCopyFile",V.filename),a(V)},[a]),ie=m.useCallback(V=>{pt.debug("handleDelete, pending confirmation",V),D(V)},[]),oe=m.useCallback(()=>{pt.debug("handleDeleteConfirm",w),w.forEach(V=>e.deleteFile(dt(V)?$.makePath(V.filename):V.filename)),l(w),D([])},[w,l,e]),be=m.useCallback(()=>{pt.debug("handleDeleteCancel"),D([])},[]),ye=m.useCallback((V,te)=>{var G=$.reducePaths(V.map(Q=>dt(Q)?$.makePath(Q.filename):Q.filename));G.forEach(Q=>{var M=$.isPath(Q)?"".concat(te).concat($.getBaseName(Q.substring(0,Q.length-1)),"/"):"".concat(te).concat($.getBaseName(Q));e.moveFile(Q,M).then(()=>{c(Q,M)}).catch(L)})},[L,c,e]),Oe=m.useCallback((V,te)=>{var G=V.filename,Q=dt(V);Q&&!G.endsWith("/")&&(G="".concat(G,"/"));var M="".concat($.getParent(G)).concat(te);Q&&!M.endsWith("/")&&(M="".concat(M,"/")),pt.debug2("handleRename",G,M),e.moveFile(G,M).catch(L),c(G,M)},[L,c,e]),we=m.useCallback(function(){var V=Os(function*(te,G){if(G!==te.basename){$.validateName(G);var Q="".concat($.getPath(te.filename)).concat(G);try{var M=yield e.info(Q);throw new _r(M)}catch(Ge){if(!(Ge instanceof Qi))throw Ge}}});return function(te,G){return V.apply(this,arguments)}}(),[e]),ce=w.length>0,Z=m.useMemo(()=>w.length===1?'Are you sure you want to delete "'.concat(w[0].filename,'"?'):"Are you sure you want to delete the selected files?",[w]);return d.jsxs("div",{className:"file-explorer",children:[x&&d.jsx(xu,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:q,onCreateFolder:A,onCreateFile:re,onMove:ye,onDelete:ie,onRename:Oe,onSelect:g,onSelectionChange:b,rowHeight:S,table:x,validateRename:we}),d.jsx(mi,{isOpen:ce,headerText:Z,bodyText:"You cannot undo this action.",onCancel:be,onConfirm:oe,confirmButtonText:"Delete"})]})}eo.displayName="FileExplorer";function Ds(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ds(o,r,i,a,s,"next",l)}function s(l){Ds(o,r,i,a,s,"throw",l)}a(void 0)})}}function Jt(n,e,t){return(e=uS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uS(n){var e=dS(n,"string");return typeof e=="symbol"?e:e+""}function dS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xt=H.module("NewItemModal");class Pn extends m.PureComponent{static getValidationMessage(e){return e instanceof _r&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Qe.isCanceled(e)||Xt.error(e)}constructor(e){super(e),Jt(this,"inputRef",k.createRef()),Jt(this,"cancelableValidatePromise",void 0),Jt(this,"cancelableExistingItemPromise",void 0),Jt(this,"pending",new jr),Jt(this,"pathMap",new Map),Jt(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:$.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:$.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.setState({path:r,value:$.getBaseName(t),validationError:void 0,prevExtension:$.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Qe.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lS(function*(){$.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new _r(u)}catch(c){if(!(c instanceof Qi))throw c}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Pn.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(Xt.debug("handleSelect",e),e.type==="directory")this.setState({path:$.makePath(e.filename)});else{var t=e.basename,r=$.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof Hn))throw e;Xt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;Xt.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){Xt.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=$.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){Xt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;Xt.debug("submitModal",r,i);var u=$.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(c=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(c=>{if(c instanceof _r&&l!=="directory"&&c.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw c}).catch(c=>{throw Qe.isCanceled(c)&&this.setState({isSubmitting:!1}),c}).catch(this.handleValidationError).catch(Pn.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),d.jsxs(k.Fragment,{children:[d.jsx(ne,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?d.jsx(me,{icon:fd,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,c=l.path,h=l.showExtensionChangeModal,p=l.showOverwriteModal,f=l.validationError,v=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=$.fileExtensionToString(g),C=$.fileExtensionToString(b),_=y?"Create":"Save",w=y?"New folder name":"Save file as";return d.jsxs(d.Fragment,{children:[d.jsxs(ks,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[d.jsx(Ns,{toggle:i,children:a}),d.jsx(Ls,{children:d.jsx("form",{children:d.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[d.jsxs("div",{className:"flex-grow-0 mb-4",children:[d.jsx("label",{htmlFor:"file-name-input",children:w}),d.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:U("form-control",{"is-invalid":f}),value:v,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),f&&d.jsx("div",{className:"invalid-feedback",children:Pn.getValidationMessage(f)})]}),d.jsxs("div",{className:"flex-grow-0",children:[d.jsx("label",{children:"Directory: /"}),this.renderPathButtons(c)]}),d.jsx("div",{className:"flex-grow-1 file-explorer-container",children:d.jsx(eo,{onSelect:this.handleSelect,storage:t,focusedPath:c})})]})})}),d.jsxs(sl,{children:[d.jsx(ne,{kind:"secondary",onClick:i,children:"Cancel"}),d.jsx(ne,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:_})]})]}),d.jsx(mi,{isOpen:p,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),d.jsx(mi,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(C,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(C,'"')})]})}}Jt(Pn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cS(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return d.jsxs("div",{className:"file-explorer-toolbar",children:[d.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[d.jsx(ne,{kind:"ghost",icon:Ws,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),d.jsx(ne,{kind:"ghost",icon:vd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&d.jsx("div",{className:"file-explorer-toolbar-search",children:d.jsx(vl,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Ms(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ms(o,r,i,a,s,"next",l)}function s(l){Ms(o,r,i,a,s,"throw",l)}a(void 0)})}}function Du(n,e,t){return(e=mS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mS(n){var e=pS(n,"string");return typeof e=="symbol"?e:e+""}function pS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zt=H.module("FileExplorerPanel"),fS=(n,e)=>{var t=Rm(n),r=Br(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},vS=Vn(fS,null,null,{forwardRef:!0});function gS(n){var e=n;return e!=null&&typeof e.button=="number"}class Dn extends k.Component{static handleError(e){Zt.error(e)}static isFocusEvent(e){return gS(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Zt.debug("handleCreateFile",r,i,o),e.emit(Fe.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Zt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Zt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(Dn.handleError)}handleCopyFile(e){var t=this;return hS(function*(){var r=t.props.fileStorage;if(dt(e)){Zt.error("Invalid item in handleCopyItem",e);return}var i=yield $.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(Fe.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=$.makePath(e[0].filename):t=$.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Zt.debug("fileSelect",e),e.type!=="directory"){var r=Dn.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(Fe.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Zt.debug("handleRename",e,t),r.emit(Fe.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return d.jsxs(Hr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[d.jsx(cS,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&d.jsx(eo,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),d.jsx(Pn,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Du(Dn,"COMPONENT","FileExplorerPanel");Du(Dn,"TITLE","File Explorer");var QC=vS(Dn);function Wn(n,e,t){return(e=bS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bS(n){var e=yS(n,"string");return typeof e=="symbol"?e:e+""}function yS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var js=H.module("LogPanel");class Kr extends m.PureComponent{constructor(e){super(e),Wn(this,"isBottomVisible",void 0),Wn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;js.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){js.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return d.jsxs(Hr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&d.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&d.jsx(ve,{session:i,ref:o=>{this.logView=o}})]})}}Wn(Kr,"defaultProps",{session:null});Wn(Kr,"COMPONENT","LogPanel");Wn(Kr,"TITLE","Log");var SS=(n,e)=>{var t;return{session:(t=Br(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},JC=Vn(SS,null,null,{forwardRef:!0})(Kr);export{uh as $,ue as A,Qe as B,ge as C,ul as D,Rd as E,He as F,kr as G,al as H,ct as I,ne as J,E as K,ml as L,P as M,dl as N,de as O,Ar as P,Nr as Q,lt as R,fe as S,il as T,yn as U,mi as V,Lc as W,vl as X,Lr as Y,sl as Z,bl as _,MC as a,sv as a$,Di as a0,DS as a1,dm as a2,Mi as a3,MS as a4,hl as a5,yl as a6,cl as a7,Rc as a8,Dh as a9,ru as aA,cv as aB,ee as aC,Ki as aD,eu as aE,uu as aF,Lv as aG,ou as aH,fr as aI,tu as aJ,pg as aK,mg as aL,uC as aM,mC as aN,cC as aO,fC as aP,fa as aQ,_C as aR,De as aS,wC as aT,su as aU,nu as aV,jC as aW,DC as aX,iv as aY,av as aZ,ov as a_,wr as aa,gm as ab,Et as ac,Ve as ad,Tt as ae,K as af,Ye as ag,_l as ah,Cl as ai,Sl as aj,jS as ak,AS as al,kS as am,ZS as an,T as ao,aC as ap,EC as aq,Tg as ar,hg as as,cg as at,xC as au,Jr as av,du as aw,TC as ax,gC as ay,bC as az,Cv as b,Ky as b$,sC as b0,oC as b1,bv as b2,lu as b3,Pv as b4,yC as b5,SC as b6,CC as b7,AC as b8,dC as b9,dp as bA,up as bB,Ml as bC,gi as bD,hp as bE,xl as bF,Il as bG,vi as bH,Xn as bI,ea as bJ,XS as bK,tC as bL,ta as bM,OS as bN,lo as bO,Rg as bP,qi as bQ,NC as bR,Wg as bS,Kg as bT,Te as bU,Bb as bV,R as bW,Ut as bX,vu as bY,Le as bZ,xr as b_,pC as ba,hC as bb,vC as bc,OC as bd,kC as be,mn as bf,lC as bg,Kv as bh,Mp as bi,YS as bj,Kt as bk,Ol as bl,rC as bm,Op as bn,QS as bo,JS as bp,eC as bq,Tp as br,xp as bs,Dp as bt,nC as bu,mp as bv,cp as bw,Dl as bx,lp as by,sp as bz,um as c,ot as c$,Iu as c0,gu as c1,sb as c2,Cu as c3,Yg as c4,On as c5,bu as c6,In as c7,Oy as c8,Or as c9,Km as cA,zm as cB,Vm as cC,ap as cD,el as cE,wS as cF,Qs as cG,Hr as cH,zC as cI,mt as cJ,vt as cK,GS as cL,WC as cM,$S as cN,KC as cO,BC as cP,VC as cQ,jr as cR,NS as cS,HC as cT,LS as cU,UC as cV,VS as cW,Rm as cX,RS as cY,Br as cZ,Fe as c_,i0 as ca,ve as cb,Pi as cc,fu as cd,En as ce,Ai as cf,$ as cg,Qi as ch,YC as ci,Ri as cj,nv as ck,IC as cl,Ym as cm,ZC as cn,JC as co,XC as cp,QC as cq,vc as cr,PS as cs,Bm as ct,Um as cu,US as cv,FS as cw,HS as cx,BS as cy,Wm as cz,KS as d,Pn as d0,dt as d1,Fm as d2,Ne as d3,$C as d4,LC as d5,qC as d6,GC as d7,h0 as d8,c0 as d9,FC as da,RC as db,xS as dc,gt as dd,TS as de,qr as df,Kd as dg,Hn as dh,rv as e,qS as f,_m as g,WS as h,Tl as i,zS as j,IS as k,Ec as l,qn as m,Nc as n,Pc as o,nl as p,tl as q,le as r,PC as s,Tc as t,Cm as u,Oc as v,ol as w,Xs as x,ES as y,rl as z};
46
+ //# sourceMappingURL=LogPanel-DzqyvYDR.js.map