UNPKG

@blueprintjs/table

Version:

Scalable interactive table component

1 lines 252 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("@blueprintjs/icons"),require("classnames"),require("react")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","@blueprintjs/icons","classnames","react"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("@blueprintjs/icons"),require("classnames"),require("react")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Table=t(e.Blueprint.Core,e.Blueprint.Icons,e.classNames,e.React))}(self,(function(e,t,n,r){return function(){"use strict";var o={500:function(e){var t=function(e,t){return e+n(t)},n=function(e){return null===e||"boolean"==typeof e||void 0===e?"":"number"==typeof e?e.toString():"string"==typeof e?e:Array.isArray(e)?e.reduce(t,""):function(e){return Object.prototype.hasOwnProperty.call(e,"props")}(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?n(e.props.children):""};n.default=n,e.exports=n},840:function(t){t.exports=e},864:function(e){e.exports=t},138:function(e){e.exports=n},12:function(e){e.exports=r}},i={};function l(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};l.r(a),l.d(a,{Cell:function(){return sn},Clipboard:function(){return Jn},Column:function(){return Zn},ColumnHeaderCell:function(){return jo},ColumnHeaderCell2:function(){return jo},ColumnLoadingOption:function(){return Rt},CopyCellsMenuItem:function(){return Er},DragSelectable:function(){return so},Draggable:function(){return Cn},EditableCell:function(){return Dn},EditableCell2:function(){return qn},EditableName:function(){return Uo},FocusMode:function(){return ct},Grid:function(){return Mt},HorizontalCellDivider:function(){return Ro},JSONFormat:function(){return tn},JSONFormat2:function(){return tn},Orientation:function(){return Sr},Rect:function(){return Tt},RegionCardinality:function(){return st},Regions:function(){return St},RenderMode:function(){return $n},ResizeHandle:function(){return xr},RowHeaderCell:function(){return zo},RowHeaderCell2:function(){return zo},RowLoadingOption:function(){return wt},SelectionModes:function(){return Ot},Table:function(){return Na},Table2:function(){return pu},TableLoadingOption:function(){return Ct},TruncatedFormat:function(){return Kt},TruncatedFormat2:function(){return Kt},TruncatedPopoverMode:function(){return Vt},Utils:function(){return ht}});var u={};l.r(u),l.d(u,{areFocusedRegionsEqual:function(){return Jr},expandFocusedRegion:function(){return Zr},getFocusModeFromProps:function(){return zr},getFocusedCellFromCoordinates:function(){return Wr},getFocusedColumn:function(){return Yr},getFocusedOrLastSelectedIndex:function(){return Ur},getFocusedRegionFromProps:function(){return Nr},getInitialFocusedRegion:function(){return Gr},isFocusAtRegionBottom:function(){return Vr},isFocusAtRegionLeft:function(){return Kr},isFocusAtRegionRight:function(){return Qr},isFocusAtRegionTop:function(){return qr},toFocusedRegion:function(){return Xr},validateFocusedRegion:function(){return Br}});var c=l(138),s=l.n(c),d=l(12),f=l(840),p=f.Classes.getClassNamespace(),h=("".concat(p,"-table-body"),"".concat(p,"-table-body-cells")),v="".concat(p,"-table-body-scrolling-indicator-overlay"),g="".concat(p,"-table-body-is-scrolling-top"),y="".concat(p,"-table-body-is-scrolling-bottom"),m="".concat(p,"-table-body-is-scrolling-right"),b="".concat(p,"-table-body-is-scrolling-left"),R=("".concat(p,"-table-body-scroll-client"),"".concat(p,"-table-body-virtual-client")),w="".concat(p,"-table-bottom-container"),C="".concat(p,"-table-cell"),O="".concat(p,"-table-cell-client"),S="".concat(p,"-table-cell-ghost"),E="".concat(p,"-table-cell-interactive"),H="".concat(p,"-table-cell-ledger-even"),P="".concat(p,"-table-cell-ledger-odd"),k="".concat(p,"-table-column-header-tr"),T="".concat(p,"-table-column-headers"),I="".concat(p,"-table-column-header-cell"),j="".concat(p,"-table-column-name"),L="".concat(p,"-table-column-name-text"),x="".concat(p,"-table-container"),D="".concat(p,"-table-dragging"),M="".concat(p,"-table-editable-name"),_="".concat(p,"-table-editable-text"),F=("".concat(p,"-table-cell-text-placeholder"),"".concat(p,"-table-focus-region")),A="".concat(p,"-table-has-interaction-bar"),z="".concat(p,"-table-has-reorder-handle"),N="".concat(p,"-table-header"),W="".concat(p,"-table-header-active"),U="".concat(p,"-table-header-content"),G="".concat(p,"-table-header-reorderable"),B="".concat(p,"-table-header-selected"),q="".concat(p,"-table-horizontal-cell-divider"),V="".concat(p,"-table-horizontal-guide"),K="".concat(p,"-table-interaction-bar"),Q="".concat(p,"-table-last-in-column"),Y="".concat(p,"-table-last-in-row"),X="".concat(p,"-table-menu"),Z="".concat(p,"-table-no-horizontal-scroll"),$=("".concat(p,"-table-no-layout"),"".concat(p,"-table-no-rows")),J="".concat(p,"-table-no-vertical-scroll"),ee="".concat(p,"-table-no-wrap-text"),te="".concat(p,"-table-null"),ne="".concat(p,"-table-overlay"),re="".concat(p,"-table-overlay-layer"),oe="".concat(p,"-table-reordering-cursor-overlay"),ie="".concat(p,"-table-popover-whitespace-normal"),le="".concat(p,"-table-popover-whitespace-pre"),ae="".concat(p,"-table-quadrant"),ue="".concat(p,"-table-quadrant-body-container"),ce="".concat(p,"-table-quadrant-left"),se="".concat(p,"-table-quadrant-main"),de="".concat(p,"-table-quadrant-scroll-container"),fe="".concat(p,"-table-quadrant-stack"),pe="".concat(p,"-table-quadrant-top"),he="".concat(p,"-table-quadrant-top-left"),ve="".concat(p,"-table-region"),ge="".concat(p,"-table-reorder-handle"),ye="".concat(p,"-table-reorder-handle-target"),me="".concat(p,"-table-reordering"),be="".concat(p,"-table-resize-guides"),Re="".concat(p,"-table-resize-handle"),we="".concat(p,"-table-resize-handle-target"),Ce="".concat(p,"-table-resize-horizontal"),Oe="".concat(p,"-table-resize-sensor"),Se="".concat(p,"-table-resize-sensor-expand"),Ee="".concat(p,"-table-resize-sensor-shrink"),He="".concat(p,"-table-resize-vertical"),Pe=("".concat(p,"-table-rounded-layout"),"".concat(p,"-table-row-headers")),ke="".concat(p,"-table-row-headers-cells-container"),Te="".concat(p,"-table-row-name"),Ie="".concat(p,"-table-row-name-text"),je="".concat(p,"-table-selection-enabled"),Le="".concat(p,"-table-selection-region"),xe="".concat(p,"-table-th-menu"),De="".concat(p,"-table-th-menu-container"),Me="".concat(p,"-table-th-menu-container-background"),_e="".concat(p,"-table-th-menu-open"),Fe="".concat(p,"-table-th-menu-select-cells"),Ae="".concat(p,"-table-thead"),ze="".concat(p,"-table-top-container"),Ne="".concat(p,"-table-truncated-cell"),We="".concat(p,"-table-truncated-format"),Ue="".concat(p,"-table-truncated-format-text"),Ge="".concat(p,"-table-truncated-popover"),Be="".concat(p,"-table-truncated-popover-target"),qe="".concat(p,"-table-truncated-text"),Ve="".concat(p,"-table-truncated-value"),Ke="".concat(p,"-table-vertical-guide");function Qe(e,t){return"number"==typeof t?"".concat(e).concat(t):0===t.indexOf(e)?t:"".concat(e).concat(t)}function Ye(e){return Qe("".concat(p,"-table-col-"),e)}function Xe(e){return Qe("".concat(p,"-table-row-"),e)}function Ze(e){return Qe("".concat(p,"-table-cell-col-"),e)}function $e(e){return Qe("".concat(p,"-table-cell-row-"),e)}function Je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tt(e)}function nt(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?Je(e):t;var n}function rt(e,t){return rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},rt(e,t)}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=tt(e);if(t){var o=tt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nt(this,n)}}var it=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rt(e,t)}(i,e);var t,n,r,o=ot(i);function i(e){var t,n,r,l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),n=Je(t),l=void 0,(r="style")in n?Object.defineProperty(n,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[r]=l,t.style=t.calculateStyle(e.variableLength),t}return t=i,n=[{key:"componentDidUpdate",value:function(e){(!e.loading&&this.props.loading||e.variableLength!==this.props.variableLength)&&(this.style=this.calculateStyle(this.props.variableLength))}},{key:"render",value:function(){return this.props.loading?d.createElement("div",{className:f.Classes.SKELETON,style:this.style}):d.Children.only(this.props.children)}},{key:"calculateStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?75-5*Math.floor(11*Math.random()):100;return{width:"".concat(e,"%")}}}],n&&et(t.prototype,n),r&&et(t,r),i}(d.PureComponent),lt=l(864);function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ut(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var ct,st,dt="bp-table-text-no-measure",ft=f.IconSize.STANDARD,pt=["font-style","font-variant","font-weight","font-size","font-family"],ht={times:function(e,t){if(e<0)throw new Error("[Blueprint] times() cannot be called with negative numbers.");for(var n=Array(e),r=0;r<e;r++)n[r]=t(r);return n},accumulate:function(e){var t=[],n=0,r=!0,o=!1,i=void 0;try{for(var l,a=e[Symbol.iterator]();!(r=(l=a.next()).done);r=!0){n+=l.value,t.push(n)}}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return t},toBase26Alpha:function(e){for(var t="";;){var n=e%26;if(t=String.fromCharCode(65+n)+t,(e-=n)<=0)return t;e=e/26-1}},toBase26CellName:function(e,t){return"".concat(ht.toBase26Alpha(t)).concat(e+1)},binarySearch:function(e,t,n){for(var r=0;r<t;){var o=Math.floor((r+t)/2);n(o)<e?r=o+1:t=o}return t},assignSparseValues:function(e,t){if(null==t||e.length!==t.length)return e;e=e.slice();for(var n=0;n<e.length;n++){var r=t[n];null!=r&&(e[n]=r)}return e},measureElementTextContent:function(e){var t=document.createElement("canvas").getContext("2d"),n=getComputedStyle(e,null);return t.font=pt.map((function(e){return n.getPropertyValue(e)})).join(" "),function(e,t){var n,r=t.querySelectorAll(".".concat(dt)),o=0;r&&r.length&&r.forEach((function(t){var n,r=e.measureText(null!==(n=t.textContent)&&void 0!==n?n:"");o+=r.width-ft}));var i=e.measureText(null!==(n=t.textContent)&&void 0!==n?n:"");return ut(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){at(e,t,n[t])}))}return e}({},i),{width:i.width-o})}(t,e)},clamp:function(e,t,n){return null!=t&&e<t&&(e=t),null!=n&&e>n&&(e=n),e},guideIndexToReorderedIndex:function(e,t,n){return t<e?t:e<=t&&t<e+n?e:Math.max(0,t-n)},reorderedIndexToGuideIndex:function(e,t,n){return t<=e?t:t+n},reorderArray:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(0===r||r===e.length||t===n)return e.slice();if(!(r<0||r>e.length||t+r>e.length)){for(var o=e.slice(0,t),i=e.slice(t,t+r),l=e.slice(t+r),a=[],u=0,c=0,s=0,d=0;u<n;)c<o.length?(a.push(o[c]),c+=1):(a.push(l[d]),d+=1),u+=1;for(;s<r;)a.push(i[s]),s+=1,u+=1;for(;u<e.length;)c<o.length?(a.push(o[c]),c+=1):(a.push(l[d]),d+=1),u+=1;return a}},isLeftClick:function(e){return 0===e.button},getApproxCellHeight:function(e,t,n,r,o,i){var l=null==e?0:e.length,a=(t-o)/n;return(Math.ceil(l/a)+i)*r},compareSparseArrays:function(e,t){return void 0!==e&&void 0!==t&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))}};function vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,o=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e){e.CELL="cell",e.ROW="row"}(ct||(ct={})),function(e){e.CELLS="cells",e.FULL_ROWS="full-rows",e.FULL_COLUMNS="full-columns",e.FULL_TABLE="full-table"}(st||(st={}));var Rt,wt,Ct,Ot={ALL:["full-table","full-columns","full-rows","cells"],COLUMNS_AND_CELLS:["full-columns","cells"],COLUMNS_ONLY:["full-columns"],NONE:[],ROWS_AND_CELLS:["full-rows","cells"],ROWS_ONLY:["full-rows"]};!function(e){e.CELLS="cells",e.HEADER="column-header"}(Rt||(Rt={})),function(e){e.CELLS="cells",e.HEADER="row-header"}(wt||(wt={})),function(e){e.CELLS="cells",e.COLUMN_HEADERS="column-header",e.ROW_HEADERS="row-header"}(Ct||(Ct={}));var St=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"getRegionCardinality",value:function(e){return null!=e.cols&&null!=e.rows?"cells":null!=e.cols?"full-columns":null!=e.rows?"full-rows":"full-table"}},{key:"getFocusCellCoordinatesFromRegion",value:function(t){switch(e.getRegionCardinality(t)){case"full-table":return{col:0,row:0};case"full-columns":return{col:t.cols[0],row:0};case"full-rows":return{col:0,row:t.rows[0]};case"cells":return{col:t.cols[0],row:t.rows[0]}}}},{key:"copy",value:function(t){var n=e.getRegionCardinality(t);return"cells"===n?e.cell(t.rows[0],t.cols[0],t.rows[1],t.cols[1]):"full-columns"===n?e.column(t.cols[0],t.cols[1]):"full-rows"===n?e.row(t.rows[0],t.rows[1]):e.table()}},{key:"cell",value:function(e,t,n,r){return{cols:this.normalizeInterval(t,r),rows:this.normalizeInterval(e,n)}}},{key:"row",value:function(e,t){return{rows:this.normalizeInterval(e,t)}}},{key:"column",value:function(e,t){return{cols:this.normalizeInterval(e,t)}}},{key:"table",value:function(){return{}}},{key:"add",value:function(e,t){var n=e.slice();return n.push(t),n}},{key:"update",value:function(e,t,n){var r=e.slice();return null!=n?r.splice(n,1,t):(r.pop(),r.push(t)),r}},{key:"clampRegion",value:function(t,n,r){var o=e.copy(t);return null!=t.rows&&(o.rows[0]=ht.clamp(t.rows[0],0,n),o.rows[1]=ht.clamp(t.rows[1],0,n)),null!=t.cols&&(o.cols[0]=ht.clamp(t.cols[0],0,r),o.cols[1]=ht.clamp(t.cols[1],0,r)),o}},{key:"lastRegionIsEqual",value:function(t,n){if(null==t||0===t.length)return!1;var r=t[t.length-1];return e.regionsEqual(r,n)}},{key:"findMatchingRegion",value:function(t,n){if(null==t)return-1;for(var r=0;r<t.length;r++)if(e.regionsEqual(t[r],n))return r;return-1}},{key:"findContainingRegion",value:function(t,n){if(null==t)return-1;for(var r=0;r<t.length;r++)if(e.regionContains(t[r],n))return r;return-1}},{key:"hasFullColumn",value:function(t,n){if(null==t)return!1;var r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done);r=!0){var u=l.value,c=e.getRegionCardinality(u);if("full-table"===c)return!0;if("full-columns"===c&&e.intervalContainsIndex(u.cols,n))return!0}}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return!1}},{key:"hasFullRow",value:function(t,n){if(null==t)return!1;var r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done);r=!0){var u=l.value,c=e.getRegionCardinality(u);if("full-table"===c)return!0;if("full-rows"===c&&e.intervalContainsIndex(u.rows,n))return!0}}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return!1}},{key:"hasFullTable",value:function(t){if(null==t)return!1;var n=!0,r=!1,o=void 0;try{for(var i,l=t[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var a=i.value;if("full-table"===e.getRegionCardinality(a))return!0}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}return!1}},{key:"containsRegion",value:function(t,n){return e.overlapsRegion(t,n,!1)}},{key:"overlapsRegion",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.intervalOverlaps:e.intervalContains;if(null==t||null==n)return!1;var o=!0,i=!1,l=void 0;try{for(var a,u=t[Symbol.iterator]();!(o=(a=u.next()).done);o=!0){var c=a.value;switch(e.getRegionCardinality(c)){case"full-table":return!0;case"full-columns":if(r(c.cols,n.cols))return!0;continue;case"full-rows":if(r(c.rows,n.rows))return!0;continue;case"cells":if(r(c.cols,n.cols)&&r(c.rows,n.rows))return!0;continue}}}catch(e){i=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw l}}return!1}},{key:"eachUniqueFullColumn",value:function(t,n){if(null!=t&&0!==t.length&&null!=n){var r={};t.forEach((function(t){if("full-columns"===e.getRegionCardinality(t))for(var o=bt(t.cols,2),i=o[0],l=o[1],a=i;a<=l;a++)r[a]||(r[a]=!0,n(a))}))}}},{key:"eachUniqueFullRow",value:function(t,n){if(null!=t&&0!==t.length&&null!=n){var r={};t.forEach((function(t){if("full-rows"===e.getRegionCardinality(t))for(var o=bt(t.rows,2),i=o[0],l=o[1],a=i;a<=l;a++)r[a]||(r[a]=!0,n(a))}))}}},{key:"enumerateUniqueCells",value:function(t,n,r){if(null==t||0===t.length)return[];var o={},i=[],l=!0,a=!1,u=void 0;try{for(var c,s=t[Symbol.iterator]();!(l=(c=s.next()).done);l=!0){var d=c.value;e.eachCellInRegion(d,n,r,(function(e,t){var n="".concat(e,"-").concat(t);!0!==o[n]&&(o[n]=!0,i.push([e,t]))}))}}catch(e){a=!0,u=e}finally{try{l||null==s.return||s.return()}finally{if(a)throw u}}return i.sort(e.rowFirstComparator),i}},{key:"getCellRegionFromRegion",value:function(t,n,r){switch(e.getRegionCardinality(t)){case"full-table":return e.cell(0,0,n-1,r-1);case"full-columns":return e.cell(0,t.cols[0],n-1,t.cols[1]);case"full-rows":return e.cell(t.rows[0],0,t.rows[1],r-1);case"cells":return e.cell(t.rows[0],t.cols[0],t.rows[1],t.cols[1])}}},{key:"getRegionFromFocusedRegion",value:function(t){switch(t.type){case ct.CELL:return e.cell(t.row,t.col);case ct.ROW:return e.row(t.row)}}},{key:"sparseMapCells",value:function(t,n){var r=e.getBoundingRegion(t);if(void 0!==r){var o=r.rows[1]+1-r.rows[0],i=r.cols[1]+1-r.cols[0],l=ht.times(o,(function(){return new Array(i)}));return t.forEach((function(e){var t=bt(e,2),o=t[0],i=t[1];l[o-r.rows[0]][i-r.cols[0]]=n(o,i)})),l}}},{key:"getBoundingRegion",value:function(e){var t,n,r,o,i=!0,l=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var s=bt(u.value,2),d=s[0],f=s[1];t=void 0===t||d<t?d:t,n=void 0===n||d>n?d:n,r=void 0===r||f<r?f:r,o=void 0===o||f>o?f:o}}catch(e){l=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(l)throw a}}if(void 0!==t&&void 0!==n&&void 0!==r&&void 0!==o)return{cols:[r,o],rows:[t,n]}}},{key:"isValid",value:function(e){return!(null==e||null!=e.rows&&(e.rows[0]<0||e.rows[1]<0)||null!=e.cols&&(e.cols[0]<0||e.cols[1]<0))}},{key:"isRegionValidForTable",value:function(e,t,n){return!(0===t||0===n||null!=e.rows&&!Et(e.rows,0,t-1)||null!=e.cols&&!Et(e.cols,0,n-1))}},{key:"joinStyledRegionGroups",value:function(t,n,r){var o=null==r?void 0:"type"in r?r:mt(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yt(e,t,n[t])}))}return e}({},r),{type:ct.CELL}),i=[];return null!=n&&(i=i.concat(n)),null!=t&&t.length>0&&i.push({className:Le,regions:t}),void 0!==o&&i.push({className:F,regions:[e.getRegionFromFocusedRegion(o)]}),i}},{key:"regionsEqual",value:function(t,n){return e.intervalsEqual(t.rows,n.rows)&&e.intervalsEqual(t.cols,n.cols)}},{key:"expandRegion",value:function(t,n){var r=e.getRegionCardinality(t),o=e.getRegionCardinality(n);if(o!==r)return n;switch(o){case"full-rows":var i=Math.min(t.rows[0],n.rows[0]),l=Math.max(t.rows[1],n.rows[1]);return e.row(i,l);case"full-columns":var a=Math.min(t.cols[0],n.cols[0]),u=Math.max(t.cols[1],n.cols[1]);return e.column(a,u);case"cells":var c=Math.min(t.rows[0],n.rows[0]),s=Math.min(t.cols[0],n.cols[0]),d=Math.max(t.rows[1],n.rows[1]),f=Math.max(t.cols[1],n.cols[1]);return e.cell(c,s,d,f);default:return e.table()}}},{key:"eachCellInRegion",value:function(t,n,r,o){switch(e.getRegionCardinality(t)){case"full-table":for(var i=0;i<n;i++)for(var l=0;l<r;l++)o(i,l);break;case"full-columns":for(var a=0;a<n;a++)for(var u=t.cols[0];u<=t.cols[1];u++)o(a,u);break;case"full-rows":for(var c=t.rows[0];c<=t.rows[1];c++)for(var s=0;s<r;s++)o(c,s);break;case"cells":for(var d=t.rows[0];d<=t.rows[1];d++)for(var f=t.cols[0];f<=t.cols[1];f++)o(d,f)}}},{key:"regionContains",value:function(t,n){return e.overlapsRegion([t],n,!1)}},{key:"intervalsEqual",value:function(e,t){return null==e?null==t:null!=t&&e[0]===t[0]&&e[1]===t[1]}},{key:"intervalContainsIndex",value:function(e,t){return null!=e&&e[0]<=t&&e[1]>=t}},{key:"intervalContains",value:function(e,t){return null!=e&&null!=t&&e[0]<=t[0]&&t[1]<=e[1]}},{key:"intervalOverlaps",value:function(e,t){return null!=e&&null!=t&&!(e[1]<t[0]||e[0]>t[1])}},{key:"rowFirstComparator",value:function(e,t){var n=e[0]-t[0];return 0===n?e[1]-t[1]:n}},{key:"numericalComparator",value:function(e,t){return e-t}},{key:"normalizeInterval",value:function(t,n){null==n&&(n=t);var r=[t,n];return r.sort(e.numericalComparator),r}}],(n=null)&&gt(t.prototype,n),r&&gt(t,r),e}();function Et(e,t,n){return Ht(e[0],t,n)&&Ht(e[1],t,n)}function Ht(e,t,n){return e>=t&&e<=n}function Pt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tt=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),kt(this,"left",void 0),kt(this,"top",void 0),kt(this,"width",void 0),kt(this,"height",void 0),this.left=t,this.top=n,this.width=r,this.height=o}var t,n,r;return t=e,r=[{key:"union",value:function(t,n){var r=e.wrap(t),o=e.wrap(n),i=Math.min(r.top,o.top),l=Math.min(r.left,o.left),a=Math.max(r.top+r.height,o.top+o.height);return new e(l,i,Math.max(r.left+r.width,o.left+o.width)-l,a-i)}},{key:"subtractOrigin",value:function(t,n){var r=e.wrap(t),o=e.wrap(n);return new e(r.left-o.left,r.top-o.top,r.width,r.height)}},{key:"style",value:function(e){return{height:"".concat(e.height,"px"),left:"".concat(e.left,"px"),position:"absolute",top:"".concat(e.top,"px"),width:"".concat(e.width,"px")}}},{key:"wrap",value:function(t){return n=t,(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r)?t:new e(t.left,t.top,t.width,t.height);var n,r}}],(n=[{key:"subtractOrigin",value:function(t){return e.subtractOrigin(this,t)}},{key:"union",value:function(t){return e.union(this,t)}},{key:"style",value:function(){return e.style(this)}},{key:"sizeStyle",value:function(){return{height:"".concat(this.height,"px"),width:"".concat(this.width,"px")}}},{key:"containsX",value:function(e){return e>=this.left&&e<=this.left+this.width}},{key:"containsY",value:function(e){return e>=this.top&&e<=this.top+this.height}},{key:"equals",value:function(e){return null!=e&&this.left===e.left&&this.top===e.top&&this.width===e.width&&this.height===e.height}}])&&Pt(t.prototype,n),r&&Pt(t,r),e}();function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,o=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return It(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}kt(Tt,"ORIGIN",new Tt(0,0,0,0));var Mt=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.DEFAULT_BLEED,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_GHOST_HEIGHT,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.DEFAULT_GHOST_WIDTH;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt(this,"numCols",void 0),Lt(this,"numRows",void 0),Lt(this,"bleed",void 0),Lt(this,"columnWidths",void 0),Lt(this,"rowHeights",void 0),Lt(this,"cumulativeColumnWidths",void 0),Lt(this,"cumulativeRowHeights",void 0),Lt(this,"ghostHeight",void 0),Lt(this,"ghostWidth",void 0),Lt(this,"getCumulativeWidthBefore",(function(e){return 0===e?0:r.getCumulativeWidthAt(e-1)})),Lt(this,"getCumulativeWidthAt",(function(e){return 0===r.numCols?r.ghostWidth*e:e>=r.numCols?r.cumulativeColumnWidths[r.numCols-1]+r.ghostWidth*(e-r.numCols+1):r.cumulativeColumnWidths[e]})),Lt(this,"getCumulativeHeightBefore",(function(e){return 0===e?0:r.getCumulativeHeightAt(e-1)})),Lt(this,"getCumulativeHeightAt",(function(e){return 0===r.numRows?r.ghostHeight*e:e>=r.numRows?r.cumulativeRowHeights[r.numRows-1]+r.ghostHeight*(e-r.numRows+1):r.cumulativeRowHeights[e]})),this.columnWidths=n,this.rowHeights=t,this.cumulativeColumnWidths=ht.accumulate(n),this.cumulativeRowHeights=ht.accumulate(t),this.numCols=n.length,this.numRows=t.length,this.bleed=o,this.ghostHeight=i,this.ghostWidth=l}var t,n,r;return t=e,n=[{key:"getCellRect",value:function(e,t){var n=this.rowHeights[e],r=this.cumulativeRowHeights[e]-n,o=this.columnWidths[t],i=this.cumulativeColumnWidths[t]-o;return new Tt(i,r,o,n)}},{key:"getGhostCellRect",value:function(e,t){var n=0,r=0,o=0,i=0;return e>=this.rowHeights.length?(i=this.ghostHeight,r=this.getHeight()+this.ghostHeight*(e-this.numRows)):(i=this.rowHeights[e],r=this.cumulativeRowHeights[e]-i),t>=this.columnWidths.length?(o=this.ghostWidth,n=this.getWidth()+this.ghostWidth*(t-this.numCols)):(o=this.columnWidths[t],n=this.cumulativeColumnWidths[t]-o),new Tt(n,r,o,i)}},{key:"getRowRect",value:function(e){var t=this.rowHeights[e],n=this.cumulativeRowHeights[e]-t;return new Tt(0,n,this.getWidth(),t)}},{key:"getColumnRect",value:function(e){var t=this.columnWidths[e],n=this.cumulativeColumnWidths[e]-t;return new Tt(n,0,t,this.getHeight())}},{key:"getWidth",value:function(){return 0===this.numCols?0:this.cumulativeColumnWidths[this.numCols-1]}},{key:"getHeight",value:function(){return 0===this.numRows?0:this.cumulativeRowHeights[this.numRows-1]}},{key:"getRect",value:function(){return new Tt(0,0,this.getWidth(),this.getHeight())}},{key:"mapCellsInRect",value:function(e,t){var n=[];if(null==e)return n;for(var r=this.getRowIndicesInRect({rect:e}),o=r.rowIndexStart,i=r.rowIndexEnd,l=this.getColumnIndicesInRect(e),a=l.columnIndexStart,u=l.columnIndexEnd,c=o;c<=i;c++)for(var s=a;s<=u;s++)n.push(t(c,s));return n}},{key:"mapRowsInRect",value:function(e,t){var n=[];if(null==e)return n;for(var r=this.getRowIndicesInRect({rect:e}),o=r.rowIndexStart,i=r.rowIndexEnd,l=o;l<=i;l++)n.push(t(l));return n}},{key:"mapColumnsInRect",value:function(e,t){var n=[];if(null==e)return n;for(var r=this.getColumnIndicesInRect(e),o=r.columnIndexStart,i=r.columnIndexEnd,l=o;l<=i;l++)n.push(t(l));return n}},{key:"getRowIndicesInRect",value:function(t){var n=t.rect,r=t.includeGhostCells,o=void 0!==r&&r,i=t.columnHeaderHeight,l=void 0===i?0:i,a=t.limit,u=void 0===a?e.DEFAULT_MAX_ROWS:a;if(null==n)return{rowIndexEnd:0,rowIndexStart:0};var c=o?Math.max(this.numRows,e.DEFAULT_MAX_ROWS):this.numRows,s=n.top,d=void 0===s?0:s,f=n.height,p=this.getIndicesInInterval(d,d+(f-l),c,!o,this.getCumulativeHeightAt),h=p.start,v=p.end;return{rowIndexEnd:u>0&&v-h>u?h+u:v,rowIndexStart:h}}},{key:"getColumnIndicesInRect",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.DEFAULT_MAX_COLUMNS;if(null==t)return{columnIndexEnd:0,columnIndexStart:0};var o=n?Math.max(this.numCols,e.DEFAULT_MAX_COLUMNS):this.numCols,i=t.left,l=void 0===i?0:i,a=t.width,u=this.getIndicesInInterval(l,l+a,o,!n,this.getCumulativeWidthAt),c=u.start,s=u.end;return{columnIndexEnd:r>0&&s-c>r?c+r:s,columnIndexStart:c}}},{key:"isGhostIndex",value:function(e,t){return e>=this.numRows||t>=this.numCols}},{key:"isGhostColumn",value:function(e){return e>=this.numCols}},{key:"getExtremaClasses",value:function(e,t,n,r){return e===n&&t===r?[Q,Y]:e===n?[Q]:t===r?[Y]:[]}},{key:"getRegionStyle",value:function(e){switch(St.getRegionCardinality(e)){case st.CELLS:var t=Dt(e.rows,2),n=t[0],r=t[1],o=Dt(e.cols,2),i=o[0],l=o[1];if(this.isGhostIndex(n,i)||this.isGhostIndex(r,l))return{display:"none"};var a=this.getCellRect(n,i),u=this.getCellRect(r,l),c=0===i?0:1,s=0===n?0:1,d=a.union(u);return d.height+=s,d.left-=c,d.width+=c,d.top-=s,xt(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Lt(e,t,n[t])}))}return e}({},d.style()),{display:"block"});case st.FULL_COLUMNS:var f=Dt(e.cols,2),p=f[0],h=f[1];if(this.isGhostIndex(0,p)||this.isGhostIndex(0,h))return{display:"none"};var v=this.getCellRect(0,p),g=this.getCellRect(0,h),y=v.union(g),m=0===p?0:1;return{bottom:0,display:"block",left:y.left-m,top:0,width:y.width+m};case st.FULL_ROWS:var b=Dt(e.rows,2),R=b[0],w=b[1];if(this.isGhostIndex(R,0)||this.isGhostIndex(w,0))return{display:"none"};var C=this.getCellRect(R,0),O=this.getCellRect(w,0),S=C.union(O),E=0===R?0:1;return{display:"block",height:S.height+E,left:0,right:0,top:S.top-E};case st.FULL_TABLE:return{bottom:0,display:"block",left:0,right:0,top:0};default:return{display:"none"}}}},{key:"getIndicesInInterval",value:function(e,t,n,r,o){var i=ht.binarySearch(e,n-1,o),l=ht.binarySearch(t,n-1,o);return i>=0&&e===o(i)&&(i+=1),i=Math.max(0,i-this.bleed),{end:l=r?Math.min(n-1,l+this.bleed):Math.min(n-1,l),start:i}}}],n&&jt(t.prototype,n),r&&jt(t,r),e}();function _t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Lt(Mt,"DEFAULT_BLEED",3),Lt(Mt,"DEFAULT_MAX_COLUMNS",50),Lt(Mt,"DEFAULT_MAX_ROWS",200),Lt(Mt,"DEFAULT_GHOST_HEIGHT",20),Lt(Mt,"DEFAULT_GHOST_WIDTH",150),Lt(Mt,"MIN_COLUMN_HEADER_HEIGHT",30),Lt(Mt,"MIN_ROW_HEADER_WIDTH",30);var At=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ft(this,"tableElement",void 0),Ft(this,"scrollContainerElement",void 0),Ft(this,"cellContainerElement",void 0),Ft(this,"grid",void 0),Ft(this,"numFrozenRows",void 0),Ft(this,"numFrozenColumns",void 0),Ft(this,"convertCellIndexToClientX",void 0),Ft(this,"convertCellMidpointToClientX",void 0),Ft(this,"convertCellIndexToClientY",void 0),Ft(this,"convertCellMidpointToClientY",void 0),Ft(this,"toGridX",void 0),Ft(this,"toGridY",void 0),this.tableElement=t,this.scrollContainerElement=n,this.cellContainerElement=r,this.convertCellIndexToClientX=function(e){return o.grid.getCumulativeWidthAt(e)},this.convertCellMidpointToClientX=function(e){return(o.grid.getCumulativeWidthBefore(e)+o.grid.getCumulativeWidthAt(e))/2},this.convertCellIndexToClientY=function(e){return o.grid.getCumulativeHeightAt(e)},this.convertCellMidpointToClientY=function(e){return(o.grid.getCumulativeHeightBefore(e)+o.grid.getCumulativeHeightAt(e))/2},this.toGridX=function(e){var t=o.cellContainerElement.getBoundingClientRect().left,n=o.scrollContainerElement.scrollLeft,r=e-(t+n);return null!=o.numFrozenColumns&&o.numFrozenColumns>0&&r<=o.grid.getCumulativeWidthBefore(o.numFrozenColumns)?r:r+n},this.toGridY=function(e){var t=o.cellContainerElement.getBoundingClientRect().top,n=o.scrollContainerElement.scrollTop,r=e-(t+n);return null!=o.numFrozenRows&&o.numFrozenRows>0&&r<=o.grid.getCumulativeHeightBefore(o.numFrozenRows)?r:r+n},this.numFrozenRows=0,this.numFrozenColumns=0}var t,n,r;return t=e,n=[{key:"setGrid",value:function(e){return this.grid=e,this}},{key:"setNumFrozenRows",value:function(e){return this.numFrozenRows=e,this}},{key:"setNumFrozenColumns",value:function(e){return this.numFrozenColumns=e,this}},{key:"getViewportRect",value:function(){return new Tt(this.scrollContainerElement.scrollLeft||0,this.scrollContainerElement.scrollTop||0,this.scrollContainerElement.clientWidth,this.scrollContainerElement.clientHeight)}},{key:"getWidestVisibleCellInColumn",value:function(t){for(var n=this.getColumnCellSelector(t),r=this.tableElement.querySelectorAll(n),o=0,i=0;i<r.length;i++){var l=ht.measureElementTextContent(r.item(i)).width,a=Math.ceil(l)+2*e.CELL_HORIZONTAL_PADDING;a>o&&(o=a)}return o}},{key:"getTallestVisibleCellInColumn",value:function(e){for(var t=this.getColumnCellSelector(e),n=this.tableElement.querySelectorAll("".concat(t,".").concat(C)),r=0,o=0;o<n.length;o++){var i=n.item(o),l=i.querySelector(".".concat(Ve)),a=i.querySelector(".".concat(Ue)),u=i.querySelector(".".concat(qe)),c=0;(c=null!=l?l.scrollHeight:null!=a?a.scrollHeight:null!=u?u.scrollHeight:i.scrollHeight)>r&&(r=c)}return r}},{key:"hasVerticalOverflowOrExactFit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.MIN_COLUMN_HEADER_HEIGHT,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getViewportRect();return void 0!==this.grid&&this.grid.getHeight()>=t.height-e}},{key:"hasHorizontalOverflowOrExactFit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.MIN_ROW_HEADER_WIDTH,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getViewportRect();return void 0!==this.grid&&this.grid.getWidth()>=t.width-e}},{key:"convertPointToColumn",value:function(e,t){var n=this.getTableRect();if(void 0===this.grid||!n.containsX(e))return-1;var r=this.toGridX(e),o=t?this.grid.numCols:this.grid.numCols-1,i=t?this.convertCellMidpointToClientX:this.convertCellIndexToClientX;return ht.binarySearch(r,o,i)}},{key:"convertPointToRow",value:function(e,t){var n=this.getTableRect();if(void 0===this.grid||!n.containsY(e))return-1;var r=this.toGridY(e),o=t?this.grid.numRows:this.grid.numRows-1,i=t?this.convertCellMidpointToClientY:this.convertCellIndexToClientY;return ht.binarySearch(r,o,i)}},{key:"convertPointToCell",value:function(e,t){var n=this.toGridX(e),r=this.toGridY(t);return{col:ht.binarySearch(n,this.grid.numCols-1,this.convertCellIndexToClientX),row:ht.binarySearch(r,this.grid.numRows-1,this.convertCellIndexToClientY)}}},{key:"getColumnCellSelector",value:function(e){var t=e<this.numFrozenColumns?ce:se,n=Ze(e);return".".concat(t," .").concat(n)}},{key:"getTableRect",value:function(){return Tt.wrap(this.tableElement.getBoundingClientRect())}}],n&&_t(t.prototype,n),r&&_t(t,r),e}();function zt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e){return Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ut(e)}function Gt(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?zt(e):t;var n}function Bt(e,t){return Bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bt(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ut(e);if(t){var o=Ut(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Gt(this,n)}}Ft(At,"CELL_HORIZONTAL_PADDING",10);var Vt;!function(e){e.ALWAYS="always",e.NEVER="never",e.WHEN_TRUNCATED="when-truncated",e.WHEN_TRUNCATED_APPROX="when-truncated-approx"}(Vt||(Vt={}));var Kt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bt(e,t)}(i,e);var t,n,r,o=qt(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Wt(zt(e=o.apply(this,arguments)),"state",{isPopoverOpen:!1,isTruncated:!1}),Wt(zt(e),"contentDiv",void 0),Wt(zt(e),"handleContentDivRef",(function(t){return e.contentDiv=t})),Wt(zt(e),"handlePopoverOpen",(function(){e.setState({isPopoverOpen:!0})})),Wt(zt(e),"handlePopoverClose",(function(){e.setState({isPopoverOpen:!1})})),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.setTruncationState()}},{key:"componentDidUpdate",value:function(){this.setTruncationState()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.detectTruncation,r=e.truncateLength,o=e.truncationSuffix,i=""+t,l=i;if(!n&&r>0&&l.length>r&&(l=l.substring(0,r)+o),this.shouldShowPopover(i)){var a=s()(this.props.className,We);return d.createElement("div",{className:a},d.createElement("div",{className:Ve,ref:this.handleContentDivRef},l),this.renderPopover())}var u=s()(this.props.className,Ue);return d.createElement("div",{className:u,ref:this.handleContentDivRef},l)}},{key:"renderPopover",value:function(){var e=this.props,t=e.children,n=e.preformatted;if(this.state.isPopoverOpen){var r=s()(Ge,n?le:ie),o=d.createElement("div",{className:r},t);return d.createElement(f.Popover,{className:Be,content:o,isOpen:!0,onClose:this.handlePopoverClose,placement:"bottom",rootBoundary:"document"},d.createElement(lt.More,null))}return d.createElement("span",{className:Be,onClick:this.handlePopoverOpen},d.createElement(lt.More,null))}},{key:"shouldShowPopover",value:function(e){var t=this.props,n=t.detectTruncation,r=t.measureByApproxOptions,o=t.showPopover,i=t.truncateLength;switch(o){case"always":return!0;case"never":default:return!1;case"when-truncated":return n?this.state.isTruncated:i>0&&e.length>i;case"when-truncated-approx":if(!n)return i>0&&e.length>i;if(null==this.props.parentCellHeight||null==this.props.parentCellWidth)return!1;var l=r.approximateCharWidth,a=r.approximateLineHeight,u=r.cellHorizontalPadding,c=r.numBufferLines,s=this.props.parentCellWidth;return ht.getApproxCellHeight(e,s,l,a,u,c)>this.props.parentCellHeight}}},{key:"setTruncationState",value:function(){if(this.props.detectTruncation&&"when-truncated"===this.props.showPopover)if(null!=this.contentDiv){var e=this.state.isTruncated,t=this.contentDiv,n=t.clientHeight,r=t.clientWidth,o=t.scrollHeight,i=t.scrollWidth,l=e?i-25:i,a=e&&l===r||l>r||o>n;this.setState({isTruncated:a})}else this.setState({isTruncated:!1})}}])&&Nt(t.prototype,n),r&&Nt(t,r),i}(d.PureComponent);function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}function Zt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function $t(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}function Jt(e,t){return Jt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Jt(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xt(e);if(t){var o=Xt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $t(this,n)}}Wt(Kt,"displayName","".concat(f.DISPLAYNAME_PREFIX,".TruncatedFormat")),Wt(Kt,"defaultProps",{detectTruncation:!1,measureByApproxOptions:{approximateCharWidth:8,approximateLineHeight:18,cellHorizontalPadding:2*At.CELL_HORIZONTAL_PADDING,numBufferLines:0},preformatted:!1,showPopover:"when-truncated",truncateLength:2e3,truncationSuffix:"..."});var tn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jt(e,t)}(i,e);var t,n,r,o=en(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.omitQuotesOnStrings,r=e.stringify,o=this.props.showPopover,i=null==t;i&&(o=Vt.NEVER);var l=s()(this.props.className,Yt({},te,i)),a="";return a=n&&"string"==typeof t?t:r(t),d.createElement(Kt,Zt(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Yt(e,t,n[t])}))}return e}({},this.props),{className:l,showPopover:o}),a)}}],n&&Qt(t.prototype,n),r&&Qt(t,r),i}(d.Component);function nn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function on(e){return on=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},on(e)}function ln(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}function an(e,t){return an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},an(e,t)}function un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=on(e);if(t){var o=on(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ln(this,n)}}Yt(tn,"displayName","".concat(f.DISPLAYNAME_PREFIX,".JSONFormat")),Yt(tn,"defaultProps",{omitQuotesOnStrings:!0,stringify:function(e){return JSON.stringify(e,null,2)}});var cn=function(){return d.createElement(sn,null)},sn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&an(e,t)}(i,e);var t,n,r,o=un(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"shouldComponentUpdate",value:function(e){return!f.Utils.shallowCompareKeys(this.props,e,{exclude:["style"]})||!f.Utils.deepCompareKeys(this.props.style,e.style)}},{key:"render",value:function(){var e,t,n=this.props,r=n.cellRef,o=n.tabIndex,i=n.onKeyDown,l=n.onKeyUp,a=n.onKeyPress,u=n.style,c=n.intent,p=n.interactive,h=n.loading,v=n.tooltip,g=n.truncated,y=n.className,m=n.wrapText,b=s()(C,f.Classes.intentClass(c),(rn(e={},E,p),rn(e,f.Classes.LOADING,h),rn(e,Ne,g),e),y),R=s()((rn(t={},qe,g),rn(t,ee,!m),t)),w=d.Children.map(this.props.children,(function(e){var t=f.Utils.isElementOfType(e,Kt)||f.Utils.isElementOfType(e,tn);return null!=u&&d.isValidElement(e)&&t?d.cloneElement(e,{parentCellHeight:void 0===u.height?void 0:parseInt(u.height.toString(),10),parentCellWidth:void 0===u.width?void 0:parseInt(u.width.toString(),10)}):e})),O=d.createElement("div",{className:R},w);return d.createElement("div",{className:b,title:v,ref:r,onKeyDown:i,onKeyPress:a,onKeyUp:l,style:u,tabIndex:o},d.createElement(it,{loading:null!=h&&h,variableLength:!0},O))}}])&&nn(t.prototype,n),r&&nn(t,r),i}(d.Component);function dn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}rn(sn,"displayName","".concat(f.DISPLAYNAME_PREFIX,".Cell")),rn(sn,"defaultProps",{truncated:!0,wrapText:!1});var pn=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),fn(this,"handler",void 0),fn(this,"element",void 0),fn(this,"activationCoordinates",void 0),fn(this,"doubleCli