@deephaven/code-studio 0.98.0 → 0.98.1-beta.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.
- package/build/assets/AppRoot-BVCW8A5r.js +6 -0
- package/build/assets/AppRoot-BVCW8A5r.js.map +1 -0
- package/build/assets/{AppRoot-DerJTNRY.css → AppRoot-if4cKBY8.css} +1 -1
- package/build/assets/{Chart-DxBN0Rii.js → Chart-D8vy_nKx.js} +2 -2
- package/build/assets/{Chart-DxBN0Rii.js.map → Chart-D8vy_nKx.js.map} +1 -1
- package/build/assets/{ControlType-1eV6e0bA.js → ControlType-3TFAM3W5.js} +4 -4
- package/build/assets/{ControlType-1eV6e0bA.js.map → ControlType-3TFAM3W5.js.map} +1 -1
- package/build/assets/{FontBootstrap-wwzmdg_p.js → FontBootstrap-EpHJKqX8.js} +2 -2
- package/build/assets/{FontBootstrap-wwzmdg_p.js.map → FontBootstrap-EpHJKqX8.js.map} +1 -1
- package/build/assets/{FormatterUtils-CBUZkkvP.js → FormatterUtils-BFzBSTaZ.js} +2 -2
- package/build/assets/{FormatterUtils-CBUZkkvP.js.map → FormatterUtils-BFzBSTaZ.js.map} +1 -1
- package/build/assets/{Grid-DB8QOLXC.js → Grid-UMIFqKM9.js} +2 -2
- package/build/assets/{Grid-DB8QOLXC.js.map → Grid-UMIFqKM9.js.map} +1 -1
- package/build/assets/{IrisGrid-BmWTNiFk.js → IrisGrid-C4myDMjE.js} +2 -2
- package/build/assets/{IrisGrid-BmWTNiFk.js.map → IrisGrid-C4myDMjE.js.map} +1 -1
- package/build/assets/{IrisGridModel-Bz7ABVKv.js → IrisGridModel-5QDt-EGN.js} +3 -3
- package/build/assets/{IrisGridModel-Bz7ABVKv.js.map → IrisGridModel-5QDt-EGN.js.map} +1 -1
- package/build/assets/{IrisGridShortcuts-DaIjESjk.js → IrisGridShortcuts-3wX-cLRW.js} +2 -2
- package/build/assets/{IrisGridShortcuts-DaIjESjk.js.map → IrisGridShortcuts-3wX-cLRW.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-LXDaQmb8.js → IrisGridThemeProvider-BxCg7hwL.js} +4 -4
- package/build/assets/{IrisGridThemeProvider-LXDaQmb8.js.map → IrisGridThemeProvider-BxCg7hwL.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-Cn8aBSm9.js → LocalWorkspaceStorage-CW0O-gZu.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-Cn8aBSm9.js.map → LocalWorkspaceStorage-CW0O-gZu.js.map} +1 -1
- package/build/assets/{MarkdownEditor-x6V7C5Gc.js → MarkdownEditor-DG9SOVOG.js} +2 -2
- package/build/assets/{MarkdownEditor-x6V7C5Gc.js.map → MarkdownEditor-DG9SOVOG.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-B7cwYvGp.js → MarkdownNotebook-By3GLPII.js} +2 -2
- package/build/assets/{MarkdownNotebook-B7cwYvGp.js.map → MarkdownNotebook-By3GLPII.js.map} +1 -1
- package/build/assets/{MissingPartitionError-wEhliZiu.js → MissingPartitionError-CUxe35wy.js} +2 -2
- package/build/assets/{MissingPartitionError-wEhliZiu.js.map → MissingPartitionError-CUxe35wy.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-hYMuFiP4.js → StyleGuideRoot-DH6A_So8.js} +4 -4
- package/build/assets/{StyleGuideRoot-hYMuFiP4.js.map → StyleGuideRoot-DH6A_So8.js.map} +1 -1
- package/build/assets/{TokenBoxCellRenderer-DAg2WI9p.js → TokenBoxCellRenderer-CudY08Kg.js} +2 -2
- package/build/assets/{TokenBoxCellRenderer-DAg2WI9p.js.map → TokenBoxCellRenderer-CudY08Kg.js.map} +1 -1
- package/build/assets/index-1GYQSvIf.js +2 -0
- package/build/assets/{index-DePCdphx.js.map → index-1GYQSvIf.js.map} +1 -1
- package/build/assets/{index-CEcRhMlc.js → index-CNZCQQTF.js} +3 -3
- package/build/assets/{index-CEcRhMlc.js.map → index-CNZCQQTF.js.map} +1 -1
- package/build/assets/{index-DD5_AC_r.js → index-JxET7y3f.js} +6 -6
- package/build/assets/{index-DD5_AC_r.js.map → index-JxET7y3f.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +31 -31
- package/build/assets/AppRoot-BWBuXpUc.js +0 -6
- package/build/assets/AppRoot-BWBuXpUc.js.map +0 -1
- package/build/assets/index-DePCdphx.js +0 -2
package/build/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="manifest" href="./manifest.json" />
|
|
13
13
|
<link rel="icon" href="./favicon-cc-app.svg" />
|
|
14
14
|
<title>Deephaven</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-CNZCQQTF.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/monaco-BVlTSxnv.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/helpers-BosuxZz1.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-B48G5X41.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/code-studio",
|
|
3
|
-
"version": "0.98.0",
|
|
3
|
+
"version": "0.98.1-beta.0+a273b072",
|
|
4
4
|
"description": "Deephaven Code Studio",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@adobe/react-spectrum": "3.35.1",
|
|
15
|
-
"@deephaven/app-utils": "^0.98.0",
|
|
16
|
-
"@deephaven/auth-plugins": "^0.98.0",
|
|
17
|
-
"@deephaven/chart": "^0.98.0",
|
|
18
|
-
"@deephaven/components": "^0.98.0",
|
|
19
|
-
"@deephaven/console": "^0.98.0",
|
|
20
|
-
"@deephaven/dashboard": "^0.98.0",
|
|
21
|
-
"@deephaven/dashboard-core-plugins": "^0.98.0",
|
|
22
|
-
"@deephaven/file-explorer": "^0.98.0",
|
|
23
|
-
"@deephaven/filters": "^0.98.0",
|
|
24
|
-
"@deephaven/golden-layout": "^0.98.0",
|
|
25
|
-
"@deephaven/grid": "^0.98.0",
|
|
26
|
-
"@deephaven/icons": "^0.98.0",
|
|
27
|
-
"@deephaven/iris-grid": "^0.98.0",
|
|
28
|
-
"@deephaven/jsapi-bootstrap": "^0.98.0",
|
|
29
|
-
"@deephaven/jsapi-components": "^0.98.0",
|
|
30
|
-
"@deephaven/jsapi-shim": "^0.98.0",
|
|
15
|
+
"@deephaven/app-utils": "^0.98.1-beta.0+a273b072",
|
|
16
|
+
"@deephaven/auth-plugins": "^0.98.1-beta.0+a273b072",
|
|
17
|
+
"@deephaven/chart": "^0.98.1-beta.0+a273b072",
|
|
18
|
+
"@deephaven/components": "^0.98.1-beta.0+a273b072",
|
|
19
|
+
"@deephaven/console": "^0.98.1-beta.0+a273b072",
|
|
20
|
+
"@deephaven/dashboard": "^0.98.1-beta.0+a273b072",
|
|
21
|
+
"@deephaven/dashboard-core-plugins": "^0.98.1-beta.0+a273b072",
|
|
22
|
+
"@deephaven/file-explorer": "^0.98.1-beta.0+a273b072",
|
|
23
|
+
"@deephaven/filters": "^0.98.1-beta.0+a273b072",
|
|
24
|
+
"@deephaven/golden-layout": "^0.98.1-beta.0+a273b072",
|
|
25
|
+
"@deephaven/grid": "^0.98.1-beta.0+a273b072",
|
|
26
|
+
"@deephaven/icons": "^0.98.1-beta.0+a273b072",
|
|
27
|
+
"@deephaven/iris-grid": "^0.98.1-beta.0+a273b072",
|
|
28
|
+
"@deephaven/jsapi-bootstrap": "^0.98.1-beta.0+a273b072",
|
|
29
|
+
"@deephaven/jsapi-components": "^0.98.1-beta.0+a273b072",
|
|
30
|
+
"@deephaven/jsapi-shim": "^0.98.1-beta.0+a273b072",
|
|
31
31
|
"@deephaven/jsapi-types": "^1.0.0-dev0.34.0",
|
|
32
|
-
"@deephaven/jsapi-utils": "^0.98.0",
|
|
33
|
-
"@deephaven/log": "^0.98.0",
|
|
34
|
-
"@deephaven/plugin": "^0.98.0",
|
|
35
|
-
"@deephaven/pouch-storage": "^0.98.0",
|
|
36
|
-
"@deephaven/react-hooks": "^0.98.0",
|
|
37
|
-
"@deephaven/redux": "^0.98.0",
|
|
38
|
-
"@deephaven/storage": "^0.98.0",
|
|
39
|
-
"@deephaven/utils": "^0.98.0",
|
|
32
|
+
"@deephaven/jsapi-utils": "^0.98.1-beta.0+a273b072",
|
|
33
|
+
"@deephaven/log": "^0.98.1-beta.0+a273b072",
|
|
34
|
+
"@deephaven/plugin": "^0.98.1-beta.0+a273b072",
|
|
35
|
+
"@deephaven/pouch-storage": "^0.98.1-beta.0+a273b072",
|
|
36
|
+
"@deephaven/react-hooks": "^0.98.1-beta.0+a273b072",
|
|
37
|
+
"@deephaven/redux": "^0.98.1-beta.0+a273b072",
|
|
38
|
+
"@deephaven/storage": "^0.98.1-beta.0+a273b072",
|
|
39
|
+
"@deephaven/utils": "^0.98.1-beta.0+a273b072",
|
|
40
40
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
41
41
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
42
42
|
"bowser": "^2.11.0",
|
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
"update-licenses": "npm-license > licenses.txt"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@deephaven/eslint-config": "^0.98.0",
|
|
78
|
-
"@deephaven/mocks": "^0.98.0",
|
|
79
|
-
"@deephaven/prettier-config": "^0.98.0",
|
|
80
|
-
"@deephaven/stylelint-config": "^0.98.0",
|
|
81
|
-
"@deephaven/test-utils": "^0.98.0",
|
|
77
|
+
"@deephaven/eslint-config": "^0.98.1-beta.0+a273b072",
|
|
78
|
+
"@deephaven/mocks": "^0.98.1-beta.0+a273b072",
|
|
79
|
+
"@deephaven/prettier-config": "^0.98.1-beta.0+a273b072",
|
|
80
|
+
"@deephaven/stylelint-config": "^0.98.1-beta.0+a273b072",
|
|
81
|
+
"@deephaven/test-utils": "^0.98.1-beta.0+a273b072",
|
|
82
82
|
"autoprefixer": "^10.4.8"
|
|
83
83
|
},
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "a273b07228cbb82793e6762cbd9c65560bcd773c"
|
|
88
88
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./StyleGuideRoot-hYMuFiP4.js","./vendor-B48G5X41.js","./helpers-BosuxZz1.js","./vendor-Ck7TznCw.css","./index-CEcRhMlc.js","./monaco-BVlTSxnv.js","./monaco-DaByH3fU.css","./index-CGGlEYhX.css","./IrisGridModel-Bz7ABVKv.js","./ControlType-1eV6e0bA.js","./ControlType-PE7EOqgJ.css","./IrisGridModel-DDgEpNBk.css","./FontBootstrap-wwzmdg_p.js","./TokenBoxCellRenderer-DAg2WI9p.js","./IrisGridShortcuts-DaIjESjk.js","./IrisGridShortcuts-B4ulgs9Z.css","./useMergeRef-2uVbAipJ.js","./TokenBoxCellRenderer-CnOjKPv1.css","./LocalWorkspaceStorage-Cn8aBSm9.js","./LocalWorkspaceStorage-DcJvxNHp.css","./FontBootstrap-HppzMMw0.css","./Grid-DB8QOLXC.js","./Grid-DzvebgTk.css","./StyleGuideRoot-Q5SNMm10.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Ut=Object.defineProperty;var Kt=(a,s,e)=>s in a?Ut(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e;var v=(a,s,e)=>Kt(a,typeof s!="symbol"?s+"":s,e);import{X as rt,Y as it,Z as $t,_ as Wt,r as m,J as n,a0 as pe,a1 as lt,V as X,a2 as De,M as I,a3 as N,N as E,a4 as Gt,a5 as ge,a6 as le,a7 as ct,a8 as dt,a9 as be,aa as Bt,ab as Vt,ac as Ht,I as Yt,ad as Zt,ae as qt,af as zt,ag as Jt,ah as ve,ai as Xt}from"./vendor-B48G5X41.js";import{_ as Qt,W as es,a as ts}from"./monaco-BVlTSxnv.js";import{O as ce,P as Y,T as P,D as ss,I as _,a as M,b as V,u as ut,F as ns,c as R,d as as,e as ae,S as de,B as T,C as H,g as os,f as ht,h as mt,i as pt,j as gt,k as ft,l as rs,m as is,n as ls,o as cs,p as bt,q as ds,r as A,s as Oe,t as vt,K as us,v as Ae,w as hs,x as ms,y as ps,z as ue,A as gs,E as fs,G as bs,H as vs,J as Ss,L as oe,M as Se,R as _e,N as Z,Q as ys,U as W,V as he,W as xs,X as Cs,Y as Ts,Z as St,_ as yt,$ as ws,a0 as Ds,a1 as js,a2 as Es,a3 as Ns,a4 as Fs,a5 as Rs,a6 as Is,a7 as Me,a8 as Os,a9 as xt,aa as Ls,ab as ks,ac as Ps,ad as j,ae as As,af as re,ag as _s,ah as Ms,ai as Us,aj as Ks,ak as $s,al as Ws,am as Gs,an as Bs,ao as Vs,ap as Hs,aq as Ys,ar as Zs,as as qs,at as zs,au as Js,av as Xs,aw as Qs,ax as en,ay as tn,az as sn,aA as nn,aB as an,aC as on,aD as rn,aE as ln}from"./ControlType-1eV6e0bA.js";import{L as G,v as q,a as cn,M as dn,b as un,c as hn,d as mn,e as me,f as pn,g as gn,h as fn,s as bn,l as vn,i as Sn,j as yn,k as xn,m as Cn,n as Tn,o as wn,p as Dn,q as jn,r as En,t as Nn,u as Fn,w as Rn,x as In,y as On,z as Ln,A as kn,B as Pn,C as An,D as Ue,E as Ke,F as $e,G as _n,H as Mn,I as Un,J as Kn,K as $n,N as Ct}from"./index-CEcRhMlc.js";import{C as Wn,H as Tt,T as Gn,P as Bn,R as Vn,B as Hn,m as Yn,a as Zn,L as wt,U as ye,N as qn,A as zn,g as Jn,b as Xn,u as Qn,c as ea,d as ta,e as sa,f as na,l as aa,G as oa,h as ra,i as We}from"./LocalWorkspaceStorage-Cn8aBSm9.js";import{T as ee,I as Dt,S as ia,D as la}from"./IrisGridShortcuts-DaIjESjk.js";import"./helpers-BosuxZz1.js";import"./useMergeRef-2uVbAipJ.js";function Ge(a,s,e,t,o,r,i){try{var l=a[r](i),c=l.value}catch(d){e(d);return}l.done?s(c):Promise.resolve(c).then(t,o)}function ca(a){return function(){var s=this,e=arguments;return new Promise(function(t,o){var r=a.apply(s,e);function i(c){Ge(r,t,o,i,l,"next",c)}function l(c){Ge(r,t,o,i,l,"throw",c)}i(void 0)})}}var da=[["api"],["client"],["dashboardData","default","connection"],["dashboardData","default","sessionWrapper","dh"],["layoutStorage"],["storage"]];function jt(a){var s=new Map;return function(t,o){var r,i=[...(r=s.get(this))!==null&&r!==void 0?r:[],t];o===Object(o)&&s.set(o,[...i]),i.shift();for(var l=function(u){if(i.length===a[u].length&&i.every((p,C)=>p===a[u][C]))return{v:void 0}},c=0;c<a.length;c+=1){var d=l(c);if(typeof d=="object")return d.v}return o instanceof Map?Array.from(o.entries()):o}}function Et(a,s){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"root",t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map([[a,"root"]]),o={};return Object.entries(a).forEach(r=>{var[i,l]=r;try{JSON.stringify(l,jt(s)),o[i]=l}catch{var c=l;if(typeof l=="bigint")o[i]=l.toString();else if(t.has(c))o[i]="Circular ref to ".concat(t.get(c));else{var d="".concat(e,".").concat(i);t.set(c,d),o[i]=Et(l,s,d,t)}}}),o}function ua(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return JSON.stringify(Et(a,s),jt(s),2)}function ha(a){return JSON.stringify(a,null,2)}function ma(a){var s=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),t=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),r=String(a.getMinutes()).padStart(2,"0"),i=String(a.getSeconds()).padStart(2,"0");return"".concat(s,"-").concat(e,"-").concat(t,"-").concat(o).concat(r).concat(i)}function pa(a,s,e){return je.apply(this,arguments)}function je(){return je=ca(function*(a,s,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:da,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"".concat(ma(new Date),"_support_logs"),r=new rt,i=r.folder(o);i.file("console.txt",a.getFormattedHistory()),s!=null&&i.file("metadata.json",ha(s)),e!=null&&i.file("redux.json",ua(e,t));var l=yield r.generateAsync({type:"blob"}),c=document.createElement("a");c.href=URL.createObjectURL(l),c.download="".concat(o,".zip"),c.click()}),je.apply(this,arguments)}class Be{static makeSortConfig(s,e){return{column:s,direction:e}}static makeFilterConfig(s){var e=[],t=[];return s.forEach((o,r)=>{e.push(o),r>0&&t.push(ce.and)}),{filterItems:e,filterOperators:t}}static combineFilterConfigs(s,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce.and;return{filterItems:[...s.filterItems,...e.filterItems],filterOperators:[...s.filterOperators,t,...e.filterOperators]}}static makeFilterItem(s,e,t){return{columnName:s,type:e,value:t}}}function ga(a,s,e){if(a.length>s){var t=a.length-e;return{toKeep:a.slice(t),toPrune:a.slice(0,t)}}return{toKeep:a,toPrune:[]}}function Ve(a,s){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);s&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),e.push.apply(e,t)}return e}function He(a){for(var s=1;s<arguments.length;s++){var e=arguments[s]!=null?arguments[s]:{};s%2?Ve(Object(e),!0).forEach(function(t){O(a,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):Ve(Object(e)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))})}return a}function Ye(a,s,e,t,o,r,i){try{var l=a[r](i),c=l.value}catch(d){e(d);return}l.done?s(c):Promise.resolve(c).then(t,o)}function U(a){return function(){var s=this,e=arguments;return new Promise(function(t,o){var r=a.apply(s,e);function i(c){Ye(r,t,o,i,l,"next",c)}function l(c){Ye(r,t,o,i,l,"throw",c)}i(void 0)})}}function O(a,s,e){return s=fa(s),s in a?Object.defineProperty(a,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[s]=e,a}function fa(a){var s=ba(a,"string");return typeof s=="symbol"?s:String(s)}function ba(a,s){if(typeof a!="object"||a===null)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var t=e.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}var xe=G.module("PouchStorageTable"),va="Deephaven.";it.plugin($t);function Sa(a,s){switch(a){case P.in:case P.contains:return{$regex:new RegExp("".concat(s)).toString()};case P.inIgnoreCase:return{$regex:new RegExp("".concat(s),"i").toString()};case P.eq:return{$eq:s};case P.notEq:return{$ne:s};case P.greaterThan:return{$gt:s};case P.greaterThanOrEqualTo:return{$gte:s};case P.lessThan:return{$lt:s};case P.lessThanOrEqualTo:return{$lte:s};case P.startsWith:return{$regex:new RegExp("^".concat(s,".*")).toString()};default:throw new Error("Unsupported type: ".concat(a))}}function ya(a){for(var{filterItems:s,filterOperators:e}=a,t=null,o=0;o<s.length;o+=1){var r=s[o],{columnName:i,type:l,value:c}=r,d={[i]:Sa(l,c)};if(o===0)t=d;else if(t!==null&&o-1<e.length){var h=e[o-1];if(h===ce.and)t={$and:[t,d]};else if(h===ce.or)t={$or:[t,d]};else throw new Error("Unexpected filter operator ".concat(h,", ").concat(d))}}if(t==null)throw new Error("Invalid filter config ".concat(a));return t}function Ce(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{$and:[...a.map(s=>ya(s)),{name:{$gt:null}},{id:{$gt:null}}]}}function xa(a){var s,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return[{id:e?"desc":"asc"},...(s=a==null?void 0:a.map(t=>({[t.column]:t.direction})))!==null&&s!==void 0?s:[]]}class Ca{constructor(s,e){O(this,"db",void 0),O(this,"changes",void 0),O(this,"listeners",[]),O(this,"itemListeners",new Map),O(this,"currentSize",0),O(this,"currentViewport",void 0),O(this,"currentReverse",!1),O(this,"currentFilter",null),O(this,"currentSort",null),O(this,"infoUpdatePromise",void 0),O(this,"viewportUpdatePromise",void 0),O(this,"currentViewportData",void 0),this.db=new it("".concat(va).concat(s),e),this.db._remote=!1,this.listenForChanges(),this.db.createIndex({index:{fields:["id","name"]}}),this.refreshInfo()}listenForChanges(){this.changes=this.db.changes({live:!0,since:"now",include_docs:!0}).on("change",this.dbUpdate.bind(this))}onUpdate(s){return this.listeners=[...this.listeners,s],()=>{this.listeners=this.listeners.filter(e=>e!==s)}}onItemUpdate(s,e){return this.itemListeners.has(s)||this.itemListeners.set(s,[]),this.itemListeners.set(s,[...this.itemListeners.get(s),e]),this.refreshItem(s),()=>{this.itemListeners.set(s,this.itemListeners.get(s).filter(t=>t!==e))}}close(){this.listeners=[]}get size(){return this.currentSize}get viewport(){return this.currentViewport}setReversed(s){this.currentReverse=s,this.currentViewportData=void 0,this.refreshData()}setViewport(s){this.currentViewport=s,this.refreshInfo(),this.refreshData()}setSorts(s){this.currentSort=s,this.currentViewportData=void 0,this.refreshData()}setFilters(s){this.currentFilter=s,this.currentViewportData=void 0,this.refreshInfo(),this.refreshData()}get data(){return this.currentViewportData}getViewportData(){var s=this;return U(function*(){var e;return s.viewportUpdatePromise||s.refreshData(),(e=s.viewportUpdatePromise)!==null&&e!==void 0?e:Promise.resolve({items:[],offset:0})})()}put(s){var e=this;return U(function*(){var t=He(He({},s),{},{_id:s.id});return yield e.db.put(t),t})()}sendUpdate(){for(var s,{listeners:e}=this,t=(s=this.currentViewportData)!==null&&s!==void 0?s:{items:[],offset:0},o=0;o<e.length;o+=1)e[o](t)}sendItemUpdate(s){var e=this.itemListeners.get(s.id);if(e!==void 0)for(var t=0;t<e.length;t+=1)e[t](s)}dbUpdate(s){xe.debug("Update received",s),this.refreshInfo(),s.doc!==void 0&&this.sendItemUpdate(s.doc),this.refreshData()}fetchInfo(s){var e=this;return U(function*(){return e.db.find({selector:s,fields:[]})})()}refreshInfo(){var s=this;return U(function*(){try{var e,t;(e=s.infoUpdatePromise)===null||e===void 0||e.cancel(),s.infoUpdatePromise=Y.makeCancelable(s.fetchInfo(Ce((t=s.currentFilter)!==null&&t!==void 0?t:[])));var o=yield s.infoUpdatePromise;s.currentSize=o.docs.length,s.sendUpdate()}catch(r){if(!Y.isCanceled(r))throw xe.error("Unable to refreshInfo",r),r}})()}fetchViewportData(s,e,t){var o=this;return U(function*(){return o.db.find({selector:e,skip:s.top,limit:s.bottom-s.top+1,sort:t,fields:["id","name"]}).then(r=>({items:r.docs,offset:s.top}))})()}refreshData(){var s=this;return U(function*(){if(s.currentViewport)try{var e,t,o=Ce((e=s.currentFilter)!==null&&e!==void 0?e:[]),r=xa(s.currentSort,s.currentReverse);(t=s.viewportUpdatePromise)===null||t===void 0||t.cancel(),s.viewportUpdatePromise=Y.makeCancelable(s.fetchViewportData(s.currentViewport,o,r));var i=yield s.viewportUpdatePromise;return s.currentViewportData=i,s.sendUpdate(),i}catch(l){if(!Y.isCanceled(l))throw xe.error("Unable to refreshData",l),l}})()}refreshItem(s){var e=this;return U(function*(){var t=yield e.db.find({selector:{id:s},limit:1}),o=t.docs[0];return o!==void 0&&e.sendItemUpdate(o),o})()}getSnapshot(s){var e=this;return U(function*(){var t=new Map,o=[{id:e.currentReverse?"desc":"asc"}];return yield Promise.all(s.map(function(){var r=U(function*(i){var l,[c,d]=i,h=d-c+1;return e.db.find({selector:Ce((l=e.currentFilter)!==null&&l!==void 0?l:[]),skip:c,limit:h,sort:o,fields:["id","name"]}).then(u=>{for(var p=0;p<h;p+=1){var C=c+p;t.set(C,u.docs[p])}})});return function(i){return r.apply(this,arguments)}}())),t})()}}function Ze(a,s){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);s&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),e.push.apply(e,t)}return e}function ie(a){for(var s=1;s<arguments.length;s++){var e=arguments[s]!=null?arguments[s]:{};s%2?Ze(Object(e),!0).forEach(function(t){Nt(a,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):Ze(Object(e)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))})}return a}function qe(a,s,e,t,o,r,i){try{var l=a[r](i),c=l.value}catch(d){e(d);return}l.done?s(c):Promise.resolve(c).then(t,o)}function Q(a){return function(){var s=this,e=arguments;return new Promise(function(t,o){var r=a.apply(s,e);function i(c){qe(r,t,o,i,l,"next",c)}function l(c){qe(r,t,o,i,l,"throw",c)}i(void 0)})}}function Nt(a,s,e){return s=Ta(s),s in a?Object.defineProperty(a,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[s]=e,a}function Ta(a){var s=wa(a,"string");return typeof s=="symbol"?s:String(s)}function wa(a,s){if(typeof a!="object"||a===null)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var t=e.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}var Da=2500,ja=2e3,L=G.module("PouchCommandHistoryTable");class ze extends Ca{constructor(s,e){var t;super("CommandHistoryStorage.".concat(s),{auto_compaction:!0,revs_limit:1}),Nt(this,"searchText",void 0),this.cache=e,this.cache.tableRegistry.has(this.cacheKey)||this.cache.tableRegistry.set(this.cacheKey,new Set),L.debug("Adding table to registry",this.cacheKey),(t=this.cache.tableRegistry.get(this.cacheKey))===null||t===void 0||t.add(this)}get cacheKey(){return this.db.name}setSearch(s){L.debug("Setting search filters",s),this.searchText=s.trim().toLowerCase(),this.setFilters(s?[Be.makeFilterConfig([Be.makeFilterItem("name",P.contains,s)])]:[])}dbUpdate(s){L.debug("Clearing cache and refreshing data",s),this.cache.response.delete(this.cacheKey),super.dbUpdate(s)}fetchData(s){var e=this;return Q(function*(){return Y.withTimeout(0,Q(function*(){e.cache.response.has(e.cacheKey)?L.debug("Fetching from cache",e.searchText,e.viewport):(L.debug("Fetching from PouchDB",e.searchText,e.viewport),e.cache.response.set(e.cacheKey,e.db.allDocs({include_docs:!0}).then(o=>{var r=o.rows.map(c=>c.doc).filter(c=>{var{name:d}=c;return d});L.debug("Fetched ".concat(r.length," command history items"));var{toKeep:i,toPrune:l}=ga(r,Da,ja);return l.length&&e.pruneItems(l),{docs:i}})));var t=e.cache.response.get(e.cacheKey);return e.searchText==null||e.searchText===""?t:ie(ie({},t),{},{docs:(yield t).docs.filter(o=>{var{name:r}=o;return r.toLowerCase().includes(e.searchText)})})}))})()}fetchInfo(s){var e=this;return Q(function*(){return e.fetchData(s)})()}fetchViewportData(s,e,t){var o=this;return Q(function*(){var r=yield o.fetchData(e);L.debug("Fetching viewport data",s.top,s.bottom+1,t,r);var i=typeof t[0]=="object"&&t[0].id==="desc",l=i?r.docs.slice(0).reverse():r.docs,c=l.slice(s.top,s.bottom+1);return{items:c,offset:s.top}})()}pruneItems(s){var e=this;return Q(function*(){if(e.cache.isPruning.get(e.cacheKey)===!0){L.debug("Pruning already in progress. Skipping.");return}try{L.debug("Pruning ".concat(s.length," command history items"));var t=e.cache.pauseChangeListeners(e.cacheKey);e.cache.isPruning.set(e.cacheKey,!0),yield e.db.bulkDocs(s.map(o=>ie(ie({},o),{},{_deleted:!0}))),e.cache.isPruning.set(e.cacheKey,!1),t(),L.debug("Finished pruning command history items")}catch(o){L.error("An error occurred while pruning db",o)}})()}close(){var s,e,t;L.debug("Closing table",this,(s=this.cache.tableRegistry.get(this.cacheKey))===null||s===void 0?void 0:s.size),(e=this.cache.tableRegistry.get(this.cacheKey))===null||e===void 0||e.delete(this),(t=this.changes)===null||t===void 0||t.cancel(),super.close()}}function Te(a,s,e){return s=Ea(s),s in a?Object.defineProperty(a,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[s]=e,a}function Ea(a){var s=Na(a,"string");return typeof s=="symbol"?s:String(s)}function Na(a,s){if(typeof a!="object"||a===null)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var t=e.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}var Je=G.module("PouchCommandHistoryCache");class Fa{constructor(){Te(this,"isPruning",void 0),Te(this,"response",void 0),Te(this,"tableRegistry",void 0),this.isPruning=new Map,this.response=new Map,this.tableRegistry=new Map}pauseChangeListeners(s){var e,t=[];return(e=this.tableRegistry.get(s))===null||e===void 0||e.forEach(o=>{o.changes&&(Je.debug("Pausing event listeners on '".concat(s,"' table"),o),o.changes.cancel(),t.push(o))}),()=>{t.forEach(o=>{var r,i;(r=(i=this.tableRegistry.get(s))===null||i===void 0?void 0:i.has(o))!==null&&r!==void 0&&r&&(Je.debug("Resuming event listeners on '".concat(s,"' table"),o),o.listenForChanges())})}}}function Xe(a,s){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);s&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),e.push.apply(e,t)}return e}function Qe(a){for(var s=1;s<arguments.length;s++){var e=arguments[s]!=null?arguments[s]:{};s%2?Xe(Object(e),!0).forEach(function(t){Ee(a,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):Xe(Object(e)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))})}return a}function et(a,s,e,t,o,r,i){try{var l=a[r](i),c=l.value}catch(d){e(d);return}l.done?s(c):Promise.resolve(c).then(t,o)}function we(a){return function(){var s=this,e=arguments;return new Promise(function(t,o){var r=a.apply(s,e);function i(c){et(r,t,o,i,l,"next",c)}function l(c){et(r,t,o,i,l,"throw",c)}i(void 0)})}}function Ee(a,s,e){return s=Ra(s),s in a?Object.defineProperty(a,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[s]=e,a}function Ra(a){var s=Ia(a,"string");return typeof s=="symbol"?s:String(s)}function Ia(a,s){if(typeof a!="object"||a===null)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var t=e.call(a,s||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}var tt=G.module("PouchCommandHistoryStorage");class Oa{constructor(){Ee(this,"cache",new Fa),Ee(this,"updateTableMap",new Map)}getUpdateTable(s){return this.updateTableMap.has(s)||this.updateTableMap.set(s,new ze(s,this.cache)),this.updateTableMap.get(s)}getTable(s){var e=this;return we(function*(){return new ze(s,e.cache)})()}addItem(s,e,t,o){var r=this;return we(function*(){return r.updateItem(s,{id:"".concat(new Date().getTime()),name:t,data:o})})()}updateItem(s,e){var t=this;return we(function*(){var o=t.getUpdateTable(s),r=yield o.refreshItem(e.id),i=Qe(Qe({},r??{}),e);return tt.debug("Updating item",i),yield o.put(i),tt.debug("Update saved"),e})()}listenItem(s,e,t){var o=this.getUpdateTable(s);return o.onItemUpdate(e,t)}}const Ft="SET_LAYOUT_STORAGE",La=a=>({type:Ft,payload:a});var{dh:ka}=globalThis;const Pa=G.module("SettingsUtils");function Aa(a){return a.formatString!=null}function Rt(a){const s=Wt.parse(window.navigator.userAgent),e=`${s.browser.name??""} ${Number(parseFloat(s.browser.version??""))||""}`,t=`${s.os.name??""} ${s.os.version??""}`;return{"Engine Version":a.get("deephaven.version")??"Unknown","Web UI Version":"0.98.0","Java Version":a.get("java.version")??"Unknown","Barrage Version":a.get("barrage.version")??"Unknown","Browser Name":e.trim()||"Unknown","OS Name":t.trim()||"Unknown"}}function st(a){return Array.from(a.entries()).filter(s=>s[1].version!==void 0).reduce((s,[e,t])=>({...s,[e]:t.version}),{})}function Ne(a){const s=a==null?void 0:a.querySelector("input, select, textarea");s&&s.focus()}function It(a,s){return a.defaultFormatString===s.defaultFormatString}function _a(a,s){return It(a,s)}function Ma(a,s){return It(a,s)}function Ot(a){return a!==""&&ss.isValidColumnName(a)}function z(a,s,e){if(!s||e.formatString==null||!Aa(e))return!1;switch(s){case"datetime":return V.isValid(a,e);case"decimal":return M.isValid(a,e);case"int":return _.isValid(a,e);default:return Pa.warn("Trying to validate format of unknown type"),!0}}function Ua(a){const{id:s,isNewRule:e,...t}=a;return t}function Ka(a,s){return Ot(s.columnName)&&z(a,s.columnType,s.format)}function Lt(a){const{timestamp:s,timeZone:e,showTimeZone:t,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i}=a,l=ut(),c=m.useMemo(()=>new ns(l,[],{timeZone:e,showTimeZone:t,showTSeparator:o}),[l,t,o,e]),d=r?V.getGlobalFormats(t,o):V.getFormats(t,o);return i!=null&&!d.includes(i)&&d.unshift(i),n.jsx(n.Fragment,{children:d.map(h=>{const u=V.makeFormat("",h,V.TYPE_GLOBAL);return n.jsx("option",{value:h,"data-testid":"time-format",children:c.getFormattedString(s,R.dataType.DATETIME,"",u)},h)})})}function $a(){return n.jsx(n.Fragment,{children:as.TIME_ZONES.map(a=>{const{label:s,value:e}=a;return n.jsx("option",{value:e,children:s},e)})})}const B=G.module("FormattingSectionContent"),se=class se extends m.PureComponent{constructor(e){super(e);v(this,"debouncedCommitChanges");v(this,"pendingUpdates");v(this,"containerRef");v(this,"getCachedDateTimeFormatOptions",De((e,t,o,r=!1,i)=>{const{timestampAtMenuOpen:l}=this.state;return n.jsx(Lt,{timestamp:l,timeZone:e,showTimeZone:t,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i})}));this.debouncedCommitChanges=lt(this.commitChanges.bind(this),se.inputDebounceTime),this.queueUpdate=this.queueUpdate.bind(this),this.handleDefaultDateTimeFormatChange=this.handleDefaultDateTimeFormatChange.bind(this),this.handleDefaultDecimalFormatChange=this.handleDefaultDecimalFormatChange.bind(this),this.handleDefaultIntegerFormatChange=this.handleDefaultIntegerFormatChange.bind(this),this.handleShowTimeZoneChange=this.handleShowTimeZoneChange.bind(this),this.handleShowTSeparatorChange=this.handleShowTSeparatorChange.bind(this),this.handleTimeZoneChange=this.handleTimeZoneChange.bind(this),this.handleResetDateTimeFormat=this.handleResetDateTimeFormat.bind(this),this.handleResetDecimalFormat=this.handleResetDecimalFormat.bind(this),this.handleResetIntegerFormat=this.handleResetIntegerFormat.bind(this),this.handleResetTimeZone=this.handleResetTimeZone.bind(this),this.handleTruncateNumbersWithPoundChange=this.handleTruncateNumbersWithPoundChange.bind(this),this.handleShowEmptyStringsChange=this.handleShowEmptyStringsChange.bind(this),this.handleShowNullStringsChange=this.handleShowNullStringsChange.bind(this),this.handleShowExtraGroupColumnChange=this.handleShowExtraGroupColumnChange.bind(this);const{defaultDateTimeFormat:t,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,showTimeZone:i,showTSeparator:l,timeZone:c,truncateNumbersWithPound:d,showEmptyStrings:h,showNullStrings:u,showExtraGroupColumn:p}=e;this.containerRef=X.createRef(),this.pendingUpdates=[],this.state={showTimeZone:i,showTSeparator:l,timeZone:c,defaultDateTimeFormat:t,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,truncateNumbersWithPound:d,showEmptyStrings:h,showNullStrings:u,showExtraGroupColumn:p,timestampAtMenuOpen:new Date}}componentDidMount(){Ne(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}queueUpdate(e){this.pendingUpdates.push(e),this.debouncedCommitChanges()}handleDefaultDateTimeFormatChange(e){B.debug("handleDefaultDateTimeFormatChange",e);const t={defaultDateTimeFormat:e};this.setState(t),this.queueUpdate(t)}handleDefaultDecimalFormatChange(e){B.debug("handleDefaultDecimalFormatChange",e.target.value);const t={defaultDecimalFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),z(dh,R.dataType.DECIMAL,M.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleDefaultIntegerFormatChange(e){B.debug("handleDefaultIntegerFormatChange",e.target.value);const t={defaultIntegerFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),z(dh,R.dataType.INT,_.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleShowTimeZoneChange(){const{showTimeZone:e}=this.state,t={showTimeZone:!e};this.setState(t),this.queueUpdate(t)}handleShowTSeparatorChange(){const{showTSeparator:e}=this.state,t={showTSeparator:!e};this.setState(t),this.queueUpdate(t)}handleTimeZoneChange(e){const t={timeZone:e};this.setState(t),this.queueUpdate(t)}handleResetDateTimeFormat(){const{defaults:e}=this.props,{defaultDateTimeFormat:t,showTimeZone:o,showTSeparator:r}=e;B.debug("handleResetDateTimeFormat"),this.setState({defaultDateTimeFormat:t,showTimeZone:o,showTSeparator:r}),this.queueUpdate({defaultDateTimeFormat:void 0,showTimeZone:void 0,showTSeparator:void 0})}handleResetTimeZone(){const{defaults:e}=this.props,{timeZone:t}=e;B.debug("handleResetTimeZone"),this.setState({timeZone:t}),this.queueUpdate({timeZone:void 0})}handleResetDecimalFormat(){const{defaults:e}=this.props,{defaultDecimalFormatOptions:t}=e;B.debug("handleResetDecimalFormat"),this.setState({defaultDecimalFormatOptions:t}),this.queueUpdate({defaultDecimalFormatOptions:void 0})}handleResetIntegerFormat(){const{defaults:e}=this.props,{defaultIntegerFormatOptions:t}=e;B.debug("handleResetIntegerFormat"),this.setState({defaultIntegerFormatOptions:t}),this.queueUpdate({defaultIntegerFormatOptions:void 0})}handleTruncateNumbersWithPoundChange(){const{truncateNumbersWithPound:e}=this.state,t={truncateNumbersWithPound:e!==!0};this.setState(t),this.queueUpdate(t)}handleShowEmptyStringsChange(){const{showEmptyStrings:e}=this.state,t={showEmptyStrings:!e};this.setState(t),this.queueUpdate(t)}handleShowNullStringsChange(){const{showNullStrings:e}=this.state,t={showNullStrings:!e};this.setState(t),this.queueUpdate(t)}handleShowExtraGroupColumnChange(){const{showExtraGroupColumn:e}=this.state,t={showExtraGroupColumn:!e};this.setState(t),this.queueUpdate(t)}commitChanges(){const{updateSettings:e}=this.props,t=this.pendingUpdates.reduce((o,r)=>({...o,...r}),{});this.pendingUpdates=[],e(t)}render(){const{defaults:e,dh:t}=this.props,{defaultDateTimeFormat:o,defaultDecimalFormatOptions:r,defaultIntegerFormatOptions:i,timeZone:l,showTimeZone:c,showTSeparator:d,truncateNumbersWithPound:h,showEmptyStrings:u,showNullStrings:p,showExtraGroupColumn:C}=this.state,{defaultFormatString:S=M.DEFAULT_FORMAT_STRING}=r??{},{defaultFormatString:b=_.DEFAULT_FORMAT_STRING}=i??{},g=l===e.timeZone,w=d===e.showTSeparator&&c===e.showTimeZone&&o===e.defaultDateTimeFormat,k=_a(r,e.defaultDecimalFormatOptions),D=Ma(i,e.defaultIntegerFormatOptions);return n.jsx("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:n.jsxs("div",{className:"container-fluid p-0",children:[n.jsx("div",{className:"app-settings-menu-description mb-3",children:"Choose the default formatting rule to apply to all table columns based on their type."}),n.jsxs("div",{className:"form-row mb-2",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"select-reset-timezone",children:"Time zone"}),n.jsx("div",{className:"col pr-0",children:n.jsx(de,{className:"custom-select",value:l,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:n.jsx($a,{})})}),n.jsx("div",{className:"col-1 btn-col",children:n.jsx(T,{kind:"ghost",icon:q,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:I("btn-reset","btn-reset-time-zone",{hidden:g})})})]}),n.jsxs("div",{className:"form-row mb-2",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"select-default-time-format",children:"DateTime"}),n.jsx("div",{className:"col pr-0",children:n.jsx(de,{className:"custom-select",value:o,onChange:this.handleDefaultDateTimeFormatChange,id:"select-default-time-format",children:this.getCachedDateTimeFormatOptions(l,c,d,!0,o)})}),n.jsx("div",{className:"col-1 btn-col",children:n.jsx(T,{kind:"ghost",icon:q,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:I("btn-reset","btn-reset-date-time",{hidden:w})})})]}),n.jsx("div",{className:"form-row",children:n.jsx("div",{className:"offset-3 col-9",children:n.jsx(H,{checked:c??null,onChange:this.handleShowTimeZoneChange,children:"Show time zone in dates"})})}),n.jsx("div",{className:"form-row mb-3",children:n.jsx("div",{className:"offset-3 col-9",children:n.jsx(H,{checked:d??null,onChange:this.handleShowTSeparatorChange,children:"Show 'T' separator"})})}),n.jsxs("div",{className:"form-row mb-2",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"default-decimal-format-input",children:"Decimal"}),n.jsx("div",{className:"col pr-0",children:n.jsx("input",{className:I("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!z(t,R.dataType.DECIMAL,M.makeCustomFormat(S))}),"data-lpignore":!0,placeholder:M.DEFAULT_FORMAT_STRING,type:"text",id:"default-decimal-format-input",value:S,onChange:this.handleDefaultDecimalFormatChange})}),n.jsx("div",{className:"col-1 btn-col",children:n.jsx(T,{kind:"ghost",icon:q,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:I("btn-reset","btn-reset-decimal",{hidden:k}),"data-testid":"btn-reset-decimal"})})]}),n.jsxs("div",{className:"form-row mb-2",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"Integer"}),n.jsx("div",{className:"col pr-0",children:n.jsx("input",{className:I("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!z(t,R.dataType.INT,_.makeCustomFormat(b))}),"data-lpignore":!0,placeholder:_.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:b,onChange:this.handleDefaultIntegerFormatChange})}),n.jsx("div",{className:"col-1 btn-col",children:n.jsx(T,{kind:"ghost",icon:q,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:I("btn-reset","btn-reset-integer",{hidden:D}),"data-testid":"btn-reset-integer"})})]}),n.jsx("div",{className:"form-row mb-2",children:n.jsx("div",{className:"offset-3 col-9",children:n.jsx(H,{checked:h??null,onChange:this.handleTruncateNumbersWithPoundChange,children:"Show truncated numbers as ###"})})}),n.jsxs("div",{className:"form-row mb-3",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"String"}),n.jsxs("div",{className:"col pr-0 pt-2",children:[n.jsxs(H,{checked:u??null,onChange:this.handleShowEmptyStringsChange,children:["Show empty strings as"," ",n.jsx("span",{className:"font-italic text-muted",children:"empty"})]}),n.jsxs(H,{checked:p??null,onChange:this.handleShowNullStringsChange,children:["Show null strings as"," ",n.jsx("span",{className:"font-italic text-muted",children:"null"})]})]})]}),n.jsxs("div",{className:"form-row mb-3",id:"show_extra_group_column_div",children:[n.jsx("label",{className:"col-form-label col-3",htmlFor:"default-show-extra-group-column",children:"Rollup"}),n.jsx("div",{className:"col pr-0 pt-2",id:"default-show-extra-group-column",children:n.jsx(H,{checked:C,onChange:this.handleShowExtraGroupColumnChange,children:'Show extra "group" column'})})]})]})})}};v(se,"defaultProps",{scrollTo:()=>{}}),v(se,"inputDebounceTime",250);let Fe=se;const Wa=a=>({defaultDateTimeFormat:os(a),defaultDecimalFormatOptions:ht(a),defaultIntegerFormatOptions:mt(a),dh:pt(a),showTimeZone:gt(a),showTSeparator:ft(a),truncateNumbersWithPound:rs(a),showEmptyStrings:is(a),showNullStrings:ls(a),showExtraGroupColumn:cs(a),timeZone:bt(a),defaults:ds(a)}),Ga=pe(Wa,{updateSettings:ae})(Fe);function Ba(){const[a,s]=m.useState(!1),e=()=>{s(!a)};return n.jsxs(n.Fragment,{children:[n.jsx(T,{kind:"ghost",onClick:e,icon:cn,children:"Legal Notices"}),n.jsxs(dn,{isOpen:a,toggle:e,children:[n.jsx(un,{toggle:e,children:"Legal Notice"}),n.jsxs(hn,{children:[n.jsx("p",{children:"Deephaven software is protected by U.S. Patent Nos. 9,612,959; 9,613,018; 9,613,109; 9,619,210; 9,633,060; 9,639,570; 9,672,238; 9,679,006; 9,690,821; 9,710,511; 9,760,591; 9,805,084; 9,836,494; 9,836,495; 9,886,469; 9,898,496; 9,934,266; 10,002,153; 10,002,154; 10,002,155; 10,003,673; 10,019,138; 10,069,943; 10,176,211; 10,198,465; 10,198,466; 10,198,469; 10,212,257; 10,241,960; 10,241,965; 10,242,040; 10,242,041; 10,346,394; 10,353,893; 10,452,649; 10,496,639; 10,540,351; 10,552,412; 10,565,194; 10,565,206; 10,572,474; 10,621,168; 10,642,829; 10,657,184; 10,678,787; 10,691,686; 10,783,191; 10,866,943; 10,909,183; 10,915,526; 10,922,311; 10,929,394; 11,023,462; 11,126,662; 11,151,133; 11,238,036; 11,249,994; 11,263,211; 11,449,557; 11,514,037; 11,556,528; and 11,574,018. Other patents pending."}),n.jsxs("p",{children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})]})}function $(a){const{children:s,isExpanded:e,sectionKey:t,title:o,onToggle:r}=a;return n.jsxs(n.Fragment,{children:[n.jsx("div",{children:n.jsxs(T,{kind:"ghost",className:"btn-collapse-trigger",onClick:()=>r(t),children:[n.jsx("div",{className:"d-flex align-items-center flex-grow-1",children:o}),n.jsx("div",{className:"flex-shrink-0",children:n.jsx(E,{transform:e?"flip-v":"",icon:mn})})]})}),n.jsx(Wn,{in:e,autoFocusOnShow:!0,children:s})]})}$.propTypes={children:N.node,isExpanded:N.bool.isRequired,sectionKey:N.string.isRequired,title:N.node.isRequired,onToggle:N.func};$.defaultProps={children:null,onToggle:()=>{}};function Va({shortcut:a,displayText:s,categoryName:e,onChange:t}){const[o,r]=m.useState(s),[i,l]=m.useState(a.getKeyState()),[c,d]=m.useState(!1),[h,u]=m.useState("");m.useEffect(function(){r(s),l(a.getKeyState())},[s,a]),m.useEffect(function(){r(A.getDisplayText(i)),a.matchesKeyState(i)&&d(!1)},[i,a]),m.useEffect(function(){if(c){if(!A.isValidKeyState(i)){A.isAllowedKey(i.keyValue)?u("Must contain a modifier key"):u("Must contain an allowed action key");return}const f=Oe.getConflictingShortcuts(i).filter(y=>y.id.startsWith(e)&&y!==a).map(y=>y.name);if(f.length){u(`Conflicts with ${f.join(", ")}`);return}u("")}else u("")},[c,i,e,a]);function p(D){if(D.stopPropagation(),D.preventDefault(),a.isEditable&&!D.repeat){const f=A.getKeyStateFromEvent(D),y=A.createKeyState([us.BACKSPACE]);A.doKeyStatesMatch(f,y)?l(A.NULL_KEY_STATE):l(f)}}function C(D){D.stopPropagation(),D.preventDefault(),a.matchesKeyState(i)||d(!0)}function S(){Ae.disableAllActions()}function b(){Ae.enableAllActions()}function g(){a.setKeyState(i),d(!1),t(a)}function w(){const D=a.getKeyState();l(D),d(!1)}function k(){d(!0),l(a.getDefaultKeyState())}return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"shortcut-item-container",children:[n.jsxs("label",{className:"shortcut-item-name",children:[a.name,a.tooltip!==void 0&&n.jsx(vt,{children:a.tooltip})]}),n.jsxs("div",{className:"shortcut-item-input-container",children:[n.jsx("input",{className:I("form-control",{"is-invalid":h}),onKeyDown:p,onKeyUp:C,onFocus:S,onBlur:b,disabled:!a.isEditable,value:o,readOnly:!0}),!A.doKeyStatesMatch(i,a.getDefaultKeyState())&&!h&&n.jsx(T,{className:"reset-to-default-button",kind:"ghost",icon:n.jsx(E,{icon:q,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:k})]})]}),c&&n.jsxs("div",{className:I("shortcut-item-message-container",{"is-invalid":h}),children:[n.jsx("div",{className:"shortcut-item-message",children:h}),n.jsxs("div",{className:"shortcut-item-message-buttons",children:[A.isValidKeyState(i)&&n.jsx(T,{kind:"ghost",onClick:g,children:"Confirm"}),n.jsx(T,{kind:"ghost",onClick:w,children:"Undo"})]})]})]})}function Ha({shortcutOverrides:a={},updateSettings:s}){const e=m.useCallback(i=>{const l=A.isMacPlatform,c={mac:{...a.mac},windows:{...a.windows}},d=l?c.mac:c.windows;i.forEach(h=>{h.isDefault()?delete d[h.id]:d[h.id]=h.getKeyState()}),s({shortcutOverrides:c})},[s,a]);let t=Array.from(Oe.shortcutsByCategory.entries()).map(([i,l])=>({name:i,shortcuts:l}));const o=t.findIndex(i=>i.name.toUpperCase()==="GLOBAL"),r=t.splice(o,1);return t=t.concat(r),n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"app-settings-menu-description",children:"Customize shortcuts below. To prevent unexpected results, avoid conflicting shortcuts with the browser or IDE editor."}),t.map(i=>n.jsx(Ya,{name:i.name,shortcuts:i.shortcuts,saveShortcutOverrides:e},i.name))]})}function Ya({name:a,shortcuts:s,saveShortcutOverrides:e}){function t(c){return c.split("_").map(d=>`${d[0].toUpperCase()}${d.slice(1).toLowerCase()}`).join(" ")}const[o,r]=m.useState(s);function i(c){const d=o.filter(u=>u!==c&&!u.isNull()&&u.matchesKeyState(c.getKeyState()));d.forEach(u=>u.setToNull());const h=[c,...d];e(h),r(u=>[...u])}const l=m.useMemo(()=>o.map(c=>c.getDisplayText()),[o]);return n.jsxs("div",{className:"mt-3",children:[n.jsx("div",{className:"font-weight-bold",children:t(a)}),o.map((c,d)=>n.jsx(Va,{shortcut:c,displayText:l[d],categoryName:a,onChange:i},c.id))]})}const Za=a=>({shortcutOverrides:hs(a)}),qa={updateSettings:ae},za=pe(Za,qa)(Ha),Ja=[{value:R.dataType.DATETIME,label:"DateTime"},{value:R.dataType.DECIMAL,label:"Decimal"},{value:R.dataType.INT,label:"Integer"}];function Xa(){const a=Ja.map(s=>n.jsx("option",{value:s.value,children:s.label},`key-columnType-${s.value}`));return n.jsxs(n.Fragment,{children:[n.jsx("option",{disabled:!0,value:"",children:"Select Type"},"key-columnType-placeholder"),a]})}const ne=class ne extends m.PureComponent{constructor(e){super(e);v(this,"debouncedCommitChanges");v(this,"containerRef");v(this,"addFormatRuleButtonRef");v(this,"lastFormatRuleIndex");v(this,"getCachedColumnTypeOptions",De(()=>n.jsx(Xa,{})));v(this,"getCachedDateTimeFormatOptions",De((e,t,o,r=!1,i)=>{const{timestampAtMenuOpen:l}=this.state;return n.jsx(Lt,{timestamp:l,timeZone:e,showTimeZone:t,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i})}));this.debouncedCommitChanges=lt(this.commitChanges.bind(this),ne.inputDebounceTime),this.handleFormatRuleEntered=this.handleFormatRuleEntered.bind(this),this.handleFormatRuleChange=this.handleFormatRuleChange.bind(this),this.handleFormatRuleCreate=this.handleFormatRuleCreate.bind(this),this.handleFormatRuleDelete=this.handleFormatRuleDelete.bind(this);const{formatter:t,showTimeZone:o,showTSeparator:r,timeZone:i}=e,l=t.map((c,d)=>({...c,id:d}));this.containerRef=X.createRef(),this.addFormatRuleButtonRef=X.createRef(),this.lastFormatRuleIndex=l.length,this.state={formatSettings:l,formatRulesChanged:!1,showTimeZone:o,showTSeparator:r,timeZone:i,timestampAtMenuOpen:new Date}}componentDidMount(){Ne(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}isDuplicateRule(e){const{formatSettings:t}=this.state;return t.some(o=>o.id!==e.id&&o.columnName===e.columnName&&o.columnType===e.columnType)??!1}getAutoIncrementFormatRuleIndex(){const{lastFormatRuleIndex:e}=this;return this.lastFormatRuleIndex+=1,e}handleFormatRuleChange(e,t,o){this.setState(r=>{const{formatSettings:i}=r;me(i);const l=[...i];let c={};t==="columnType"&&(c={format:this.makeDefaultFormatterItemByType(o)});const d={...l[e],...c,[t]:o};return l[e]=d,{formatSettings:l}},()=>{this.debouncedCommitChanges()})}handleFormatRuleCreate(){this.setState(e=>{const{formatSettings:t}=e,o={columnType:R.dataType.DATETIME,columnName:"",format:{},id:this.getAutoIncrementFormatRuleIndex(),isNewRule:!0};return{formatSettings:[...t,o],formatRulesChanged:!0}})}handleFormatRuleDelete(e){this.setState(t=>{const{formatSettings:o}=t;return{formatSettings:o.filter((i,l)=>l!==e),formatRulesChanged:!0}},()=>{this.debouncedCommitChanges()})}handleFormatRuleEntered(e){this.scrollToFormatBlockBottom(),Ne(e)}commitChanges(){const{formatSettings:e}=this.state,{dh:t}=this.props,o=e.filter(l=>Ka(t,l)).map(Ua)??[],{updateSettings:r}=this.props;r({formatter:o})}scrollToFormatBlockBottom(){var t,o;const{scrollTo:e}=this.props;e(0,(((t=this.addFormatRuleButtonRef.current)==null?void 0:t.offsetHeight)??0)+(((o=this.addFormatRuleButtonRef.current)==null?void 0:o.offsetTop)??0))}getRuleError(e){const{dh:t}=this.props,o={hasColumnNameError:!1,hasFormatError:!1,message:""},r=[];return e.isNewRule!==void 0&&e.isNewRule||(this.isDuplicateRule(e)&&(o.hasColumnNameError=!0,r.push("Duplicate column name/type combo.")),Ot(e.columnName)||(o.hasColumnNameError=!0,r.push("Column names must start with a letter or underscore and contain only alphanumeric characters or underscores.")),e.format.formatString!=null&&e.format.formatString.length===0?(o.hasFormatError=!0,r.push("Empty formatting rule.")):z(t,e.columnType,e.format)||(o.hasFormatError=!0,r.push("Invalid formatting rule.")),o.message=r.join(`
|
|
3
|
-
`)),o}makeDefaultFormatterItemByType(e){switch(R.getNormalizedType(e)){case R.dataType.INT:{const{defaultIntegerFormatOptions:t}=this.props,{defaultFormatString:o}=t;return _.makeFormat("",o??_.DEFAULT_FORMAT_STRING,_.TYPE_GLOBAL,void 0)}case R.dataType.DECIMAL:{const{defaultDecimalFormatOptions:t}=this.props,{defaultFormatString:o}=t;return M.makeFormat("",o??M.DEFAULT_FORMAT_STRING,M.TYPE_GLOBAL,void 0)}default:return""}}renderFormatRule(e,t){const o=`input-${e}-columnName`,r=`input-${e}-columnType`,i=`input-${e}-format`,l=this.getCachedColumnTypeOptions(),c=p=>this.handleFormatRuleChange(e,"columnName",p.target.value),d=()=>this.handleFormatRuleChange(e,"isNewRule",!1),h=p=>this.handleFormatRuleChange(e,"columnType",p),u=this.getRuleError(t);return n.jsxs("fieldset",{className:"container-fluid format-rule-container",children:[n.jsxs("div",{className:"form-row",children:[n.jsxs("div",{className:"form-group col-7 mb-2",children:[n.jsx("label",{htmlFor:o,children:"Column Name"}),n.jsx("input",{id:o,className:I("form-control",{"is-invalid":u.hasColumnNameError}),"data-lpignore":!0,type:"text",value:t.columnName,onChange:c,onBlur:d})]}),n.jsxs("div",{className:"form-group col mb-2",children:[n.jsx(T,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(e),icon:pn,tooltip:"Delete","aria-label":"Delete Format Rule"}),n.jsx("label",{htmlFor:r,children:"Column Type"}),n.jsx(de,{id:r,className:"custom-select",value:t.columnType,onChange:h,children:l})]})]}),n.jsx("div",{className:"form-row",children:n.jsxs("div",{className:"form-group col-12 d-flex mb-2",children:[n.jsx("label",{className:"flex-shrink-0 col-form-label mr-3",htmlFor:i,children:"Formatting Rule"}),this.renderFormatRuleInput(e,t.columnType,i,t.format,u.hasFormatError)]})}),n.jsx("div",{className:"form-row",children:n.jsx("div",{className:"form-group col-12 d-flex mb-2",children:u.message&&n.jsx("p",{className:"text-danger",children:u.message})})})]},e)}renderFormatRuleInput(e,t,o,r,i){switch(R.getNormalizedType(t)){case R.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(e,o,r,i);case R.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(e,o,r,i);case R.dataType.INT:return this.renderIntegerFormatRuleInput(e,o,r,i);default:throw new Error(`Unrecognized column type: ${t}`)}}renderDateTimeFormatRuleInput(e,t,o,r){const{showTimeZone:i,showTSeparator:l,timeZone:c}=this.state,d=o.formatString??"";return n.jsxs(de,{className:I("custom-select",{"is-invalid":r}),value:d,id:t,onChange:h=>{const u=V.makeFormat("",h,V.TYPE_GLOBAL);this.handleFormatRuleChange(e,"format",u)},children:[n.jsx("option",{value:"",disabled:!0,children:"Select format"},"default"),this.getCachedDateTimeFormatOptions(c,i,l)]})}renderIntegerFormatRuleInput(e,t,o,r){const{defaultIntegerFormatOptions:i}=this.props;me(i);const{defaultFormatString:l}=i,c=o.formatString??"";return n.jsx("input",{className:I("form-control","flex-grow-1",{"is-invalid":r}),"data-lpignore":!0,id:t,placeholder:l??_.DEFAULT_FORMAT_STRING,type:"text",value:c,onChange:d=>{const h=_.makeFormat("",d.target.value,_.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",h)}})}renderDecimalFormatRuleInput(e,t,o,r){const{defaultDecimalFormatOptions:i}=this.props,{defaultFormatString:l}=i,c=o.formatString??"";return n.jsx("input",{className:I("form-control","flex-grow-1",{"is-invalid":r}),"data-lpignore":!0,id:t,placeholder:l??M.DEFAULT_FORMAT_STRING,type:"text",value:c,onChange:d=>{const h=M.makeFormat("",d.target.value,M.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",h)}})}render(){const{formatRulesChanged:e,formatSettings:t}=this.state,o=t.map((i,l)=>n.jsx(ms,{onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(l,i)},i.id)),r=n.jsx(T,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:gn,children:"Add New Rule"});return n.jsxs("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:[n.jsx("div",{className:"app-settings-menu-description mb-3",children:"Customize the formatting of table columns by applying rules based on matching both a column name and column type."}),n.jsx(Gt,{appear:e,enter:e,exit:e,children:o}),r]})}};v(ne,"defaultProps",{scrollTo:()=>{}}),v(ne,"inputDebounceTime",250);let Re=ne;const Qa=a=>({formatter:ps(a),defaultDecimalFormatOptions:ht(a),defaultIntegerFormatOptions:mt(a),dh:pt(a),showTimeZone:gt(a),showTSeparator:ft(a),timeZone:bt(a)}),eo=pe(Qa,{updateSettings:ae})(Re);function to(){const a=ge(),s=ue(gs),e=ue(fs),t=m.useCallback(r=>{a(ae({webgl:r}))},[a]),o=e?n.jsx(ee,{children:"WebGL in most cases has significant performance improvements, particularly when plotting large datasets. However, in some environments (such as remote desktop environments), WebGL may not use hardware acceleration and have degraded performance. If you are experiencing issues with WebGL, you can disable it here."}):n.jsx(ee,{children:"WebGL is disabled by your system administrator. Contact your system administrator to enable."});return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"app-settings-menu-description",children:"Advanced settings here. Be careful!"}),n.jsxs("div",{className:"form-row mb-3 pl-1",children:[n.jsx(le,{isSelected:s,isDisabled:!e,onChange:t,marginEnd:"size-0",children:"Enable WebGL"}),n.jsxs(ct,{variant:"info",marginTop:"size-50",children:[n.jsx(Tt,{children:"Enable WebGL"}),n.jsx(dt,{children:n.jsx(ee,{children:o})})]})]})]})}function so(){const a=bs(),s=ue(vs),e=ge(),t=m.useCallback(r=>{if(r!=="regular"&&r!=="compact"&&r!=="spacious")throw new Error(`Invalid grid density value: ${r}`);e(ae({gridDensity:r}))},[e]),o=s.gridDensity;return me(a,"ThemeContext value is null"),n.jsxs(n.Fragment,{children:[n.jsx(Gn,{}),n.jsxs(Bn,{label:"Default table density",selectedKey:o,onChange:t,children:[n.jsx(be,{children:"Regular"},"regular"),n.jsx(be,{children:"Compact"},"compact"),n.jsx(be,{children:"Spacious"},"spacious")]})]})}function no(){const a=ue(Ss),s=ge(),{isMinimapEnabled:e,formatOnSave:t,python:{linter:o={}}={}}=a,{isEnabled:r,config:i=_e}=o,l=m.useCallback(g=>s(oe({isMinimapEnabled:g})),[s]),c=m.useCallback(g=>s(oe({formatOnSave:g})),[s]),d=m.useCallback(g=>{s(oe({python:{linter:{...o,isEnabled:g}}})),Se.isRuffEnabled=g,Se.setRuffSettings(i)},[s,o,i]),h=m.useCallback(g=>{s(oe({python:{linter:{...o,config:JSON.stringify(g)===JSON.stringify(_e)?void 0:g}}})),Se.setRuffSettings(g)},[s,o]),u=JSON.stringify(i,null,2),[p,C]=m.useState(!1),S=m.useCallback(()=>{C(!1)},[]),b=m.useCallback(g=>{h(g),S()},[h,S]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"app-settings-menu-description",children:"Customize the notebook editor."}),n.jsx("div",{className:"form-row pl-1",children:n.jsx(le,{isSelected:e,onChange:l,children:"Enable Minimap"})}),n.jsxs("div",{className:"form-row align-items-center pl-1",children:[n.jsx(le,{isSelected:t,onChange:c,margin:0,children:"Format on Save"}),n.jsxs(ct,{variant:"info",children:[n.jsx(Tt,{children:"Format on Save"}),n.jsx(dt,{children:n.jsx(ee,{children:"The Ruff settings control formatting options. Notebooks can be formatted manually using the right-click context menu."})})]})]}),n.jsx("div",{className:"form-row pl-1",children:n.jsx(le,{isSelected:r,onChange:d,marginEnd:0,children:"Enable Ruff Python Linter"})}),n.jsx("div",{className:"form-row pl-1",children:n.jsxs(Bt,{onPress:()=>C(!0),children:[n.jsx(Vt,{children:n.jsx(E,{icon:fn})}),n.jsx(ee,{children:"Customize Ruff Settings"})]})}),p&&n.jsx(Vn,{text:u,isOpen:p,onClose:S,onSave:b})]})}const x=class x extends m.Component{constructor(e){super(e);v(this,"menuContentRef");v(this,"broadcastChannel");this.handleClose=this.handleClose.bind(this),this.handleScrollTo=this.handleScrollTo.bind(this),this.handleSectionToggle=this.handleSectionToggle.bind(this),this.handleExportSupportLogs=this.handleExportSupportLogs.bind(this),this.handleLogout=this.handleLogout.bind(this),this.menuContentRef=X.createRef(),this.broadcastChannel=new BroadcastChannel(Hn),this.state={expandedSectionKey:x.FORMATTING_SECTION_KEY}}static focusFirstInputInContainer(e){const t=e==null?void 0:e.querySelector("input, select, textarea");t&&t.focus()}componentDidMount(){x.focusFirstInputInContainer(this.menuContentRef.current)}componentWillUnmount(){this.broadcastChannel.close()}isSectionExpanded(e){const{expandedSectionKey:t}=this.state;return t===e}handleLogout(){this.broadcastChannel.postMessage(Yn(Zn))}handleScrollTo(e,t){var o;(o=this.menuContentRef.current)==null||o.scrollTo(e,t)}handleSectionToggle(e){this.setState(t=>({expandedSectionKey:t.expandedSectionKey===e?void 0:e}))}handleClose(){const{onDone:e}=this.props;e()}handleExportSupportLogs(){const{serverConfigValues:e,pluginData:t}=this.props,o=st(t);pa(vn,{uiVersion:"0.98.0",userAgent:navigator.userAgent,...Object.fromEntries(e),pluginInfo:o},bn.getState())}render(){const e="https://github.com/deephaven/web-client-ui/",t="https://deephaven.io/core/docs/",{serverConfigValues:o,pluginData:r,user:i}=this.props,l=Rt(o),c=st(r),d=o.get("deephaven.version"),h=Z.COPY_VERSION_INFO.getDisplayText(),u=(b,g)=>n.jsxs(m.Fragment,{children:[n.jsx("div",{children:b}),n.jsx("div",{children:g})]},b),p=i.displayName??i.name,C=i.image!=null&&i.image!=="",S=p!=="";return n.jsxs("div",{className:"app-settings-menu",children:[n.jsxs("header",{className:"app-settings-menu-header",children:[n.jsxs("div",{className:"user-info",children:[n.jsxs("div",{className:"user-image",children:[!C&&n.jsx(E,{icon:Sn,transform:"grow-8"}),C&&n.jsx("img",{src:i.image,alt:p})]}),n.jsxs("div",{className:"user-details",children:[S&&n.jsxs("div",{className:"user-name",children:[p,i.operateAs!=null&&i.name!==i.operateAs&&n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"font-weight-light font-italic",children:[" ","as"," "]}),n.jsxs("span",{className:"operating-as-user",children:[n.jsx(E,{icon:yn,className:"mr-1"}),i.operateAs]})]})]}),i.permissions.canLogout&&n.jsx("button",{type:"button",className:"btn btn-link",onClick:this.handleLogout,children:"logout"})]})]}),n.jsx(T,{kind:"ghost",className:"btn-close-settings-menu",onClick:this.handleClose,icon:n.jsx(E,{icon:xn,transform:"grow-4"}),tooltip:"Close"})]}),n.jsxs("div",{className:"app-settings-menu-content",ref:this.menuContentRef,children:[n.jsx("h5",{children:"Settings"}),n.jsx("hr",{className:"my-0"}),n.jsx($,{sectionKey:x.FORMATTING_SECTION_KEY,isExpanded:this.isSectionExpanded(x.FORMATTING_SECTION_KEY),title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:Cn,transform:"grow-4",className:"mr-2"}),"Default Format & Time zone"]}),onToggle:this.handleSectionToggle,children:n.jsx(Ga,{})}),n.jsx($,{sectionKey:x.COLUMN_SPECIFIC_SECTION_KEY,isExpanded:this.isSectionExpanded(x.COLUMN_SPECIFIC_SECTION_KEY),title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:Tn,transform:"grow-4",className:"mr-2"}),"Format by Column Name & Type"]}),onToggle:this.handleSectionToggle,children:n.jsx(eo,{scrollTo:this.handleScrollTo})}),n.jsx($,{sectionKey:x.THEME_SECTION_KEY,isExpanded:this.isSectionExpanded(x.THEME_SECTION_KEY),onToggle:this.handleSectionToggle,title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:wn,transform:"grow-4",className:"mr-2"}),"Theme"]}),children:n.jsx(so,{})}),n.jsx($,{sectionKey:x.EDITOR_SECTION_KEY,isExpanded:this.isSectionExpanded(x.EDITOR_SECTION_KEY),onToggle:this.handleSectionToggle,title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:Dn,transform:"grow-4",className:"mr-2"}),"Editor"]}),children:n.jsx(no,{})}),n.jsx($,{sectionKey:x.SHORTCUT_SECTION_KEY,isExpanded:this.isSectionExpanded(x.SHORTCUT_SECTION_KEY),title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:jn,transform:"grow-4",className:"mr-2"}),"Keyboard Shortcuts"]}),onToggle:this.handleSectionToggle,children:n.jsx(za,{})}),n.jsx($,{sectionKey:x.ADVANCED_SECTION_KEY,isExpanded:this.isSectionExpanded(x.ADVANCED_SECTION_KEY),title:n.jsxs(n.Fragment,{children:[n.jsx(E,{icon:En,transform:"grow-4",className:"mr-2"}),"Advanced"]}),onToggle:this.handleSectionToggle,children:n.jsx(to,{})}),n.jsxs("div",{className:"app-settings-footer",children:[n.jsxs("div",{className:"app-settings-footer-section",children:[n.jsxs("div",{className:"app-settings-footer-item",children:[n.jsx("div",{className:"font-weight-bold",children:"Support"}),n.jsxs("div",{children:["GitHub: ",n.jsx("a",{href:e,className:"custom-link",target:"_blank",rel:"noopener noreferrer",children:e})]}),n.jsx(T,{kind:"tertiary",className:"mt-2 py-2",onClick:this.handleExportSupportLogs,children:"Export Logs"})]}),n.jsxs("div",{className:"app-settings-footer-item",children:[n.jsx("div",{className:"font-weight-bold",children:"Documentation"}),n.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:t,className:"custom-link",children:t})]}),n.jsxs("div",{className:"app-settings-footer-item",children:[n.jsx("div",{className:"font-weight-bold",children:"Version"}),n.jsxs("span",{className:"d-inline-block text-muted",children:[d," ",n.jsx(E,{icon:Nn}),n.jsxs(vt,{interactive:!0,children:[n.jsx("div",{className:"detailed-server-config",children:Object.entries(l).map(([b,g])=>u(b,g))}),n.jsxs(ys,{kind:"inline",tooltip:"Copy version numbers",copy:Object.entries({...l,...c}).map(([b,g])=>`${b}: ${g}`).join(`
|
|
4
|
-
`),children:["Copy Versions",n.jsxs("small",{className:"text-muted",children:["(",h,")"]})]})]})]})]}),n.jsxs("div",{className:"app-settings-footer-item",children:[n.jsx("div",{className:"font-weight-bold",children:"Plugins"}),n.jsx("div",{className:"container",children:Array.from(r.entries()).filter(b=>b[1].version!==void 0).map(([b,g])=>n.jsxs("div",{className:"row justify-content-start align-items-center",children:[n.jsx("div",{className:"col pl-0",children:n.jsx("span",{className:"my-0 text-truncate",children:b})}),n.jsx("div",{className:"col-auto",children:n.jsx("span",{children:g==null?void 0:g.version})})]},b))})]}),n.jsx("div",{className:"app-settings-footer-item",children:n.jsx(Ba,{})})]}),n.jsx("div",{className:"app-settings-footer-section",children:n.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",style:{display:"block",width:"61.8%"},children:n.jsx(wt,{})})})]})]})]})}};v(x,"defaultProps",{onDone:()=>{}}),v(x,"FORMATTING_SECTION_KEY","SettingsMenu.formatting"),v(x,"COLUMN_SPECIFIC_SECTION_KEY","SettingsMenu.columnFormatting"),v(x,"APPLICATION_SECTION_KEY","ApplicationMenu.settings"),v(x,"SHORTCUT_SECTION_KEY","SettingsMenu.shortcuts"),v(x,"THEME_SECTION_KEY","SettingsMenu.theme"),v(x,"ADVANCED_SECTION_KEY","SettingsMenu.advanced"),v(x,"EDITOR_SECTION_KEY","SettingsMenu.editor");let Ie=x;const nt=10;function J(a){const{forwardedProps:{menuItem:{action:s,title:e,disabled:t},iconElement:o,displayShortcut:r,isMouseSelected:i,isKeyboardSelected:l,closeMenu:c}}=a,d=m.useRef(),h=m.useRef(),u=m.useRef(null),[p,C]=m.useState(!1),S=m.useCallback(w=>{d.current!=null&&h.current!=null&&u.current&&(Math.abs(d.current-w.clientX)>=nt||Math.abs(h.current-w.clientY)>=nt)&&(C(!0),window.removeEventListener("mousemove",S),c(),s(w),u.current=null)},[s,c]);function b(w){d.current=w.clientX,h.current=w.clientY,u.current=w.target,window.addEventListener("mousemove",S)}function g(w){u.current===w.target&&(C(!0),c(),s(),window.removeEventListener("mousemove",S)),u.current=null}return m.useEffect(function(){return function(){return window.removeEventListener("mousemove",S)}},[S]),n.jsxs("button",{type:"button",className:I("btn-context-menu",{disabled:t},{active:i&&!t},{"keyboard-active":l&&!t}),onMouseDown:b,onMouseUp:g,disabled:p,children:[n.jsx("span",{className:I("icon"),children:o}),n.jsx("span",{className:"title",children:e}),n.jsx("span",{className:"shortcut",children:r})]})}function Le(a){const{handleControlSelect:s,handleToolSelect:e,onClearFilter:t}=a,o=m.useMemo(()=>[{title:"Input Filter",icon:Fn,menuElement:n.jsx(J,{}),action:r=>{s(W.INPUT_FILTER,r)},order:10},{title:"Dropdown Filter",icon:Rn,menuElement:n.jsx(J,{}),action:r=>{s(W.DROPDOWN_FILTER,r)},order:15},{title:"Markdown Widget",icon:In,menuElement:n.jsx(J,{}),action:r=>{s(W.MARKDOWN,r)},order:20},{title:"Filter Sets",icon:On,menuElement:n.jsx(J,{}),action:r=>{s(W.FILTER_SET_MANAGER,r)},order:25},{disabled:!0,menuElement:n.jsx("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:Ln,action:()=>{e(he.LINKER)},order:40,shortcut:Z.LINKER},{disabled:!0,menuElement:n.jsx("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:kn,action:()=>{t()},order:60,shortcut:Dt.TABLE.CLEAR_ALL_FILTERS}],[s,e,t]);return n.jsx(xs,{popperClassName:"controls-menu-popper",actions:o})}Le.propTypes={handleControlSelect:N.func,handleToolSelect:N.func,onClearFilter:N.func};Le.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};J.propTypes={forwardedProps:N.shape({iconElement:N.node,displayShortcut:N.string,isMouseSelected:N.bool.isRequired,isKeyboardSelected:N.bool.isRequired,closeMenu:N.func.isRequired,menuItem:N.shape({action:N.func,title:N.string,disabled:N.bool}).isRequired})};J.defaultProps={forwardedProps:null};const ao=Pn(Ft,null),oo={layoutStorage:ao},ro=a=>a.layoutStorage,io=a=>a.serverConfigValues;Object.entries(oo).map(([a,s])=>An.register(a,s));const at=10;function lo(a){const{onExportLayout:s,onImportLayout:e,onResetLayout:t,onSelect:o,widgets:r=[]}=a,[i,l]=m.useState(!1),[c,d]=m.useState(""),h=m.useRef(null),u=m.useRef(),p=m.useCallback((f,y)=>{f!=null&&o(f,y)},[o]),C=m.useCallback(f=>{d(f.target.value)},[]),S=m.useCallback(f=>{u.current!=null&&(Math.abs(u.current.x-f.clientX)>=at||Math.abs(u.current.y-f.clientY)>=at)&&(l(!0),window.removeEventListener("mousemove",S),p(u.current.widget,f),u.current=void 0)},[u,p]),b=m.useCallback((f,y)=>{u.current={x:f.clientX,y:f.clientY,widget:y},window.addEventListener("mousemove",S)},[S]),g=m.useCallback((f,y)=>{var K;window.removeEventListener("mousemove",S),((K=u.current)==null?void 0:K.widget)===y&&(l(!0),p(y)),u.current=void 0},[S,u,p]),w=m.useMemo(()=>r.filter(f=>{var y;return c?(y=f.name)==null?void 0:y.toLowerCase().includes(c.toLowerCase()):!0}),[c,r]).sort((f,y)=>{var K;return((K=f.name)==null?void 0:K.localeCompare(y.name??""))??0}),k=m.useMemo(()=>w.map(f=>n.jsx("li",{children:n.jsxs(T,{kind:"ghost","data-testid":`panel-list-item-${f.name??""}-button`,onMouseDown:y=>{b(y,f)},onMouseUp:y=>{g(y,f)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&p(f)},disabled:i,onClick:()=>{},children:[n.jsx(Cs,{type:f.type})," ",f.name??""]})},f.name)),[w,i,b,g,p]),D=m.useMemo(()=>k.length===0?n.jsx("span",{children:"No bound variables found."}):null,[k]);return n.jsxs("div",{className:"widget-list-container d-flex flex-column",children:[n.jsx("div",{className:"widget-list-header",children:n.jsx(Ts,{value:c,placeholder:"Find Table, Plot or Widget",onChange:C,ref:h})}),n.jsxs("ul",{className:"widget-list flex-grow-1",children:[D&&n.jsx("li",{className:"widget-list-message",children:D}),!D&&k]}),n.jsx("div",{children:n.jsx("hr",{})}),n.jsxs("div",{className:"widget-list-footer",children:[n.jsxs(T,{kind:"ghost",onClick:s,children:[n.jsxs("div",{className:"fa-md fa-layers",children:[n.jsx(E,{mask:Ue,icon:Ke,transform:"right-5 down-5"}),n.jsx(E,{icon:Ke,transform:"right-8 down-6"})]}),"Export Layout"]}),n.jsxs(T,{kind:"ghost",onClick:e,children:[n.jsxs("div",{className:"fa-md fa-layers",children:[n.jsx(E,{mask:Ue,icon:$e,transform:"right-5 down-5"}),n.jsx(E,{icon:$e,transform:"right-8 down-6"})]}),"Import Layout"]}),n.jsx(T,{kind:"ghost",icon:q,onClick:t,tooltip:"Reset Layout"})]})]})}function co({onAutoFillClick:a=()=>{}}){return n.jsxs("div",{className:"empty-dashboard-container",children:[n.jsxs("div",{className:"hint-container",children:[n.jsx(E,{icon:_n})," ",n.jsx("br",{}),"Use the panel list to add objects from a query."]}),n.jsxs("div",{className:"empty-dashboard",children:[n.jsx("div",{className:"add-panels-hint",children:"Drag Panels Here"}),n.jsx(T,{kind:"tertiary",onClick:a,children:"Auto fill objects"})]})]})}const F=G.module("AppMainContainer");class te extends m.Component{constructor(e){super(e);v(this,"dashboardLayouts");v(this,"createDashboardListenerRemovers");v(this,"closeDashboardListenerRemovers");v(this,"importElement");v(this,"widgetListenerRemover");v(this,"getDashboardPlugins",Zt(e=>Jn(e)));ks(this),this.importElement=X.createRef();const{allDashboardData:t}=this.props;this.dashboardLayouts=new Map,this.createDashboardListenerRemovers=new Map,this.closeDashboardListenerRemovers=new Map,this.state={contextActions:[{action:()=>{const{serverConfigValues:o}=this.props,r=Rt(o),i=Object.entries(r).map(([l,c])=>`${l}: ${c}`).join(`
|
|
5
|
-
`);Ps(i)},shortcut:Z.COPY_VERSION_INFO,isGlobal:!0},{action:()=>{this.handleToolSelect(he.LINKER)},shortcut:Z.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:Dt.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{this.sendReopenLast()},shortcut:Z.REOPEN_CLOSED_PANEL,isGlobal:!0},{action:()=>{F.debug("Consume unhandled save shortcut")},shortcut:Z.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isResetLayoutPromptShown:!1,isSettingsMenuShown:!1,unsavedNotebookCount:0,widgets:[],tabs:Object.entries(t).map(([o,r])=>({key:o,title:r.title??"Untitled",isClosable:o!==j,icon:o===j?Mn:void 0})),activeTabKey:j,layoutIteration:0}}static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,t){return Ls.hydrate({...e,unzip:o=>rt.loadAsync(o).then(r=>Object.values(r.files))},t)}static handleRefresh(){F.info("Refreshing application"),window.location.reload()}componentDidMount(){this.initWidgets(),this.initDashboardData(),window.addEventListener("beforeunload",te.handleWindowBeforeUnload)}componentDidUpdate(e,t){const{dashboardData:o}=this.props;e.dashboardData!==o&&this.handleDataChange(o)}componentWillUnmount(){this.deinitWidgets(),this.createDashboardListenerRemovers.forEach(e=>e()),this.closeDashboardListenerRemovers.forEach(e=>e()),window.removeEventListener("beforeunload",te.handleWindowBeforeUnload)}initWidgets(){const{connection:e}=this.props;if(e!=null){if(e.subscribeToFieldUpdates==null){F.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{F.debug("Got updates",t),this.setState(({widgets:o})=>{const{updated:r,created:i,removed:l}=t,c=[...r,...l],d=o.filter(u=>!c.some(p=>p.name===u.name));return[...r,...i].forEach(u=>{u.name!=null&&u.name!==""&&d.push(u)}),{widgets:d}})})}}deinitWidgets(){var e;(e=this.widgetListenerRemover)==null||e.call(this)}initDashboardData(){const{setDashboardPluginData:e,updateDashboardData:t,workspace:o}=this.props,{data:r}=o,{filterSets:i,links:l,pluginDataMap:c}=r;if(t(j,{filterSets:i,links:l}),c!=null){const d=Object.keys(c);for(let h=0;h<d.length;h+=1){const u=d[h],p=c[u];F.debug("initDashboardData plugin data",u,p),e(j,u,p)}}}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:t}=e.params;if(t){const{session:o,sessionConfig:r}=this.props;if(o==null||r==null){F.error("No session available to open notebook URL",t);return}const i={id:`/${t}`,itemName:`/${t}`},l=r.type,c={value:null,language:l};this.emitLayoutEvent(As.SELECT_NOTEBOOK,o,l,c,i,!0)}}sendClearFilter(){this.emitLayoutEvent(re.CLEAR_ALL_FILTERS)}sendReopenLast(){this.emitLayoutEvent(_s.REOPEN_LAST)}getActiveEventHub(){const{activeTabKey:e}=this.state,t=this.dashboardLayouts.get(e);return me(t,"No active layout found"),t.eventHub}emitLayoutEvent(e,...t){this.getActiveEventHub().emit(e,...t)}handleCancelResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1})}handleConfirmResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1}),this.resetLayout()}handleError(e){Y.isCanceled(e)||F.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t){switch(F.debug("handleControlSelect",e),e){case W.DROPDOWN_FILTER:this.emitLayoutEvent(re.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case W.INPUT_FILTER:this.emitLayoutEvent(re.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case W.MARKDOWN:this.emitLayoutEvent(Ms.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case W.FILTER_SET_MANAGER:this.emitLayoutEvent(re.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){F.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:o}=this.props;o(t===e?he.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:t}=this.props,{closed:o,filterSets:r,links:i,pluginDataMap:l}=e;t({closed:o,filterSets:r,links:i,pluginDataMap:l})}handleGoldenLayoutChange(e){var r,i;const{activeTabKey:t}=this.state,o=this.dashboardLayouts.get(t);o!==e&&(this.dashboardLayouts.set(t,e),o!=null&&((r=this.createDashboardListenerRemovers.get(t))==null||r(),(i=this.closeDashboardListenerRemovers.get(t))==null||i()),this.createDashboardListenerRemovers.set(t,Us(e.eventHub,this.handleCreateDashboard)),this.closeDashboardListenerRemovers.set(t,Ks(e.eventHub,this.handleCloseDashboard)))}handleCreateDashboard({pluginId:e,title:t,data:o}){const r=Yt(),{setDashboardPluginData:i}=this.props;i(r,e,o),this.setState(({tabs:l})=>{const c=l.findIndex(({title:d})=>d===t);return c!==-1?{tabs:l.map((d,h)=>h===c?{key:r,title:t}:d),activeTabKey:r}:{tabs:[...l,{key:r,title:t}],activeTabKey:r}})}handleCloseDashboard(e){const{tabs:t}=this.state,o=t.find(r=>r.title===e);o!=null&&this.handleTabClose(o.key)}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,t){this.setState({isPanelsMenuShown:!1}),F.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;F.debug("handleAutoFillClick",e);const t=e.sort((o,r)=>o.title!=null&&r.title!=null?o.title.localeCompare(r.title):0);for(let o=0;o<t.length;o+=1)this.openWidget(t[o])}handleExportLayoutClick(){F.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,o=ye.exportLayout(t);F.info("handleExportLayoutClick exportedConfig",o);const r=new Blob([JSON.stringify(o)],{type:"application/json"}),i=ka.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),l=document.createElement("a");l.href=URL.createObjectURL(r),l.download=`deephaven-app-layout-${i}.json`,l.click()}catch(e){F.error("Unable to export layout",e)}}handleImportLayoutClick(){F.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){F.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1,isResetLayoutPromptShown:!0,unsavedNotebookCount:$s.unsavedNotebookCount()})}handleImportLayoutFiles(e){var t;e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile((t=e.target.files)==null?void 0:t[0])}async importLayoutFile(e){try{const{updateDashboardData:t,updateWorkspaceData:o}=this.props,r=await e.text(),i=JSON.parse(r),{filterSets:l,layoutConfig:c,links:d,pluginDataMap:h}=ye.normalizeLayout(i);o({layoutConfig:c}),t(j,{filterSets:l,links:d,pluginDataMap:h}),this.setState(({layoutIteration:u})=>({layoutIteration:u+1}))}catch(t){F.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:o,layoutConfig:r,links:i}=await ye.getDefaultLayout(e,t!==void 0),{updateDashboardData:l,updateWorkspaceData:c}=this.props;c({layoutConfig:r}),l(j,{filterSets:o,links:i})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:t}=e,o=t.getData("Text"),r=/“|”/g;r.test(o)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,o.replace(r,'"')))}openWidget(e,t){const{connection:o}=this.props;Ws(this.getActiveEventHub(),{widget:Gs(e),dragEvent:t,fetch:async()=>o==null?void 0:o.getObject(e)})}handleHomeClick(){this.handleTabSelect(j)}handleTabSelect(e){this.setState({activeTabKey:e})}handleTabReorder(e,t){this.setState(({tabs:o})=>{const r=[...o],[i]=r.splice(e,1);return r.splice(t,0,i),{tabs:r}})}handleTabClose(e){this.setState(({tabs:t,activeTabKey:o})=>{const r=t.filter(l=>l.key!==e);let i=o;if(o===e&&r.length>0){const l=t.findIndex(c=>c.key===e);i=l<t.length-1?t[l+1].key:t[l-1].key}return r.length===0&&(i=j),{tabs:r,activeTabKey:i}})}getDashboards(){const{layoutIteration:e,tabs:t}=this.state,{allDashboardData:o,workspace:r}=this.props,{data:i}=r,{layoutConfig:l}=i;return[{id:j,layoutConfig:l,key:`${j}-${e}`},...t.filter(c=>c.key!==j).map(c=>{var d;return{id:c.key,layoutConfig:((d=o[c.key])==null?void 0:d.layoutConfig)??Bs,key:`${c.key}-${e}`}})]}render(){const{activeTool:e,plugins:t,user:o,serverConfigValues:r}=this.props,{permissions:i}=o,{canUsePanels:l}=i,{contextActions:c,isPanelsMenuShown:d,isResetLayoutPromptShown:h,isSettingsMenuShown:u,unsavedNotebookCount:p,widgets:C,tabs:S,activeTabKey:b}=this.state,g=this.getDashboardPlugins(t);return n.jsxs("div",{className:I("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[n.jsxs("div",{className:"app-main-top-nav-menus",children:[n.jsx(wt,{className:"ml-1",style:{maxHeight:"20px"}}),S.length>1&&n.jsx("div",{style:{flexShrink:0,flexGrow:1,display:"flex"},children:n.jsx(qn,{tabs:S,activeKey:b,onSelect:this.handleTabSelect,onReorder:this.handleTabReorder,onClose:this.handleTabClose})}),n.jsxs("div",{className:"app-main-right-menu-buttons",children:[n.jsxs(T,{kind:"ghost",className:"btn-panels-menu",icon:Un,onClick:()=>{},children:["Controls",n.jsx(Le,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),l&&n.jsxs(T,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:Kn,children:["Panels",n.jsx(Vs,{isShown:d,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,options:{placement:"bottom"},closeOnBlur:!0,interactive:!0,children:n.jsx(lo,{widgets:C,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),n.jsx(T,{kind:"ghost",className:I("btn-settings-menu",{"text-warning":o.operateAs!=null&&o.operateAs!==o.name}),onClick:this.handleSettingsMenuShow,icon:n.jsx("span",{className:"fa-layers",children:n.jsx(E,{icon:$n,transform:"grow-3"})}),tooltip:"User Settings"})]})]}),n.jsx(zn,{dashboards:this.getDashboards(),activeDashboard:b,onGoldenLayoutChange:this.handleGoldenLayoutChange,emptyDashboard:b===j?n.jsx(co,{onAutoFillClick:this.handleAutoFillClick}):n.jsx(Ct,{}),plugins:[n.jsx(Hs,{hydrateConsole:te.hydrateConsole,notebooksUrl:new URL("notebooks/",document.baseURI).href},"ConsolePlugin"),...g]}),n.jsx(ia,{in:u,mountOnEnter:!0,unmountOnExit:!0,children:n.jsx(Ie,{serverConfigValues:r,pluginData:t,onDone:this.handleSettingsMenuHide,user:o})}),n.jsx(Ys,{actions:c}),n.jsx("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles,"data-testid":"input-import-layout"}),n.jsx(Zs,{confirmButtonText:"Reset",onConfirm:this.handleConfirmResetLayoutPrompt,onCancel:this.handleCancelResetLayoutPrompt,isConfirmDanger:!0,isOpen:h,headerText:p===0?"Reset Layout":"Reset layout and discard unsaved changes",bodyText:p===0?"Do you want to reset your layout? Your existing layout will be lost.":"Do you want to reset your layout? Any unsaved notebooks will be lost."})]})}}const uo=a=>{var s,e;return{activeTool:Es(a),allDashboardData:Ns(a),dashboardData:Fs(a,j),layoutStorage:ro(a),plugins:Rs(a),connection:Is(a,j),session:(s=Me(a,j))==null?void 0:s.session,sessionConfig:(e=Me(a,j))==null?void 0:e.config,user:Os(a),workspace:xt(a),serverConfigValues:io(a)}},ho=pe(uo,{setActiveTool:St,setDashboardData:yt,setDashboardPluginData:ws,updateDashboardData:Ds,updateWorkspaceData:js})(Ht(te));function mo(){return n.jsxs("div",{className:"app",children:[n.jsx(ho,{}),n.jsx(Xn,{})]})}const po=G.module("AppInit");function ot(){const a=ut(),s=Qn(),e=ea(),t=qs(),o=ta(),r=sa(),i=qt(xt),l=ge(),[c,d]=m.useState();m.useEffect(function(){l(zs(t))},[t,l]),m.useEffect(function(){async function S(){try{const b=await na(),g=await aa(a,e,b),w=s.getStorageService(),k=new oa(w,"/layouts"),D=new ra(a,w,"/notebooks"),f=new We(k),y=new Oa,K=await f.load({isConsoleAvailable:g!==void 0}),{data:fe}=K,{settings:kt}=fe,{shortcutOverrides:ke={}}=kt,Pt=A.isMacPlatform?ke.mac??{}:ke.windows??{};Object.entries(Pt).forEach(([_t,Mt])=>{var Pe;(Pe=Oe.get(_t))==null||Pe.setKeyState(Mt)});const At={title:"Code Studio",filterSets:fe.filterSets,links:fe.links};l(Js(a)),l(St(he.DEFAULT)),l(Xs(o)),l(Qs(y)),l(yt(j,At)),l(en(D)),l(La(k)),l(tn(j,e)),g!==void 0&&l(sn(j,g)),l(nn(r)),l(an(f)),l(on(K)),l(rn(We.makeDefaultWorkspaceSettings(o)))}catch(b){po.error(b),d(b)}}S()},[a,s,e,o,l,r]);const h=i==null&&c==null,u=!h&&c==null,p=c!=null?`${c}`:null;return n.jsxs(n.Fragment,{children:[u&&n.jsx(mo,{}),n.jsx(Ct,{isLoading:h&&p==null,isLoaded:u,errorMessage:p})]})}const go=X.lazy(()=>Qt(()=>import("./StyleGuideRoot-hYMuFiP4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url)),fo=new URL(document.baseURI).pathname.replace(/\/$/,"");function bo(){return n.jsx(zt,{basename:fo,children:n.jsxs(Jt,{children:[n.jsx(ve,{exact:!0,path:"/",component:ot}),n.jsx(ve,{path:"/notebooks/:notebookPath+",component:ot}),n.jsx(ve,{path:"/styleguide",component:go}),n.jsx(Xt,{from:"*",to:"/"})]})})}function No(){return la.register(new URL("./download/serviceWorker.js",window.location.href)),ln.init({getWorker:(a,s)=>s==="json"?new es:new ts}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,n.jsx(bo,{})}export{No as AppRoot,No as default};
|
|
6
|
-
//# sourceMappingURL=AppRoot-BWBuXpUc.js.map
|