@deephaven/code-studio 1.29.0 → 1.29.1-plugin-optional-deps.fd4cf96.0.sha-fd4cf96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/build/assets/{AppRoot-ByNXRX9Z.js → AppRoot-BYgUP461.js} +4 -4
  2. package/build/assets/{AppRoot-ByNXRX9Z.js.map → AppRoot-BYgUP461.js.map} +1 -1
  3. package/build/assets/{Chart-CJdYQdQ9.js → Chart-BQ8I4i7L.js} +2 -2
  4. package/build/assets/{Chart-CJdYQdQ9.js.map → Chart-BQ8I4i7L.js.map} +1 -1
  5. package/build/assets/{ControlType-nb8hu8xE.js → ControlType-dZUYFjWs.js} +5 -5
  6. package/build/assets/ControlType-dZUYFjWs.js.map +1 -0
  7. package/build/assets/{FormatterUtils-Cwnqibxb.js → FormatterUtils-BexTF7Pg.js} +2 -2
  8. package/build/assets/{FormatterUtils-Cwnqibxb.js.map → FormatterUtils-BexTF7Pg.js.map} +1 -1
  9. package/build/assets/{Grid-CC2-iJqc.js → Grid-Tx2xMiLi.js} +2 -2
  10. package/build/assets/{Grid-CC2-iJqc.js.map → Grid-Tx2xMiLi.js.map} +1 -1
  11. package/build/assets/{IrisGrid-BPHKbuAd.js → IrisGrid-BrXTJDXQ.js} +2 -2
  12. package/build/assets/{IrisGrid-BPHKbuAd.js.map → IrisGrid-BrXTJDXQ.js.map} +1 -1
  13. package/build/assets/{IrisGridModel-6bsriUgB.js → IrisGridModel-C29Knup_.js} +4 -4
  14. package/build/assets/{IrisGridModel-6bsriUgB.js.map → IrisGridModel-C29Knup_.js.map} +1 -1
  15. package/build/assets/{IrisGridShortcuts-CcND9SFE.js → IrisGridShortcuts-C-HT1iXy.js} +2 -2
  16. package/build/assets/{IrisGridShortcuts-CcND9SFE.js.map → IrisGridShortcuts-C-HT1iXy.js.map} +1 -1
  17. package/build/assets/{LocalWorkspaceStorage-w_1OqBoq.js → LocalWorkspaceStorage-CGX54FlI.js} +2 -2
  18. package/build/assets/{LocalWorkspaceStorage-w_1OqBoq.js.map → LocalWorkspaceStorage-CGX54FlI.js.map} +1 -1
  19. package/build/assets/{MarkdownEditor-Cb40ZdjN.js → MarkdownEditor-BTW0kH2X.js} +2 -2
  20. package/build/assets/{MarkdownEditor-Cb40ZdjN.js.map → MarkdownEditor-BTW0kH2X.js.map} +1 -1
  21. package/build/assets/{MarkdownNotebook-DWizeaXM.js → MarkdownNotebook-CO6sIiLu.js} +2 -2
  22. package/build/assets/{MarkdownNotebook-DWizeaXM.js.map → MarkdownNotebook-CO6sIiLu.js.map} +1 -1
  23. package/build/assets/{MissingPartitionError-DBtE4dG7.js → MissingPartitionError-DvnHZsCQ.js} +2 -2
  24. package/build/assets/{MissingPartitionError-DBtE4dG7.js.map → MissingPartitionError-DvnHZsCQ.js.map} +1 -1
  25. package/build/assets/{MockChartModel-CRlmr2a-.js → MockChartModel-aVTbWE3h.js} +2 -2
  26. package/build/assets/{MockChartModel-CRlmr2a-.js.map → MockChartModel-aVTbWE3h.js.map} +1 -1
  27. package/build/assets/{PasteKeyHandler-C4_aCP1Y.js → PasteKeyHandler-C2c93kPX.js} +2 -2
  28. package/build/assets/{PasteKeyHandler-C4_aCP1Y.js.map → PasteKeyHandler-C2c93kPX.js.map} +1 -1
  29. package/build/assets/{Picker-DT2FM8Mj.js → Picker-fFRNaQIf.js} +2 -2
  30. package/build/assets/{Picker-DT2FM8Mj.js.map → Picker-fFRNaQIf.js.map} +1 -1
  31. package/build/assets/{StyleGuideRoot-B1uTaf3Y.js → StyleGuideRoot-BuzXY_Hc.js} +2 -2
  32. package/build/assets/{StyleGuideRoot-B1uTaf3Y.js.map → StyleGuideRoot-BuzXY_Hc.js.map} +1 -1
  33. package/build/assets/{index-JVa8V3fu.js → index-Bw2lPjhG.js} +2 -2
  34. package/build/assets/{index-JVa8V3fu.js.map → index-Bw2lPjhG.js.map} +1 -1
  35. package/build/assets/{index-thrdP8Nk.js → index-CrdwB1d9.js} +3 -3
  36. package/build/assets/{index-thrdP8Nk.js.map → index-CrdwB1d9.js.map} +1 -1
  37. package/build/assets/{index-dXs3zbSl.js → index-CyLZEMYM.js} +4 -4
  38. package/build/assets/{index-dXs3zbSl.js.map → index-CyLZEMYM.js.map} +1 -1
  39. package/build/index.html +1 -1
  40. package/package.json +31 -31
  41. package/build/assets/ControlType-nb8hu8xE.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{r as S,I as s,K as J,ad as Ii,H as dn,U as Oe,M as ie,L as un,a0 as gt,a1 as ne,bJ as ze,bD as Ba,bE as Ha,bC as Wa,a7 as qn,bk as Yn,a9 as Xn,bG as Zn,aw as Qt}from"./vendor-06-vIFQy.js";import{f as Cn,L as Ce,a3 as Pt,e as K,g as Sn,ce as Jn,cf as za,cg as Ka,W as hn,aO as Pi,aP as Qa,c9 as Mi,ca as cn,ch as qa,ci as Ya,cj as ei,aT as Xa,ck as ti,cl as qt,bI as ni,cm as Za,aU as Ja,cn as er,aK as tr,co as nr,cp as ir,aX as ar,br as rr,bm as or,M as ki,b as Li,cq as sr,cr as lr,c as Vi,k as Ui,G as dr,cs as ur,ct as hr,b_ as cr,aS as mr,cu as gr,w as vr,cv as pr,cw as fr,cx as Cr,t as Sr,b2 as br,cy as yr,bB as Yt,bM as Tr}from"./index-thrdP8Nk.js";import{o as wr,p as Er,q as Fr,t as Ar,K as ht,I as se,g as xr,k as ct,a as It,F as Ie,u as mn,v as gn,N as de,w as Nr,x as me,B as be,y as Or,z as _r,D as ii,E as Rr,G as Dr,H as jr,J as Ir,L as Pr,O as Mr,P as ke,Q as Se,R as xe,T as ai,U as $i,V as Mt,W as Gi,X as kr,f as Lr,c as Xt,Y as Vr,n as Ur,i as $r}from"./MissingPartitionError-DBtE4dG7.js";import{c as w,S as vt,B as Q,y as bn,P as Ae,O as rt,e9 as Gr,v as ft,aS as Bi,af as Hi,dq as Br,at as le,dC as Ee,V as Wi,_ as Hr,t as Le,au as zi,C as Wr,dM as Ki,Y as zr,c0 as Kr,T as we,U as Qr,b0 as qr,F as Zt,aw as Yr,bA as Xr,ea as Zr,bh as Qi}from"./ControlType-nb8hu8xE.js";import{aa as Jr,u as Te,P as eo,E as to,F as no,a0 as X,a8 as io,X as ao,a9 as At,a5 as He,H as ro,Y as oo,_ as so,K as lo,L as uo,Z as ho,T as co,N as mo,R as go,a1 as vo,W as po,Q as fo,ab as Jt,ac as Co,A as So,x as bo,a3 as yo,B as To,a7 as wo,z as Eo,D as Fo,a6 as Ao,M as xo,U as No}from"./Picker-DT2FM8Mj.js";import{e as qi,G as Yi,f as Fe,g as vn,R as Oo,I as ce}from"./IrisGridModel-6bsriUgB.js";import{S as _o,K as kt,p as De,f as Xi,C as yn,M as Ro,b as Do,i as jo,P as ri}from"./PasteKeyHandler-C4_aCP1Y.js";import{I as Ke,p as oi,P as Io,x as si,S as Po,D as Mo}from"./IrisGridShortcuts-CcND9SFE.js";import{F as li}from"./FormatterUtils-Cwnqibxb.js";import{G as ko}from"./Grid-CC2-iJqc.js";import"./helpers-BosuxZz1.js";import"./monaco-DaE0jI-i.js";import"./useMergeRef-BWn972oh.js";function di(i,e,t){return(e=Lo(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Lo(i){var e=Vo(i,"string");return typeof e=="symbol"?e:e+""}function Vo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var xt=Ce.module("AdvancedFilterCreatorFilterItem");class Tn extends S.PureComponent{static getLabelForFilter(e,t){try{if(w.isNumberType(e)||w.isCharType(e))return wr(t);if(w.isTextType(e))return Er(t);if(w.isDateType(e))return Fr(t);if(w.isBooleanType(e))return Ar(t);throw new Error("Unrecognized column type: ".concat(e))}catch(n){return xt.warn(n),""}}constructor(e){super(e),di(this,"typeDropdown",void 0),di(this,"getCachedIsValid",Ii((l,d,u,h,m)=>{try{return!u||m.makeAdvancedValueFilter(l,d,u,h)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var t=e.value,n=t===void 0?"":t,a=e.filterTypes,r=e.selectedType,o=r===void 0?a[0]:r;this.state={selectedType:o,value:n}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var t=this.props,n=t.value,a=t.selectedType;a!==void 0&&e.selectedType!==a&&this.setState({selectedType:a}),n!==void 0&&e.value!==n&&this.setState({value:n})}handleTypeChange(e){var t=e;xt.debug2("typeChange",t),this.setState({selectedType:t});var n=this.props.onChange,a=this.state.value;a!=null&&a.length>0&&n(t,a)}handleValueChange(e){xt.debug2("valueChange");var t=e.target.value;this.setState({value:t});var n=this.props.onChange,a=this.state.selectedType;a!=null&&n(a,t)}handleDelete(){xt.debug("delete");var e=this.props.onDelete;e()}render(){for(var e=this.props,t=e.column,n=e.filterTypes,a=e.formatter,r=e.tableUtils,o=this.state,l=o.selectedType,d=o.value,u=!w.isBooleanType(t.type),h=[],m=this.getCachedIsValid(t,l,d,a.timeZone,r),v=0;v<n.length;v+=1){var c=n[v],b=Tn.getLabelForFilter(t.type,c),p=s.jsx("option",{value:c,children:b},c);h.push(p)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(vt,{className:"form-control",value:l,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:h})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:J("form-control",{error:!m}),placeholder:"Enter value",value:d,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(Q,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Cn,tooltip:"Remove Filter"})})]})})}}function pn(i,e,t){return(e=Uo(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Uo(i){var e=$o(i,"string");return typeof e=="symbol"?e:e+""}function $o(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var ui=Ce.module("AdvancedFilterCreatorSelectValueList");class Ct extends S.PureComponent{static indexOf(e,t){for(var n=0;n<t.length;n+=1){var a=t[n];if(a===e||a!=null&&a.valueOf!=null&&e!=null&&e.valueOf!=null&&a.valueOf()===e.valueOf())return n}return-1}constructor(e){super(e),pn(this,"dh",void 0),pn(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var t=this.props,n=t.selectedValues,a=t.dh;this.dh=a,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:n,isLoading:!0}}componentDidMount(){var e=this.props.table;e&&this.startListening(e)}componentDidUpdate(e){var t=this.props,n=t.filters,a=t.invertSelection,r=t.selectedValues,o=t.table;e.table!==o&&(e.table&&this.stopListening(e.table),o&&this.startListening(o),this.resetViewport()),e.invertSelection!==a&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==r&&this.setState({selectedValues:r},this.handleSelectionUpdate),e.filters!==n&&(o==null||o.applyFilter(n),this.resetViewport())}componentWillUnmount(){var e=this.props.table;e&&this.stopListening(e)}handleSelect(e,t){var n=this.props.invertSelection,a=this.state.selectedValues;a=[...a];var r=Ct.indexOf(t,a);r>=0?a.splice(r,1):a.push(t);var o=r<0;n&&(o=!o);var l=this.state.offset,d=this.state.items;d=[...d];var u=e-l;u>=0&&u<d.length&&(d[u].isSelected=o),this.setState({items:d,selectedValues:a});var h=this.props.onChange;h(a,n)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var t=this.props,n=t.table,a=t.formatter;if(n){for(var r=e.detail,o=r.offset,l=[],d=n.columns[0],u=0;u<r.rows.length;u+=1){var h=r.rows[u],m=h.get(d),v=void 0;m==null?v=s.jsx("i",{className:"text-muted",children:"null"}):m===""?v=s.jsx("i",{className:"text-muted",children:"empty"}):v=a.getFormattedString(m,d.type,d.name);var c=this.isValueSelected(m);l.push({displayValue:v,value:m,isSelected:c})}ui.debug2("Received table update:",o,l.length);var b=n.size;this.setState({itemCount:b,items:l,offset:o,isLoading:!1})}}isValueSelected(e){var t=this.props.invertSelection,n=this.state.selectedValues,a=Ct.indexOf(e,n);return t?a<0:a>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var e=this.state.items;e=[...e];for(var t=0;t<e.length;t+=1){var n=e[t],a=n.value;n.isSelected=this.isValueSelected(a)}this.setState({items:e})}updateViewport(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.props.table;if(a!=null){n&&this.setState({isLoading:!0});var r=t-e+1,o=Math.max(0,e-r*3),l=Math.max(o,t+r*3);ui.debug2("Setting viewport",o,",",l),a.setViewport(o,l)}}render(){var e=this.state,t=e.offset,n=e.isLoading,a=e.items,r=e.itemCount;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(_o,{itemCount:r,items:a,offset:t,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:o=>{this.list=o}}),s.jsx(bn,{in:n,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(Pt,{className:"loading-spinner-large"})})})]})}}pn(Ct,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});function pt(i,e,t){return(e=Go(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Go(i){var e=Bo(i,"string");return typeof e=="symbol"?e:e+""}function Bo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class bt extends S.PureComponent{constructor(e){super(e),pt(this,"searchTablePromise",void 0),pt(this,"tableUtils",void 0),pt(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var t=e.dh,n=e.invertSelection,a=e.selectedValues;this.tableUtils=new w(t),this.state={filters:[],invertSelection:n,selectedValues:a,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var n=this.props,a=n.invertSelection,r=n.selectedValues,o=n.table;e.table!==o&&this.initSearchTable(),e.invertSelection!==a&&this.setState({invertSelection:a}),e.selectedValues!==r&&this.setState({selectedValues:r});var l=this.state,d=l.table,u=l.searchText;d!==t.table&&(t.table!=null&&t.table.close(),d!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var e=this.state.table;e!=null&&e.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var e=this.props.table;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var e=this.state,t=e.invertSelection,n=e.selectedValues,a=e.table;return a==null?null:t?a.totalSize-n.length:n.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),t=this.state.table,n=this.props.formatter;if(e!=null&&t!=null){var a=n.getFormattedString(e,"long"),r=n.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(a," of ").concat(r)}return null}initSearchTable(){var e=this.props.table;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(n=>{this.searchTablePromise===t?(this.setState({table:n}),this.searchTablePromise=void 0):n.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var n=this.props.onChange;n(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var n=this.props.onChange;n(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,bt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var e=this.state,t=e.table,n=e.searchText,a=this.props.timeZone,r=this.tableUtils,o=t==null?void 0:t.columns[0],l=[];if(o!=null){var d;if(n.length>0){var u=null;w.isCharType(o.type)?u=r.makeQuickFilter(o,n):w.isTextType(o.type)?u=r.makeQuickFilter(o,"~".concat(n),a):u=r.makeQuickFilter(o,">=".concat(n),a),u!=null?l.push(u):d="Invalid search text"}this.setState({filters:l,error:d})}}render(){var e=this.state,t=e.error,n=e.filters,a=e.invertSelection,r=e.selectedValues,o=e.searchText,l=e.table,d=this.props,u=d.dh,h=d.formatter,m=d.showSearch,v=this.getColumnName(),c=this.getDisplayedValueText(),b=v?"Find ".concat(v,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:m?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),m&&s.jsx("input",{type:"text",className:J("form-control",{"is-invalid":t!=null}),id:"advanced-filter-creator-select-value-input",placeholder:b,value:o,onChange:this.handleSearchChange})]}),s.jsx(Ct,{dh:u,table:l,filters:n,invertSelection:a,selectedValues:r,formatter:h,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(Q,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(Q,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(bn,{in:c!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:c})})]})]})}}pt(bt,"searchDebounceTime",250);pt(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});function et(i,e,t){return(e=Ho(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ho(i){var e=Wo(i,"string");return typeof e=="symbol"?e:e+""}function Wo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var ot=Ce.module("AdvancedFilterCreator");class Ne extends S.PureComponent{static makeFilterItem(){return{key:dn()}}constructor(e){var t,n;super(e),et(this,"focusTrapContainer",void 0),et(this,"debounceTimeout",void 0),et(this,"valuesTablePromise",void 0),et(this,"getFilterTypes",Ii(c=>w.getFilterTypes(c))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=Oe.createRef();var a=e.model,r=e.column,o=e.options,l=o.filterOperators,d=o.invertSelection,u=o.selectedValues,h=(t=(n=o.filterItems)===null||n===void 0?void 0:n.map(c=>{var b=c.selectedType,p=c.value;return{selectedType:b,value:p,key:dn()}}))!==null&&t!==void 0?t:[];h.length===0&&h.push(Ne.makeFilterItem()),l==null&&(l=[]),d==null&&(d=!0),u==null&&(u=[]);var m=a.getColumnIndexByName(r.name);K(m);var v=a.isColumnSortable(m);this.state={filterItems:h,filterOperators:l,invertSelection:d,selectedValues:u,valuesTableError:null,valuesTable:void 0,isSortable:v}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var e=this.props,t=e.model,n=e.column;if(!t.isValuesTableAvailable){ot.debug("No values table for this model, just ignore");return}this.valuesTablePromise=w.makeCancelableTablePromise(t.valuesTable(n)),this.valuesTablePromise.then(a=>{var r;if(!((r=a.columns[0].isSortable)!==null&&r!==void 0)||r){var o=a.columns[0].sort().asc();a.applySort([o])}this.setState({valuesTable:a})}).catch(a=>{Ae.isCanceled(a)||(ot.error("Unable to open values table",a),this.setState({valuesTableError:a}))})}handleFocusTrapEnd(){var e;((e=this.focusTrapContainer)===null||e===void 0||(e=e.current)===null||e===void 0?void 0:e.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t=(e=this.focusTrapContainer)===null||e===void 0||(e=e.current)===null||e===void 0?void 0:e.querySelectorAll("button,select,input,textarea");if(t&&t.length>0){var n=t[t.length-1];n.focus()}}handleAddAnd(){var e=this.state,t=e.filterItems,n=e.filterOperators;t=t.concat(Ne.makeFilterItem()),n=n.concat(rt.and),this.setState({filterItems:t,filterOperators:n})}handleAddOr(){var e=this.state,t=e.filterItems,n=e.filterOperators;t=t.concat(Ne.makeFilterItem()),n=n.concat(rt.or),this.setState({filterItems:t,filterOperators:n})}handleChangeFilterOperator(e,t){var n=this.state.filterOperators;n=[...n],Gr(t),n[e]=t,this.setState({filterOperators:n}),this.startUpdateTimer()}handleFilterChange(e,t,n){var a=this.state.filterItems;a=[...a];var r=a[e].key;a[e]={key:r,selectedType:t,value:n},this.setState({filterItems:a}),this.startUpdateTimer()}handleFilterDelete(e){var t=this.state,n=t.filterItems,a=t.filterOperators;n=[...n],a=[...a],e<n.length&&n.splice(e,1),e<a.length?a.splice(e,1):e===a.length&&a.splice(a.length-1,1),n.length===0&&n.push(Ne.makeFilterItem()),this.setState({filterItems:n,filterOperators:a}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){ot.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ne.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=ft.isModifierKeyDown(e);this.sortTable(w.sortDirection.descending,t)}handleSortUp(e){var t=ft.isModifierKeyDown(e);this.sortTable(w.sortDirection.ascending,t)}handleSubmit(e){ot.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){ot.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var t=this.props.onDone;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var e=this.state.filterItems;if(e.length===0)return!1;var t=e[e.length-1],n=t.selectedType,a=t.value;return n!=null&&n.length>0&&a!=null&&a.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.props,a=n.column,r=n.onSortChange,o=this.state.isSortable;o&&r(a,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ne.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var e=this.state,t=e.filterItems,n=e.filterOperators,a=e.invertSelection,r=e.selectedValues,o=this.props,l=o.column,d=o.onFilterChange,u=o.model,h=o.tableUtils,m=u.formatter,v=t.filter(f=>{var y=f.selectedType,F=f.value;return y!=null&&F!=null&&F!==""}),c=n.filter((f,y)=>f!=null&&t[y].selectedType!=null&&t[y].value!=null&&t[y].value!=="").slice(0,v.length-1),b={filterItems:v,filterOperators:c,invertSelection:a,selectedValues:r},p=h.makeAdvancedFilter(l,b,m.timeZone);d(l,p,b)}render(){var e=this,t=this.props,n=t.column,a=t.model,r=t.sortDirection,o=t.formatter,l=t.tableUtils,d=t.isMaximized,u=t.onToggleMaximize,h=this.state,m=h.filterItems,v=h.filterOperators,c=h.invertSelection,b=h.selectedValues,p=h.valuesTable,f=h.valuesTableError,y=h.isSortable,F=a.dh,_=a.isValuesTableAvailable,T=w.isBooleanType(n.type),k=w.isDateType(n.type),D=this.getFilterTypes(n.type),C=n.type.substring(n.type.lastIndexOf(".")+1),x=[];if(!T&&D.length)for(var R=function(U){var q=m[U],$=q.key,Z=q.selectedType,G=q.value,B=s.jsx(Tn,{column:n,filterTypes:D,onChange:e.getFilterChangeHandler(U),onDelete:e.getFilterDeleteHandler(U),selectedType:Z,value:G,formatter:o,tableUtils:l},$);if(x.push(B),U<v.length){var ee=v[U],te=ee===rt.and,ue=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(Q,{kind:"ghost",className:J("filter-operator",{active:te}),onClick:()=>e.handleChangeFilterOperator(U,rt.and),children:"AND"}),s.jsx(Q,{kind:"ghost",className:J("filter-operator",{active:!te}),onClick:()=>e.handleChangeFilterOperator(U,rt.or),children:"OR"})]},"filterOperator".concat($));x.push(ue)}},P=0;P<m.length;P+=1)R(P);var z=this.shouldShowAddFilter(),M=s.jsxs("div",{className:J("form-row justify-content-end add-filter-item",{hidden:!z}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(ie,{icon:Sn})}),s.jsx(Q,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!z,tooltip:"Add filter with AND",children:"AND"}),s.jsx(Q,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!z,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return x.push(M),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:r===w.sortDirection.descending}),onClick:this.handleSortDown,icon:Jn,tooltip:y?"Sort ".concat(n.name," Descending"):"Not sortable",disabled:!y}),s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:r===w.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(ie,{icon:Jn,rotation:180}),tooltip:y?"Sort ".concat(n.name," Ascending"):"Not sortable",disabled:!y}),s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:d}),onClick:u,icon:d?za:Ka,tooltip:d?"Restore dialog size":"Maximize dialog"})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[n.name," ",s.jsxs("span",{className:"column-type",children:["(",C,")"]})]}),x,_&&f==null&&s.jsxs(s.Fragment,{children:[!T&&s.jsx("hr",{}),s.jsx("div",{className:"form-group advanced-filter-values-group",children:s.jsx(bt,{dh:F,table:p,onChange:this.handleSelectValueChange,invertSelection:c,selectedValues:b,formatter:o,showSearch:!k,timeZone:o.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(Q,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(Q,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}et(Ne,"debounceFilterUpdate",250);et(Ne,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});function Lt(i){var e=i.animation,t=e===void 0?"iris-grid-bottom-bar-slide-up":e,n=i.children,a=i.className,r=i.isShown,o=i.onClick,l=i.onEntering,d=i.onEntered,u=i.onExiting,h=i.onExited,m=S.useRef(null);return s.jsx(un,{in:r,timeout:hn.transitionMs,classNames:t,onEntering:l,onEntered:d,onExiting:u,onExited:h,mountOnEnter:!0,unmountOnExit:!0,nodeRef:m,children:s.jsx("div",{ref:m,className:J("iris-grid-bottom-bar",a),role:"presentation",onClick:o,onKeyPress:o,children:n})})}function hi(i,e){return qo(i)||Qo(i,e)||Ko(i,e)||zo()}function zo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as S,I as s,K as J,ad as Ii,H as dn,U as Oe,M as ie,L as un,a0 as gt,a1 as ne,bJ as ze,bD as Ba,bE as Ha,bC as Wa,a7 as qn,bk as Yn,a9 as Xn,bG as Zn,aw as Qt}from"./vendor-06-vIFQy.js";import{f as Cn,L as Ce,a3 as Pt,e as K,g as Sn,ce as Jn,cf as za,cg as Ka,W as hn,aO as Pi,aP as Qa,c9 as Mi,ca as cn,ch as qa,ci as Ya,cj as ei,aT as Xa,ck as ti,cl as qt,bI as ni,cm as Za,aU as Ja,cn as er,aK as tr,co as nr,cp as ir,aX as ar,br as rr,bm as or,M as ki,b as Li,cq as sr,cr as lr,c as Vi,k as Ui,G as dr,cs as ur,ct as hr,b_ as cr,aS as mr,cu as gr,w as vr,cv as pr,cw as fr,cx as Cr,t as Sr,b2 as br,cy as yr,bB as Yt,bM as Tr}from"./index-CrdwB1d9.js";import{o as wr,p as Er,q as Fr,t as Ar,K as ht,I as se,g as xr,k as ct,a as It,F as Ie,u as mn,v as gn,N as de,w as Nr,x as me,B as be,y as Or,z as _r,D as ii,E as Rr,G as Dr,H as jr,J as Ir,L as Pr,O as Mr,P as ke,Q as Se,R as xe,T as ai,U as $i,V as Mt,W as Gi,X as kr,f as Lr,c as Xt,Y as Vr,n as Ur,i as $r}from"./MissingPartitionError-DvnHZsCQ.js";import{c as w,S as vt,B as Q,y as bn,P as Ae,O as rt,e9 as Gr,v as ft,aS as Bi,af as Hi,dq as Br,at as le,dC as Ee,V as Wi,_ as Hr,t as Le,au as zi,C as Wr,dM as Ki,Y as zr,c0 as Kr,T as we,U as Qr,b0 as qr,F as Zt,aw as Yr,bA as Xr,ea as Zr,bh as Qi}from"./ControlType-dZUYFjWs.js";import{aa as Jr,u as Te,P as eo,E as to,F as no,a0 as X,a8 as io,X as ao,a9 as At,a5 as He,H as ro,Y as oo,_ as so,K as lo,L as uo,Z as ho,T as co,N as mo,R as go,a1 as vo,W as po,Q as fo,ab as Jt,ac as Co,A as So,x as bo,a3 as yo,B as To,a7 as wo,z as Eo,D as Fo,a6 as Ao,M as xo,U as No}from"./Picker-fFRNaQIf.js";import{e as qi,G as Yi,f as Fe,g as vn,R as Oo,I as ce}from"./IrisGridModel-C29Knup_.js";import{S as _o,K as kt,p as De,f as Xi,C as yn,M as Ro,b as Do,i as jo,P as ri}from"./PasteKeyHandler-C2c93kPX.js";import{I as Ke,p as oi,P as Io,x as si,S as Po,D as Mo}from"./IrisGridShortcuts-C-HT1iXy.js";import{F as li}from"./FormatterUtils-BexTF7Pg.js";import{G as ko}from"./Grid-Tx2xMiLi.js";import"./helpers-BosuxZz1.js";import"./monaco-DaE0jI-i.js";import"./useMergeRef-BWn972oh.js";function di(i,e,t){return(e=Lo(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Lo(i){var e=Vo(i,"string");return typeof e=="symbol"?e:e+""}function Vo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var xt=Ce.module("AdvancedFilterCreatorFilterItem");class Tn extends S.PureComponent{static getLabelForFilter(e,t){try{if(w.isNumberType(e)||w.isCharType(e))return wr(t);if(w.isTextType(e))return Er(t);if(w.isDateType(e))return Fr(t);if(w.isBooleanType(e))return Ar(t);throw new Error("Unrecognized column type: ".concat(e))}catch(n){return xt.warn(n),""}}constructor(e){super(e),di(this,"typeDropdown",void 0),di(this,"getCachedIsValid",Ii((l,d,u,h,m)=>{try{return!u||m.makeAdvancedValueFilter(l,d,u,h)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var t=e.value,n=t===void 0?"":t,a=e.filterTypes,r=e.selectedType,o=r===void 0?a[0]:r;this.state={selectedType:o,value:n}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var t=this.props,n=t.value,a=t.selectedType;a!==void 0&&e.selectedType!==a&&this.setState({selectedType:a}),n!==void 0&&e.value!==n&&this.setState({value:n})}handleTypeChange(e){var t=e;xt.debug2("typeChange",t),this.setState({selectedType:t});var n=this.props.onChange,a=this.state.value;a!=null&&a.length>0&&n(t,a)}handleValueChange(e){xt.debug2("valueChange");var t=e.target.value;this.setState({value:t});var n=this.props.onChange,a=this.state.selectedType;a!=null&&n(a,t)}handleDelete(){xt.debug("delete");var e=this.props.onDelete;e()}render(){for(var e=this.props,t=e.column,n=e.filterTypes,a=e.formatter,r=e.tableUtils,o=this.state,l=o.selectedType,d=o.value,u=!w.isBooleanType(t.type),h=[],m=this.getCachedIsValid(t,l,d,a.timeZone,r),v=0;v<n.length;v+=1){var c=n[v],b=Tn.getLabelForFilter(t.type,c),p=s.jsx("option",{value:c,children:b},c);h.push(p)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(vt,{className:"form-control",value:l,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:h})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:J("form-control",{error:!m}),placeholder:"Enter value",value:d,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(Q,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Cn,tooltip:"Remove Filter"})})]})})}}function pn(i,e,t){return(e=Uo(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Uo(i){var e=$o(i,"string");return typeof e=="symbol"?e:e+""}function $o(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var ui=Ce.module("AdvancedFilterCreatorSelectValueList");class Ct extends S.PureComponent{static indexOf(e,t){for(var n=0;n<t.length;n+=1){var a=t[n];if(a===e||a!=null&&a.valueOf!=null&&e!=null&&e.valueOf!=null&&a.valueOf()===e.valueOf())return n}return-1}constructor(e){super(e),pn(this,"dh",void 0),pn(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var t=this.props,n=t.selectedValues,a=t.dh;this.dh=a,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:n,isLoading:!0}}componentDidMount(){var e=this.props.table;e&&this.startListening(e)}componentDidUpdate(e){var t=this.props,n=t.filters,a=t.invertSelection,r=t.selectedValues,o=t.table;e.table!==o&&(e.table&&this.stopListening(e.table),o&&this.startListening(o),this.resetViewport()),e.invertSelection!==a&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==r&&this.setState({selectedValues:r},this.handleSelectionUpdate),e.filters!==n&&(o==null||o.applyFilter(n),this.resetViewport())}componentWillUnmount(){var e=this.props.table;e&&this.stopListening(e)}handleSelect(e,t){var n=this.props.invertSelection,a=this.state.selectedValues;a=[...a];var r=Ct.indexOf(t,a);r>=0?a.splice(r,1):a.push(t);var o=r<0;n&&(o=!o);var l=this.state.offset,d=this.state.items;d=[...d];var u=e-l;u>=0&&u<d.length&&(d[u].isSelected=o),this.setState({items:d,selectedValues:a});var h=this.props.onChange;h(a,n)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var t=this.props,n=t.table,a=t.formatter;if(n){for(var r=e.detail,o=r.offset,l=[],d=n.columns[0],u=0;u<r.rows.length;u+=1){var h=r.rows[u],m=h.get(d),v=void 0;m==null?v=s.jsx("i",{className:"text-muted",children:"null"}):m===""?v=s.jsx("i",{className:"text-muted",children:"empty"}):v=a.getFormattedString(m,d.type,d.name);var c=this.isValueSelected(m);l.push({displayValue:v,value:m,isSelected:c})}ui.debug2("Received table update:",o,l.length);var b=n.size;this.setState({itemCount:b,items:l,offset:o,isLoading:!1})}}isValueSelected(e){var t=this.props.invertSelection,n=this.state.selectedValues,a=Ct.indexOf(e,n);return t?a<0:a>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var e=this.state.items;e=[...e];for(var t=0;t<e.length;t+=1){var n=e[t],a=n.value;n.isSelected=this.isValueSelected(a)}this.setState({items:e})}updateViewport(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.props.table;if(a!=null){n&&this.setState({isLoading:!0});var r=t-e+1,o=Math.max(0,e-r*3),l=Math.max(o,t+r*3);ui.debug2("Setting viewport",o,",",l),a.setViewport(o,l)}}render(){var e=this.state,t=e.offset,n=e.isLoading,a=e.items,r=e.itemCount;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(_o,{itemCount:r,items:a,offset:t,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:o=>{this.list=o}}),s.jsx(bn,{in:n,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(Pt,{className:"loading-spinner-large"})})})]})}}pn(Ct,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});function pt(i,e,t){return(e=Go(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Go(i){var e=Bo(i,"string");return typeof e=="symbol"?e:e+""}function Bo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class bt extends S.PureComponent{constructor(e){super(e),pt(this,"searchTablePromise",void 0),pt(this,"tableUtils",void 0),pt(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var t=e.dh,n=e.invertSelection,a=e.selectedValues;this.tableUtils=new w(t),this.state={filters:[],invertSelection:n,selectedValues:a,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var n=this.props,a=n.invertSelection,r=n.selectedValues,o=n.table;e.table!==o&&this.initSearchTable(),e.invertSelection!==a&&this.setState({invertSelection:a}),e.selectedValues!==r&&this.setState({selectedValues:r});var l=this.state,d=l.table,u=l.searchText;d!==t.table&&(t.table!=null&&t.table.close(),d!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var e=this.state.table;e!=null&&e.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var e=this.props.table;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var e=this.state,t=e.invertSelection,n=e.selectedValues,a=e.table;return a==null?null:t?a.totalSize-n.length:n.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),t=this.state.table,n=this.props.formatter;if(e!=null&&t!=null){var a=n.getFormattedString(e,"long"),r=n.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(a," of ").concat(r)}return null}initSearchTable(){var e=this.props.table;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(n=>{this.searchTablePromise===t?(this.setState({table:n}),this.searchTablePromise=void 0):n.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var n=this.props.onChange;n(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var n=this.props.onChange;n(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,bt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var e=this.state,t=e.table,n=e.searchText,a=this.props.timeZone,r=this.tableUtils,o=t==null?void 0:t.columns[0],l=[];if(o!=null){var d;if(n.length>0){var u=null;w.isCharType(o.type)?u=r.makeQuickFilter(o,n):w.isTextType(o.type)?u=r.makeQuickFilter(o,"~".concat(n),a):u=r.makeQuickFilter(o,">=".concat(n),a),u!=null?l.push(u):d="Invalid search text"}this.setState({filters:l,error:d})}}render(){var e=this.state,t=e.error,n=e.filters,a=e.invertSelection,r=e.selectedValues,o=e.searchText,l=e.table,d=this.props,u=d.dh,h=d.formatter,m=d.showSearch,v=this.getColumnName(),c=this.getDisplayedValueText(),b=v?"Find ".concat(v,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:m?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),m&&s.jsx("input",{type:"text",className:J("form-control",{"is-invalid":t!=null}),id:"advanced-filter-creator-select-value-input",placeholder:b,value:o,onChange:this.handleSearchChange})]}),s.jsx(Ct,{dh:u,table:l,filters:n,invertSelection:a,selectedValues:r,formatter:h,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(Q,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(Q,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(bn,{in:c!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:c})})]})]})}}pt(bt,"searchDebounceTime",250);pt(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});function et(i,e,t){return(e=Ho(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ho(i){var e=Wo(i,"string");return typeof e=="symbol"?e:e+""}function Wo(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var ot=Ce.module("AdvancedFilterCreator");class Ne extends S.PureComponent{static makeFilterItem(){return{key:dn()}}constructor(e){var t,n;super(e),et(this,"focusTrapContainer",void 0),et(this,"debounceTimeout",void 0),et(this,"valuesTablePromise",void 0),et(this,"getFilterTypes",Ii(c=>w.getFilterTypes(c))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=Oe.createRef();var a=e.model,r=e.column,o=e.options,l=o.filterOperators,d=o.invertSelection,u=o.selectedValues,h=(t=(n=o.filterItems)===null||n===void 0?void 0:n.map(c=>{var b=c.selectedType,p=c.value;return{selectedType:b,value:p,key:dn()}}))!==null&&t!==void 0?t:[];h.length===0&&h.push(Ne.makeFilterItem()),l==null&&(l=[]),d==null&&(d=!0),u==null&&(u=[]);var m=a.getColumnIndexByName(r.name);K(m);var v=a.isColumnSortable(m);this.state={filterItems:h,filterOperators:l,invertSelection:d,selectedValues:u,valuesTableError:null,valuesTable:void 0,isSortable:v}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var e=this.props,t=e.model,n=e.column;if(!t.isValuesTableAvailable){ot.debug("No values table for this model, just ignore");return}this.valuesTablePromise=w.makeCancelableTablePromise(t.valuesTable(n)),this.valuesTablePromise.then(a=>{var r;if(!((r=a.columns[0].isSortable)!==null&&r!==void 0)||r){var o=a.columns[0].sort().asc();a.applySort([o])}this.setState({valuesTable:a})}).catch(a=>{Ae.isCanceled(a)||(ot.error("Unable to open values table",a),this.setState({valuesTableError:a}))})}handleFocusTrapEnd(){var e;((e=this.focusTrapContainer)===null||e===void 0||(e=e.current)===null||e===void 0?void 0:e.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t=(e=this.focusTrapContainer)===null||e===void 0||(e=e.current)===null||e===void 0?void 0:e.querySelectorAll("button,select,input,textarea");if(t&&t.length>0){var n=t[t.length-1];n.focus()}}handleAddAnd(){var e=this.state,t=e.filterItems,n=e.filterOperators;t=t.concat(Ne.makeFilterItem()),n=n.concat(rt.and),this.setState({filterItems:t,filterOperators:n})}handleAddOr(){var e=this.state,t=e.filterItems,n=e.filterOperators;t=t.concat(Ne.makeFilterItem()),n=n.concat(rt.or),this.setState({filterItems:t,filterOperators:n})}handleChangeFilterOperator(e,t){var n=this.state.filterOperators;n=[...n],Gr(t),n[e]=t,this.setState({filterOperators:n}),this.startUpdateTimer()}handleFilterChange(e,t,n){var a=this.state.filterItems;a=[...a];var r=a[e].key;a[e]={key:r,selectedType:t,value:n},this.setState({filterItems:a}),this.startUpdateTimer()}handleFilterDelete(e){var t=this.state,n=t.filterItems,a=t.filterOperators;n=[...n],a=[...a],e<n.length&&n.splice(e,1),e<a.length?a.splice(e,1):e===a.length&&a.splice(a.length-1,1),n.length===0&&n.push(Ne.makeFilterItem()),this.setState({filterItems:n,filterOperators:a}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){ot.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ne.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=ft.isModifierKeyDown(e);this.sortTable(w.sortDirection.descending,t)}handleSortUp(e){var t=ft.isModifierKeyDown(e);this.sortTable(w.sortDirection.ascending,t)}handleSubmit(e){ot.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){ot.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var t=this.props.onDone;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var e=this.state.filterItems;if(e.length===0)return!1;var t=e[e.length-1],n=t.selectedType,a=t.value;return n!=null&&n.length>0&&a!=null&&a.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.props,a=n.column,r=n.onSortChange,o=this.state.isSortable;o&&r(a,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ne.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var e=this.state,t=e.filterItems,n=e.filterOperators,a=e.invertSelection,r=e.selectedValues,o=this.props,l=o.column,d=o.onFilterChange,u=o.model,h=o.tableUtils,m=u.formatter,v=t.filter(f=>{var y=f.selectedType,F=f.value;return y!=null&&F!=null&&F!==""}),c=n.filter((f,y)=>f!=null&&t[y].selectedType!=null&&t[y].value!=null&&t[y].value!=="").slice(0,v.length-1),b={filterItems:v,filterOperators:c,invertSelection:a,selectedValues:r},p=h.makeAdvancedFilter(l,b,m.timeZone);d(l,p,b)}render(){var e=this,t=this.props,n=t.column,a=t.model,r=t.sortDirection,o=t.formatter,l=t.tableUtils,d=t.isMaximized,u=t.onToggleMaximize,h=this.state,m=h.filterItems,v=h.filterOperators,c=h.invertSelection,b=h.selectedValues,p=h.valuesTable,f=h.valuesTableError,y=h.isSortable,F=a.dh,_=a.isValuesTableAvailable,T=w.isBooleanType(n.type),k=w.isDateType(n.type),D=this.getFilterTypes(n.type),C=n.type.substring(n.type.lastIndexOf(".")+1),x=[];if(!T&&D.length)for(var R=function(U){var q=m[U],$=q.key,Z=q.selectedType,G=q.value,B=s.jsx(Tn,{column:n,filterTypes:D,onChange:e.getFilterChangeHandler(U),onDelete:e.getFilterDeleteHandler(U),selectedType:Z,value:G,formatter:o,tableUtils:l},$);if(x.push(B),U<v.length){var ee=v[U],te=ee===rt.and,ue=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(Q,{kind:"ghost",className:J("filter-operator",{active:te}),onClick:()=>e.handleChangeFilterOperator(U,rt.and),children:"AND"}),s.jsx(Q,{kind:"ghost",className:J("filter-operator",{active:!te}),onClick:()=>e.handleChangeFilterOperator(U,rt.or),children:"OR"})]},"filterOperator".concat($));x.push(ue)}},P=0;P<m.length;P+=1)R(P);var z=this.shouldShowAddFilter(),M=s.jsxs("div",{className:J("form-row justify-content-end add-filter-item",{hidden:!z}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(ie,{icon:Sn})}),s.jsx(Q,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!z,tooltip:"Add filter with AND",children:"AND"}),s.jsx(Q,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!z,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return x.push(M),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:r===w.sortDirection.descending}),onClick:this.handleSortDown,icon:Jn,tooltip:y?"Sort ".concat(n.name," Descending"):"Not sortable",disabled:!y}),s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:r===w.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(ie,{icon:Jn,rotation:180}),tooltip:y?"Sort ".concat(n.name," Ascending"):"Not sortable",disabled:!y}),s.jsx(Q,{kind:"ghost",className:J("sort-operator",{active:d}),onClick:u,icon:d?za:Ka,tooltip:d?"Restore dialog size":"Maximize dialog"})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[n.name," ",s.jsxs("span",{className:"column-type",children:["(",C,")"]})]}),x,_&&f==null&&s.jsxs(s.Fragment,{children:[!T&&s.jsx("hr",{}),s.jsx("div",{className:"form-group advanced-filter-values-group",children:s.jsx(bt,{dh:F,table:p,onChange:this.handleSelectValueChange,invertSelection:c,selectedValues:b,formatter:o,showSearch:!k,timeZone:o.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(Q,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(Q,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}et(Ne,"debounceFilterUpdate",250);et(Ne,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});function Lt(i){var e=i.animation,t=e===void 0?"iris-grid-bottom-bar-slide-up":e,n=i.children,a=i.className,r=i.isShown,o=i.onClick,l=i.onEntering,d=i.onEntered,u=i.onExiting,h=i.onExited,m=S.useRef(null);return s.jsx(un,{in:r,timeout:hn.transitionMs,classNames:t,onEntering:l,onEntered:d,onExiting:u,onExited:h,mountOnEnter:!0,unmountOnExit:!0,nodeRef:m,children:s.jsx("div",{ref:m,className:J("iris-grid-bottom-bar",a),role:"presentation",onClick:o,onKeyPress:o,children:n})})}function hi(i,e){return qo(i)||Qo(i,e)||Ko(i,e)||zo()}function zo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ko(i,e){if(i){if(typeof i=="string")return ci(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ci(i,e):void 0}}function ci(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Qo(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function qo(i){if(Array.isArray(i))return i}var Yo=3e3,Xo=5;function Zo(i){var e=i.isSaving,t=e===void 0?!1:e,n=i.onSave,a=i.onDiscard,r=i.discardTooltip,o=i.saveTooltip,l=i.error,d=i.pendingDataErrors,u=i.pendingDataMap,h=i.onEntering,m=i.onEntered,v=i.onExiting,c=i.onExited,b=S.useState(!1),p=hi(b,2),f=p[0],y=p[1],F=S.useState(!1),_=hi(F,2),T=_[0],k=_[1],D=S.useRef(),C=Bi(t),x=S.useMemo(()=>d.size===0?l:d.size<=Xo?"Key can't be empty (on pending row".concat(d.size>1?"s":""," ").concat(Array.from(d.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(d.size," rows)"),[l,d]);S.useEffect(function(){C!=null&&C&&!t&&x==null&&(y(!0),k(!0),D.current=setTimeout(()=>{y(!1)},Yo))},[x,t,C]),S.useEffect(function(){D.current&&u.size>0&&(clearTimeout(D.current),y(!1),k(!1))},[u]),S.useEffect(function(){return()=>D.current?clearTimeout(D.current):void 0},[]);var R=u.size,P;return t?P=s.jsx(Pt,{className:"loading-spinner-vertical-align"}):T&&(P=Qa),s.jsxs(Lt,{className:"pending-data-bottom-bar",isShown:R>0||f||x!=null,onEntering:h,onEntered:m,onExiting:v,onExited:()=>{k(!1),c&&c()},children:[x!=null&&x!==""&&s.jsxs("div",{className:"error-message",children:[s.jsx(ie,{icon:Pi}),s.jsx("span",{children:"".concat(x)})]}),(x==null||x==="")&&s.jsx("div",{className:"status-message",children:R>0&&s.jsx("span",{children:"".concat(R," row").concat(R>1?"s":""," pending")})}),s.jsxs("div",{className:"buttons-container",children:[!t&&!T&&s.jsx(Q,{kind:"secondary",onClick:a,tooltip:r,children:"Discard"}),s.jsxs(Q,{kind:T?"success":"primary",onClick:n,icon:P,disabled:t||T||x!=null,tooltip:o,children:[t&&"Committing...",!t&&T&&"Success",!t&&!T&&"Commit"]})]})]})}function mi(i,e,t,n,a,r,o){try{var l=i[r](o),d=l.value}catch(u){return void t(u)}l.done?e(d):Promise.resolve(d).then(n,a)}function en(i){return function(){var e=this,t=arguments;return new Promise(function(n,a){var r=i.apply(e,t);function o(d){mi(r,n,a,o,l,"next",d)}function l(d){mi(r,n,a,o,l,"throw",d)}o(void 0)})}}function Ve(i,e,t){return(e=Jo(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Jo(i){var e=es(i,"string");return typeof e=="symbol"?e:e+""}function es(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var fe=Ce.module("IrisGridCopyHandler");function tn(i){return i.columnIndex!=null}class L extends S.Component{static getStatusMessageText(e,t){switch(e){case L.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case L.COPY_STATES.KEYED_CONFIRMATION_REQUIRED:return"Keyed selection may be up to ".concat(t.toLocaleString()," rows. Copy to clipboard?");case L.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case L.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case L.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case L.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case L.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case L.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case L.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case L.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),Ve(this,"textData",void 0),Ve(this,"hideTimer",void 0),Ve(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:L.COPY_STATES.IDLE,buttonState:L.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var e=this.props.copyOperation;e!=null&&this.startCopy()}componentDidUpdate(e){var t=this.props.copyOperation;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){fe.debug2("startCopy"),this.stopCopy();var e=this.props,t=e.copyOperation,n=e.model;if(t==null){fe.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var a=t.error;if(a!=null){fe.debug("Showing copy error",a),this.setState({isShown:!0,copyState:L.COPY_STATES.DONE,error:a}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),!tn(t)&&qi(t.selection)){var r=Yi.rowCount(t.selection.toRanges());if(this.setState({rowCount:r}),r>L.NO_PROMPT_THRESHOLD){this.setState({buttonState:L.BUTTON_STATES.COPY,copyState:L.COPY_STATES.CONFIRMATION_REQUIRED});return}}else if(!tn(t)){var o=t.selection instanceof ht?t.selection.getUniqueRowCount():null,l=o??n.rowCount;if(l>L.NO_PROMPT_THRESHOLD){this.setState({rowCount:l,buttonState:L.BUTTON_STATES.COPY,copyState:o!=null?L.COPY_STATES.CONFIRMATION_REQUIRED:L.COPY_STATES.KEYED_CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){fe.debug2("handleBackgroundClick");var e=this.state.copyState;e===L.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){fe.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return en(function*(){if(fe.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){fe.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){fe.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return en(function*(){fe.debug2("copyText",e),t.textData=e,yield Hi(e)})()}showCopyDone(){this.setState({copyState:L.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return en(function*(){e.stopFetch();var t=e.props,n=t.model,a=t.copyOperation;if(tn(a)){var r=a.columnIndex,o=a.columnDepth,l=a.movedColumns;fe.debug("startFetch copyHeader",r,o),e.setState({buttonState:L.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:L.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var d=Fe.getModelIndex(r,l),u=n.textForColumnHeader(d,o);if(u===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:L.COPY_STATES.DONE});return}e.fetchPromise=Ae.makeCancelable(u)}else{var h=a,m=h.selection,v=h.includeHeaders,c=h.userColumnWidths,b=h.movedColumns,p=h.formatValues;fe.debug("startFetch copySelection",m),e.setState({buttonState:L.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:L.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=p!=null&&p?(F,_)=>n.displayString(F,_.type,_.name):F=>"".concat(F);e.fetchPromise=Ae.makeCancelable(Jr(m,n,v,f,b,c))}try{var y=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(y),e.showCopyDone()}catch(F){fe.error("Error copying text",F),e.setState({buttonState:L.BUTTON_STATES.CLICK_TO_COPY,copyState:L.COPY_STATES.CLICK_REQUIRED})}}catch(F){F instanceof Br?fe.debug("User cancelled copy."):(fe.error("Error fetching contents",F),e.fetchPromise=void 0,e.setState({buttonState:L.BUTTON_STATES.RETRY,copyState:L.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(fe.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,L.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var e=this.props,t=e.onEntering,n=e.onEntered,a=e.onExiting,r=e.onExited,o=this.state,l=o.buttonState,d=o.copyState,u=o.isShown,h=o.rowCount,m=o.error,v=d===L.COPY_STATES.DONE?"fade":"copy-slide-up",c=L.getCopyButtonText(l),b=m??L.getStatusMessageText(d,h),p=d!==L.COPY_STATES.DONE,f=l===L.BUTTON_STATES.FETCH_IN_PROGRESS,y=d===L.COPY_STATES.DONE;return s.jsxs(Lt,{animation:v,isShown:u,className:J("iris-grid-copy-handler",{"copy-done":y}),onClick:this.handleBackgroundClick,onEntering:t,onEntered:n,onExiting:a,onExited:r,children:[s.jsx("div",{className:"status-message",children:s.jsx("span",{children:b})}),s.jsx(bn,{in:p,mountOnEnter:!0,unmountOnExit:!0,children:s.jsxs("div",{className:"buttons-container",children:[s.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),s.jsxs(Q,{kind:f?"tertiary":"primary",className:J("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&s.jsx(Pt,{className:"loading-spinner-vertical-align"}),c]})]})})]})}}Ve(L,"NO_PROMPT_THRESHOLD",1e4);Ve(L,"HIDE_TIMEOUT",3e3);Ve(L,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",KEYED_CONFIRMATION_REQUIRED:"KEYED_CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});Ve(L,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});Ve(L,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});function jt(i,e,t){return(e=ts(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ts(i){var e=ns(i,"string");return typeof e=="symbol"?e:e+""}function ns(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Zi extends S.PureComponent{constructor(e){super(e),jt(this,"inputField",void 0),jt(this,"initialValue",void 0),jt(this,"debouncedSendUpdate",void 0);var t=e.debounceMs;this.debouncedSendUpdate=gt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var n=e.value;this.initialValue=n,this.state={isChanged:!1,value:n}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var t=this.props,n=t.debounceMs,a=t.value;e.value!==a&&(this.debouncedSendUpdate.cancel(),this.initialValue=a,this.setState({value:a,isChanged:!1})),e.debounceMs!==n&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=gt(this.sendUpdate.bind(this),n))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var t=e.target.value;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var e=this.initialValue,t=this.state.isChanged;t&&this.sendUpdate(e);var n=this.props.onDone;n()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var n=this.props.onDone;n(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var t=e.relatedTarget;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var t=this.props.onTab;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var t=this.props.onContextMenu;t(e)}sendUpdate(e){var t=this.props.onChange;t(e)}render(){var e=this.props,t=e.className,n=e.style,a=e.showAdvancedFilterButton,r=e.isAdvancedFilterSet,o=e.onAdvancedFiltersTriggered,l=this.state.value;return s.jsxs("div",{style:n,className:"iris-grid-input-autosized-wrapper","data-value":l,children:[s.jsx("input",{ref:d=>{this.inputField=d},className:J("iris-grid-input-field",t),type:"text",value:l,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),a&&s.jsx("div",{className:"advanced-filter-button-container",children:s.jsx(Q,{kind:"ghost",className:J("btn-link-icon advanced-filter-button",{"filter-set":r}),onClick:o,onContextMenu:this.handleContextMenu,children:s.jsxs("div",{className:"fa-layers ",children:[s.jsx(ie,{icon:Mi,className:"filter-solid"}),s.jsx(ie,{icon:cn,className:"filter-light"})]})})})]})}}jt(Zi,"defaultProps",{style:{},className:"",value:"",showAdvancedFilterButton:!1,isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});function is(i,e,t){return(e=as(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function as(i){var e=rs(i,"string");return typeof e=="symbol"?e:e+""}function rs(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class os extends kt{constructor(e){super(),is(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onDown(e,t){if(e.altKey&&!ft.isModifierKeyDown(e)&&!e.shiftKey){var n=t.state,a=n.mouseX,r=n.mouseY;if(a==null||r==null)return!1;var o=t.getGridPointFromXY(a,r);if(o.column!=null&&o.row!=null)return this.cursor=this.irisGrid.props.copyCursor,!0}return!1}onUp(e,t){return this.cursor===this.irisGrid.props.copyCursor?(this.cursor=null,!0):!1}}function ss(i,e,t){return(e=ls(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ls(i){var e=ds(i,"string");return typeof e=="symbol"?e:e+""}function ds(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class us extends kt{constructor(e){super(),ss(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(e.key==="c"&&ft.isModifierKeyDown(e)){var t=this.irisGrid.state.gridSelection;return t!=null&&!t.isEmpty()&&(qi(t)&&!se.isValidSnapshotRanges(t.toRanges())?this.irisGrid.copySelection(t,!1,!1,"Invalid copy ranges"):this.irisGrid.copySelection(t)),!0}return!1}}function hs(i,e,t){return(e=cs(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function cs(i){var e=ms(i,"string");return typeof e=="symbol"?e:e+""}function ms(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class gs extends kt{constructor(e){super(),hs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Ke.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var t=this.irisGrid.state.reverse;return this.irisGrid.reverse(!t),!0}return!1}}function vs(i,e,t){return(e=ps(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ps(i){var e=fs(i,"string");return typeof e=="symbol"?e:e+""}function fs(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Cs extends kt{constructor(e){super(),vs(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Ke.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}function Ss(i,e){return ws(i)||Ts(i,e)||ys(i,e)||bs()}function bs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ys(i,e){if(i){if(typeof i=="string")return gi(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gi(i,e):void 0}}function gi(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Ts(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function ws(i){if(Array.isArray(i))return i}var Es=3e3;function Fs(i){var e=i.children,t=e===void 0?null:e,n=i.onEntering,a=i.onEntered,r=i.onExiting,o=i.onExited,l=S.useState(!1),d=Ss(l,2),u=d[0],h=d[1],m=S.useRef(),v=Bi(t),c=S.useCallback(()=>{h(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{h(!1)},Es)},[h,m]);return S.useEffect(()=>{v!==t&&t!=null&&c()},[t,v,h,c]),S.useEffect(()=>()=>m.current?clearTimeout(m.current):void 0,[]),s.jsx(Lt,{className:"toast-bottom-bar",isShown:u,onEntering:n,onEntered:a,onExiting:r,onExited:o,children:t})}var As=1;function Ji(i){var e=i.model,t=i.top,n=i.bottom,a=i.left,r=i.right,o=i.filter,l=i.formatter,d=i.columnAlignmentMap,u=i.reverse,h=u===void 0?!1:u,m=i.sorts,v=i.customColumns,c=i.movedColumns,b=i.hiddenColumns,p=i.alwaysFetchColumns,f=i.rollupConfig,y=f===void 0?null:f,F=i.totalsConfig,_=F===void 0?null:F,T=i.selectDistinctColumns,k=T===void 0?le:T,D=i.pendingRowCount,C=D===void 0?0:D,x=i.pendingDataMap,R=x===void 0?Ee:x,P=i.frozenColumns,z=i.formatColumns,M=i.columnHeaderGroups,V=i.partitionConfig,U=i.showExtraGroupColumn,q=e.isTotalsAvailable,$=e.isRollupAvailable;Te(()=>{xr(e)&&U!=null&&(e.showExtraGroupColumn=U)},[e,U]);var Z=S.useMemo(()=>se.getModelViewportColumns(e.columns,a,r,c,b,p,As),[e.columns,a,r,c,b,p]);return Te(function(){e.filter=o},[e,o]),Te(function(){var B=[...m];h&&B.push(e.dh.Table.reverse()),e.sort=B},[e,m,h]),Te(function(){e.formatter=l},[e,l]),Te(function(){e.columnAlignmentMap=d},[e,d]),Te(function(){e.isCustomColumnsAvailable&&(e.customColumns=v)},[e,v]),Te(function(){e.isFormatColumnsAvailable&&(e.formatColumns=z)},[e,z]),Te(function(){e.setViewport(t,n,Z)},[e,t,n,Z]),Te(function(){$&&(e.rollupConfig=y)},[e,$,y]),Te(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=k)},[e,k]),Te(function(){q&&(e.totalsConfig=_)},[e,q,_]),Te(function(){e.columnHeaderGroups=M},[e,M]),Te(function(){V&&ct(e)&&(e.partitionConfig=V)},[e,V]),S.useEffect(function(){P&&e.updateFrozenColumns(P)},[e,P]),S.useEffect(function(){e.pendingRowCount=C},[e,C]),S.useEffect(function(){e.pendingDataMap=R},[e,R]),null}Ji.displayName="IrisGridModelUpdater";function ea(i,e,t){return(e=xs(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function xs(i){var e=Ns(i,"string");return typeof e=="symbol"?e:e+""}function Ns(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var nn=Ce.module("ColumnStatistics"),Os={SIZE:"Number of Rows"};class St extends S.Component{static getStatsLabel(e){var t;return(t=Os[e])!==null&&t!==void 0?t:e.split(" ").map(n=>n[0].toUpperCase()+n.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),ea(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var e=this.props,t=e.column,n=e.model,a=n.rowCount-n.pendingRowCount-n.floatingBottomRowCount-n.floatingTopRowCount;this.setState({numRows:a}),!n.isColumnStatisticsAvailable||t.isProxy===!0?this.setState({loading:!1}):a<St.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var e=this.props,t=e.column,n=e.model;this.cancelablePromise=Ae.makeCancelable(n.columnStatistics(t)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){nn.debug("Received statistics",e);var t=this.props,n=t.model,a=t.onStatistics,r=[];e.statisticsMap.forEach((o,l)=>{r.push({operation:St.getStatsLabel(l),value:o,type:e.getType(l)})}),e.uniqueValues.forEach((o,l)=>{r.push({operation:l,className:"column-statistics-unique-value",value:o,type:"long"})}),this.setState({loading:!1,statistics:r,numRows:n.rowCount-n.pendingRowCount-n.floatingBottomRowCount-n.floatingTopRowCount}),a()}handleError(e){if(e!=null&&Ae.isCanceled(e)){nn.debug("Called handleError on a cancelled promise result");return}nn.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,t=this.props,n=t.column,a=t.model,r=this.state,o=r.error,l=r.loading,d=r.statistics,u=r.numRows,h=!l&&o==null&&d==null&&a.isColumnStatisticsAvailable,m=[],v=n.type.substring(n.type.lastIndexOf(".")+1),c=n.description===null?null:n.description;if(d!=null)for(var b=0;b<d.length;b+=1){var p=d[b],f=p.operation,y=p.className,F=p.value,_=p.type,T=_?a.displayString(F,_):a.displayString(F,n.type,n.name),k=s.jsxs(Oe.Fragment,{children:[s.jsx("div",{className:J("column-statistic-operation",y),children:f}),s.jsx("div",{className:"column-statistic-value",children:T})]},f);m.push(k)}var D=vn(a)&&a.hasExpandableRows?"Expanded Rows":"Number of Rows",C=a.displayString(u,"long"),x=a.getColumnIndexByName(n.name);return s.jsxs("div",{className:"column-statistics",children:[s.jsxs("div",{className:"column-statistics-title",children:[(e=n.displayName)!==null&&e!==void 0?e:n.name,s.jsxs("span",{className:"column-statistics-type",children:[" (",v,")"]}),s.jsx(Wi,{tooltip:"Copy column name",copy:n.name,isQuiet:!0})]}),c!=null&&s.jsx("div",{className:"column-statistics-description",children:c}),x!=null&&!a.isColumnSortable(x)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(ie,{icon:qa,className:"mr-1"}),"Not sortable"]}),x!=null&&!a.isColumnMovable(x)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(ie,{icon:a.isColumnFrozen(x)?Ya:ei,className:"mr-1"}),a.isColumnFrozen(x)?"Frozen":"Not movable"]}),x!=null&&De(a)&&a.isEditable&&!a.inputKeyColumnSet.has(n.name)&&!a.inputValueColumnSet.has(n.name)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(ie,{icon:ei,className:"mr-1"}),"Not editable"]}),s.jsxs("div",{className:"column-statistics-grid",children:[d==null&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"column-statistic-operation",children:D}),s.jsx("div",{className:"column-statistic-value",children:C})]}),m]}),h&&s.jsx(Q,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),o!=null&&s.jsx("div",{className:"error-message",children:"".concat(o)}),d&&!l&&s.jsx(Q,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:Xa,children:"Refresh"}),l&&s.jsxs("div",{className:"column-statistics-loading",children:[s.jsx(Pt,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}ea(St,"AUTO_GENERATE_LIMIT",1e5);function _s(i,e,t){return(e=Rs(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Rs(i){var e=Ds(i,"string");return typeof e=="symbol"?e:e+""}function Ds(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}class Nt extends S.PureComponent{static createSearchFilter(e,t,n,a,r){var o=r?a.filter(u=>!n.includes(u.name)).map(u=>u.name):n;if(t&&o.length>0){var l=e.FilterValue.ofString(t),d=o.length===a.length?e.FilterCondition.search(l):e.FilterCondition.search(l,a.filter(u=>o.includes(u.name)).map(u=>u.filter()));return d}}constructor(e){super(e),_s(this,"searchField",void 0),this.handleSearchValueChange=this.handleSearchValueChange.bind(this),this.toggleColumn=this.toggleColumn.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.selectNumbers=this.selectNumbers.bind(this),this.searchField=Oe.createRef(),this.state={isConfigureColumnsShown:!1}}focus(){var e;(e=this.searchField.current)===null||e===void 0||e.focus()}handleSearchValueChange(e){var t=this.props,n=t.onChange,a=t.selectedColumns,r=t.invertSelection;n(e.target.value,a,r)}sendColumnChange(e,t){var n=this.props,a=n.onChange,r=n.value;a(r,e,t)}setInvertSelection(e){var t=this.props,n=t.onChange,a=t.value;n(a,[],e)}toggleColumn(e){var t=this.props,n=t.selectedColumns,a=t.invertSelection;if(n.includes(e))this.sendColumnChange(n.filter(o=>o!==e),a);else{var r=n.slice();r.push(e),this.sendColumnChange(r,a)}}selectAll(){this.setInvertSelection(!0)}clear(){this.setInvertSelection(!1)}selectNumbers(){var e=this.props.columns;this.sendColumnChange(e.filter(t=>w.isNumberType(t.type)).map(t=>t.name),!1)}render(){var e=this.props,t=e.value,n=e.selectedColumns,a=e.invertSelection,r=e.columns,o=this.state.isConfigureColumnsShown,l=n.length===0&&a===!0||n.length===r.length&&a===!1,d=n.length===0&&a===!1||n.length===r.length&&a===!0,u;return l?u=s.jsxs(s.Fragment,{children:[s.jsx(ie,{icon:ni,mask:qt,transform:"shrink-2 down-5 right-7"}),s.jsx(ie,{icon:Za,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}):d?u=s.jsxs(s.Fragment,{children:[s.jsx(ie,{icon:Ja,mask:qt,transform:"shrink-1 down-5 right-7"}),s.jsx(ie,{icon:ti,className:"text-danger",transform:"shrink-4 down-5 right-7"})]}):u=s.jsxs(s.Fragment,{children:[s.jsx(ie,{icon:ni,mask:qt,transform:"shrink-2 down-5 right-7"}),s.jsx(ie,{icon:er,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}),s.jsxs("div",{className:"cross-column-container",children:[s.jsx(Hr,{className:"cross-column-search",placeholder:"Search Data...","data-testid":"cross-column-search",value:t,onChange:this.handleSearchValueChange,ref:this.searchField}),s.jsxs("button",{type:"button",className:"btn btn-link btn-link-icon px-2",onClick:()=>{o?this.setState({isConfigureColumnsShown:!1}):this.setState({isConfigureColumnsShown:!0})},children:[s.jsx("div",{className:"fa-layers",children:u}),s.jsx(Le,{children:"Configure Columns"}),s.jsx(zi,{isShown:o,className:"cross-column-popper",onExited:()=>{this.setState({isConfigureColumnsShown:!1})},closeOnBlur:!0,interactive:!0,children:s.jsxs("div",{className:"cross-column-popup",children:["Searched Columns",s.jsx("div",{className:"cross-column-scroll",children:r.map(h=>h.isProxy===!0?null:s.jsxs(Oe.Fragment,{children:[s.jsx(Wr,{className:"cross-column-checkbox",checked:a?!n.includes(h.name):n.includes(h.name),onChange:()=>this.toggleColumn(h.name),children:h.name}),h.type.substring(h.type.lastIndexOf(".")+1)]},h.name))}),s.jsxs("div",{className:"cross-column-button-bar",children:[s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,children:"Select All"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.clear,children:"Clear"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectNumbers,children:"Numbers Only"})]}),d&&s.jsxs("p",{className:"text-danger",children:[s.jsx(ie,{icon:ti})," Select at least one column to search."]})]})})]})]})}}function vi(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),t.push.apply(t,n)}return t}function pi(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vi(Object(t),!0).forEach(function(n){mt(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):vi(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function fi(i,e,t,n,a,r,o){try{var l=i[r](o),d=l.value}catch(u){return void t(u)}l.done?e(d):Promise.resolve(d).then(n,a)}function Ot(i){return function(){var e=this,t=arguments;return new Promise(function(n,a){var r=i.apply(e,t);function o(d){fi(r,n,a,o,l,"next",d)}function l(d){fi(r,n,a,o,l,"throw",d)}o(void 0)})}}function mt(i,e,t){return(e=js(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function js(i){var e=Is(i,"string");return typeof e=="symbol"?e:e+""}function Is(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ye=Ce.module("IrisGridPartitionSelector");class Ps extends S.Component{constructor(e){super(e),mt(this,"pending",void 0),mt(this,"tableUtils",void 0),mt(this,"getCachedChangeCallback",ne(n=>a=>this.handlePartitionSelect(n,a),{max:100})),mt(this,"getCachedFormatValueCallback",ne(n=>a=>this.getDisplayValue(n,a),{max:100})),this.handlePartitionTableClick=this.handlePartitionTableClick.bind(this),this.handleMergeClick=this.handleMergeClick.bind(this),this.handlePartitionSelect=this.handlePartitionSelect.bind(this);var t=e.model;this.tableUtils=new w(t.dh),this.pending=new Ki,this.state={isLoading:!0,baseTable:null,keysTable:null,partitionTables:null}}componentDidMount(){var e=this;return Ot(function*(){var t=e.props.model;try{var n=yield e.pending.add(t.partitionKeysTable().then(r=>r),r=>r.close()),a=yield e.pending.add(t.partitionBaseTable(),r=>r.close());e.setState({keysTable:n,baseTable:a,isLoading:!1},e.updatePartitionOptions)}catch(r){if(!Ae.isCanceled(r))throw r}})()}componentDidUpdate(e){var t=e.partitionConfig,n=this.props.partitionConfig;t!==n&&this.updatePartitionOptions()}componentWillUnmount(){this.pending.cancel();var e=this.state,t=e.keysTable,n=e.baseTable,a=e.partitionTables;n==null||n.close(),t==null||t.close(),a==null||a.forEach(r=>r.close())}handlePartitionTableClick(){Ye.debug2("handlePartitionTableClick");var e=this.props.partitionConfig;K(e);var t=pi({},e);t.mode=e.mode==="keys"?"partition":"keys",this.sendUpdate(t)}handleMergeClick(){Ye.debug2("handleMergeClick");var e=this.props.partitionConfig;K(e);var t=pi({},e);t.mode=e.mode==="merged"?"partition":"merged",this.sendUpdate(t)}handlePartitionSelect(e,t){var n=this;return Ot(function*(){var a=n.props.partitionConfig;K(a),Ye.debug("handlePartitionSelect",e,t,a);var r=[...a.partitions];r[e]=t;var o=n.state.baseTable,l=n.state.keysTable;K(o),K(l);try{n.setState({isLoading:!0});var d=yield n.pending.add(o.copy(),v=>v.close()),u=r.slice(0,e+1).map((v,c)=>{var b=d.columns[c];return n.tableUtils.makeNullableEqFilter(b,v)});d.applyFilter(u),d.setViewport(0,0,d.columns);var h=yield n.pending.add(d.getViewportData()),m={partitions:l.columns.map(v=>h.rows[0].get(v)),mode:"partition"};d.close(),n.sendUpdate(m)}catch(v){Ae.isCanceled(v)||Ye.error("Unable to get partition tables",v)}finally{n.setState({isLoading:!1})}})()}sendUpdate(e){Ye.debug2("sendUpdate",e);var t=this.props.onChange;t(e)}getDisplayValue(e,t){var n=this.props.model;if(t===null)return"(null)";if(t===void 0||t==="")return"";var a=n.partitionColumns[e];return w.isCharType(a.type)&&t.toString().length>0?String.fromCharCode(parseInt(t.toString(),10)):n.displayString(t,a.type,a.name)}updatePartitionOptions(){var e=this;return Ot(function*(){var t=e.props.model,n=e.props.partitionConfig;if(n!=null){var a=e.state.keysTable;K(a);var r=[...n.partitions].map((l,d)=>{var u=a.columns[d];return e.tableUtils.makeNullableEqFilter(u,l)}),o=yield Promise.all(t.partitionColumns.map(function(){var l=Ot(function*(d,u){return a.applyFilter(r.slice(0,u)),a.selectDistinct(t.partitionColumns.slice(0,u+1))});return function(d,u){return l.apply(this,arguments)}}()));e.setState({partitionTables:o})}})()}getPartitionFilters(e){var t=this.props,n=t.model,a=t.partitionConfig;K(a);var r=a.partitions;if(Ye.debug("getPartitionFilters",a),r.length!==e.length)throw new Error("Invalid partition config set. Expected ".concat(e.length," partitions, but got ").concat(r.length));for(var o=[],l=0;l<r.length;l+=1)if(l===0)o.push([]);else{var d=o[l-1],u=r[l-1],h=n.partitionColumns[l-1],m=[...d,this.tableUtils.makeNullableEqFilter(h,u)];o.push(m)}return o}render(){var e=this.props,t=e.model,n=e.partitionConfig,a=this.state,r=a.isLoading,o=a.partitionTables,l=t.partitionColumns.map((d,u)=>s.jsxs("div",{className:"column-selector",children:[(o==null?void 0:o[u])&&s.jsx(eo,{label:d.name,labelPosition:"side",table:o[u],direction:"bottom",shouldFlip:!1,keyColumn:o[u].columns[u].name,selectedKey:(n==null?void 0:n.mode)==="partition"?n.partitions[u]:null,placeholder:"Select a key",labelColumn:o[u].columns[u].name,onChange:this.getCachedChangeCallback(u),isDisabled:r||n==null}),t.partitionColumns.length-1===u||s.jsx(ie,{icon:tr})]},"selector-".concat(d.name)));return s.jsxs("div",{className:"iris-grid-partition-selector",children:[s.jsxs("div",{className:"partition-button-group",children:[s.jsx(Q,{onClick:this.handlePartitionTableClick,kind:"inline",tooltip:t.isPartitionAwareSourceTable?"View keys as table":"View underlying partition table",icon:nr,active:(n==null?void 0:n.mode)==="keys",disabled:r||n==null,children:"Partitions"}),s.jsx(Q,{onClick:this.handleMergeClick,kind:"inline",tooltip:"View all partitions as one merged table",icon:s.jsx(ie,{icon:ir,rotation:90}),active:(n==null?void 0:n.mode)==="merged",disabled:r||n==null,children:t.isPartitionAwareSourceTable?"Coalesce":"Merge"})]}),l]})}}function Ms(i,e,t){return(e=ks(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ks(i){var e=Ls(i,"string");return typeof e=="symbol"?e:e+""}function Ls(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Vs=Ce.module("SelectDistinctBuilder");class ta extends S.Component{constructor(e){super(e),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleDropdownChanged=this.handleDropdownChanged.bind(this);var t=this.props,n=t.model,a=t.selectDistinctColumns;this.state={inputs:a.length>0?[...a]:[""],columns:n.originalColumns}}componentDidUpdate(e,t){var n=this.state.inputs,a=this.props.onChange;if(t.inputs!==n){var r=n.filter(o=>o!=="");ze(t.inputs.filter(o=>o!==""),r)||a(r)}}handleAddColumnClick(){this.setState(e=>{var t=e.inputs;return{inputs:[...t,""]}})}handleDeleteColumn(e){this.setState(t=>{var n=t.inputs;return{inputs:n.length===1&&e===0?[""]:n.filter((a,r)=>e!==r)}})}handleDropdownChanged(e,t){Vs.debug("handleDropdownChanged",e,t),this.setState(n=>{var a=n.inputs,r=[...a];return r[e]=t,{inputs:r}})}renderInputs(){var e=this.state,t=e.columns,n=e.inputs;return n.map((a,r)=>{var o=t.filter(l=>{var d=l.name;return d===a||!n.includes(d)}).map(l=>{var d=l.name;return s.jsx("option",{value:d,children:d},d)});return s.jsxs("div",{className:"form-inline px-3 pb-3",children:[s.jsxs(vt,{className:"form-control custom-select col",value:a,onChange:l=>this.handleDropdownChanged(r,l),children:[s.jsx("option",{value:"",children:"Select a column"}),o]}),(n.length>1||a!=="")&&s.jsx(Q,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{this.handleDeleteColumn(r)},icon:s.jsx(ie,{icon:Cn,transform:"grow-3"}),tooltip:"Delete column"})]},r)})}render(){var e=this.state,t=e.columns,n=e.inputs,a=n.length>=t.length;return s.jsxs("div",{role:"presentation",className:"select-distinct-builder-container h-100",children:[s.jsx("div",{className:"select-distinct-title",children:"Display Unique Values From"}),this.renderInputs(),s.jsx("hr",{}),s.jsx("div",{className:"pt-1 px-3",children:s.jsx(Q,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,disabled:a,icon:Sn,children:"Add Additional Column"})}),s.jsx("div",{className:"select-distinct-builder-footer",children:s.jsx("div",{className:"select-distinct-builder-hint",children:"Display only unique values from the selected table columns. Note that this will reset any filters and display only the selected columns."})})]})}}Ms(ta,"defaultProps",{selectDistinctColumns:[],onChange:()=>{}});var Us=Ce.module("PluginTableOptionsErrorBoundary");class $s extends Oe.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:null}}componentDidCatch(e,t){var n=this.props.itemType;Us.error('Plugin sidebar page "'.concat(n,'" threw during render; suppressing.'),e,t)}render(){var e=this.state.error,t=this.props,n=t.children,a=t.itemType;return e==null?n:s.jsxs("div",{className:"plugin-sidebar-error",role:"alert","data-testid":"plugin-sidebar-error",children:[s.jsxs("p",{children:[a," failed to render:"]}),s.jsx("p",{children:e.message})]})}}function Gs(i,e){return zs(i)||Ws(i,e)||Hs(i,e)||Bs()}function Bs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hs(i,e){if(i){if(typeof i=="string")return Ci(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ci(i,e):void 0}}function Ci(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function Ws(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function zs(i){if(Array.isArray(i))return i}function wn(i){var e=i.items,t=i.onChange,n=t===void 0?()=>{}:t;return s.jsx(Xi,{items:Array.from(e.entries()).map(a=>{var r=Gs(a,2),o=r[0],l=r[1];return{title:wn.getAdvancedSettingsTitleForKey(o),isOn:l,onChange:d=>n(o,d)}})})}wn.getAdvancedSettingsTitleForKey=i=>{switch(i){case It.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from a control";case It.LINK_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from an incoming link filter"}};function Si(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),t.push.apply(t,n)}return t}function Xe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Si(Object(t),!0).forEach(function(n){Ks(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Si(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Ks(i,e,t){return(e=Qs(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Qs(i){var e=qs(i,"string");return typeof e=="symbol"?e:e+""}function qs(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var bi=Ce.module("ConditionalFormattingMenu"),an=()=>{};function Ys(i){var e,t=i.leftHandValue.type;if(i.condition===me.IS_NULL||i.condition===me.IS_NOT_NULL||w.isBooleanType(t)&&(i.condition===be.IS_TRUE||i.condition===be.IS_FALSE))return"";if(!w.isNumberType(t)&&!w.isCharType(t)&&!w.isStringType(t)&&!w.isDateType(t)&&!w.isBooleanType(t))throw new Error("Invalid column type ".concat(t," in getRuleValue"));var n=w.isStringType(t)?'"':"";return(e=Or(i.rightHandValue,n))!==null&&e!==void 0?e:""}function Xs(i){var e=i.leftHandValue,t=e.name,n=e.type,a=i.formattedColumns,r=a.length>0?"[".concat(a.map(o=>o.name).join(", "),"] = "):"";return w.isNumberType(n)&&i.condition===de.IS_BETWEEN?"".concat(r).concat(i.start," < ").concat(t," < ").concat(i.end):"".concat(r).concat(t," ").concat(Nr(n,i.condition),`
@@ -11,4 +11,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
11
11
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jl(i,e){if(i){if(typeof i=="string")return Oi(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Oi(i,e):void 0}}function Oi(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function ed(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function td(i){if(Array.isArray(i))return i}function nd(i){var e,t,n=i.text,a=i.isOpen,r=i.onClose,o=S.useState(!1),l=ut(o,2),d=l[0],u=l[1],h=S.useState(0),m=ut(h,2),v=m[0],c=m[1],b=S.useState(!1),p=ut(b,2),f=p[0],y=p[1],F=S.useState(!1),_=ut(F,2),T=_[0],k=_[1],D=S.useState(!1),C=ut(D,2),x=C[0],R=C[1],P=S.useRef();S.useEffect(function(){if(a){try{JSON.parse(n),R(!0)}catch{R(!1)}k(!1)}},[a,n]),S.useEffect(function(){P.current&&P.current.layout()},[v]),S.useEffect(function(){P.current&&P.current.updateOptions({lineNumbers:f?"on":"off"})},[f]);function z(){y(!f)}function M(){var $,Z=($=P.current)===null||$===void 0?void 0:$.getModel();!x||!Z||(T?(Z.setValue(n),k(!1)):(Z.setValue(JSON.stringify(JSON.parse(n),void 0,2)),k(!0)),V())}function V(){var $,Z,G=P.current;G&&y((($=(Z=G.getModel())===null||Z===void 0?void 0:Z.getLineCount())!==null&&$!==void 0?$:0)>1)}function U(){d&&(P.current=void 0,r())}function q($){var Z;P.current=$,c($.getContentHeight()),$.onDidContentSizeChange(G=>{var B=G.contentHeight;return c(B)}),V(),(Z=document.activeElement)===null||Z===void 0||Z.blur()}return!a&&!d?null:s.jsxs(ki,{isOpen:a,centered:!0,keyboard:!0,toggle:U,onOpened:()=>u(!0),onClosed:()=>{u(!1),c(0)},className:"cell-overflow-modal",size:"xl",children:[s.jsxs(Li,{toggle:r,children:[s.jsx("h5",{className:"overflow-modal-title",children:"Cell Contents"}),s.jsx(Wi,{tooltip:"Copy cell contents",copy:(e=(t=P.current)===null||t===void 0?void 0:t.getValue())!==null&&e!==void 0?e:n}),s.jsxs(Yn,{isSelected:f,"aria-label":"Toggle line numbers",onChange:z,children:[s.jsx(Xn,{UNSAFE_className:"action-button-icon-with-tooltip",children:s.jsx(ie,{icon:sr})}),s.jsx(Le,{children:"Toggle line numbers"})]}),x&&s.jsxs(Yn,{isSelected:T,"aria-label":"Format as JSON",onChange:M,children:[s.jsx(Xn,{UNSAFE_className:"action-button-icon-with-tooltip",children:s.jsx(ie,{icon:lr})}),s.jsx(Le,{children:"Format as JSON"})]})]}),s.jsx(Vi,{style:{height:v},children:s.jsx(Kr,{onEditorInitialized:q,settings:{value:n,readOnly:!0,wordWrap:"on",language:x?"typescript":"plaintext",folding:x,padding:{bottom:16},lineNumbers:f?"on":"off",overviewRulerLanes:0,renderLineHighlight:"none",find:{seedSearchStringFromSelection:"never"}}})})]})}function id(i,e){return sd(i)||od(i,e)||rd(i,e)||ad()}function ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
12
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rd(i,e){if(i){if(typeof i=="string")return _i(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_i(i,e):void 0}}function _i(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function od(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function sd(i){if(Array.isArray(i))return i}var ld="###,##0",oa=S.forwardRef((i,e)=>{var t=i.gotoRow,n=i.gotoRowError,a=i.gotoValueError,r=i.onGotoRowSubmit,o=i.isShown,l=i.onEntering,d=i.onEntered,u=i.onExiting,h=i.onExited,m=i.model,v=i.onGotoRowNumberChanged,c=i.onClose,b=i.gotoValueSelectedColumnName,p=i.gotoValue,f=i.gotoValueFilter,y=i.onGotoValueSelectedColumnNameChanged,F=i.onGotoValueSelectedFilterChanged,_=i.onGotoValueChanged,T=i.onGotoValueSubmit,k=S.useRef(null),D=S.useRef(null),C=S.useState(!1),x=id(C,2),R=x[0],P=x[1],z=[];Lr(m)&&(z=m.table.columns);var M=m.dh,V=m.rowCount,U=S.useMemo(()=>"goto-row-input-".concat(dn()),[]),q=g=>{g.key==="Enter"?(g.stopPropagation(),g.preventDefault(),T()):(g.key==="Backspace"||g.key==="Delete")&&(p==="".concat(Number.POSITIVE_INFINITY)||p==="".concat(Number.NEGATIVE_INFINITY))&&te("")},$=g=>{g.key==="Enter"&&(g.stopPropagation(),g.preventDefault(),T(g.shiftKey))},Z=m.getColumnIndexByName(b),G=z[Z??0],B=G==null?void 0:G.type,ee=w.getNormalizedType(B),te=g=>{_(g??"")};S.useImperativeHandle(e,()=>({focus(){var g;P(!0),(g=k.current)===null||g===void 0||g.select()}}));var ue=()=>{if(R&&document.activeElement!==k.current){var g;(g=k.current)===null||g===void 0||g.select()}else if(!R&&document.activeElement!==D.current){var E;(E=D.current)===null||E===void 0||E.select()}};S.useEffect(ue,[R]);var ge=()=>{switch(ee){case w.dataType.DECIMAL:case w.dataType.INT:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:D,className:J("form-control",{"is-invalid":a!==""}),onKeyDown:q,placeholder:"value",onChange:g=>{var E=g.target.value.toLowerCase();/^-?[0-9]*\.?[0-9]*$/.test(g.target.value)?te(g.target.value):E==="-i"||E==="-infinity"?te("".concat(Number.NEGATIVE_INFINITY)):(E==="i"||E==="infinity")&&te("".concat(Number.POSITIVE_INFINITY))},value:p,"aria-label":"Value Input"})});case w.dataType.DATETIME:return s.jsx("div",{className:"goto-value-date-time-input",children:s.jsx(Do,{ref:D,className:J("form-control","goto-value-date-time-input",{"is-invalid":a!==""}),defaultValue:p,onChange:te,onSubmit:$,"aria-label":"Value Input"})});case w.dataType.STRING:return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"goto-row-input",children:s.jsxs(vt,{className:"custom-select",onChange:g=>{F(g)},value:f,"aria-label":"filter-type-select",children:[s.jsx("option",{value:we.eqIgnoreCase,children:"Equals (case-insensitive)"},we.eqIgnoreCase),s.jsx("option",{value:we.containsIgnoreCase,children:"Contains (case-insensitive)"},we.containsIgnoreCase),s.jsx("option",{value:we.eq,children:"Equals"},we.eq),s.jsx("option",{value:we.contains,children:"Contains"},we.contains)]})}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:D,className:J("form-control",{"is-invalid":a!==""}),onKeyDown:$,placeholder:"value",onChange:g=>te(g.target.value),value:p,"aria-label":"Value Input"})})]});case w.dataType.BOOLEAN:return s.jsx("div",{className:"goto-row-input",children:s.jsxs(vt,{className:"custom-select",onChange:g=>{te(g)},value:p,"aria-label":"Value Input",children:[s.jsx("option",{"aria-label":"null value",value:""},"null"),s.jsx("option",{value:"true",children:"true"},"true"),s.jsx("option",{value:"false",children:"false"},"false")]})});default:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:D,className:"form-control",onKeyDown:$,placeholder:"value",onChange:g=>te(g.target.value),value:p,"aria-label":"Value Input"})})}};return s.jsx(Lt,{isShown:o,className:J("goto-row"),onEntering:l,onEntered:()=>{d(),ue()},onExiting:u,onExited:h,children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"goto-row-row",children:[s.jsxs("div",{className:J("goto-row-wrapper",{"is-inactive":!R}),onClick:()=>P(!0),onFocus:()=>P(!0),role:"group",children:[s.jsx("label",{className:"goto-row-text",htmlFor:U,children:"Go to row"}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:k,"data-testid":"goto-row-input",type:"number",onKeyDown:g=>{g.key==="Enter"&&(g.stopPropagation(),g.preventDefault(),r())},className:J("form-control",{"is-invalid":n!==""}),placeholder:"Row number",onChange:g=>{v(g)},value:t,id:U})}),s.jsxs("div",{className:"goto-row-text",children:["of"," ",M.i18n.NumberFormat.format(ld,V)]}),n&&s.jsx("div",{className:"text-danger",children:n})]}),s.jsx("div",{className:"goto-row-close",children:s.jsx(Q,{kind:"ghost",onClick:c,children:s.jsx(ie,{icon:Ui,style:{marginRight:"0"}})})})]}),m.isSeekRowAvailable&&s.jsx("div",{className:"goto-row-row",children:s.jsxs("div",{className:J("goto-row-wrapper",{"is-inactive":R}),onClick:()=>P(!1),onFocus:()=>P(!1),role:"group",children:[s.jsx("div",{className:"goto-row-text",children:"Go to value"}),s.jsx("div",{className:"goto-row-input",children:s.jsx(vt,{className:"custom-select",onChange:g=>{var E=g;y(E)},value:b,"aria-label":"column-name-select",id:"column-name-select",children:z.map(g=>s.jsx("option",{value:g.name,children:g.name},g.name))})}),ge(),s.jsxs("div",{children:[s.jsx(Q,{tooltip:"Previous match",icon:dr,kind:"ghost",disabled:p==="",onClick:()=>{T(!0)}}),s.jsx(Q,{tooltip:"Next match",icon:ur,kind:"ghost",disabled:p==="",onClick:()=>{T(!1)}})]}),a&&s.jsx("div",{className:"text-danger",children:a})]})})]})})});oa.displayName="GotoRow";function dd(i){var e=i.isOpen,t=i.onClose,n=i.errorMessage,a=Qr.PASTE.getDisplayText();return s.jsxs(ki,{isOpen:e,toggle:t,centered:!0,children:[s.jsx(Li,{closeButton:!1,children:"No Paste Permission"}),s.jsxs(Vi,{children:[s.jsx("p",{children:n}),s.jsxs("p",{children:["You can still use ",a," to paste."]})]}),s.jsx(qr,{children:s.jsx(Q,{kind:"primary",onClick:t,children:"Dismiss"})})]})}function Ze(i,e){return md(i)||cd(i,e)||hd(i,e)||ud()}function ud(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
13
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hd(i,e){if(i){if(typeof i=="string")return Ri(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ri(i,e):void 0}}function Ri(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function cd(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,a,r,o,l=[],d=!0,u=!1;try{if(r=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;d=!1}else for(;!(d=(n=r.call(t)).done)&&(l.push(n.value),l.length!==e);d=!0);}catch(h){u=!0,a=h}finally{try{if(!d&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function md(i){if(Array.isArray(i))return i}function Di(i,e,t,n,a,r,o){try{var l=i[r](o),d=l.value}catch(u){return void t(u)}l.done?e(d):Promise.resolve(d).then(n,a)}function Je(i){return function(){var e=this,t=arguments;return new Promise(function(n,a){var r=i.apply(e,t);function o(d){Di(r,n,a,o,l,"next",d)}function l(d){Di(r,n,a,o,l,"throw",d)}o(void 0)})}}function ji(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),t.push.apply(t,n)}return t}function oe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ji(Object(t),!0).forEach(function(n){A(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ji(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function A(i,e,t){return(e=gd(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function gd(i){var e=vd(i,"string");return typeof e=="symbol"?e:e+""}function vd(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var N=Ce.module("IrisGrid"),pd=500,fd=500,Cd=250,Sd=250,bd=250,fn=Object.freeze({aggregations:le,showOnTop:!1}),yd="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";class je extends S.Component{constructor(e){var t,n,a;super(e),A(this,"grid",void 0),A(this,"lastFocusedFilterBarColumn",void 0),A(this,"lastLoadedConfig",void 0),A(this,"tooltip",void 0),A(this,"pending",void 0),A(this,"globalColumnFormats",void 0),A(this,"dateTimeFormatterOptions",void 0),A(this,"decimalFormatOptions",void 0),A(this,"integerFormatOptions",void 0),A(this,"truncateNumbersWithPound",void 0),A(this,"showEmptyStrings",void 0),A(this,"showNullStrings",void 0),A(this,"showExtraGroupColumn",void 0),A(this,"loadingScrimStartTime",void 0),A(this,"loadingScrimFinishTime",void 0),A(this,"animationFrame",void 0),A(this,"loadingTimer",void 0),A(this,"tableSaver",void 0),A(this,"crossColumnRef",void 0),A(this,"isAnimating",void 0),A(this,"filterInputRef",void 0),A(this,"gotoRowRef",void 0),A(this,"isCopying",void 0),A(this,"toggleFilterBarAction",void 0),A(this,"toggleSearchBarAction",void 0),A(this,"toggleGotoRowAction",void 0),A(this,"discardAction",void 0),A(this,"commitAction",void 0),A(this,"contextActions",void 0),A(this,"tableUtils",void 0),A(this,"keyHandlers",void 0),A(this,"mouseHandlers",void 0),A(this,"lastMetricCalculatorFactory",void 0),A(this,"slideTransitionRef",Oe.createRef()),A(this,"bottomTransitionRef",Oe.createRef()),A(this,"getAdvancedMenuOpenedHandler",ne(g=>this.handleAdvancedMenuOpened.bind(this,g),{max:100})),A(this,"getAdvancedMenuToggleMaximizeHandler",ne(g=>this.handleAdvancedFilterToggleMaximize.bind(this,g),{max:100})),A(this,"getCachedCreateEmptySelection",ne(g=>g?E=>ht.empty(E):void 0,{max:1})),A(this,"getCachedAdvancedFilterMenuActions",ne((g,E,j,H,I,O,W)=>s.jsx(Ne,{model:g,column:E,onFilterChange:this.handleAdvancedFilterChange,onSortChange:this.handleAdvancedFilterSortChange,onDone:this.handleAdvancedFilterDone,options:j,sortDirection:H,formatter:I,tableUtils:this.tableUtils,isMaximized:O,onToggleMaximize:W}),{max:50})),A(this,"getCachedOptionItems",ne((g,E,j,H,I,O,W,re,Y,he,ye,_e,Ue,tt,Pe,Me,yt)=>{var ve=[];return g&&ve.push({type:X.CHART_BUILDER,title:"Chart Builder",icon:hr,order:100}),H&&ve.push({type:X.VISIBILITY_ORDERING_BUILDER,title:"Organize Columns",icon:cr,order:200}),j&&ve.push({type:X.CONDITIONAL_FORMATTING,title:"Conditional Formatting",icon:mr,order:300}),E&&ve.push({type:X.CUSTOM_COLUMN_BUILDER,title:"Custom Columns",icon:gr,order:400}),I&&ve.push({type:X.ROLLUP_ROWS,title:"Rollup Rows",icon:vr,order:500}),O&&ve.push({type:X.AGGREGATIONS,title:"Aggregate Columns",icon:pr,order:600}),W&&ve.push({type:X.SELECT_DISTINCT,title:"Select Distinct Values",icon:fr,order:700}),re&&tt&&ve.push({type:X.TABLE_EXPORTER,title:"Download CSV",icon:Cr,order:800}),yt&&ve.push({type:X.ADVANCED_SETTINGS,title:"Advanced Settings",icon:Sr,order:900}),ve.push({type:X.QUICK_FILTERS,title:"Quick Filters",subtitle:Y.shortcut.getDisplayText(),icon:cn,isOn:_e,onChange:Y.action,order:1e3}),Pe&&ve.push({type:X.SEARCH_BAR,title:"Search Bar",subtitle:he.shortcut.getDisplayText(),icon:br,isOn:Ue,onChange:he.action,order:1100}),ve.push({type:X.GOTO,title:"Go to",subtitle:ye.shortcut.getDisplayText(),icon:yr,isOn:Me,onChange:ye.action,order:1200}),Object.freeze(ve)},{max:1})),A(this,"getCachedTransformedOptionItems",ne((g,E)=>{if(E==null)return g;var j;try{j=E(g)}catch(O){return N.error("transformTableOptions threw an error; falling back to defaults.",O),g}var H=new Map;j.forEach(O=>{H.set(String(O.type),O)});var I=[...H.values()].map((O,W)=>({item:O,index:W})).sort((O,W)=>{var re,Y;return((re=O.item.order)!==null&&re!==void 0?re:1/0)-((Y=W.item.order)!==null&&Y!==void 0?Y:1/0)||O.index-W.index}).map(O=>{var W=O.item;return W});return Object.freeze(I)},{max:1})),A(this,"getCachedHiddenColumns",ne((g,E)=>se.getHiddenColumns(new Map([...g.initialColumnWidths,...E])),{max:1})),A(this,"getCachedHiddenColumnNames",ne((g,E)=>Object.freeze(g.map(j=>{var H;return(H=E[j])===null||H===void 0?void 0:H.name}).filter(j=>j!=null)),{max:1})),A(this,"getCachedViewState",ne(g=>Object.freeze({hiddenColumns:g}),{max:1})),A(this,"getAggregationMap",ne((g,E)=>{var j={};return E.forEach(H=>{var I=H.operation,O=H.selected,W=H.invert;j[I]=Xt.getOperationColumnNames(g,I,O,W)}),j},{max:1})),A(this,"getOperationMap",ne((g,E)=>se.getOperationMap(g,E),{max:1})),A(this,"getOperationOrder",ne(g=>se.getOperationOrder(g),{max:1})),A(this,"getCachedFormatColumns",ne((g,E,j)=>Vr(g,E,j),{max:1e3})),A(this,"getCachedPreviewFormatColumns",ne((g,E,j,H,I)=>{if(N.debug("getCachedPreviewFormatColumns",j,H,I),H!==void 0&&I!==void 0){var O=[...j];return O[I]=H,this.getCachedFormatColumns(g,E,O)}return this.getCachedFormatColumns(g,E,j)},{max:1})),A(this,"getModelRollupConfig",ne((g,E,j)=>se.getModelRollupConfig(g,E,j),{max:1})),A(this,"getModelTotalsConfig",ne((g,E,j)=>se.getModelTotalsConfig(g,E,j),{max:1})),A(this,"getCachedStateOverride",ne((g,E,j,H,I,O,W,re,Y,he,ye,_e)=>({model:g,theme:E,hoverSelectColumn:j,isFilterBarShown:H,isSelectingColumn:I,loadingScrimProgress:O,quickFilters:W,advancedFilters:re,sorts:Y,reverse:he,rollupConfig:ye,isMenuShown:_e}),{max:1})),A(this,"getCachedFilter",ne((g,E,j,H)=>[...g??[],...se.getFiltersFromFilterMap(E),...se.getFiltersFromFilterMap(j),...H!==void 0?[H]:[]],{max:1})),A(this,"getCachedTheme",ne((g,E,j,H,I)=>{var O,W=g??io(),re=H>0?(O=E==null?void 0:E.rowFooterWidth)!==null&&O!==void 0?O:W.rowFooterWidth:0,Y=this.state.metricCalculator;Y!=null&&(Y.resetCalculatedColumnWidths(),Y.resetCalculatedRowHeights());var he={};return I==="compact"?he=W.density.compact:I==="spacious"&&(he=W.density.spacious),oe(oe(oe(oe({},W),he),E),{},{autoSelectRow:!j,rowFooterWidth:re})},{max:1})),A(this,"getCachedKeyHandlers",ne(g=>[...g,...this.keyHandlers].sort((E,j)=>E.order-j.order),{max:1})),A(this,"getCachedMouseHandlers",ne(g=>[...g,...this.mouseHandlers].map(E=>typeof E=="function"?E(this):E),{max:1})),A(this,"getCachedRenderer",ne(g=>g??new ao,{max:1})),A(this,"getAlwaysFetchColumns",ne((g,E,j,H,I,O,W)=>{for(var re=[],Y=0;Y<H;Y+=1)re.push(E[Fe.getModelIndex(Y,j)].name);for(var he=0;he<I;he+=1)re.push(E[Fe.getModelIndex(E.length-1-he,j)].name);if(W)for(var ye=W[0];ye<=W[1];ye+=1)re.push(E[Fe.getModelIndex(ye,j)].name);var _e=At(O)?O.selectionKeyColumnIndices:le,Ue=_e.map(Pe=>{var Me;return(Me=E[Pe])===null||Me===void 0?void 0:Me.name}).filter(Pe=>Pe!=null),tt=new Set([...g,...re,...Ue]);return Object.freeze([...tt])},{max:1})),A(this,"updateSearchFilter",gt((g,E,j,H)=>{var I=this.props.model,O=Nt.createSearchFilter(I.dh,g,E,j,H);this.setState({searchFilter:O})},Cd)),A(this,"showViewportLoading",Zn(()=>{var g=this.props.model,E=this.state.loadingSpinnerShown;g.isViewportPending&&!E&&this.startLoading("Waiting for viewport...",{loadingCancelShown:!1,loadingBlocksGrid:!1})},pd,{leading:!1,trailing:!0})),A(this,"handleConditionalFormatEditorUpdate",gt(g=>{this.setState({conditionalFormatPreview:g,conditionalFormatError:null})},bd)),A(this,"handleDownloadProgressUpdate",Zn((g,E)=>{var j=this.state.tableDownloadStatus;j===He.DOWNLOAD_STATUS.DOWNLOADING&&this.setState({tableDownloadProgress:g,tableDownloadEstimatedTime:E})},fd)),A(this,"getOverflowButtonTooltip",ne(g=>{if(g==null)return null;var E=oe(oe({position:"absolute"},g),{},{pointerEvents:"none"}),j={placement:"left",modifiers:{flip:{behavior:["left","right"]}}};return s.jsx("div",{style:E,children:s.jsx(Le,{options:j,ref:this.handleTooltipRef,children:"View full contents"},Date.now())})},{max:1})),A(this,"getExpandCellTooltip",ne(g=>{if(g==null)return null;var E=this.state.expandTooltipDisplayValue,j=this.props.model,H=vn(j)&&j.isExpandAllAvailable,I=oe(oe({position:"absolute"},g),{},{pointerEvents:"none"}),O={placement:"bottom-start"};return s.jsx("div",{style:I,children:s.jsx(Le,{options:O,ref:this.handleTooltipRef,children:s.jsxs("div",{style:{textAlign:"left"},children:["Click to ",E," row",H&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),ft.isMacPlatform()?"⌘":"Ctrl+","Click to expand row and all children"]})]})},Date.now())})},{max:1})),A(this,"getHoverTooltip",ne(g=>{if(g==null)return null;var E=this.state.hoverDisplayValue,j=oe(oe({position:"absolute"},g),{},{pointerEvents:"none"}),H={placement:"bottom"};return s.jsx("div",{style:j,children:s.jsx(Le,{options:H,ref:this.handleTooltipRef,children:s.jsx("div",{className:"link-hover-tooltip",children:E})})})},{max:1})),A(this,"handleGotoValueChanged",g=>{this.setState({gotoValue:g,gotoValueManuallyChanged:!0}),this.debouncedSeekRow(g)}),A(this,"debouncedSeekRow",gt(g=>{this.seekRow(g)},Sd)),this.handleAdvancedFilterChange=this.handleAdvancedFilterChange.bind(this),this.handleAdvancedFilterSortChange=this.handleAdvancedFilterSortChange.bind(this),this.handleAdvancedFilterDone=this.handleAdvancedFilterDone.bind(this),this.handleAdvancedFilterToggleMaximize=this.handleAdvancedFilterToggleMaximize.bind(this),this.handleAdvancedMenuOpened=this.handleAdvancedMenuOpened.bind(this),this.handleGotoRowOpened=this.handleGotoRowOpened.bind(this),this.handleGotoRowClosed=this.handleGotoRowClosed.bind(this),this.handleAdvancedMenuClosed=this.handleAdvancedMenuClosed.bind(this),this.handleAggregationChange=this.handleAggregationChange.bind(this),this.handleAggregationsChange=this.handleAggregationsChange.bind(this),this.handleAggregationEdit=this.handleAggregationEdit.bind(this),this.handleAnimationLoop=this.handleAnimationLoop.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleChartChange=this.handleChartChange.bind(this),this.handleChartCreate=this.handleChartCreate.bind(this),this.handleGridError=this.handleGridError.bind(this),this.handleFilterBarChange=this.handleFilterBarChange.bind(this),this.handleFilterBarDone=this.handleFilterBarDone.bind(this),this.handleFilterBarTab=this.handleFilterBarTab.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleMenu=this.handleMenu.bind(this),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleMenuBack=this.handleMenuBack.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handlePending=this.handlePending.bind(this),this.handlePendingCleared=this.handlePendingCleared.bind(this),this.handleSelectionChanged=this.handleSelectionChanged.bind(this),this.handleGridSelectionChange=this.handleGridSelectionChange.bind(this),this.handleMovedColumnsChanged=this.handleMovedColumnsChanged.bind(this),this.handleHeaderGroupsChanged=this.handleHeaderGroupsChanged.bind(this),this.handleUpdate=this.handleUpdate.bind(this),this.handleTableChanged=this.handleTableChanged.bind(this),this.handleSchemaChanged=this.handleSchemaChanged.bind(this),this.handleTooltipRef=this.handleTooltipRef.bind(this),this.handleViewChanged=this.handleViewChanged.bind(this),this.handleFormatSelection=this.handleFormatSelection.bind(this),this.handleColumnAlignmentChange=this.handleColumnAlignmentChange.bind(this),this.handleConditionalFormatCreate=this.handleConditionalFormatCreate.bind(this),this.handleConditionalFormatEdit=this.handleConditionalFormatEdit.bind(this),this.handleConditionalFormatsChange=this.handleConditionalFormatsChange.bind(this),this.handleConditionalFormatEditorSave=this.handleConditionalFormatEditorSave.bind(this),this.handleConditionalFormatEditorCancel=this.handleConditionalFormatEditorCancel.bind(this),this.handleUpdateCustomColumns=this.handleUpdateCustomColumns.bind(this),this.handleCustomColumnsChanged=this.handleCustomColumnsChanged.bind(this),this.handleSelectDistinctChanged=this.handleSelectDistinctChanged.bind(this),this.handlePendingDataUpdated=this.handlePendingDataUpdated.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.handlePendingCommitClicked=this.handlePendingCommitClicked.bind(this),this.handlePendingDiscardClicked=this.handlePendingDiscardClicked.bind(this),this.handleGotoRowSelectedRowNumberSubmit=this.handleGotoRowSelectedRowNumberSubmit.bind(this),this.focusRowInGrid=this.focusRowInGrid.bind(this),this.handleDownloadTable=this.handleDownloadTable.bind(this),this.handleDownloadTableStart=this.handleDownloadTableStart.bind(this),this.handleCancelDownloadTable=this.handleCancelDownloadTable.bind(this),this.handleDownloadCanceled=this.handleDownloadCanceled.bind(this),this.handleDownloadCompleted=this.handleDownloadCompleted.bind(this),this.handlePartitionChange=this.handlePartitionChange.bind(this),this.handleColumnVisibilityChanged=this.handleColumnVisibilityChanged.bind(this),this.handleColumnVisibilityReset=this.handleColumnVisibilityReset.bind(this),this.handleCrossColumnSearch=this.handleCrossColumnSearch.bind(this),this.handleRollupChange=this.handleRollupChange.bind(this),this.handleOverflowClose=this.handleOverflowClose.bind(this),this.handleCloseNoPastePermissionModal=this.handleCloseNoPastePermissionModal.bind(this),this.getColumnBoundingRect=this.getColumnBoundingRect.bind(this),this.handleGotoRowSelectedRowNumberChanged=this.handleGotoRowSelectedRowNumberChanged.bind(this),this.handleGotoValueSelectedColumnNameChanged=this.handleGotoValueSelectedColumnNameChanged.bind(this),this.handleGotoValueSelectedFilterChanged=this.handleGotoValueSelectedFilterChanged.bind(this),this.handleGotoValueChanged=this.handleGotoValueChanged.bind(this),this.handleGotoValueSubmitted=this.handleGotoValueSubmitted.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.makeQuickFilter=this.makeQuickFilter.bind(this),this.setFilterMap=this.setFilterMap.bind(this),this.handleFrozenColumnsChanged=this.handleFrozenColumnsChanged.bind(this),this.grid=null,this.lastLoadedConfig=null,this.pending=new Ki,this.globalColumnFormats=le,this.decimalFormatOptions={},this.integerFormatOptions={},this.truncateNumbersWithPound=!1,this.showEmptyStrings=!0,this.showNullStrings=!0,this.showExtraGroupColumn=!0,this.tableSaver=null,this.crossColumnRef=Oe.createRef(),this.isAnimating=!1,this.filterInputRef=Oe.createRef(),this.gotoRowRef=Oe.createRef(),this.isCopying=!1,this.toggleFilterBarAction={action:()=>this.toggleFilterBar(),shortcut:Ke.TABLE.TOGGLE_QUICK_FILTER},this.toggleSearchBarAction={action:()=>this.toggleSearchBar(),shortcut:Ke.TABLE.TOGGLE_SEARCH},this.toggleGotoRowAction={action:()=>this.toggleGotoRow(),shortcut:Ke.TABLE.GOTO_ROW},this.discardAction={action:()=>{var g=this.props.model;De(g)&&g.isEditable&&g.pendingDataMap.size>0&&this.discardPending().catch(N.error)},shortcut:Ke.INPUT_TABLE.DISCARD},this.commitAction={action:()=>{var g=this.props.model;De(g)&&g.isEditable&&g.pendingDataMap.size>0&&g.pendingDataErrors.size===0&&this.commitPending().catch(N.error)},shortcut:Ke.INPUT_TABLE.COMMIT},this.contextActions=[this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,this.discardAction,this.commitAction];var r=e.aggregationSettings,o=e.conditionalFormats,l=e.customColumnFormatMap,d=e.columnAlignmentMap,u=e.isFilterBarShown,h=e.isSelectingPartition,m=e.partitions,v=e.partitionConfig,c=e.model,b=e.movedColumns,p=e.movedRows,f=e.rollupConfig,y=e.userColumnWidths,F=e.userColumnWidthsByName,_=e.userRowHeights,T=e.showSearchBar,k=e.searchValue,D=e.selectedSearchColumns,C=e.invertSearchColumns,x=e.advancedFilters,R=e.quickFilters,P=e.selectDistinctColumns,z=e.pendingDataMap,M=e.canCopy,V=e.frozenColumns,U=e.columnHeaderGroups,q=e.getMetricCalculator,$=c.dh,Z=[new os(this),new gs(this),new Cs(this)],G=[new ro(this),new oo(this),new so(this),new lo(this),new uo(this),new ho(this),new co(this),new mo(this,$),new go(this),new vo(this),new po(this),...M?[new fo(this)]:[]];M&&Z.push(new us(this));var B=b.length>0?b:c.initialMovedColumns,ee=p.length>0?p:c.initialMovedRows,te=q({userColumnWidths:new Map(y),userColumnWidthsByName:F!=null?new Map(F):void 0,userRowHeights:new Map(_),movedColumns:B,initialColumnWidths:new Map(c==null||(t=c.layoutHints)===null||t===void 0||(t=t.hiddenColumns)===null||t===void 0?void 0:t.map(g=>[c.getColumnIndexByName(g),0]))});this.lastMetricCalculatorFactory=q;var ue=D??[],ge=Nt.createSearchFilter($,k,ue,c.columns,C);this.tableUtils=new w($),this.mouseHandlers=G,this.keyHandlers=Z,this.state={isFilterBarShown:u,isSelectingPartition:h,focusedFilterBarColumn:null,metricCalculator:te,metrics:void 0,partitionConfig:v??(m&&m.length?{partitions:m,mode:"partition"}:void 0),quickFilters:R?new Map(R):new Map,advancedFilters:new Map(x),shownAdvancedFilter:null,maximizedAdvancedFilter:null,hoverAdvancedFilter:null,sorts:[],reverse:!1,customColumns:[],selectDistinctColumns:P,gridSelection:null,copyOperation:null,loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1,loadingBlocksGrid:!1,movedColumns:B,movedRows:ee,shownColumnTooltip:null,formatter:new Zt($),isMenuShown:!1,customColumnFormatMap:new Map(l),columnAlignmentMap:new Map(d),conditionalFormats:o,conditionalFormatEditIndex:null,conditionalFormatPreview:void 0,conditionalFormatError:null,hoverSelectColumn:null,isTableDownloading:!1,isReady:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:0,showSearchBar:T,searchFilter:ge,searchValue:k,selectedSearchColumns:ue,invertSearchColumns:C,rollupConfig:f,rollupSelectedColumns:[],aggregationSettings:De(c)&&c.isEditable?oe(oe({},r),{},{showOnTop:!0}):r,selectedAggregation:null,openOptions:[],pendingRowCount:0,pendingDataMap:z??new Map,pendingDataErrors:new Map,pendingSavePromise:null,pendingSaveError:null,toastMessage:null,frozenColumns:V,showOverflowModal:!1,showNoPastePermissionModal:!1,noPastePermissionError:"",overflowText:"",overflowButtonTooltipProps:null,expandCellTooltipProps:null,expandTooltipDisplayValue:"expand",hoverTooltipProps:null,hoverDisplayValue:"",isGotoShown:!1,gotoRow:"",gotoRowError:"",gotoValueError:"",gotoValueSelectedColumnName:(n=(a=c.columns[0])===null||a===void 0?void 0:a.name)!==null&&n!==void 0?n:"",gotoValueSelectedFilter:we.eqIgnoreCase,gotoValue:"",gotoValueManuallyChanged:!1,columnHeaderGroups:U??c.initialColumnHeaderGroups}}componentDidMount(){var e=this.props.model;this.initState(),this.startListening(e)}componentDidUpdate(e,t){var n=this.props,a=n.inputFilters,r=n.isSelectingColumn,o=n.settings,l=n.model,d=n.customFilters,u=n.quickFilters,h=n.sorts,m=n.isQuickFiltersControlled,v=n.isSortsControlled,c=n.getMetricCalculator;l!==e.model&&(this.stopListening(e.model),this.startListening(l)),c!==e.getMetricCalculator&&this.maybeRebuildMetricCalculator();var b=a!==e.inputFilters?a.filter(C=>!e.inputFilters.includes(C)):[];if(b.length>0){var p,f=this.props.advancedSettings,y=(p=f.get(It.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS))!==null&&p!==void 0?p:!1;y&&(this.clearGridInputField(),this.clearCrossColumSearch());var F=this.applyInputFilters(b,y);F&&this.startLoading("Filtering...",{resetRanges:!0})}r!==e.isSelectingColumn&&this.resetColumnSelection(),o!==e.settings&&this.updateFormatterSettings(o),d!==e.customFilters&&this.startLoading("Filtering...",{resetRanges:!0}),(h!==e.sorts||!e.isSortsControlled&&v)&&this.updateSorts(h),(u!==e.quickFilters||!e.isQuickFiltersControlled&&m)&&this.updateQuickFilters(u);var _=this.loadingScrimStartTime,T=this.loadingScrimFinishTime;_!=null&&T!=null&&window.requestAnimationFrame(()=>{var C=Date.now(),x=C-_,R=T-_,P=Math.min(x/R,1);T<C&&(this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0),this.setState(z=>z.loadingScrimProgress==null?(N.debug2("Ignoring scrim update because loading cancelled."),null):{loadingScrimProgress:P})});var k=this.state.openOptions;if(k!==t.openOptions){var D=C=>C.type===X.AGGREGATION_EDIT;!k.some(D)&&t.openOptions.some(D)&&this.removeEmptyAggregations()}this.sendStateChange()}componentWillUnmount(){var e=this.props.model;this.stopListening(e),this.pending.cancel(),this.updateSearchFilter.cancel(),this.loadingTimer&&clearTimeout(this.loadingTimer),this.handleDownloadProgressUpdate.cancel(),this.animationFrame!==void 0&&cancelAnimationFrame(this.animationFrame),this.showViewportLoading.cancel()}get gridWrapper(){var e,t;return(e=(t=this.grid)===null||t===void 0?void 0:t.canvasWrapper.current)!==null&&e!==void 0?e:null}getKeyHandlers(){var e=this.props.keyHandlers;return this.getCachedKeyHandlers(e)}getMetricState(){var e,t=(e=this.grid)===null||e===void 0?void 0:e.getMetricState();if(t!=null){var n=this.state,a=n.advancedFilters,r=n.hoverSelectColumn,o=n.isFilterBarShown,l=n.isMenuShown,d=n.loadingScrimProgress,u=n.quickFilters,h=n.sorts,m=n.reverse,v=n.rollupConfig,c=this.props,b=c.model,p=c.isSelectingColumn;return oe(oe({},t),this.getCachedStateOverride(b,this.getTheme(),r,o,p,d,u,a,h,m,v,l))}}get renderer(){var e=this.props.renderer;return this.getCachedRenderer(e)}getMouseHandlers(){var e=this.props.mouseHandlers;return this.getCachedMouseHandlers(e)}getValueForCell(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.props.model,r=a.dh,o=this.getModelColumn(e),l=this.getModelRow(t);if(n&&o!=null&&l!=null){var d=a.valueForCell(o,l);if(w.isDateType(a.columns[o].type)){var u=a.formatter;return r.i18n.DateTimeFormat.format(yd,d,r.i18n.TimeZone.getTimeZone(u.timeZone))}return d}return n?null:o!=null&&l!=null?a.textForCell(o,l):""}getModelColumn(e){var t=this.state.metrics;K(t);var n=t.modelColumns;return n==null?null:e!=null&&e<0?e:e!=null?n.get(e):null}getModelRow(e){var t=this.state.metrics;K(t);var n=t.modelRows;return n==null?null:e!=null?n.get(e):null}getTheme(){var e,t=this.props,n=t.model,a=t.theme,r=t.density,o=this.context,l=o.theme,d=o.density;return this.getCachedTheme(l,a,(e=De(n)&&n.isEditable)!==null&&e!==void 0?e:!1,n.floatingTopRowCount+n.floatingBottomRowCount,r??d)}getVisibleColumn(e){var t=this.state.movedColumns;return Fe.getVisibleIndex(e,t)}makeQuickFilter(e,t,n){try{return this.tableUtils.makeQuickFilter(e,t,n)}catch(a){N.error("Error creating quick filter",a)}return null}applyInputFilters(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.props.model,a=this.state,r=a.advancedFilters,o=a.quickFilters,l=t?new Map:new Map(r),d=t?new Map:new Map(o),u=t&&r.size>0,h=t&&o.size>0;return e.forEach(m=>{var v=m.name,c=m.type,b=m.value,p=n.columns.findIndex(f=>{var y=f.name,F=f.type;return y===v&&F===c});p>=0?(u=l.delete(p)||u,h=this.applyQuickFilter(p,b,d)||h):N.error("Unable to find column for inputFilter",v,c,b)}),h&&this.requestQuickFiltersChange(d),u&&this.setState({advancedFilters:l}),h||u}applyQuickFilter(e,t,n){var a=this.props.model,r=a.formatter,o=a.columns[e];if(t!=null&&"".concat(t).trim().length>0){var l=n.get(e);if(l!=null){var d=l.text;if(d===t)return N.debug2("Ignoring change to existing filter"),!1}return n.set(e,{text:t,filter:this.makeQuickFilter(o,t,r.timeZone)}),!0}return n.delete(e)}setAdvancedFilterMap(e){this.setState({advancedFilters:e})}setAdvancedFilter(e,t,n){N.debug("Setting advanced filter",e,t),this.startLoading("Filtering...",{resetRanges:!0}),this.setState(a=>{var r=a.advancedFilters,o=new Map(r);return t==null?o.delete(e):o.set(e,{filter:t,options:n}),{advancedFilters:o}})}setQuickFilter(e,t,n){N.debug("Setting quick filter",e,t,n);var a=this.state.quickFilters,r=new Map(a);r.set(e,{filter:t,text:n}),this.requestQuickFiltersChange(r)}setFilterMap(e){var t;N.debug("setFilterMap",e);var n=this.props.advancedSettings,a=(t=n.get(It.LINK_CHANGE_CLEARS_ALL_FILTERS))!==null&&t!==void 0?t:!1;a&&this.clearAllFilters();var r=this.props.model,o=this.state.quickFilters,l=a?new Map:new Map(o),d=!1;e.forEach((u,h)=>{var m=u.columnType,v=u.filterList,c=r.columns.find(y=>y.name===h&&y.type===m);if(c!=null){var b=r.getColumnIndexByName(c.name);K(b);var p=se.combineFiltersFromList(m,v);if(p.length===0)d=l.delete(b)||d;else{var f=r.formatter;l.set(b,{filter:this.makeQuickFilter(c,p,f.timeZone),text:"".concat(p)}),d=!0}}}),d&&this.requestQuickFiltersChange(l)}removeColumnFilter(e){var t=Array.isArray(e)?e:[e,e],n=this.state,a=n.advancedFilters,r=n.quickFilters,o=this.props.isQuickFiltersControlled,l=new Map(a),d=new Map(r);l.forEach((m,v)=>{v>=t[0]&&v<=t[1]&&l.delete(v)}),d.forEach((m,v)=>{v>=t[0]&&v<=t[1]&&d.delete(v)});var u=l.size!==a.size,h=d.size!==r.size;h&&this.requestQuickFiltersChange(d),u&&((!h||o)&&this.startLoading("Filtering...",{resetRanges:!0}),this.setState({advancedFilters:l}))}removeQuickFilter(e){var t=this.state.quickFilters,n=new Map(t);n.delete(e),this.requestQuickFiltersChange(n)}clearAllFilters(){N.debug("Clearing all filters");var e=this.state,t=e.advancedFilters,n=e.quickFilters,a=e.searchFilter,r=this.props.isQuickFiltersControlled;if(!(n.size===0&&t.size===0&&a===null)){n.size>0&&this.requestQuickFiltersChange(Ee);var o=t.size>0||a!=null;o&&((n.size===0||r)&&this.startLoading("Clearing Filters...",{resetRanges:!0}),this.setState({advancedFilters:new Map,searchValue:"",searchFilter:void 0})),r||this.clearGridInputField()}}clearAllAggregations(){N.debug("Clearing all aggregations"),this.setState({aggregationSettings:fn})}clearCrossColumSearch(){N.debug("Clearing cross-column search"),this.setState({searchValue:"",searchFilter:void 0})}clearGridInputField(){this.filterInputRef.current!=null&&this.filterInputRef.current.setValue("")}rebuildFilters(){var e=this.props.model,t=this.state,n=t.advancedFilters,a=t.quickFilters;if(n.size===0&&a.size===0){N.debug("No filters to rebuild");return}var r=e.columns,o=e.formatter;N.debug("Rebuilding filters");var l=new Map,d=new Map;n.forEach((u,h)=>{var m=u.options,v=r[h],c=this.tableUtils.makeAdvancedFilter(v,m,o.timeZone);l.set(h,{options:m,filter:c})}),a.forEach((u,h)=>{var m=u.text,v=r[h];d.set(h,{text:m,filter:this.makeQuickFilter(v,m,o.timeZone)})}),this.startLoading("Rebuilding filters...",{resetRanges:!0}),a.size>0&&this.requestQuickFiltersChange(d),this.setState({advancedFilters:l})}setFilters(e){var t=e.quickFilters,n=e.advancedFilters;this.requestQuickFiltersChange(t),this.setState({advancedFilters:n})}updateFormatterSettings(e){var t,n,a,r,o,l,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=li.getColumnFormats(e),h=li.getDateTimeFormatterOptions(e),m=(t=e==null?void 0:e.defaultDecimalFormatOptions)!==null&&t!==void 0?t:{},v=(n=e==null?void 0:e.defaultIntegerFormatOptions)!==null&&n!==void 0?n:{},c=(a=e==null?void 0:e.truncateNumbersWithPound)!==null&&a!==void 0?a:!1,b=(r=e==null?void 0:e.showEmptyStrings)!==null&&r!==void 0?r:!0,p=(o=e==null?void 0:e.showNullStrings)!==null&&o!==void 0?o:!0,f=(l=e==null?void 0:e.showExtraGroupColumn)!==null&&l!==void 0?l:!0,y=!ze(this.globalColumnFormats,u),F=!ze(this.dateTimeFormatterOptions,h),_=!ze(this.decimalFormatOptions,e==null?void 0:e.defaultDecimalFormatOptions),T=!ze(this.integerFormatOptions,v),k=this.truncateNumbersWithPound!==c,D=this.showEmptyStrings!==b,C=this.showNullStrings!==p,x=this.showExtraGroupColumn!==f;(y||F||_||T||k||D||C||x)&&(this.globalColumnFormats=u,this.dateTimeFormatterOptions=h,this.decimalFormatOptions=m,this.integerFormatOptions=v,this.truncateNumbersWithPound=c,this.showEmptyStrings=b,this.showNullStrings=p,this.showExtraGroupColumn=f,this.updateFormatter({},d),F&&d&&this.rebuildFilters())}updateFormatter(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this.state.customColumnFormatMap,r=this.props.model,o=oe({customColumnFormatMap:a},e),l=[...(t=this.globalColumnFormats)!==null&&t!==void 0?t:[],...o.customColumnFormatMap.values()],d=new Zt(r.dh,l,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions,this.truncateNumbersWithPound,this.showEmptyStrings,this.showNullStrings);N.debug("updateFormatter",this.globalColumnFormats,l),this.setState(oe(oe({},o),{},{formatter:d}),()=>{n&&this.grid&&this.grid.forceUpdate()})}initFormatter(){var e=this.props.settings;this.updateFormatterSettings(e)}initState(){var e=this.props.model;try{ct(e)&&e.isPartitionRequired?this.loadPartitionsTable(e):this.loadTableState()}catch(t){this.handleTableLoadError(t)}}loadTableState(){var e=this.props,t=e.applyInputFiltersOnInit,n=e.inputFilters,a=e.sorts,r=e.model,o=e.reverse,l=e.reverseType,d=e.customColumns,u=e.searchValue,h=e.selectedSearchColumns,m=e.invertSearchColumns,v=h??[],c=Nt.createSearchFilter(r.dh,u,v,r.columns,m);if(t){var b=n.filter(p=>p.value!=null);this.applyInputFilters(b)}this.setState({sorts:a,reverse:o||l===w.REVERSE_TYPE.POST_SORT,customColumns:d,isReady:!0,searchFilter:c}),this.initFormatter()}loadPartitionsTable(e){var t=this;return Je(function*(){try{var n=t.state.partitionConfig;n||(t.startLoading("Loading partitions...",{loadingCancelShown:!1,resetRanges:!0}),t.initializePartitionConfig(e)),t.setState({isSelectingPartition:!0},t.loadTableState)}catch(a){Ae.isCanceled(a)||t.handleTableLoadError(a)}})()}initializePartitionConfig(e){var t=this;return Je(function*(){var n=yield t.pending.add(e.partitionKeysTable(),o=>o.close()),a=e.dh,r=n.columns.map(o=>o.sort().desc());n.applySort(r),n.setViewport(0,0),n.addEventListener(a.Table.EVENT_UPDATED,o=>{try{var l=o.detail;if(l.rows.length===0){t.stopLoading();return}var d=l.rows[0],u=n.columns.map(m=>d.get(m)),h={partitions:u,mode:e.isPartitionAwareSourceTable?"partition":"keys"};n.close(),t.setState({loadingSpinnerShown:!1,partitionConfig:h})}catch(m){n.close(),N.error("Error getting initial partition config",m)}})})()}selectPartitionKeyFromTable(e){var t=this.props.model;if(K(e),ct(t)){var n=this.getRowDataMap(e),a=new Set(t.partitionColumns.map(l=>l.name)),r=Object.entries(n).filter(l=>{var d=Ze(l,2),u=d[0];return d[1],a.has(u)}).map(l=>{var d=Ze(l,2);d[0];var u=d[1];return u.value}),o={partitions:r,mode:"partition"};this.setState({isSelectingPartition:!0,partitionConfig:o})}}copyCell(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.props.canCopy;if(a){var r=String(this.getValueForCell(e,t,n));Hi(r).catch(o=>N.error("Unable to copy cell",o))}else N.error("Attempted to copyCell for user without copy permission.")}copyColumnHeader(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==null){var n=this.props.canCopy,a=this.state.movedColumns;if(n){var r={columnIndex:e,columnDepth:t,movedColumns:a};this.setState({copyOperation:r})}else N.error("Attempted copyColumnHeader for user without copy permission.")}}copyRanges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3?arguments[3]:void 0,r=this.props.model,o=Yi.boundedRanges(e,r.columnCount,r.rowCount),l=new Oo(o,()=>r);this.copySelection(l,t,n,a)}copySelection(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3?arguments[3]:void 0,r=this.props.canCopy,o=this.state,l=o.metricCalculator,d=o.movedColumns,u=l.getUserColumnWidths();if(r){if(e instanceof ht&&e.pendingRanges.length>0)return;var h={selection:e,includeHeaders:t,formatValues:n,movedColumns:d,userColumnWidths:u,error:a};this.setState({copyOperation:h})}else N.error("Attempted copySelection for user without copy permission.")}startLoading(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.resetRanges,a=n===void 0?!1:n,r=t.loadingCancelShown,o=r===void 0?!0:r,l=t.loadingBlocksGrid,d=l===void 0?!0:l;this.setState({loadingText:e,loadingCancelShown:o,loadingBlocksGrid:d});var u=this.getTheme();if(a&&this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({top:0},!0)),this.loadingScrimStartTime==null){var h,m,v=u.minScrimTransitionTime,c=u.maxScrimTransitionTime;K(v),K(c);var b=(h=(m=this.gridWrapper)===null||m===void 0?void 0:m.getBoundingClientRect().height)!==null&&h!==void 0?h:0,p=Math.max(v,Math.min(b/2,c));this.loadingScrimStartTime=Date.now(),this.loadingScrimFinishTime=this.loadingScrimStartTime+p,this.setState({loadingScrimProgress:0}),this.loadingTimer=setTimeout(()=>{this.setState({loadingSpinnerShown:!0})},je.loadingSpinnerDelay)}}stopLoading(){this.showViewportLoading.cancel(),this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0,this.setState({loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1}),this.loadingTimer!=null&&(clearTimeout(this.loadingTimer),this.loadingTimer=void 0)}rollback(){if(this.lastLoadedConfig){N.debug("loading last loading config",this.lastLoadedConfig);var e=this.lastLoadedConfig,t=e.advancedFilters,n=e.aggregationSettings,a=e.conditionalFormats,r=e.conditionalFormatEditIndex,o=e.conditionalFormatPreview,l=e.customColumns,d=e.quickFilters,u=e.reverse,h=e.rollupConfig,m=e.searchFilter,v=e.selectDistinctColumns,c=e.sorts;this.lastLoadedConfig=null,this.setState({advancedFilters:t,aggregationSettings:n,conditionalFormats:a,conditionalFormatEditIndex:r,conditionalFormatPreview:o,customColumns:l,quickFilters:d,reverse:u,rollupConfig:h,searchFilter:m,selectDistinctColumns:v,sorts:c})}else N.debug("remove all sorts, filters, and custom columns"),this.setState({advancedFilters:new Map,aggregationSettings:fn,conditionalFormats:[],conditionalFormatEditIndex:null,conditionalFormatPreview:void 0,customColumns:[],quickFilters:new Map,reverse:!1,rollupConfig:void 0,selectDistinctColumns:[],sorts:[]})}canRollback(){return this.lastLoadedConfig!=null||!se.isEmptyConfig(this.state)}startListening(e){e.addEventListener(ce.EVENT.UPDATED,this.handleUpdate),e.addEventListener(ce.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.addEventListener(ce.EVENT.PENDING,this.handlePending),e.addEventListener(ce.EVENT.PENDING_CLEARED,this.handlePendingCleared),e.addEventListener(ce.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.addEventListener(ce.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.addEventListener(ce.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated),e.addEventListener(ce.EVENT.TABLE_CHANGED,this.handleTableChanged),e.addEventListener(ce.EVENT.SCHEMA_CHANGED,this.handleSchemaChanged)}stopListening(e){e.removeEventListener(ce.EVENT.UPDATED,this.handleUpdate),e.removeEventListener(ce.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.removeEventListener(ce.EVENT.PENDING,this.handlePending),e.removeEventListener(ce.EVENT.PENDING_CLEARED,this.handlePendingCleared),e.removeEventListener(ce.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.removeEventListener(ce.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.removeEventListener(ce.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated),e.removeEventListener(ce.EVENT.TABLE_CHANGED,this.handleTableChanged),e.removeEventListener(ce.EVENT.SCHEMA_CHANGED,this.handleSchemaChanged)}focus(){var e;(e=this.grid)===null||e===void 0||e.focus()}focusFilterBar(e){var t=this.state.movedColumns,n=this.props.model,a=n.columnCount,r=Fe.getModelIndex(e,t);if(e==null||a<=e||!n.isFilterable(r)){this.setState({focusedFilterBarColumn:null});return}var o=this.state,l=o.metricCalculator,d=o.metrics;K(d);var u=this.getMetricState();K(u);var h=l.getScrollLeftForColumn(e,u,d);if(h!=null){var m;(m=this.grid)===null||m===void 0||m.setViewState({left:h,leftOffset:0},!0)}this.lastFocusedFilterBarColumn=e,this.setState({focusedFilterBarColumn:e,isFilterBarShown:!0})}hideColumnByVisibleIndex(e){var t,n=this.state,a=n.metricCalculator,r=n.movedColumns;a.setColumnWidth(Fe.getModelIndex(e,r),0),(t=this.grid)===null||t===void 0||t.forceUpdate()}freezeColumnByColumnName(e){var t=this.state,n=t.frozenColumns,a=t.movedColumns,r=this.props.model;N.debug2("freezing column",e);var o=n==null?new Set(r.frozenColumns):new Set(n);o.add(e);var l=r.getColumnIndexByName(e);K(l);var d=Fe.getVisibleIndex(l,a),u=Fe.moveItem(d,o.size-1,a);this.setState({frozenColumns:[...o],movedColumns:u})}unFreezeColumnByColumnName(e){var t=this.state,n=t.frozenColumns,a=t.movedColumns,r=this.props.model;N.debug2("unfreezing column",e);var o=n==null?new Set(r.frozenColumns):new Set(n);o.delete(e);var l=r.getColumnIndexByName(e);K(l);var d=Fe.getVisibleIndex(l,a),u=Fe.moveItem(d,o.size+r.frontColumns.length,a);this.setState({frozenColumns:[...o],movedColumns:u})}handleFrozenColumnsChanged(e){this.setState({frozenColumns:e})}toggleExpandColumn(e,t){N.debug2("Toggle expand column",e);var n=this.props.model;Jt(n)&&n.hasExpandableColumns&&n.setColumnExpanded(e,!n.isColumnExpanded(e),t)}expandAllColumns(){N.debug2("Expand all columns");var e=this.props.model;Jt(e)&&e.isExpandAllColumnsAvailable&&e.expandAllColumns()}collapseAllColumns(){N.debug2("Collapse all columns");var e=this.props.model;Jt(e)&&e.isExpandAllColumnsAvailable&&e.collapseAllColumns()}handleColumnVisibilityChanged(e,t){var n,a=this.state,r=a.metricCalculator,o=a.metrics;K(o),t?e.forEach(l=>{var d=r.initialColumnWidths.get(l),u=o.calculatedColumnWidths.get(l);d!==u&&u!=null?r.setColumnWidth(l,u):r.resetColumnWidth(l)}):e.forEach(l=>{r.setColumnWidth(l,0)}),(n=this.grid)===null||n===void 0||n.forceUpdate()}handleColumnVisibilityReset(){var e,t,n=this.state.metricCalculator,a=this.props.model;n.resetAllColumnWidths(),this.handleMovedColumnsChanged(a.initialMovedColumns),this.handleHeaderGroupsChanged(a.initialColumnHeaderGroups),this.setState({frozenColumns:(e=(t=a.layoutHints)===null||t===void 0?void 0:t.frozenColumns)!==null&&e!==void 0?e:le})}handleCrossColumnSearch(e,t,n){var a=this.props.model;this.startLoading("Searching..."),this.updateSearchFilter(e,t,a.columns,n),this.setState({searchValue:e,selectedSearchColumns:t,invertSearchColumns:n})}handleAnimationLoop(){var e;(e=this.grid)===null||e===void 0||e.updateCanvas(),this.isAnimating&&(this.animationFrame=requestAnimationFrame(this.handleAnimationLoop))}handleAnimationStart(){N.debug2("handleAnimationStart"),this.isAnimating=!0,this.animationFrame=requestAnimationFrame(this.handleAnimationLoop)}handleAnimationEnd(){N.debug2("handleAnimationEnd"),this.isAnimating=!1}handlePartitionChange(e){this.startLoading("Partitioning...");var t=this.state.partitionConfig;t!==e&&this.setState({partitionConfig:e})}handleTableLoadError(e){if(!Ae.isCanceled(e)){N.error(e);var t=this.props.onError;t(e)}}handleViewportUpdated(){var e=this.props.model,t=this.state,n=t.loadingText,a=t.loadingSpinnerShown,r="Waiting for viewport...";e.isViewportPending&&!a?this.showViewportLoading():n===r&&!e.isViewportPending&&this.stopLoading()}showAllColumns(){for(var e,t=this.state.metricCalculator,n=t.getUserColumnWidths(),a=[...n.entries()],r=0;r<a.length;r+=1){var o=Ze(a[r],2),l=o[0],d=o[1];d===0&&t.resetColumnWidth(l)}(e=this.grid)===null||e===void 0||e.forceUpdate()}updateMetrics(){var e;this.setState({metrics:(e=this.grid)===null||e===void 0?void 0:e.updateMetrics()})}toggleSort(e,t){N.info("Toggling sort for column",e);var n=this.props.model,a=this.getModelColumn(e);if(K(a),n.isColumnSortable(e)){var r=this.state.sorts,o=w.toggleSortForColumn(r,n.columns,a,t);this.requestSortsChange(o)}else N.debug("Column type was not sortable",n.columns[e])}updateSorts(e){var t;this.startLoading("Sorting..."),this.setState({sorts:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}requestSortsChange(e){var t=this.props,n=t.isSortsControlled,a=t.onSortsChange;a==null||a(e),n||this.updateSorts(e)}updateQuickFilters(e){var t,n=this.state.quickFilters;if(e==null){if(n.size===0)return}else if(e===n)return;this.startLoading("Filtering...",{resetRanges:!0}),this.setState({quickFilters:e??Ee}),(t=this.grid)===null||t===void 0||t.forceUpdate()}requestQuickFiltersChange(e){var t=this.props,n=t.isQuickFiltersControlled,a=t.onQuickFiltersChange;a==null||a(e),n||this.updateQuickFilters(e)}sortColumn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.sortDirection.none,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;K(e);var r=this.props.model,o=w.sortColumn(r.sort,r.columns,e,t,n,a);this.requestSortsChange(o)}reverse(e){var t;this.startLoading("Reversing..."),this.setState({reverse:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}isReversible(){var e=this.props.model;return e.isReversible}toggleFilterBar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.lastFocusedFilterBarColumn,t=this.state.isFilterBarShown;if(t=!t,this.setState({isFilterBarShown:t}),t)if(e!=null)this.focusFilterBar(e);else{for(var n=0,a=this.props.model,r=a.columnCount,o=0;o<r;o+=1){var l=this.getModelColumn(o);if(l!=null){var d=a.columns[l];if(d!=null&&w.isTextType(d.type)){n=o;break}}}this.focusFilterBar(n)}else{var u;(u=this.grid)===null||u===void 0||u.focus()}}isTableSearchAvailable(){var e,t,n,a=this.props,r=a.model,o=a.canToggleSearch,l=r.dh,d=r==null||(e=r.layoutHints)===null||e===void 0?void 0:e.searchDisplayMode;return d===((t=l.SearchDisplayMode)===null||t===void 0?void 0:t.SEARCH_DISPLAY_HIDE)?!1:d===((n=l.SearchDisplayMode)===null||n===void 0?void 0:n.SEARCH_DISPLAY_SHOW)?!0:o}toggleSearchBar(){var e=this.state.showSearchBar;if(this.isTableSearchAvailable()){var t=!e;this.setState({showSearchBar:t},()=>{var n;if(t&&(n=this.crossColumnRef)!==null&&n!==void 0&&n.current){var a;(a=this.crossColumnRef)===null||a===void 0||a.current.focus()}else{var r;(r=this.grid)===null||r===void 0||r.focus()}})}}toggleGotoRow(){var e,t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=this.state.isGotoShown;if(n||a){var l;this.setState({isGotoShown:!0,gotoValue:a,gotoValueSelectedColumnName:r,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1}),this.focusRowInGrid(n),(l=this.gotoRowRef.current)===null||l===void 0||l.focus();return}var d=(e=this.grid)===null||e===void 0?void 0:e.state.selection.cursorRow,u=(t=this.grid)===null||t===void 0?void 0:t.state.selection.cursorColumn;if(d==null||u==null){this.setState({isGotoShown:!o,gotoRow:"",gotoValue:"",gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1});return}var h=this.props.model,m=h.columns[u].name,v=String(this.getValueForCell(u,d,!0));this.setState({isGotoShown:!o,gotoRow:"".concat(d+1),gotoValue:v,gotoValueSelectedColumnName:m,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1})}commitPending(){var e=this;return Je(function*(){var t,n=e.props.model;if(!De(n)||!n.isEditable)throw new Error("Cannot save, table is not editable");var a=e.state.pendingSavePromise;if(a!=null)throw new Error("Save already in progress");var r=(t=document)===null||t===void 0||(t=t.activeElement)===null||t===void 0?void 0:t.classList.contains("grid-cell-input-field");if(r!=null&&r){var o;if(document.activeElement!=null&&document.activeElement.classList.contains("error"))throw new Zr("Current input is invalid");(o=e.grid)===null||o===void 0||o.focus()}var l=e.pending.add(n.commitPending()).then(()=>{e.setState({pendingSaveError:null,pendingSavePromise:null})}).catch(d=>{Ae.isCanceled(d)||e.setState({pendingSaveError:d,pendingSavePromise:null})});return e.setState({pendingSavePromise:l}),l})()}discardPending(){var e=this;return Je(function*(){var t=e.state.pendingSavePromise;if(t!=null)throw new Error("Cannot cancel a save in progress");e.setState({pendingSavePromise:null,pendingSaveError:null,pendingDataMap:new Map,pendingDataErrors:new Map})})()}selectColumn(e){var t=this.props.onColumnSelected;t(e)}selectData(e,t){var n=this.getRowDataMap(t),a=this.props.onDataSelected;a(t,n)}getRowDataMap(e){for(var t=this,n=this.props.model,a=n.columns,r=n.groupedColumns,o={},l=function(){var h=a[d],m=h.name,v=h.type,c=n.valueForCell(d,e),b=n.textForCell(d,e),p=t.getVisibleColumn(d),f=vn(n)&&n.isRowExpandable(e),y=r.find(F=>F.name===m)!=null;o[m]={value:c,text:b,type:v,isGrouped:y,isExpandable:f,visibleIndex:p}},d=0;d<a.length;d+=1)l();return o}handleAdvancedFilterChange(e,t,n){var a=this.props.model,r=a.getColumnIndexByName(e.name);K(r),this.setAdvancedFilter(r,t,n)}handleAdvancedFilterSortChange(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.props.model,r=a.getColumnIndexByName(e.name);K(r);var o=a.columns[r].name,l=w.getSortForColumn(a.sort,o),d=null;(l==null||l.direction!==t)&&(t===w.sortDirection.descending?d=e.sort().desc():d=e.sort().asc());var u=w.setSortForColumn(a.sort,o,d,n);N.info("Setting table sorts",u),this.requestSortsChange(u)}handleAdvancedFilterDone(){var e;(e=this.grid)===null||e===void 0||e.focus()}handleAdvancedFilterToggleMaximize(e){this.setState(t=>{var n=t.maximizedAdvancedFilter;return{maximizedAdvancedFilter:n===e?null:e}})}handleAdvancedMenuOpened(e){this.setState({shownAdvancedFilter:e,maximizedAdvancedFilter:null})}handleGotoRowOpened(){this.setState({isGotoShown:!0,gotoValueManuallyChanged:!1})}handleGotoRowClosed(){this.setState({isGotoShown:!1,gotoValueManuallyChanged:!1})}handleAdvancedMenuClosed(e){var t,n=this.state,a=n.focusedFilterBarColumn,r=n.isFilterBarShown;if(r&&a===e&&((t=this.filterInputRef)===null||t===void 0?void 0:t.current)!==null){var o;(o=this.filterInputRef)===null||o===void 0||o.current.focus(),this.setState({shownAdvancedFilter:null,maximizedAdvancedFilter:null})}else this.setState({focusedFilterBarColumn:null,shownAdvancedFilter:null,maximizedAdvancedFilter:null})}handleCancel(){this.rollback()}handleChartChange(){}handleChartCreate(e){var t=this.props,n=t.model,a=t.onCreateChart;a(e,n)}handleGridError(e){N.warn("Grid Error",e),this.setState({toastMessage:s.jsx("div",{className:"error-message",children:"".concat(e)})})}handleFilterBarChange(e){var t=this.state,n=t.focusedFilterBarColumn,a=t.quickFilters,r=new Map(a);if(n!=null){var o=this.getModelColumn(n);K(o),this.applyQuickFilter(o,e,r)}this.requestQuickFiltersChange(r)}handleFilterBarDone(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e){var n;(n=this.grid)===null||n===void 0||n.focus()}t&&this.setState({focusedFilterBarColumn:null})}handleFilterBarTab(e){var t=this.state.focusedFilterBarColumn;K(t),e?this.focusFilterBar(t-1):this.focusFilterBar(t+1)}handleFormatSelection(e,t){var n=this.props.model,a=n.columns[e],r=this.state.customColumnFormatMap,o=new Map(r);if(t!=null){var l=w.getNormalizedType(a.type);K(l);var d=Zt.makeColumnFormattingRule(l,a.name,t);o.set(a.name,d)}else o.delete(a.name);this.updateFormatter({customColumnFormatMap:o})}handleColumnAlignmentChange(e,t){var n=this.props.model,a=n.columns[e];this.setState(r=>{var o=r.columnAlignmentMap,l=o===void 0?Ee:o,d=new Map(l);return t!=null?d.set(a.name,t):d.delete(a.name),{columnAlignmentMap:d}})}handleMenu(e){e.stopPropagation(),this.setState({isMenuShown:!0})}handleMenuClose(){this.setState({isMenuShown:!1,openOptions:[]})}handleMenuBack(){this.setState(e=>{var t=e.openOptions,n=[...t];return n.pop(),{openOptions:n}})}handleMenuSelect(e){this.setState(t=>{var n=t.openOptions;return{openOptions:[...n,e]}})}handleRequestFailed(e){var t=e,n=t.detail;N.error("request failed:",n),this.stopLoading();var a=this.state,r=a.partitionConfig,o=a.conditionalFormatEditIndex;if(Ur(n)&&r!=null)this.startLoading("Reloading partition...",{resetRanges:!0}),this.setState({partitionConfig:void 0},()=>{this.initState()});else if(o!==null){var l,d=(l=n==null?void 0:n.errorMessage)!==null&&l!==void 0?l:String(n);this.setState({conditionalFormatError:d,conditionalFormatPreview:void 0})}else if(this.canRollback())this.startLoading("Rolling back changes...",{resetRanges:!0}),this.rollback();else{N.error("Table failed and unable to rollback");var u=this.props.onError;u(new Error("Error displaying table: ".concat(n)))}}handlePending(e){var t=e,n=t.detail,a=n??{},r=a.text,o=a.options;this.loadingScrimStartTime==null&&this.startLoading(r??"Loading...",oe({loadingCancelShown:!1},o))}handlePendingCleared(){this.stopLoading()}handleUpdate(){var e;N.debug2("Received model update");var t=this.state,n=t.advancedFilters,a=t.aggregationSettings,r=t.conditionalFormats,o=t.conditionalFormatEditIndex,l=t.conditionalFormatPreview,d=t.customColumns,u=t.quickFilters,h=t.reverse,m=t.rollupConfig,v=t.searchFilter,c=t.selectDistinctColumns,b=t.sorts,p={advancedFilters:n,aggregationSettings:a,conditionalFormats:r,conditionalFormatEditIndex:o,conditionalFormatPreview:l,customColumns:d,quickFilters:u,reverse:h,rollupConfig:m,searchFilter:v,selectDistinctColumns:c,sorts:b};se.isEmptyConfig(p)?this.lastLoadedConfig=null:this.lastLoadedConfig=p,(e=this.grid)===null||e===void 0||e.forceUpdate(),this.stopLoading()}handleTableChanged(){var e=this.props.model,t=this.state.partitionConfig;ct(e)&&(t==null?void 0:t.mode)!=="keys"&&this.rebuildFilters()}handleSchemaChanged(){var e,t=this.props.model;this.setState({movedColumns:t.initialMovedColumns});var n=(e=this.grid)===null||e===void 0?void 0:e.state.selection;if(n!=null){var a=At(t),r=n instanceof ht;if(a!==r){var o;(o=this.grid)===null||o===void 0||o.clearSelectedRanges()}}}handleViewChanged(e){var t,n,a=this.props.model,r=(t=(n=this.grid)===null||n===void 0?void 0:n.state.selection.selectionEndRow)!==null&&t!==void 0?t:0,o=0;if(De(a)&&a.isEditable){K(e);var l=e.bottomViewport,d=a.rowCount-a.floatingBottomRowCount;r===d-1?o=a.pendingRowCount+1:r===d-2?o=a.pendingRowCount:o=Math.max(0,l-(a.rowCount-a.pendingRowCount)-a.floatingTopRowCount-a.floatingBottomRowCount-1)}this.setState({metrics:e,pendingRowCount:o})}handleSelectionChanged(e){K(e);var t=this.props.onSelectionChanged;t==null||t(e)}handleGridSelectionChange(e){var t=this.props.onSelectionChange,n=this.state.copyOperation;this.setState({gridSelection:e}),n!=null&&this.setState({copyOperation:null});var a=e.cursorRow;a!=null&&this.setState({gotoRow:"".concat(a+1)}),t==null||t(e),e instanceof ht&&e.pendingRanges.length>0&&this.resolveKeyedSelection(e)}resolveKeyedSelection(e){var t=this;return Je(function*(){var n=t.props.model;if(At(n)){var a=e.pendingRanges;if(a.length!==0)try{var r,o=yield n.fetchKeyValuesForRowRanges(a);if(((r=t.grid)===null||r===void 0?void 0:r.getSelection())!==e)return;t.grid.setSelection(e.resolve(o))}catch(d){var l;N.error("resolveKeyedSelection failed",d),((l=t.grid)===null||l===void 0?void 0:l.getSelection())===e&&t.grid.setSelection(e.clear())}}})()}handleMovedColumnsChanged(e,t){this.setState({movedColumns:e},t)}handleHeaderGroupsChanged(e){var t=this.props.model,n=this.state.columnHeaderGroups;n!==e&&this.setState({columnHeaderGroups:e.every(a=>$r(a)&&a.isValid())?e:se.parseColumnHeaderGroups(t,e).groups},()=>{var a;return(a=this.grid)===null||a===void 0?void 0:a.forceUpdate()})}handleTooltipRef(e){e!=null&&e.startTimer(),this.tooltip=e}handleConditionalFormatsChange(e){N.debug("Updated conditional formats",e),this.setState({conditionalFormats:e})}handleConditionalFormatCreate(){N.debug("Create new conditional format");var e=this.state,t=e.openOptions,n=e.conditionalFormats;this.setState({openOptions:[...t,{type:X.CONDITIONAL_FORMATTING_EDIT,title:"Create Formatting Rule"}],conditionalFormatEditIndex:n.length,conditionalFormatPreview:void 0})}handleConditionalFormatEdit(e){N.debug("Edit conditional format",e);var t=this.state,n=t.openOptions,a=t.conditionalFormats;this.setState({openOptions:[...n,{type:X.CONDITIONAL_FORMATTING_EDIT,title:"Edit Formatting Rule"}],conditionalFormatEditIndex:e,conditionalFormatPreview:oe({},a[e])})}handleConditionalFormatEditorSave(e){N.debug("Save conditional format changes",e),this.setState(t=>{if(t.conditionalFormatEditIndex===null)return N.debug("Invalid format index"),null;var n=[...t.conditionalFormats];return n[t.conditionalFormatEditIndex]=e,{conditionalFormats:n}},()=>{this.handleMenuBack()})}handleConditionalFormatEditorCancel(){this.handleMenuBack(),this.setState({conditionalFormatEditIndex:null,conditionalFormatError:null})}handleUpdateCustomColumns(e){N.info("handleUpdateCustomColumns:",e);var t=this.props.model,n=this.state,a=n.movedColumns,r=n.sorts,o=n.quickFilters,l=n.advancedFilters,d=n.selectDistinctColumns,u=t.columns,h=t.customColumns.map(y=>"".concat(y)),m=se.getRemovedCustomColumnNames(h,e);if(m.length>0){var v=se.removeSortsInColumns(r,m),c=se.removeFiltersInColumns(u,o,m),b=se.removeFiltersInColumns(u,l,m),p=se.removeColumnFromMovedColumns(u,a,m),f=se.removeColumnsFromSelectDistinctColumns(d,m);v.length!==r.length&&(N.debug("removing sorts from removed custom columns..."),this.requestSortsChange(v)),(c.size!==o.size||b.size!==l.size)&&(N.debug("removing filters from removed custom columns..."),c.size!==o.size&&this.requestQuickFiltersChange(c),b.size!==l.size&&this.setState({advancedFilters:b})),ze(a,p)||(N.debug("change moved columns for removed custom columns",p),this.setState({movedColumns:p})),ze(d,f)||(N.debug("change selectDistinct columns for removed custom columns",p),this.setState({selectDistinctColumns:f}))}this.setState({customColumns:e}),e.length>0&&this.startLoading("Applying custom columns...")}handleCustomColumnsChanged(){N.debug("Model columns changed");var e=this.state.isReady;e?(this.updateMetrics(),this.stopLoading()):this.loadTableState()}maybeRebuildMetricCalculator(){var e,t=this.props.getMetricCalculator;if(t!==this.lastMetricCalculatorFactory){var n=this.props.model,a=this.state.movedColumns,r=t({userColumnWidths:new Map,userRowHeights:new Map,movedColumns:a,initialColumnWidths:new Map(n==null||(e=n.layoutHints)===null||e===void 0||(e=e.hiddenColumns)===null||e===void 0?void 0:e.map(o=>[n.getColumnIndexByName(o),0]))});this.lastMetricCalculatorFactory=t,N.debug("Swapping metric calculator",r),this.grid!=null&&(this.grid.metricCalculator=r),this.setState({metricCalculator:r})}}handlePendingCommitClicked(){return this.commitPending()}handlePendingDiscardClicked(){return this.discardPending()}handlePendingDataUpdated(){var e;N.debug("pending data updated");var t=this.props.model,n=t.pendingDataMap,a=t.pendingDataErrors;this.setState({pendingDataMap:n,pendingDataErrors:a,pendingSaveError:null}),(e=this.grid)===null||e===void 0||e.forceUpdate()}handleResizeColumn(e){var t,n=this.state,a=n.metrics,r=n.metricCalculator;if(!a)throw new Error("Metrics not set");var o=Yt(a.contentColumnWidths,e),l=r.getUserColumnWidths();l.has(e)?(r.resetColumnWidth(e),r.setCalculatedColumnWidth(e,o)):r.setColumnWidth(e,o),(t=this.grid)===null||t===void 0||t.forceUpdate()}handleResizeAllColumns(){var e,t=this.state,n=t.metrics,a=t.metricCalculator;if(!n)throw new Error("Metrics not set");var r=[...n.allColumnWidths.entries()],o=r.filter(f=>{var y=Ze(f,2);y[0];var F=y[1];return F!==0}).map(f=>{var y=Ze(f,1),F=y[0];return F}),l=n.contentColumnWidths,d=a.getUserColumnWidths(),u=o.filter(f=>d.has(f));if(o.length===u.length)for(var h=0;h<o.length;h+=1){var m=o[h],v=Yt(l,m);a.resetColumnWidth(m),a.setCalculatedColumnWidth(m,v)}else for(var c=0;c<o.length;c+=1){var b=o[c],p=Yt(l,b);a.setColumnWidth(b,p)}(e=this.grid)===null||e===void 0||e.forceUpdate()}handleAggregationsChange(e){var t,n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];N.debug("handleAggregationsChange",e,a,r);var o=this.state.rollupConfig,l=((t=o==null||(n=o.columns)===null||n===void 0?void 0:n.length)!==null&&t!==void 0?t:0)>0,d=[...a,...r],u=!(l&&d.length>0&&d.every(h=>Xt.isRollupProhibited(h)));u&&this.startLoading("Aggregating ".concat(e.aggregations.map(h=>h.operation).join(", "),"...")),this.setState({aggregationSettings:e})}handleAggregationChange(e){var t,n;N.debug("handleAggregationChange",e);var a=this.state.rollupConfig,r=((t=a==null||(n=a.columns)===null||n===void 0?void 0:n.length)!==null&&t!==void 0?t:0)>0,o=!(r&&Xt.isRollupProhibited(e.operation));o&&this.startLoading("Aggregating ".concat(e.operation,"...")),this.setState(l=>{var d=l.aggregationSettings;return{selectedAggregation:e,aggregationSettings:oe(oe({},d),{},{aggregations:d.aggregations.map(u=>u.operation===e.operation?e:u)})}})}handleAggregationEdit(e){N.debug("handleAggregationEdit",e);var t=this.state.openOptions;this.setState({openOptions:[...t,{type:X.AGGREGATION_EDIT,title:"Edit Columns to ".concat(e.operation)}],selectedAggregation:e})}handleRollupChange(e){var t,n;if(N.info("Rollup change",e),(e==null?void 0:e.columns)!=null&&e.columns.length>0){var a=this.state.metricCalculator,r=a.getUserColumnWidthsByName();e.columns.forEach(o=>{r.get(o)===0&&a.resetColumnWidthByName(o)})}this.resetGridViewState(),this.clearAllFilters(),this.startLoading("Grouping by columns ".concat((t=e==null||(n=e.columns)===null||n===void 0?void 0:n.join(", "))!==null&&t!==void 0?t:"","...")),this.requestSortsChange(le),this.setState({rollupConfig:e,movedColumns:le,frozenColumns:le,reverse:!1,selectDistinctColumns:le})}handleSelectDistinctChanged(e){N.debug("SelectDistinct change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.clearAllAggregations(),this.startLoading("Selecting distinct values in ".concat(e.length>0?e.join(", "):"","...")),this.requestSortsChange(le),this.setState({selectDistinctColumns:e,movedColumns:[],reverse:!1})}handleDownloadTableStart(){var e=this.props.canDownloadCsv;e?this.setState({isTableDownloading:!0,tableDownloadProgress:0,tableDownloadEstimatedTime:null,tableDownloadStatus:He.DOWNLOAD_STATUS.INITIATING}):N.error("Attempted to handleDownloadTableStart for user without download CSV permission.")}handleDownloadTable(e,t,n,a,r,o,l){var d=this.props.canDownloadCsv;d?(N.info("start table downloading",e,t,n,a,r,o,l),this.setState(()=>(this.tableSaver&&this.tableSaver.startDownload(e,t,n,a,r,o,l),{tableDownloadStatus:He.DOWNLOAD_STATUS.DOWNLOADING}))):N.error("Attempted to handleDownloadTable for user without download CSV permission.")}removeEmptyAggregations(){N.debug("removeEmptyAggregations"),this.setState(e=>{var t=e.aggregationSettings,n=t.aggregations,a=n.filter(r=>r.selected.length>0||r.invert);return a.length!==n.length?{selectedAggregation:null,aggregationSettings:oe(oe({},t),{},{aggregations:a})}:{selectedAggregation:null,aggregationSettings:t}})}seekRow(e){var t=arguments,n=this;return Je(function*(){var a,r=t.length>1&&t[1]!==void 0?t[1]:!1,o=n.state,l=o.gotoValueSelectedColumnName,d=o.gotoValueSelectedFilter,u=n.props.model,h=u.dh;if(u.isSeekRowAvailable&&e!==""){var m=se.getColumnByName(u.columns,l);if(m!==void 0){var v=(a=n.grid)===null||a===void 0?void 0:a.state.selection.cursorRow;v==null&&(v=0);var c=d===we.contains||d===we.containsIgnoreCase,b=d===we.eqIgnoreCase||d===we.containsIgnoreCase;try{var p,f=u.formatter,y=w.getNormalizedType(m.type),F;switch(y){case w.dataType.CHAR:case w.dataType.STRING:{F=yield u.seekRow(v,m,h.ValueType.STRING,e,b,c,r??!1);break}case w.dataType.DATETIME:{var _=Qi.parseDateRange(h,e,f.timeZone),T=Ze(_,1),k=T[0];F=yield u.seekRow(v,m,h.ValueType.DATETIME,k,void 0,void 0,r??!1);break}case w.dataType.DECIMAL:case w.dataType.INT:{if(!w.isBigDecimalType(m.type)&&!w.isBigIntegerType(m.type)){var D=parseInt(e,10);e==="-Infinity"?D=Number.NEGATIVE_INFINITY:e==="Infinity"&&(D=Number.POSITIVE_INFINITY),F=yield u.seekRow(v,m,h.ValueType.NUMBER,D,void 0,void 0,r??!1)}else F=yield u.seekRow(v,m,h.ValueType.STRING,e,void 0,void 0,r??!1);break}default:F=yield u.seekRow(v,m,h.ValueType.STRING,n.tableUtils.makeValue(m.type,e,f.timeZone),void 0,void 0,r??!1)}(p=n.grid)===null||p===void 0||p.setFocusRow(F),n.setState({gotoValueError:""})}catch{n.setState({gotoValueError:"invalid input"})}}}})()}handleCancelDownloadTable(){var e;(e=this.tableSaver)===null||e===void 0||e.cancelDownload(),this.setState({isTableDownloading:!1})}handleDownloadCompleted(){this.setState({isTableDownloading:!1,tableDownloadProgress:100,tableDownloadStatus:He.DOWNLOAD_STATUS.FINISHED})}handleDownloadCanceled(){this.setState({isTableDownloading:!1,tableDownloadProgress:0,tableDownloadStatus:He.DOWNLOAD_STATUS.CANCELED})}deleteRanges(e){var t=this.props.model;if(!Co(t)||!t.isDeletable)throw new Error("Model does not support deleting ranges");this.pending.add(t.delete(e)).catch(n=>{Ae.isCanceled(n)||N.error("Unable to delete ranges",e,n)})}resetColumnSelection(){if(this.grid!=null){var e=this.props.isSelectingColumn;if(e){var t=this.props.columnAllowedCursor;this.grid.setState({cursor:t})}else this.grid.setState({cursor:null}),this.setState({hoverSelectColumn:null})}}resetGridViewState(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({left:0,top:0,topOffset:0,leftOffset:0},e))}sendStateChange(){if(this.grid){var e=this.state,t=this.grid.state,n=this.props.onStateChange;n(e,t)}}handleOverflowClose(){var e;this.setState({showOverflowModal:!1}),(e=this.grid)===null||e===void 0||e.focus()}handleOpenNoPastePermissionModal(e){this.setState({showNoPastePermissionModal:!0,noPastePermissionError:e})}handleCloseNoPastePermissionModal(){this.setState({showNoPastePermissionModal:!1})}getColumnBoundingRect(){var e,t=this.state,n=t.metrics,a=t.shownColumnTooltip;K(n),K(a);var r=(e=this.gridWrapper)===null||e===void 0?void 0:e.getBoundingClientRect(),o=20;K(r);var l=n.columnHeaderHeight,d=n.allColumnXs,u=n.allColumnWidths,h=n.width,m=n.columnHeaderMaxDepth,v=d.get(a),c=u.get(a);K(v),K(c);var b=r.left+Qt(v+c/2,o,h-o);return{top:r.top+(m-1)*l,left:r.left+Qt(v+c/2,o,h-o),bottom:r.top+m*l,right:r.left+Qt(v+c/2,o,h-o)+1,width:1,height:l,x:b,y:r.top,toJSON:()=>{throw new Error("not implemented")}}}handleGotoRowSelectedRowNumberSubmit(){var e=this.state.gotoRow;this.focusRowInGrid(e)}focusRowInGrid(e){var t=this.props.model,n=t.rowCount;if(this.setState({gotoRow:e}),e===""){this.setState({gotoRowError:"",gotoValueError:""});return}var a=parseInt(e,10);if(a>n||a<-n)this.setState({gotoRowError:"Invalid row index"});else if(a===0){var r;this.setState({gotoRowError:"",gotoValueError:""}),(r=this.grid)===null||r===void 0||r.setFocusRow(0)}else if(a<0){var o;this.setState({gotoRowError:"",gotoValueError:""}),(o=this.grid)===null||o===void 0||o.setFocusRow(a+n)}else{var l;(l=this.grid)===null||l===void 0||l.setFocusRow(a-1),this.setState({gotoRowError:"",gotoValueError:""})}}handleGotoRowSelectedRowNumberChanged(e){var t=e.target.value;this.focusRowInGrid(t)}getColumnTooltip(e,t,n){var a=t.columnHeaderHeight,r=t.columnHeaderMaxDepth,o=t.allColumnXs,l=t.allColumnWidths,d=t.width,u=o.get(e),h=l.get(e);if(u==null||h==null)return null;var m=Math.max(0,u),v=h;u+h>d?v=d-u:u<0&&(v=h-Math.abs(u));var c={position:"absolute",top:(r-1)*a,left:m,width:v,height:a,pointerEvents:"none"},b={clientWidth:1,clientHeight:a,getBoundingClientRect:this.getColumnBoundingRect},p={placement:"bottom",modifiers:{flip:{behavior:["bottom","top"]}}},f=this.getModelColumn(e);if(f==null)return null;var y=n.columns[f];return y==null?null:s.jsx("div",{style:c,children:s.jsx(Le,{timeout:400,interactive:!0,options:p,ref:this.handleTooltipRef,referenceObject:b,onExited:()=>{this.setState({shownColumnTooltip:null})},children:s.jsx(St,{model:n,column:y,onStatistics:()=>{var F;(F=this.tooltip)===null||F===void 0||F.update()}})},y.name)})}handleGotoValueSelectedColumnNameChanged(e){var t,n=this.props.model,a=(t=this.grid)===null||t===void 0?void 0:t.state.selection.cursorRow,r=this.state,o=r.gotoValueSelectedColumnName,l=r.gotoValueManuallyChanged;if(a!=null){var d=n.getColumnIndexByName(e),u=se.getColumnByName(n.columns,e),h=se.getColumnByName(n.columns,o);if(d==null||u==null)return;var m=n.valueForCell(d,a),v=se.convertValueToText(m,u.type);l&&u.type===(h==null?void 0:h.type)?this.setState({gotoValueSelectedColumnName:e,gotoValueError:""}):this.setState({gotoValueSelectedColumnName:e,gotoValue:v,gotoValueError:"",gotoValueManuallyChanged:!1})}this.setState({gotoValueSelectedColumnName:e,gotoValueError:""})}handleGotoValueSelectedFilterChanged(e){this.setState({gotoValueSelectedFilter:e,gotoValueError:""})}handleGotoValueSubmitted(e){var t=this.state.gotoValue;this.seekRow(t,e)}getFilterBarInput(e,t,n,a,r){var o;if(e==null||n==null)return null;var l=this.getMetricState();if(l==null)return null;var d=t.getFilterInputCoordinates(n,l,e);if(d==null)return null;var u=Math.min(Math.max(je.minDebounce,Math.round(e.rowCount/200)),je.maxDebounce),h=d.x,m=d.y,v=d.width,c=d.height,b=e.width,p={top:m,left:h,minWidth:Math.min(v,b-h),height:c},f="",y=!0,F=this.getModelColumn(n);K(F);var _=a.get(F),T=r.get(F);_!=null&&(f=_.text,y=_.filter!=null);var k=a.size!==0||r.size!==0,D=t.getAdvancedFilterButtonCoordinates(n,l,e)!=null;return s.jsx(Zi,{ref:this.filterInputRef,style:p,className:J({error:!y,active:f!==""||T!=null,"iris-grid-has-filter":k}),showAdvancedFilterButton:D,isAdvancedFilterSet:T!=null,onAdvancedFiltersTriggered:()=>{this.setState({shownAdvancedFilter:n})},onChange:this.handleFilterBarChange,onDone:this.handleFilterBarDone,onTab:this.handleFilterBarTab,onContextMenu:(o=this.grid)===null||o===void 0?void 0:o.handleContextMenu,debounceMs:u,value:f},n)}render(){var e,t,n=this,a,r,o=this.props,l=o.children,d=o.customFilters,u=o.getDownloadWorker,h=o.isSelectingColumn,m=o.isStuckToBottom,v=o.isStuckToRight,c=o.model,b=o.name,p=o.onlyFetchVisibleColumns,f=o.alwaysFetchColumns,y=o.advancedSettings,F=o.onAdvancedSettingsChange,_=o.canDownloadCsv,T=o.onCreateChart,k=o.transformTableOptions,D=this.context.cellInputRendererRegistry,C=this.state,x=C.metricCalculator,R=C.metrics,P=C.isFilterBarShown,z=C.isSelectingPartition,M=C.isMenuShown,V=C.isReady,U=C.copyOperation,q=C.focusedFilterBarColumn,$=C.loadingText,Z=C.loadingScrimProgress,G=C.loadingSpinnerShown,B=C.loadingCancelShown,ee=C.loadingBlocksGrid,te=C.shownColumnTooltip,ue=C.hoverAdvancedFilter,ge=C.shownAdvancedFilter,g=C.maximizedAdvancedFilter,E=C.hoverSelectColumn,j=C.quickFilters,H=C.advancedFilters,I=C.searchFilter,O=C.selectDistinctColumns,W=C.movedColumns,re=C.movedRows,Y=C.formatter,he=C.conditionalFormats,ye=C.conditionalFormatPreview,_e=C.conditionalFormatEditIndex,Ue=C.conditionalFormatError,tt=C.columnAlignmentMap,Pe=C.sorts,Me=C.reverse,yt=C.customColumns,ve=C.gridSelection,sa=C.isTableDownloading,En=C.tableDownloadStatus,la=C.tableDownloadProgress,Vt=C.tableDownloadEstimatedTime,Fn=C.showSearchBar,da=C.searchValue,ua=C.selectedSearchColumns,ha=C.invertSearchColumns,Ut=C.aggregationSettings,An=C.selectedAggregation,$e=C.rollupConfig,nt=C.openOptions,ca=C.pendingSavePromise,ma=C.pendingSaveError,ga=C.pendingRowCount,va=C.pendingDataErrors,xn=C.pendingDataMap,pa=C.toastMessage,fa=C.frozenColumns,Nn=C.columnHeaderGroups,Ca=C.showOverflowModal,Sa=C.showNoPastePermissionModal,ba=C.noPastePermissionError,ya=C.overflowText,On=C.overflowButtonTooltipProps,_n=C.expandCellTooltipProps,Rn=C.hoverTooltipProps,Dn=C.isGotoShown,Ta=C.gotoRow,wa=C.gotoRowError,Ea=C.gotoValueError,Fa=C.gotoValueSelectedColumnName,Aa=C.gotoValue,xa=C.gotoValueSelectedFilter,jn=C.partitionConfig;if(!V)return null;var Tt=this.getTheme(),In=Tt.columnHeaderHeight,Na=this.getCachedFilter(d,j,H,I),Pn=x.getUserColumnWidths(),Oa=this.getCachedStateOverride(c,Tt,E,P,h,Z,j,H,Pe,Me,$e,M),_a=R?R.top:0,Ra=R?R.bottomViewport:0,Mn=null,kn=null;p&&(Mn=R?R.left:0,kn=R?R.right:0);var Da=R!=null&&R.width>0&&R.height>0,Ln=((e=$e==null||(t=$e.columns)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>0,ja=P?this.getFilterBarInput(R,x,q,j,H):null,Vn=null;if($!=null){var Ia=s.jsxs("div",{className:"iris-grid-loading-status",children:[s.jsx("div",{className:J("iris-grid-loading-status-bar",{show:G}),children:$}),s.jsxs("button",{type:"button",onClick:this.handleCancel,className:J("iris-grid-btn-cancel",{show:B}),children:[s.jsx(ie,{icon:Ui,transform:"down-1"}),"Cancel"]})]}),Pa=R?R.gridY:0;Vn=s.jsx("div",{className:"iris-grid-loading",style:ee?{top:Pa}:{},children:Ia})}var Un=null;if(te!=null&&R){var $t;Un=this.getColumnTooltip(te,R,c),($t=this.tooltip)===null||$t===void 0||$t.update()}var $n=[];if(R&&P)for(var Gn=this.getMetricState(),Bn=R.visibleColumns,Ma=function(){var ae=Bn[Gt],Ge=n.getModelColumn(ae);if(Ge!=null){var Qe=c.isFilterable(Ge),it=Qe&&Gn?x.getAdvancedFilterButtonCoordinates(ae,Gn,R):null;if(it!=null){var Wt=it.x,zt=it.y,qe={position:"absolute",top:zt,left:Wt},at=H.get(Ge),wt=at!=null,Et=ae===ue||ae===q||wt,Kt=s.jsx("div",{className:J("advanced-filter-button-container",{hidden:!Et}),style:qe,children:Et&&s.jsx(Q,{kind:"ghost",className:J("btn-link-icon advanced-filter-button",{"filter-set":wt}),onClick:()=>{n.setState({shownAdvancedFilter:ae,maximizedAdvancedFilter:null})},onContextMenu:Ft=>{var Be;(Be=n.grid)===null||Be===void 0||Be.handleContextMenu(Ft)},onMouseEnter:()=>{n.setState({hoverAdvancedFilter:ae})},onMouseLeave:()=>{n.setState({hoverAdvancedFilter:null})},children:s.jsxs("div",{className:"fa-layers",children:[s.jsx(ie,{icon:Mi,className:"filter-solid"}),s.jsx(ie,{icon:cn,className:"filter-light"})]})})},ae);$n.push(Kt)}}},Gt=0;Gt<Bn.length;Gt+=1)Ma();var Hn=[];if(R)for(var Wn=R.gridX,zn=R.visibleColumns,ka=R.allColumnXs,La=R.allColumnWidths,Kn=R.columnHeaderHeight,Va=function(){var ae=zn[Bt],Ge=ka.get(ae),Qe=La.get(ae);if(Ge!=null&&Qe!=null&&Qe>0){var it=Wn+Ge,Wt=Wn+Ge+Qe-20,zt=P?{position:"absolute",top:Kn,left:Wt,width:20,height:Tt.filterBarHeight}:{position:"absolute",top:0,left:it,width:Qe,height:Kn},qe=n.getModelColumn(ae);if(qe!=null){var at=c.columns[qe];if(at==null)return N.warn("Column does not exist at index ".concat(qe," for column array of length ").concat(c.columns.length)),1;var wt=H.get(qe),Et=wt||{},Kt=Et.options,Ft=w.getSortForColumn(c.sort,at.name),Be=Ft?Ft.direction:null;if(!Xr(Be))throw new Error("Invalid sort direction: ".concat(Be));var Ga=s.jsx("div",{className:"advanced-filter-menu-container",style:zt,children:s.jsx(zi,{className:"advanced-filter-menu-popper",isMaximized:ge===ae&&g===ae,onEntered:n.getAdvancedMenuOpenedHandler(ae),onExited:()=>{n.handleAdvancedMenuClosed(ae)},isShown:ge===ae,interactive:!0,closeOnBlur:!0,options:{positionFixed:!0},children:n.getCachedAdvancedFilterMenuActions(c,at,Kt,Be,Y,ge===ae&&g===ae,n.getAdvancedMenuToggleMaximizeHandler(ae))})},ae);Hn.push(Ga)}}},Bt=0;Bt<zn.length;Bt+=1)Va();var Ua=this.getCachedOptionItems(T!==void 0&&c.isChartBuilderAvailable,c.isCustomColumnsAvailable,c.isFormatColumnsAvailable,c.isOrganizeColumnsAvailable,c.isRollupAvailable,c.isTotalsAvailable||Ln,c.isSelectDistinctAvailable,c.isExportAvailable,this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,P,Fn,_,this.isTableSearchAvailable(),Dn,y.size>0),Qn=this.getCachedTransformedOptionItems(Ua,k),Ht=this.getCachedHiddenColumns(x,Pn),$a=nt.map(pe=>{switch(pe.type){case X.CHART_BUILDER:return s.jsx(Eo,{model:c,onChange:this.handleChartChange,onSubmit:this.handleChartCreate},X.CHART_BUILDER);case X.VISIBILITY_ORDERING_BUILDER:return s.jsx(wo,{model:c,movedColumns:W,hiddenColumns:Ht,columnHeaderGroups:Nn,onColumnVisibilityChanged:this.handleColumnVisibilityChanged,onReset:this.handleColumnVisibilityReset,onMovedColumnsChanged:this.handleMovedColumnsChanged,onColumnHeaderGroupChanged:this.handleHeaderGroupsChanged,onFrozenColumnsChanged:this.handleFrozenColumnsChanged},X.VISIBILITY_ORDERING_BUILDER);case X.CONDITIONAL_FORMATTING:return s.jsx(Zs,{rules:he,onChange:this.handleConditionalFormatsChange,onCreate:this.handleConditionalFormatCreate,onSelect:this.handleConditionalFormatEdit});case X.CONDITIONAL_FORMATTING_EDIT:return K(c.columns),K(this.handleConditionalFormatEditorUpdate),s.jsx(Xl,{dh:c.dh,columns:c.columns,rule:ye,errorMessage:Ue??void 0,onUpdate:this.handleConditionalFormatEditorUpdate,onSave:this.handleConditionalFormatEditorSave,onCancel:this.handleConditionalFormatEditorCancel});case X.CUSTOM_COLUMN_BUILDER:return s.jsx(To,{model:c,customColumns:yt,onSave:this.handleUpdateCustomColumns,onCancel:this.handleMenuBack},X.CUSTOM_COLUMN_BUILDER);case X.ROLLUP_ROWS:return s.jsx(yo,{model:c,onChange:this.handleRollupChange,config:$e},X.ROLLUP_ROWS);case X.AGGREGATIONS:return s.jsx(bo,{settings:Ut,isRollup:Ln,availablePlacements:De(c)&&c.isEditable?["top"]:["top","bottom"],onChange:this.handleAggregationsChange,onEdit:this.handleAggregationEdit,dh:c.dh});case X.AGGREGATION_EDIT:return An&&s.jsx(So,{aggregation:An,columns:c.originalColumns,onChange:this.handleAggregationChange});case X.TABLE_EXPORTER:return s.jsx(He,{model:c,name:b,userColumnWidths:Pn,movedColumns:W,isDownloading:sa,tableDownloadStatus:En,tableDownloadProgress:la,tableDownloadEstimatedTime:Vt??void 0,onDownload:this.handleDownloadTable,onDownloadStart:this.handleDownloadTableStart,onCancel:this.handleCancelDownloadTable,selection:ve},X.TABLE_EXPORTER);case X.SELECT_DISTINCT:return s.jsx(ta,{model:c,selectDistinctColumns:O,onChange:this.handleSelectDistinctChanged});case X.ADVANCED_SETTINGS:return s.jsx(wn,{items:y,onChange:F});default:{var ae=pe.configPage;if(ae==null)throw Error("Unexpected option type ".concat(pe.type));return s.jsx($s,{itemType:String(pe.type),children:s.jsx(ae,{model:c,viewState:this.getCachedViewState(this.getCachedHiddenColumnNames(Ht,c.columns)),onBack:this.handleMenuBack})},String(pe.type))}}});return s.jsxs("div",{className:"iris-grid",role:"presentation",children:[s.jsxs("div",{className:"iris-grid-column",children:[l!=null&&s.jsx("div",{className:"iris-grid-bar",children:l}),s.jsx(un,{in:z,timeout:hn.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,nodeRef:this.slideTransitionRef,children:s.jsx("div",{ref:this.slideTransitionRef,className:"iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary",children:ct(c)&&c.isPartitionRequired&&s.jsx(Ps,{model:c,partitionConfig:jn,onChange:this.handlePartitionChange})})}),s.jsx(un,{in:Fn,timeout:hn.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,nodeRef:this.bottomTransitionRef,children:s.jsx("div",{ref:this.bottomTransitionRef,className:"iris-grid-bar",children:s.jsx(Nt,{value:da,selectedColumns:ua,invertSelection:ha,onChange:this.handleCrossColumnSearch,columns:c.columns,ref:this.crossColumnRef})})}),s.jsxs(ko,{ref:pe=>{this.grid=pe},isStickyBottom:!De(c)||!c.isEditable,createEmptySelection:this.getCachedCreateEmptySelection(At(c)),isStuckToBottom:m,isStuckToRight:v,metricCalculator:x,model:c,keyHandlers:this.getKeyHandlers(),mouseHandlers:this.getMouseHandlers(),movedColumns:W,movedRows:re,onError:this.handleGridError,onViewChanged:this.handleViewChanged,onSelectionChanged:this.handleSelectionChanged,onSelectionChange:this.handleGridSelectionChange,onMovedColumnsChanged:this.handleMovedColumnsChanged,renderer:this.renderer,cellInputRendererRegistry:D??Fo,stateOverride:Oa,theme:Tt,children:[s.jsx(nd,{isOpen:Ca,text:ya,onClose:this.handleOverflowClose}),Da&&s.jsx(Ji,{model:c,top:_a,bottom:Ra,left:Mn,right:kn,filter:Na,formatter:Y,columnAlignmentMap:tt,sorts:Pe,reverse:Me,movedColumns:W,customColumns:yt,hiddenColumns:Ht,alwaysFetchColumns:this.getAlwaysFetchColumns(f,c.columns,W,c.floatingLeftColumnCount,c.floatingRightColumnCount,c,(a=this.grid)===null||a===void 0||(a=a.state.draggingColumn)===null||a===void 0?void 0:a.range),formatColumns:this.getCachedPreviewFormatColumns(c.dh,c.columns,he,ye,((r=nt[nt.length-1])===null||r===void 0?void 0:r.type)===X.CONDITIONAL_FORMATTING_EDIT?_e??void 0:void 0),rollupConfig:this.getModelRollupConfig(c.originalColumns,$e,Ut),totalsConfig:this.getModelTotalsConfig(c.columns,$e,Ut),selectDistinctColumns:O,pendingRowCount:ga,pendingDataMap:xn,frozenColumns:fa,columnHeaderGroups:Nn,partitionConfig:jn,showExtraGroupColumn:this.showExtraGroupColumn}),!M&&s.jsx("div",{className:"grid-settings-button",style:{height:"".concat(In,"px"),width:"".concat(In,"px")},children:s.jsx(Q,{kind:"ghost","data-testid":"btn-iris-grid-settings-button-".concat(b),onClick:this.handleMenu,icon:s.jsx(ie,{icon:Tr,transform:"up-1"}),tooltip:"Table Options"})}),ja,Vn,$n,Un,Hn,On&&this.getOverflowButtonTooltip(On),_n&&this.getExpandCellTooltip(_n),Rn&&this.getHoverTooltip(Rn)]}),s.jsx(oa,{ref:this.gotoRowRef,model:c,isShown:Dn,gotoRow:Ta,gotoRowError:wa,gotoValueError:Ea,onGotoRowSubmit:this.handleGotoRowSelectedRowNumberSubmit,onGotoRowNumberChanged:this.handleGotoRowSelectedRowNumberChanged,onClose:this.handleGotoRowClosed,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:()=>{this.handleAnimationStart(),this.focus()},onExited:this.handleAnimationEnd,gotoValueSelectedColumnName:Fa,gotoValue:Aa,gotoValueFilter:xa,onGotoValueSelectedColumnNameChanged:this.handleGotoValueSelectedColumnNameChanged,onGotoValueSelectedFilterChanged:this.handleGotoValueSelectedFilterChanged,onGotoValueChanged:this.handleGotoValueChanged,onGotoValueSubmit:this.handleGotoValueSubmitted}),s.jsx(Zo,{error:ma,isSaving:ca!=null,saveTooltip:"Commit (".concat(this.commitAction.shortcut.getDisplayText(),")"),discardTooltip:"Discard (".concat(this.discardAction.shortcut.getDisplayText(),")"),pendingDataErrors:va,pendingDataMap:xn,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,onSave:this.handlePendingCommitClicked,onDiscard:this.handlePendingDiscardClicked}),s.jsx(Fs,{children:pa}),s.jsx(L,{model:c,copyOperation:U??void 0,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd}),s.jsx(Ao,{dh:c.dh,ref:pe=>{this.tableSaver=pe},getDownloadWorker:u,onDownloadCompleted:this.handleDownloadCompleted,onDownloadCanceled:this.handleDownloadCanceled,onDownloadProgressUpdate:this.handleDownloadProgressUpdate,isDownloading:En===He.DOWNLOAD_STATUS.DOWNLOADING,formatter:Y})]}),s.jsx(Po,{in:M,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"table-sidebar",children:s.jsx(jo,{children:[s.jsx(ri,{title:"Table Options",onClose:this.handleMenuClose,children:s.jsx(Xi,{onSelect:pe=>this.handleMenuSelect(Qn[pe]),items:Qn})},"table-options"),...$a.map((pe,ae)=>s.jsx(ri,{title:nt[ae].title,onBack:this.handleMenuBack,onClose:this.handleMenuClose,children:pe},nt[ae].type))]})})}),s.jsx(Yr,{actions:this.contextActions}),s.jsx(dd,{isOpen:Sa,onClose:this.handleCloseNoPastePermissionModal,errorMessage:ba})]})}}A(je,"contextType",xo);A(je,"minDebounce",150);A(je,"maxDebounce",500);A(je,"loadingSpinnerDelay",800);A(je,"defaultProps",{advancedFilters:Ee,advancedSettings:Ee,alwaysFetchColumns:le,conditionalFormats:le,customColumnFormatMap:Ee,columnAlignmentMap:Ee,isFilterBarShown:!1,applyInputFiltersOnInit:!1,movedColumns:le,movedRows:le,inputFilters:le,customFilters:le,onCreateChart:void 0,onColumnSelected:()=>{},onDataSelected:()=>{},onError:()=>{},onStateChange:()=>{},onAdvancedSettingsChange:()=>{},partitions:void 0,partitionConfig:void 0,quickFilters:Ee,isQuickFiltersControlled:!1,onQuickFiltersChange:void 0,selectDistinctColumns:le,sorts:le,isSortsControlled:!1,onSortsChange:void 0,reverse:!1,customColumns:le,aggregationSettings:fn,rollupConfig:void 0,userColumnWidths:Ee,userColumnWidthsByName:void 0,userRowHeights:Ee,onSelectionChanged:()=>{},onSelectionChange:()=>{},isSelectingColumn:!1,isSelectingPartition:!1,isStuckToBottom:!1,isStuckToRight:!1,columnAllowedCursor:"linker",columnNotAllowedCursor:"linker-not-allowed",copyCursor:"copy",name:"table",onlyFetchVisibleColumns:!0,showSearchBar:!1,searchValue:"",invertSearchColumns:!0,onContextMenu:()=>le,pendingDataMap:Ee,getDownloadWorker:Mo.getServiceWorker,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Qi.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,showExtraGroupColumn:!0,formatter:le},canCopy:!0,canDownloadCsv:!0,frozenColumns:void 0,density:void 0,canToggleSearch:!0,mouseHandlers:le,keyHandlers:le,getMetricCalculator:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new No(...t)}});export{je as default};
14
- //# sourceMappingURL=IrisGrid-BPHKbuAd.js.map
14
+ //# sourceMappingURL=IrisGrid-BrXTJDXQ.js.map