1var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(o){if(this==null)throw new TypeError('"this" is null or not defined');var n=Object(this),s=n.length>>>0;if(typeof o!="function")throw new TypeError("predicate must be a function");for(var a=arguments[1],r=0;r<s;){var l=n[r];if(o.call(a,l,r,n))return r;r++}return-1}});Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(o){if(this==null)throw new TypeError('"this" is null or not defined');var n=Object(this),s=n.length>>>0;if(typeof o!="function")throw new TypeError("predicate must be a function");for(var a=arguments[1],r=0;r<s;){var l=n[r];if(o.call(a,l,r,n))return l;r++}}});String.prototype.includes||(String.prototype.includes=function(t,o){if(t instanceof RegExp)throw TypeError("first argument must not be a RegExp");return o===void 0&&(o=0),this.indexOf(t,o)!==-1});Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(o,n){if(this==null)throw new TypeError('"this" is null or not defined');var s=Object(this),a=s.length>>>0;if(a===0)return!1;var r=n|0,l=Math.max(r>=0?r:a-Math.abs(r),0);function u(d,c){return d===c||typeof d=="number"&&typeof c=="number"&&isNaN(d)&&isNaN(c)}for(;l<a;){if(u(s[l],o))return!0;l++}return!1}});typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(o,n){if(o==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(o),a=1;a<arguments.length;a++){var r=arguments[a];if(r!=null)for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(s[l]=r[l])}return s},writable:!0,configurable:!0});var H=function(o){this.table=o,this.blockHozScrollEvent=!1,this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.element.insertBefore(this.headersElement,this.element.firstChild)};H.prototype.createHeadersElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t};H.prototype.createHeaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-header"),this.table.options.headerVisible||t.classList.add("tabulator-header-hidden"),t};H.prototype.initialize=function(){};H.prototype.setRowManager=function(t){this.rowManager=t};H.prototype.getElement=function(){return this.element};H.prototype.getHeadersElement=function(){return this.headersElement};H.prototype.scrollHorizontal=function(t){var o=0,n=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=t,t>n?(o=t-n,this.element.style.marginLeft=-o+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()};H.prototype.generateColumnsFromRowData=function(t){var o=[],n=this.table.options.autoColumnsDefinitions,s,a;if(t&&t.length){s=t[0];for(var r in s){var l={field:r,title:r},u=s[r];switch(typeof u>"u"?"undefined":E(u)){case"undefined":a="string";break;case"boolean":a="boolean";break;case"object":Array.isArray(u)?a="array":a="string";break;default:!isNaN(u)&&u!==""?a="number":u.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?a="alphanum":a="string";break}l.sorter=a,o.push(l)}if(n)switch(typeof n>"u"?"undefined":E(n)){case"function":this.table.options.columns=n.call(this.table,o);break;case"object":Array.isArray(n)?o.forEach(function(d){var c=n.find(function(h){return h.field===d.field});c&&Object.assign(d,c)}):o.forEach(function(d){n[d.field]&&Object.assign(d,n[d.field])}),this.table.options.columns=o;break}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}};H.prototype.setColumns=function(t,o){for(var n=this;n.headersElement.firstChild;)n.headersElement.removeChild(n.headersElement.firstChild);n.columns=[],n.columnsByIndex=[],n.columnsByField={},n.table.modExists("frozenColumns")&&n.table.modules.frozenColumns.reset(),t.forEach(function(s,a){n._addColumn(s)}
1),n._reIndexColumns(),n.table.options.responsiveLayout&&n.table.modExists("responsiveLayout",!0)&&n.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!1,!0),n.redraw(!0)};H.prototype._addColumn=function(t,o,n){var s=new R(t,this),a=s.getElement(),r=n&&this.findColumnIndex(n);if(n&&r>-1){var l=this.columns.indexOf(n.getTopColumn()),u=n.getElement();o?(this.columns.splice(l,0,s),u.parentNode.insertBefore(a,u)):(this.columns.splice(l+1,0,s),u.parentNode.insertBefore(a,u.nextSibling))}else o?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement())),s.columnRendered();return s};H.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)};H.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)};H.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})};H.prototype._verticalAlignHeaders=function(){var t=this,o=0;t.columns.forEach(function(n){var s;n.clearVerticalAlign(),s=n.getHeight(),s>o&&(o=s)}),t.columns.forEach(function(n){n.verticalAlign(t.table.options.columnHeaderVertAlign,o)}),t.rowManager.adjustTableSize()};H.prototype.findColumn=function(t){var o=this;if((typeof t>"u"?"undefined":E(t))=="object"){if(t instanceof R)return t;if(t instanceof N)return t._getSelf()||!1;if(typeof HTMLElement<"u"&&t instanceof HTMLElement){var n=o.columns.find(function(s){return s.element===t});return n||!1}}else return this.columnsByField[t]||!1;return!1};H.prototype.getColumnByField=function(t){return this.columnsByField[t]};H.prototype.getColumnsByFieldRoot=function(t){var o=this,n=[];return Object.keys(this.columnsByField).forEach(function(s){var a=s.split(".")[0];a===t&&n.push(o.columnsByField[s])}),n};H.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]};H.prototype.getFirstVisibileColumn=function(o){var o=this.columnsByIndex.findIndex(function(n){return n.visible});return o>-1?this.columnsByIndex[o]:!1};H.prototype.getColumns=function(){return this.columns};H.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(o){return t===o})};H.prototype.getRealColumns=function(){return this.columnsByIndex};H.prototype.traverse=function(t){var o=this;o.columnsByIndex.forEach(function(n,s){t(n,s)})};H.prototype.getDefinitions=function(t){var o=this,n=[];return o.columnsByIndex.forEach(function(s){(!t||t&&s.visible)&&n.push(s.getDefinition())}),n};H.prototype.getDefinitionTree=function(){var t=this,o=[];return t.columns.forEach(function(n){o.push(n.getDefinition(!0))}),o};H.prototype.getComponents=function(t){var o=this,n=[],s=t?o.columns:o.columnsByIndex;return s.forEach(function(a){n.push(a.getComponent())}),n};H.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(o){o.visible&&(t+=o.getWidth())}),t};H.prototype.moveColumn=function(t,o,n){this.moveColumnActual(t,o,n),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),o.element.parentNode.insertBefore(t.element,o.element),n&&o.element.parentNode.insertBefore(o.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()};H.prototype.moveColumnActual=function(t,o,n){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,o,n):this._moveColumnInArray(this.columns,t,o,n),this._moveColumnInArray(this.columnsByIndex,t,o,n,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!0),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")};H.prototype._moveColumnInArray=function(t,o,n,s,a){var r=this,l=t.indexOf(o),u,d=[];l>-1&&(t.splice(l,1),u=t.indexOf(n),u>
1-1?s&&(u=u+1):u=l,t.splice(u,0,o),a&&(this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.rowManager.rows.forEach(function(c){d=d.concat(r.table.modules.dataTree.getTreeChildren(c,!1,!0))}),d=d.concat(this.table.rowManager.rows),d.forEach(function(c){if(c.cells.length){var h=c.cells.splice(l,1)[0];c.cells.splice(u,0,h)}})))};H.prototype.scrollToColumn=function(t,o,n){var s=this,a=0,r=0,l=0,u=t.getElement();return new Promise(function(d,c){if(typeof o>"u"&&(o=s.table.options.scrollToColumnPosition),typeof n>"u"&&(n=s.table.options.scrollToColumnIfVisible),t.visible){switch(o){case"middle":case"center":l=-s.element.clientWidth/2;break;case"right":l=u.clientWidth-s.headersElement.clientWidth;break}if(!n&&(r=u.offsetLeft,r>0&&r+u.offsetWidth<s.element.clientWidth))return!1;a=u.offsetLeft+l,a=Math.max(Math.min(a,s.table.rowManager.element.scrollWidth-s.table.rowManager.element.clientWidth),0),s.table.rowManager.scrollHorizontal(a),s.scrollHorizontal(a),d()}else console.warn("Scroll Error - Column not visible"),c("Scroll Error - Column not visible")})};H.prototype.generateCells=function(t){var o=this,n=[];return o.columnsByIndex.forEach(function(s){n.push(s.generateCell(t))}),n};H.prototype.getFlexBaseWidth=function(){var t=this,o=t.table.element.clientWidth,n=0;return t.rowManager.element.scrollHeight>t.rowManager.element.clientHeight&&(o-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(s){var a,r,l;s.visible&&(a=s.definition.width||0,r=typeof s.minWidth>"u"?t.table.options.columnMinWidth:parseInt(s.minWidth),typeof a=="string"?a.indexOf("%")>-1?l=o/100*parseInt(a):l=parseInt(a):l=a,n+=l>r?l:r)}),n};H.prototype.addColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s._addColumn(t,o,n);s._reIndexColumns(),s.table.options.responsiveLayout&&s.table.modExists("responsiveLayout",!0)&&s.table.modules.responsiveLayout.initialize(),s.table.modExists("columnCalcs")&&s.table.modules.columnCalcs.recalc(s.table.rowManager.activeRows),s.redraw(!0),s.table.modules.layout.getMode()!="fitColumns"&&l.reinitializeWidth(),s._verticalAlignHeaders(),s.table.rowManager.reinitialize(),s.table.options.virtualDomHoz&&s.table.vdomHoz.reinitialize(),a(l)})};H.prototype.deregisterColumn=function(t){var o=t.getField(),n;o&&delete this.columnsByField[o],n=this.columnsByIndex.indexOf(t),n>-1&&this.columnsByIndex.splice(n,1),n=this.columns.indexOf(t),n>-1&&this.columns.splice(n,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this._verticalAlignHeaders(),this.redraw()};H.prototype.redraw=function(t){t&&(p.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};
1var N=function(o){this._column=o,this.type="ColumnComponent"};N.prototype.getElement=function(){return this._column.getElement()};N.prototype.getDefinition=function(){return this._column.getDefinition()};N.prototype.getField=function(){return this._column.getField()};N.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(o){t.push(o.getComponent())}),t};N.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible};N.prototype.isVisible=function(){return this._column.visible};N.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()};N.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()};N.prototype.toggle=function(){this._column.visible?this.hide():this.show()};N.prototype.delete=function(){return this._column.delete()};N.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(o){t.push(o.getComponent())}),t};N.prototype.getParentColumn=function(){return this._column.parent instanceof R?this._column.parent.getComponent():!1};N.prototype._getSelf=function(){return this._column};N.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)};N.prototype.getTable=function(){return this._column.table};N.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)};N.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)};N.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)};N.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)};N.prototype.move=function(t,o){var n=this._column.table.columnManager.findColumn(t);n?this._column.table.columnManager.moveColumn(this._column,n,o):console.warn("Move Error - No matching column found:",n)};N.prototype.getNextColumn=function(){var t=this._column.nextColumn();return t?t.getComponent():!1};N.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return t?t.getComponent():!1};N.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)};N.prototype.getWidth=function(){return this._column.getWidth()};N.prototype.setWidth=function(t){var o;return t===!0?o=this._column.reinitializeWidth(!0):o=this._column.setWidth(t),this._column.table.options.virtualDomHoz&&this._column.table.vdomHoz.reinitialize(!0),o};N.prototype.validate=function(){return this._column.validate()};var R=function t(o,n){var s=this;this.table=n.table,this.definition=o,this.parent=n,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),o.columns?(this.isGroup=!0,o.columns.forEach(function(a,r){var l=new t(a,s);s.attachColumn(l)}),s.checkColumnVisibility()):n.registerColumnField(this),o.rowHandle&&this.table.options.movableRows!==!1&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};R.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t};R.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t};R.prototype.checkDefinition=function(){var t=this;
1Object.keys(this.definition).forEach(function(o){t.defaultOptionList.indexOf(o)===-1&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",o)})};R.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData};R.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)};R.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)};R.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)};R.prototype._mapDepricatedFunctionality=function(){typeof this.definition.hideInHtml<"u"&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),typeof this.definition.align<"u"&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),typeof this.definition.downloadTitle<"u"&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))};R.prototype.setTooltip=function(){var t=this,o=t.definition,n=o.headerTooltip||o.tooltip===!1?o.headerTooltip:t.table.options.tooltipsHeader;n?n===!0?o.field?t.table.modules.localize.bind("columns|"+o.field,function(s){t.element.setAttribute("title",s||o.title)}):t.element.setAttribute("title",o.title):(typeof n=="function"&&(n=n(t.getComponent()),n===!1&&(n="")),t.element.setAttribute("title",n)):t.element.setAttribute("title","")};R.prototype._buildHeader=function(){for(var t=this,o=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);o.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),o.headerVertical==="flip"&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),o.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(typeof o.headerFilterPlaceholder<"u"&&o.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(o.field,o.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(o.topCalc||o.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",function(n){t.setTooltip()})};R.prototype._bindEvents=function(){var t=this,o=t.definition,n,s,a;typeof o.headerClick=="function"&&t.element.addEventListener("click",function(r){o.headerClick(r,t.getComponent())}),typeof o.headerDblClick=="function"&&t.element.addEventListener("dblclick",function(r){o.headerDblClick(r,t.getComponent())}),typeof o.headerContext=="function"&&t.element.addEventListener("contextmenu",function(r){o.headerContext(r,t.getComponent())}),typeof o.headerTap=="function"&&(a=!1,t.element.addEventListener("touchstart",function(r){a=!0},{passive:!0}),t.element.addEventListener("touchend",function(r){a&&o.headerTap(r,t.getComponent()),a=!1})),typeof o.headerDblTap=="function"&&(n=null,t.element.addEventListener("touchend",function(r){n?(clearTimeout(n),n=null,o.headerDblTap(r,t.getComponent())):n=setTimeout(function(){clearTimeout(n),n=null},300)})),typeof o.headerTapHold=="function"&&(s=null,t.element.addEventListener("touchstart",function(r){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),s=null,a=!1,o.headerTapHold(r,t.getComponent())},1e3)},{passive:!0}),t.element.addEventListener("touchend",function(r){clearTimeout(s),s=null})),typeof o.cellClick=="function"&&(t.cellEvents.cellClick=o.cellClick),typeof o.cellDblClick=="function"&&(t.cellEvents.cellDblClick=o.cellDblClick),typeof o.cellContext=="function"&&(t.cellEvents.cellContext=o.cellContext),typeof o.cellMouseEnter=="function"&&(t.cellEvents.cellMouseEnter=o.cellMouseEnter),typeof o.cellMouseLeave=="function"&&(t.cellEvents.cellMouseLeave=o.cellMouseLeave),typeof o.cellMouseOver=="function"&&(t.cellEvents.cellMouseOver=o.cellMouseOver),typeof o.cellMouseOut=="function"&&(t.cellEvents.cellMouseOut=o.cellMouseOut),typeof o.cellMouseMove=="function"&&(t.cellEvents.cellMouseMove=o.cellMouseMove),typeof o.cellTap=="function"&&(t.cellEvents.cellTap=o.cellTap),typeof o.cellDblTap=="function"&&(t.cellEvents.cellDblTap=o.cellDblTap),typeof o.cellTapHold=="function"&&(t.cellEvents.cellTapHold=o.cellTapHold),typeof o.cellEdited=="function"&&(t.cellEvents.cellEdited=o.cellEdited),typeof o.cellEditing=="function"&&(t.cellEvents.cellEditing=o.cellEditing),typeof o.cellEditCancelled=="function"&&(t.cellEvents.cellEditCancelled=o.cellEditCancelled)};R.prototype._buildColumnHeader=function(){var t=this,o=this.definition,n=this.table;if(n.modExists("sort")&&n.modules.sort.initializeColumn(this,this.titleHolderElement),(o.headerContextMenu||o.headerClickMenu||o.headerMenu)&&n.modExists("menu")&&n.modules.menu.initializeColumnHeader(this),n.modExists("format")&&n.modules.format.initializeColumn(this),typeof o.editor<"u"&&n.modExists("edit")&&n.modules.edit.initializeColumn(this),typeof o.validator<"u"&&n.modExists("validate")&&n.modules.val
1idate.initializeColumn(this),n.modExists("mutator")&&n.modules.mutator.initializeColumn(this),n.modExists("accessor")&&n.modules.accessor.initializeColumn(this),E(n.options.responsiveLayout)&&n.modExists("responsiveLayout")&&n.modules.responsiveLayout.initializeColumn(this),typeof o.visible<"u"&&(o.visible?this.show(!0):this.hide(!0)),o.cssClass){var s=o.cssClass.split(" ");s.forEach(function(a){t.element.classList.add(a)})}o.field&&this.element.setAttribute("tabulator-field",o.field),this.setMinWidth(typeof o.minWidth>"u"?this.table.options.columnMinWidth:parseInt(o.minWidth)),(o.maxWidth||this.table.options.columnMaxWidth)&&o.maxWidth!==!1&&this.setMaxWidth(typeof o.maxWidth>"u"?this.table.options.columnMaxWidth:parseInt(o.maxWidth)),this.reinitializeWidth(),this.tooltip=this.definition.tooltip||this.definition.tooltip===!1?this.definition.tooltip:this.table.options.tooltips,this.hozAlign=typeof this.definition.hozAlign>"u"?this.table.options.cellHozAlign:this.definition.hozAlign,this.vertAlign=typeof this.definition.vertAlign>"u"?this.table.options.cellVertAlign:this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign};R.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var t=document.createElement("div");return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t};R.prototype._buildColumnHeaderTitle=function(){var t=this,o=t.definition,n=t.table,s=document.createElement("div");if(s.classList.add("tabulator-col-title"),o.editableTitle){var a=document.createElement("input");a.classList.add("tabulator-title-editor"),a.addEventListener("click",function(r){r.stopPropagation(),a.focus()}),a.addEventListener("change",function(){o.title=a.value,n.options.columnTitleChanged.call(t.table,t.getComponent())}),s.appendChild(a),o.field?n.modules.localize.bind("columns|"+o.field,function(r){a.value=r||o.title||" "}):a.value=o.title||" "}else o.field?n.modules.localize.bind("columns|"+o.field,function(r){t._formatColumnHeaderTitle(s,r||o.title||" ")}):t._formatColumnHeaderTitle(s,o.title||" ");return s};R.prototype._formatColumnHeaderTitle=function(t,o){var n=this,s,a,r,l,u;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(s=this.table.modules.format.getFormatter(this.definition.titleFormatter),u=function(c){n.titleFormatterRendered=c},l={getValue:function(){return o},getElement:function(){return t}},r=this.definition.titleFormatterParams||{},r=typeof r=="function"?r():r,a=s.call(this.table.modules.format,l,r,u),typeof a>"u"?"undefined":E(a)){case"object":a instanceof Node?t.appendChild(a):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",a));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=a}else t.innerHTML=o};R.prototype._buildGroupHeader=function(){var t=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var o=this.definition.cssClass.split(" ");o.forEach(function(n){t.element.classList.add(n)})}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign,this.element.appendChild(this.groupElement)};R.prototype._getFlatData=function(t){return t[this.field]};R.prototype._getNestedData=function(t){for(var o=t,n=this.fieldStructure,s=n.length,a,r=0;r<s&&(o=o[n[r]],a=o,!!o);r++);return a};R.prototype._setFlatData=function(t,o){this.field&&(t[this.field]=o)};R.prototype._setNestedData=function(t,o){for(var n=t,s=this.fieldStructure,a=s.length,r=0;r<a;r++)if(r==a-1)n[s[r]]=o;else{if(!n[s[r]])if(typeof o<"u")n[s[r]]={};else break;n=n[s[r]]}};R.prototype.attachColumn=function(t){var o=this;o.groupElement?(o.columns.push(t),o.groupElement.appendChild(t.getElement())):console.warn("Column Warning - Column being attached to another column instead of column group")};R.prototype.verticalAlign=function(t,o){var n=this.parent.isGroup?this.parent.getGroupElement().clientHeight:o||this.parent.getHeadersElement().clientHeight;this.element.style.height=n+"px",this.isGroup&&(this.groupElement.style.minHeight=n-this.contentElement.offsetHeight+"px"),!this.isGroup&&t!=="top"&&(t==="bottom"?this.element.style.paddingTop=this.element.clientHeight-this.contentElement.offsetHeight+"px":this.element.style.paddingTop=(this.element.clientHeight-this.contentElement.offsetHeight)/2+"px"),this.columns.forEach(function(s){s.verticalAlign(t)})};R.prototype.clearVerticalAlign=function(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(t){t.clearVerticalAlign()})};R.prototype.bindModuleColumns=function(){this.definition.formatter=="rownum"&&(this.table.rowManager.rowNumColumn=this)};R.prototype.getElement=function(){return this.element};R.prototype.getGroupElement=function(){return this.groupElement};R.prototype.getField=function(){return this.field};R.prototype.getFirstColumn=function(){return this.isGroup?this.columns.length?this.columns[0].getFirstColumn():!1:this};R.prototype.getLastColumn=function(){return this.isGroup?this.columns.length?this.columns[this.columns.length-1].getLastColumn():!1:this};R.prototype.getColumns=function(){return this.columns};R.prototype.getCells=function(){return this.cells};R.prototype.getTopColumn=function(){return this.parent.isGroup?this.parent.getTopColumn():this};R.prototype.getDefinition=function(t){var o=[];return this.isGroup&&t&&(this.columns.forEach(function(n){o.push(n.getDefinition(!0))}),this.definition.columns=o),this.definition};R.prototype.checkColumnVisibility=function(){var t=!1;this.columns.forEach(function(o){o.visible&&(t=!0)}),t?(this.show(),this.parent.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1)):this.hide()};R.prototype.show=function(t,o){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEac
1h(function(n){n.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager._verticalAlignHeaders(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),!o&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),!this.silent&&this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize())};R.prototype.hide=function(t,o){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager._verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(n){n.hide()}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),!o&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),!this.silent&&this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize())};R.prototype.matchChildWidths=function(){var t=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(o){o.visible&&(t+=o.getWidth())}),this.contentElement.style.maxWidth=t-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())};R.prototype.removeChild=function(t){var o=this.columns.indexOf(t);o>-1&&this.columns.splice(o,1),this.columns.length||this.delete()};R.prototype.setWidth=function(t){this.widthFixed=!0,this.setWidthActual(t)};R.prototype.setWidthActual=function(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(o){o.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()};R.prototype.checkCellHeights=function(){var t=[];this.cells.forEach(function(o){o.row.heightInitialized&&(o.row.getElement().offsetParent!==null?(t.push(o.row),o.row.clearCellHeight()):o.row.heightInitialized=!1)}),t.forEach(function(o){o.calcHeight()}),t.forEach(function(o){o.setCellHeight()})};R.prototype.getWidth=function(){var t=0;return this.isGroup?this.columns.forEach(function(o){o.visible&&(t+=o.getWidth())}):t=this.width,t};R.prototype.getHeight=function(){return this.element.offsetHeight};R.prototype.setMinWidth=function(t){this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(o){o.setMinWidth()})};R.prototype.setMaxWidth=function(t){this.maxWidth=t,this.maxWidthStyled=t?t+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(o){o.setMaxWidth()})};R.prototype.delete=function(){var t=this;return new Promise(function(o,n){t.isGroup&&t.columns.forEach(function(r){r.delete()}),t.table.modExists("edit")&&t.table.modules.edit.currentCell.column===t&&t.table.modules.edit.cancelEdit();for(var s=t.cells.length,a=0;a<s;a++)t.cells[0].delete();t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.element=!1,t.contentElement=!1,t.titleElement=!1,t.groupElement=!1,t.parent.isGroup&&t.parent.removeChild(t),t.table.columnManager.deregisterColumn(t),t.table.options.virtualDomHoz&&t.table.vdomHoz.reinitialize(!0),o()})};R.prototype.columnRendered=function(){this.titleFormatterRendered&&this.titleFormatterRendered()};R.prototype.validate=function(){var t=[];return this.cells.forEach(function(o){o.validate()||t.push(o.getComponent())}),t.length?t:!0};R.prototype.generateCell=function(t){var o=this,n=new A(o,t);return this.cells.push(n),n};R.prototype.nextColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1?this._nextVisibleColumn(t+1):!1};R.prototype._nextVisibleColumn=function(t){var o=this.table.columnManager.getColumnByIndex(t);return!o||o.visible?o:this._nextVisibleColumn(t+1)};R.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1?this._prevVisibleColumn(t-1):!1};R.prototype._prevVisibleColumn=function(t){var o=this.table.columnManager.getColumnByIndex(t);return!o||o.visible?o:this._prevVisibleColumn(t-1)};R.prototype.reinitializeWidth=function(t){this.widthFixed=!1,typeof this.definition.width<"u"&&!t&&this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()};R.prototype.fitToData=function(){var t=this;
1this.widthFixed||(this.element.style.width="",t.cells.forEach(function(n){n.clearWidth()}));var o=this.element.offsetWidth;(!t.width||!this.widthFixed)&&(t.cells.forEach(function(n){var s=n.getWidth();s>o&&(o=s)}),o&&t.setWidthActual(o+1))};R.prototype.updateDefinition=function(t){var o=this;return new Promise(function(n,s){var a;o.isGroup||o.parent.isGroup?(console.warn("Column Update Error - The updateDefinition function is only available on ungrouped columns"),s("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(a=Object.assign({},o.getDefinition()),a=Object.assign(a,t),o.table.columnManager.addColumn(a,!1,o).then(function(r){a.field==o.field&&(o.field=!1),o.delete().then(function(){n(r.getComponent())}).catch(function(l){s(l)})}).catch(function(r){s(r)}))})};R.prototype.deleteCell=function(t){var o=this.cells.indexOf(t);o>-1&&this.cells.splice(o,1)};R.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","maxWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","headerHozAlign","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","clickMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"];R.prototype.getComponent=function(){return this.component||(this.component=new N(this)),this.component};var C=function(o){this.table=o,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};C.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t};C.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t};C.prototype.getElement=function(){return this.element};C.prototype.getTableElement=function(){return this.tableElement};C.prototype.getRowPosition=function(t,o){return o?this.activeRows.indexOf(t):this.rows.indexOf(t)};C.prototype.setColumnManager=function(t){this.columnManager=t};C.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRen
1der=!0,t.element.addEventListener("scroll",function(){var o=t.element.scrollLeft;t.scrollLeft!=o&&(t.columnManager.scrollHorizontal(o),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(o),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(o),t.table.options.scrollHorizontal(o)),t.scrollLeft=o}),this.renderMode==="virtual"&&t.element.addEventListener("scroll",function(){var o=t.element.scrollTop,n=t.scrollTop>o;t.scrollTop!=o?(t.scrollTop=o,t.scrollVertical(n),t.table.options.ajaxProgressiveLoad=="scroll"&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-o),t.table.options.scrollVertical(o)):t.scrollTop=o})};C.prototype.findRow=function(t){var o=this;if((typeof t>"u"?"undefined":E(t))=="object"){if(t instanceof T)return t;if(t instanceof F)return t._getSelf()||!1;if(typeof HTMLElement<"u"&&t instanceof HTMLElement){var n=o.rows.find(function(a){return a.getElement()===t});return n||!1}}else{if(typeof t>"u"||t===null)return!1;var s=o.rows.find(function(a){return a.data[o.table.options.index]==t});return s||!1}return!1};C.prototype.getRowFromDataObject=function(t){var o=this.rows.find(function(n){return n.data===t});return o||!1};C.prototype.getRowFromPosition=function(t,o){return o?this.activeRows[t]:this.rows[t]};C.prototype.scrollToRow=function(t,o,n){var s=this,a=this.getDisplayRows().indexOf(t),r=t.getElement(),l,u=0;return new Promise(function(d,c){if(a>-1){if(typeof o>
1"u"&&(o=s.table.options.scrollToRowPosition),typeof n>"u"&&(n=s.table.options.scrollToRowIfVisible),o==="nearest")switch(s.renderMode){case"classic":l=p.prototype.helpers.elOffset(r).top,o=Math.abs(s.element.scrollTop-l)>Math.abs(s.element.scrollTop+s.element.clientHeight-l)?"bottom":"top";break;case"virtual":o=Math.abs(s.vDomTop-a)>Math.abs(s.vDomBottom-a)?"bottom":"top";break}if(!n&&p.prototype.helpers.elVisible(r)&&(u=p.prototype.helpers.elOffset(r).top-p.prototype.helpers.elOffset(s.element).top,u>0&&u<s.element.clientHeight-r.offsetHeight))return!1;switch(s.renderMode){case"classic":s.element.scrollTop=p.prototype.helpers.elOffset(r).top-p.prototype.helpers.elOffset(s.element).top+s.element.scrollTop;break;case"virtual":s._virtualRenderFill(a,!0);break}switch(o){case"middle":case"center":s.element.scrollHeight-s.element.scrollTop==s.element.clientHeight?s.element.scrollTop=s.element.scrollTop+(r.offsetTop-s.element.scrollTop)-(s.element.scrollHeight-r.offsetTop)/2:s.element.scrollTop=s.element.scrollTop-s.element.clientHeight/2;break;case"bottom":s.element.scrollHeight-s.element.scrollTop==s.element.clientHeight?s.element.scrollTop=s.element.scrollTop-(s.element.scrollHeight-r.offsetTop)+r.offsetHeight:s.element.scrollTop=s.element.scrollTop-s.element.clientHeight+r.offsetHeight;break}d()}else console.warn("Scroll Error - Row not visible"),c("Scroll Error - Row not visible")})};C.prototype.setData=function(t,o,n){var s=this,a=this;return new Promise(function(r,l){o&&s.getDisplayRows().length?a.table.options.pagination?a._setDataActual(t,!0):s.reRenderInPosition(function(){a._setDataActual(t)}
1):(s.table.options.autoColumns&&n&&s.table.columnManager.generateColumnsFromRowData(t),s.resetScroll(),s._setDataActual(t)),r()})};C.prototype._setDataActual=function(t,o){var n=this;n.table.options.dataLoading.call(this.table,t),this._wipeElements(),this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.clear(),Array.isArray(t)?(this.table.modExists("selectRow")&&this.table.modules.selectRow.clearSelectionData(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchData(t),t.forEach(function(s,a){if(s&&(typeof s>"u"?"undefined":E(s))==="object"){var r=new T(s,n);n.rows.push(r)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",s)}),n.refreshActiveData(!1,!1,o),n.table.options.dataLoaded.call(this.table,t)):console.error(`Data Loading Error - Unable to process data due to invalid data type 2Expecting: array 3Received: `,typeof t>"u"?"undefined":E(t),` 4Data: `,t)};C.prototype._wipeElements=function(){this.rows.forEach(function(t){t.wipe()}),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.wipe(),this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()};C.prototype.deleteRow=function(t,o){var n=this.rows.indexOf(t),s=this.activeRows.indexOf(t);s>-1&&this.activeRows.splice(s,1),n>-1&&this.rows.splice(n,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(a){var r=a.indexOf(t);r>-1&&a.splice(r,1)}),o||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")};C.prototype.addRow=function(t,o,n,s){var a=this.addRowActual(t,o,n,s);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",a,{data:t,pos:o,index:n}),a};C.prototype.addRows=function(t,o,n){var s=this,a=this,r=[];return new Promise(function(l,u){o=s.findAddRowPos(o),Array.isArray(t)||(t=[t]),t.length-1,(typeof n>"u"&&o||typeof n<"u"&&!o)&&t.reverse(),t.forEach(function(d,c){var h=a.addRow(d,o,n,!0);r.push(h)}),s.table.options.groupBy&&s.table.modExists("groupRows")?s.table.modules.groupRows.updateGroupRows(!0):s.table.options.pagination&&s.table.modExists("page")?s.refreshActiveData(!1,!1,!0):s.reRenderInPosition(),s.table.modExists("columnCalcs")&&s.table.modules.columnCalcs.recalc(s.table.rowManager.activeRows),s.regenerateRowNumbers(),l(r)})};C.prototype.findAddRowPos=function(t){return typeof t>"u"&&(t=this.table.options.addRowPos),t==="pos"&&(t=!0),t==="bottom"&&(t=!1),t};C.prototype.addRowActual=function(t,o,n,s){var a=t instanceof T?t:new T(t||{},this),r=this.findAddRowPos(o),l=-1,u,d;if(!n&&this.table.options.pagination&&this.table.options.paginationAddRow=="page"&&(d=this.getDisplayRows(),r?d.length?n=d[0]:this.activeRows.length&&(n=this.activeRows[this.activeRows.length-1],r=!1):d.length&&(n=d[d.length-1],r=!(d.length<this.table.modules.page.getPageSize()))),typeof n<"u"&&(n=this.findRow(n)),this.table.options.groupBy&&this.table.modExists("groupRows")){this.table.modules.groupRows.assignRowToGroup(a);var c=a.getGroup().rows;c.length>1&&(!n||n&&c.indexOf(n)==-1?r?c[0]!==a&&(n=c[0],this._moveRowInArray(a.getGroup().rows,a,n,!r)):c[c.length-1]!==a&&(n=c[c.length-1],this._moveRowInArray(a.getGroup().rows,a,n,!r)):this._moveRowInArray(a.getGroup().rows,a,n,!r))}return n&&(l=this.rows.indexOf(n)),n&&l>-1?(u=this.activeRows.indexOf(n),this.displayRowIterator(function(h){var m=h.indexOf(n);m>-1&&h.splice(r?m:m+1,0,a)}),u>-1&&this.activeRows.splice(r?u:u+1,0,a),this.rows.splice(r?l:l+1,0,a)):r?(this.displayRowIterator(function(h){h.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(h){h.push(a)}),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.o
4ptions.rowAdded.call(this.table,a.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),s||this.reRenderInPosition(),a};C.prototype.moveRow=function(t,o,n){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(o),to:o,after:n}),this.moveRowActual(t,o,n),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())};C.prototype.moveRowActual=function(t,o,n){var s=this;if(this._moveRowInArray(this.rows,t,o,n),this._moveRowInArray(this.activeRows,t,o,n),this.displayRowIterator(function(l){s._moveRowInArray(l,t,o,n)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!n&&o instanceof S&&(o=this.table.rowManager.prevDisplayRow(t)||o);var a=o.getGroup(),r=t.getGroup();a===r?this._moveRowInArray(a.rows,t,o,n):(r&&r.removeRow(t),a.insertRow(t,o,n))}};C.prototype._moveRowInArray=function(t,o,n,s){var a,r,l,u;if(o!==n&&(a=t.indexOf(o),a>-1&&(t.splice(a,1),r=t.indexOf(n),r>-1?s?t.splice(r+1,0,o):t.splice(r,0,o):t.splice(a,0,o)),t===this.getDisplayRows())){l=a<r?a:r,u=r>a?r:a+1;for(var d=l;d<=u;d++)t[d]&&this.styleRow(t[d],d)}};C.prototype.clearData=function(){this.setData([])};C.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)};C.prototype.getDisplayRowIndex=function(t){var o=this.getDisplayRows().indexOf(t);return o>-1?o:!1};C.prototype.nextDisplayRow=function(t,o){var n=this.getDisplayRowIndex(t),s=!1;return n!==!1&&n<this.displayRowsCount-1&&(s=this.getDisplayRows()[n+1]),s&&(!(s instanceof T)||s.type!="row")?this.nextDisplayRow(s,o):s};C.prototype.prevDisplayRow=function(t,o){var n=this.getDisplayRowIndex(t),s=!1;return n&&(s=this.getDisplayRows()[n-1]),o&&s&&(!(s instanceof T)||s.type!="row")?this.prevDisplayRow(s,o):s};C.prototype.findRowIndex=function(t,o){var n;return t=this.findRow(t),t&&(n=o.indexOf(t),n>-1)?n:!1};C.prototype.getData=function(t,o){var n=[],s=this.getRows(t);return s.forEach(function(a){a.type=="row"&&n.push(a.getData(o||"data"))}),n};C.prototype.getComponents=function(t){var o=[],n=this.getRows(t);return n.forEach(function(s){o.push(s.getComponent())}),o};C.prototype.getDataCount=function(t){var o=this.getRows(t);return o.length};C.prototype._genRemoteRequest=function(){var t=this,o=this.table,n=o.options,s={};if(o.modExists("page")){if(n.ajaxSorting){var a=this.table.modules.sort.getSort();a.forEach(function(l){delete l.column}),s[this.table.modules.page.paginationDataSentNames.sorters]=a}if(n.ajaxFiltering){var r=this.table.modules.filter.getFilters(!0,!0);s[this.table.modules.page.paginationDataSentNames.filters]=r}this.table.modules.ajax.setParams(s,!0)}o.modules.ajax.sendRequest().then(function(l){t._setDataActual(l,!0)}).catch(function(l){})};C.prototype.filterRefresh=function(){var t=this.table,o=t.options,n=this.scrollLeft;o.ajaxFiltering?o.pagination=="remote"&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(n)};C.prototype.sorterRefresh=function(t){var o=this.table,n=this.table.options,s=this.scrollLeft;n.ajaxSorting?(n.pagination=="remote"||n.progressiveLoad)&&o.modExists("page")?(o.modules.page.reset(!0),o.modules.page.setPage(1).then(function(){}).catch(function(){})):n.ajaxProgressiveLoad?o.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(s)};C.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)};C.prototype.refreshActiveData=function(t,o,n){var s=this,a=this.table,r=["all","filter","sort","display","freeze","group","tree","page"],l;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||r.indexOf(t)<r.indexOf(this.redrawBlockRestoreConfig.stage))&&(this.redrawBlockRestoreConfig={stage:t,skipStage:o,renderInPosition:n});return}else{switch(s.table.modExists("edit")&&s.table.modules.edit.cancelEdit(),t||(t="all"),a.options.selectable&&!a.options.selectablePersistence&&a.modExists("selectRow")&&a.modules.selectRow.deselectRows(),t){case"all":case"filter":o?o=!1:a.modExists("filter")?s.setA
4ctiveRows(a.modules.filter.filter(s.rows)):s.setActiveRows(s.rows.slice(0));case"sort":o?o=!1:a.modExists("sort")&&a.modules.sort.sort(this.activeRows),this.regenerateRowNumbers();case"display":this.resetDisplayRows();case"freeze":o?o=!1:this.table.modExists("frozenRows")&&a.modules.frozenRows.isFrozen()&&(a.modules.frozenRows.getDisplayIndex()||a.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()),l=a.modules.frozenRows.getDisplayIndex(),l=s.setDisplayRows(a.modules.frozenRows.getRows(this.getDisplayRows(l-1)),l),l!==!0&&a.modules.frozenRows.setDisplayIndex(l));case"group":o?o=!1:a.options.groupBy&&a.modExists("groupRows")&&(a.modules.groupRows.getDisplayIndex()||a.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()),l=a.modules.groupRows.getDisplayIndex(),l=s.setDisplayRows(a.modules.groupRows.getRows(this.getDisplayRows(l-1)),l),l!==!0&&a.modules.groupRows.setDisplayIndex(l));case"tree":o?o=!1:a.options.dataTree&&a.modExists("dataTree")&&(a.modules.dataTree.getDisplayIndex()||a.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()),l=a.modules.dataTree.getDisplayIndex(),l=s.setDisplayRows(a.modules.dataTree.getRows(this.getDisplayRows(l-1)),l),l!==!0&&a.modules.dataTree.setDisplayIndex(l)),a.options.pagination&&a.modExists("page")&&!n&&a.modules.page.getMode()=="local"&&a.modules.page.reset();case"page":o?o=!1:a.options.pagination&&a.modExists("page")&&(a.modules.page.getDisplayIndex()||a.modules.page.setDisplayIndex(this.getNextDisplayIndex()),l=a.modules.page.getDisplayIndex(),a.modules.page.getMode()=="local"&&a.modules.page.setMaxRows(this.getDisplayRows(l-1).length),l=s.setDisplayRows(a.modules.page.getRows(this.getDisplayRows(l-1)),l),l!==!0&&a.modules.page.setDisplayIndex(l))}
4p.prototype.helpers.elVisible(s.element)&&(n?s.reRenderInPosition():(t==="all"&&this.table.options.virtualDomHoz&&this.table.vdomHoz.dataChange(),s.renderTable(),a.options.layoutColumnsOnNewData&&s.table.columnManager.redraw(!0))),a.modExists("columnCalcs")&&a.modules.columnCalcs.recalc(this.activeRows)}};C.prototype.regenerateRowNumbers=function(){var t=this;this.rowNumColumn&&this.activeRows.forEach(function(o){var n=o.getCell(t.rowNumColumn);n&&n._generateContents()})};C.prototype.setActiveRows=function(t){this.activeRows=t,this.activeRowsCount=this.activeRows.length};C.prototype.resetDisplayRows=function(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length,this.table.modExists("frozenRows")&&this.table.modules.frozenRows.setDisplayIndex(0),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.setDisplayIndex(0),this.table.options.pagination&&this.table.modExists("page")&&this.table.modules.page.setDisplayIndex(0)};C.prototype.getNextDisplayIndex=function(){return this.displayRows.length};C.prototype.setDisplayRows=function(t,o){var n=!0;return o&&typeof this.displayRows[o]<"u"?(this.displayRows[o]=t,n=!0):(this.displayRows.push(t),n=o=this.displayRows.length-1),o==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),n};C.prototype.getDisplayRows=function(t){return typeof t>"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]};C.prototype.getVisibleRows=function(t){var o=this.element.scrollTop,n=this.element.clientHeight+o,s=!1,a=0,r=0,l=this.getDisplayRows();if(t){this.getDisplayRows();for(var u=this.vDomTop;u<=this.vDomBottom;u++)if(l[u])if(s)if(n-l[u].getElement().offsetTop>=0)r=u;else break;else if(o-l[u].getElement().offsetTop>=0)a=u;else if(s=!0,n-l[u].getElement().offsetTop>=0)r=u;else break}else a=this.vDomTop,r=this.vDomBottom;return l.slice(a,r+1)};C.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length};C.prototype.getRows=function(t){var o;switch(t){case"active":o=this.activeRows;break;case"display":o=this.table.rowManager.getDisplayRows();break;case"visible":o=this.getVisibleRows(!0);break;case"selected":o=this.table.modules.selectRow.selectedRows;break;default:o=this.rows}return o};C.prototype.reRenderInPosition=function(t){if(this.getRenderMode()=="virtual")if(this.redrawBlock)t?t():this.redrawBlockRederInPosition=!0;else{for(var o=this.element.scrollTop,n=!1,s=!1,a=this.scrollLeft,r=this.getDisplayRows(),l=this.vDomTop;l<=this.vDomBottom;l++)if(r[l]){var u=o-r[l].getElement().offsetTop;if(s===!1||Math.abs(u)<s)s=u,n=l;else break}t&&t(),this._virtualRenderFill(n===!1?this.displayRowsCount-1:n,!0,s||0),this.scrollHorizontal(a)}else this.renderTable(),t&&t()};C.prototype.setRenderMode=function(){this.table.options.virtualDom?(this.renderMode="virtual",this.table.element.clientHeight||this.table.options.height?this.fixedHeight=!0:this.fixedHeight=!1):this.renderMode="classic"};C.prototype.getRenderMode=function(){return this.renderMode};C.prototype.renderTable=function(){switch(this.table.options.renderStarted.call(this.table),this.element.scrollTop=0,this.renderMode){case"classic":this._simpleRender();break;case"virtual":this._virtualRenderFill();break}this.firstRender&&(this.displayRowsCount?(this.firstRender=!1,this.table.modules.layout.layout()):this.renderEmptyScroll()),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.displayRowsCount||this.table.options.placeholder&&(this.table.options.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.table.options.placeholder),this.table.options.placeholder.style.width=this.table.columnManager.getWidth()+"px"),this.table.options.renderComplete.call(this.table)};C.prototype._simpleRender=function(){this._clearVirtualDom(),this.displayRowsCount?this.checkClassicModeGroupHeaderWidth():this.renderEmptyScroll()};C.prototype.checkClassicModeGroupHeaderWidth=function(){var t=this,o=this.tableElement,n=!0;
4t.getDisplayRows().forEach(function(s,a){t.styleRow(s,a),o.appendChild(s.getElement()),s.initialize(!0),s.type!=="group"&&(n=!1)}),n?o.style.minWidth=t.table.columnManager.getWidth()+"px":o.style.minWidth=""};C.prototype.renderEmptyScroll=function(){this.table.options.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"};C.prototype._clearVirtualDom=function(){var t=this.tableElement;for(this.table.options.placeholder&&this.table.options.placeholder.parentNode&&this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder);t.firstChild;)t.removeChild(t.firstChild);t.style.paddingTop="",t.style.paddingBottom="",t.style.minWidth="",t.style.minHeight="",t.style.display="",t.style.visibility="",this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0};C.prototype.styleRow=function(t,o){var n=t.getElement();o%2?(n.classList.add("tabulator-row-even"),n.classList.remove("tabulator-row-odd")):(n.classList.add("tabulator-row-odd"),n.classList.remove("tabulator-row-even"))};C.prototype._virtualRenderFill=function(t,o,n){var s=this,a=s.tableElement,r=s.element,l=0,u=0,d=0,c=0,h=!0,m=s.getDisplayRows();if(t=t||0,n=n||0,!t)s._clearVirtualDom();else{for(;a.firstChild;)a.removeChild(a.firstChild);var f=(s.displayRowsCount-t+1)*s.vDomRowHeight;f<s.height&&(t-=Math.ceil((s.height-f)/s.vDomRowHeight),t<0&&(t=0)),l=Math.min(Math.max(Math.floor(s.vDomWindowBuffer/s.vDomRowHeight),s.vDomWindowMinMarginRows),t),t-=l}if(s.displayRowsCount&&p.prototype.helpers.elVisible(s.element)){for(s.vDomTop=t,s.vDomBottom=t-1;(u<=s.height+s.vDomWindowBuffer||c<s.vDomWindowMinTotalRows)&&s.vDomBottom<s.displayRowsCount-1;){var g=s.vDomBottom+1,w=m[g],b=0;s.styleRow(w,g),a.appendChild(w.getElement()),w.initialize(),w.heightInitialized||w.normalizeHeight(!0),b=w.getHeight(),c<l?d+=b:u+=b,b>this.vDomWindowBuffer&&(this.vDomWindowBuffer=b*2),w.type!=="group"&&(h=!1),s.vDomBottom++,c++}t?(s.vDomTopPad=o?s.vDomRowHeight*this.vDomTop+n:s.scrollTop-d,s.vDomBottomPad=s.vDomBottom==s.displayRowsCount-1?0:Math.max(s.vDomScrollHeight-s.vDomTopPad-u-d,0)):(this.vDomTopPad=0,s.vDomRowHeight=Math.floor((u+d)/c),s.vDomBottomPad=s.vDomRowHeight*(s.displayRowsCount-s.vDomBottom-1),s.vDomScrollHeight=d+u+s.vDomBottomPad-s.height),a.style.paddingTop=s.vDomTopPad+"px",a.style.paddingBottom=s.vDomBottomPad+"px",o&&(this.scrollTop=s.vDomTopPad+d+n-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&o&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,r.scrollTop=this.scrollTop,a.style.minWidth=h?s.table.columnManager.getWidth()+"px":"",s.table.options.groupBy&&s.table.modules.layout.getMode()!="fitDataFill"&&s.displayRowsCount==s.table.modules.groupRows.countGroups()&&(s.tableElement.style.minWidth=s.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()};C.prototype.scrollVertical=function(t){var o=this.scrollTop-this.vDomScrollPosTop,n=this.scrollTop-this.vDomScrollPosBottom,s=this.vDomWindowBuffer*2;if(-o>s||n>s){var a=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(a)}else t?(o<0&&this._addTopRow(-o),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-n):this.vDomScrollPosBottom=this.scrollTop)):(o>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o):this.vDomScrollPosTop=this.scrollTop),n>=0&&this._addBottomRow(n))};C.prototype._addTopRow=function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.tableElement,s=this.getDisplayRows();if(this.vDomTop){var a=this.vDomTop-1,r=s[a],l=r.getHeight()||this.vDomRowHeight;t>=l&&(this.styleRow(r,a),n.insertBefore(r.getElement(),n.firstChild),(!r.initialized||!r.heightInitialized)&&(this.vDomTopNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomTopPad-=l,this.vDomTopPad<0&&(this.vDomTopPad=a*this.vDomRowHeight),a||(this.vDomTopPad=0),n.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=l,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=r.getHeight()*2),o<this.vDomMaxRenderChain&&this.vDomTop&&t>=(s[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,o+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}};C.prototype._removeTopRow=function(t){var o=this.tableElement,n=this.getDisplayRows()[this.vDomTop],s=n.getHeight()||this.vDomRowHeight;if(t>=s){var a=n.getElement();a.parentNode.removeChild(a),this.vDomTopPad+=s,o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}};C.prototype._addBottomRow=function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.tableElement,s=this.getDisplayRows();if(this.vDomBottom<this.displayRowsCount-1){var a=this.vDomBottom+1,r=s[a],l=r.getHeight()||this.vDomRowHeight;t>=l&&(this.styleRow(r,a),n.appendChild(r.getElement()),(!r.initialized||!r.heightInitialized)&&(this.vDomBottomNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomBottomPad-=l,(this.vDomBottomPad<0||a==this.displayRowsCount-1)&&(this.vDomBottomPad=0),n.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=l,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=r.getHeight()*2),o<this.vDomMaxRenderChain&&this.vDomBottom<this.displayRowsCount-1&&t>=(s[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,o+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}};C.prototype._removeBottomRow=function(t){var o=this.tableElement,n=this.getDisplayRows()[this.vDomBottom],s=n.getHeight()||this.vDomRowHeight;if(t>=s){var a=n.getElement();a.parentNode&&a.parentNode.removeChild(a),this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}};C.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(o){o.calcHeight()}),t.forEach(function(o){o.setCellHeight()}),t.length=0};C.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.n
4ormalizeHeight()})};C.prototype.adjustTableSize=function(){var t=this.element.clientHeight,o;if(this.renderMode==="virtual"){var n=Math.floor(this.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(this.element.style.minHeight="calc(100% - "+n+"px)",this.element.style.height="calc(100% - "+n+"px)",this.element.style.maxHeight="calc(100% - "+n+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-n+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,!this.fixedHeight&&t!=this.element.clientHeight&&(o=this.table.modExists("resizeTable"),(o&&!this.table.modules.resizeTable.autoResize||!o)&&this.redraw())}};C.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize(!0)})};C.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1};C.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1};C.prototype.redraw=function(t){var o=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():(this.renderMode=="classic"?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(o)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))};C.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var ee=function(o){this.table=o,this.element=this.table.rowManager.tableElement,this.holderEl=this.table.rowManager.element,this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.window=200,this.initialized=!1,this.columns=[],this.compatabilityCheck()&&this.initialize()};ee.prototype.compatabilityCheck=function(){var t=this.table.options,o=!1,n=!0;return t.layout=="fitDataTable"&&(console.warn("Horizontal Vitrual DOM is not compatible with fitDataTable layout mode"),n=!1),t.responsiveLayout&&(console.warn("Horizontal Vitrual DOM is not compatible with responsive columns"),n=!1),this.table.rtl&&(console.warn("Horizontal Vitrual DOM is not currently compatible with RTL text direction"),n=!1),t.columns&&(o=t.columns.find(function(s){return s.frozen}),o&&(console.warn("Horizontal Vitrual DOM is not compatible with frozen columns"),n=!1)),n||(t.virtualDomHoz=!1),n};ee.prototype.initialize=function(){var t=this;this.holderEl.addEventListener("scroll",function(){var o=t.holderEl.scrollLeft;t.scrollLeft!=o&&(t.scrollLeft=o,t.scroll(o-(t.vDomScrollPosLeft+t.window)))})};ee.prototype.deinitialize=function(){this.initialized=!1};ee.prototype.clear=function(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0};ee.prototype.dataChange=function(){var t=!1,o=0,n=0,s,a,r;if(this.table.options.layout==="fitData"){if(this.table.columnManager.columnsByIndex.forEach(function(u){!u.definition.width&&u.visible&&(t=!0)}),t&&t&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.holderEl.clientWidth+this.window,this.table.options.groupBy?(s=this.table.modules.groupRows.getGroups(!1)[0],a=s.getRows(!1)[0]):a=this.table.rowManager.getDisplayRows()[0],a)){r=a.getElement(),a.generateCells(),this.element.appendChild(r);for(var n=0;n<a.cells.length;n++){var l=a.cells[n];
4if(r.appendChild(l.getElement()),l.column.reinitializeWidth(),o+=l.column.getWidth(),o>this.vDomScrollPosRight)break}for(r.parentNode.removeChild(r),this.fitDataColAvg=Math.floor(o/(n+1)),n;n<this.table.columnManager.columnsByIndex.length;n++)this.table.columnManager.columnsByIndex[n].setWidth(this.fitDataColAvg);this.reinitialize(!1,!0)}}else this.table.options.layout==="fitColumns"&&(this.table.modules.layout.layout(),this.table.vdomHoz.reinitialize(!1,!0))};ee.prototype.fitDataLayoutOverride=function(){for(var t=this.leftCol;t<=this.rightCol;t++)this.columns[t].reinitializeWidth()};ee.prototype.reinitialize=function(t,o){var n=this,s={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol};if(!(t&&!this.initialized)){this.clear(),this.scrollLeft=this.holderEl.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.window,this.vDomScrollPosRight=this.scrollLeft+this.holderEl.clientWidth+this.window;var a=0;this.table.columnManager.columnsByIndex.forEach(function(r){var l={};if(r.visible){var u=r.getWidth();l.leftPos=a,l.rightPos=a+u,a+u>n.vDomScrollPosLeft&&a<n.vDomScrollPosRight?(n.leftCol==-1&&(n.leftCol=n.columns.length,n.vDomPadLeft=a),n.rightCol=n.columns.length):n.leftCol!==-1&&(n.vDomPadRight+=u),n.columns.push(r),r.modules.vdomHoz=l,a+=u}}),this.element.style.paddingLeft=this.vDomPadLeft+"px",this.element.style.paddingRight=this.vDomPadRight+"px",this.initialized=!0,o||(!t||this.reinitChanged(s))&&this.renitializeRows(),this.holderEl.scrollLeft=this.scrollLeft}};ee.prototype.reinitChanged=function(t){var o=this,n=!0;return t.cols.length!==this.columns.length||t.leftCol!==this.leftCol||t.rightCol!==this.rightCol?!0:(t.cols.forEach(function(s,a){s!==o.columns[a]&&(n=!1)}),!n)};ee.prototype.renitializeRows=function(){var t=this,o=this.table.rowManager.getVisibleRows();o.forEach(function(n){t.reinitializeRow(n,!0)})};ee.prototype.scroll=function(t){this.vDomScrollPosLeft+=t,this.vDomScrollPosRight+=t,t>this.holderEl.clientWidth*.8?this.reinitialize():t>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())};ee.prototype.colPositionAdjust=function(t,o,n){for(var s=t;s<o;s++){var a=this.columns[s];a.modules.vdomHoz.leftPos-=n,a.modules.vdomHoz.rightPos-=n}};ee.prototype.addColRight=function(){var t=this.columns[this.rightCol+1],o,n,s;t&&t.modules.vdomHoz.leftPos<=this.vDomScrollPosRight&&(o=this.table.rowManager.getVisibleRows(),o.forEach(function(a){if(a.type!=="group"){var r=a.getCell(t);a.getElement().appendChild(r.getElement()),r.cellRendered()}}),this.fitDataColAvg&&(n=t.getWidth(),n===this.fitDataColAvg&&(t.reinitializeWidth(),s=n-t.getWidth(),s&&(t.modules.vdomHoz.rightPos-=s,this.colPositionAdjust(this.rightCol+1,this.columns.length,s)))),this.rightCol++,this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=t.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.addColRight())};ee.prototype.addColLeft=function(){var t=this.columns[this.leftCol-1],o;if(t&&t.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){var o=this.table.rowManager.getVisibleRows();o.forEach(function(s){if(s.type!=="group"){var a=s.getCell(t);s.getElement().prepend(a.getElement()),a.cellRendered()}}),this.leftCol?this.vDomPadLeft-=t.getWidth():this.vDomPadLeft=0,this.element.style.paddingLeft=this.vDomPadLeft+"px",this.leftCol--,this.addColLeft()}};ee.prototype.removeColRight=function(o){var o=this.columns[this.rightCol],n;o&&o.modules.vdomHoz.leftPos>this.vDomScrollPosRight&&(n=this.table.rowManager.getVisibleRows(),o.modules.vdomHoz.visible=!1,n.forEach(function(s){if(s.type!=="group"){var a=s.getCell(o);s.getElement().removeChild(a.getElement())}}),this.vDomPadRight+=o.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.rightCol--,this.removeColRight())};ee.prototype.removeColLeft=function(){var t=this.columns[this.leftCol],o;t&&t.modules.vdomHoz.rightPos<this.vDomScrollPosLeft&&(o=this.table.rowManager.getVisibleRows(),o.forEach(function(n){if(n.type!=="group"){var s=n.getCell(t);n.getElement().removeChild(s.getElement())}}),this.vDomPadLeft+=t.getWidth(),this.element.style.paddingLeft=this.vDomPadLeft+"px",this.leftCol++,this.removeColLeft())};ee.prototype.initializeRow=function(t){if(t.type!=="group"){t.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};for(var o=this.leftCol;o<=this.rightCol;o++){var n=this.columns[o];if(n&&n.visible){var s=t.getCell(n);t.getElement().appendChild(s.getElement()),s.cellRendered()}}}};ee.prototype.reinitializeRow=function(t,o){if(t.type!=="group"&&(o||!t.modules.vdomHoz||t.modules.vdomHoz.leftCol!==this.leftCol||t.modules.vdomHoz.rightCol!==this.rightCol)){for(var n=t.getElement();n.firstChild;)n.removeChild(n.firstChild);this.initializeRow(t)}};var F=function(o){this._row=o};F.prototype.getData=function(t){return this._row.getData(t)};F.prototype.getElement=function(){return this._row.getElement()};F.prototype.getCells=function(){var t=[];
4return this._row.getCells().forEach(function(o){t.push(o.getComponent())}),t};F.prototype.getCell=function(t){var o=this._row.getCell(t);return o?o.getComponent():!1};F.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]};F.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)};F.prototype.delete=function(){return this._row.delete()};F.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)};F.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)};F.prototype.move=function(t,o){this._row.moveToRow(t,o)};F.prototype.update=function(t){return this._row.updateData(t)};F.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)};F.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)};F.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)};F.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)};F.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)};F.prototype._getSelf=function(){return this._row};F.prototype.validate=function(){return this._row.validate()};F.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)};F.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)};F.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){var t=this._row.table.modules.frozenRows.rows.indexOf(this._row);return t>-1}return!1};F.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)};F.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)};F.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)};F.prototype.getTreeParent=function(){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.getTreeParent(this._row):!1};F.prototype.getTreeChildren=function(){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.getTreeChildren(this._row,!0):!1};F.prototype.addTreeChild=function(t,o,n){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.addTreeChildRow(this._row,t,o,n):!1};F.prototype.reformat=function(){return this._row.reinitialize()};F.prototype.getGroup=function(){return this._row.getGroup().getComponent()};F.prototype.getTable=function(){return this._row.table};F.prototype.getNextRow=function(){var t=this._row.nextRow();return t&&t.getComponent()};F.prototype.getPrevRow=function(){var t=this._row.prevRow();return t&&t.getComponent()};var T=function(o,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"row";this.table=n.table,this.parent=n,this.data={},this.type=s,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.created=!1,this.setData(o)};T.prototype.create=function(){this.created||(this.created=!0,this.generateElement())};T.prototype.createElement=function(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t};T.prototype.getElement=function(){return this.create(),this.element};T.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)};T.prototype.generateElement=function(){var t=this,o,n,s;this.createElement(),t.table.options.selectable!==!1&&t.table.modExists("selectRow")&&t.table.modules.selectRow.initializeRow(this),t.table.options.movableRows!==!1&&t.table.modExists("moveRow")&&t.table.modules.moveRow.initializeRow(this),t.table.options.dataTree!==!1&&t.table.modExists("dataTree")&&t.table.modules.dataTree.initializeRow(this),t.table.options.responsiveLayout==="collapse"&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.initializeRow(this),(t.table.options.rowContextMenu||t.table.options.rowClickMenu)&&this.table.modExists("menu")&&t.table.modules.menu.initializeRow(this),t.table.options.rowClick&&t.element.addEventListener("click",function(a){t.table.options.rowClick(a,t.getComponent())}),t.table.options.rowDblClick&&t.element.addEventListener("dblclick",function(a){t.table.options.rowDblClick(a,t.getComponent())}),t.table.options.rowContext&&t.element.addEventListener("contextmenu",function(a){t.table.options.rowContext(a,t.getComponent())}),t.table.options.rowMouseEnter&&t.element.addEventListener("mouseenter",function(a){t.table.options.rowMouseEnter(a,t.getComponent())}),t.table.options.rowMouseLeave&&t.element.addEventListener("mouseleave",function(a){t.table.options.rowMouseLeave(a,t.getComponent())}),t.table.options.rowMouseOver&&t.element.addEventListener("mouseover",function(a){t.table.options.rowMouseOver(a,t.getComponent())}),t.table.options.rowMouseOut&&t.element.addEventListener("mouseout",function(a){t.table.options.rowMouseOut(a,t.getComponent())}),t.table.options.rowMouseMove&&t.element.addEventListener("mousemove",function(a){t.table.options.rowMouseMove(a,t.getComponent())}),t.table.options.rowTap&&(s=!1,t.element.addEventListener("touchstart",function(a){s=!0},{passive:!0}),t.element.addEventListener("touchend",function(a){s&&t.table.options.rowTap(a,t.getComponent()),s=!1})),t.table.options.rowDblTap&&(o=null,t.element.addEventListener("touchend",function(a){o?(clearTimeout(o),o=null,t.table.options.rowDblTap(a,t.getComponent())):o=setTimeout(function(){clearTimeout(o),o=null},300)})),t.table.options.rowTapHold&&(n=null,t.element.addEventListener("touchstart",function(a){clearTimeout(n),n=setTimeout(function(){clearTimeout(n),n=null,s=!1,t.table.options.rowTapHold(a,t.getComponent())},1e3)},{passive:!0}),t.element.addEventListener("touchend",function(a){clearTimeout(n),n=null}))};T.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)};T.prototype.initialize=function(t){var o=this;if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),this.table.o
4ptions.virtualDomHoz&&this.table.vdomHoz.initialized?this.table.vdomHoz.initializeRow(this):this.cells.forEach(function(n){o.element.appendChild(n.getElement()),n.cellRendered()}),t&&this.normalizeHeight(),this.table.options.dataTree&&this.table.modExists("dataTree")&&this.table.modules.dataTree.layoutRow(this),this.table.options.responsiveLayout==="collapse"&&this.table.modExists("responsiveLayout")&&this.table.modules.responsiveLayout.layoutRow(this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.table.options.resizableRows&&this.table.modExists("resizeRows")&&this.table.modules.resizeRows.initializeRow(this),this.initialized=!0}else this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitializeRow(this)};T.prototype.reinitializeHeight=function(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)};T.prototype.reinitialize=function(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.getTreeChildren(this,!1,!0).forEach(function(o){o.reinitialize(!0)})};T.prototype.calcHeight=function(t){var o=0,n=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(s){var a=s.getHeight();a>o&&(o=a)}),t?this.height=Math.max(o,n):this.height=this.manualHeight?this.height:Math.max(o,n),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight};T.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0};T.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})};T.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()};T.prototype.setHeight=function(t,o){(this.height!=t||o)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)};T.prototype.getHeight=function(){return this.outerHeight};T.prototype.getWidth=function(){return this.element.offsetWidth};T.prototype.deleteCell=function(t){var o=this.cells.indexOf(t);o>-1&&this.cells.splice(o,1)};T.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)};T.prototype.updateData=function(t){var o=this,n=this.element&&p.prototype.helpers.elVisible(this.element),s={},a;return new Promise(function(r,l){typeof t=="string"&&(t=JSON.parse(t)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(s=Object.assign(s,o.data),s=Object.assign(s,t),a=o.table.modules.mutator.transformRow(s,"data",t)):a=t;for(var u in a)o.data[u]=a[u];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var u in t){var d=o.table.columnManager.getColumnsByFieldRoot(u);d.forEach(function(h){var m=o.getCell(h.getField());if(m){var f=h.getFieldValue(a);m.getValue()!=f&&(m.setValueProcessData(f),n&&m.cellRendered())}})}o.table.options.groupUpdateOnCellEdit&&o.table.options.groupBy&&o.table.modExists("groupRows")&&o.table.modules.groupRows.reassignRowToGroup(o.row),n?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),o.table.options.dataTree!==!1&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(t)&&(o.table.modules.dataTree.initializeRow(o),n&&(o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0))),o.table.options.rowUpdated.call(o.table,o.getComponent()),o.table.options.dataChanged&&o.table.options.dataChanged.call(o.table,o.table.rowManager.getData()),r()})};T.prototype.getData=function(t){return t&&this.table.modExists("accessor")?this.table.modules.accessor.transformRow(this,t):this.data};T.prototype.getCell=function(t){var o=!1;return t=this.table.columnManager.findColumn(t),o=this.cells.find(function(n){return n.column===t}),o};T.prototype.getCellIndex=function(t){return this.cells.findIndex(function(o){return o===t})};T.prototype.findNextEditableCell=function(t){var o=!1;if(t<this.cells.length-1)for(var n=t+1;n<this.cells.length;n++){var s=this.cells[n];if(s.column.modules.edit&&p.prototype.helpers.elVisible(s.getElement())){var a=!0;
4if(typeof s.column.modules.edit.check=="function"&&(a=s.column.modules.edit.check(s.getComponent())),a){o=s;break}}}return o};T.prototype.findPrevEditableCell=function(t){var o=!1;if(t>0)for(var n=t-1;n>=0;n--){var s=this.cells[n],a=!0;if(s.column.modules.edit&&p.prototype.helpers.elVisible(s.getElement())&&(typeof s.column.modules.edit.check=="function"&&(a=s.column.modules.edit.check(s.getComponent())),a)){o=s;break}}return o};T.prototype.getCells=function(){return this.cells};T.prototype.nextRow=function(){var t=this.table.rowManager.nextDisplayRow(this,!0);return t||!1};T.prototype.prevRow=function(){var t=this.table.rowManager.prevDisplayRow(this,!0);return t||!1};T.prototype.moveToRow=function(t,o){var n=this.table.rowManager.findRow(t);n?(this.table.rowManager.moveRowActual(this,n,!o),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)};T.prototype.validate=function(){var t=[];return this.cells.forEach(function(o){o.validate()||t.push(o.getComponent())}),t.length?t:!0};T.prototype.delete=function(){var t=this;return new Promise(function(o,n){var s,a;t.table.options.history&&t.table.modExists("history")&&(t.table.options.groupBy&&t.table.modExists("groupRows")?(a=t.getGroup().rows,s=a.indexOf(t),s&&(s=a[s-1])):(s=t.table.rowManager.getRowIndex(t),s&&(s=t.table.rowManager.rows[s-1])),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!s,index:s})),t.deleteActual(),o()})};T.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this),this.detatchModules(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.rowDelete(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))};T.prototype.detatchModules=function(){this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.modExists("frozenRows")&&this.table.modules.frozenRows.detachRow(this)};T.prototype.deleteCells=function(){for(var t=this.cells.length,o=0;o<t;o++)this.cells[0].delete()};T.prototype.wipe=function(){if(this.detatchModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}};T.prototype.getGroup=function(){return this.modules.group||!1};T.prototype.getComponent=function(){return this.component||(this.component=new F(this)),this.component};var U=function(o){this._cell=o};U.prototype.getValue=function(){return this._cell.getValue()};U.prototype.getOldValue=function(){return this._cell.getOldValue()};U.prototype.getInitialValue=function(){return this._cell.initialValue};U.prototype.getElement=function(){return this._cell.getElement()};U.prototype.getRow=function(){return this._cell.row.getComponent()};U.prototype.getData=function(){return this._cell.row.getData()};U.prototype.getField=function(){return this._cell.column.getField()};U.prototype.getColumn=function(){return this._cell.column.getComponent()};U.prototype.setValue=function(t,o){typeof o>"u"&&(o=!0),this._cell.setValue(t,o)};U.prototype.restoreOldValue=function(){this._cell.setValueActual(this._cell.getOldValue())};U.prototype.restoreInitialValue=function(){this._cell.setValueActual(this._cell.initialValue)};U.prototype.edit=function(t){return this._cell.edit(t)};U.prototype.cancelEdit=function(){this._cell.cancelEdit()};U.prototype.isEdited=function(){return!!this._cell.modules.edit&&this._cell.modules.edit.edited};U.prototype.clearEdited=function(){self.table.modExists("edit",!0)&&this._cell.table.modules.edit.clearEdited(this._cell)};
4U.prototype.isValid=function(){return this._cell.modules.validate?!this._cell.modules.validate.invalid:!0};U.prototype.validate=function(){return this._cell.validate()};U.prototype.clearValidation=function(){this._cell.table.modExists("validate",!0)&&this._cell.table.modules.validate.clearValidation(this._cell)};U.prototype.nav=function(){return this._cell.nav()};U.prototype.checkHeight=function(){this._cell.checkHeight()};U.prototype.getTable=function(){return this._cell.table};U.prototype._getSelf=function(){return this._cell};var A=function(o,n){this.table=o.table,this.column=o,this.row=n,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()};A.prototype.build=function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value};A.prototype.generateElement=function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element};A.prototype._configureCell=function(){var t=this,o=t.column.cellEvents,n=t.element,s=this.column.getField(),a={top:"flex-start",bottom:"flex-end",middle:"center"},r={left:"flex-start",right:"flex-end",center:"center"};if(n.style.textAlign=t.column.hozAlign,t.column.vertAlign&&(n.style.display="inline-flex",n.style.alignItems=a[t.column.vertAlign]||"",t.column.hozAlign&&(n.style.justifyContent=r[t.column.hozAlign]||"")),s&&n.setAttribute("tabulator-field",s),t.column.definition.cssClass){var l=t.column.definition.cssClass.split(" ");l.forEach(function(u){n.classList.add(u)})}this.table.options.tooltipGenerationMode==="hover"&&n.addEventListener("mouseenter",function(u){t._generateTooltip()}),t._bindClickEvents(o),t._bindTouchEvents(o),t._bindMouseEvents(o),t.column.modules.edit&&t.table.modules.edit.bindEditor(t),t.column.definition.rowHandle&&t.table.options.movableRows!==!1&&t.table.modExists("moveRow")&&t.table.modules.moveRow.initializeCell(t),t.column.visible||t.hide()};A.prototype._bindClickEvents=function(t){var o=this,n=o.element;(t.cellClick||o.table.options.cellClick)&&n.addEventListener("click",function(s){var a=o.getComponent();t.cellClick&&t.cellClick.call(o.table,s,a),o.table.options.cellClick&&o.table.options.cellClick.call(o.table,s,a)}),t.cellDblClick||this.table.options.cellDblClick?n.addEventListener("dblclick",function(s){var a=o.getComponent();t.cellDblClick&&t.cellDblClick.call(o.table,s,a),o.table.options.cellDblClick&&o.table.options.cellDblClick.call(o.table,s,a)}):n.addEventListener("dblclick",function(s){if(!(o.table.modExists("edit")&&o.table.modules.edit.currentCell===o)){s.preventDefault();try{if(document.selection){var a=document.body.createTextRange();a.moveToElementText(o.element),a.select()}else if(window.getSelection){var a=document.createRange();a.selectNode(o.element),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}}catch{}}}),(t.cellContext||this.table.options.cellContext)&&n.addEventListener("contextmenu",function(s){var a=o.getComponent();t.cellContext&&t.cellContext.call(o.table,s,a),o.table.options.cellContext&&o.table.options.cellContext.call(o.table,s,a)})};A.prototype._bindMouseEvents=function(t){var o=this,n=o.element;(t.cellMouseEnter||o.table.options.cellMouseEnter)&&n.addEventListener("mouseenter",function(s){var a=o.getComponent();t.cellMouseEnter&&t.cellMouseEnter.call(o.table,s,a),o.table.options.cellMouseEnter&&o.table.options.cellMouseEnter.call(o.table,s,a)}),(t.cellMouseLeave||o.table.options.cellMouseLeave)&&n.addEventListener("mouseleave",function(s){var a=o.getComponent();t.cellMouseLeave&&t.cellMouseLeave.call(o.table,s,a),o.table.options.cellMouseLeave&&o.table.options.cellMouseLeave.call(o.table,s,a)}),(t.cellMouseOver||o.table.options.cellMouseOver)&&n.addEventListener("mouseover",function(s){var a=o.getComponent();t.cellMouseOver&&t.cellMouseOver.call(o.table,s,a),o.table.options.cellMouseOver&&o.table.o
4ptions.cellMouseOver.call(o.table,s,a)}),(t.cellMouseOut||o.table.options.cellMouseOut)&&n.addEventListener("mouseout",function(s){var a=o.getComponent();t.cellMouseOut&&t.cellMouseOut.call(o.table,s,a),o.table.options.cellMouseOut&&o.table.options.cellMouseOut.call(o.table,s,a)}),(t.cellMouseMove||o.table.options.cellMouseMove)&&n.addEventListener("mousemove",function(s){var a=o.getComponent();t.cellMouseMove&&t.cellMouseMove.call(o.table,s,a),o.table.options.cellMouseMove&&o.table.options.cellMouseMove.call(o.table,s,a)})};A.prototype._bindTouchEvents=function(t){var o=this,n=o.element,s,a,r;(t.cellTap||this.table.options.cellTap)&&(r=!1,n.addEventListener("touchstart",function(l){r=!0},{passive:!0}),n.addEventListener("touchend",function(l){if(r){var u=o.getComponent();t.cellTap&&t.cellTap.call(o.table,l,u),o.table.options.cellTap&&o.table.options.cellTap.call(o.table,l,u)}r=!1})),(t.cellDblTap||this.table.options.cellDblTap)&&(s=null,n.addEventListener("touchend",function(l){if(s){clearTimeout(s),s=null;var u=o.getComponent();t.cellDblTap&&t.cellDblTap.call(o.table,l,u),o.table.options.cellDblTap&&o.table.options.cellDblTap.call(o.table,l,u)}else s=setTimeout(function(){clearTimeout(s),s=null},300)})),(t.cellTapHold||this.table.options.cellTapHold)&&(a=null,n.addEventListener("touchstart",function(l){clearTimeout(a),a=setTimeout(function(){clearTimeout(a),a=null,r=!1;var u=o.getComponent();t.cellTapHold&&t.cellTapHold.call(o.table,l,u),o.table.options.cellTapHold&&o.table.options.cellTapHold.call(o.table,l,u)},1e3)},{passive:!0}),n.addEventListener("touchend",function(l){clearTimeout(a),a=null}))};A.prototype._generateContents=function(){var t;switch(this.table.modExists("format")?t=this.table.modules.format.formatValue(this):t=this.element.innerHTML=this.value,typeof t>"u"?"undefined":E(t)){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",t!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=t}};A.prototype.cellRendered=function(){this.table.modExists("format")&&this.table.modules.format.cellRendered&&this.table.modules.format.cellRendered(this)};A.prototype._generateTooltip=function(){var t=this.column.tooltip;t?(t===!0?t=this.value:typeof t=="function"&&(t=t(this.getComponent()),t===!1&&(t="")),typeof t>"u"&&(t=""),this.element.setAttribute("title",t)):this.element.setAttribute("title","")};A.prototype.getElement=function(t){return this.loaded||(this.loaded=!0,t||this.layoutElement()),this.element};A.prototype.getValue=function(){return this.value};A.prototype.getOldValue=function(){return this.oldValue};A.prototype.setValue=function(t,o){var n=this.setValueProcessData(t,o),s;n&&(this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("cellEdit",this,{oldValue:this.oldValue,newValue:this.value}),s=this.getComponent(),this.column.cellEvents.cellEdited&&this.column.cellEvents.cellEdited.call(this.table,s),this.table.options.groupUpdateOnCellEdit&&this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.reassignRowToGroup(this.row),this.cellRendered(),this.table.options.cellEdited.call(this.table,s),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.table.rowManager.getData()))};A.prototype.setValueProcessData=function(t,o){var n=!1;return this.value!=t&&(n=!0,o&&this.column.modules.mutate&&(t=this.table.modules.mutator.transformCell(this,t))),this.setValueActual(t),n&&this.table.modExists("columnCalcs")&&(this.column.definition.topCalc||this.column.definition.bottomCalc)&&(this.table.options.groupBy&&this.table.modExists("groupRows")?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),this.table.o
4ptions.columnCalcs!="table"&&this.table.modules.columnCalcs.recalcRowGroup(this.row)):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows)),n};A.prototype.setValueActual=function(t){this.oldValue=this.value,this.value=t,this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.block(),this.column.setFieldValue(this.row.data,t),this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.unblock(),this.loaded&&this.layoutElement()};A.prototype.layoutElement=function(){this._generateContents(),this._generateTooltip(),this.table.options.resizableColumns&&this.table.modExists("resizeColumns")&&this.row.type==="row"&&this.table.modules.resizeColumns.initializeColumn("cell",this.column,this.element),(this.column.definition.contextMenu||this.column.definition.clickMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeCell(this),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutElement(this.element,this.column)};A.prototype.setWidth=function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled};A.prototype.clearWidth=function(){this.width="",this.element.style.width=""};A.prototype.getWidth=function(){return this.width||this.element.offsetWidth};A.prototype.setMinWidth=function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled};A.prototype.setMaxWidth=function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled};A.prototype.checkHeight=function(){this.row.reinitializeHeight()};A.prototype.clearHeight=function(){this.element.style.height="",this.height=null};A.prototype.setHeight=function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled};A.prototype.getHeight=function(){return this.height||this.element.offsetHeight};A.prototype.show=function(){this.element.style.display=this.column.vertAlign?"inline-flex":""};A.prototype.hide=function(){this.element.style.display="none"};A.prototype.edit=function(t){if(this.table.modExists("edit",!0))return this.table.modules.edit.editCell(this,t)};A.prototype.cancelEdit=function(){if(this.table.modExists("edit",!0)){var t=this.table.modules.edit.getCurrentCell();t&&t._getSelf()===this?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}};
4A.prototype.validate=function(){if(this.column.modules.validate&&this.table.modExists("validate",!0)){var t=this.table.modules.validate.validate(this.column.modules.validate,this,this.getValue());return t===!0}else return!0};A.prototype.delete=function(){!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.modules.validate&&this.modules.validate.invalid&&this.table.modules.validate.clearValidation(this),this.modules.edit&&this.modules.edit.edited&&this.table.modules.edit.clearEdited(this),this.table.options.history&&this.table.modules.history.clearComponentHistory(this),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}};A.prototype.nav=function(){var t=this,o=!1,n=this.row.getCellIndex(this);return{next:function(){var a=this.right(),r;return a?!0:(r=t.table.rowManager.nextDisplayRow(t.row,!0),r&&(a=r.findNextEditableCell(-1),a)?(a.edit(),!0):!1)},prev:function(){var a=this.left(),r;return a?!0:(r=t.table.rowManager.prevDisplayRow(t.row,!0),r&&(a=r.findPrevEditableCell(r.cells.length),a)?(a.edit(),!0):!1)},left:function(){return o=t.row.findPrevEditableCell(n),o?(o.edit(),!0):!1},right:function(){return o=t.row.findNextEditableCell(n),o?(o.edit(),!0):!1},up:function(){var a=t.table.rowManager.prevDisplayRow(t.row,!0);a&&a.cells[n].edit()},down:function(){var a=t.table.rowManager.nextDisplayRow(t.row,!0);a&&a.cells[n].edit()}}};A.prototype.getIndex=function(){this.row.getCellIndex(this)};A.prototype.getComponent=function(){return this.component||(this.component=new U(this)),this.component};var Ee=function(o){this.table=o,this.active=!1,this.element=this.createElement(),this.external=!1,this.links=[],this._initialize()};Ee.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-footer"),t};Ee.prototype._initialize=function(t){if(this.table.options.footerElement)switch(E(this.table.options.footerElement)){case"string":this.table.options.footerElement[0]==="<"?this.element.innerHTML=this.table.options.footerElement:(this.external=!0,this.element=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}};Ee.prototype.getElement=function(){return this.element};Ee.prototype.append=function(t,o){this.activate(o),this.element.appendChild(t),this.table.rowManager.adjustTableSize()};Ee.prototype.prepend=function(t,o){this.activate(o),this.element.insertBefore(t,this.element.firstChild),this.table.rowManager.adjustTableSize()};Ee.prototype.remove=function(t){t.parentNode.removeChild(t),this.deactivate()};Ee.prototype.deactivate=function(t){(!this.element.firstChild||t)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)};Ee.prototype.activate=function(t){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display="")),t&&this.links.push(t)};Ee.prototype.redraw=function(){this.links.forEach(function(t){t.footerRedraw()})};var p=function t(o,n){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.vdomHoz=null,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.modules={},this.initializeElement(o)&&(this.initializeOptions(n||{}),this._create()),t.prototype.comms.register(this)};p.prototype.defaultOptions={height:!1,minHeight:!1,maxHeight:!1,layout:"fitData",layoutColumnsOnNewData:!1,columnMinWidth:40,columnMaxWidth:!1,columnHeaderVertAlign:"top",columnVertAlign:!1,resizableColumns:!0,resizableRows:!1,autoResize:!0,columns:[],cellHozAlign:"",cellVertAlign:"",headerHozAlign:"",data:[],autoColumns:!1,autoColumnsDefinitions:!1,reactiveData:!1,nestedFieldSeparator:".",tooltips:!1,tooltipsHeader:!1,tooltipGenerationMode:"load",initialSort:!1,initialFilter:!1,initialHeaderFilter:!1,columnHeaderSortMulti:!0,sortOrderReverse:!1,headerSort:!0,headerSortTristate:!1,headerSortElement:"<div class='tabulator-arrow'></div>",footerElement:!1,index:"id",textDirection:"auto",keybindings:[],tabEndNewRow:!1,invalidOptionWarnings:!0,clipboard:!1,clipboardCopyStyled:!0,clipboardCopyConfig:!1,clipboardCopyFormatter:!1,clipboardCopyRowRange:"active",clipboardPasteParser:"table",clipboardPasteAction:"insert",clipboardCopied:function(){},clipboardPasted:function(){},clipboardPasteError:function(){},downloadDataFormatter:!1,downloadReady:function(o,n){return n},downloadComplete:!1,downloadConfig:{},downloadRowRange:"active",dataTree:!1,dataTreeFilter:!0,dataTreeSort:!0,dataTreeElementColumn:!1,dataTreeBranchElement:!0,dataTreeChildIndent:9,dataTreeChildField:"_children",dataTreeCollapseElement:!1,dataTreeExpandElement:!1,dataTreeStartExpanded:!1,dataTreeRowExpanded:function(){},dataTreeRowCollapsed:function(){},dataTreeChildColumnCalcs:!1,dataTreeSelectPropagate:!1,printAsHtml:!1,printFormatter:!1,printHeader:!1,printFooter:!1,printCopyStyle:!0,printStyled:!0,printVisibleRows:!0,printRowRange:"visible",printConfig:{},addRowPos:"bottom",selectable:"highlight",selectableRangeMode:"drag",selectableRollingSelection:!0,selectablePersistence:!0,selectableCheck:function(o,n){return!0},headerFilterLiveFilterDelay:300,headerFilterPlaceholder:!1,headerVisible:!0,history:!1,locale:!1,langs:{},virtualDom:!0,virtualDomBuffer:0,virtualDomHoz:!1,persistentLayout:!1,persistentSort:!1,persistentFilter:!1,persistenceID:"",persistenceMode:!0,persistenceReaderFunc:!1,persistenceWriterFunc:!1,persistence:!1,responsiveLayout:!1,responsiveLayoutCollapseStartOpen:!0,responsiveLayoutCollapseUseFormatters:!0,responsiveLayoutCollapseFormatter:!1,pagination:!1,paginationSize:!1,paginationInitialPage:1,paginationButtonCount:5,paginationSizeSelector:!1,paginationElement:!1,paginationDataSent:{},paginationDataReceived:{},paginationAddRow:"page",ajaxURL:!1,ajaxURLGenerator:!1,ajaxParams:{},ajaxConfig:"get",ajaxContentType:"form",ajaxRequestFunc:!1,ajaxLoader:!0,ajaxLoaderLoading:!1,ajaxLoaderError:!1,ajaxFiltering:!1,ajaxSorting:!1,ajaxProgressiveLoad:!1,ajaxProgressiveLoadDelay:0,ajaxProgressiveLoadScrollMargin:0,groupBy:!1,groupStartOpen:!0,groupValues:!1,groupUpdateOnCellEdit:!1,groupHeader:!1,groupHeaderPrint:null,groupHeaderClipboard:null,groupHeaderHtmlOutput:null,groupHeaderDownload:null,htmlOutputConfig:!1,movableColumns:!1,movableRows:!1,movableRowsConnectedTables:!1,movableRowsConnectedElements:!1,movableRowsSender:!1,movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},movableRowsElementDrop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowMouseEnter:!1,rowMouseLeave:!1,rowMouseOver:!1,rowMouseOut:!1,rowMouseMove:!1,rowContextMenu:!1,rowClickMenu:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:!1,dataChanged:!1,ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupContextMenu:!1,groupClickMenu:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationMode:"blocking",validationFailed:function(){},historyUndo:function(){},historyRedo:function(){},scrollHorizontal:function(){},scrollVertical:function(){}};
4p.prototype.initializeOptions=function(t){if(t.invalidOptionWarnings!==!1)for(var o in t)typeof this.defaultOptions[o]>"u"&&console.warn("Invalid table constructor option:",o);for(var o in this.defaultOptions)o in t?this.options[o]=t[o]:Array.isArray(this.defaultOptions[o])?this.options[o]=Object.assign([],this.defaultOptions[o]):E(this.defaultOptions[o])==="object"&&this.defaultOptions[o]!==null?this.options[o]=Object.assign({},this.defaultOptions[o]):this.options[o]=this.defaultOptions[o]};p.prototype.initializeElement=function(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement?(this.element=t,!0):typeof t=="string"?(this.element=document.querySelector(t),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)};p.prototype.rtlCheck=function(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(t.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}};p.prototype._mapDepricatedFunctionality=function(){(this.options.persistentLayout||this.options.persistentSort||this.options.persistentFilter)&&(this.options.persistence||(this.options.persistence={})),this.options.dataEdited&&(console.warn("DEPRECATION WARNING - dataEdited option has been deprecated, please use the dataChanged option instead"),this.options.dataChanged=this.options.dataEdited),this.options.downloadDataFormatter&&console.warn("DEPRECATION WARNING - downloadDataFormatter option has been deprecated"),typeof this.options.clipboardCopyHeader<"u"&&(this.options.columnHeaders=this.options.clipboardCopyHeader,console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option")),this.options.printVisibleRows!==!0&&(console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"),this.options.persistence.printRowRange="active"),this.options.printCopyStyle!==!0&&(console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"),this.options.persistence.printStyled=this.options.printCopyStyle),this.options.persistentLayout&&(console.warn("persistentLayout option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.columns>"u"&&(this.options.persistence.columns=!0)),this.options.persistentSort&&(console.warn("persistentSort option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.sort>"u"&&(this.options.persistence.sort=!0)),this.options.persistentFilter&&(console.warn("persistentFilter option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.filter>"u"&&(this.options.persistence.filter=!0)),this.options.columnVertAlign&&(console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"),this.options.columnHeaderVertAlign=this.options.columnVertAlign)};p.prototype._clearSelection=function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")};p.prototype._create=function(){this._clearObjectPointers(),this._mapDepricatedFunctionality(),this.bindModules(),this.rtlCheck(),this.element.tagName==="TABLE"&&this.modExists("htmlTableImport",!0)&&this.modules.htmlTableImport.parseTable(),this.columnManager=new H(this),this.rowManager=new C(this),this.footerManager=new Ee(this),this.columnManager.setRowManager(this.rowManager),this.rowManager.setColumnManager(this.columnManager),this.options.virtualDomHoz&&(this.vdomHoz=new ee(this)),this._buildElement(),this._loadInitialData()};p.prototype._clearObjectPointers=function(){this.options.columns=this.options.columns.slice(0),this.options.reactiveData||(this.options.data=this.options.data.slice(0))};p.prototype._buildElement=function(){var t=this,o=this.element,n=this.modules,s=this.options;for(s.tableBuilding.call(this),o.classList.add("tabulator"),o.setAttribute("role","grid");o.firstChild;)o.removeChild(o.firstChild);s.height&&(s.height=isNaN(s.height)?s.height:s.height+"px",o.style.height=s.height),s.minHeight!==!1&&(s.minHeight=isNaN(s.minHeight)?s.minHeight:s.minHeight+"px",o.style.minHeight=s.minHeight),s.maxHeight!==!1&&(s.maxHeight=isNaN(s.maxHeight)?s.maxHeight:s.maxHeight+"px",o.style.maxHeight=s.maxHeight),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&n.layout.initialize(s.layout),n.localize.initialize(),s.headerFilterPlaceholder!==!1&&n.localize.setHeaderFilterPlaceholder(s.headerFilterPlaceholder);for(var a in s.langs)n.localize.installLang(a,s.langs[a]);if(n.localize.setLocale(s.locale),typeof s.placeholder=="string"){var r=document.createElement("div");r.classList.add("tabulator-placeholder");var l=document.createElement("span");l.innerHTML=s.placeholder,r.appendChild(l),s.placeholder=r}if(o.appendChild(this.columnManager.getElement()),o.appendChild(this.rowManager.getElement()),s.footerElement&&this.footerManager.activate(),s.persistence&&this.modExists("persistence",!0)&&n.persistence.initialize(),s.movableRows&&this.modExists("moveRow")&&n.moveRow.initialize(),s.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&n.columnCalcs.initialize(),this.columnManager.setColumns(s.columns),s.dataTree&&this.modExists("dataTree",!0)&&n.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.sort||s.initialSort)&&this.modExists("sort",!0)){var u=[];s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.sort?(u=n.persistence.load("sort"),u===!1&&s.initialSort&&(u=s.initialSort)):s.initialSort&&(u=s.initialSort),n.sort.setSort(u)}if((s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.filter||s.initialFilter)&&this.modExists("filter",!0)){var d=[];s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.filter?(d=n.persistence.load("filter"),d===!1&&s.initialFilter&&(d=s.initialFilter)):s.initialFilter&&(d=s.initialFilter),n.filter.setFilter(d)}s.initialHeaderFilter&&this.modExists("filter",!0)&&s.initialHeaderFilter.forEach(function(c){var h=t.columnManager.findColumn(c.field);if(h)n.filter.setHeaderFilterValue(h,c.value);else return console.warn("Column Filter Error - No matching column found:",c.field),!1}),this.modExists("ajax")&&n.ajax.initialize(),s.pagination&&this.modExists("page",!0)&&n.page.initialize(),s.groupBy&&this.modExists("groupRows",!0)&&n.groupRows.initialize(),this.modExists("keybindings")&&n.keybindings.initialize(),this.modExists("selectRow")&&n.selectRow.clearSelectionData(!0),s.autoResize&&this.modExists("resizeTable")&&n.resizeTable.initialize(),this.modExists("clipboard")&&n.clipboard.initialize(),s.printAsHtml&&this.modExists("print")&&n.print.initialize(),s.tableBuilt.call(this)};p.prototype._loadInitialData=function(){var t=this;if(t.options.pagination&&t.modExists("page"))if(t.modules.page.reset(!0,!0),t.options.pagination=="local"){if(t.options.data.length)t.rowManager.setData(t.options.data,!1,!0);else if((t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax")){t.modules.ajax.loadD
4ata(!1,!0).then(function(){}).catch(function(){t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)});return}else t.rowManager.setData(t.options.data,!1,!0);t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)}else t.options.ajaxURL?t.modules.page.setPage(t.options.paginationInitialPage).then(function(){}).catch(function(){}):t.rowManager.setData([],!1,!0);else t.options.data.length?t.rowManager.setData(t.options.data):(t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax")?t.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){}):t.rowManager.setData(t.options.data,!1,!0)};p.prototype.destroy=function(){var t=this.element;for(p.prototype.comms.deregister(this),this.options.reactiveData&&this.modExists("reactiveData",!0)&&this.modules.reactiveData.unwatchData(),this.rowManager.rows.forEach(function(o){o.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.modExists("resizeTable")&&this.modules.resizeTable.clearBindings(),this.modExists("keybindings")&&this.modules.keybindings.clearBindings();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator")};p.prototype._detectBrowser=function(){var t=navigator.userAgent||navigator.vendor||window.opera;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))};p.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()};p.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()};p.prototype.setDataFromLocalFile=function(t){var o=this;return new Promise(function(n,s){var a=document.createElement("input");a.type="file",a.accept=t||".json,application/json",a.addEventListener("change",function(r){var l=a.files[0],u=new FileReader,d;u.readAsText(l),u.onload=function(c){try{d=JSON.parse(u.result)}catch(h){console.warn("File Load Error - File contents is invali
4d JSON",h),s(h);return}o.setData(d).then(function(h){n(h)}).catch(function(h){n(h)})},u.onerror=function(c){console.warn("File Load Error - Unable to read file"),s()}}),a.click()})};p.prototype.setData=function(t,o,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,o,n,!1,!0)};p.prototype._setData=function(t,o,n,s,a){var r=this;if(typeof t=="string"){if(t.indexOf("{")==0||t.indexOf("[")==0)return r.rowManager.setData(JSON.parse(t),s,a);if(r.modExists("ajax",!0))return o&&r.modules.ajax.setParams(o),n&&r.modules.ajax.setConfig(n),r.modules.ajax.setUrl(t),r.options.pagination=="remote"&&r.modExists("page",!0)?(r.modules.page.reset(!0,!0),r.modules.page.setPage(1)):r.modules.ajax.loadData(s,a)}else return t?r.rowManager.setData(t,s,a):r.modExists("ajax")&&(r.modules.ajax.getUrl||r.options.ajaxURLGenerator)?r.options.pagination=="remote"&&r.modExists("page",!0)?(r.modules.page.reset(!0,!0),r.modules.page.setPage(1)):r.modules.ajax.loadData(s,a):r.rowManager.setData([],s,a)};p.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()};p.prototype.getData=function(t){return t===!0&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getData(t)};p.prototype.getDataCount=function(t){return t===!0&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getDataCount(t)};p.prototype.searchRows=function(t,o,n){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,o,n)};p.prototype.searchData=function(t,o,n){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,o,n)};p.prototype.getHtml=function(t,o,n){if(this.modExists("export",!0))return this.modules.export.getHtml(t,o,n)};p.prototype.print=function(t,o,n){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,o,n)};p.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()};p.prototype.replaceData=function(t,o,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,o,n,!0)};p.prototype.updateData=function(t){var o=this,n=this,s=0;return new Promise(function(a,r){o.modExists("ajax")&&o.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?t.forEach(function(l){var u=n.rowManager.findRow(l[n.options.index]);u&&(s++,u.updateData(l).then(function(){s--,s||a()}))}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})};p.prototype.addData=function(t,o,n){var s=this;return new Promise(function(a,r){s.modExists("ajax")&&s.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?s.rowManager.addRows(t,o,n).then(function(l){var u=[];l.forEach(function(d){u.push(d.getComponent())}),a(u)}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})};p.prototype.updateOrAddData=function(t){var o=this,n=this,s=[],a=0;return new Promise(function(r,l){o.modExists("ajax")&&o.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?t.forEach(function(u){var d=n.rowManager.findRow(u[n.options.index]);a++,d?d.updateData(u).then(function(){a--,s.push(d.getComponent()),a||r(s)}):n.rowManager.addRows(u).then(function(c){a--,s.push(c[0].getComponent()),a||r(s)})}):(console.warn("Update Error - No data provided"),l("Update Error - No data provided"))})};p.prototype.getRow=function(t){var o=this.rowManager.findRow(t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)};p.prototype.getRowFromPosition=function(t,o){var n=this.rowManager.getRowFromPosition(t,o);return n?n.getComponent():(console.warn("Find Error - No matching row found:",t),!1)};p.prototype.deleteRow=function(t){var o=this;return new Promise(function(n,s){var a=o,r=0,l=0,u=[];function d(){r++,r==t.length&&l&&(a.rowManager.reRenderInPosition(),n())}Array.isArray(t)||(t=[t]),t.forEach(function(c){var h=o.rowManager.findRow(c,!0);h?u.push(h):(console.warn("Delete Error - No matching row found:",c),s("Delete Error - No matching row found"),d())}),u.sort(function(c,h){return o.rowManager.rows.indexOf(c)>o.rowManager.rows.indexOf(h)?1:-1}),u.forEach(function(c){c.delete().then(function(){l++,d()}).catch(function(h){d(),s(h)})})})};p.prototype.addRow=function(t,o,n){var s=this;return new Promise(function(a,r){typeof t=="string"&&(t=JSON.parse(t)),s.rowManager.addRows(t,o,n).then(function(l){s.modExists("columnCalcs")&&s.modules.columnCalcs.recalc(s.rowManager.activeRows),a(l[0].getComponent())})})};p.prototype.updateOrAddRow=function(t,o){var n=this;return new Promise(function(s,a){var r=n.rowManager.findRow(t);
4typeof o=="string"&&(o=JSON.parse(o)),r?r.updateData(o).then(function(){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),s(r.getComponent())}).catch(function(l){a(l)}):r=n.rowManager.addRows(o).then(function(l){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),s(l[0].getComponent())}).catch(function(l){a(l)})})};p.prototype.updateRow=function(t,o){var n=this;return new Promise(function(s,a){var r=n.rowManager.findRow(t);typeof o=="string"&&(o=JSON.parse(o)),r?r.updateData(o).then(function(){s(r.getComponent())}).catch(function(l){a(l)}):(console.warn("Update Error - No matching row found:",t),a("Update Error - No matching row found"))})};p.prototype.scrollToRow=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.rowManager.findRow(t);l?s.rowManager.scrollToRow(l,o,n).then(function(){a()}).catch(function(u){r(u)}):(console.warn("Scroll Error - No matching row found:",t),r("Scroll Error - No matching row found"))})};p.prototype.moveRow=function(t,o,n){var s=this.rowManager.findRow(t);s?s.moveToRow(o,n):console.warn("Move Error - No matching row found:",t)};p.prototype.getRows=function(t){return t===!0&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getComponents(t)};p.prototype.getRowPosition=function(t,o){var n=this.rowManager.findRow(t);return n?this.rowManager.getRowPosition(n,o):(console.warn("Position Error - No matching row found:",t),!1)};p.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)};p.prototype.setColumns=function(t){this.columnManager.setColumns(t)};p.prototype.getColumns=function(t){return this.columnManager.getComponents(t)};p.prototype.getColumn=function(t){var o=this.columnManager.findColumn(t);return o?o.getComponent():(console.warn("Find Error - No matching column found:",t),!1)};p.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()};p.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())};p.prototype.setColumnLayout=function(t){return this.modExists("persistence",!0)?(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0):!1};p.prototype.showColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update();else return console.warn("Column Show Error - No matching column found:",t),!1};p.prototype.hideColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update();else return console.warn("Column Hide Error - No matching column found:",t),!1};p.prototype.toggleColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.visible?o.hide():o.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1};p.prototype.addColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.columnManager.findColumn(n);s.columnManager.addColumn(t,o,l).then(function(u){a(u.getComponent())}).catch(function(u){r(u)})})};p.prototype.deleteColumn=function(t){var o=this;return new Promise(function(n,s){var a=o.columnManager.findColumn(t);a?a.delete().then(function(){n()}).catch(function(r){s(r)}):(console.warn("Column Delete Error - No matching column found:",t),s())})};p.prototype.updateColumnDefinition=function(t,o){var n=this;return new Promise(function(s,a){var r=n.columnManager.findColumn(t);r?r.updateDefinition(o).then(function(l){s(l)}).catch(function(l){a(l)}):(console.warn("Column Update Error - No matching column found:",t),a())})};p.prototype.moveColumn=function(t,o,n){var s=this.columnManager.findColumn(t),a=this.columnManager.findColumn(o);s?a?this.columnManager.moveColumn(s,a,n):console.warn("Move Error - No matching column found:",a):console.warn("Move Error - No matching column found:",t)};p.prototype.scrollToColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.columnManager.findColumn(t);l?s.columnManager.scrollToColumn(l,o,n).then(function(){a()}).catch(function(u){r(u)}):(console.warn("Scroll Error - No matching column found:",t),r("Scroll Error - No matching column found"))})};p.prototype.setLocale=function(t){this.modules.localize.setLocale(t)};p.prototype.getLocale=function(){return this.modules.localize.getLocale()};p.prototype.getLang=function(t){return this.modules.localize.getLang(t)};p.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)};p.prototype.setHeight=function(t){this.rowManager.renderMode!=="classic"?(this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")};p.prototype.setSort=function(t,o){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,o),this.rowManager.sorterRefresh())};p.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()};p.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())};p.prototype.setFilter=function(t,o,n,s){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,o,n,s),this.rowManager.filterRefresh())};p.prototype.refreshFilter=function(){this.modExists("filter",!0)&&this.rowManager.filterRefresh()};p.prototype.addFilter=function(t,o,n,s){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,o,n,s),this.rowManager.filterRefresh())};p.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)};p.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(o)this.modules.filter.setHeaderFilterFocus(o);else return console.warn("Column Filter Focus Error - No matching column found:",t),!1}};p.prototype.getHeaderFilterValue=function(t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(o)return this.modules.filter.getHeaderFilterValue(o);console.warn("Column Filter Error - No matching column found:",t)}};p.prototype.setHeaderFilterValue=function(t,o){if(this.modExists("filter",!0)){var n=this.columnManager.findColumn(t);if(n)this.modules.filter.setHeaderFilterValue(n,o);else return console.warn("Column Filter Error - No matching column found:",t),!1}};p.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()};p.prototype.removeFilter=function(t,o,n){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,o,n),this.rowManager.filterRefresh())};p.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())};p.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())};p.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&(t===!0&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),t="active"),this.modules.selectRow.selectRows(t))};p.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)};p.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)};p.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()};p.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()};p.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.val
4idate.getInvalidCells()};p.prototype.clearCellValidation=function(t){var o=this;this.modExists("validate",!0)&&(t||(t=this.modules.validate.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(function(n){o.modules.validate.clearValidation(n._getSelf())}))};p.prototype.validate=function(t){var o=[];return this.rowManager.rows.forEach(function(n){var s=n.validate();s!==!0&&(o=o.concat(s))}),o.length?o:!0};p.prototype.setMaxPage=function(t){if(this.options.pagination&&this.modExists("page"))this.modules.page.setMaxPage(t);else return!1};p.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(o,n){n()})};p.prototype.setPageToRow=function(t){var o=this;return new Promise(function(n,s){o.options.pagination&&o.modExists("page")?(t=o.rowManager.findRow(t),t?o.modules.page.setPageToRow(t).then(function(){n()}).catch(function(){s()}):s()):s()})};p.prototype.setPageSize=function(t){if(this.options.pagination&&this.modExists("page"))this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){});else return!1};p.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()};p.prototype.previousPage=function(){if(this.options.pagination&&this.modExists("page"))this.modules.page.previousPage();else return!1};p.prototype.nextPage=function(){if(this.options.pagination&&this.modExists("page"))this.modules.page.nextPage();else return!1};p.prototype.getPage=function(){return this.options.pagination&&this.modExists("page")?this.modules.page.getPage():!1};p.prototype.getPageMax=function(){return this.options.pagination&&this.modExists("page")?this.modules.page.getPageMax():!1};p.prototype.setGroupBy=function(t){if(this.modExists("groupRows",!0))this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group");else return!1};p.prototype.setGroupValues=function(t){if(this.modExists("groupRows",!0))this.options.groupValues=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group");else return!1};p.prototype.setGroupStartOpen=function(t){if(this.modExists("groupRows",!0))this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set");else return!1};p.prototype.setGroupHeader=function(t){if(this.modExists("groupRows",!0))this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set");else return!1};p.prototype.getGroups=function(t){return this.modExists("groupRows",!0)?this.modules.groupRows.getGroups(!0):!1};p.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()};p.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()};p.prototype.clearCellEdited=function(t){var o=this;this.modExists("edit",!0)&&(t||(t=this.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(function(n){o.modules.edit.clearEdited(n._getSelf())}))};p.prototype.getCalcResults=function(){return this.modExists("columnCalcs",!0)?this.modules.columnCalcs.getResults():!1};p.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)};p.prototype.navigatePrev=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?t.nav().prev():!1};p.prototype.navigateNext=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?t.nav().next():!1};p.prototype.navigateLeft=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().left()):!1};p.prototype.navigateRight=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().right()):!1};p.prototype.navigateUp=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().up()):!1};p.prototype.navigateDown=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().down()):!1};p.prototype.undo=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.undo():!1};p.prototype.redo=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.redo():!1};p.prototype.getHistoryUndoSize=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.getHistoryUndoSize():!1};p.prototype.getHistoryRedoSize=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.getHistoryRedoSize():!1};p.prototype.clearHistory=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.clear():!1};p.prototype.download=function(t,o,n,s){this.modExists("download",!0)&&this.modules.download.download(t,o,n,s)};p.prototype.downloadToTab=function(t,o,n,s){this.modExists("download",!0)&&this.modules.download.download(t,o,n,s,!0)};p.prototype.tableComms=function(t,o,n,s){this.modules.comms.receive(t,o,n,s)};p.prototype.moduleBindings={};p.prototype.extendModule=function(t,o,n){if(p.prototype.moduleBindings[t]){var s=p.prototype.moduleBindings[t].prototype[o];if(s)if((typeof n>"u"?"undefined":E(n))=="object")for(var a in n)s[a]=n[a];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",o)}else console.warn("Module Error - module does not exist:",t)};p.prototype.registerModule=function(t,o){p.prototype.moduleBindings[t]=o};p.prototype.bindModules=function(){this.modules={};for(var t in p.prototype.moduleBindings)this.modules[t]=new p.prototype.moduleBindings[t](this)};p.prototype.modExists=function(t,o){return this.modules[t]?!0:(o&&console.error("Tabulator Module Not Installed: "+t),!1)};p.prototype.helpers={elVisible:function(o){return!(o.offsetWidth<=0&&o.offsetHeight<=0)},elOffset:function(o){var n=o.getBoundingClientRect();return{top:n.top+window.pageYOffset-document.documentElement.clientTop,left:n.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(o){var n=Object.assign(Array.isArray(o)?[]:{},o);for(var s in o)o[s]!=null&&E(o[s])==="object"&&(o[s]instanceof Date?n[s]=new Date(o[s]):n[s]=this.deepClone(o[s]));return n}};p.prototype.comms={tables:[],register:function(o){p.prototype.comms.tables.push(o)},deregister:function(o){var n=p.prototype.comms.tables.indexOf(o);n>-1&&p.prototype.comms.tables.splice(n,1)},lookupTable:function(o,n){var s=[],a,r;
4if(typeof o=="string"){if(a=document.querySelectorAll(o),a.length)for(var l=0;l<a.length;l++)r=p.prototype.comms.matchElement(a[l]),r&&s.push(r)}else typeof HTMLElement<"u"&&o instanceof HTMLElement||o instanceof p?(r=p.prototype.comms.matchElement(o),r&&s.push(r)):Array.isArray(o)?o.forEach(function(u){s=s.concat(p.prototype.comms.lookupTable(u))}):n||console.warn("Table Connection Error - Invalid Selector",o);return s},matchElement:function(o){return p.prototype.comms.tables.find(function(n){return o instanceof p?n===o:n.element===o})}};p.prototype.findTable=function(t){var o=p.prototype.comms.lookupTable(t,!0);return Array.isArray(o)&&!o.length?!1:o};var Ne=function(o){this.table=o,this.mode=null};Ne.prototype.initialize=function(t){this.modes[t]?this.mode=t:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)};Ne.prototype.getMode=function(){return this.mode};Ne.prototype.layout=function(){this.modes[this.mode].call(this,this.table.columnManager.columnsByIndex),this.mode.indexOf("fitData")===0&&this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")};Ne.prototype.modes={fitData:function(o){this.table.options.virtualDomHoz?this.table.vdomHoz.fitDataLayoutOverride():o.forEach(function(n){n.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:function(o){o.forEach(function(n){n.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataTable:function(o){o.forEach(function(n){n.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataStretch:function(o){var n=this,s=0,a=this.table.rowManager.element.clientWidth,r=0,l=!1;o.forEach(function(u,d){u.widthFixed||u.reinitializeWidth(),(n.table.options.responsiveLayout?u.modules.responsive.visible:u.visible)&&(l=u),u.visible&&(s+=u.getWidth())}),l?(r=a-s+l.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(l.setWidth(0),this.table.modules.responsiveLayout.update()),r>0?l.setWidth(r):l.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(o){var n=this,s=n.table.element.clientWidth,a=0,r=0,l=0,u=0,d=[],c=[],h=0,m=0,w=0;function f(b){var y;return typeof b=="string"?b.indexOf("%")>-1?y=s/100*parseInt(b):y=parseInt(b):y=b,y}function g(b,y,x,M){var _=[],Y=0,Z=0,Q=0,ye=l,me=0,de=0,ge=[];function be(k){return x*(k.column.definition.widthGrow||1)}function De(k){return f(k.width)-x*(k.column.definition.widthShrink||0)}return b.forEach(function(k,Fe){var we=M?De(k):be(k);k.column.minWidth>=we?_.push(k):k.column.maxWidth&&k.column.maxWidth<we?(k.width=k.column.maxWidth,y-=k.column.maxWidth,ye-=M?k.column.definition.widthShrink||1:k.column.definition.widthGrow||1,ye&&(x=Math.floor(y/ye))):(ge.push(k),de+=M?k.column.definition.widthShrink||1:k.column.definition.widthGrow||1)}),_.length?(_.forEach(function(k){Y+=M?k.width-k.column.minWidth:k.column.minWidth,k.width=k.column.minWidth}),Z=y-Y,Q=de?Math.floor(Z/de):Z,me=Z-Q*de,me+=g(ge,Z,Q,M)):(me=de?y-Math.floor(y/de)*de:y,ge.forEach(function(k){k.width=M?De(k):be(k)})),me}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(s-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),o.forEach(function(b){var y,x,M;b.visible&&(y=b.definition.width,x=parseInt(b.minWidth),y?(M=f(y),a+=M>x?M:x,b.definition.widthShrink&&(c.push({column:b,width:M>x?M:x}),h+=b.definition.widthShrink)):(d.push({column:b,width:0}),l+=b.definition.widthGrow||1))}),r=s-a,u=Math.floor(r/l);var w=g(d,r,u,!1);d.length&&w>0&&(d[d.length-1].width+=+w),d.forEach(function(b){r-=b.width}),m=Math.abs(w)+r,m>0&&h&&(w=g(c,m,Math.floor(m/h),!0)),c.length&&(c[c.length-1].width-=w),d.forEach(function(b){b.column.setWi
4dth(b.width)}),c.forEach(function(b){b.column.setWidth(b.width)})}};p.prototype.registerModule("layout",Ne);var ae=function(o){this.table=o,this.locale="default",this.lang=!1,this.bindings={},this.langList={}};ae.prototype.initialize=function(){this.langList=p.prototype.helpers.deepClone(this.langs)};ae.prototype.setHeaderFilterPlaceholder=function(t){this.langList.default.headerFilters.default=t};ae.prototype.setHeaderFilterColumnPlaceholder=function(t,o){this.langList.default.headerFilters.columns[t]=o,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=o)};ae.prototype.installLang=function(t,o){this.langList[t]?this._setLangProp(this.langList[t],o):this.langList[t]=o};ae.prototype._setLangProp=function(t,o){for(var n in o)t[n]&&E(t[n])=="object"?this._setLangProp(t[n],o[n]):t[n]=o[n]};ae.prototype.setLocale=function(t){var o=this;t=t||"default";function n(a,r){for(var l in a)E(a[l])=="object"?(r[l]||(r[l]={}),n(a[l],r[l])):r[l]=a[l]}if(t===!0&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langList[t]){var s=t.split("-")[0];o.langList[s]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,s),t=s):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=p.prototype.helpers.deepClone(o.langList.default||{}),t!="default"&&n(o.langList[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()};ae.prototype.getLocale=function(t){return self.locale};ae.prototype.getLang=function(t){return t?this.langList[t]:this.lang};ae.prototype.getText=function(n,o){var n=o?n+"|"+o:n,s=n.split("|"),a=this._getLangElement(s,this.locale);return a||""};ae.prototype._getLangElement=function(t,o){var n=this,s=n.lang;return t.forEach(function(a){var r;s&&(r=s[a],typeof r<"u"?s=r:s=!1)}),s};ae.prototype.bind=function(t,o){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(o),o(this.getText(t),this.lang)};ae.prototype._executeBindings=function(){var t=this,o=function(a){t.bindings[a].forEach(function(r){r(t.getText(a),t.lang)})};for(var n in t.bindings)o(n)};ae.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All"},headerFilters:{default:"filter column...",columns:{}}}};p.prototype.registerModule("localize",ae);var Ve=function(o){this.table=o};Ve.prototype.getConnections=function(t){var o=this,n=[],s;return s=p.prototype.comms.lookupTable(t),s.forEach(function(a){o.table!==a&&n.push(a)}),n};Ve.prototype.send=function(t,o,n,s){var a=this,r=this.getConnections(t);r.forEach(function(l){l.tableComms(a.table.element,o,n,s)}),!r.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)};Ve.prototype.receive=function(t,o,n,s){if(this.table.modExists(o))return this.table.modules[o].commsReceived(t,n,s);console.warn("Inter-table Comms Error - no such module:",o)};p.prototype.registerModule("comms",Ve);var Pe=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};Pe.prototype.initializeColumn=function(t){var o=this,n=!1,s={};this.allowedTypes.forEach(function(a){var r="accessor"+(a.charAt(0).toUpperCase()+a.slice(1)),l;t.definition[r]&&(l=o.lookupAccessor(t.definition[r]),l&&(n=!0,s[r]={accessor:l,params:t.definition[r+"Params"]||{}}))}),n&&(t.modules.accessor=s)};Pe.prototype.lookupAccessor=function(t){var o=!1;switch(typeof t>"u"?"undefined":E(t)){case"string":this.accessors[t]?o=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":o=t;break}return o};Pe.prototype.transformRow=function(t,o){var n="accessor"+(o.charAt(0).toUpperCase()+o.slice(1)),s=t.getComponent(),a=p.prototype.helpers.deepClone(t.data||{});return this.table.columnManager.traverse(function(r){var l,u,d,c;r.modules.accessor&&(u=r.modules.accessor[n]||r.modules.accessor.accessor||!1,u&&(l=r.getFieldValue(a),l!="undefined"&&(c=r.getComponent(),d=typeof u.params=="function"?u.params(l,a,o,c,s):u.params,r.setFieldValue(a,u.accessor(l,a,o,d,c,s)))))}),a},Pe.prototype.accessors={};p.prototype.registerModule("accessor",Pe);var W=function(o){this.table=o,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};W.prototype.initialize=function(){var t;
4this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&(typeof this.table.options.ajaxLoaderLoading=="string"?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=t.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(typeof this.table.options.ajaxLoaderError=="string"?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=t.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))};W.prototype.createLoaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader"),t};W.prototype.createMsgElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader-msg"),t.setAttribute("role","alert"),t};W.prototype.setParams=function(t,o){if(o){this.params=this.params||{};for(var n in t)this.params[n]=t[n]}else this.params=t};W.prototype.getParams=function(){return this.params||{}};W.prototype.setConfig=function(t){if(this._loadDefaultConfig(),typeof t=="string")this.config.method=t;else for(var o in t)this.config[o]=t[o]};W.prototype._loadDefaultConfig=function(t){var o=this;if(!o.config||t){o.config={};for(var n in o.defaultConfig)o.config[n]=o.defaultConfig[n]}};W.prototype.setUrl=function(t){this.url=t};W.prototype.getUrl=function(){return this.url};W.prototype.loadData=function(t,o){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t,o)};W.prototype.nextPage=function(t){var o;this.loading||(o=this.table.options.ajaxProgressiveLoadScrollMargin||this.table.rowManager.getElement().clientHeight*2,t<o&&this.table.modules.page.nextPage().then(function(){}).catch(function(){}))};W.prototype.blockActiveRequest=function(){this.requestOrder++};W.prototype._loadDataProgressive=function(){return this.table.rowManager.setData([]),this.table.modules.page.setPage(1)};W.prototype._loadDataStandard=function(t,o){var n=this;return new Promise(function(s,a){n.sendRequest(t).then(function(r){n.table.rowManager.setData(r,t,o).then(function(){s()}).catch(function(l){a(l)})}).catch(function(r){a(r)})})};W.prototype.generateParamsList=function(t,o){var n=this,s=[];if(o=o||"",Array.isArray(t))t.forEach(function(r,l){s=s.concat(n.generateParamsList(r,o?o+"["+l+"]":l))});else if((typeof t>"u"?"undefined":E(t))==="object")for(var a in t)s=s.concat(n.generateParamsList(t[a],o?o+"["+a+"]":a));else s.push({key:o,value:t});return s};W.prototype.serializeParams=function(t){var o=this.generateParamsList(t),n=[];return o.forEach(function(s){n.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value))}),n.join("&")};W.prototype.sendRequest=function(t){var o=this,n=this,s=n.url,a;return n.requestOrder++,a=n.requestOrder,n._loadDefaultConfig(),new Promise(function(r,l){n.table.options.ajaxRequesting.call(o.table,n.url,n.params)!==!1?(n.loading=!0,t||n.showLoader(),o.loaderPromise(s,n.config,n.params).then(function(u){a===n.requestOrder?(n.table.options.ajaxResponse&&(u=n.table.options.ajaxResponse.call(n.table,n.url,n.params,u)),r(u),n.hideLoader(),n.loading=!1):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made")}).catch(function(u){console.error("Ajax Load Error: ",u),n.table.o
4ptions.ajaxError.call(n.table,u),n.showError(),setTimeout(function(){n.hideLoader()},3e3),n.loading=!1,l(u)})):l()})};W.prototype.showLoader=function(){var t=typeof this.table.options.ajaxLoader=="function"?this.table.options.ajaxLoader():this.table.options.ajaxLoader;if(t){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-error"),this.msgElement.classList.add("tabulator-loading"),this.loadingElement?this.msgElement.appendChild(this.loadingElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|loading"),this.table.element.appendChild(this.loaderElement)}};W.prototype.showError=function(){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-loading"),this.msgElement.classList.add("tabulator-error"),this.errorElement?this.msgElement.appendChild(this.errorElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|error"),this.table.element.appendChild(this.loaderElement)};W.prototype.hideLoader=function(){this.loaderElement.parentNode&&this.loaderElement.parentNode.removeChild(this.loaderElement)};W.prototype.defaultConfig={method:"GET"};W.prototype.defaultURLGenerator=function(t,o,n){return t&&n&&Object.keys(n).length&&(!o.method||o.method.toLowerCase()=="get")&&(o.method="get",t+=(t.includes("?")?"&":"?")+this.modules.ajax.serializeParams(n)),t};W.prototype.defaultLoaderPromise=function(t,o,n){var s=this,a;return new Promise(function(r,l){if(t=s.urlGenerator.call(s.table,t,o,n),o.method.toUpperCase()!="GET")if(a=E(s.table.options.ajaxContentType)==="object"?s.table.options.ajaxContentType:s.contentTypeFormatters[s.table.options.ajaxContentType],a){for(var u in a.headers)o.headers||(o.headers={}),typeof o.headers[u]>"u"&&(o.headers[u]=a.headers[u]);o.body=a.body.call(s,t,o,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",s.table.options.ajaxContentType);t?(typeof o.headers>"u"&&(o.headers={}),typeof o.headers.Accept>"u"&&(o.headers.Accept="application/json"),typeof o.headers["X-Requested-With"]>"u"&&(o.headers["X-Requested-With"]="XMLHttpRequest"),typeof o.mode>"u"&&(o.mode="cors"),o.mode=="cors"?(typeof o.headers["Access-Control-Allow-Origin"]>"u"&&(o.headers["Access-Control-Allow-Origin"]=window.location.origin),typeof o.credentials>"u"&&(o.credentials="same-origin")):typeof o.credentials>"u"&&(o.credentials="include"),fetch(t,o).then(function(d){d.ok?d.json().then(function(c){r(c)}).catch(function(c){l(c),console.warn("Ajax Load Error - Invalid JSON returned",c)}):(console.error("Ajax Load Error - Connection Error: "+d.status,d.statusText),l(d))}).catch(function(d){console.error("Ajax Load Error - Connection Error: ",d),l(d)})):(console.warn("Ajax Load Error - No URL Set"),r([]))})};W.prototype.contentTypeFormatters={json:{headers:{"Content-Type":"application/json"},body:function(o,n,s){return JSON.stringify(s)}},form:{headers:{},body:function(o,n,s){var a=this.generateParamsList(s),r=new FormData;return a.forEach(function(l){r.append(l.key,l.value)}),r}}};p.prototype.registerModule("ajax",W);var He=function(o){this._row=o};He.prototype.getData=function(t){return this._row.getData(t)};He.prototype.getElement=function(){return this._row.getElement()};He.prototype.getTable=function(){return this._row.table};He.prototype.getCells=function(){var t=[];
4return this._row.getCells().forEach(function(o){t.push(o.getComponent())}),t};He.prototype.getCell=function(t){var o=this._row.getCell(t);return o?o.getComponent():!1};He.prototype._getSelf=function(){return this._row};var X=function(o){this.table=o,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};X.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t};X.prototype.initialize=function(){this.genColumn=new R({field:"value"},this)};X.prototype.registerColumnField=function(){};X.prototype.initializeColumn=function(t){var o=t.definition,n={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(E(o.topCalc)){case"string":this.calculations[o.topCalc]?n.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":n.topCalc=o.topCalc;break}n.topCalc&&(t.modules.columnCalcs=n,this.topCalcs.push(t),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(o.bottomCalc){switch(E(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?n.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":n.botCalc=o.bottomCalc;break}n.botCalc&&(t.modules.columnCalcs=n,this.botCalcs.push(t),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}};X.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()};X.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)};X.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)};X.prototype.scrollHorizontal=function(t){this.botInitialized&&this.botRow&&(this.botRow.getElement().style.marginLeft=-t+"px")};X.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}};X.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))};X.prototype.recalcAll=function(){var t=this;if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalc(this.table.rowManager.activeRows),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var o=table.modules.groupRows.getChildGroups();o.forEach(function(n){t.recalcGroup(n)})}};X.prototype.recalcGroup=function(t){var o,n;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),n=this.generateRowData("bottom",o),t.calcs.bottom.updateData(n),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),n=this.generateRowData("top",o),t.calcs.top.updateData(n),t.calcs.top.reinitialize()))};X.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))};X.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))};X.prototype.rowsToData=function(t){var o=this,n=[];
4return t.forEach(function(s){if(n.push(s.getData()),o.table.options.dataTree&&o.table.options.dataTreeChildColumnCalcs&&s.modules.dataTree.open){var a=o.rowsToData(o.table.modules.dataTree.getFilteredTreeChildren(s));n=n.concat(a)}}),n};X.prototype.generateRow=function(t,o){var n=this,s=this.generateRowData(t,o),a;return n.table.modExists("mutator")&&n.table.modules.mutator.disable(),a=new T(s,this,"calc"),n.table.modExists("mutator")&&n.table.modules.mutator.enable(),a.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),a.component=!1,a.getComponent=function(){return this.component||(this.component=new He(this)),this.component},a.generateCells=function(){var r=[];n.table.columnManager.columnsByIndex.forEach(function(l){n.genColumn.setField(l.getField()),n.genColumn.hozAlign=l.hozAlign,l.definition[t+"CalcFormatter"]&&n.table.modExists("format")?n.genColumn.modules.format={formatter:n.table.modules.format.getFormatter(l.definition[t+"CalcFormatter"]),params:l.definition[t+"CalcFormatterParams"]||{}}:n.genColumn.modules.format={formatter:n.table.modules.format.getFormatter("plaintext"),params:{}},n.genColumn.definition.cssClass=l.definition.cssClass;var u=new A(n.genColumn,a);u.getElement(),u.column=l,u.setWidth(),l.cells.push(u),r.push(u),l.visible||u.hide()}),this.cells=r},a};X.prototype.generateRowData=function(t,o){var n={},s=t=="top"?this.topCalcs:this.botCalcs,a=t=="top"?"topCalc":"botCalc",r,l;return s.forEach(function(u){var d=[];u.modules.columnCalcs&&u.modules.columnCalcs[a]&&(o.forEach(function(c){d.push(u.getFieldValue(c))}),l=a+"Params",r=typeof u.modules.columnCalcs[l]=="function"?u.modules.columnCalcs[l](d,o):u.modules.columnCalcs[l],u.setFieldValue(n,u.modules.columnCalcs[a](d,o,r)))}),n};X.prototype.hasTopCalcs=function(){return!!this.topCalcs.length};X.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length};X.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)};X.prototype.getResults=function(){var t=this,o={},n;return this.table.options.groupBy&&this.table.modExists("groupRows")?(n=this.table.modules.groupRows.getGroups(!0),n.forEach(function(s){o[s.getKey()]=t.getGroupResults(s)})):o={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},o};X.prototype.getGroupResults=function(t){var o=this,n=t._getSelf(),s=t.getSubGroups(),a={},r={};return s.forEach(function(l){a[l.getKey()]=o.getGroupResults(l)}),r={top:n.calcs.top?n.calcs.top.getData():{},bottom:n.calcs.bottom?n.calcs.bottom.getData():{},groups:a},r};X.prototype.calculations={avg:function(o,n,s){var a=0,r=typeof s.precision<"u"?s.precision:2;return o.length&&(a=o.reduce(function(l,u){return Number(l)+Number(u)}),a=a/o.length,a=r!==!1?a.toFixed(r):a),parseFloat(a).toString()},max:function(o,n,s){var a=null,r=typeof s.precision<"u"?s.precision:!1;return o.forEach(function(l){l=Number(l),(l>a||a===null)&&(a=l)}),a!==null?r!==!1?a.toFixed(r):a:""},min:function(o,n,s){var a=null,r=typeof s.precision<"u"?s.precision:!1;return o.forEach(function(l){l=Number(l),(l<a||a===null)&&(a=l)}),a!==null?r!==!1?a.toFixed(r):a:""},sum:function(o,n,s){var a=0,r=typeof s.precision<"u"?s.precision:!1;return o.length&&o.forEach(function(l){l=Number(l),a+=isNaN(l)?0:Number(l)}),r!==!1?a.toFixed(r):a},concat:function(o,n,s){var a=0;return o.length&&(a=o.reduce(function(r,l){return String(r)+String(l)})),a},count:function(o,n,s){var a=0;return o.length&&o.forEach(function(r){r&&a++}),a}};p.prototype.registerModule("columnCalcs",X);var ce=function(o){this.table=o,this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0};ce.prototype.initialize=function(){var t=this;this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",function(o){var n,s,a;if(!t.blocked){if(o.preventDefault(),t.customSelection)n=t.customSelection,t.table.options.clipboardCopyFormatter&&(n=t.table.options.clipboardCopyFormatter("plain",n));else{var a=t.table.modules.export.generateExportList(t.table.options.clipboardCopyConfig,t.table.options.clipboardCopyStyled,t.rowRange,"clipboard");s=t.table.modules.export.genereateHTMLTable(a),n=s?t.generatePlainContent(a):"",t.table.options.clipboardCopyFormatter&&(n=t.table.options.clipboardCopyFormatter("plain",n),s=t.table.options.clipboardCopyFormatter("html",s))}window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",n):o.clipboardData&&o.clipboardData.setData?(o.clipboardData.setData("text/plain",n),s&&o.clipboardData.setData("text/html",s)):o.originalEvent&&o.originalEvent.clipboardData.setData&&(o.originalEvent.clipboardData.setData("text/plain",n),s&&o.originalEvent.clipboardData.setData("text/html",s)),t.table.options.clipboardCopied.call(t.table,n,s),t.reset()}}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",function(o){t.paste(o)}
4),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction)};ce.prototype.reset=function(){this.blocked=!0,this.customSelection=!1};ce.prototype.generatePlainContent=function(t){var o=[];return t.forEach(function(n){var s=[];n.columns.forEach(function(a){var r="";if(a)if(n.type==="group"&&(a.value=a.component.getKey()),a.value===null)r="";else switch(E(a.value)){case"object":r=JSON.stringify(a.value);break;case"undefined":r="";break;default:r=a.value}s.push(r)}),o.push(s.join(" "))}),o.join(` 5`)};ce.prototype.copy=function(n,o){var n,s,a;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=n||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(n=document.createRange(),n.selectNodeContents(this.table.element),s=window.getSelection(),s.toString()&&o&&(this.customSelection=s.toString()),s.removeAllRanges(),s.addRange(n)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(a=document.body.createTextRange(),a.moveToElementText(this.table.element),a.select()),document.execCommand("copy"),s&&s.removeAllRanges())};ce.prototype.setPasteAction=function(t){switch(typeof t>"u"?"undefined":E(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t;break}};ce.prototype.setPasteParser=function(t){switch(typeof t>"u"?"undefined":E(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t;break}};ce.prototype.paste=function(t){var o,n,s;this.checkPaseOrigin(t)&&(o=this.getPasteData(t),n=this.pasteParser.call(this,o),n?(t.preventDefault(),this.table.modExists("mutator")&&(n=this.mutateData(n)),s=this.pasteAction.call(this,n),this.table.options.clipboardPasted.call(this.table,o,n,s)):this.table.options.clipboardPasteError.call(this.table,o))};ce.prototype.mutateData=function(t){var o=this,n=[];return Array.isArray(t)?t.forEach(function(s){n.push(o.table.modules.mutator.transformRow(s,"clipboard"))}):n=t,n};ce.prototype.checkPaseOrigin=function(t){var o=!0;return(t.target.tagName!="DIV"||this.table.modules.edit.currentCell)&&(o=!1),o};ce.prototype.getPasteData=function(t){var o;return window.clipboardData&&window.clipboardData.getData?o=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?o=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(o=t.originalEvent.clipboardData.getData("text/plain")),o};ce.prototype.pasteParsers={table:function(o){var n=[],s=!0,a=this.table.columnManager.columns,r=[],l=[];return o=o.split(` 6`),o.forEach(function(u){n.push(u.split(" "))}),n.length&&!(n.length===1&&n[0].length<2)?(n[0].forEach(function(u){var d=a.find(function(c){return u&&c.definition.title&&u.trim()&&c.definition.title.trim()===u.trim()});d?r.push(d):s=!1}),s||(s=!0,r=[],n[0].forEach(function(u){var d=a.find(function(c){return u&&c.field&&u.trim()&&c.field.trim()===u.trim()});d?r.push(d):s=!1}),s||(r=this.table.columnManager.columnsByIndex)),s&&n.shift(),n.forEach(function(u){var d={};u.forEach(function(c,h){r[h]&&(d[r[h].field]=c)}),l.push(d)}),l):!1}};ce.prototype.pasteActions={replace:function(o){return this.table.setData(o)},update:function(o){return this.table.updateOrAddData(o)},insert:function(o){return this.table.addData(o)}};p.prototype.registerModule("clipboard",ce);var K=function(o){this.table=o,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0};K.prototype.initialize=function(){var t=null,o=this.table.columnManager.getFirstVisibileColumn(),n=this.table.options;switch(this.field=n.dataTreeChildField,this.indent=n.dataTreeChildIndent,this.elementField=n.dataTreeElementColumn||(o?o.field:!1),n.dataTreeBranchElement&&(n.dataTreeBranchElement===!0?(this.branchEl=
6document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof n.dataTreeBranchElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=n.dataTreeBranchElement),n.dataTreeCollapseElement?typeof n.dataTreeCollapseElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=n.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),n.dataTreeExpandElement?typeof n.dataTreeExpandElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=n.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),E(n.dataTreeStartExpanded)){case"boolean":this.startOpen=function(s,a){return n.dataTreeStartExpanded};break;case"function":this.startOpen=n.dataTreeStartExpanded;break;default:this.startOpen=function(s,a){return n.dataTreeStartExpanded[a]};break}};K.prototype.initializeRow=function(t){var o=t.getData()[this.field],n=Array.isArray(o),s=n||!n&&(typeof o>"u"?"undefined":E(o))==="object"&&o!==null;!s&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!s&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:s?t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0):!1,controlEl:t.modules.dataTree&&s?t.modules.dataTree.controlEl:!1,branchEl:t.modules.dataTree&&s?t.modules.dataTree.branchEl:!1,parent:t.modules.dataTree?t.modules.dataTree.parent:!1,children:s}};K.prototype.layoutRow=function(t){var o=this.elementField?t.getCell(this.elementField):t.getCells()[0],n=o.getElement(),s=t.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(t,n),t.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),n.insertBefore(s.branchEl,n.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?n.style.paddingRight=parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":n.style.paddingLeft=parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")};K.prototype.generateControlElement=function(t,a){var n=this,s=t.modules.dataTree,a=a||t.getCells()[0].getElement(),r=s.controlEl;s.children!==!1&&(s.open?(s.controlEl=this.collapseEl.cloneNode(!0),s.controlEl.addEventListener("click",function(l){l.stopPropagation(),n.collapseRow(t)})):(s.controlEl=this.expandEl.cloneNode(!0),s.controlEl.addEventListener("click",function(l){l.stopPropagation(),n.expandRow(t)})),s.controlEl.addEventListener("mousedown",function(l){l.stopPropagation()}),r&&r.parentNode===a?r.parentNode.replaceChild(s.controlEl,r):a.insertBefore(s.controlEl,a.firstChild))};K.prototype.setDisplayIndex=function(t){this.displayIndex=t};K.prototype.getDisplayIndex=function(){return this.displayIndex};K.prototype.getRows=function(t){var o=this,n=[];return t.forEach(function(s,a){var r,l;n.push(s),s instanceof T&&(s.create(),r=s.modules.dataTree.children,!r.index&&r.children!==!1&&(l=o.getChildren(s),l.forEach(function(u){u.create(),n.push(u)})))}),n};K.prototype.getChildren=function(t,o){var n=this,s=t.modules.dataTree,a=[],r=[];return s.children!==!1&&(s.open||o)&&(Array.isArray(s.children)||(s.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.o
6ptions.dataTreeFilter?a=this.table.modules.filter.filter(s.children):a=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(a),a.forEach(function(l){r.push(l);var u=n.getChildren(l);u.forEach(function(d){r.push(d)})})),r};K.prototype.generateChildren=function(t){var o=this,n=[],s=t.getData()[this.field];return Array.isArray(s)||(s=[s]),s.forEach(function(a){var r=new T(a||{},o.table.rowManager);r.create(),r.modules.dataTree.index=t.modules.dataTree.index+1,r.modules.dataTree.parent=t,r.modules.dataTree.children&&(r.modules.dataTree.open=o.startOpen(r.getComponent(),r.modules.dataTree.index)),n.push(r)}),n};K.prototype.expandRow=function(t,o){var n=t.modules.dataTree;n.children!==!1&&(n.open=!0,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(t.getComponent(),t.modules.dataTree.index))};K.prototype.collapseRow=function(t){var o=t.modules.dataTree;o.children!==!1&&(o.open=!1,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(t.getComponent(),t.modules.dataTree.index))};K.prototype.toggleRow=function(t){var o=t.modules.dataTree;o.children!==!1&&(o.open?this.collapseRow(t):this.expandRow(t))};K.prototype.getTreeParent=function(t){return t.modules.dataTree.parent?t.modules.dataTree.parent.getComponent():!1};K.prototype.getFilteredTreeChildren=function(t){var o=t.modules.dataTree,n=[],s;return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(o.children):s=o.children,s.forEac
6h(function(a){a instanceof T&&n.push(a)})),n};K.prototype.rowDelete=function(t){var o=t.modules.dataTree.parent,n;o&&(n=this.findChildIndex(t,o),n!==!1&&o.data[this.field].splice(n,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)};K.prototype.addTreeChildRow=function(t,o,n,s){var a=!1;typeof o=="string"&&(o=JSON.parse(o)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),typeof s<"u"&&(a=this.findChildIndex(s,t),a!==!1&&t.data[this.field].splice(n?a:a+1,0,o)),a===!1&&(n?t.data[this.field].unshift(o):t.data[this.field].push(o)),this.initializeRow(t),this.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)};K.prototype.findChildIndex=function(t,o){var n=this,s=!1;return(typeof t>"u"?"undefined":E(t))=="object"?t instanceof T?s=t.data:t instanceof F?s=t._getSelf().data:typeof HTMLElement<"u"&&t instanceof HTMLElement&&o.modules.dataTree&&(s=o.modules.dataTree.children.find(function(a){return a instanceof T?a.element===t:!1}),s&&(s=s.data)):typeof t>"u"||t===null?s=!1:s=o.data[this.field].find(function(a){return a.data[n.table.options.index]==t}),s&&(Array.isArray(o.data[this.field])&&(s=o.data[this.field].indexOf(s)),s==-1&&(s=!1)),s};K.prototype.getTreeChildren=function(t,o,n){var s=this,a=t.modules.dataTree,r=[];return a.children&&(Array.isArray(a.children)||(a.children=this.generateChildren(t)),a.children.forEach(function(l){l instanceof T&&(r.push(o?l.getComponent():l),n&&(r=r.concat(s.getTreeChildren(l,o,n))))})),r};K.prototype.checkForRestyle=function(t){t.row.cells.indexOf(t)||t.row.reinitialize()};K.prototype.getChildField=function(){return this.field};K.prototype.redrawNeeded=function(t){return(this.field?typeof t[this.field]<"u":!1)||(this.elementField?typeof t[this.elementField]<"u":!1)};p.prototype.registerModule("dataTree",K);var _e=function(o){this.table=o};_e.prototype.download=function(t,o,n,s,a){var r=this,l=!1;function u(c,h){a?a===!0?r.triggerDownload(c,h,t,o,!0):a(c):r.triggerDownload(c,h,t,o)}if(typeof t=="function"?l=t:r.downloaders[t]?l=r.downloaders[t]:console.warn("Download Error - No such download type found: ",t),l){var d=this.generateExportList(s);l.call(this.table,d,n||{},u)}};_e.prototype.generateExportList=function(t){var o=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),n=this.table.options.groupHeaderDownload;return n&&!Array.isArray(n)&&(n=[n]),o.forEach(function(s){var a;s.type==="group"&&(a=s.columns[0],n&&n[s.indent]&&(a.value=n[s.indent](a.value,s.component._group.getRowCount(),s.component._group.getData(),s.component)))}),o};_e.prototype.triggerDownload=function(t,o,n,u,a){var r=document.createElement("a"),l=new Blob([t],{type:o}),u=u||"Tabulator."+(typeof n=="function"?"txt":n);l=this.table.options.downloadReady.call(this.table,t,l),l&&(a?window.open(window.URL.createObjectURL(l)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(l,u):(r.setAttribute("href",window.URL.createObjectURL(l)),r.setAttribute("download",u),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)),this.table.options.downloadComplete&&this.table.options.downloadComplete())};_e.prototype.commsReceived=function(t,o,n){switch(o){case"intercept":this.download(n.type,"",n.options,n.active,n.intercept);break}};_e.prototype.downloaders={csv:function(o,n,s){var a=n&&n.delimiter?n.delimiter:",",r=[],l=[];o.forEach(function(u){var d=[];switch(u.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":u.columns.forEach(function(c,h){c&&c.depth===1&&(l[h]=typeof c.value>"u"||c.value===null?"":'"'+String(c.value).split('"').join('""')+'"')});break;case"row":u.columns.forEach(function(c){if(c){switch(E(c.value)){case"object":c.value=JSON.stringify(c.value);break;case"undefined":case"null":c.value="";break}d.push('"'+String(c.value).split('"').join('""')+'"')}}),r.push(d.join(a));break}}),l.length&&r.unshift(l.join(a)),r=r.join(` 7`),n.bom&&(r="\uFEFF"+r),s(r,"text/csv")},json:function(o,n,s){var a=[];o.forEach(function(r){var l={};switch(r.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":r.columns.forEach(function(u){u&&(l[u.component.getField()]=u.value)}),a.push(l);break}}),a=JSON.stringify(a,null," "),s(a,"application/json")},pdf:function(o,n,s){var a=[],r=[],l={},u=n.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220}
7,d=n.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=n.jsPDF||{},h=n&&n.title?n.title:"";c.orientation||(c.orientation=n.orientation||"landscape"),c.unit||(c.unit="pt"),o.forEach(function(g){switch(g.type){case"header":a.push(m(g));break;case"group":r.push(m(g,u));break;case"calc":r.push(m(g,d));break;case"row":r.push(m(g));break}});function m(g,w){var b=[];return g.columns.forEach(function(y){var x;if(y){switch(E(y.value)){case"object":y.value=JSON.stringify(y.value);break;case"undefined":case"null":y.value="";break}x={content:y.value,colSpan:y.width,rowSpan:y.height},w&&(x.styles=w),b.push(x)}else b.push("")}),b}var f=new jsPDF(c);n&&n.autoTable&&(typeof n.autoTable=="function"?l=n.autoTable(f)||{}:l=n.autoTable),h&&(l.addPageContent=function(g){f.text(h,40,30)}),l.head=a,l.body=r,f.autoTable(l),n&&n.documentProcessing&&n.documentProcessing(f),s(f.output("arraybuffer"),"application/pdf")},xlsx:function(o,n,s){var a=this,r=n.sheetName||"Sheet1",l=XLSX.utils.book_new(),u;l.SheetNames=[],l.Sheets={};function d(){var m=[],f=[],g={},w={s:{c:0,r:0},e:{c:o[0]?o[0].columns.reduce(function(b,y){return b+(y&&y.width?y.width:1)},0):0,r:o.length}};return o.forEach(function(b,y){var x=[];b.columns.forEach(function(M,_){M?(x.push(!(M.value instanceof Date)&&E(M.value)==="object"?JSON.stringify(M.value):M.value),(M.width>1||M.height>-1)&&f.push({s:{r:y,c:_},e:{r:y+M.height-1,c:_+M.width-1}})):x.push("")}),m.push(x)}),XLSX.utils.sheet_add_aoa(g,m),g["!ref"]=XLSX.utils.encode_range(w),f.length&&(g["!merges"]=f),g}if(n.sheetOnly){s(d());return}if(n.sheets)for(var c in n.sheets)n.sheets[c]===!0?(l.SheetNames.push(c),l.Sheets[c]=d()):(l.SheetNames.push(c),this.modules.comms.send(n.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:a.active,intercept:function(f){l.Sheets[c]=f}}));else l.SheetNames.push(r),l.Sheets[r]=d();n.documentProcessing&&(l=n.documentProcessing(l));function h(m){for(var f=new ArrayBuffer(m.length),g=new Uint8Array(f),w=0;w!=m.length;++w)g[w]=m.charCodeAt(w)&255;return f}u=XLSX.write(l,{bookType:"xlsx",bookSST:!0,type:"binary"}),s(h(u),"application/octet-stream")},html:function(o,n,s){this.modExists("export",!0)&&s(this.modules.export.genereateHTMLTable(o),"text/html")}};p.prototype.registerModule("download",_e);var re=function(o){this.table=o,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};re.prototype.initializeColumn=function(t){var o=this,n={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(E(t.definition.editor)){case"string":t.definition.editor==="tick"&&(t.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),o.editors[t.definition.editor]?n.editor=o.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":n.editor=t.definition.editor;break;case"boolean":t.definition.editor===!0&&(typeof t.definition.formatter!="function"?(t.definition.formatter==="tick"&&(t.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),o.editors[t.definition.formatter]?n.editor=o.editors[t.definition.formatter]:n.editor=o.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter));break}n.editor&&(t.modules.edit=n)};re.prototype.getCurrentCell=function(){return this.currentCell?this.currentCell.getComponent():!1};re.prototype.clearEditor=function(t){var o=this.currentCell,n;if(this.invalidEdit=!1,o){for(this.currentCell=!1,n=o.getElement(),t?o.validate():n.classList.remove("tabulator-validation-fail"),n.classList.remove("tabulator-editing");n.firstChild;)n.removeChild(n.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}};re.prototype.cancelEdit=function(){if(this.currentCell){var t=this.currentCell,o=this.currentCell.getComponent();this.clearEditor(!0),t.setValueActual(t.getValue()),t.cellRendered(),(t.column.definition.editor=="textarea"||t.column.definition.variableHeight)&&t.row.normalizeHeight(!0),t.column.cellEvents.cellEditCancelled&&t.column.cellEvents.cellEditCancelled.call(this.table,o),this.table.o
7ptions.cellEditCancelled.call(this.table,o)}};re.prototype.bindEditor=function(t){var o=this,n=t.getElement(!0);n.setAttribute("tabindex",0),n.addEventListener("click",function(s){n.classList.contains("tabulator-editing")||n.focus({preventScroll:!0})}),n.addEventListener("mousedown",function(s){s.button===2?s.preventDefault():o.mouseClick=!0}),n.addEventListener("focus",function(s){o.recursionBlock||o.edit(t,s,!1)})};re.prototype.focusCellNoEvent=function(t,o){this.recursionBlock=!0,o&&this.table.browser==="ie"||t.getElement().focus({preventScroll:!0}),this.recursionBlock=!1};re.prototype.editCell=function(t,o){this.focusCellNoEvent(t),this.edit(t,!1,o)};re.prototype.focusScrollAdjust=function(t){if(this.table.rowManager.getRenderMode()=="virtual"){var o=this.table.rowManager.element.scrollTop,n=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=t.row.getElement();s.offsetTop,s.offsetTop<o?this.table.rowManager.element.scrollTop-=o-s.offsetTop:s.offsetTop+s.offsetHeight>n&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-n);var a=this.table.rowManager.element.scrollLeft,r=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,l=t.getElement();l.offsetLeft,this.table.modExists("frozenColumns")&&(a+=parseInt(this.table.modules.frozenColumns.leftMargin),r-=parseInt(this.table.modules.frozenColumns.rightMargin)),this.table.options.virtualDomHoz&&(a-=parseInt(this.table.vdomHoz.vDomPadLeft),r-=parseInt(this.table.vdomHoz.vDomPadLeft)),l.offsetLeft<a?this.table.rowManager.element.scrollLeft-=a-l.offsetLeft:l.offsetLeft+l.offsetWidth>r&&(this.table.rowManager.element.scrollLeft+=l.offsetLeft+l.offsetWidth-r)}};re.prototype.edit=function(t,o,n){var s=this,a=!0,r=function(){},l=t.getElement(),u,d,c;if(this.currentCell){this.invalidEdit||this.cancelEdit();return}function h(b){if(s.currentCell===t){var y=!0;
7return t.column.modules.validate&&s.table.modExists("validate")&&s.table.options.validationMode!="manual"&&(y=s.table.modules.validate.validate(t.column.modules.validate,t,b)),y===!0||s.table.options.validationMode==="highlight"?(s.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,s.editedCells.indexOf(t)==-1&&s.editedCells.push(t),t.setValue(b,!0),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t),y!==!0?(l.classList.add("tabulator-validation-fail"),s.table.options.validationFailed.call(s.table,t.getComponent(),b,y),!1):!0):(s.invalidEdit=!0,l.classList.add("tabulator-validation-fail"),s.focusCellNoEvent(t,!0),r(),s.table.options.validationFailed.call(s.table,t.getComponent(),b,y),!1)}}function m(){s.currentCell===t&&(s.cancelEdit(),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t))}function f(b){r=b}if(t.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;switch(o&&o.stopPropagation(),E(t.column.modules.edit.check)){case"function":a=t.column.modules.edit.check(t.getComponent());break;case"boolean":a=t.column.modules.edit.check;break}if(a||n){if(s.cancelEdit(),s.currentCell=t,this.focusScrollAdjust(t),d=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.cellEvents.cellClick&&t.column.cellEvents.cellClick.call(this.table,o,d)),t.column.cellEvents.cellEditing&&t.column.cellEvents.cellEditing.call(this.table,d),s.table.options.cellEditing.call(this.table,d),c=typeof t.column.modules.edit.params=="function"?t.column.modules.edit.params(d):t.column.modules.edit.params,u=t.column.modules.edit.editor.call(s,d,f,h,m,c),u!==!1)if(u instanceof Node){for(l.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(u),r();for(var g=l.children,w=0;w<g.length;w++)g[w].addEventListener("click",function(b){b.stopPropagation()})}else return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",u),l.blur(),!1;else return l.blur(),!1;return!0}else return this.mouseClick=!1,l.blur(),!1};re.prototype.maskInput=function(t,o){var n=o.mask,s=typeof o.maskLetterChar<"u"?o.maskLetterChar:"A",a=typeof o.maskNumberChar<"u"?o.maskNumberChar:"9",r=typeof o.maskWildcardChar<"u"?o.maskWildcardChar:"*";function l(u){var d=n[u];typeof d<"u"&&d!==r&&d!==s&&d!==a&&(t.value=t.value+""+d,l(u+1))}t.addEventListener("keydown",function(u){var d=t.value.length,c=u.key;if(u.keyCode>46){if(d>=n.length)return u.preventDefault(),u.stopPropagation(),!1;switch(n[d]){case s:if(c.toUpperCase()==c.toLowerCase())return u.preventDefault(),u.stopPropagation(),!1;break;case a:if(isNaN(c))return u.preventDefault(),u.stopPropagation(),!1;break;case r:break;default:if(c!==n[d])return u.preventDefault(),u.stopPropagation(),!1}}}),t.addEventListener("keyup",function(u){u.keyCode>46&&o.maskAutoFill&&l(t.value.length)}),t.placeholder||(t.placeholder=n),o.maskAutoFill&&l(t.value.length)};re.prototype.getEditedCells=function(){var t=[];return this.editedCells.forEach(function(o){t.push(o.getComponent())}),t};re.prototype.clearEdited=function(t){var o;t.modules.edit&&t.modules.edit.edited&&(t.modules.edit.edited=!1,t.modules.validate&&(t.modules.validate.invali
7d=!1)),o=this.editedCells.indexOf(t),o>-1&&this.editedCells.splice(o,1)};re.prototype.editors={input:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input");if(u.setAttribute("type",r.search?"search":"text"),u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var d in r.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+r.elementAttributes["+"+d])):u.setAttribute(d,r.elementAttributes[d]);u.value=typeof l<"u"?l:"",n(function(){u.focus({preventScroll:!0}),u.style.height="100%"});function c(h){(l===null||typeof l>"u")&&u.value!==""||u.value!==l?s(u.value)&&(l=u.value):a()}return u.addEventListener("change",c),u.addEventListener("blur",c),u.addEventListener("keydown",function(h){switch(h.keyCode){case 13:c();break;case 27:a();break;case 35:case 36:h.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(u,r),u},textarea:function(o,n,s,a,r){var l=o.getValue(),u=r.verticalNavigation||"hybrid",d=String(l!==null&&typeof l<"u"?l:"");(d.match(/(?:\r\n|\r|\n)/g)||[]).length+1;var c=document.createElement("textarea"),h=0;if(c.style.display="block",c.style.padding="2px",c.style.height="100%",c.style.width="100%",c.style.boxSizing="border-box",c.style.whiteSpace="pre-wrap",c.style.resize="none",r.elementAttributes&&E(r.elementAttributes)=="object")for(var m in r.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),c.setAttribute(m,c.getAttribute(m)+r.elementAttributes["+"+m])):c.setAttribute(m,r.elementAttributes[m]);c.value=d,n(function(){c.focus({preventScroll:!0}),c.style.height="100%",c.scrollHeight,c.style.height=c.scrollHeight+"px",o.getRow().normalizeHeight()});function f(g){(l===null||typeof l>"u")&&c.value!==""||c.value!==l?(s(c.value)&&(l=c.value),setTimeout(function(){o.getRow().normalizeHeight()},300)):a()}return c.addEventListener("change",f),c.addEventListener("blur",f),c.addEventListener("keyup",function(){c.style.height="";var g=c.scrollHeight;c.style.height=g+"px",g!=h&&(h=g,o.getRow().normalizeHeight())}),c.addEventListener("keydown",function(g){switch(g.keyCode){case 27:a();break;case 38:(u=="editor"||u=="hybrid"&&c.selectionStart)&&(g.stopImmediatePropagation(),g.stopPropagation());break;case 40:(u=="editor"||u=="hybrid"&&c.selectionStart!==c.value.length)&&(g.stopImmediatePropagation(),g.stopPropagation());break;case 35:case 36:g.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(c,r),c},number:function(o,n,s,a,r){var l=o.getValue(),u=r.verticalNavigation||"editor",d=document.createElement("input");if(d.setAttribute("type","number"),typeof r.max<"u"&&d.setAttribute("max",r.max),typeof r.min<"u"&&d.setAttribute("min",r.min),typeof r.step<"u"&&d.setAttribute("step",r.step),d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var c in r.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+r.elementAttributes["+"+c])):d.setAttribute(c,r.elementAttributes[c]);d.value=l;var h=function(g){m()};n(function(){d.removeEventListener("blur",h),d.focus({preventScroll:!0}),d.style.height="100%",d.addEventListener("blur",h)});function m(){var f=d.value;!isNaN(f)&&f!==""&&(f=Number(f)),f!==l?s(f)&&(l=f):a()}return d.addEventListener("keydown",function(f){switch(f.keyCode){case 13:m();break;case 27:a();break;case 38:case 40:u=="editor"&&(f.stopImmediatePropagation(),f.stopPropagation());break;case 35:case 36:f.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(d,r),d},range:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input");if(u.setAttribute("type","range"),typeof r.max<"u"&&u.setAttribute("max",r.max),typeof r.min<"u"&&u.setAttribute("min",r.min),typeof r.step<"u"&&u.setAttribute("step",r.step),u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var d in r.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+r.elementAttributes["+"+d])):u.setAttribute(d,r.elementAttributes[d]);u.value=l,n(function(){u.focus({preventScroll:!0}),u.style.height="100%"});function c(){var h=u.value;!isNaN(h)&&h!==""&&(h=Number(h)),h!=l?s(h)&&(l=h):a()}return u.addEventListener("blur",function(h){c()}),u.addEventListener("keydown",function(h){switch(h.keyCode){case 13:c();break;case 27:a();break}}),u},select:function(o,n,s,a,r){var l=this,u=this,d=o.getElement(),c=o.getValue(),h=r.verticalNavigation||"editor",m=typeof c<"u"||c===null?Array.isArray(c)?c:[c]:typeof r.defaultValue<"u"?r.defaultValue:[],f=document.createElement("input"),g=document.createElement("div"),w=r.multiselect,b=[],y={},x=[],M=[],_=!0,Y=!1,Z="",Q=null;(Array.isArray(r)||!Array.isArray(r)&&(typeof r>"u"?"undefined":E(r))==="object"&&!r.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),r={values:r});function ye(v){var D={},q=u.table.getData(),oe;return v?oe=u.table.columnManager.getColumnByField(v):oe=o.getColumn()._getSelf(),oe?q.forEach(function(Oe){var ke=oe.getFieldValue(Oe);ke!==null&&typeof ke<"u"&&ke!==""&&(D[ke]=!0)}):console.warn("unable to find matching column to create select lookup list:",v),Object.keys(D)}function me(v,D){var q=[],oe=[];
7function Oe(G){var G={label:G.label,value:G.value,itemParams:G.itemParams,elementAttributes:G.elementAttributes,element:!1};return D.indexOf(G.value)>-1&&be(G),q.push(G),oe.push(G),G}if(typeof v=="function"&&(v=v(o)),Array.isArray(v))v.forEach(function(ie){var G;(typeof ie>"u"?"undefined":E(ie))==="object"?ie.options?(G={label:ie.label,group:!0,itemParams:ie.itemParams,elementAttributes:ie.elementAttributes,element:!1},oe.push(G),ie.options.forEach(function(qe){Oe(qe)})):Oe(ie):(G={label:ie,value:ie,element:!1},D.indexOf(G.value)>-1&&be(G),q.push(G),oe.push(G))});else for(var ke in v){var We={label:v[ke],value:ke,element:!1};D.indexOf(We.value)>-1&&be(We),q.push(We),oe.push(We)}r.sortValuesList&&(q.sort(function(ie,G){return ie.label<G.label?-1:ie.label>G.label?1:0}),oe.sort(function(ie,G){return ie.label<G.label?-1:ie.label>G.label?1:0}),r.sortValuesList!=="asc"&&(q.reverse(),oe.reverse())),b=q,x=oe,de()}function de(){for(;g.firstChild;)g.removeChild(g.firstChild);x.forEach(function(v){var D=v.element;if(!D){if(D=document.createElement("div"),v.label=r.listItemFormatter?r.listItemFormatter(v.value,v.label,o,D,v.itemParams):v.label,v.group?(D.classList.add("tabulator-edit-select-list-group"),D.tabIndex=0,D.innerHTML=v.label===""?" ":v.label):(D.classList.add("tabulator-edit-select-list-item"),D.tabIndex=0,D.innerHTML=v.label===""?" ":v.label,D.addEventListener("click",function(){Y=!0,setTimeout(function(){Y=!1},10),w?(k(v),f.focus()):Fe(v)}),M.indexOf(v)>-1&&D.classList.add("active")),v.elementAttributes&&E(v.elementAttributes)=="object")for(var q in v.elementAttributes)q.charAt(0)=="+"?(q=q.slice(1),D.setAttribute(q,f.getAttribute(q)+v.elementAttributes["+"+q])):D.setAttribute(q,v.elementAttributes[q]);D.addEventListener("mousedown",function(){_=!1,setTimeout(function(){_=!0},10)}),v.element=D}g.appendChild(D)})}function ge(v,D){!w&&y&&y.element&&y.element.classList.remove("active"),y&&y.element&&y.element.classList.remove("focused"),y=v,v.element&&(v.element.classList.add("focused"),D&&v.element.classList.add("active")),v&&v.element&&v.element.scrollIntoView&&v.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function be(v){var D=M.indexOf(v);D==-1&&(M.push(v),ge(v,!0)),Be()}function De(v){var D=M[v];v>-1&&(M.splice(v,1),D.element&&D.element.classList.remove("active"))}function k(v){v||(v=y);var D=M.indexOf(v);D>-1?De(D):(w!==!0&&M.length>=w&&De(0),be(v)),Be()}function Fe(v){O(),v||(v=y),v&&(f.value=v.label,s(v.value)),m=[v.value]}function we(v){v||O();var D=[];M.forEach(function(q){D.push(q.value)}),m=D,s(D)}function Be(){var v=[];M.forEach(function(D){v.push(D.label)}),f.value=v.join(", "),u.currentCell===!1&&we(!0)}function L(){for(var v=M.length,D=0;D<v;D++)De(0)}function z(){O(),a()}function $(){if(M=[],!g.parentNode){r.values===!0?me(ye(),m):typeof r.values=="string"?me(ye(r.values),m):me(r.values||[],m);var v=p.prototype.helpers.elOffset(d);g.style.minWidth=d.offsetWidth+"px",g.style.top=v.top+d.offsetHeight+"px",g.style.left=v.left+"px",g.addEventListener("mousedown",function(D){_=!1,setTimeout(function(){_=!0},10)}),document.body.appendChild(g)}}function O(){g.parentNode&&g.parentNode.removeChild(g),P()}function P(){u.table.rowManager.element.removeEventListener("scroll",z)}function j(v){clearTimeout(Q);var D=String.fromCharCode(event.keyCode).toLowerCase();Z+=D.toLowerCase();var q=b.find(function(oe){return typeof oe.label<"u"&&oe.label.toLowerCase().startsWith(Z)});q&&ge(q,!w),Q=setTimeout(function(){Z=""},800)}if(f.setAttribute("type","text"),f.style.padding="4px",f.style.width="100%",f.style.boxSizing="border-box",f.style.cursor="default",f.readOnly=this.currentCell!=!1,r.elementAttributes&&E(r.elementAttributes)=="object")for(var Te in r.elementAttributes)Te.charAt(0)=="+"?(Te=Te.slice(1),f.setAttribute(Te,f.getAttribute(Te)+r.elementAttributes["+"+Te])):f.setAttribute(Te,r.elementAttributes[Te]);return f.value=typeof c<"u"||c===null?c:"",f.addEventListener("search",function(v){f.value||(L(),we())}),f.addEventListener("keydown",function(v){var D;switch(v.keyCode){case 38:D=b.indexOf(y),(h=="editor"||h=="hybrid"&&D)&&(v.stopImmediatePropagation(),v.stopPropagation(),v.preventDefault(),D>0&&ge(b[D-1],!w));break;case 40:D=b.indexOf(y),(h=="editor"||h=="hybrid"&&D<b.length-1)&&(v.stopImmediatePropagation(),v.stopPropagation(),v.preventDefault(),D<b.length-1&&(D==-1?ge(b[0],!w):ge(b[D+1],!w)));break;case 37:case 39:v.stopImmediatePropagation(),v.stopPropagation(),v.preventDefault();break;case 13:w?k():Fe();break;case 27:z();break;case 9:break;default:u.currentCell===!1&&v.preventDefault(),v.keyCode>=38&&v.keyCode<=90&&j(v.keyCode)}}),f.addEventListener("blur",function(v){_&&(w?we():z())}),f.addEventListener("focus",function(v){Y||$()}),g=document.createElement("div"),g.classList.add("tabulator-edit-select-list"),n(function(){f.style.height="100%",f.focus({preventScroll:!0})}),setTimeout(function(){l.table.rowManager.element.addEventListener("scroll",z)},10),f},autocomplete:function(o,n,s,a,r){var l=this,u=this,d=o.getElement(),c=o.getValue(),h=r.verticalNavigation||"editor",m=typeof c<"u"||c===null?c:typeof r.defaultValue<"u"?r.defaultValue:"",f=document.createElement("input"),g=document.createElement("div"),w=[],b=!1,y=!0,x=!1;if(f.setAttribute("type","search"),f.style.padding="4px",f.style.width="100%",f.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var M in r.elementAttributes)M.charAt(0)=="+"?(M=M.slice(1),f.setAttribute(M,f.getAttribute(M)+r.elementAttributes["+"+M])):f.setAttribute(M,r.elementAttributes[M]);g.classList.add("tabulator-edit-select-list"),g.addEventListener("mousedown",function(L){y=!1,setTimeout(function(){y=!0},10)});function _(){r.values===!0?x=Y():typeof r.values=="string"&&(x=Y(r.values))}function Y(L){var z={},$=u.table.getData(),O;return L?O=u.table.columnManager.getColumnByField(L):O=o.getColumn()._getSelf(),O?($.forEach(function(P){var j=O.getFieldValue(P);j!==null&&typeof j<"u"&&j!==""&&(z[j]=!0)}
7),r.sortValuesList?r.sortValuesList=="asc"?z=Object.keys(z).sort():z=Object.keys(z).sort().reverse():z=Object.keys(z)):console.warn("unable to find matching column to create autocomplete lookup list:",L),z}function Z(L,z){var $=[],O,P;x?O=x:O=r.values||[],r.searchFunc?($=r.searchFunc(L,O),$ instanceof Promise?(Q(typeof r.searchingPlaceholder<"u"?r.searchingPlaceholder:"Searching..."),$.then(function(j){de(ye(j),z)}).catch(function(j){console.err("error in autocomplete search promise:",j)})):de(ye($),z)):(P=ye(O),L===""?r.showListOnEmpty&&($=P):P.forEach(function(j){(j.value!==null||typeof j.value<"u")&&(String(j.value).toLowerCase().indexOf(String(L).toLowerCase())>-1||String(j.title).toLowerCase().indexOf(String(L).toLowerCase())>-1)&&$.push(j)}),de($,z))}function Q(L){var z=document.createElement("div");me(),L!==!1&&(z.classList.add("tabulator-edit-select-list-notice"),z.tabIndex=0,L instanceof Node?z.appendChild(L):z.innerHTML=L,g.appendChild(z))}function ye(L){var z=[];if(Array.isArray(L))L.forEach(function(P){var j={};(typeof P>"u"?"undefined":E(P))==="object"?(j.title=r.listItemFormatter?r.listItemFormatter(P.value,P.label):P.label,j.value=P.value):(j.title=r.listItemFormatter?r.listItemFormatter(P,P):P,j.value=P),z.push(j)});else for(var $ in L){var O={title:r.listItemFormatter?r.listItemFormatter($,L[$]):L[$],value:$};z.push(O)}return z}function me(){for(;g.firstChild;)g.removeChild(g.firstChild)}function de(L,z){L.length?ge(L,z):r.emptyPlaceholder&&Q(r.emptyPlaceholder)}function ge(L,z){var $=!1;me(),w=L,w.forEach(function(O){var P=O.element;P||(P=document.createElement("div"),P.classList.add("tabulator-edit-select-list-item"),P.tabIndex=0,P.innerHTML=O.title,P.addEventListener("click",function(j){k(O),be()}),P.addEventListener("mousedown",function(j){y=!1,setTimeout(function(){y=!0},10)}),O.element=P,z&&O.value==c&&(f.value=O.title,O.element.classList.add("active"),$=!0),O===b&&(O.element.classList.add("active"),$=!0)),g.appendChild(P)}),$||k(!1)}function be(){Fe(),b?c!==b.value?(c=b.value,f.value=b.title,s(b.value)):a():r.freetext||r.allowEmpty&&f.value===""?(c=f.value,s(f.value)):a()}function De(){if(!g.parentNode){for(console.log("show",m);g.firstChild;)g.removeChild(g.firstChild);var L=p.prototype.helpers.elOffset(d);g.style.minWidth=d.offsetWidth+"px",g.style.top=L.top+d.offsetHeight+"px",g.style.left=L.left+"px",document.body.appendChild(g)}}function k(L,z){b&&b.element&&b.element.classList.remove("active"),b=L,L&&L.element&&L.element.classList.add("active"),L&&L.element&&L.element.scrollIntoView&&L.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function Fe(){g.parentNode&&g.parentNode.removeChild(g),Be()}function we(){Fe(),a()}function Be(){u.table.rowManager.element.removeEventListener("scroll",we)}return f.addEventListener("keydown",function(L){var z;switch(L.keyCode){case 38:z=w.indexOf(b),(h=="editor"||h=="hybrid"&&z)&&(L.stopImmediatePropagation(),L.stopPropagation(),L.preventDefault(),z>0?k(w[z-1]):k(!1));break;case 40:z=w.indexOf(b),(h=="editor"||h=="hybrid"&&z<w.length-1)&&(L.stopImmediatePropagation(),L.stopPropagation(),L.preventDefault(),z<w.length-1&&(z==-1?k(w[0]):k(w[z+1])));break;case 37:case 39:L.stopImmediatePropagation(),L.stopPropagation();break;case 13:be();break;case 27:we();break;case 36:case 35:L.stopImmediatePropagation();break}}),f.addEventListener("keyup",function(L){switch(L.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:Z(f.value)}}),f.addEventListener("search",function(L){Z(f.value)}),f.addEventListener("blur",function(L){y&&be()}),f.addEventListener("focus",function(L){var z=m;_(),De(),f.value=z,Z(z,!0)}),n(function(){f.style.height="100%",f.focus({preventScroll:!0})}),r.mask&&this.table.modules.edit.maskInput(f,r),setTimeout(function(){l.table.rowManager.element.addEventListener("scroll",we)},10),_(),f.value=m,Z(m,!0),f},star:function(o,n,s,a,r){var l=this,u=o.getElement(),d=o.getValue(),c=u.getElementsByTagName("svg").length||5,h=u.getElementsByTagName("svg")[0]?u.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),g=document.createElementNS("http://www.w3.org/2000/svg","svg");function w(_){m.forEach(function(Y,Z){Z<_?(l.table.browser=="ie"?Y.setAttribute("class","tabulator-star-active"):Y.classList.replace("tabulator-star-inactive","tabulator-star-active"),Y.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):(l.table.browser=="ie"?Y.setAttribute("class","tabulator-star-inactive"):Y.classList.replace("tabulator-star-active","tabulator-star-inactive"),Y.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function b(_){var Y=document.createElement("span"),Z=g.cloneNode(!0);m.push(Z),Y.addEventListener("mouseenter",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation(),w(_)}),Y.addEventListener("mousemove",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation()}),Y.addEventListener("click",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation(),s(_),u.blur()}),Y.appendChild(Z),f.appendChild(Y)}function y(_){d=_,w(_)}if(u.style.whiteSpace="nowrap",u.style.overflow="hidden",u.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",g.setAttribute("width",h),g.setAttribute("height",h),g.setAttribute("viewBox","0 0 512 512"),g.setAttribute("xml:space","preserve"),g.style.padding="0 1px",r.elementAttributes&&E(r.elementAttributes)=="object")for(var x in r.elementAttributes)x.charAt(0)=="+"?(x=x.slice(1),f.setAttribute(x,f.getAttribute(x)+r.elementAttributes["+"+x])):f.setAttribute(x,r.elementAttributes[x]);for(var M=1;M<=c;M++)b(M);return d=Math.min(parseInt(d),c),w(d),f.addEventListener("mousemove",function(_){w(0)}),f.addEventListener("click",function(_){s(0)}),u.addEventListener("blur",function(_){a()}),u.addEventListener("keydown",function(_){switch(_.keyCode){case 39:y(d+1);break;case 37:y(d-1);break;case 13:s(d);break;case 27:a();break}}),f},progress:function(o,n,s,a,r){var l=o.getElement(),u=typeof r.max>"u"?l.getElementsByTagName("div")[0].getAttribute("max")||100:r.max,d=typeof r.min>"u"?l.getElementsByTagName("div")[0].getAttribute("min")||0:r.min,c=(u-d)/100,h=o.getValue()||0,m=document.createElement("div"),f=document.createElement("div"),g,w;
7function b(){var x=window.getComputedStyle(l,null),M=c*Math.round(f.offsetWidth/((l.clientWidth-parseInt(x.getPropertyValue("padding-left"))-parseInt(x.getPropertyValue("padding-right")))/100))+d;s(M),l.setAttribute("aria-valuenow",M),l.setAttribute("aria-label",h)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),f.style.display="inline-block",f.style.position="relative",f.style.height="100%",f.style.backgroundColor="#488CE9",f.style.maxWidth="100%",f.style.minWidth="0%",r.elementAttributes&&E(r.elementAttributes)=="object")for(var y in r.elementAttributes)y.charAt(0)=="+"?(y=y.slice(1),f.setAttribute(y,f.getAttribute(y)+r.elementAttributes["+"+y])):f.setAttribute(y,r.elementAttributes[y]);return l.style.padding="4px 4px",h=Math.min(parseFloat(h),u),h=Math.max(parseFloat(h),d),h=Math.round((h-d)/c),f.style.width=h+"%",l.setAttribute("aria-valuemin",d),l.setAttribute("aria-valuemax",u),f.appendChild(m),m.addEventListener("mousedown",function(x){g=x.screenX,w=f.offsetWidth}),m.addEventListener("mouseover",function(){m.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(x){g&&(f.style.width=w+x.screenX-g+"px")}),l.addEventListener("mouseup",function(x){g&&(x.stopPropagation(),x.stopImmediatePropagation(),g=!1,w=!1,b())}),l.addEventListener("keydown",function(x){switch(x.keyCode){case 39:x.preventDefault(),f.style.width=f.clientWidth+l.clientWidth/100+"px";break;case 37:x.preventDefault(),f.style.width=f.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:b();break;case 27:a();break}}),l.addEventListener("blur",function(){a()}),f},tickCross:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input"),d=r.tristate,c=typeof r.indeterminateValue>"u"?null:r.indeterminateValue,h=!1;if(u.setAttribute("type","checkbox"),u.style.marginTop="5px",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var m in r.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),u.setAttribute(m,u.getAttribute(m)+r.elementAttributes["+"+m])):u.setAttribute(m,r.elementAttributes[m]);u.value=l,d&&(typeof l>"u"||l===c||l==="")&&(h=!0,u.indeterminate=!0),this.table.browser!="firefox"&&n(function(){u.focus({preventScroll:!0})}),u.checked=l===!0||l==="true"||l==="True"||l===1,n(function(){u.focus()});function f(g){return d?g?h?c:u.checked:u.checked&&!h?(u.checked=!1,u.indeterminate=!0,h=!0,c):(h=!1,u.checked):u.checked}return u.addEventListener("change",function(g){s(f())}),u.addEventListener("blur",function(g){s(f(!0))}),u.addEventListener("keydown",function(g){g.keyCode==13&&s(f()),g.keyCode==27&&a()}),u}};p.prototype.registerModule("edit",re);var Ye=function(o,n,s,a){this.type=o,this.columns=n,this.component=s||!1,this.indent=a||0},Ge=function(o,n,s,a,r){this.value=o,this.component=n||!1,this.width=s,this.height=a,this.depth=r},te=function(o){this.table=o,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};te.prototype.generateExportList=function(t,o,n,s){this.cloneTableStyle=o,this.config=t||{},this.colVisProp=s;var a=this.config.columnHeaders!==!1?this.headersToExportRows(this.generateColumnGroupHeaders()):[],r=this.bodyToExportRows(this.rowLookup(n));return a.concat(r)};te.prototype.genereateTable=function(t,o,n,s){var a=this.generateExportList(t,o,n,s);return this.genereateTableElement(a)};te.prototype.rowLookup=function(t){var o=this,n=[];if(typeof t=="function")t.call(this.table).forEach(function(s){s=o.table.rowManager.findRow(s),s&&n.push(s)});else switch(t){case!0:case"visible":n=this.table.rowManager.getVisibleRows(!0);break;case"all":n=this.table.rowManager.rows;break;case"selected":n=this.table.modules.selectRow.selectedRows;break;case"active":default:this.table.options.pagination?n=this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):n=this.table.rowManager.getDisplayRows()}return Object.assign([],n)};te.prototype.generateColumnGroupHeaders=function(){var t=this,o=[],n=this.config.columnGroups!==!1?this.table.columnManager.columns:this.table.columnManager.columnsByIndex;
7return n.forEach(function(s){var a=t.processColumnGroup(s);a&&o.push(a)}),o};te.prototype.processColumnGroup=function(t){var o=this,n=t.columns,s=0,a=t.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||t.definition.title,r={title:a,column:t,depth:1};if(n.length){if(r.subGroups=[],r.width=0,n.forEach(function(l){var u=o.processColumnGroup(l);u&&(r.width+=u.width,r.subGroups.push(u),u.depth>s&&(s=u.depth))}),r.depth+=s,!r.width)return!1}else if(this.columnVisCheck(t))r.width=1;else return!1;return r};te.prototype.columnVisCheck=function(t){return t.definition[this.colVisProp]!==!1&&(t.visible||!t.visible&&t.definition[this.colVisProp])};te.prototype.headersToExportRows=function(t){var o=[],n=0,s=[];function a(r,l){var u=n-l;if(typeof o[l]>"u"&&(o[l]=[]),r.height=r.subGroups?1:u-r.depth+1,o[l].push(r),r.height>1)for(var d=1;d<r.height;d++)typeof o[l+d]>"u"&&(o[l+d]=[]),o[l+d].push(!1);if(r.width>1)for(var c=1;c<r.width;c++)o[l].push(!1);r.subGroups&&r.subGroups.forEach(function(h){a(h,l+1)})}return t.forEach(function(r){r.depth>n&&(n=r.depth)}),t.forEach(function(r){a(r,0)}),o.forEach(function(r){var l=[];r.forEach(function(u){u?l.push(new Ge(u.title,u.column.getComponent(),u.width,u.height,u.depth)):l.push(null)}),s.push(new Ye("header",l))}),s};te.prototype.bodyToExportRows=function(t){var o=this,n=[],s=[];return this.table.columnManager.columnsByIndex.forEach(function(a){o.columnVisCheck(a)&&n.push(a.getComponent())}),this.config.columnCalcs!==!1&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),t=t.filter(function(a){switch(a.type){case"group":return o.config.rowGroups!==!1;case"calc":return o.config.columnCalcs!==!1;case"row":return!(o.table.options.dataTree&&o.config.dataTree===!1&&a.modules.dataTree.parent)}return!0}),t.forEach(function(a,r){var l=a.getData(o.colVisProp),u=[],d=0;switch(a.type){case"group":d=a.level,u.push(new Ge(a.key,a.getComponent(),n.length,1));break;case"calc":case"row":n.forEach(function(c){u.push(new Ge(c._column.getFieldValue(l),c,1,1))}),o.table.options.dataTree&&o.config.dataTree!==!1&&(d=a.modules.dataTree.index);break}s.push(new Ye(a.type,u,a.getComponent(),d))}),s};te.prototype.genereateTableElement=function(t){var o=this,n=document.createElement("table"),s=document.createElement("thead"),a=document.createElement("tbody"),r=this.lookupTableStyles(),l=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u={};return u.rowFormatter=l!==null?l:this.table.options.rowFormatter,this.table.options.dataTree&&this.config.dataTree!==!1&&this.table.modExists("columnCalcs")&&(u.treeElementField=this.table.modules.dataTree.elementField),u.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u.groupHeader&&!Array.isArray(u.groupHeader)&&(u.groupHeader=[u.groupHeader]),n.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),s,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach(function(d,c){switch(d.type){case"header":s.appendChild(o.genereateHeaderElement(d,u,r));break;case"group":a.appendChild(o.genereateGroupElement(d,u,r));break;case"calc":a.appendChild(o.genereateCalcElement(d,u,r));break;case"row":var h=o.genereateRowElement(d,u,r);o.mapElementStyles(c%2&&r.evenRow?r.evenRow:r.oddRow,h,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),a.appendChild(h);break}}),s.innerHTML&&n.appendChild(s),n.appendChild(a),this.mapElementStyles(this.table.element,n,["border-top","border-left","border-right","border-bottom"]),n};te.prototype.lookupTableStyles=function(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not
7(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t};te.prototype.genereateHeaderElement=function(t,o,n){var s=this,a=document.createElement("tr");return t.columns.forEach(function(r){if(r){var l=document.createElement("th"),u=r.component._column.definition.cssClass?r.component._column.definition.cssClass.split(" "):[];l.colSpan=r.width,l.rowSpan=r.height,l.innerHTML=r.value,s.cloneTableStyle&&(l.style.boxSizing="border-box"),u.forEach(function(d){l.classList.add(d)}),s.mapElementStyles(r.component.getElement(),l,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),s.mapElementStyles(r.component._column.contentElement,l,["padding-top","padding-left","padding-right","padding-bottom"]),r.component._column.visible?s.mapElementStyles(r.component.getElement(),l,["width"]):r.component._column.definition.width&&(l.style.width=r.component._column.definition.width+"px"),r.component._column.parent&&s.mapElementStyles(r.component._column.parent.groupElement,l,["border-top"]),a.appendChild(l)}}),a};te.prototype.genereateGroupElement=function(t,o,n){var s=document.createElement("tr"),a=document.createElement("td"),r=t.columns[0];return s.classList.add("tabulator-print-table-row"),o.groupHeader&&o.groupHeader[t.indent]?r.value=o.groupHeader[t.indent](r.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):o.groupHeader===!1?r.value=r.value:r.value=t.component._group.generator(r.value,t.component._group.getRowCount(),t.component._group.getData(),t.component),a.colSpan=r.width,a.innerHTML=r.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+t.indent),r.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(n.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(n.firstGroup,a,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(a),s};te.prototype.genereateCalcElement=function(t,o,n){var s=this.genereateRowElement(t,o,n);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(n.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s};te.prototype.genereateRowElement=function(t,o,n){var s=this,a=document.createElement("tr");return a.classList.add("tabulator-print-table-row"),t.columns.forEach(function(r){if(r){var l=document.createElement("td"),u=r.component._column,d=r.value,c={modules:{},getValue:function(){return d},getField:function(){return u.definition.field},getElement:function(){return l},getColumn:function(){return u.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return c},column:u},h=u.definition.cssClass?u.definition.cssClass.split(" "):[];if(h.forEach(function(m){l.classList.add(m)}),s.table.modExists("format")&&s.config.formatCells!==!1)d=s.table.modules.format.formatExportValue(c,s.colVisProp);else switch(typeof d>"u"?"undefined":E(d)){case"object":d=JSON.stringify(d);break;case"undefined":case"null":d="";break;default:d=d}d instanceof Node?l.appendChild(d):l.innerHTML=d,n.firstCell&&(s.mapElementStyles(n.firstCell,l,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),u.definition.align&&(l.style.textAlign=u.definition.align)),s.table.o
7ptions.dataTree&&s.config.dataTree!==!1&&(o.treeElementField&&o.treeElementField==u.field||!o.treeElementField&&i==0)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),a.appendChild(l),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback(),o.rowFormatter&&s.config.formatCells!==!1&&o.rowFormatter(t.component)}}),a};te.prototype.genereateHTMLTable=function(t){var o=document.createElement("div");return o.appendChild(this.genereateTableElement(t)),o.innerHTML};te.prototype.getHtml=function(t,o,n,s){var a=this.generateExportList(n||this.table.options.htmlOutputConfig,o,t,s||"htmlOutput");return this.genereateHTMLTable(a)};te.prototype.mapElementStyles=function(t,o,n){if(this.cloneTableStyle&&t&&o){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var a=window.getComputedStyle(t);n.forEach(function(r){o.style[s[r]]=a.getPropertyValue(r)})}}};p.prototype.registerModule("export",te);var V=function(o){this.table=o,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};V.prototype.initializeColumn=function(t,o){var n=this,s=t.getField();function a(r){var l=t.modules.filter.tagType=="input"&&t.modules.filter.attrType=="text"||t.modules.filter.tagType=="textarea"?"partial":"match",u="",d="",c;if(typeof t.modules.filter.prevSuccess>"u"||t.modules.filter.prevSuccess!==r){if(t.modules.filter.prevSuccess=r,t.modules.filter.emptyFunc(r))delete n.headerFilters[s];else{switch(t.modules.filter.value=r,E(t.definition.headerFilterFunc)){case"string":n.filters[t.definition.headerFilterFunc]?(u=t.definition.headerFilterFunc,c=function(m){var f=t.definition.headerFilterFuncParams||{},g=t.getFieldValue(m);return f=typeof f=="function"?f(r,g,m):f,n.filters[t.definition.headerFilterFunc](r,g,m,f)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":c=function(m){var f=t.definition.headerFilterFuncParams||{},g=t.getFieldValue(m);return f=typeof f=="function"?f(r,g,m):f,t.definition.headerFilterFunc(r,g,m,f)},u=c;break}if(!c)switch(l){case"partial":c=function(m){var f=t.getFieldValue(m);return typeof f<"u"&&f!==null?String(f).toLowerCase().indexOf(String(r).toLowerCase())>-1:!1},u="like";break;default:c=function(m){return t.getFieldValue(m)==r},u="="}n.headerFilters[s]={value:r,func:c,type:u,params:{}}}d=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==d&&(n.prevHeaderFilterChangeCheck=d,n.changed=!0,n.table.rowManager.filterRefresh())}return!0}t.modules.filter={success:a,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)};V.prototype.generateHeaderFilterElement=function(t,o,n){var s=this,a=this,r=t.modules.filter.success,l=t.getField(),u,d,c,h,m,f,g;function w(){}if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),l){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(b){return!b&&b!=="0"&&b!==0},u=document.createElement("div"),u.classList.add("tabulator-header-filter"),E(t.definition.headerFilter)){case"string":a.table.modules.edit.editors[t.definition.headerFilter]?(d=a.table.modules.edit.editors[t.definition.headerFilter],(t.definition.headerFilter==="tick"||t.definition.headerFilter==="tickCross")&&!t.definition.headerFilterEmptyCheck&&(t.modules.filter.emptyFunc=function(b){return b!==!0&&b!==!1})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":d=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?d=t.modules.edit.editor:t.definition.formatter&&a.table.modules.edit.editors[t.definition.formatter]?(d=a.table.modules.edit.editors[t.definition.formatter],(t.definition.formatter==="tick"||t.definition.formatter==="tickCross")&&!t.definition.headerFilterEmptyC
7heck&&(t.modules.filter.emptyFunc=function(b){return b!==!0&&b!==!1})):d=a.table.modules.edit.editors.input;break}if(d){if(h={getValue:function(){return typeof o<"u"?o:""},getField:function(){return t.definition.field},getElement:function(){return u},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},g=t.definition.headerFilterParams||{},g=typeof g=="function"?g.call(a.table):g,c=d.call(this.table.modules.edit,h,function(){},r,w,g),!c){console.warn("Filter Error - Cannot add filter to "+l+" column, editor returned a value of false");return}if(!(c instanceof Node)){console.warn("Filter Error - Cannot add filter to "+l+" column, editor should return an instance of Node, the editor returned:",c);return}l?a.table.modules.localize.bind("headerFilters|columns|"+t.definition.field,function(b){c.setAttribute("placeholder",typeof b<"u"&&b?b:a.table.modules.localize.getText("headerFilters|default"))}):a.table.modules.localize.bind("headerFilters|default",function(b){c.setAttribute("placeholder",typeof a.column.definition.headerFilterPlaceholder<"u"&&a.column.definition.headerFilterPlaceholder?a.column.definition.headerFilterPlaceholder:b)}),c.addEventListener("click",function(b){b.stopPropagation(),c.focus()}),c.addEventListener("focus",function(b){var y=s.table.columnManager.element.scrollLeft;y!==s.table.rowManager.element.scrollLeft&&(s.table.rowManager.scrollHorizontal(y),s.table.columnManager.scrollHorizontal(y))}),m=!1,f=function(y){m&&clearTimeout(m),m=setTimeout(function(){r(c.value)},a.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=c,t.modules.filter.attrType=c.hasAttribute("type")?c.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=c.tagName.toLowerCase(),t.definition.headerFilterLiveFilter!==!1&&(t.definition.headerFilter==="autocomplete"||t.definition.headerFilter==="tickCross"||(t.definition.editor==="autocomplete"||t.definition.editor==="tickCross")&&t.definition.headerFilter===!0||(c.addEventListener("keyup",f),c.addEventListener("search",f),t.modules.filter.attrType=="number"&&c.addEventListener("change",function(b){r(c.value)}),t.modules.filter.attrType=="text"&&this.table.browser!=="ie"&&c.setAttribute("type","search")),(t.modules.filter.tagType=="input"||t.modules.filter.tagType=="select"||t.modules.filter.tagType=="textarea")&&c.addEventListener("mousedown",function(b){b.stopPropagation()})),u.appendChild(c),t.contentElement.appendChild(u),n||a.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)};V.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="none")})};V.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="")})};V.prototype.setHeaderFilterFocus=function(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())};V.prototype.getHeaderFilterValue=function(t){if(t.modules.filter&&t.modules.filter.headerElement)return t.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",t.getField())};V.prototype.setHeaderFilterValue=function(t,o){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,o,!0),t.modules.filter.success(o)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))};V.prototype.reloadHeaderFilter=function(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",t.getField()))};V.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t};V.prototype.setFilter=function(t,o,n,s){var a=this;a.filterList=[],Array.isArray(t)||(t=[{field:t,type:o,value:n,params:s}]),a.addFilter(t)};V.prototype.addFilter=function(t,o,n,s){var a=this;Array.isArray(t)||(t=[{field:t,type:o,value:n,params:s}]),t.forEach(function(r){r=a.findFilter(r),r&&(a.filterList.push(r),a.changed=!0)}
7),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.findFilter=function(t){var o=this,n;if(Array.isArray(t))return this.findSubFilters(t);var s=!1;return typeof t.field=="function"?s=function(r){return t.field(r,t.type||{})}:o.filters[t.type]?(n=o.table.columnManager.getColumnByField(t.field),n?s=function(r){return o.filters[t.type](t.value,n.getFieldValue(r),r,t.params||{})}:s=function(r){return o.filters[t.type](t.value,r[t.field],r,t.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=s,t.func?t:!1};V.prototype.findSubFilters=function(t){var o=this,n=[];return t.forEach(function(s){s=o.findFilter(s),s&&n.push(s)}),n.length?n:!1};V.prototype.getFilters=function(t,o){var n=[];return t&&(n=this.getHeaderFilters()),o&&n.forEach(function(s){typeof s.type=="function"&&(s.type="function")}),n=n.concat(this.filtersToArray(this.filterList,o)),n};V.prototype.filtersToArray=function(t,o){var n=this,s=[];return t.forEach(function(a){var r;Array.isArray(a)?s.push(n.filtersToArray(a,o)):(r={field:a.field,type:a.type,value:a.value},o&&typeof r.type=="function"&&(r.type="function"),s.push(r))}),s};V.prototype.getHeaderFilters=function(){var t=[];for(var o in this.headerFilters)t.push({field:o,type:this.headerFilters[o].type,value:this.headerFilters[o].value});return t};V.prototype.removeFilter=function(t,o,n){var s=this;Array.isArray(t)||(t=[{field:t,type:o,value:n}]),t.forEach(function(a){var r=-1;E(a.field)=="object"?r=s.filterList.findIndex(function(l){return a===l}):r=s.filterList.findIndex(function(l){return a.field===l.field&&a.type===l.type&&a.value===l.value}),r>-1?(s.filterList.splice(r,1),s.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",a.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.clearHeaderFilter=function(){var t=this;this.headerFilters={},t.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(o){typeof o.modules.filter.value<"u"&&delete o.modules.filter.value,o.modules.filter.prevSuccess=void 0,t.reloadHeaderFilter(o)}),this.changed=!0};V.prototype.search=function(t,o,n,s){var a=this,r=[],l=[];return Array.isArray(o)||(o=[{field:o,type:n,value:s}]),o.forEach(function(u){u=a.findFilter(u),u&&l.push(u)}),this.table.rowManager.rows.forEach(function(u){var d=!0;l.forEach(function(c){a.filterRecurse(c,u.getData())||(d=!1)}),d&&r.push(t==="data"?u.getData("data"):u.getComponent())}),r};V.prototype.filter=function(t,o){var n=this,s=[],a=[];return n.table.options.dataFiltering&&n.table.options.dataFiltering.call(n.table,n.getFilters()),!n.table.options.ajaxFiltering&&(n.filterList.length||Object.keys(n.headerFilters).length)?t.forEach(function(r){n.filterRow(r)&&s.push(r)}):s=t.slice(0),n.table.options.dataFiltered&&(s.forEach(function(r){a.push(r.getComponent())}),n.table.options.dataFiltered.call(n.table,n.getFilters(),a)),s};V.prototype.filterRow=function(t,o){var n=this,s=!0,a=t.getData();n.filterList.forEach(function(l){n.filterRecurse(l,a)||(s=!1)});for(var r in n.headerFilters)n.headerFilters[r].func(a)||(s=!1);return s};V.prototype.filterRecurse=function(t,o){var n=this,s=!1;return Array.isArray(t)?t.forEach(function(a){n.filterRecurse(a,o)&&(s=!0)}):s=t.func(o),s};V.prototype.filters={"=":function(o,n,s,a){return n==o},"<":function(o,n,s,a){return n<o},"<=":function(o,n,s,a){return n<=o},">":function(o,n,s,a){return n>o},">=":function(o,n,s,a){return n>=o},"!=":function(o,n,s,a){return n!=o},regex:function(o,n,s,a){return typeof o=="string"&&(o=new RegExp(o)),o.test(n)},like:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().indexOf(o.toLowerCase())>-1:!1},keywords:function(o,n,s,a){var r=o.toLowerCase().split(typeof a.separator>"u"?" ":a.separator),l=String(n===null||typeof n>"u"?"":n).toLowerCase(),u=[];return r.forEach(function(d){l.includes(d)&&u.push(!0)}),a.matchAll?u.length===r.length:!!u.length},starts:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().startsWith(o.toLowerCase()):!1},ends:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().endsWith(o.toLowerCase()):!1},in:function(o,n,s,a){return Array.isArray(o)?o.length?o.indexOf(n)>-1:!0:(console.warn("Filter Error - filter value is not an array:",o),!1)}};p.prototype.registerModule("filter",V);var Ce=function(o){this.table=o};Ce.prototype.initializeColumn=function(t){t.modules.format=this.lookupFormatter(t,""),typeof t.definition.formatterPrint<"u"&&(t.modules.format.print=this.lookupFormatter(t,"Print")),typeof t.definition.formatterClipboard<"u"&&(t.modules.format.clipboard=this.lookupFormatter(t,"Clipboard")),typeof t.definition.formatterHtmlOutput<"u"&&(t.modules.format.htmlOutput=this.lookupFormatter(t,"HtmlOutput"))};Ce.prototype.lookupFormatter=function(t,o){var n={params:t.definition["formatter"+o+"Params"]||{}},s=t.definition["formatter"+o];switch(typeof s>"u"?"undefined":E(s)){case"string":s==="tick"&&(s="tickCross",typeof n.params.crossElement>"u"&&(n.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[s]?n.formatter=this.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),n.formatter=this.formatters.plaintext);break;case"function":n.formatter=s;break;default:n.formatter=this.formatters.plaintext;break}return n};Ce.prototype.cellRendered=function(t){t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered&&(t.modules.format.renderedCallback(),t.modules.format.rendered=!0)};Ce.prototype.formatValue=function(t){var o=t.getComponent(),n=typeof t.column.modules.format.params=="function"?t.column.modules.format.params(o):t.column.modules.format.params;function s(a){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=a,t.modules.format.rendered=!1}return t.column.modules.format.formatter.call(this,o,n,s)};Ce.prototype.formatExportValue=function(t,o){var n=t.column.modules.format[o],s;if(n){var a=function(l){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=l,t.modules.format.rendered=!1};return s=typeof n.params=="function"?n.params(component):n.params,n.formatter.call(this,t.getComponent(),s,a)}else return this.formatValue(t)};Ce.prototype.sanitizeHTML=function(t){if(t){var o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(n){return o[n]})}else return t};Ce.prototype.emptyToSpace=function(t){return t===null||typeof t>"u"||t===""?" ":t};Ce.prototype.getFormatter=function(o){var o;switch(typeof o>"u"?"undefined":E(o)){case"string":this.formatters[o]?o=this.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),o=this.formatters.plaintext);break;case"function":o=o;break;default:o=this.formatters.plaintext;break}return o};Ce.prototype.formatters={plaintext:function(o,n,s){return this.emptyToSpace(this.sanitizeHTML(o.getValue()))},html:function(o,n,s){return o.getValue()},textarea:function(o,n,s){return o.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(o.getValue()))},money:function(o,n,s){var a=parseFloat(o.getValue()),r,l,u,d,c=n.decimal||".",h=n.thousand||",",m=n.symbol||"",f=!!n.symbolAfter,g=typeof n.precision<"u"?n.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(o.getValue()));for(r=g!==!1?a.toFixed(g):a,r=String(r).split("."),l=r[0],u=r.length>1?c+r[1]:"",d=/(\d+)(\d{3})/;d.test(l);)l=l.replace(d,"$1"+h+"$2");return f?l+u+m:m+l+u},link:function(o,n,s){var a=o.getValue(),r=n.urlPrefix||"",l=n.download,u=a,d=document.createElement("a"),c;if(n.labelField&&(c=o.getData(),u=c[n.labelField]),n.label)switch(E(n.label)){case"string":u=n.label;break;case"function":u=n.label(o);break}if(u){if(n.urlField&&(c=o.getData(),a=c[n.urlField]),n.url)switch(E(n.url)){case"string":a=n.url;break;case"function":a=n.url(o);break}return d.setAttribute("href",r+a),n.target&&d.setAttribute("target",n.target),n.download&&(typeof l=="function"?l=l(o):l=l===!0?"":l,d.setAttribute("download",l)),d.innerHTML=this.emptyToSpace(this.sanitizeHTML(u)),d}else return" "},image:function(o,n,s){var a=document.createElement("img"),r=o.getValue();switch(n.urlPrefix&&(r=n.urlPrefix+o.getValue()),n.urlSuffix&&(r=r+n.urlSuffix),a.setAttribute("src",r),E(n.height)){case"number":a.style.height=n.height+"px";break;case"string":a.style.height=n.height;break}switch(E(n.width)){case"number":a.style.width=n.width+"px";break;case"string":a.style.width=n.width;break}return a.addEventListener("load",function(){o.getRow().normalizeHeight()}),a},tickCross:function(o,n,s){var a=o.getValue(),r=o.getElement(),l=n.allowEmpty,u=n.allowTruthy,d=typeof n.tickElement<"u"?n.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',c=typeof n.crossElement<"u"?n.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313
7-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return u&&a||a===!0||a==="true"||a==="True"||a===1||a==="1"?(r.setAttribute("aria-checked",!0),d||""):l&&(a==="null"||a===""||a===null||typeof a>"u")?(r.setAttribute("aria-checked","mixed"),""):(r.setAttribute("aria-checked",!1),c||"")},datetime:function(o,n,s){var a=n.inputFormat||"YYYY-MM-DD hh:mm:ss",r=n.outputFormat||"DD/MM/YYYY hh:mm:ss",l=typeof n.invalidPlaceholder<"u"?n.invalidPlaceholder:"",u=o.getValue(),d=moment(u,a);return d.isValid()?n.timezone?d.tz(n.timezone).format(r):d.format(r):l===!0?u:typeof l=="function"?l(u):l},datetimediff:function(o,n,s){var a=n.inputFormat||"YYYY-MM-DD hh:mm:ss",r=typeof n.invalidPlaceholder<"u"?n.invalidPlaceholder:"",l=typeof n.suffix<"u"?n.suffix:!1,u=typeof n.unit<"u"?n.unit:void 0,d=typeof n.humanize<"u"?n.humanize:!1,c=typeof n.date<"u"?n.date:moment(),h=o.getValue(),m=moment(h,a);return m.isValid()?d?moment.duration(m.diff(c)).humanize(l):m.diff(c,u)+(l?" "+l:""):r===!0?h:typeof r=="function"?r(h):r},lookup:function(o,n,s){var a=o.getValue();return typeof n[a]>"u"?(console.warn("Missing display value for "+a),a):n[a]},star:function(o,n,s){var a=o.getValue(),r=o.getElement(),l=n&&n.stars?n.stars:5,u=document.createElement("span"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),c='<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',h='<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>';u.style.verticalAlign="middle",d.setAttribute("width","14"),d.setAttribute("height","14"),d.setAttribute("viewBox","0 0 512 512"),d.setAttribute("xml:space","preserve"),d.style.padding="0 1px",a=a&&!isNaN(a)?parseInt(a):0,a=Math.max(0,Math.min(a,l));for(var m=1;m<=l;m++){var f=d.cloneNode(!0);f.innerHTML=m<=a?c:h,u.appendChild(f)}return r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",r.setAttribute("aria-label",a),u},traffic:function(o,n,s){var a=this.sanitizeHTML(o.getValue())||0,r=document.createElement("span"),l=n&&n.max?n.max:100,u=n&&n.min?n.min:0,d=n&&typeof n.color<"u"?n.color:["red","orange","green"],c="#666666",h,m;if(!(isNaN(a)||typeof o.getValue()>"u")){switch(r.classList.add("tabulator-traffic-light"),m=parseFloat(a)<=l?parseFloat(a):l,m=parseFloat(m)>=u?parseFloat(m):u,h=(l-u)/100,m=Math.round((m-u)/h),typeof d>"u"?"undefined":E(d)){case"string":c=d;break;case"function":c=d(a);break;case"object":if(Array.isArray(d)){var f=100/d.length,g=Math.floor(m/f);g=Math.min(g,d.length-1),g=Math.max(g,0),c=d[g];break}}return r.style.backgroundColor=c,r}},progress:function(o,n,s){var a=this.sanitizeHTML(o.getValue())||0,r=o.getElement(),l=n&&n.max?n.max:100,u=n&&n.min?n.min:0,d=n&&n.legendAlign?n.legendAlign:"center",c,h,m,f,g;switch(h=parseFloat(a)<=l?parseFloat(a):l,h=parseFloat(h)>=u?parseFloat(h):u,c=(l-u)/100,h=Math.round((h-u)/c),E(n.color)){case"string":m=n.color;break;case"function":m=n.color(a);break;case"object":if(Array.isArray(n.color)){var w=100/n.color.length,b=Math.floor(h/w);b=Math.min(b,n.color.length-1),b=Math.max(b,0),m=n.color[b];break}default:m="#2DC214"}switch(E(n.legend)){case"string":f=n.legend;break;case"function":f=n.legend(a);break;case"boolean":f=a;break;default:f=!1}switch(E(n.legendColor)){case"string":g=n.legendColor;break;case"function":g=n.legendColor(a);break;case"object":if(Array.isArray(n.legendColor)){var w=100/n.legendColor.length,b=Math.floor(h/w);b=Math.min(b,n.legendColor.length-1),b=Math.max(b,0),g=n.legendColor[b]}break;default:g="#000"}r.style.minWidth="30px",r.style.position="relative",r.setAttribute("aria-label",h);var y=document.createElement("div");if(y.style.display="inline-block",y.style.position="relative",y.style.width=h+"%",y.style.backgroundColor=m,y.style.height="100%",y.setAttribute("data-max",l),y.setAttribute("data-min",u),f){var x=document.createElement("div");x.style.position="absolute",x.style.top="4px",x.style.left=0,x.style.textAlign=d,x.style.width="100%",x.style.color=g,x.innerHTML=f}return s(function(){if(!(o instanceof U)){var M=document.createElement("div");M.style.position="absolute",M.style.top="4px",M.style.bottom="4px",M.style.left="4px",M.style.right="4px",r.appendChild(M),r=M}r.appendChild(y),f&&r.appendChild(x)}),""},color:function(o,n,s){return o.getElement().style.backgroundColor=this.sanitizeHTML(o.getValue()),""},buttonTick:function(o,n,s){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(o,n,s){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313
7-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},rownum:function(o,n,s){return this.table.rowManager.activeRows.indexOf(o.getRow()._getSelf())+1},handle:function(o,n,s){return o.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},responsiveCollapse:function(o,n,s){var a=document.createElement("div"),r=o.getRow()._row.modules.responsiveLayout;a.classList.add("tabulator-responsive-collapse-toggle"),a.innerHTML="<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>",o.getElement().classList.add("tabulator-row-handle");function l(u){var d=r.element;r.open=u,d&&(r.open?(a.classList.add("open"),d.style.display=""):(a.classList.remove("open"),d.style.display="none"))}return a.addEventListener("click",function(u){u.stopImmediatePropagation(),l(!r.open)}),l(r.open),a},rowSelection:function(o,n,s){var a=this,r=document.createElement("input");if(r.type="checkbox",this.table.modExists("selectRow",!0))if(r.addEventListener("click",function(u){u.stopPropagation()}),typeof o.getRow=="function"){var l=o.getRow();l instanceof F?(r.addEventListener("change",function(u){l.toggleSelect()}),r.checked=l.isSelected&&l.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(l,r)):r=""}else r.addEventListener("change",function(u){a.table.modules.selectRow.selectedRows.length?a.table.deselectRow():a.table.selectRow(n.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(r);return r}};p.prototype.registerModule("format",Ce);var he=function(o){this.table=o,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};he.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0};he.prototype.initializeColumn=function(t){var o={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(o.position=this.initializationMode,this.initializationMode=="left"?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=o):this.initializationMode="right")};he.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen};he.prototype.scrollHorizontal=function(){var t=this,o;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),o=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),o.forEach(function(n){n.type==="row"&&t.layoutRow(n)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)};he.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft};he.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))};he.prototype.layoutColumnPosition=function(t){var o=this,n=[];this.leftColumns.forEach(function(s,a){if(s.modules.frozen.margin=o._calcSpace(o.leftColumns,a)+o.table.columnManager.scrollLeft+"px",a==o.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var r=o.getColGroupParentElement(s);n.includes(r)||(o.layoutElement(r,s),n.push(r)),s.modules.frozen.edge&&r.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else o.layoutElement(s.getElement(),s);
7t&&s.cells.forEach(function(l){o.layoutElement(l.getElement(!0),s)})}),this.rightColumns.forEach(function(s,a){s.modules.frozen.margin=o.rightPadding-o._calcSpace(o.rightColumns,a+1)+"px",a==o.rightColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup?o.layoutElement(o.getColGroupParentElement(s),s):o.layoutElement(s.getElement(),s),t&&s.cells.forEach(function(r){o.layoutElement(r.getElement(!0),s)})})};he.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()};he.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(o){o.type==="row"&&t.layoutRow(o)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)};he.prototype.layoutRow=function(t){var o=this,n=t.getElement();n.style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(s){var a=t.getCell(s);a&&o.layoutElement(a.getElement(!0),s)}),this.rightColumns.forEach(function(s){var a=t.getCell(s);a&&o.layoutElement(a.getElement(!0),s)})};he.prototype.layoutElement=function(t,o){o.modules.frozen&&(t.style.position="absolute",t.style.left=o.modules.frozen.margin,t.classList.add("tabulator-frozen"),o.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+o.modules.frozen.position))};he.prototype._calcSpace=function(t,o){for(var n=0,s=0;s<o;s++)t[s].visible&&(n+=t[s].getWidth());return n};p.prototype.registerModule("frozenColumns",he);var Re=function(o){this.table=o,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};Re.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)};Re.prototype.setDisplayIndex=function(t){this.displayIndex=t};Re.prototype.getDisplayIndex=function(){return this.displayIndex};Re.prototype.isFrozen=function(){return!!this.rows.length};Re.prototype.getRows=function(t){var o=t.slice(0);return this.rows.forEach(function(n){var s=o.indexOf(n);s>-1&&o.splice(s,1)}),o};Re.prototype.freezeRow=function(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())};Re.prototype.unfreezeRow=function(t){this.rows.indexOf(t),t.modules.frozen?(t.modules.frozen=!1,this.detachRow(t),this.table.rowManager.adjustTableSize(),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")};Re.prototype.detachRow=function(t){var o=this.rows.indexOf(t);if(o>-1){var n=t.getElement();n.parentNode.removeChild(n),this.rows.splice(o,1)}};Re.prototype.styleRows=function(t){var o=this;this.rows.forEach(function(n,s){o.table.rowManager.styleRow(n,s)})};p.prototype.registerModule("frozenRows",Re);var le=function(o){this._group=o,this.type="GroupComponent"};le.prototype.getKey=function(){return this._group.key};le.prototype.getField=function(){return this._group.field};le.prototype.getElement=function(){return this._group.element};le.prototype.getRows=function(){return this._group.getRows(!0)};le.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)};le.prototype.getParentGroup=function(){return this._group.parent?this._group.parent.getComponent():!1};le.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible};le.prototype.isVisible=function(){return this._group.visible};le.prototype.show=function(){this._group.show()};le.prototype.hide=function(){this._group.hide()};le.prototype.toggle=function(){this._group.toggleVisibility()};le.prototype._getSelf=function(){return this._group};le.prototype.getTable=function(){return this._group.groupManager.table};var S=function(o,n,s,a,r,l,u){this.groupManager=o,this.parent=n,this.key=a,this.level=s,this.field=r,this.hasSubGroups=s<o.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=u,this.rows=[],this.groups=[],this.groupList=[],this.generator=l,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=u?u.visible:typeof o.startOpen[s]<"u"?o.startOpen[s]:o.startOpen[0],this.component=null,this.createElements(),this.addBindings(),this.createValueGroups()};S.prototype.wipe=function(){this.groupList.length?this.groupList.forEach(function(t){t.wipe()}):(this.element=!1,this.arrowElement=!1,this.elementContents=!1)};S.prototype.createElements=function(){var t=document.createElement("div");t.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(t),this.groupManager.table.options.movableRows!==!1&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)};S.prototype.createValueGroups=function(){var t=this,o=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]&&this.groupManager.allowedValues[o].forEac
7h(function(n){t._createGroup(n,o)})};S.prototype.addBindings=function(){var t=this,o,n,s,a;t.groupManager.table.options.groupClick&&t.element.addEventListener("click",function(r){t.groupManager.table.options.groupClick.call(t.groupManager.table,r,t.getComponent())}),t.groupManager.table.options.groupDblClick&&t.element.addEventListener("dblclick",function(r){t.groupManager.table.options.groupDblClick.call(t.groupManager.table,r,t.getComponent())}),t.groupManager.table.options.groupContext&&t.element.addEventListener("contextmenu",function(r){t.groupManager.table.options.groupContext.call(t.groupManager.table,r,t.getComponent())}),(t.groupManager.table.options.groupContextMenu||t.groupManager.table.options.groupClickMenu)&&t.groupManager.table.modExists("menu")&&t.groupManager.table.modules.menu.initializeGroup.call(t.groupManager.table.modules.menu,t),t.groupManager.table.options.groupTap&&(s=!1,t.element.addEventListener("touchstart",function(r){s=!0},{passive:!0}),t.element.addEventListener("touchend",function(r){s&&t.groupManager.table.options.groupTap(r,t.getComponent()),s=!1})),t.groupManager.table.options.groupDblTap&&(o=null,t.element.addEventListener("touchend",function(r){o?(clearTimeout(o),o=null,t.groupManager.table.options.groupDblTap(r,t.getComponent())):o=setTimeout(function(){clearTimeout(o),o=null},300)})),t.groupManager.table.options.groupTapHold&&(n=null,t.element.addEventListener("touchstart",function(r){clearTimeout(n),n=setTimeout(function(){clearTimeout(n),n=null,s=!1,t.groupManager.table.options.groupTapHold(r,t.getComponent())},1e3)},{passive:!0}),t.element.addEventListener("touchend",function(r){clearTimeout(n),n=null})),t.groupManager.table.options.groupToggleElement&&(a=t.groupManager.table.options.groupToggleElement=="arrow"?t.arrowElement:t.element,a.addEventListener("click",function(r){r.stopPropagation(),r.stopImmediatePropagation(),t.toggleVisibility()}))};S.prototype._createGroup=function(t,o){var n=o+"_"+t,s=new S(this.groupManager,this,o,t,this.groupManager.groupIDLookups[o].field,this.groupManager.headerGenerator[o]||this.groupManager.headerGenerator[0],this.old?this.old.groups[n]:!1);this.groups[n]=s,this.groupList.push(s)};S.prototype._addRowToGroup=function(t){var o=this.level+1;if(this.hasSubGroups){var n=this.groupManager.groupIDLookups[o].func(t.getData()),s=o+"_"+n;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]?this.groups[s]&&this.groups[s].addRow(t):(this.groups[s]||this._createGroup(n,o),this.groups[s].addRow(t))}};S.prototype._addRow=function(t){this.rows.push(t),t.modules.group=this};S.prototype.insertRow=function(t,o,n){var s=this.conformRowData({});t.updateData(s);var a=this.rows.indexOf(o);a>-1?n?this.rows.splice(a+1,0,t):this.rows.splice(a,0,t):n?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)};S.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})};S.prototype.getRowIndex=function(t){};S.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t};S.prototype.removeRow=function(t){var o=this.rows.indexOf(t),n=t.getElement();o>-1&&this.rows.splice(o,1),!this.groupManager.table.options.groupValues&&!this.rows.length?(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0)):(n.parentNode&&n.parentNode.removeChild(n),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))};S.prototype.removeGroup=function(t){var o=t.level+"_"+t.key,n;this.groups[o]&&(delete this.groups[o],n=this.groupList.indexOf(t),n>-1&&this.groupList.splice(n,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))};S.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(n){o=o.concat(n.getHeadersAndRows(t))}):(!t&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top)),o=o.concat(this.rows),!t&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom))):!this.groupList.length&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top))),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom)))),o};S.prototype.getData=function(t,o){var n=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(s){n.push(s.getData(o||"data"))}),n};S.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t};S.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()};S.prototype.hide=function(){this.visible=!1,this.groupManager.table.rowManager.getRenderMode()=="classic"&&!this.groupManager.table.options.pagination?(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){var o=t.getHeadersAndRows();o.forEach(function(n){n.detachElement()})}):this.rows.forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()):this.groupManager.updateGroupRows(!0),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)};S.prototype.show=function(){var t=this;if(t.visible=!0,this.groupManager.table.rowManager.getRenderMode()=="classic"&&!this.groupManager.table.options.pagination){this.element.classList.add("tabulator-group-visible");var o=t.getElement();this.groupList.length?this.groupList.forEach(function(n){var s=n.getHeadersAndRows();
7s.forEach(function(a){var r=a.getElement();o.parentNode.insertBefore(r,o.nextSibling),a.initialize(),o=r})}):t.rows.forEach(function(n){var s=n.getElement();o.parentNode.insertBefore(s,o.nextSibling),n.initialize(),o=s}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}else this.groupManager.updateGroupRows(!0);this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)};S.prototype._visSet=function(){var t=[];typeof this.visible=="function"&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))};S.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(n){var s=n.getRowGroup(t);s&&(o=s)}):this.rows.find(function(n){return n===t})&&(o=this),o};S.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(n){o.push(t?n.getComponent():n)}),o};S.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(n){o.push(t?n.getComponent():n)}),o};S.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);typeof this.elementContents=="string"?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)};S.prototype.getPath=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.unshift(this.key),this.parent&&this.parent.getPath(t),t};S.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;t<this.element.childNodes.length;++t)this.element.childNodes[t].parentNode.removeChild(this.element.childNodes[t]);return this.generateGroupHeaderContents(),this.element};S.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)};S.prototype.normalizeHeight=function(){this.setHeight(this.element.clientHeight)};S.prototype.initialize=function(t){(!this.initialized||t)&&(this.normalizeHeight(),this.initialized=!0)};S.prototype.reinitialize=function(){this.initialized=!1,this.height=0,p.prototype.helpers.elVisible(this.element)&&this.initialize(!0)};S.prototype.setHeight=function(t){this.height!=t&&(this.height=t,this.outerHeight=this.element.offsetHeight)};S.prototype.getHeight=function(){return this.outerHeight};S.prototype.getGroup=function(){return this};S.prototype.reinitializeHeight=function(){};S.prototype.calcHeight=function(){};S.prototype.setCellHeight=function(){};S.prototype.clearCellHeight=function(){};S.prototype.getComponent=function(){return this.component||(this.component=new le(this)),this.component};var J=function(o){this.table=o,this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayIndex=0};J.prototype.initialize=function(){var t=this,o=t.table.options.groupBy,n=t.table.options.groupStartOpen,s=t.table.options.groupHeader;if(this.allowedValues=t.table.options.groupValues,Array.isArray(o)&&Array.isArray(s)&&o.length>s.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(r,l){t.headerGenerator[0]=function(u,d,c){return(typeof u>"u"?"":u)+"<span>("+d+" "+(d===1?r:l.groups.items)+")</span>"}}),this.groupIDLookups=[],Array.isArray(o)||o)this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="table"&&this.table.options.columnCalcs!="both"&&this.table.modules.columnCalcs.removeCalcs();
7else if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="group"){var a=this.table.columnManager.getRealColumns();a.forEach(function(r){r.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),r.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(r,l){var u,d;typeof r=="function"?u=r:(d=t.table.columnManager.getColumnByField(r),d?u=function(h){return d.getFieldValue(h)}:u=function(h){return h[r]}),t.groupIDLookups.push({field:typeof r=="function"?!1:r,func:u,values:t.allowedValues?t.allowedValues[l]:!1})}),n&&(Array.isArray(n)||(n=[n]),n.forEach(function(r){}),t.startOpen=n),s&&(t.headerGenerator=Array.isArray(s)?s:[s]),this.initialized=!0};J.prototype.setDisplayIndex=function(t){this.displayIndex=t};J.prototype.getDisplayIndex=function(){return this.displayIndex};J.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)};J.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(n){o.push(t?n.getComponent():n)}),o};J.prototype.getChildGroups=function(t){var o=this,n=[];return t||(t=this),t.groupList.forEach(function(s){s.groupList.length?n=n.concat(o.getChildGroups(s)):n.push(s)}),n};J.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})};J.prototype.pullGroupListData=function(t){var o=this,n=[];return t.forEach(function(s){var a={};a.level=0,a.rowCount=0,a.headerContent="";var r=[];s.hasSubGroups?(r=o.pullGroupListData(s.groupList),a.level=s.level,a.rowCount=r.length-s.groupList.length,a.headerContent=s.generator(s.key,a.rowCount,s.rows,s),n.push(a),n=n.concat(r)):(a.level=s.level,a.headerContent=s.generator(s.key,s.rows.length,s.rows,s),a.rowCount=s.getRows().length,n.push(a),s.getRows().forEach(function(l){n.push(l.getData("data"))}))}),n};J.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)};J.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(n){var s=n.getRowGroup(t);s&&(o=s)}),o};J.prototype.countGroups=function(){return this.groupList.length};J.prototype.generateGroups=function(t){var o=this,n=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(s){o.createGroup(s,0,n)}),t.forEach(function(s){o.assignRowToExistingGroup(s,n)})):t.forEach(function(s){o.assignRowToGroup(s,n)})};J.prototype.createGroup=function(t,o,n){var s=o+"_"+t,a;n=n||[],a=new S(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],n[s]),this.groups[s]=a,this.groupList.push(a)};J.prototype.assignRowToExistingGroup=function(t,o){var n=this.groupIDLookups[0].func(t.getData()),s="0_"+n;this.groups[s]&&this.groups[s].addRow(t)};J.prototype.assignRowToGroup=function(t,o){var n=this.groupIDLookups[0].func(t.getData()),s=!this.groups["0_"+n];return s&&this.createGroup(n,0,o),this.groups["0_"+n].addRow(t),!s};J.prototype.reassignRowToGroup=function(t){var o=t.getGroup(),n=o.getPath(),s=this.getExpectedPath(t),a=!0,a=n.length==s.length&&n.every(function(r,l){return r===s[l]});a||(o.removeRow(t),this.assignRowToGroup(t,self.groups),this.table.rowManager.refreshActiveData("group",!1,!0))};J.prototype.getExpectedPath=function(t){var o=[],n=t.getData();return this.groupIDLookups.forEach(function(s){o.push(s.func(n))}),o};J.prototype.updateGroupRows=function(t){var o=this,n=[];if(o.groupList.forEach(function(a){n=n.concat(a.getHeadersAndRows())}),t){var s=o.table.rowManager.setDisplayRows(n,this.getDisplayIndex());s!==!0&&this.setDisplayIndex(s),o.table.rowManager.refreshActiveData("group",!0,!0)}return n};J.prototype.scrollHeaders=function(t){this.table.options.virtualDomHoz&&(t-=this.table.vdomHoz.vDomPadLeft),t=t+"px",this.groupList.forEach(function(o){o.scrollHeader(t)})};J.prototype.removeGroup=function(t){var o=t.level+"_"+t.key,n;this.groups[o]&&(delete this.groups[o],n=this.groupList.indexOf(t),n>-1&&this.groupList.splice(n,1))};p.prototype.registerModule("groupRows",J);var ve=function(o){this.table=o,this.history=[],this.index=-1};ve.prototype.clear=function(){this.history=[],this.index=-1};ve.prototype.action=function(t,o,n){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:n}),this.index++};ve.prototype.getHistoryUndoSize=function(){return this.index+1};ve.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)};ve.prototype.clearComponentHistory=function(t){var o=this.history.findIndex(function(n){return n.component===t});o>-1&&(this.history.splice(o,1),o<=this.index&&this.index--,this.clearComponentHistory(t))};ve.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.o
7ptions.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}else return console.warn("History Undo Error - No more history to undo"),!1};ve.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}else return console.warn("History Redo Error - No more history to redo"),!1};ve.prototype.undoers={cellEdit:function(o){o.component.setValueProcessData(o.data.oldValue)},rowAdd:function(o){o.component.deleteActual()},rowDelete:function(o){var n=this.table.rowManager.addRowActual(o.data.data,o.data.pos,o.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(o.component,n)},rowMove:function(o){this.table.rowManager.moveRowActual(o.component,this.table.rowManager.rows[o.data.posFrom],!o.data.after),this.table.rowManager.redraw()}};ve.prototype.redoers={cellEdit:function(o){o.component.setValueProcessData(o.data.newValue)},rowAdd:function(o){var n=this.table.rowManager.addRowActual(o.data.data,o.data.pos,o.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(o.component,n)},rowDelete:function(o){o.component.deleteActual()},rowMove:function(o){this.table.rowManager.moveRowActual(o.component,this.table.rowManager.rows[o.data.posTo],o.data.after),this.table.rowManager.redraw()}};
7ve.prototype._rebindRow=function(t,o){this.history.forEach(function(n){if(n.component instanceof T)n.component===t&&(n.component=o);else if(n.component instanceof A&&n.component.row===t){var s=n.component.column.getField();s&&(n.component=o.getCell(s))}})};p.prototype.registerModule("history",ve);var Ae=function(o){this.table=o,this.fieldIndex=[],this.hasIndex=!1};Ae.prototype.parseTable=function(){var t=this,o=t.table.element,n=t.table.options;n.columns;var s=o.getElementsByTagName("th"),a=o.getElementsByTagName("tbody")[0],r=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),a=a?a.getElementsByTagName("tr"):[],t._extractOptions(o,n),s.length?t._extractHeaders(s,a):t._generateBlankHeaders(s,a);for(var l=0;l<a.length;l++){var u=a[l],d=u.getElementsByTagName("td"),c={};t.hasIndex||(c[n.index]=l);for(var h=0;h<d.length;h++){var m=d[h];typeof this.fieldIndex[h]<"u"&&(c[this.fieldIndex[h]]=m.innerHTML)}r.push(c)}var f=document.createElement("div"),g=o.attributes;for(var h in g)E(g[h])=="object"&&f.setAttribute(g[h].name,g[h].value);o.parentNode.replaceChild(f,o),n.data=r,t.table.options.htmlImported.call(this.table),this.table.element=f};Ae.prototype._extractOptions=function(t,o,n){var s=t.attributes,a=n?Object.assign([],n):Object.keys(o),r
7={};a.forEach(function(c){r[c.toLowerCase()]=c});for(var l in s){var u=s[l],d;u&&(typeof u>"u"?"undefined":E(u))=="object"&&u.name&&u.name.indexOf("tabulator-")===0&&(d=u.name.replace("tabulator-",""),typeof r[d]<"u"&&(o[r[d]]=this._attribValue(u.value)))}};Ae.prototype._attribValue=function(t){return t==="true"?!0:t==="false"?!1:t};Ae.prototype._findCol=function(t){var o=this.table.options.columns.find(function(n){return n.title===t});return o||!1};Ae.prototype._extractHeaders=function(t,o){for(var n=0;n<t.length;n++){var s=t[n],a=!1,r=this._findCol(s.textContent),l;r?a=!0:r={title:s.textContent.trim()},r.field||(r.field=s.textContent.trim().toLowerCase().replace(" ","_")),l=s.getAttribute("width"),l&&!r.width&&(r.width=l),s.attributes,this._extractOptions(s,r,R.prototype.defaultOptionList),this.fieldIndex[n]=r.field,r.field==this.table.options.index&&(this.hasIndex=!0),a||this.table.options.columns.push(r)}};Ae.prototype._generateBlankHeaders=function(t,o){for(var n=0;n<t.length;n++){var s=t[n],a={title:"",field:"col"+n};this.fieldIndex[n]=a.field;var r=s.getAttribute("width");r&&(a.width=r),this.table.options.columns.push(a)}};p.prototype.registerModule("htmlTableImport",Ae);var Me=function(o){this.table=o,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};Me.prototype.initialize=function(){var t=this.table.options.keybindings,o={};if(this.watchKeys={},this.pressedKeys=[],t!==!1){for(var n in this.bindings)o[n]=this.bindings[n];if(Object.keys(t).length)for(var s in t)o[s]=t[s];this.mapBindings(o),this.bindEvents()}};Me.prototype.mapBindings=function(t){var o=this,n=this,s=function(l){o.actions[l]?t[l]&&(E(t[l])!=="object"&&(t[l]=[t[l]]),t[l].forEach(function(u){n.mapBinding(l,u)})):console.warn("Key Binding Error - no such action:",l)};for(var a in t)s(a)};Me.prototype.mapBinding=function(t,o){var n=this,s={action:this.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1},a=o.toString().toLowerCase().split(" ").join("").split("+");a.forEach(function(r){switch(r){case"ctrl":s.ctrl=!0;break;case"shift":s.shift=!0;break;case"meta":s.meta=!0;break;default:r=parseInt(r),s.keys.push(r),n.watchKeys[r]||(n.watchKeys[r]=[]),n.watchKeys[r].push(s)}})};Me.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(o){var n=o.keyCode,s=t.watchKeys[n];
7s&&(t.pressedKeys.push(n),s.forEach(function(a){t.checkBinding(o,a)}))},this.keydownBinding=function(o){var n=o.keyCode,s=t.watchKeys[n];if(s){var a=t.pressedKeys.indexOf(n);a>-1&&t.pressedKeys.splice(a,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)};Me.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)};Me.prototype.checkBinding=function(t,o){var n=this,s=!0;return t.ctrlKey==o.ctrl&&t.shiftKey==o.shift&&t.metaKey==o.meta?(o.keys.forEach(function(a){var r=n.pressedKeys.indexOf(a);r==-1&&(s=!1)}),s&&o.action.call(n,t),!0):!1};Me.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"};Me.prototype.actions={keyBlock:function(o){o.stopPropagation(),o.preventDefault()},scrollPageUp:function(o){var n=this.table.rowManager,s=n.scrollTop-n.height;n.element.scrollHeight,o.preventDefault(),n.displayRowsCount&&(s>=0?n.element.scrollTop=s:n.scrollToRow(n.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(o){var n=this.table.rowManager,s=n.scrollTop+n.height,a=n.element.scrollHeight;o.preventDefault(),n.displayRowsCount&&(s<=a?n.element.scrollTop=s:n.scrollToRow(n.getDisplayRows()[n.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(o){var n=this.table.rowManager;o.preventDefault(),n.displayRowsCount&&n.scrollToRow(n.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(o){var n=this.table.rowManager;o.preventDefault(),n.displayRowsCount&&n.scrollToRow(n.getDisplayRows()[n.displayRowsCount-1]),this.table.element.focus()},navPrev:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().prev()))},navNext:function(o){var n=!1,s=this.table.options.tabEndNewRow,a;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),a=n.nav(),a.next()||s&&(n.getElement().firstChild.blur(),s===!0?s=this.table.addRow({}):typeof s=="function"?s=this.table.addRow(s(n.row.getComponent())):s=this.table.addRow(Object.assign({},s)),s.then(function(){setTimeout(function(){a.next()})}))))},navLeft:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().left()))},navRight:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().right()))},navUp:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().up()))},navDown:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().down()))},undo:function(o){var n=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n||(o.preventDefault(),this.table.modules.history.undo()))},redo:function(o){var n=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n||(o.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(o){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};p.prototype.registerModule("keybindings",Me);var ue=function(o){this.table=o,this.menuElements=[],this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1,this.positionReversedX=!1};ue.prototype.initializeColumnHeader=function(t){var o=this,n;t.definition.headerContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.definition.headerContextMenu)),this.tapHold(t,t.definition.headerContextMenu)),t.definition.headerMenu&&(n=document.createElement("span"),n.classList.add("tabulator-header-menu-button"),n.innerHTML="⋮",n.addEventListener("click",function(s){s.stopPropagation(),s.preventDefault(),o.LoadMenuEvent(t,t.definition.headerMenu,s)}),t.titleElement.insertBefore(n,t.titleElement.firstChild))};ue.prototype.LoadMenuEvent=function(t,o,n){o=typeof o=="function"?o.call(this.table,t.getComponent(),n):o,this.loadMenu(n,t,o)};ue.prototype.tapHold=function(t,o){var n=this,s=t.getElement(),a=null,r=!1;s.addEventListener("touchstart",function(l){clearTimeout(a),r=!1,a=setTimeout(function(){clearTimeout(a),a=null,r=!0,n.LoadMenuEvent(t,o,l)},1e3)},{passive:!0}),s.addEventListener("touchend",function(l){clearTimeout(a),a=null,r&&l.preventDefault()})};ue.prototype.initializeCell=function(t){t.column.definition.contextMenu&&(t.getElement(!0).addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.column.definition.contextMenu)),this.tapHold(t,t.column.definition.contextMenu)),t.column.definition.clickMenu&&t.getElement(!0).addEventListener("click",this.LoadMenuEvent.bind(this,t,t.column.definition.clickMenu))};
7ue.prototype.initializeRow=function(t){this.table.options.rowContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.rowContextMenu)),this.tapHold(t,this.table.options.rowContextMenu)),this.table.options.rowClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.rowClickMenu))};ue.prototype.initializeGroup=function(t){this.table.options.groupContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.groupContextMenu)),this.tapHold(t,this.table.options.groupContextMenu)),this.table.options.groupClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.groupClickMenu))};ue.prototype.loadMenu=function(t,o,n,s){var a=this,r=!(t instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),r||t.preventDefault(),!(!n||!n.length)){if(!s){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout(function(){a.nestedMenuBlock=!1},100);this.hideMenu(),this.menuElements=[]}n.forEach(function(u){var d=document.createElement("div"),c=u.label,h=u.disabled;u.separator?d.classList.add("tabulator-menu-separator"):(d.classList.add("tabulator-menu-item"),typeof c=="function"&&(c=c.call(a.table,o.getComponent())),c instanceof Node?d.appendChild(c):d.innerHTML=c,typeof h=="function"&&(h=h.call(a.table,o.getComponent())),h?(d.classList.add("tabulator-menu-item-disabled"),d.addEventListener("click",function(m){m.stopPropagation()})):u.menu&&u.menu.length?d.addEventListener("click",function(m){m.stopPropagation(),a.hideOldSubMenus(l),a.loadMenu(m,o,u.menu,d)}):u.action&&d.addEventListener("click",function(m){u.action(m,o.getComponent())}),u.menu&&u.menu.length&&d.classList.add("tabulator-menu-item-submenu")),l.appendChild(d)}),l.addEventListener("click",function(u){a.hideMenu()}),this.menuElements.push(l),this.positionMenu(l,s,r,t)}};ue.prototype.hideOldSubMenus=function(t){var o=this.menuElements.indexOf(t);if(o>-1)for(var n=this.menuElements.length-1;n>o;n--){var s=this.menuElements[n];s.parentNode&&s.parentNode.removeChild(s),this.menuElements.pop()}};ue.prototype.positionMenu=function(t,o,n,s){var a=this,r=Math.max(document.body.offsetHeight,window.innerHeight),l,u,d;o?(d=p.prototype.helpers.elOffset(o),l=d.left+o.offsetWidth,u=d.top-1):(l=n?s.touches[0].pageX:s.pageX,u=n?s.touches[0].pageY:s.pageY,this.positionReversedX=!1),t.style.top=u+"px",t.style.left=l+"px",setTimeout(function(){a.table.rowManager.element.addEventListener("scroll",a.blurEvent),document.body.addEventListener("click",a.blurEvent),document.body.addEventListener("contextmenu",a.blurEvent),window.addEventListener("resize",a.blurEvent),document.body.addEventListener("keydown",a.escEvent)},100),document.body.appendChild(t),u+t.offsetHeight>=r&&(t.style.top="",o?t.style.bottom=r-d.top-o.offsetHeight-1+"px":t.style.bottom=r-u+"px"),(l+t.offsetWidth>=document.body.offsetWidth||this.positionReversedX)&&(t.style.left="",o?t.style.right=document.documentElement.offsetWidth-d.left+"px":t.style.right=document.documentElement.offsetWidth-l+"px",this.positionReversedX=!0)};ue.prototype.isOpen=function(){return!!this.menuElements.length};ue.prototype.escMenu=function(t){t.keyCode==27&&this.hideMenu()};ue.prototype.hideMenu=function(){this.menuElements.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}),document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent)};ue.prototype.menus={};p.prototype.registerModule("menu",ue);var xe=function(o){this.table=o,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};xe.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t};xe.prototype.initializeColumn=function(t){var o=this,n={},s;t.modules.frozen||(s=t.getElement(),n.mousemove=(function(a){t.parent===o.moving.parent&&((o.touchMove?a.touches[0].pageX:a.pageX)-p.prototype.helpers.elOffset(s).left+o.table.columnManager.element.scrollLeft>t.getWidth()/2?(o.toCol!==t||!o.toColAfter)&&(s.parentNode.insertBefore(o.placeholderElement,s.nextSibling),o.moveColumn(t,!0)):(o.toCol!==t||o.toColAfter)&&(s.parentNode.insertBefore(o.placeholderElement,s),o.moveColumn(t,!1)))}).bind(o),s.addEventListener("mousedown",function(a){o.touchMove=!1,a.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(a,t)},o.checkPeriod))}),s.addEventListener("mouseup",function(a){a.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(t)),t.modules.moveColumn=n};xe.prototype.bindTouchEvents=function(t){var o=this,n=t.getElement(),s=!1,a,r,l,u,d,c;n.addEventListener("touchstart",function(h){o.checkTimeout=setTimeout(function(){o.touchMove=!0,a=t.nextColumn(),l=a?a.getWidth()/2:0,r=t.prevColumn(),u=r?r.getWidth()/2:0,d=0,c=0,s=!1,o.startMove(h,t)},o.checkPeriod)},{passive:!0}),n.addEventListener("touchmove",function(h){var m,f;o.moving&&(o.moveHover(h),s||(s=h.touches[0].pageX),m=h.touches[0].pageX-s,m>0?a&&m-d>l&&(f=a,f!==t&&(s=h.touches[0].pageX,f.getElement().parentNode.insertBefore(o.placeholderElement,f.getElement().nextSibling),o.moveColumn(f,!0))):r&&-m-c>u&&(f=r,f!==t&&(s=h.touches[0].pageX,f.getElement().parentNode.insertBefore(o.placeholderElement,f.getElement()),o.moveColumn(f,!1))),f&&(a=f.nextColumn(),d=l,l=a?a.getWidth()/2:0,r=f.prevColumn(),c=u,u=r?r.getWidth()/2:0))},{passive:!0}),n.addEventListener("touchend",function(h){o.checkTimeout&&clearTimeout(o.checkTimeout),o.moving&&o.endMove(h)})};xe.prototype.startMove=function(t,o){var n=o.getElement();this.moving=o,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-p.prototype.helpers.elOffset(n).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=o.getWidth()+"px",this.placeholderElement.style.height=o.getHeight()+"px",n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)};xe.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})};xe.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})};xe.prototype.moveColumn=function(t,o){var n=this.moving.getCells();
7this.toCol=t,this.toColAfter=o,o?t.getCells().forEach(function(s,a){var r=s.getElement(!0);r.parentNode.insertBefore(n[a].getElement(),r.nextSibling)}):t.getCells().forEach(function(s,a){var r=s.getElement(!0);r.parentNode.insertBefore(n[a].getElement(),r)})};xe.prototype.endMove=function(t){(t.which===1||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))};xe.prototype.moveHover=function(t){var o=this,n=o.table.columnManager.getElement(),s=n.scrollLeft,a=(o.touchMove?t.touches[0].pageX:t.pageX)-p.prototype.helpers.elOffset(n).left+s,r;o.hoverElement.style.left=a-o.startX+"px",a-s<o.autoScrollMargin&&(o.autoScrollTimeout||(o.autoScrollTimeout=setTimeout(function(){r=Math.max(0,s-5),o.table.rowManager.getElement().scrollLeft=r,o.autoScrollTimeout=!1},1))),s+n.clientWidth-a<o.autoScrollMargin&&(o.autoScrollTimeout||(o.autoScrollTimeout=setTimeout(function(){r=Math.min(n.clientWidth,s+5),o.table.rowManager.getElement().scrollLeft=r,o.autoScrollTimeout=!1},1)))};p.prototype.registerModule("moveColumn",xe);var B=function(o){this.table=o,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1};B.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.classList.add("tabulator-row-placeholder"),t};B.prototype.initialize=function(t){this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements};B.prototype.setHandle=function(t){this.hasHandle=t};B.prototype.initializeGroupHeader=function(t){var o=this,n={};n.mouseup=(function(s){o.tableRowDrop(s,row)}).bind(o),n.mousemove=(function(s){if(s.pageY-p.prototype.helpers.elOffset(t.element).top+o.table.rowManager.element.scrollTop>t.getHeight()/2){if(o.toRow!==t||!o.toRowAfter){var a=t.getElement();a.parentNode.insertBefore(o.placeholderElement,a.nextSibling),o.moveRow(t,!0)}}else if(o.toRow!==t||o.toRowAfter){var a=t.getElement();a.previousSibling&&(a.parentNode.insertBefore(o.placeholderElement,a),o.moveRow(t,!1))}}).bind(o),t.modules.moveRow=n};B.prototype.initializeRow=function(t){var o=this,n={},s;n.mouseup=(function(a){o.tableRowDrop(a,t)}).bind(o),n.mousemove=(function(a){var r=t.getElement();a.pageY-p.prototype.helpers.elOffset(r).top+o.table.rowManager.element.scrollTop>t.getHeight()/2?(o.toRow!==t||!o.toRowAfter)&&(r.parentNode.insertBefore(o.placeholderElement,r.nextSibling),o.moveRow(t,!0)):(o.toRow!==t||o.toRowAfter)&&(r.parentNode.insertBefore(o.placeholderElement,r),o.moveRow(t,!1))}).bind(o),this.hasHandle||(s=t.getElement(),s.addEventListener("mousedown",function(a){a.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(a,t)},o.checkPeriod))}),s.addEventListener("mouseup",function(a){a.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=n};B.prototype.initializeCell=function(t){var o=this,n=t.getElement(!0);n.addEventListener("mousedown",function(s){s.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(s,t.row)},o.checkPeriod))}),n.addEventListener("mouseup",function(s){s.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t.row,n)};B.prototype.bindTouchEvents=function(t,o){var n=this,s=!1,a,r,l,u,d,c;o.addEventListener("touchstart",function(h){n.checkTimeout=setTimeout(function(){n.touchMove=!0,a=t.nextRow(),l=a?a.getHeight()/2:0,r=t.prevRow(),u=r?r.getHeight()/2:0,d=0,c=0,s=!1,n.startMove(h,t)},n.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,o.addEventListener("touchmove",function(h){var m,f;n.moving&&(h.preventDefault(),n.moveHover(h),s||(s=h.touches[0].pageY),m=h.touches[0].pageY-s,m>0?a&&m-d>l&&(f=a,f!==t&&(s=h.touches[0].pageY,f.getElement().parentNode.insertBefore(n.placeholderElement,f.getElement().nextSibling),n.moveRow(f,!0))):r&&-m-c>u&&(f=r,f!==t&&(s=h.touches[0].pageY,f.getElement().parentNode.insertBefore(n.placeholderElement,f.getElement()),n.moveRow(f,!1))),f&&(a=f.nextRow(),d=l,l=a?a.getHeight()/2:0,r=f.prevRow(),c=u,u=r?r.getHeight()/2:0))}),o.addEventListener("touchend",function(h){n.checkTimeout&&clearTimeout(n.checkTimeout),n.moving&&(n.endMove(h),n.touchMove=!1)})};B.prototype._bindMouseMove=function(){var t=this;
7t.table.rowManager.getDisplayRows().forEach(function(o){(o.type==="row"||o.type==="group")&&o.modules.moveRow.mousemove&&o.getElement().addEventListener("mousemove",o.modules.moveRow.mousemove)})};B.prototype._unbindMouseMove=function(){var t=this;t.table.rowManager.getDisplayRows().forEach(function(o){(o.type==="row"||o.type==="group")&&o.modules.moveRow.mousemove&&o.getElement().removeEventListener("mousemove",o.modules.moveRow.mousemove)})};B.prototype.startMove=function(t,o){var n=o.getElement();this.setStartPosition(t,o),this.moving=o,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=o.getWidth()+"px",this.placeholderElement.style.height=o.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(o)):(n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n)),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(t)};B.prototype.setStartPosition=function(t,o){var n=this.touchMove?t.touches[0].pageX:t.pageX,s=this.touchMove?t.touches[0].pageY:t.pageY,a,r;a=o.getElement(),this.connection?(r=a.getBoundingClientRect(),this.startX=r.left-n+window.pageXOffset,this.startY=r.top-s+window.pageYOffset):this.startY=s-a.getBoundingClientRect().top};B.prototype.endMove=function(t){(!t||t.which===1||this.touchMove)&&(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))};B.prototype.moveRow=function(t,o){this.toRow=t,this.toRowAfter=o};B.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)};B.prototype.moveHoverTable=function(t){var o=this.table.rowManager.getElement(),n=o.scrollTop,s=(this.touchMove?t.touches[0].pageY:t.pageY)-o.getBoundingClientRect().top+n;this.hoverElement.style.top=s-this.startY+"px"};B.prototype.moveHoverConnections=function(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"};B.prototype.elementRowDrop=function(t,o,n){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(t,o,n?n.getComponent():!1)};B.prototype.connectToTables=function(t){var o=this,n;this.connectionSelectorsTables&&(n=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,n),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:t})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(s){typeof s=="string"?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(s))):o.connectionElements.push(s)}
7),this.connectionElements.forEach(function(s){var a=function(l){o.elementRowDrop(l,s,o.moving)};s.addEventListener("mouseup",a),s.tabulatorElementDropEvent=a,s.classList.add("tabulator-movingrow-receiving")}))};B.prototype.disconnectFromTables=function(){var t;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(o){o.classList.remove("tabulator-movingrow-receiving"),o.removeEventListener("mouseup",o.tabulatorElementDropEvent),delete o.tabulatorElementDropEvent})};B.prototype.connect=function(t,o){var n=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=o,this.table.element.classList.add("tabulator-movingrow-receiving"),n.table.rowManager.getDisplayRows().forEach(function(s){s.type==="row"&&s.modules.moveRow&&s.modules.moveRow.mouseup&&s.getElement().addEventListener("mouseup",s.modules.moveRow.mouseup)}),n.tableRowDropEvent=n.tableRowDrop.bind(n),n.table.element.addEventListener("mouseup",n.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,o,t),!0)};B.prototype.disconnect=function(t){var o=this;t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(n){n.type==="row"&&n.modules.moveRow&&n.modules.moveRow.mouseup&&n.getElement().removeEventListener("mouseup",n.modules.moveRow.mouseup)}),o.table.element.removeEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,t)):console.warn("Move Row Error - trying to disconnect from non connected table")};B.prototype.dropComplete=function(t,o,n){var s=!1;if(n){switch(E(this.table.options.movableRowsSender)){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender;break}s?s.call(this,this.moving.getComponent(),o?o.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),o?o.getComponent():void 0,t)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),o?o.getComponent():void 0,t);this.endMove()};B.prototype.tableRowDrop=function(t,o){var n=!1,s=!1;switch(t.stopImmediatePropagation(),E(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver;break}n?s=n.call(this,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:o,success:s})};B.prototype.receivers={insert:function(o,n,s){return this.table.addRow(o.getData(),void 0,n),!0},add:function(o,n,s){return this.table.addRow(o.getData()),!0},update:function(o,n,s){return n?(n.update(o.getData()),!0):!1},replace:function(o,n,s){return n?(this.table.addRow(o.getData(),void 0,n),n.delete(),!0):!1}};B.prototype.senders={delete:function(o,n,s){o.delete()}};B.prototype.commsReceived=function(t,o,n){switch(o){case"connect":return this.connect(t,n.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,n.row,n.success)}};p.prototype.registerModule("moveRow",B);var ze=function(o){this.table=o,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};ze.prototype.initializeColumn=function(t){var o=this,n=!1,s={};
7this.allowedTypes.forEach(function(a){var r="mutator"+(a.charAt(0).toUpperCase()+a.slice(1)),l;t.definition[r]&&(l=o.lookupMutator(t.definition[r]),l&&(n=!0,s[r]={mutator:l,params:t.definition[r+"Params"]||{}}))}),n&&(t.modules.mutate=s)};ze.prototype.lookupMutator=function(t){var o=!1;switch(typeof t>"u"?"undefined":E(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t;break}return o};ze.prototype.transformRow=function(t,o,n){var s=this,a="mutator"+(o.charAt(0).toUpperCase()+o.slice(1)),r;return this.enabled&&s.table.columnManager.traverse(function(l){var u,d,c;l.modules.mutate&&(u=l.modules.mutate[a]||l.modules.mutate.mutator||!1,u&&(r=l.getFieldValue(typeof n<"u"?n:t),(o=="data"||typeof r<"u")&&(c=l.getComponent(),d=typeof u.params=="function"?u.params(r,t,o,c):u.params,l.setFieldValue(t,u.mutator(r,t,o,d,c)))))}),t};ze.prototype.transformCell=function(t,o){var n=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,s={};return n?(s=Object.assign(s,t.row.getData()),t.column.setFieldValue(s,o),n.mutator(o,s,"edit",n.params,t.getComponent())):o};ze.prototype.enable=function(){this.enabled=!0};ze.prototype.disable=function(){this.enabled=!1};ze.prototype.mutators={};p.prototype.registerModule("mutator",ze);var I=function(o){this.table=o,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};I.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))};I.prototype.generatePageSizeSelectList=function(){var t=this,o=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))o=this.table.options.paginationSizeSelector,this.pageSizes=o,this.pageSizes.indexOf(this.size)==-1&&o.unshift(this.size);else if(this.pageSizes.indexOf(this.size)==-1){o=[];for(var n=1;n<5;n++)o.push(this.size*n);this.pageSizes=o}else o=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);o.forEach(function(s){var a=document.createElement("option");a.value=s,s===!0?t.table.modules.localize.bind("pagination|all",function(r){a.innerHTML=r}):a.innerHTML=s,t.pageSizeSelect.appendChild(a)}),this.pageSizeSelect.value=this.size}};I.prototype.initialize=function(t){var o=this,n,s,a;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSe
7ntNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),o.table.modules.localize.bind("pagination|first",function(r){o.firstBut.innerHTML=r}),o.table.modules.localize.bind("pagination|first_title",function(r){o.firstBut.setAttribute("aria-label",r),o.firstBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|prev",function(r){o.prevBut.innerHTML=r}),o.table.modules.localize.bind("pagination|prev_title",function(r){o.prevBut.setAttribute("aria-label",r),o.prevBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|next",function(r){o.nextBut.innerHTML=r}),o.table.modules.localize.bind("pagination|next_title",function(r){o.nextBut.setAttribute("aria-label",r),o.nextBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|last",function(r){o.lastBut.innerHTML=r}),o.table.modules.localize.bind("pagination|last_title",function(r){o.lastBut.setAttribute("aria-label",r),o.lastBut.setAttribute("title",r)}),o.firstBut.addEventListener("click",function(){o.setPage(1).then(function(){}).catch(function(){})}),o.prevBut.addEventListener("click",function(){o.previousPage().then(function(){}).catch(function(){})}),o.nextBut.addEventListener("click",function(){o.nextPage().then(function(){}).catch(function(){})}),o.lastBut.addEventListener("click",function(){o.setPage(o.max).then(function(){}).catch(function(){})}),o.table.options.paginationElement&&(o.element=o.table.options.paginationElement),this.pageSizeSelect&&(n=document.createElement("label"),o.table.modules.localize.bind("pagination|page_size",function(r){o.pageSizeSelect.setAttribute("aria-label",r),o.pageSizeSelect.setAttribute("title",r),n.innerHTML=r}),o.element.appendChild(n),o.element.appendChild(o.pageSizeSelect),o.pageSizeSelect.addEventListener("change",function(r){o.setPageSize(o.pageSizeSelect.value=="true"?!0:o.pageSizeSelect.value),o.setPage(1).then(function(){}).catch(function(){})})),o.element.appendChild(o.firstBut),o.element.appendChild(o.prevBut),o.element.appendChild(o.pagesElement),o.element.appendChild(o.nextBut),o.element.appendChild(o.lastBut),!o.table.options.paginationElement&&!t&&o.table.footerManager.append(o.element,o),o.mode=o.table.options.pagination,o.table.options.paginationSize?o.size=o.table.options.paginationSize:(s=document.createElement("div"),s.classList.add("tabulator-row"),s.style.visibility=t,a=document.createElement("div"),a.classList.add("tabulator-cell"),a.innerHTML="Page Row Test",s.appendChild(a),o.table.rowManager.getTableElement().appendChild(s),o.size=Math.floor(o.table.rowManager.getElement().clientHeight/s.offsetHeight),o.table.rowManager.getTableElement().removeChild(s)),o.count=o.table.options.paginationButtonCount,o.generatePageSizeSelectList()};I.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0};I.prototype.setDisplayIndex=function(t){this.displayIndex=t};I.prototype.getDisplayIndex=function(){return this.displayIndex};I.prototype.setMaxRows=function(t){t?this.max=this.size===!0?1:Math.ceil(t/this.size):this.max=1,this.page>this.max&&(this.page=this.max)};I.prototype.reset=function(t,o){return(this.mode=="local"||t)&&(this.page=1),o&&(this.initialLoad=!0),!0};I.prototype.setMaxPage=function(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())};I.prototype.setPage=function(t){var o=this,n=this;switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return new Promise(function(s,a){t=parseInt(t),t>0&&t<=o.max||o.mode!=="local"?(o.page=t,o.trigger().then(function(){s()}).catch(function(){a()}),n.table.options.persistence&&n.table.modExists("persistence",!0)&&n.table.modules.persistence.config.page&&n.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+o.max+":",t),a())})};I.prototype.setPageToRow=function(t){var o=this;return new Promise(function(n,s){var a=o.table.rowManager.getDisplayRows(o.displayIndex-1),r=a.indexOf(t);if(r>-1){var l=o.size===!0?1:Math.ceil((r+1)/o.size);o.setPage(l).then(function(){n()}).catch(function(){s()})}else console.warn("Pagination Error - Requested row is not visible"),s()})};I.prototype.setPageSize=function(t){t!==!0&&(t=parseInt(t)),t>0&&(this.size=t),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.o
7ptions.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")};I.prototype._setPageButtons=function(){for(var t=this,o=Math.floor((this.count-1)/2),n=Math.ceil((this.count-1)/2),s=this.max-this.page+o+1<this.count?this.max-this.count+1:Math.max(this.page-o,1),a=this.page<=n?Math.min(this.count,this.max):Math.min(this.page+n,this.max);t.pagesElement.firstChild;)t.pagesElement.removeChild(t.pagesElement.firstChild);t.page==1?(t.firstBut.disabled=!0,t.prevBut.disabled=!0):(t.firstBut.disabled=!1,t.prevBut.disabled=!1),t.page==t.max?(t.lastBut.disabled=!0,t.nextBut.disabled=!0):(t.lastBut.disabled=!1,t.nextBut.disabled=!1);for(var r=s;r<=a;r++)r>0&&r<=t.max&&t.pagesElement.appendChild(t._generatePageButton(r));this.footerRedraw()};I.prototype._generatePageButton=function(t){var o=this,n=document.createElement("button");return n.classList.add("tabulator-page"),t==o.page&&n.classList.add("active"),n.setAttribute("type","button"),n.setAttribute("role","button"),o.table.modules.localize.bind("pagination|page_title",function(s){n.setAttribute("aria-label",s+" "+t),n.setAttribute("title",s+" "+t)}),n.setAttribute("data-page",t),n.textContent=t,n.addEventListener("click",function(s){o.setPage(t).then(function(){}).catch(function(){})}),n};I.prototype.previousPage=function(){var t=this;return new Promise(function(o,n){t.page>1?(t.page--,t.trigger().then(function(){o()}).catch(function(){n()}),t.table.options.persistence&&t.table.modExists("persistence",!0)&&t.table.modules.persistence.config.page&&t.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),n())})};I.prototype.nextPage=function(){var t=this;return new Promise(function(o,n){t.page<t.max?(t.page++,t.trigger().then(function(){o()}).catch(function(){n()}),t.table.options.persistence&&t.table.modExists("persistence",!0)&&t.table.modules.persistence.config.page&&t.table.modules.persistence.save("page")):(t.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+t.max+":",t.max+1),n())})};I.prototype.getPage=function(){return this.page};I.prototype.getPageMax=function(){return this.max};I.prototype.getPageSize=function(t){return this.size};I.prototype.getMode=function(){return this.mode};I.prototype.getRows=function(t){var o,n,s;if(this.mode=="local"){o=[],this.size===!0?(n=0,s=t.length):(n=this.size*(this.page-1),s=n+parseInt(this.size)),this._setPageButtons();for(var a=n;a<s;a++)t[a]&&o.push(t[a]);return o}else return this._setPageButtons(),t.slice(0)};I.prototype.trigger=function(){var t=this,o;return new Promise(function(n,s){switch(t.mode){case"local":o=t.table.rowManager.scrollLeft,t.table.rowManager.refreshActiveData("page"),t.table.rowManager.scrollHorizontal(o),t.table.options.pageLoaded.call(t.table,t.getPage()),n();break;case"remote":case"progressive_load":case"progressive_scroll":t.table.modules.ajax.blockActiveRequest(),t._getRemotePage().then(function(){n()}).catch(function(){s()});break;default:console.warn("Pagination Error - no such pagination mode:",t.mode),s()}})};I.prototype._getRemotePage=function(){var t=this,o=this,n,s;return new Promise(function(a,r){if(o.table.modExists("ajax",!0)||r(),n=p.prototype.helpers.deepClone(o.table.modules.ajax.getParams()||{}),s=o.table.modules.ajax.getParams(),s[t.dataSentNames.page]=o.page,t.size&&(s[t.dataSentNames.size]=t.size),t.table.options.ajaxSorting&&t.table.modExists("sort")){var l=o.table.modules.sort.getSort();l.forEach(function(d){delete d.column}),s[t.dataSentNames.sorters]=l}if(t.table.options.ajaxFiltering&&t.table.modExists("filter")){var u=o.table.modules.filter.getFilters(!0,!0);s[t.dataSentNames.filters]=u}o.table.modules.ajax.setParams(s),o.table.modules.ajax.sendRequest(t.progressiveLoad).then(function(d){o._parseRemoteData(d),a()}).catch(function(d){r()}),o.table.modules.ajax.setParams(n)})};I.prototype._parseRemoteData=function(s){var o=this,n,s,a;if(typeof s[this.dataReceivedNames.last_page]>"u"&&console.warn("Remote Pagination Error - Server response missing '"+this.dataReceivedNames.last_page+"' property"),s[this.dataReceivedNames.data]){if(this.max=parseInt(s[this.dataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":this.page==1?this.table.rowManager.setData(s[this.dataReceivedNames.data],!1,this.initialLoad&&this.page==1):this.table.rowManager.addRows(s[this.dataReceivedNames.data]),this.page<this.max&&setTimeout(function(){o.nextPage().then(function(){}).catch(function(){})}
7,o.table.options.ajaxProgressiveLoadDelay);break;case"progressive_scroll":s=this.table.rowManager.getData().concat(s[this.dataReceivedNames.data]),this.table.rowManager.setData(s,!0,this.initialLoad&&this.page==1),a=this.table.options.ajaxProgressiveLoadScrollMargin||this.table.rowManager.element.clientHeight*2,o.table.rowManager.element.scrollHeight<=o.table.rowManager.element.clientHeight+a&&o.nextPage().then(function(){}).catch(function(){});break}else n=this.table.rowManager.scrollLeft,this.table.rowManager.setData(s[this.dataReceivedNames.data],!1,this.initialLoad&&this.page==1),this.table.rowManager.scrollHorizontal(n),this.table.columnManager.scrollHorizontal(n),this.table.options.pageLoaded.call(this.table,this.getPage());this.initialLoad=!1}else console.warn("Remote Pagination Error - Server response missing '"+this.dataReceivedNames.data+"' property")};I.prototype.footerRedraw=function(){var t=this.table.footerManager.element;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))};I.prototype.paginationDataSentNames={page:"page",size:"size",sorters:"sorters",filters:"filters"};I.prototype.paginationDataReceivedNames={current_page:"current_page",last_page:"last_page",data:"data"};p.prototype.registerModule("page",I);var ne=function(o){this.table=o,this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1};ne.prototype.localStorageTest=function(){var t="_tabulator_test";try{return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch{return!1}};ne.prototype.initialize=function(){var t=this.table.options.persistenceMode,o=this.table.options.persistenceID,n;this.mode=t!==!0?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?typeof this.table.options.persistenceReaderFunc=="function"?this.readFunc=this.table.options.persistenceReaderFunc:this.readers[this.table.options.persistenceReaderFunc]?this.readFunc=this.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):this.readers[this.mode]?this.readFunc=this.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?typeof this.table.options.persistenceWriterFunc=="function"?this.writeFunc=this.table.options.persistenceWriterFunc:this.readers[this.table.options.persistenceWriterFunc]?this.writeFunc=this.readers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):this.writers[this.mode]?this.writeFunc=this.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(o||this.table.element.getAttribute("id")||""),this.config={sort:this.table.options.persistence===!0||this.table.options.persistence.sort,filter:this.table.options.persistence===!0||this.table.options.persistence.filter,group:this.table.options.persistence===!0||this.table.options.persistence.group,page:this.table.options.persistence===!0||this.table.options.persistence.page,columns:this.table.options.persistence===!0?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(n=this.retreiveData("page"),n&&(typeof n.paginationSize<"u"&&(this.config.page===!0||this.config.page.size)&&(this.table.options.paginationSize=n.paginationSize),typeof n.paginationInitialPage<"u"&&(this.config.page===!0||this.config.page.page)&&(this.table.options.paginationInitialPage=n.paginationInitialPage))),this.config.group&&(n=this.retreiveData("group"),n&&(typeof n.groupBy<"u"&&(this.config.group===!0||this.config.group.groupBy)&&(this.table.options.groupBy=n.groupBy),typeof n.groupStartOpen<"u"&&(this.config.group===!0||this.config.group.groupStartOpen)&&(this.table.options.groupStartOpen=n.groupStartOpen),typeof n.groupHeader<"u"&&(this.config.group===!0||this.config.group.groupHeader)&&(this.table.o
7ptions.groupHeader=n.groupHeader))),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns))};ne.prototype.initializeColumn=function(t){var o=this,n,s;this.config.columns&&(this.defWatcherBlock=!0,n=t.getDefinition(),s=this.config.columns===!0?Object.keys(n):this.config.columns,s.forEach(function(a){var r=Object.getOwnPropertyDescriptor(n,a),l=n[a];r&&Object.defineProperty(n,a,{set:function(d){l=d,o.defWatcherBlock||o.save("columns"),r.set&&r.set(d)},get:function(){return r.get&&r.get(),l}})}),this.defWatcherBlock=!1)};ne.prototype.load=function(t,o){var n=this.retreiveData(t);return o&&(n=n?this.mergeDefinition(o,n):o),n};ne.prototype.retreiveData=function(t){return this.readFunc?this.readFunc(this.id,t):!1};ne.prototype.mergeDefinition=function(t,o){var n=this,s=[];return o=o||[],o.forEach(function(a,r){var l=n._findColumn(t,a),u;l&&(n.config.columns===!0||n.config.columns==null?(u=Object.keys(l),u.push("width")):u=n.config.columns,u.forEach(function(d){d!=="columns"&&typeof a[d]<"u"&&(l[d]=a[d])}),l.columns&&(l.columns=n.mergeDefinition(l.columns,a.columns)),s.push(l))}),t.forEach(function(a,r){var l=n._findColumn(o,a);l||(s.length>r?s.splice(r,0,a):s.push(a))}),s};ne.prototype._findColumn=function(t,o){var n=o.columns?"group":o.field?"field":"object";return t.find(function(s){switch(n){case"group":return s.title===o.title&&s.columns.length===o.columns.length;case"field":return s.field===o.field;case"object":return s===o}})};ne.prototype.save=function(t){var o={};switch(t){case"columns":o=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":o=this.table.modules.filter.getFilters();break;case"sort":o=this.validateSorters(this.table.modules.sort.getSort());break;case"group":o=this.getGroupConfig();break;case"page":o=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,t,o)};ne.prototype.validateSorters=function(t){return t.forEach(function(o){o.column=o.field,delete o.field}),t};ne.prototype.getGroupConfig=function(){var t={};return this.config.group&&((this.config.group===!0||this.config.group.groupBy)&&(t.groupBy=this.table.options.groupBy),(this.config.group===!0||this.config.group.groupStartOpen)&&(t.groupStartOpen=this.table.options.groupStartOpen),(this.config.group===!0||this.config.group.groupHeader)&&(t.groupHeader=this.table.options.groupHeader)),t};ne.prototype.getPageConfig=function(){var t={};return this.config.page&&((this.config.page===!0||this.config.page.size)&&(t.paginationSize=this.table.modules.page.getPageSize()),(this.config.page===!0||this.config.page.page)&&(t.paginationInitialPage=this.table.modules.page.getPage())),t};ne.prototype.parseColumns=function(t){var o=this,n=[],s=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach(function(a){var r={},l=a.getDefinition(),u;a.isGroup?(r.title=l.title,r.columns=o.parseColumns(a.getColumns())):(r.field=a.getField(),o.config.columns===!0||o.config.columns==null?(u=Object.keys(l),u.push("width")):u=o.config.columns,u.forEach(function(d){switch(d){case"width":r.width=a.getWidth();break;case"visible":r.visible=a.visible;break;default:typeof l[d]!="function"&&s.indexOf(d)===-1&&(r[d]=l[d])}})),n.push(r)}),n};ne.prototype.readers={local:function(o,n){var s=localStorage.getItem(o+"-"+n);return s?JSON.parse(s):!1},cookie:function(o,n){var s=document.cookie,a=o+"-"+n,r=s.indexOf(a+"="),l,u;return r>-1&&(s=s.substr(r),l=s.indexOf(";"),l>-1&&(s=s.substr(0,l)),u=s.replace(a+"=","")),u?JSON.parse(u):!1}};ne.prototype.writers={local:function(o,n,s){localStorage.setItem(o+"-"+n,JSON.stringify(s))},cookie:function(o,n,s){var a=new Date;a.setDate(a.getDate()+1e4),document.cookie=o+"-"+n+"="+JSON.stringify(s)+"; expires="+a.toUTCString()}};p.prototype.registerModule("persistence",ne);var Ie=function(o){this.table=o,this.element=!1,this.manualBlock=!1};Ie.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))};Ie.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.o
7ptions.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))};Ie.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")};Ie.prototype.printFullscreen=function(t,o,n){var s=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable(typeof n<"u"?n:this.table.options.printConfig,typeof o<"u"?o:this.table.options.printStyled,t,"print"),d,c;this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),d=typeof this.table.options.printHeader=="function"?this.table.options.printHeader.call(this.table):this.table.options.printHeader,typeof d=="string"?r.innerHTML=d:r.appendChild(d),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),c=typeof this.table.options.printFooter=="function"?this.table.options.printFooter.call(this.table):this.table.options.printFooter,typeof c=="string"?l.innerHTML=c:l.appendChild(c),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(s,a),this.manualBlock=!1};p.prototype.registerModule("print",Ie);var Le=function(o){this.table=o,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};Le.prototype.watchData=function(t){var o=this,n;this.currentVersion++,n=this.currentVersion,o.unwatchData(),o.data=t,o.origFuncs.push=t.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments);return!o.blocked&&n===o.currentVersion&&a.forEach(function(r){o.table.rowManager.addRowActual(r,!1)}),o.origFuncs.push.apply(t,arguments)}}),o.origFuncs.unshift=t.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments);return!o.blocked&&n===o.currentVersion&&a.forEach(function(r){o.table.rowManager.addRowActual(r,!0)}),o.origFuncs.unshift.apply(t,arguments)}}),o.origFuncs.shift=t.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var a;return!o.blocked&&n===o.currentVersion&&o.data.length&&(a=o.table.rowManager.getRowFromDataObject(o.data[0]),a&&a.deleteActual()),o.origFuncs.shift.call(t)}}),o.origFuncs.pop=t.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var a;return!o.blocked&&n===o.currentVersion&&o.data.length&&(a=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]),a&&a.deleteActual()),o.origFuncs.pop.call(t)}}),o.origFuncs.splice=t.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments),r=a[0]<0?t.length+a[0]:a[0],l=a[1],u=a[2]?a.slice(2):!1,d;if(!o.blocked&&n===o.currentVersion){if(u&&(d=t[r]?o.table.rowManager.getRowFromDataObject(t[r]):!1,d?u.forEach(function(h){o.table.rowManager.addRowActual(h,!0,d,!0)}):(u=u.slice().reverse(),u.forEach(function(h){o.table.rowManager.addRowActual(h,!0,!1,!0)}))),l!==0){var c=t.slice(r,typeof a[1]>"u"?a[1]:r+l);c.forEach(function(h,m){var f=o.table.rowManager.getRowFromDataObject(h);f&&f.deleteActual(m!==c.length-1)})}(u||l!==0)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(t,arguments)}})};Le.prototype.unwatchData=function(){if(this.data!==!1)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})};Le.prototype.watchRow=function(t){var o=t.getData();this.blocked=!0;for(var n in o)this.watchKey(t,o,n);
7this.table.options.dataTree&&this.watchTreeChildren(t),this.blocked=!1};Le.prototype.watchTreeChildren=function(t){var o=this,n=t.getData()[this.table.options.dataTreeChildField],s={};function a(){o.table.modules.dataTree.initializeRow(t),o.table.modules.dataTree.layoutRow(t),o.table.rowManager.refreshActiveData("tree",!1,!0)}n&&(s.push=n.push,Object.defineProperty(n,"push",{enumerable:!1,configurable:!0,value:function(){var l=s.push.apply(n,arguments);return a(),l}}),s.unshift=n.unshift,Object.defineProperty(n,"unshift",{enumerable:!1,configurable:!0,value:function(){var l=s.unshift.apply(n,arguments);return a(),l}}),s.shift=n.shift,Object.defineProperty(n,"shift",{enumerable:!1,configurable:!0,value:function(){var l=s.shift.call(n);return a(),l}}),s.pop=n.pop,Object.defineProperty(n,"pop",{enumerable:!1,configurable:!0,value:function(){var l=s.pop.call(n);return a(),l}}),s.splice=n.splice,Object.defineProperty(n,"splice",{enumerable:!1,configurable:!0,value:function(){var l=s.splice.apply(n,arguments);return a(),l}}))};Le.prototype.watchKey=function(t,o,n){var s=this,a=Object.getOwnPropertyDescriptor(o,n),r=o[n],l=this.currentVersion;Object.defineProperty(o,n,{set:function(d){if(r=d,!s.blocked&&l===s.currentVersion){var c={};c[n]=d,t.updateData(c)}a.set&&a.set(d)},get:function(){return a.get&&a.get(),r}})};Le.prototype.unwatchRow=function(t){var o=t.getData();for(var n in o)Object.defineProperty(o,n,{value:o[n]})};Le.prototype.block=function(){this.blocked=!0};Le.prototype.unblock=function(){this.blocked=!1};p.prototype.registerModule("reactiveData",Le);var je=function(o){this.table=o,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};je.prototype.initializeColumn=function(t,o,n){var s=this,a=!1,r=this.table.options.resizableColumns;if(t==="header"&&(a=o.definition.formatter=="textarea"||o.definition.variableHeight,o.modules.resize={variableHeight:a}),r===!0||r==t){var l=document.createElement("div");l.className="tabulator-col-resize-handle";var u=document.createElement("div");u.className="tabulator-col-resize-handle prev",l.addEventListener("click",function(h){h.stopPropagation()});var d=function(m){var f=o.getLastColumn();f&&s._checkResizability(f)&&(s.startColumn=o,s._mouseDown(m,f,l))};l.addEventListener("mousedown",d),l.addEventListener("touchstart",d,{passive:!0}),l.addEventListener("dblclick",function(h){var m=o.getLastColumn();m&&s._checkResizability(m)&&(h.stopPropagation(),m.reinitializeWidth(!0))}),u.addEventListener("click",function(h){h.stopPropagation()});var c=function(m){var f,g,w;f=o.getFirstColumn(),f&&(g=s.table.columnManager.findColumnIndex(f),w=g>0?s.table.columnManager.getColumnByIndex(g-1):!1,w&&s._checkResizability(w)&&(s.startColumn=o,s._mouseDown(m,w,u)))};u.addEventListener("mousedown",c),u.addEventListener("touchstart",c,{passive:!0}),u.addEventListener("dblclick",function(h){var m,f,g;m=o.getFirstColumn(),m&&(f=s.table.columnManager.findColumnIndex(m),g=f>0?s.table.columnManager.getColumnByIndex(f-1):!1,g&&s._checkResizability(g)&&(h.stopPropagation(),g.reinitializeWidth(!0)))}),n.appendChild(l),n.appendChild(u)}};je.prototype._checkResizability=function(t){return typeof t.definition.resizable<"u"?t.definition.resizable:this.table.options.resizableColumns};je.prototype._mouseDown=function(t,o,n){var s=this;s.table.element.classList.add("tabulator-block-select");function a(l){s.table.rtl?o.setWidth(s.startWidth-((typeof l.screenX>"u"?l.touches[0].screenX:l.screenX)-s.startX)):o.setWidth(s.startWidth+((typeof l.screenX>"u"?l.touches[0].screenX:l.screenX)-s.startX)),s.table.options.virtualDomHoz&&s.table.vdomHoz.reinitialize(!0),!s.table.browserSlow&&o.modules.resize&&o.modules.resize.variableHeight&&o.checkCellHeights()}function r(l){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&o.modules.resize&&o.modules.resize.variableHeight&&o.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",a),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.table.o
7ptions.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,o.getComponent())}t.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=typeof t.screenX>"u"?t.touches[0].screenX:t.screenX,s.startWidth=o.getWidth(),document.body.addEventListener("mousemove",a),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",a,{passive:!0}),n.addEventListener("touchend",r)};p.prototype.registerModule("resizeColumns",je);var Ue=function(o){this.table=o,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};Ue.prototype.initializeRow=function(t){var o=this,n=t.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var a=document.createElement("div");a.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(u){u.stopPropagation()});var r=function(d){o.startRow=t,o._mouseDown(d,t,s)};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r,{passive:!0}),a.addEventListener("click",function(u){u.stopPropagation()});var l=function(d){var c=o.table.rowManager.prevDisplayRow(t);c&&(o.startRow=c,o._mouseDown(d,c,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),n.appendChild(s),n.appendChild(a)};Ue.prototype._mouseDown=function(t,o,n){var s=this;s.table.element.classList.add("tabulator-block-select");function a(l){o.setHeight(s.startHeight+((typeof l.screenY>"u"?l.touches[0].screenY:l.screenY)-s.startY))}function r(l){document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",a),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,o.getComponent())}t.stopPropagation(),s.startY=typeof t.screenY>"u"?t.touches[0].screenY:t.screenY,s.startHeight=o.getHeight(),document.body.addEventListener("mousemove",a),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",a,{passive:!0}),n.addEventListener("touchend",r)};p.prototype.registerModule("resizeRows",Ue);var Xe=function(o){this.table=o,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};Xe.prototype.initialize=function(t){var o=this,n=this.table,s;this.tableHeight=n.element.clientHeight,this.tableWidth=n.element.clientWidth,n.element.parentNode&&(this.containerHeight=n.element.parentNode.clientHeight,this.containerWidth=n.element.parentNode.clientWidth),typeof ResizeObserver<"u"&&n.rowManager.getRenderMode()==="virtual"?(this.autoResize=!0,this.observer=new ResizeObserver(function(a){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var r=Math.floor(a[0].contentRect.height),l=Math.floor(a[0].contentRect.width);(o.tableHeight!=r||o.tableWidth!=l)&&(o.tableHeight=r,o.tableWidth=l,n.element.parentNode&&(o.containerHeight=n.element.parentNode.clientHeight,o.containerWidth=n.element.parentNode.clientWidth),n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw())}}),this.observer.observe(n.element),s=window.getComputedStyle(n.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(s.getPropertyValue("max-height")||s.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(a){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var r=Math.floor(a[0].contentRect.height),l=Math.floor(a[0].contentRect.width);(o.containerHeight!=r||o.containerWidth!=l)&&(o.containerHeight=r,o.containerWidth=l,o.tableHeight=n.element.clientHeight,o.tableWidth=n.element.clientWidth),n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell)&&(n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw())},window.addEventListener("resize",this.binding))};Xe.prototype.clearBindings=function(t){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)};p.prototype.registerModule("resizeTable",Xe);var fe=function(o){this.table=o,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};fe.prototype.initialize=function(){var t=this,o=[];
7this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(u,d){u.modules.responsive&&u.modules.responsive.order&&u.modules.responsive.visible&&(u.modules.responsive.index=d,o.push(u),!u.visible&&t.mode==="collapse"&&t.hiddenColumns.push(u))}),o=o.reverse(),o=o.sort(function(u,d){var c=d.modules.responsive.order-u.modules.responsive.order;return c||d.modules.responsive.index-u.modules.responsive.index}),this.columns=o,this.mode==="collapse"&&this.generateCollapsedContent();for(var a=this.table.columnManager.columnsByIndex,n=Array.isArray(a),s=0,a=n?a:a[Symbol.iterator]();;){var r;if(n){if(s>=a.length)break;r=a[s++]}else{if(s=a.next(),s.done)break;r=s.value}var l=r;if(l.definition.formatter=="responsiveCollapse"){this.collapseHandleColumn=l;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())};fe.prototype.initializeColumn=function(t){var o=t.getDefinition();t.modules.responsive={order:typeof o.responsive>"u"?1:o.responsive,visible:o.visible!==!1}};fe.prototype.initializeRow=function(t){var o;t.type!=="calc"&&(o=document.createElement("div"),o.classList.add("tabulator-responsive-collapse"),t.modules.responsiveLayout={element:o,open:this.collapseStartOpen},this.collapseStartOpen||(o.style.display="none"))};fe.prototype.layoutRow=function(t){var o=t.getElement();t.modules.responsiveLayout&&(o.appendChild(t.modules.responsiveLayout.element),this.generateCollapsedRowContent(t))};fe.prototype.updateColumnVisibility=function(t,o){t.modules.responsive&&(t.modules.responsive.visible=o,this.initialize())};fe.prototype.hideColumn=function(t){var o=this.hiddenColumns.length;t.hide(!1,!0),this.mode==="collapse"&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent(),this.collapseHandleColumn&&!o&&this.collapseHandleColumn.show())};fe.prototype.showColumn=function(t){var o;t.show(!1,!0),t.setWidth(t.getWidth()),this.mode==="collapse"&&(o=this.hiddenColumns.indexOf(t),o>-1&&this.hiddenColumns.splice(o,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())};fe.prototype.update=function(){for(var t=this,o=!0;o;){var n=t.table.modules.layout.getMode()=="fitColumns"?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),s=(t.table.options.headerVisible?t.table.columnManager.element.clientWidth:t.table.element.clientWidth)-n;if(s<0){var a=t.columns[t.index];a?(t.hideColumn(a),t.index++):o=!1}else{var r=t.columns[t.index-1];r&&s>0&&s>=r.getWidth()?(t.showColumn(r),t.index--):o=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}};fe.prototype.generateCollapsedContent=function(){var t=this,o=this.table.rowManager.getDisplayRows();o.forEach(function(n){t.generateCollapsedRowContent(n)})};fe.prototype.generateCollapsedRowContent=function(t){var o,n;if(t.modules.responsiveLayout){for(o=t.modules.responsiveLayout.element;o.firstChild;)o.removeChild(o.firstChild);n=this.collapseFormatter(this.generateCollapsedRowData(t)),n&&o.appendChild(n)}};fe.prototype.generateCollapsedRowData=function(t){var o=this,n=t.getData(),s=[],a;return this.hiddenColumns.forEach(function(r){var l=r.getFieldValue(n);r.definition.title&&r.field&&(r.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(a={value:!1,data:{},getValue:function(){return l},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return r.getComponent()}}
7,s.push({field:r.field,title:r.definition.title,value:r.modules.format.formatter.call(o.table.modules.format,a,r.modules.format.params)})):s.push({field:r.field,title:r.definition.title,value:l}))}),s};fe.prototype.formatCollapsedData=function(t){var o=document.createElement("table");return t.forEach(function(n){var s=document.createElement("tr"),a=document.createElement("td"),r=document.createElement("td"),l,u=document.createElement("strong");a.appendChild(u),this.table.modules.localize.bind("columns|"+n.field,function(d){u.innerText=d||n.title}),n.value instanceof Node?(l=document.createElement("div"),l.appendChild(n.value),r.appendChild(l)):r.innerHTML=n.value,s.appendChild(a),s.appendChild(r),o.appendChild(s)},this),Object.keys(t).length?o:""};p.prototype.registerModule("responsiveLayout",fe);var se=function(o){this.table=o,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};se.prototype.clearSelectionData=function(t){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()};se.prototype.initializeRow=function(t){var o=this,n=t.getElement(),s=function a(){setTimeout(function(){o.selecting=!1},50),document.body.removeEventListener("mouseup",a)};t.modules.select={selected:!1},o.table.options.selectableCheck.call(this.table,t.getComponent())?(n.classList.add("tabulator-selectable"),n.classList.remove("tabulator-unselectable"),o.table.options.selectable&&o.table.options.selectable!="highlight"&&(o.table.options.selectableRangeMode==="click"?n.addEventListener("click",function(a){if(a.shiftKey){o.table._clearSelection(),o.lastClickedRow=o.lastClickedRow||t;var r=o.table.rowManager.getDisplayRowIndex(o.lastClickedRow),l=o.table.rowManager.getDisplayRowIndex(t),u=r<=l?r:l,d=r>=l?r:l,c=o.table.rowManager.getDisplayRows().slice(0),h=c.splice(u,d-u+1);a.ctrlKey||a.metaKey?(h.forEach(function(m){m!==o.lastClickedRow&&(o.table.options.selectable!==!0&&!o.isRowSelected(t)?o.selectedRows.length<o.table.options.selectable&&o.toggleRow(m):o.toggleRow(m))}),o.lastClickedRow=t):(o.deselectRows(void 0,!0),o.table.options.selectable!==!0&&h.length>o.table.options.selectable&&(h=h.slice(0,o.table.options.selectable)),o.selectRows(h)),o.table._clearSelection()}else a.ctrlKey||a.metaKey?(o.toggleRow(t),o.lastClickedRow=t):(o.deselectRows(void 0,!0),o.selectRows(t),o.lastClickedRow=t)}):(n.addEventListener("click",function(a){(!o.table.modExists("edit")||!o.table.modules.edit.getCurrentCell())&&o.table._clearSelection(),o.selecting||o.toggleRow(t)}),n.addEventListener("mousedown",function(a){if(a.shiftKey)return o.table._clearSelection(),o.selecting=!0,o.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),o.toggleRow(t),!1}),n.addEventListener("mouseenter",function(a){o.selecting&&(o.table._clearSelection(),o.toggleRow(t),o.selectPrev[1]==t&&o.toggleRow(o.selectPrev[0]))}),n.addEventListener("mouseout",function(a){o.selecting&&(o.table._clearSelection(),o.selectPrev.unshift(t))})))):(n.classList.add("tabulator-unselectable"),n.classList.remove("tabulator-selectable"))};se.prototype.toggleRow=function(t){this.table.options.selectableCheck.call(this.table,t.getComponent())&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))};se.prototype.selectRows=function(t){var o=this,n;switch(typeof t>"u"?"undefined":E(t)){case"undefined":this.table.rowManager.rows.forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged();break;case"string":n=this.table.rowManager.findRow(t),n?this._selectRow(n,!0,!0):this.table.rowManager.getRows(t).forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(t)?(t.forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged()):this._selectRow(t,!1,!0);break}};se.prototype._selectRow=function(t,o,n){if(!isNaN(this.table.options.selectable)&&this.table.options.selectable!==!0&&!n&&this.selectedRows.length>=this.table.options.selectable)if(this.table.options.selectableRollingSelection)this._deselectRow(this.selectedRows[0]);else return!1;var s=this.table.rowManager.findRow(t);s?this.selectedRows.indexOf(s)==-1&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.o
7ptions.dataTreeSelectPropagate&&this.childRowSelection(s,!0),o||this.table.options.rowSelected.call(this.table,s.getComponent()),this._rowSelectionChanged(o)):o||console.warn("Selection Error - No such row found, ignoring selection:"+t)};se.prototype.isRowSelected=function(t){return this.selectedRows.indexOf(t)!==-1};se.prototype.deselectRows=function(t,o){var n=this,s;if(typeof t>"u"){s=n.selectedRows.length;for(var a=0;a<s;a++)n._deselectRow(n.selectedRows[0],!0);n._rowSelectionChanged(o)}else Array.isArray(t)?(t.forEach(function(r){n._deselectRow(r,!0)}),n._rowSelectionChanged(o)):n._deselectRow(t,o)};se.prototype._deselectRow=function(t,o){var n=this,s=n.table.rowManager.findRow(t),a;s?(a=n.selectedRows.findIndex(function(r){return r==s}),a>-1&&(s.getElement().classList.remove("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(a,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),o||n.table.options.rowDeselected.call(this.table,s.getComponent()),n._rowSelectionChanged(o))):o||console.warn("Deselection Error - No such row found, ignoring selection:"+t)};se.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(o){t.push(o.getData())}),t};se.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(o){t.push(o.getComponent())}),t};se.prototype._rowSelectionChanged=function(t){this.headerCheckboxElement&&(this.selectedRows.length===0?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),t||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.get
7SelectedRows())};se.prototype.registerRowSelectCheckbox=function(t,o){t._row.modules.select||(t._row.modules.select={}),t._row.modules.select.checkboxEl=o};se.prototype.registerHeaderSelectCheckbox=function(t){this.headerCheckboxElement=t};se.prototype.childRowSelection=function(t,o){var n=this.table.modules.dataTree.getChildren(t,!0);if(o)for(var r=n,s=Array.isArray(r),a=0,r=s?r:r[Symbol.iterator]();;){var l;if(s){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var u=l;this._selectRow(u,!0)}else for(var h=n,d=Array.isArray(h),c=0,h=d?h:h[Symbol.iterator]();;){var m;if(d){if(c>=h.length)break;m=h[c++]}else{if(c=h.next(),c.done)break;m=c.value}var f=m;this._deselectRow(f,!0)}};p.prototype.registerModule("selectRow",se);var pe=function(o){this.table=o,this.sortList=[],this.changed=!1};pe.prototype.initializeColumn=function(t,o){var n=this,s=!1,a,r;switch(E(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?s=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter;break}t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:typeof t.definition.headerSortTristate<"u"?t.definition.headerSortTristate:this.table.options.headerSortTristate},(typeof t.definition.headerSort>"u"?this.table.options.headerSort!==!1:t.definition.headerSort!==!1)&&(a=t.getElement(),a.classList.add("tabulator-sortable"),r=document.createElement("div"),r.classList.add("tabulator-col-sorter"),E(this.table.options.headerSortElement)=="object"?r.appendChild(this.table.options.headerSortElement):r.innerHTML=this.table.options.headerSortElement,o.appendChild(r),t.modules.sort.element=r,a.addEventListener("click",function(l){var u="",d=[],c=!1;if(t.modules.sort){if(t.modules.sort.tristate)t.modules.sort.dir=="none"?u=t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?u=t.modules.sort.dir=="asc"?"desc":"asc":u="none";else switch(t.modules.sort.dir){case"asc":u="desc";break;case"desc":u="asc";break;default:u=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(l.shiftKey||l.ctrlKey)?(d=n.getSort(),c=d.findIndex(function(h){return h.field===t.getField()}),c>-1?(d[c].dir=u,c!=d.length-1&&(c=d.splice(c,1)[0],u!="none"&&d.push(c))):u!="none"&&d.push({column:t,dir:u}),n.setSort(d)):u=="none"?n.clear():n.setSort(t,u),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))};pe.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t};pe.prototype.getSort=function(){var t=this,o=[];return t.sortList.forEach(function(n){n.column&&o.push({column:n.column.getComponent(),field:n.column.getField(),dir:n.dir})}),o};pe.prototype.setSort=function(t,o){var n=this,s=[];Array.isArray(t)||(t=[{column:t,dir:o}]),t.forEach(function(a){var r;r=n.table.columnManager.findColumn(a.column),r?(a.column=r,s.push(a),n.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",a.column)}),n.sortList=s,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")};pe.prototype.clear=function(){this.setSort([])};pe.prototype.findSorter=function(t){var o=this.table.rowManager.activeRows[0],n="string",s,a;if(o&&(o=o.getData(),s=t.getField(),s))switch(a=t.getFieldValue(o),typeof a>"u"?"undefined":E(a)){case"undefined":n="string";break;case"boolean":n="boolean";break;default:!isNaN(a)&&a!==""?n="number":a.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(n="alphanum");break}return this.sorters[n]};pe.prototype.sort=function(t){var o=this,n=this.table.options.sortOrderReverse?o.sortList.slice().reverse():o.sortList,s=[],a=[];o.table.options.dataSorting&&o.table.options.dataSorting.call(o.table,o.getSort()),o.clearColumnHeaders(),o.table.options.ajaxSorting?n.forEac
7h(function(r,l){o.setColumnHeader(r.column,r.dir)}):(n.forEach(function(r,l){var u=r.column.modules.sort;r.column&&u&&(u.sorter||(u.sorter=o.findSorter(r.column)),r.params=typeof u.params=="function"?u.params(r.column.getComponent(),r.dir):u.params,s.push(r)),o.setColumnHeader(r.column,r.dir)}),s.length&&o._sortItems(t,s)),o.table.options.dataSorted&&(t.forEach(function(r){a.push(r.getComponent())}),o.table.options.dataSorted.call(o.table,o.getSort(),a))};pe.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})};pe.prototype.setColumnHeader=function(t,o){t.modules.sort.dir=o,t.getElement().setAttribute("aria-sort",o)};pe.prototype._sortItems=function(t,o){var n=this,s=o.length-1;t.sort(function(a,r){for(var l,u=s;u>=0;u--){var d=o[u];if(l=n._sortRow(a,r,d.column,d.dir,d.params),l!==0)break}return l})};pe.prototype._sortRow=function(t,o,n,s,a){var r,l,u=s=="asc"?t:o,d=s=="asc"?o:t;return t=n.getFieldValue(u.getData()),o=n.getFieldValue(d.getData()),t=typeof t<"u"?t:"",o=typeof o<"u"?o:"",r=u.getComponent(),l=d.getComponent(),n.modules.sort.sorter.call(this,t,o,r,l,n.getComponent(),s,a)};pe.prototype.sorters={number:function(o,n,s,a,r,l,u){var d=u.alignEmptyValues,c=u.decimalSeparator,h=u.thousandSeparator,m=0;if(o=String(o),n=String(n),h&&(o=o.split(h).join(""),n=n.split(h).join("")),c&&(o=o.split(c).join("."),n=n.split(c).join(".")),o=parseFloat(o),n=parseFloat(n),isNaN(o))m=isNaN(n)?0:-1;else if(isNaN(n))m=1;else return o-n;return(d==="top"&&l==="desc"||d==="bottom"&&l==="asc")&&(m*=-1),m},string:function(o,n,s,a,r,l,u){var d=u.alignEmptyValues,c=0,h;if(!o)c=n?-1:0;else if(!n)c=1;else{switch(E(u.locale)){case"boolean":u.locale&&(h=this.table.modules.localize.getLocale());break;case"string":h=u.locale;break}return String(o).toLowerCase().localeCompare(String(n).toLowerCase(),h)}return(d==="top"&&l==="desc"||d==="bottom"&&l==="asc")&&(c*=-1),c},date:function(o,n,s,a,r,l,u){return u.format||(u.format="DD/MM/YYYY"),this.sorters.datetime.call(this,o,n,s,a,r,l,u)},time:function(o,n,s,a,r,l,u){return u.format||(u.format="HH:mm"),this.sorters.datetime.call(this,o,n,s,a,r,l,u)},datetime:function(o,n,s,a,r,l,u){var d=u.format||"DD/MM/YYYY HH:mm:ss",c=u.alignEmptyValues,h=0;
7if(typeof moment<"u"){if(o=moment(o,d),n=moment(n,d),!o.isValid())h=n.isValid()?-1:0;else if(!n.isValid())h=1;else return o-n;return(c==="top"&&l==="desc"||c==="bottom"&&l==="asc")&&(h*=-1),h}else console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(o,n,s,a,r,l,u){var d=o===!0||o==="true"||o==="True"||o===1?1:0,c=n===!0||n==="true"||n==="True"||n===1?1:0;return d-c},array:function(o,n,s,a,r,l,u){var d=0,c=0,h=u.type||"length",m=u.alignEmptyValues,f=0;function g(w){switch(h){case"length":return w.length;case"sum":return w.reduce(function(b,y){return b+y});case"max":return Math.max.apply(null,w);case"min":return Math.min.apply(null,w);case"avg":return w.reduce(function(b,y){return b+y})/w.length}}if(!Array.isArray(o))m=Array.isArray(n)?-1:0;else if(!Array.isArray(n))m=1;else return d=o?g(o):0,c=n?g(n):0,d-c;return(m==="top"&&l==="desc"||m==="bottom"&&l==="asc")&&(f*=-1),f},exists:function(o,n,s,a,r,l,u){var d=typeof o>"u"?0:1,c=typeof n>"u"?0:1;return d-c},alphanum:function(o,n,s,a,r,l,u){var d,c,h,m,f=0,g,w=/(\d+)|(\D+)/g,b=/\d/,y=u.alignEmptyValues,x=0;if(!o&&o!==0)x=!n&&n!==0?0:-1;else if(!n&&n!==0)x=1;else{if(isFinite(o)&&isFinite(n))return o-n;if(d=String(o).toLowerCase(),c=String(n).toLowerCase(),d===c)return 0;if(!(b.test(d)&&b.test(c)))return d>c?1:-1;for(d=d.match(w),c=c.match(w),g=d.length>c.length?c.length:d.length;f<g;)if(h=d[f],m=c[f++],h!==m)return isFinite(h)&&isFinite(m)?(h.charAt(0)==="0"&&(h="."+h),m.charAt(0)==="0"&&(m="."+m),h-m):h>m?1:-1;return d.length>c.length}return(y==="top"&&l==="desc"||y==="bottom"&&l==="asc")&&(x*=-1),x}};p.prototype.registerModule("sort",pe);var Se=function(o){this.table=o,this.invalidCells=[]};Se.prototype.initializeColumn=function(t){var o=this,n=[],s;t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(a){s=o._extractValidator(a),s&&n.push(s)}):(s=this._extractValidator(t.definition.validator),s&&n.push(s)),t.modules.validate=n.length?n:!1)};Se.prototype._extractValidator=function(t){var o,n,s;switch(typeof t>"u"?"undefined":E(t)){case"string":return s=t.indexOf(":"),s>-1?(o=t.substring(0,s),n=t.substring(s+1)):o=t,this._buildValidator(o,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}};Se.prototype._buildValidator=function(t,o){var n=typeof t=="function"?t:this.validators[t];return n?{type:typeof t=="function"?"function":t,func:n,params:o}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)};Se.prototype.validate=function(t,o,n){var s=this,a=[],r=this.invalidCells.indexOf(o);return t&&t.forEach(function(l){l.func.call(s,o.getComponent(),n,l.params)||a.push({type:l.type,parameters:l.params})}
7),a=a.length?a:!0,o.modules.validate||(o.modules.validate={}),a===!0?(o.modules.validate.invalid=!1,o.getElement().classList.remove("tabulator-validation-fail"),r>-1&&this.invalidCells.splice(r,1)):(o.modules.validate.invalid=!0,this.table.options.validationMode!=="manual"&&o.getElement().classList.add("tabulator-validation-fail"),r==-1&&this.invalidCells.push(o)),a};Se.prototype.getInvalidCells=function(){var t=[];return this.invalidCells.forEach(function(o){t.push(o.getComponent())}),t};Se.prototype.clearValidation=function(t){var o;t.modules.validate&&t.modules.validate.invalid&&(t.getElement().classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,o=this.invalidCells.indexOf(t),o>-1&&this.invalidCells.splice(o,1))};Se.prototype.validators={integer:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(n=Number(n),typeof n=="number"&&isFinite(n)&&Math.floor(n)===n)},float:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(n=Number(n),typeof n=="number"&&isFinite(n)&&n%1!==0)},numeric:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:!isNaN(n)},string:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:isNaN(n)},max:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:parseFloat(n)<=s},min:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:parseFloat(n)>=s},starts:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).toLowerCase().startsWith(String(s).toLowerCase())},ends:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).toLowerCase().endsWith(String(s).toLowerCase())},minLength:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).length>=s},maxLength:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).length<=s},in:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(typeof s=="string"&&(s=s.split("|")),n===""||s.indexOf(n)>-1)},regex:function(o,n,s){if(n===""||n===null||typeof n>"u")return!0;var a=new RegExp(s);return a.test(n)},unique:function(o,n,s){if(n===""||n===null||typeof n>"u")return!0;var a=!0,r=o.getData(),l=o.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(u){var d=u.getData();d!==r&&n==l.getFieldValue(d)&&(a=!1)}),a},required:function(o,n,s){return n!==""&&n!==null&&typeof n<"u"}};p.prototype.registerModule("validate",Se);export{p as T};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.