@deephaven/embed-widget 0.57.1-beta.0 → 0.57.2-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/{App-cb2735fe.js → App-2862ea4c.js} +2 -2
- package/build/assets/{App-cb2735fe.js.map → App-2862ea4c.js.map} +1 -1
- package/build/assets/{IrisGridModelFactory-b3123b28.js → IrisGridModelFactory-ebba69c7.js} +2 -2
- package/build/assets/{IrisGridModelFactory-b3123b28.js.map → IrisGridModelFactory-ebba69c7.js.map} +1 -1
- package/build/assets/{WidgetView-9b760a72.js → WidgetView-d39ed7b1.js} +2 -2
- package/build/assets/{WidgetView-9b760a72.js.map → WidgetView-d39ed7b1.js.map} +1 -1
- package/build/assets/index-aa3c826a.css +1 -0
- package/build/assets/{index-5163d963.js → index-b91e2a25.js} +3 -3
- package/build/assets/{index-5163d963.js.map → index-b91e2a25.js.map} +1 -1
- package/build/assets/{index-04385a8f.js → index-d90faf82.js} +2 -2
- package/build/assets/{index-04385a8f.js.map → index-d90faf82.js.map} +1 -1
- package/build/assets/index-dd488dc3.css +6 -0
- package/build/assets/{index-0f342bf3.js → index-e0f9eee6.js} +2 -2
- package/build/assets/{index-0f342bf3.js.map → index-e0f9eee6.js.map} +1 -1
- package/build/assets/{usePlugins-51bc337a.js → usePlugins-480ce5cc.js} +2 -2
- package/build/assets/{usePlugins-51bc337a.js.map → usePlugins-480ce5cc.js.map} +1 -1
- package/build/index.html +3 -3
- package/package.json +15 -15
- package/build/assets/index-03463bb3.css +0 -6
- package/build/assets/index-5b1139be.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ab as sr,ac as ul,ad as hl,ae as cl,af as vl,C as d,F as J,r as p,ag as or,ah as pl,V as _,E as X,ai as Gn,G as Z,aj as Sn,ak as Ls,a4 as te,al as En,a3 as Ds,K as Je,U as Et,R as Ms,am as zi,an as Ke,D as qi,L as $e,ao as xs,ap as ml,aq as Fs,X as Bn}from"./vendor-dc320d30.js";import{bL as lr,$ as $t,T as Is,B as k,N as Fe,w as se,K as re,bM as fl,b6 as Be,G as Mn,o as Q,bN as qe,bO as Rs,H as qt,C as gl,e as Kt,S as ks,bP as Tt,i as wt,bQ as js,bR as As,I as Yi,X as bl,aG as ci,u as Cl,aE as Sl,P as El,aH as M,aK as oe,p as yl,aR as _s,a_ as ot,b5 as Ot,l as Ar,Q as $s,aF as _r,ax as Us,bx as je,ay as Hs,a$ as Vs,aL as Pl,m as dr,ab as Ae,a7 as $r,a2 as Gs,a6 as Ur,bS as yn,R as Hr,j as xn,z as Bs,r as wl,E as Tl,F as Vr,ba as Ol,bI as Ri,bp as mt,b9 as vi,aP as Nl,bs as Ll,aZ as Dl,az as Pn,aV as nn,aJ as me,bT as Ml,aQ as xl,aI as dn,bq as ur,bU as Fl,bV as Il,bW as Rl,bX as mn,a3 as kl,aX as jl,b0 as Al,aW as _l}from"./IrisGridModelFactory-b3123b28.js";import{L as z,J as $l,K as Ws,O as hr,P as cr,k as Ks,g as Ul,e as I,Q as Wt,R as Hl,U as Gr,V as Vl,X as Gl,Y as Bl,Z as Wl,v as kn,_ as vr,$ as zs,c as wn,a as pr,a0 as Xi,a1 as Kl,a2 as zl,a3 as Br,a4 as ri,a5 as Wr,a6 as qs,a7 as ql,a8 as pi,a9 as Yl,T as Zi,aa as Xl,ab as Zl,ac as Ql,ad as Jl,ae as ed,M as Ys,l as Xs,b as Zs,af as td,ag as Qs,ah as nd,ai as Js,aj as eo,ak as Kr,al as id,am as rd,an as ad,ao as sd,ap as od,aq as ld,ar as dd}from"./index-5163d963.js";import{P as ge,t as ud,r as zr,g as hd,C as cd,u as vd,e as Nt,s as to,o as pd,n as md,q as fd}from"./usePlugins-51bc337a.js";import"./helpers-042e6b4d.js";import"./plotly-919eb32a.js";function qr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function gd(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(t),!0).forEach(function(n){bd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function bd(i,e,t){return e=Cd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Cd(i){var e=Sd(i,"string");return typeof e=="symbol"?e:String(e)}function Sd(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ed=Object.freeze({}),yd=new Map,no=i=>i.api,Pd=i=>i.user,io=i=>i.storage,ro=i=>io(i).commandHistoryStorage,ao=i=>io(i).fileStorage,wd=i=>i.defaultWorkspaceSettings,so=i=>{var{workspace:e}=i;return e},jn=i=>{for(var e=so(i).data.settings,t=gd({},wd(i)),n=Object.keys(e),r=0;r<n.length;r+=1){var a=n[r];e[a]!==void 0&&(t[a]=e[a])}return t},mr=i=>jn(i).timeZone,Td=i=>{var e;return(e=jn(i).defaultNotebookSettings)!==null&&e!==void 0?e:Ed},fr=i=>i.activeTool,Od=i=>{var e;return(e=i.plugins)!==null&&e!==void 0?e:yd},oo="SET_ACTIVE_TOOL",Nd="SET_API",Ld="SET_COMMAND_HISTORY_STORAGE",Dd="SET_FILE_STORAGE",Md="SET_PLUGINS",xd="SET_USER",lo="SET_WORKSPACE",Fd="SET_DEFAULT_WORKSPACE_SETTINGS",Id="SET_WORKSPACE_STORAGE",Rd="SET_SERVER_CONFIG_VALUES";function Yr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function xt(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(t),!0).forEach(function(n){kd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function kd(i,e,t){return e=jd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function jd(i){var e=Ad(i,"string");return typeof e=="symbol"?e:String(e)}function Ad(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var _d=i=>({type:lo,payload:i}),$d=i=>(e,t)=>{e(_d(i));var{storage:n}=t(),{workspaceStorage:r}=n;return r.save(i)},Ud=i=>(e,t)=>{var{workspace:n}=t(),{data:r}=n,a=xt(xt({},n),{},{data:xt(xt(xt({},r),i),{},{settings:xt(xt({},r.settings),i.settings)})});return e($d(a))},Hd=i=>e=>e(Ud({settings:i})),uo=i=>({type:oo,payload:i});function Xr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ki(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(t),!0).forEach(function(n){Vd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Vd(i,e,t){return e=Gd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gd(i){var e=Bd(i,"string");return typeof e=="symbol"?e:String(e)}function Bd(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ho(i,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case i:{var r=n.payload;return r==null?null:t!=null?ki(ki({},t),r):ki({},r)}default:return t}}}function Lt(i,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case i:return n.payload;default:return t}}}const Wd=Lt(Nd,null),Kd=Lt(oo,null),zd=Lt(Md,null),qd=Lt(Ld,null),Yd=Lt(Dd,null),Xd=Lt(Id,null),Zd=sr({commandHistoryStorage:qd,fileStorage:Yd,workspaceStorage:Xd}),Qd=ho(xd,null),Jd=ho(lo,null),eu=Lt(Fd,null),tu=Lt(Rd,null);var nu={activeTool:Kd,api:Wd,plugins:zd,storage:Zd,user:Qd,workspace:Jd,defaultWorkspaceSettings:eu,serverConfigValues:tu};const iu=nu;var Zr=z.module("redux-logger"),ru=i=>e=>t=>{Zr.debug("dispatching",t);var n=e(t);return Zr.debug("next state",i.getState()),n};const au=ru;var su=z.module("redux-crashReporter"),ou=i=>e=>t=>{try{return e(t)}catch(n){throw su.error("Error executing",t," with state ",i.getState(),":",n),n}};const lu=ou,du=[au,lu,ul];var ji;Object.entries(iu).map(i=>{var[e,t]=i;return lr.register(e,t)});var uu=(ji=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&ji!==void 0?ji:vl,co=hl(sr(lr.reducers),uu(cl(...du)));lr.setListener(i=>{co.replaceReducer(sr(i))});const hu=co;function cu(i){var{type:e}=i,t=$t();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:return d.jsx(J,{icon:cr});case t.VariableType.FIGURE:return d.jsx(J,{icon:hr});case t.VariableType.PANDAS:return d.jsx(J,{icon:Ws});default:return d.jsx(J,{icon:$l})}}function vu(i,e,t){return e=pu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pu(i){var e=mu(i,"string");return typeof e=="symbol"?e:String(e)}function mu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class fu extends p.Component{constructor(e){super(e),vu(this,"container",void 0),this.container=null}componentDidMount(){this.colorize()}colorize(){var{children:e}=this.props;this.container&&e!=null&&or.colorizeElement(this.container,{theme:"dh-dark"})}render(){var{children:e,language:t}=this.props;return d.jsx("div",{children:d.jsx("div",{"data-lang":t,ref:n=>{this.container=n},style:{pointerEvents:"none"},children:e})})}}const mi=fu;class gu{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const vo=gu;class ai{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)?[]:pl.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"),n="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),a="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(n,":").concat(r,".").concat(a)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return ai.isTableType(e,t)||ai.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}const Qi=ai;function po(i){var{children:e}=i;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})]})}po.propTypes={children:_.node.isRequired};function Ji(i,e,t){return e=bu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function bu(i){var e=Cu(i,"string");return typeof e=="symbol"?e:String(e)}function Cu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class mo extends p.Component{constructor(e){super(e),Ji(this,"timer",void 0),Ji(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:n}=this.state;return d.jsx("div",{className:X("console-history-result-in-progress",{disabled:e}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Ks,{className:"ml-2"}),"Running... ",Is.formatElapsedTime(n)," ",d.jsx(k,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ul,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Ji(mo,"defaultProps",{disabled:!1});const Su=mo;function Tn(i,e,t){return e=Eu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Eu(i){var e=yu(i,"string");return typeof e=="symbol"?e:String(e)}function yu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Yt extends p.PureComponent{constructor(e){super(e),Tn(this,"mouseX",void 0),Tn(this,"mouseY",void 0),Tn(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)>=Yt.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Yt.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{isExpanded:e,isTriggerHovered:t}=this.state,{message:n}=this.props;I(n);var r=n.indexOf(`
|
|
1
|
+
import{ab as sr,ac as ul,ad as hl,ae as cl,af as vl,C as d,F as J,r as p,ag as or,ah as pl,V as _,E as X,ai as Gn,G as Z,aj as Sn,ak as Ls,a4 as te,al as En,a3 as Ds,K as Je,U as Et,R as Ms,am as zi,an as Ke,D as qi,L as $e,ao as xs,ap as ml,aq as Fs,X as Bn}from"./vendor-dc320d30.js";import{bL as lr,$ as $t,T as Is,B as k,N as Fe,w as se,K as re,bM as fl,b6 as Be,G as Mn,o as Q,bN as qe,bO as Rs,H as qt,C as gl,e as Kt,S as ks,bP as Tt,i as wt,bQ as js,bR as As,I as Yi,X as bl,aG as ci,u as Cl,aE as Sl,P as El,aH as M,aK as oe,p as yl,aR as _s,a_ as ot,b5 as Ot,l as Ar,Q as $s,aF as _r,ax as Us,bx as je,ay as Hs,a$ as Vs,aL as Pl,m as dr,ab as Ae,a7 as $r,a2 as Gs,a6 as Ur,bS as yn,R as Hr,j as xn,z as Bs,r as wl,E as Tl,F as Vr,ba as Ol,bI as Ri,bp as mt,b9 as vi,aP as Nl,bs as Ll,aZ as Dl,az as Pn,aV as nn,aJ as me,bT as Ml,aQ as xl,aI as dn,bq as ur,bU as Fl,bV as Il,bW as Rl,bX as mn,a3 as kl,aX as jl,b0 as Al,aW as _l}from"./IrisGridModelFactory-ebba69c7.js";import{L as z,J as $l,K as Ws,O as hr,P as cr,k as Ks,g as Ul,e as I,Q as Wt,R as Hl,U as Gr,V as Vl,X as Gl,Y as Bl,Z as Wl,v as kn,_ as vr,$ as zs,c as wn,a as pr,a0 as Xi,a1 as Kl,a2 as zl,a3 as Br,a4 as ri,a5 as Wr,a6 as qs,a7 as ql,a8 as pi,a9 as Yl,T as Zi,aa as Xl,ab as Zl,ac as Ql,ad as Jl,ae as ed,M as Ys,l as Xs,b as Zs,af as td,ag as Qs,ah as nd,ai as Js,aj as eo,ak as Kr,al as id,am as rd,an as ad,ao as sd,ap as od,aq as ld,ar as dd}from"./index-b91e2a25.js";import{P as ge,t as ud,r as zr,g as hd,C as cd,u as vd,e as Nt,s as to,o as pd,n as md,q as fd}from"./usePlugins-480ce5cc.js";import"./helpers-042e6b4d.js";import"./plotly-919eb32a.js";function qr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function gd(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(t),!0).forEach(function(n){bd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function bd(i,e,t){return e=Cd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Cd(i){var e=Sd(i,"string");return typeof e=="symbol"?e:String(e)}function Sd(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ed=Object.freeze({}),yd=new Map,no=i=>i.api,Pd=i=>i.user,io=i=>i.storage,ro=i=>io(i).commandHistoryStorage,ao=i=>io(i).fileStorage,wd=i=>i.defaultWorkspaceSettings,so=i=>{var{workspace:e}=i;return e},jn=i=>{for(var e=so(i).data.settings,t=gd({},wd(i)),n=Object.keys(e),r=0;r<n.length;r+=1){var a=n[r];e[a]!==void 0&&(t[a]=e[a])}return t},mr=i=>jn(i).timeZone,Td=i=>{var e;return(e=jn(i).defaultNotebookSettings)!==null&&e!==void 0?e:Ed},fr=i=>i.activeTool,Od=i=>{var e;return(e=i.plugins)!==null&&e!==void 0?e:yd},oo="SET_ACTIVE_TOOL",Nd="SET_API",Ld="SET_COMMAND_HISTORY_STORAGE",Dd="SET_FILE_STORAGE",Md="SET_PLUGINS",xd="SET_USER",lo="SET_WORKSPACE",Fd="SET_DEFAULT_WORKSPACE_SETTINGS",Id="SET_WORKSPACE_STORAGE",Rd="SET_SERVER_CONFIG_VALUES";function Yr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function xt(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(t),!0).forEach(function(n){kd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function kd(i,e,t){return e=jd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function jd(i){var e=Ad(i,"string");return typeof e=="symbol"?e:String(e)}function Ad(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var _d=i=>({type:lo,payload:i}),$d=i=>(e,t)=>{e(_d(i));var{storage:n}=t(),{workspaceStorage:r}=n;return r.save(i)},Ud=i=>(e,t)=>{var{workspace:n}=t(),{data:r}=n,a=xt(xt({},n),{},{data:xt(xt(xt({},r),i),{},{settings:xt(xt({},r.settings),i.settings)})});return e($d(a))},Hd=i=>e=>e(Ud({settings:i})),uo=i=>({type:oo,payload:i});function Xr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ki(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(t),!0).forEach(function(n){Vd(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Vd(i,e,t){return e=Gd(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gd(i){var e=Bd(i,"string");return typeof e=="symbol"?e:String(e)}function Bd(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ho(i,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case i:{var r=n.payload;return r==null?null:t!=null?ki(ki({},t),r):ki({},r)}default:return t}}}function Lt(i,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case i:return n.payload;default:return t}}}const Wd=Lt(Nd,null),Kd=Lt(oo,null),zd=Lt(Md,null),qd=Lt(Ld,null),Yd=Lt(Dd,null),Xd=Lt(Id,null),Zd=sr({commandHistoryStorage:qd,fileStorage:Yd,workspaceStorage:Xd}),Qd=ho(xd,null),Jd=ho(lo,null),eu=Lt(Fd,null),tu=Lt(Rd,null);var nu={activeTool:Kd,api:Wd,plugins:zd,storage:Zd,user:Qd,workspace:Jd,defaultWorkspaceSettings:eu,serverConfigValues:tu};const iu=nu;var Zr=z.module("redux-logger"),ru=i=>e=>t=>{Zr.debug("dispatching",t);var n=e(t);return Zr.debug("next state",i.getState()),n};const au=ru;var su=z.module("redux-crashReporter"),ou=i=>e=>t=>{try{return e(t)}catch(n){throw su.error("Error executing",t," with state ",i.getState(),":",n),n}};const lu=ou,du=[au,lu,ul];var ji;Object.entries(iu).map(i=>{var[e,t]=i;return lr.register(e,t)});var uu=(ji=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&ji!==void 0?ji:vl,co=hl(sr(lr.reducers),uu(cl(...du)));lr.setListener(i=>{co.replaceReducer(sr(i))});const hu=co;function cu(i){var{type:e}=i,t=$t();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:return d.jsx(J,{icon:cr});case t.VariableType.FIGURE:return d.jsx(J,{icon:hr});case t.VariableType.PANDAS:return d.jsx(J,{icon:Ws});default:return d.jsx(J,{icon:$l})}}function vu(i,e,t){return e=pu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pu(i){var e=mu(i,"string");return typeof e=="symbol"?e:String(e)}function mu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class fu extends p.Component{constructor(e){super(e),vu(this,"container",void 0),this.container=null}componentDidMount(){this.colorize()}colorize(){var{children:e}=this.props;this.container&&e!=null&&or.colorizeElement(this.container,{theme:"dh-dark"})}render(){var{children:e,language:t}=this.props;return d.jsx("div",{children:d.jsx("div",{"data-lang":t,ref:n=>{this.container=n},style:{pointerEvents:"none"},children:e})})}}const mi=fu;class gu{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const vo=gu;class ai{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)?[]:pl.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"),n="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),a="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(n,":").concat(r,".").concat(a)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return ai.isTableType(e,t)||ai.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}const Qi=ai;function po(i){var{children:e}=i;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})]})}po.propTypes={children:_.node.isRequired};function Ji(i,e,t){return e=bu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function bu(i){var e=Cu(i,"string");return typeof e=="symbol"?e:String(e)}function Cu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class mo extends p.Component{constructor(e){super(e),Ji(this,"timer",void 0),Ji(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:n}=this.state;return d.jsx("div",{className:X("console-history-result-in-progress",{disabled:e}),children:d.jsxs("span",{className:"badge",children:[d.jsx(Ks,{className:"ml-2"}),"Running... ",Is.formatElapsedTime(n)," ",d.jsx(k,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ul,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Ji(mo,"defaultProps",{disabled:!1});const Su=mo;function Tn(i,e,t){return e=Eu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Eu(i){var e=yu(i,"string");return typeof e=="symbol"?e:String(e)}function yu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Yt extends p.PureComponent{constructor(e){super(e),Tn(this,"mouseX",void 0),Tn(this,"mouseY",void 0),Tn(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)>=Yt.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Yt.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{isExpanded:e,isTriggerHovered:t}=this.state,{message:n}=this.props;I(n);var r=n.indexOf(`
|
|
2
2
|
`),a=r>-1,s=n;a&&(s=n.slice(0,r));var o=n.slice(r),l=t?"error-btn-link error-btn-link--active":"error-btn-link";return d.jsxs("div",{className:X("error-message",{expanded:e}),children:[a&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"error-gutter",children:d.jsx("button",{type:"button",onClick:this.handleToggleError,className:l,tabIndex:-1,children:d.jsx(J,{icon:e?Wt:Hl,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:s}),e?o:""]})]}),!a&&d.jsx("div",{className:"error-content",children:d.jsx("div",{className:"console-error-text",children:s})})]},"error")}}Tn(Yt,"defaultProps",{message:""});Tn(Yt,"mouseDragThreshold",5);const Pu=Yt;function wu(i,e,t){return e=Tu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Tu(i){var e=Ou(i,"string");return typeof e=="symbol"?e:String(e)}function Ou(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Qr=z.module("ConsoleHistoryItem");class fo extends p.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Qr.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(Qr.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:n,iconForType:r}=this.props,{disabledObjects:a,result:s}=t,o=t.command!=null&&t.command!=="",l=null;o&&(l=d.jsxs("div",{className:"console-history-item-command",children:[d.jsx("div",{className:"console-history-gutter",children:">"}),d.jsx("div",{className:"console-history-content",children:d.jsx(mi,{language:n,children:t.command})})]}));var u=[],h=!1;if(s){var{error:c,message:v,changes:m}=s;if(m){var{created:b,updated:g}=m;[...b,...g].forEach(x=>{h=!0;var{title:L}=x,F="".concat(L),N=e===void 0||e||(a??[]).indexOf(F)>=0,$=d.jsx(k,{kind:"primary",onClick:()=>this.handleObjectClick(x),className:"btn-console-object",disabled:N,icon:r(x.type),children:L},F);u.push($)})}if(c!=null&&!o){var f,C="".concat((f=c.message)!==null&&f!==void 0?f:c);C||(C=c);var E=d.jsx(Pu,{message:C},"result-error");u.push(E)}if(v!==void 0&&v!==""){var S=d.jsx("div",{className:"log-message",children:v},"log-message");u.push(S)}}else{h=!0;var y=d.jsx(Su,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");u.push(y)}var O=null;return u.length>0&&(O=d.jsx(po,{children:u})),d.jsxs("div",{className:X("console-command-result",{"console-result-buttons":h}),children:[l,O]})}}wu(fo,"defaultProps",{disabled:!1});const Nu=fo;function Lu(i,e){return"".concat(i,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}function Du(i){for(var{disabled:e=!1,items:t,language:n,openObject:r,supportsType:a,iconForType:s}=i,o=[],l=0;l<t.length;l+=1){var u=t[l],h=d.jsx(Nu,{disabled:e,item:u,openObject:r,language:n,supportsType:a,iconForType:s},Lu(l,u));o.push(h)}return d.jsx("div",{className:"container-fluid console-history",children:o})}var Mu={name:"Console",CLEAR:Fe.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[se.CTRL,re.L],macShortcut:[se.CTRL,re.C]}),FOCUS_HISTORY:Fe.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[se.CTRL,re.H],macShortcut:[se.CTRL,se.OPTION,re.H]})},xu={name:"Command History",FOCUS_HISTORY:Fe.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[se.CTRL,re.H],macShortcut:[se.CTRL,se.OPTION,re.H]}),SEND_TO_CONSOLE:Fe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[re.ENTER],macShortcut:[re.ENTER]}),SEND_TO_NOTEBOOK:Fe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[se.CTRL,re.ENTER],macShortcut:[se.CMD,re.ENTER]}),RUN:Fe.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[se.ALT,re.R],macShortcut:[se.OPTION,re.R]})},Fu={name:"Notebook",RUN:Fe.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[se.ALT,re.R],macShortcut:[se.OPTION,re.R]}),RUN_SELECTED:Fe.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[se.ALT,se.SHIFT,re.R],macShortcut:[se.OPTION,se.SHIFT,re.R]}),FIND:Fe.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[se.CTRL,re.F],macShortcut:[se.CMD,re.F],isEditable:!1}),MINIMAP:Fe.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[se.ALT,re.M],macShortcut:[se.OPTION,re.M]}),WORDWRAP:Fe.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[se.ALT,re.Z],macShortcut:[se.OPTION,re.Z]})},Iu={CONSOLE:Mu,COMMAND_HISTORY:xu,NOTEBOOK:Fu};const xe=Iu,Pe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"});function Ai(i,e,t){return e=Ru(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ru(i){var e=ku(i,"string");return typeof e=="symbol"?e:String(e)}function ku(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var dt=z.module("MonacoCompletionProvider");class kt extends p.PureComponent{static lspToMonacoKind(e){var t=Gn.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{start:t,end:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}constructor(e){super(e),Ai(this,"registeredCompletionProvider",void 0),Ai(this,"registeredSignatureProvider",void 0),Ai(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var{language:e,session:t}=this.props;this.registeredCompletionProvider=Gn.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp&&(this.registeredSignatureProvider=Gn.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover&&(this.registeredHoverProvider=Gn.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,n;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(n=this.registeredHoverProvider)===null||n===void 0||n.dispose()}handleCompletionRequest(e,t,n){var{model:r,session:a}=this.props;if(e!==r)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:kt.monacoToLspPosition(t),context:n},o=a.getCompletionItems(s);dt.debug("Requested completion items",s);var l=o.then(u=>{dt.debug("Completion items received: ",s,u);var h=u.map(c=>{var{label:v,kind:m,detail:b,documentation:g,sortText:f,filterText:C,textEdit:E,insertTextFormat:S}=c;return{label:v,kind:kt.lspToMonacoKind(m),detail:b,documentation:(g==null?void 0:g.kind)==="markdown"?g:g==null?void 0:g.value,sortText:f,filterText:C,insertText:E.text,insertTextRules:S===2?4:S,range:kt.lspToMonacoRange(E.range)}});return{incomplete:!0,suggestions:h}}).catch(u=>(dt.error("There was an error retrieving completion items",u),{suggestions:[]}));return l}handleSignatureRequest(e,t,n,r){var a={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:s,session:o}=this.props;if(e!==s||!o.getSignatureHelp)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:kt.monacoToLspPosition(t),context:r},u=o.getSignatureHelp(l);dt.debug("Requested signature help",l);var h=u.then(c=>{dt.debug("Signatures received: ",l,u);var v=c.map(b=>{var{label:g,documentation:f,parameters:C}=b;return{documentation:(f==null?void 0:f.kind)==="markdown"?f:f==null?void 0:f.value,label:g,parameters:C??[]}});if(v.length===0)return a;var m=0;return{value:{signatures:v,activeSignature:m,activeParameter:c[m].activeParameter},dispose:()=>{}}}).catch(c=>(dt.error("There was an error retrieving completion items",c),a));return h}handleHoverRequest(e,t){var{model:n,session:r}=this.props;if(e!==n||!r.getHover)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:kt.monacoToLspPosition(t)},s=r.getHover(a);dt.debug("Requested hover",a);var o=s.then(l=>{dt.debug("Hover received: ",a,l);var{contents:u}=l;return{contents:u?[u]:[]}}).catch(l=>(dt.error("There was an error retrieving hover",l),{contents:[]}));return o}render(){return null}}const go=kt;function Jr(i,e,t,n,r,a,s){try{var o=i[a](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,r)}function ju(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var a=i.apply(e,t);function s(l){Jr(a,n,r,s,o,"next",l)}function o(l){Jr(a,n,r,s,o,"throw",l)}s(void 0)})}}function Ve(i,e,t){return e=Au(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Au(i){var e=_u(i,"string");return typeof e=="symbol"?e:String(e)}function _u(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var _i=z.module("ConsoleInput"),si=parseInt(fl["line-height"],10),bo=6,Co=6,$u=si+bo+Co,$i=100;class An extends p.PureComponent{constructor(e){super(e),Ve(this,"cancelListener",void 0),Ve(this,"commandContainer",void 0),Ve(this,"commandEditor",void 0),Ve(this,"commandHistoryIndex",void 0),Ve(this,"commandSuggestionContainer",void 0),Ve(this,"loadingPromise",void 0),Ve(this,"timestamp",void 0),Ve(this,"bufferIndex",void 0),Ve(this,"history",void 0),Ve(this,"modifiedCommands",void 0),this.handleWindowResize=this.handleWindowResize.bind(this),this.commandContainer=Z.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.state={commandEditorHeight:si,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),window.addEventListener("resize",this.handleWindowResize),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(_i.debug("Command received: ",e),!n){var r;this.commandHistoryIndex=null,(r=this.commandEditor)===null||r===void 0||r.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:si,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:bo,bottom:Co},value:"",wordWrap:"on"},r=this.commandContainer.current;I(r),this.commandEditor=or.create(r,n),Be.setEOL(this.commandEditor),Be.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var a,s=(a=this.commandEditor)===null||a===void 0?void 0:a.getValue();this.modifiedCommands.set(this.commandHistoryIndex,s??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(a=>{var{commandEditor:s,commandHistoryIndex:o}=this,l=s==null?void 0:s.getPosition();I(l);var{lineNumber:u}=l,h=s==null?void 0:s.getModel();if(a.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&u===1){o!=null?this.loadCommand(o+1):this.loadCommand(0),this.focusStart(),a.stopPropagation(),a.preventDefault();return}if(a.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&u===(h==null?void 0:h.getLineCount())){o!=null&&o>0?this.loadCommand(o-1):this.loadCommand(null),this.focusEnd(),a.stopPropagation(),a.preventDefault();return}if(!a.altKey&&!a.shiftKey&&!a.metaKey&&a.keyCode===Sn.Enter&&!this.isSuggestionMenuPopulated()){var c;a.stopPropagation(),a.preventDefault();var v=(c=this.commandEditor)===null||c===void 0?void 0:c.getValue().trim();if(v!==void 0){var m;this.processCommand(v),(m=this.commandEditor)===null||m===void 0||m.setValue("")}}}),Be.disableKeyBindings(this.commandEditor,[Ls.CtrlCmd|Sn.KeyF]),Be.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(Be.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleWindowResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,n;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(n=t.getDomNode())===null||n===void 0?void 0:n.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,n;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(n=t.querySelector(".monaco-list-rows"))===null||n===void 0?void 0:n.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,n,r,a,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();I(s);var o=s.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,o);I(l),(n=this.commandEditor)===null||n===void 0||n.setPosition({lineNumber:1,column:o}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(l),(a=this.commandEditor)===null||a===void 0||a.focus()}focusEnd(){var e,t,n,r,a,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();I(s);var o=s.getLineCount(),l=s.getLineLength(o)+1,u=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(o,l);I(u),(n=this.commandEditor)===null||n===void 0||n.setPosition({lineNumber:o,column:l}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(u),(a=this.commandEditor)===null||a===void 0||a.focus()}clear(){var e,t,n;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(n=t.getModel())===null||n===void 0||n.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,n;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),a=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(n=t.getModel())===null||n===void 0||n.setValue(r??a),e!==null&&e>this.history.length-$i&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return ju(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:n,scope:r}=e.props;e.loadingPromise=ge.makeCancelable(t.getTable(n,r??"",e.timestamp),o=>o.close());var a=yield e.loadingPromise;a.setReversed(!0),a.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+$i-1}),e.loadingPromise=ge.makeCancelable(a.getViewportData(),()=>a.close());var s=yield e.loadingPromise;e.bufferIndex+=$i,e.bufferIndex>=a.size&&(e.bufferIndex=null),e.history=[...s.items.filter((o,l,u)=>{var{name:h}=o;return l===0||h!==u[l-1].name}).map(o=>{var{name:l}=o;return l}).reverse(),...e.history],e.loadingPromise=void 0,a.close()}catch(o){if(e.loadingPromise=void 0,ge.isCanceled(o)){_i.debug2("Promise canceled, not loading history");return}_i.error("Error fetching history",o)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),I(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var{onSubmit:t}=this.props;t(e)}updateDimensions(){if(this.commandEditor){var{maxHeight:e}=this.props;I(e);var t=this.commandEditor.getContentHeight(),n=Math.max(Math.min(t,e),$u),r=t>n,a={overviewRulerLanes:r?void 0:0};this.setState({commandEditorHeight:n},()=>{var s,o;(s=this.commandEditor)===null||s===void 0||s.updateOptions(a),(o=this.commandEditor)===null||o===void 0||o.layout()})}}render(){var{disabled:e,language:t,session:n}=this.props,{commandEditorHeight:r,isFocused:a,model:s}=this.state;return d.jsx("div",{className:X("console-input-wrapper",{disabled:e}),children:d.jsxs("div",{className:X("console-input-inner-wrapper",{focus:a}),children:[d.jsx("div",{className:An.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:r}}),s&&d.jsx(go,{model:s,language:t,session:n})]})})}}Ve(An,"defaultProps",{maxHeight:si*10,scope:null,disabled:!1});Ve(An,"INPUT_CLASS_NAME","console-input");const ea=An;function yt(i,e,t){return e=Uu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Uu(i){var e=Hu(i,"string");return typeof e=="symbol"?e:String(e)}function Hu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var ta="pasted values",Vu=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Ui=[".csv",".tsv",".tab",".psv",".dsv",".txt"],na=[".zip"];class st extends p.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!Vu.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ui.some(n=>e.endsWith(n))||t&&na.some(n=>e.endsWith(n))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===ta?Gr:e.endsWith(".csv")?Vl:e.endsWith(".zip")?Gl:Bl}constructor(e){super(e),yt(this,"fileElem",void 0),yt(this,"divElem",void 0),yt(this,"getValidExtensions",te(t=>t?[...Ui,...na]:[...Ui])),yt(this,"getAcceptString",te(t=>this.getValidExtensions(t).join(", "))),yt(this,"getFileTypeErrorString",te(t=>qe.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=Z.createRef(),this.divElem=Z.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{files:t}=e.target;t!=null&&this.handleFile(t[0])}handleDrop(e){var{allowZip:t,clearDragError:n,dragError:r}=this.props;if(e.preventDefault(),e.stopPropagation(),r!=null){n();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var a=e.dataTransfer.items[0].getAsFile();I(a),st.isValidExtension(a.name,t)?this.handleFile(a):this.setState({dropError:st.FILE_TYPE_ERROR})}}unstageFile(e){var{onCancel:t}=this.props;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var{onFileOpened:t}=this.props;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var{onPaste:e,onError:t,uploadInProgress:n}=this.props;n||navigator.clipboard.readText().then(r=>{e(r),this.setState({selectedFileName:ta,dropError:void 0})}).catch(r=>t(r))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:Gr,action:this.handleMenuPaste,shortcut:Mn.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:n}=this.props,{selectedFileName:r,dropError:a}=this.state,s=t??a,o=this.makeContextMenuItems();return d.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:st.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[d.jsx(Q,{actions:o}),d.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!r&&(s===void 0||s==="")&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(J,{icon:Wl})}),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(k,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),r&&(s===void 0||s==="")&&d.jsxs("div",{className:"selected-content",children:[d.jsx("div",{className:"selected-icon",children:d.jsx(J,{icon:st.getIcon(r)})}),d.jsxs("div",{className:"selected-text",children:[d.jsx("label",{children:"Selected File"}),d.jsxs("label",{className:"selected-name",children:[r,!n&&d.jsx(k,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:kn,tooltip:"Remove"})]})]})]}),!!s&&d.jsxs("div",{className:"message-content",children:[d.jsx("div",{className:"message-icon",children:d.jsx(J,{icon:vr})}),d.jsx("label",{children:s}),s===st.FILE_TYPE_ERROR&&d.jsx("div",{className:"message-small",children:d.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}yt(st,"defaultProps",{allowZip:!1,dragError:null});yt(st,"MULTIPLE_FILE_ERROR","Please select only one file");yt(st,"FILE_TYPE_ERROR","Filetype not supported.");const Bt=st;function Ut(i,e,t){return e=Gu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gu(i){var e=Bu(i,"string");return typeof e=="symbol"?e:String(e)}function Bu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Dt{}Ut(Dt,"INTEGER","int");Ut(Dt,"LONG","long");Ut(Dt,"DOUBLE","double");Ut(Dt,"BOOLEAN","bool");Ut(Dt,"STRING","string");Ut(Dt,"DATE_TIME","datetime");Ut(Dt,"LOCAL_TIME","localtime");const ne=Dt;function So(i,e){var t=i.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(n,r)=>e(r)),t}function ia(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ra(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(n){Le(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Le(i,e,t){return e=Wu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Wu(i){var e=Ku(i,"string");return typeof e=="symbol"?e:String(e)}function Ku(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var aa="unknown",zu=2147483647,qu=-2147483648,sa=/^[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]+)?$/,oa=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Te{static determineType(e,t,n){if(!e||e===n)return t;switch(t){case ne.STRING:return ne.STRING;case ne.INTEGER:return Te.checkInteger(e);case ne.LONG:return Te.checkLong(e);case ne.DOUBLE:return Te.checkDouble(e);case ne.BOOLEAN:return Te.checkBoolean(e);case ne.DATE_TIME:return Te.checkDateTime(e);case ne.LOCAL_TIME:return Te.checkLocalTime(e);default:return Te.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return Te.isNotParsableNumber(t)?ne.STRING:Te.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return Te.isNotParsableNumber(t)?ne.STRING:t.includes(".")?ne.DOUBLE:ne.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return Te.isNotParsableNumber(t)?ne.STRING:ne.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?ne.BOOLEAN:ne.STRING}static checkDateTime(e){return sa.test(e)?ne.DATE_TIME:ne.STRING}static checkLocalTime(e){return oa.test(e)?ne.LOCAL_TIME:ne.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(Te.isNotParsableNumber(t)){var n=e.toLowerCase();return n==="true"||n==="false"?ne.BOOLEAN:sa.test(e)&&e.includes(":")?ne.DATE_TIME:oa.test(e)?ne.LOCAL_TIME:ne.STRING}return Te.getNumberType(t)}static getNumberType(e){if(e.includes("."))return ne.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return ne.LONG;var n=parseInt(e,10);return n>zu||n<qu?ne.LONG:ne.INTEGER}constructor(e,t,n,r,a,s,o,l,u,h){Le(this,"onFileCompleted",void 0),Le(this,"file",void 0),Le(this,"readHeaders",void 0),Le(this,"nullString",void 0),Le(this,"onProgress",void 0),Le(this,"onError",void 0),Le(this,"types",void 0),Le(this,"chunks",void 0),Le(this,"totalChunks",void 0),Le(this,"rowCount",void 0),Le(this,"isZip",void 0),Le(this,"shouldTrim",void 0),Le(this,"zipProgress",void 0),Le(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=n,this.nullString=a,this.onProgress=s,this.onError=o,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=u,this.shouldTrim=h,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=ra(ra({},r),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)En.parse(this.file,this.config);else{var e=So(this.file,this.handleNodeUpdate);En.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:n}=e;if(!this.types){if(n==null||n.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(n[0].length).fill(aa),this.readHeaders&&(n=n.slice(1))}this.rowCount+=n.length,I(this.types);var r=[...this.types];n.forEach(o=>{if(o.length>=r.length){for(var l=0;l<r.length;l+=1)r[l]=Te.determineType(this.shouldTrim?o[l].trim():o[l],r[l],this.nullString);this.types=r}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
3
3
|
Expected length `.concat(r.length," but found ").concat(o.length,`.
|
|
4
4
|
Row = `).concat(o))}),this.chunks+=1;var a=0;this.totalChunks>0?a=Math.round(this.chunks/this.totalChunks*50):a=Math.round(this.zipProgress/2);var s=this.onProgress(a);s&&t.abort()}handleComplete(e){var{types:t,onFileCompleted:n}=this;I(t),(e==null||!e.meta.aborted)&&n(t.map(r=>r===aa||r===ne.LOCAL_TIME?ne.STRING:r),this.rowCount)}handleError(e){var{onError:t}=this;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}const Yu=Te;function le(i,e,t){return e=Xu(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Xu(i){var e=Zu(i,"string");return typeof e=="symbol"?e:String(e)}function Zu(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Wn=z.module("CsvParser"),Qu=650;class Xt{static generateHeaderRecursive(e){var t="",n=e;return e>=26&&(t=t.concat(Xt.generateHeaderRecursive(Math.floor(e/26)-1)),n=e%26),t.concat(String.fromCharCode(65+n))}constructor(e){var{onFileCompleted:t,session:n,file:r,type:a,readHeaders:s=!0,onProgress:o,onError:l,timeZone:u,isZip:h}=e;le(this,"onFileCompleted",void 0),le(this,"session",void 0),le(this,"file",void 0),le(this,"isZip",void 0),le(this,"type",void 0),le(this,"readHeaders",void 0),le(this,"timeZone",void 0),le(this,"onProgress",void 0),le(this,"onError",void 0),le(this,"tables",void 0),le(this,"headers",void 0),le(this,"types",void 0),le(this,"rowCount",void 0),le(this,"rowsProcessed",void 0),le(this,"chunks",void 0),le(this,"totalChunks",void 0),le(this,"isComplete",void 0),le(this,"zipProgress",void 0),le(this,"consolidatedChunks",void 0),le(this,"numConsolidated",void 0),le(this,"isCancelled",void 0),le(this,"config",void 0),this.onFileCompleted=t,this.session=n,this.file=r,this.isZip=h,this.type=a,this.readHeaders=s,this.timeZone=u,this.onProgress=o,this.onError=l,this.tables=[],this.rowCount=0,this.rowsProcessed=0,this.chunks=0,this.totalChunks=h?0:Math.ceil(r.size/En.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:a.delimiter,newline:a.newline,escapeChar:a.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:a.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(e,t){for(var n=t.length,r=new Array(e).fill(null).map(()=>new Array(n)),a=0;a<n;a+=1){var s=t[a];if(s.length<e)throw new Error("Insufficient columns. Expected ".concat(e," but found ").concat(s.length,`
|
|
@@ -24,4 +24,4 @@ Check your internet connection.`;if(t&&n)return"Disconnected from server.";if(n)
|
|
|
24
24
|
`).concat(zt.makeCirclePath(s,o,bs)),F="link-select-clip-".concat(l),N=Math.atan2(o-O,s-y),$=N-gs+Math.PI,q=N+gs+Math.PI,j=s+Math.cos(N)*fs,G=o+Math.sin(N)*fs,A=j+Math.cos($)*ti,R=G+Math.sin($)*ti,K=j+Math.cos(q)*ti,H=G+Math.sin(q)*ti,ce="".concat(j,",").concat(G," ").concat(A,",").concat(R," ").concat(K,",").concat(H),Ce=.25*r+.5*y+.25*s,Ie=.25*a+.5*O+.25*o,P=y-r+(s-y),w=O-a+(o-O),D=w/P,B=20,W=B/Math.sqrt(1+D**2),ve=W*D,T=W*-1,V=ve*-1;Number.isFinite(D)?D>0?(W*=-1,ve*=-1,T*=-1,V*=-1,T-=50-10*(Math.abs(m)%Ct),V+=10*(Math.abs(m)%Ct),W-=50-10*(Math.abs(m)%Ct),ve+=10*(Math.abs(m)%Ct)):D<0?(T+=10*(Math.abs(m)%Ct),V+=10*(Math.abs(m)%Ct),W+=10*(Math.abs(m)%Ct),ve+=10*(Math.abs(m)%Ct)):(T=15,V=10,W=-25,ve=10):(T=10,V=5,W=10,ve=-35);var Y="";t!==void 0&&(t==="startsWith"?Y="a*":t==="endsWith"?Y="*z":Y=Ae.getFilterOperatorString(t));var ae=h!=="chartLink"&&h!=="filterSource";return d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:X(e,{hovering:c}),children:[d.jsx("clipPath",{id:F,children:d.jsx("path",{d:L,clipRule:"evenodd"})}),d.jsx("path",{className:"link-select",d:x,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,clipPath:"url(#".concat(F,")"),"data-testid":"link-select"}),d.jsx("path",{className:"link-background",d:x}),d.jsx("path",{className:"link-foreground",d:x}),d.jsx("circle",{className:"link-dot",cx:r,cy:a,r:"5"}),d.jsx("polygon",{className:"link-triangle",points:ce})]}),u!=null&&n&&d.jsxs(d.Fragment,{children:[ae&&d.jsx(k,{kind:"primary",className:"btn-fab btn-operator",style:{top:Ie+(D>=0?ve:V),left:Ce+(D>=0?W:T)},onClick:()=>{},icon:d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx("b",{children:Y}),d.jsx(J,{icon:Wt,transform:"right-8 down-9 shrink-5"})]}),tooltip:"Change comparison operator",children:d.jsx(Kt,{actions:this.getDropdownActions,popperOptions:{placement:"bottom-start"}})}),d.jsx(k,{kind:"primary",className:"btn-fab btn-delete",style:{top:Ie+(D<0?ve:V),left:Ce+(D<0?W:T)},onClick:this.handleDelete,icon:kn,tooltip:"Delete"})]})]})}}Xo(zt,"defaultProps",{className:"",isSelected:!1,onClick(){},onDelete(){}});const vm=zt;function Cs(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Ss(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cs(Object(t),!0).forEach(function(n){Ir(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Cs(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Ir(i,e,t){return e=pm(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pm(i){var e=mm(i,"string");return typeof e=="symbol"?e:String(e)}function mm(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Bi=z.module("LinkerOverlayContent");class Jo extends p.Component{constructor(e){super(e),Ir(this,"dialogRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleResize=this.handleResize.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleEscapePressed=this.handleEscapePressed.bind(this),this.handleOperatorChanged=this.handleOperatorChanged.bind(this),this.dialogRef=Z.createRef(),this.state={mouse:void 0,dialog:void 0,offset:{x:0,y:0},isDragging:!1,mode:"select"}}componentDidMount(){window.addEventListener("blur",this.handleBlur,!0),window.addEventListener("mousemove",this.handleMouseMove,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),window.addEventListener("keydown",this.handleKeyDown,!0),window.addEventListener("keyup",this.handleKeyUp,!0),window.addEventListener("resize",this.handleResize,!0)}componentDidCatch(e,t){Bi.error("componentDidCatch",e,t)}componentWillUnmount(){window.removeEventListener("blur",this.handleBlur,!0),window.removeEventListener("mousemove",this.handleMouseMove,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("keydown",this.handleKeyDown,!0),window.removeEventListener("keyup",this.handleKeyUp,!0),window.removeEventListener("resize",this.handleResize,!0)}getPointFromLinkPoint(e){var{panelManager:t}=this.props,{panelId:n,columnName:r}=e,a=t.getOpenedPanelById(n);if(a!=null){if(!Yo(a))throw new Error("Panel does not have getCoordinateForColumn method: ".concat(n));try{var s=a.getCoordinateForColumn(r);if(s!=null)return s}catch{Bi.error("Could not get coordinate for column",r,a)}}var o=t.getContainerByPanelId(n);if(o==null)throw new Error("Unable to find panel container for id: ".concat(n));return M.getTabPoint(o)}handleOperatorChanged(e,t){var{links:n,onLinksUpdated:r}=this.props,a=n.map(s=>s.id===e?Ss(Ss({},s),{},{operator:t}):s);r(a)}handleBlur(){this.setState({mode:"select"})}handleResize(){var{dialog:e}=this.state;if(e&&this.dialogRef.current){var t=this.dialogRef.current.getBoundingClientRect(),n=Bn(e.x,0,window.innerWidth-t.width),r=Bn(e.y,0,window.innerHeight-t.height);this.setState({dialog:{x:n,y:r}})}}handleMouseMove(e){var{offset:t,isDragging:n}=this.state;if(this.setState({mouse:{x:e.clientX,y:e.clientY}}),n&&this.dialogRef.current){var r=this.dialogRef.current.getBoundingClientRect(),a=Bn(window.innerWidth-(e.clientX+r.width+t.x),0,window.innerWidth-r.width),s=Bn(window.innerHeight-(e.clientY+r.height+t.y),0,window.innerHeight-r.height);this.setState({dialog:{x:a,y:s}})}}handleMouseDown(e){var t={x:0,y:0};if(this.dialogRef.current){var n=this.dialogRef.current.getBoundingClientRect();t.x=n.right-(n.width+e.clientX),t.y=n.bottom-(n.height+e.clientY)}this.setState({isDragging:!0,offset:t})}handleMouseUp(){this.setState({isDragging:!1})}handleKeyDown(e){if(e.key==="Alt")e.preventDefault(),this.setState({mode:"delete"});else if(e.key==="Delete"||e.key==="Backspace"){var{selectedIds:t,onLinkDeleted:n}=this.props;e.preventDefault(),t.forEach(r=>n(r))}}handleKeyUp(e){e.key==="Alt"&&(e.preventDefault(),this.setState({mode:"select"}))}handleEscapePressed(){var{onCancel:e}=this.props;e()}render(){var{disabled:e,links:t,selectedIds:n,messageText:r,onLinkSelected:a,onLinkDeleted:s,onAllLinksDeleted:o,onDone:l}=this.props,{mouse:u,dialog:h,isDragging:c,mode:v}=this.state,m=t.map(b=>{try{var g,f,{id:C,type:E,isReversed:S,start:y,end:O,operator:x}=b,L=y.columnType,[F,N]=this.getPointFromLinkPoint(y),$=(g=u==null?void 0:u.x)!==null&&g!==void 0?g:F,q=(f=u==null?void 0:u.y)!==null&&f!==void 0?f:N;if(O!=null&&([$,q]=this.getPointFromLinkPoint(O)),S!=null&&S){var[j,G]=[F,N];[F,N]=[$,q],[$,q]=[j,G]}var A=X("linker-link",{disabled:e},{"link-filter-source":E==="filterSource"},{"link-invalid":E==="invalid"},{interactive:b.end==null},{"link-is-selected":n.has(C)},{"danger-delete":v==="delete"});return{x1:F,y1:N,x2:$,y2:q,id:C,className:A,operator:x,startColumnType:L,type:E}}catch(R){return Bi.warn("Unable to get point for link",b,R),null}}).filter(b=>b!=null);return d.jsxs("div",{className:X("linker-overlay",{"danger-delete":v==="delete"}),children:[m.map(b=>{var{x1:g,y1:f,x2:C,y2:E,id:S,className:y,operator:O,startColumnType:x,type:L}=b;return d.jsx(vm,{className:y,id:S,x1:g,y1:f,x2:C,y2:E,onClick:a,onDelete:s,isSelected:n.has(S),operator:O,startColumnType:x,type:L,onOperatorChanged:this.handleOperatorChanged},S)}),d.jsxs("div",{className:X("linker-toast-dialog",{dragging:c}),ref:this.dialogRef,style:{bottom:h==null?void 0:h.y,right:h==null?void 0:h.x},"data-testid":"linker-toast-dialog",children:[d.jsx(k,{draggable:!0,kind:"inline",className:"btn-drag-handle",icon:dd,onClick:()=>{},onMouseDown:this.handleMouseDown,children:!c&&d.jsx(wt,{children:"Drag to reposition"})}),d.jsx("div",{className:"toast-body",children:r}),d.jsxs("div",{className:"toast-footer",children:[d.jsx(k,{kind:"secondary",onClick:o,children:"Clear All"}),d.jsx(k,{kind:"primary",onClick:l,children:"Done"})]})]}),d.jsx(Q,{actions:[{action:this.handleEscapePressed,shortcut:Mn.LINKER_CLOSE,isGlobal:!0}]})]})}}Ir(Jo,"defaultProps",{disabled:"false"});const fm=Jo;function Es(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ys(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Es(Object(t),!0).forEach(function(n){el(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Es(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function el(i,e,t){return e=gm(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function gm(i){var e=bm(i,"string");return typeof e=="symbol"?e:String(e)}function bm(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ee=z.module("Linker"),Cm=(i,e)=>({activeTool:fr(i),dh:no(i),isolatedLinkerPanelId:yr(i,e.localDashboardId),links:on(i,e.localDashboardId),timeZone:mr(i)}),Sm=Ke(Cm,{setActiveTool:uo,setDashboardLinks:wr,addDashboardLinks:fc,deleteDashboardLinks:gc,setDashboardIsolatedLinkerPanelId:ko,setDashboardColumnSelectionValidator:bc});class Em extends p.Component{constructor(e){super(e),el(this,"getCachedLinks",te((t,n,r)=>{var a=[...t];return n!=null&&n.start!=null&&a.push(n),r!==void 0?a.filter(s=>{var o,l;return(s==null||(o=s.start)===null||o===void 0?void 0:o.panelId)===r||(s==null||(l=s.end)===null||l===void 0?void 0:l.panelId)===r||(s==null?void 0:s.end)==null}):a})),this.handleCancel=this.handleCancel.bind(this),this.handleDone=this.handleDone.bind(this),this.handlePanelCloned=this.handlePanelCloned.bind(this),this.handleFilterColumnSelect=this.handleFilterColumnSelect.bind(this),this.handleColumnsChanged=this.handleColumnsChanged.bind(this),this.handlePanelClosed=this.handlePanelClosed.bind(this),this.handleLayoutStateChanged=this.handleLayoutStateChanged.bind(this),this.handleAllLinksDeleted=this.handleAllLinksDeleted.bind(this),this.handleLinkDeleted=this.handleLinkDeleted.bind(this),this.handleLinksUpdated=this.handleLinksUpdated.bind(this),this.handleChartColumnSelect=this.handleChartColumnSelect.bind(this),this.handleGridColumnSelect=this.handleGridColumnSelect.bind(this),this.handleUpdateValues=this.handleUpdateValues.bind(this),this.handleStateChange=this.handleStateChange.bind(this),this.handleExited=this.handleExited.bind(this),this.handleLinkSelected=this.handleLinkSelected.bind(this),this.handlePanelDragging=this.handlePanelDragging.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.isColumnSelectionValid=this.isColumnSelectionValid.bind(this),this.state={linkInProgress:void 0,selectedIds:new Set,isDraggingPanel:!1}}componentDidMount(){var{layout:e}=this.props;this.startListening(e),this.updateSelectionValidators()}componentDidUpdate(e){var{activeTool:t,layout:n}=this.props;n!==e.layout&&(this.stopListening(e.layout),this.startListening(n)),t!==e.activeTool&&(this.updateSelectionValidators(),t===at.DEFAULT&&this.reset())}componentDidCatch(e,t){Ee.error("componentDidCatch",e,t)}componentWillUnmount(){var{layout:e}=this.props;this.stopListening(e)}startListening(e){e.on("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.on(Ze.COLUMN_SELECTED,this.handleGridColumnSelect),t.on(Ze.DATA_SELECTED,this.handleUpdateValues),t.on(Ze.STATE_CHANGED,this.handleStateChange),t.on(tr.COLUMN_SELECTED,this.handleChartColumnSelect),t.on(oe.CLONED,this.handlePanelCloned),t.on(fe.COLUMN_SELECTED,this.handleFilterColumnSelect),t.on(fe.COLUMNS_CHANGED,this.handleColumnsChanged),t.on(oe.CLOSE,this.handlePanelClosed),t.on(oe.CLOSED,this.handlePanelClosed),t.on(oe.DRAGGING,this.handlePanelDragging),t.on(oe.DROPPED,this.handlePanelDropped)}stopListening(e){e.off("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.off(Ze.COLUMN_SELECTED,this.handleGridColumnSelect),t.off(Ze.DATA_SELECTED,this.handleUpdateValues),t.off(Ze.STATE_CHANGED,this.handleStateChange),t.off(tr.COLUMN_SELECTED,this.handleChartColumnSelect),t.off(oe.CLONED,this.handlePanelCloned),t.off(fe.COLUMN_SELECTED,this.handleFilterColumnSelect),t.off(fe.COLUMNS_CHANGED,this.handleColumnsChanged),t.off(oe.CLOSE,this.handlePanelClosed),t.off(oe.CLOSED,this.handlePanelClosed),t.off(oe.DRAGGING,this.handlePanelDragging),t.off(oe.DROPPED,this.handlePanelDropped)}reset(){this.setState({linkInProgress:void 0,selectedIds:new Set})}handleCancel(){var{linkInProgress:e}=this.state;if(e==null){var{setActiveTool:t}=this.props;t(at.DEFAULT)}this.setState({linkInProgress:void 0})}handleDone(){var{setActiveTool:e}=this.props;e(at.DEFAULT)}handleChartColumnSelect(e,t){this.columnSelected(e,t,!0)}handleFilterColumnSelect(e,t){Ee.debug("handleFilterColumnSelect",this.isOverlayShown());var{links:n,localDashboardId:r,setActiveTool:a,setDashboardIsolatedLinkerPanelId:s}=this.props,o=M.getIdFromPanel(e),l=n.filter(u=>{var h,c;return((h=u.start)===null||h===void 0?void 0:h.panelId)===o||((c=u.end)===null||c===void 0?void 0:c.panelId)===o});if(!this.isOverlayShown()&&o!=null){a(at.LINKER),s(r,o),l.length===0&&this.columnSelected(e,t,!0,o);return}this.columnSelected(e,t,!0)}handleColumnsChanged(e,t){Ee.debug("handleColumnsChanged",e,t);var{links:n}=this.props,r=M.getIdFromPanel(e);if(r==null){Ee.error("Invalid panelId",e);return}var a=n.filter(s=>{var{start:o,end:l}=s;return o.panelId===r&&Gt.findColumn(t,o)==null||l!=null&&l.panelId===r&&Gt.findColumn(t,l)==null});this.deleteLinks(a)}handleGridColumnSelect(e,t){if(!vs(t)){Ee.debug2("Column is not filterable");return}this.columnSelected(e,t)}columnSelected(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3?arguments[3]:void 0;if(!(r===void 0&&!this.isOverlayShown())){var{isolatedLinkerPanelId:a}=this.props,{linkInProgress:s}=this.state,o=M.getIdFromPanel(e);if(o!=null){var l=M.getComponentNameFromPanel(e),{name:u,type:h}=t;if(s==null||s.start==null){var c={id:$e.generate(),start:{panelId:o,panelComponent:l,columnName:u,columnType:h},type:"invalid",isReversed:n};Ee.debug("starting link",c),this.setState({linkInProgress:c})}else{var{links:v}=this.props,{start:m,id:b,isReversed:g}=s,f={panelId:o,panelComponent:l,columnName:u,columnType:h},C=Gt.getLinkType(g!==void 0&&g?f:m,g!==void 0&&g?m:f,r??a);switch(C){case"invalid":Ee.debug("Ignore invalid link connection",s,f);return;case"filterSource":{var E=g!==void 0&&g?m.panelId:f.panelId,S=v.filter(F=>{var{end:N}=F;return(N==null?void 0:N.panelId)===E});this.deleteLinks(S);break}case"chartLink":{var y=g===!0?m:f,O=g===!0?f:m;Ee.debug("creating chartlink",{existingLinkEnd:y,start:m,end:f});var x=v.filter(F=>{var{end:N,start:$}=F;return($==null?void 0:$.panelId)===O.panelId&&(N==null?void 0:N.panelId)===y.panelId&&(N==null?void 0:N.columnName)===y.columnName&&(N==null?void 0:N.columnType)===y.columnType});this.deleteLinks(x);break}}var L={start:g!==void 0&&g?f:m,end:g!==void 0&&g?m:f,id:b,type:C,operator:mn.eq};Ee.info("creating link",L),this.setState({linkInProgress:void 0,selectedIds:new Set([b])},()=>{this.addLinks([L])})}}}}unsetFilterValueForLink(e){var{panelManager:t}=this.props;if(e.end){var{end:n}=e,{panelId:r,columnName:a,columnType:s}=n,o=t.getOpenedPanelById(r);o?cs(o)?o.unsetFilterValue(a,s):Ee.debug("endPanel.unsetFilterValue not implemented",o):Ee.debug("endPanel no longer exists, ignoring unsetFilterValue",r)}}setPanelFilterMap(e,t){Ee.debug("Set filter data for panel:",e,t);var{panelManager:n}=this.props,r=n.getOpenedPanelById(e);r?cs(r)?r.setFilterMap(t):Ee.debug("panel.setFilterMap not implemented",e,r):Ee.debug("panel no longer exists, ignoring setFilterMap",e)}addLinks(e){var{addDashboardLinks:t,localDashboardId:n}=this.props;t(n,e)}deleteLinks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{localDashboardId:n}=this.props;if(e.forEach(s=>this.unsetFilterValueForLink(s)),t){var{setDashboardLinks:r}=this.props;r(n,[])}else if(e.length>0){var{deleteDashboardLinks:a}=this.props;a(n,e.map(s=>{var{id:o}=s;return o}))}}handleAllLinksDeleted(){var{links:e,isolatedLinkerPanelId:t}=this.props;if(t===void 0)this.deleteLinks(e,!0);else{var n=e.filter(r=>{var a,s;return(r==null||(a=r.start)===null||a===void 0?void 0:a.panelId)===t||(r==null||(s=r.end)===null||s===void 0?void 0:s.panelId)===t});this.deleteLinks(n)}this.reset()}handleLinkDeleted(e){var{links:t}=this.props,n=t.find(r=>r.id===e);n?this.deleteLinks([n]):Ee.error("Unable to find link to delete",e)}handleUpdateValues(e,t){for(var n=M.getIdFromPanel(e),{dh:r,links:a,timeZone:s}=this.props,o=new Map,l=0;l<a.length;l+=1){var{start:u,end:h,operator:c}=a[l];if(u.panelId===n&&h!=null){var{panelId:v,columnName:m,columnType:b}=h,g=o.has(v)?o.get(v):new Map,f=g.has(m)===!0?g.get(m).filterList:[],{visibleIndex:C,isExpandable:E,isGrouped:S}=t[u.columnName],{value:y}=t[u.columnName],O="".concat(y);if(y===null&&E&&S&&(y=void 0),b!=null&&Ae.isDateType(b)){var x=new Gs(r,{timeZone:s,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:kl.FULL_DATE_FORMAT});O=x.format(y)}var L={operator:c,text:O,value:y,startColumnIndex:C};f.push(L),g.set(m,{columnType:b,filterList:f}),o.set(v,g)}}o.forEach((F,N)=>{this.setPanelFilterMap(N,F)})}handlePanelCloned(e,t){var{links:n}=this.props,r=M.getIdFromPanel(e),a=t.id;if(r!=null){var s=Gt.cloneLinksForPanel(n,r,a);this.addLinks(s)}}handlePanelDragging(e){for(var{links:t}=this.props,n=0;n<t.length;n+=1){var r=t[n],{start:a,end:s}=r;if(a.panelId===e||(s==null?void 0:s.panelId)===e){this.setState({isDraggingPanel:!0});return}}}handlePanelDropped(){this.setState({isDraggingPanel:!1})}handlePanelClosed(e){Ee.debug("Panel ".concat(e," closed, deleting links.")),this.deleteLinksForPanelId(e)}handleLinkSelected(e){this.setState({selectedIds:new Set([e])})}handleLinksUpdated(e){var{localDashboardId:t,setDashboardLinks:n}=this.props;n(t,e)}handleLayoutStateChanged(){this.forceUpdate()}handleStateChange(){this.forceUpdate()}handleExited(){var{localDashboardId:e,setDashboardIsolatedLinkerPanelId:t}=this.props;t(e,void 0)}deleteLinksForPanelId(e){for(var{links:t}=this.props,n=0;n<t.length;n+=1){var r=t[n],{start:a,end:s,id:o}=r;(a.panelId===e||(s==null?void 0:s.panelId)===e)&&this.handleLinkDeleted(o)}}isOverlayShown(){var{activeTool:e}=this.props;return e===at.LINKER}updateSelectionValidators(){var{activeTool:e,setDashboardColumnSelectionValidator:t,localDashboardId:n}=this.props;switch(e){case at.LINKER:t(n,this.isColumnSelectionValid);break;default:t(n,void 0);break}}updateLinkInProgressType(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"invalid";this.setState(t=>{var{linkInProgress:n}=t;return n!==void 0?{linkInProgress:ys(ys({},n),{},{type:e})}:null})}isColumnSelectionValid(e,t){var{linkInProgress:n}=this.state,{isolatedLinkerPanelId:r}=this.props;if(t==null)return(n==null?void 0:n.start)!=null&&this.updateLinkInProgressType(),!1;if(!vs(t))return Ee.debug2("Column is not filterable",t.description),(n==null?void 0:n.start)!=null&&this.updateLinkInProgressType("invalid"),!1;if((n==null?void 0:n.start)==null)return!0;var{isReversed:a,start:s}=n,o=M.getIdFromPanel(e);if(o==null)return!1;var l={panelId:o,panelComponent:M.getComponentNameFromPanel(e),columnName:t.name,columnType:t.type},u=a!==void 0&&a?Gt.getLinkType(l,s,r):Gt.getLinkType(s,l,r);return this.updateLinkInProgressType(u),u!=="invalid"}render(){var{links:e,isolatedLinkerPanelId:t,panelManager:n}=this.props,{linkInProgress:r,selectedIds:a,isDraggingPanel:s}=this.state,o=this.isOverlayShown(),l=r!=null&&r.start!=null,u=t===void 0?"Click a column source, then click a column target to create a filter link. The filter comparison operator used by a selected link can be changed. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.":"Create a link between the source column button and a table column by clicking on one, then the other. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.";return s?null:d.jsx(qi,{in:o,timeout:Zi.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,onExited:this.handleExited,children:d.jsx(fm,{disabled:l,panelManager:n,links:this.getCachedLinks(e,r,t),selectedIds:a,messageText:u,onLinkSelected:this.handleLinkSelected,onLinkDeleted:this.handleLinkDeleted,onAllLinksDeleted:this.handleAllLinksDeleted,onLinksUpdated:this.handleLinksUpdated,onDone:this.handleDone,onCancel:this.handleCancel})})}}var ym=Sm(Em);const Pm=ym;function wm(i){nn(i);var{id:e,layout:t,panelManager:n}=i;return d.jsx(Pm,{layout:t,localDashboardId:e,panelManager:n})}var Tm={name:"LinkerPlugin",type:Nt.DASHBOARD_PLUGIN,component:wm};const Cf=Tm;function tl(i,e,t){return e=Om(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Om(i){var e=Nm(i,"string");return typeof e=="symbol"?e:String(e)}function Nm(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class tn{static getNewMarkdownTitle(e){for(var t="".concat(tn.DEFAULT_TITLE),n=0;e.indexOf(t)>=0;)n+=1,t="".concat(tn.DEFAULT_TITLE,"-").concat(n);return t}}tl(tn,"DEFAULT_TITLE","Note");tl(tn,"DEFAULT_CONTENT",`# Markdown Note
|
|
25
25
|
|
|
26
26
|
This note can be edited using **markdown** for styling.`);const Wi=tn;function Lm(i){nn(i);var{id:e,layout:t,panelManager:n,registerComponent:r}=i,a=p.useCallback(o=>{var{title:l,componentState:u,props:h}=o,{panelState:c=null}=h;return u!=null&&({panelState:c=null}=u),l==null||c==null||c.content==null||c.content.length===0||c.content===Wi.DEFAULT_CONTENT?null:jl(o)},[]),s=p.useCallback(function(){var{title:o="",metadata:l={},id:u=$e.generate(),focusElement:h=M.DEFAULT_FOCUS_SELECTOR,createNewStack:c=!1,dragEvent:v=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=n.getOpenedPanelConfigsOfType(un.COMPONENT),b=n.getClosedPanelConfigsOfType(un.COMPONENT),g=m.map(y=>{var O;return(O=y.title)!==null&&O!==void 0?O:""}),f=o!=null&&o!==""?o:Wi.getNewMarkdownTitle(g),C=b.length>0?null:Wi.DEFAULT_CONTENT,E={type:"react-component",component:un.COMPONENT,props:{id:u,metadata:l,panelState:{content:C},localDashboardId:e},title:f,id:u},{root:S}=t;M.openComponent({root:S,config:E,focusElement:h,createNewStack:c,dragEvent:v})},[e,t,n]);return p.useEffect(function(){var l=[r(un.COMPONENT,un,Al,a)];return()=>{l.forEach(u=>u())}},[a,r]),me(t.eventHub,Xh.OPEN,s),null}var Dm={name:"MarkdownPlugin",type:Nt.DASHBOARD_PLUGIN,component:Lm};const Sf=Dm;function Ps(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function ws(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ps(Object(t),!0).forEach(function(n){Mm(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Ps(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Mm(i,e,t){return e=xm(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function xm(i){var e=Fm(i,"string");return typeof e=="symbol"?e:String(e)}function Fm(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Rr=p.forwardRef((i,e)=>{var{localDashboardId:t,fetch:n}=i,r=zo(n,t);return d.jsx(Lp,ws(ws({ref:e},i),r))});Rr.displayName="PandasPanelPlugin";const Ef=Rr;function Ts(i,e,t,n,r,a,s){try{var o=i[a](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,r)}function Ki(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var a=i.apply(e,t);function s(l){Ts(a,n,r,s,o,"next",l)}function o(l){Ts(a,n,r,s,o,"throw",l)}s(void 0)})}}function Im(i){var e=$t(),[t,n]=p.useState(),[r,a]=p.useState(!0),[s,o]=p.useState(!1),{fetch:l}=i,u=p.useCallback(Ki(function*(){var c=yield l();return ur.makeModel(e,c)}),[e,l]),h=p.useCallback(Ki(function*(){a(!0);var c=yield u();n(c),a(!1)}),[u]);return p.useEffect(()=>{var c=!1;function v(){return m.apply(this,arguments)}function m(){return m=Ki(function*(){var b=yield u();c||(n(b),o(!0),a(!1))}),m.apply(this,arguments)}return v(),a(!0),()=>{c=!0}},[u]),d.jsxs(d.Fragment,{children:[d.jsx(pr,{isLoaded:s,isLoading:r}),t&&d.jsx(vi,{model:t,children:d.jsx(Ko,{onClick:h})})]})}var Rm={name:"PandasPanel",title:"Pandas",type:Nt.WIDGET_PLUGIN,component:Im,panelComponent:Rr,supportedTypes:"pandas.DataFrame",icon:Ws};const yf=Rm;function Os(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function pn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Os(Object(t),!0).forEach(function(n){km(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Os(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function km(i,e,t){return e=jm(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function jm(i){var e=Am(i,"string");return typeof e=="symbol"?e:String(e)}function Am(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var _m=z.module("WidgetLoaderPlugin");function $m(i){var e;function t(n,r){var a=i.component,{metadata:s}=n,o=_l(a);return d.jsx(Si,pn(pn({widgetName:s==null?void 0:s.name,widgetType:i.title},n),{},{children:o?d.jsx(a,pn(pn({},n),{},{ref:r})):d.jsx(a,pn({},n))}))}return t.displayName="WidgetLoaderPlugin(".concat((e=i.component.displayName)!==null&&e!==void 0?e:i.name,")"),p.forwardRef(t)}function Um(i){var e=to(),t=p.useMemo(()=>{var o=new Map;return e.forEach(l=>{fd(l)&&[l.supportedTypes].flat().forEach(u=>{if(u!=null&&u!==""){if(o.has(u)){var h;_m.warn("Multiple WidgetPlugins handling type ".concat(u,". Replacing ").concat((h=o.get(u))===null||h===void 0?void 0:h.name," with ").concat(l.name," to handle ").concat(u))}o.set(u,l)}})}),o},[e]);nn(i);var{id:n,layout:r,registerComponent:a}=i,s=p.useCallback(o=>{var l,{dragEvent:u,fetch:h,panelId:c=$e.generate(),widget:v}=o,{id:m,type:b}=v,g=(l=v.title)!==null&&l!==void 0?l:v.name,f=t.get(b);if(f!=null){var C={id:m,name:g,type:b},E={localDashboardId:n,metadata:C,fetch:h},S={type:"react-component",component:f.name,props:E,title:g,id:c},{root:y}=r;M.openComponent({root:y,config:S,dragEvent:u})}},[n,r,t]);return p.useEffect(()=>{var o=[...new Set(t.values())].map(l=>{var{panelComponent:u}=l;return u==null?a(l.name,$m(l)):a(l.name,u)});return()=>{o.forEach(l=>l())}},[a,t]),me(r.eventHub,oe.OPEN,s),null}var Hm={name:"WidgetLoaderPlugin",type:Nt.DASHBOARD_PLUGIN,component:Um};const Pf=Hm;function xi(i,e,t){return e=Vm(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Vm(i){var e=Gm(i,"string");return typeof e=="symbol"?e:String(e)}function Gm(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Hn{}xi(Hn,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");xi(Hn,"INPUT_FILTER","ControlType.INPUT_FILTER");xi(Hn,"MARKDOWN","ControlType.MARKDOWN");xi(Hn,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const wf=Hn;var Bm=_.shape({state:_.shape({panelState:_.shape({})})}),Wm=_.shape({panelId:_.string.isRequired,columnName:_.string.isRequired,columnType:_.string.isRequired}),Ns=_.shape({panelId:_.string.isRequired,columnName:_.string.isRequired}),nl=_.shape({start:Ns,end:Ns,id:_.string,isReversed:_.bool}),Km=_.arrayOf(nl),zm=_.shape({name:_.string.isRequired,operateAs:_.string.isRequired,groups:_.arrayOf(_.string).isRequired,permissions:_.shape({canUsePanels:_.bool.isRequired,canCopy:_.bool.isRequired,canDownloadCsv:_.bool.isRequired,canLogout:_.bool.isRequired}).isRequired}),qm=Object.freeze({LinkPoint:Wm,Link:nl,Links:Km,Panel:Bm,User:zm});const Tf=qm;var Ym=(i,e)=>i[e]===null?null:_.bool,Xm=(i,e)=>i[e]===null?null:_.string,Zm=Object.freeze({nullableBoolean:Ym,nullableString:Xm});const Of=Zm;export{Wp as ChartBuilderPlugin,pf as ChartBuilderPluginConfig,tr as ChartEvent,Pi as ChartPanel,cf as ChartPanelPlugin,vf as ChartPluginConfig,Gp as ChartWidgetPlugin,Rc as CommandHistoryPanel,Of as CommonPropTypes,We as ConsoleEvent,Hi as ConsolePanel,mf as ConsolePlugin,wf as ControlType,At as DropdownFilterPanel,Ov as FileExplorerPanel,Zp as FilterPlugin,ff as FilterPluginConfig,Mv as FilterSetManager,Gi as FilterSetManagerPanel,gf as GridPanelPlugin,bf as GridPluginConfig,sm as GridWidgetPlugin,fe as InputFilterEvent,Ln as InputFilterPanel,Ze as IrisGridEvent,In as IrisGridPanel,wm as LinkerPlugin,Cf as LinkerPluginConfig,Gt as LinkerUtils,ip as LogPanel,Xh as MarkdownEvent,un as MarkdownPanel,Lm as MarkdownPlugin,Sf as MarkdownPluginConfig,hf as MockFileStorage,ie as NotebookEvent,Rt as NotebookPanel,af as PandasEvent,Lp as PandasPanel,Ef as PandasPanelPlugin,yf as PandasPluginConfig,Im as PandasWidgetPlugin,pt as Panel,zn as TabEvent,at as ToolType,Tf as UIPropTypes,Um as WidgetLoaderPlugin,Pf as WidgetLoaderPluginConfig,Si as WidgetPanel,Ci as WidgetPanelTooltip,fc as addDashboardLinks,gc as deleteDashboardLinks,Pr as getColumnSelectionValidatorForDashboard,Ro as getColumnsForDashboard,lf as getDashboardConnection,of as getDashboardConsoleSettings,$n as getDashboardSessionWrapper,mc as getFilterSetsForDashboard,Sr as getInputFiltersForDashboard,yr as getIsolatedLinkerPanelIdForDashboard,on as getLinksForDashboard,Er as getTableMapForDashboard,yc as isChartPanelDehydratedProps,Ao as isChartPanelFigureMetadata,On as isChartPanelTableMetadata,Ec as isGLChartPanelState,Fv as isIrisGridPanelMetadata,xv as isLegacyIrisGridPanelMetadata,bc as setDashboardColumnSelectionValidator,df as setDashboardConnection,Cc as setDashboardConsoleSettings,Sc as setDashboardFilterSets,ko as setDashboardIsolatedLinkerPanelId,wr as setDashboardLinks,uf as setDashboardSessionWrapper,em as useLoadTablePlugin};
|
|
27
|
-
//# sourceMappingURL=index-
|
|
27
|
+
//# sourceMappingURL=index-d90faf82.js.map
|