diff --git a/SQLite.viewer.podspec b/SQLite.viewer.podspec index f78b1e9..04faf40 100644 --- a/SQLite.viewer.podspec +++ b/SQLite.viewer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SQLite.viewer' - s.version = '3.0.2' + s.version = '3.0.3' s.summary = 'An elegant library for debugging sqlite databases in iOS applications' s.homepage = 'https://github.com/sergeymild/SQLite.viewer' s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/SQLiteViewer.xcodeproj/project.pbxproj b/SQLiteViewer.xcodeproj/project.pbxproj index 290a004..d41c19a 100644 --- a/SQLiteViewer.xcodeproj/project.pbxproj +++ b/SQLiteViewer.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 9227304C24F675E2005EE2C9 /* css in Resources */ = {isa = PBXBuildFile; fileRef = 9227304824F675E2005EE2C9 /* css */; }; + 9227304D24F675E2005EE2C9 /* js in Resources */ = {isa = PBXBuildFile; fileRef = 9227304924F675E2005EE2C9 /* js */; }; + 9227304E24F675E2005EE2C9 /* favicon.ico in Resources */ = {isa = PBXBuildFile; fileRef = 9227304A24F675E2005EE2C9 /* favicon.ico */; }; + 9227304F24F675E2005EE2C9 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 9227304B24F675E2005EE2C9 /* index.html */; }; 924E147924F2770A00E5ECE5 /* GetWifiAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924E147824F2770A00E5ECE5 /* GetWifiAddress.swift */; }; 92EDE97224F4C9E8004C998E /* JSONConvertors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92EDE97124F4C9E8004C998E /* JSONConvertors.swift */; }; - 92EDE98024F50261004C998E /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 92EDE97C24F50261004C998E /* index.html */; }; - 92EDE98124F50261004C998E /* css in Resources */ = {isa = PBXBuildFile; fileRef = 92EDE97D24F50261004C998E /* css */; }; - 92EDE98224F50261004C998E /* js in Resources */ = {isa = PBXBuildFile; fileRef = 92EDE97E24F50261004C998E /* js */; }; - 92EDE98324F50261004C998E /* favicon.ico in Resources */ = {isa = PBXBuildFile; fileRef = 92EDE97F24F50261004C998E /* favicon.ico */; }; 9D4A4F5F1F2E2FED000AF312 /* SQLiteViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D4A4F5D1F2E2FED000AF312 /* SQLiteViewer.swift */; }; 9D4A4F671F2E321E000AF312 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D4A4F661F2E321E000AF312 /* Tests.swift */; }; 9D4A4F691F2E321E000AF312 /* SQLiteViewer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DEE21F91F097812001E5F78 /* SQLiteViewer.framework */; }; @@ -35,12 +35,12 @@ /* Begin PBXFileReference section */ 1A11A312BFA0934DF31C98DA /* Pods-SQLiteViewerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SQLiteViewerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SQLiteViewerTests/Pods-SQLiteViewerTests.debug.xcconfig"; sourceTree = ""; }; 3F93D726511CE84ACF473AED /* Pods_SQLiteViewerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SQLiteViewerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9227304824F675E2005EE2C9 /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; path = css; sourceTree = ""; }; + 9227304924F675E2005EE2C9 /* js */ = {isa = PBXFileReference; lastKnownFileType = folder; path = js; sourceTree = ""; }; + 9227304A24F675E2005EE2C9 /* favicon.ico */ = {isa = PBXFileReference; lastKnownFileType = image.ico; path = favicon.ico; sourceTree = ""; }; + 9227304B24F675E2005EE2C9 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; 924E147824F2770A00E5ECE5 /* GetWifiAddress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetWifiAddress.swift; sourceTree = ""; }; 92EDE97124F4C9E8004C998E /* JSONConvertors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONConvertors.swift; sourceTree = ""; }; - 92EDE97C24F50261004C998E /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - 92EDE97D24F50261004C998E /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; path = css; sourceTree = ""; }; - 92EDE97E24F50261004C998E /* js */ = {isa = PBXFileReference; lastKnownFileType = folder; path = js; sourceTree = ""; }; - 92EDE97F24F50261004C998E /* favicon.ico */ = {isa = PBXFileReference; lastKnownFileType = image.ico; path = favicon.ico; sourceTree = ""; }; 9D4A4F5D1F2E2FED000AF312 /* SQLiteViewer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteViewer.swift; sourceTree = ""; }; 9D4A4F641F2E321E000AF312 /* SQLiteViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SQLiteViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9D4A4F661F2E321E000AF312 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; @@ -90,10 +90,10 @@ 9D4A4F5B1F2E2FED000AF312 /* Assets */ = { isa = PBXGroup; children = ( - 92EDE97D24F50261004C998E /* css */, - 92EDE97F24F50261004C998E /* favicon.ico */, - 92EDE97C24F50261004C998E /* index.html */, - 92EDE97E24F50261004C998E /* js */, + 9227304824F675E2005EE2C9 /* css */, + 9227304A24F675E2005EE2C9 /* favicon.ico */, + 9227304B24F675E2005EE2C9 /* index.html */, + 9227304924F675E2005EE2C9 /* js */, ); path = Assets; sourceTree = ""; @@ -265,10 +265,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 92EDE98124F50261004C998E /* css in Resources */, - 92EDE98224F50261004C998E /* js in Resources */, - 92EDE98324F50261004C998E /* favicon.ico in Resources */, - 92EDE98024F50261004C998E /* index.html in Resources */, + 9227304C24F675E2005EE2C9 /* css in Resources */, + 9227304F24F675E2005EE2C9 /* index.html in Resources */, + 9227304D24F675E2005EE2C9 /* js in Resources */, + 9227304E24F675E2005EE2C9 /* favicon.ico in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sources/Assets/index.html b/Sources/Assets/index.html index 33d9877..77efe96 100644 --- a/Sources/Assets/index.html +++ b/Sources/Assets/index.html @@ -1 +1 @@ -db_viewer
\ No newline at end of file +db_viewer
\ No newline at end of file diff --git a/Sources/Assets/js/app.01f46d27.js b/Sources/Assets/js/app.01f46d27.js new file mode 100644 index 0000000..7ef7452 --- /dev/null +++ b/Sources/Assets/js/app.01f46d27.js @@ -0,0 +1,2 @@ +(function(e){function t(t){for(var i,n,r=t[0],l=t[1],u=t[2],c=0,d=[];c=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw s}}}}function w(e,t){if(e){if("string"===typeof e)return E(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oEMPTY",VARCHAR:"EMPTY",REAL:0,BLOB:0},filterOperators:{"=":"=","<>":"<>","<":"<",">":">","<=":"<=",">=":">=",IN:"IN","NOT IN":"NOT IN","IS NULL":"IS NULL",BETWEEN:"BETWEEN","NOT BETWEEN":"NOT BETWEEN",contains:"contains","Not contains":"Not contains","Has prefix":"Has prefix","Has suffix":"Has suffix"},operatorInputPlaceholder:{"=":"EMPTY","<>":"EMPTY","<":"EMPTY",">":"EMPTY","<=":"EMPTY",">=":"EMPTY",IN:"1,2,3","NOT IN":"1,2,3","IS NULL":"","IS NOT NULL":"",BETWEEN:"1 AND 100","NOT BETWEEN":"1 AND 100",contains:"Pattern","Not contains":"Pattern","Has suffix":"Pattern","Has prefix":"Pattern"},operatorString:{"=":function(e){return"= '".concat(e,"'")},"<>":function(e){return"<> '".concat(e,"'")},"<":function(e){return"< '".concat(e,"'")},">":function(e){return"> '".concat(e,"'")},"<=":function(e){return"<= '".concat(e,"'")},">=":function(e){return">= '".concat(e,"'")},IN:function(e){return"IN (".concat(e,")")},"NOT IN":function(e){return"NOT IN (".concat(e,")")},"IS NULL":function(){return"IS NULL"},"IS NOT NULL":function(){return"IS NOT NULL"},BETWEEN:function(e){return"BETWEEN ".concat(e)},"NOT BETWEEN":function(e){return"NOT BETWEEN ".concat(e)},contains:function(e){return"LIKE '%".concat(e,"%'")},"Not contains":function(e){return"NOT LIKE '%".concat(e,"%'")},"Has suffix":function(e){return"LIKE '%".concat(e,"'")},"Has prefix":function(e){return"LIKE '".concat(e,"%'")}},operatorValueValidators:{"=":/.+/,"<>":/.+/,"<":/.+/,">":/.+/,"<=":/.+/,">=":/.+/,IN:/(.+?)(?:,|$)/,"NOT IN":/(.+?)(?:,|$)/,"IS NULL":/\s{0}/,"IS NOT NULL":/\s{0}/,BETWEEN:/\w+\s(and|AND)\s\w+/,"NOT BETWEEN":/\w+\s(and|AND)\s\w+/,contains:/.+/,"Not contains":/.+/,"Has suffix":/.+/,"Has prefix":/.+/},selectQuery:function(e,t){var o,i="",n=[],s=y(t);try{for(s.s();!(o=s.n()).done;){var a=o.value;if(a.value){var r=C.operatorString[a.operator](a.value);n.push('("'.concat(a.column," ").concat(r,'")'))}}}catch(l){s.e(l)}finally{s.f()}return 0===n.length?null:(i+=" ".concat(n.join(" AND ").replace(/"/g,"")),i)}},x={provider:C},R=function(e,t,o){return null===o||void 0===o?"NULL":"BLOB"===e.type?"BLOB":o||("surname"===e&&console.log(e,o,!!o),x.provider.defaultValues[t])},M=R,L={props:["id","column","row","updateValue"],data:function(){return{allowEdit:!1,isInEditMode:!1,updatedValue:null}},computed:{value:function(){return M(this.column,this.row)},inputModel:{set:function(e){this.updatedValue=e},get:function(){return this.value}}},methods:{handleRowClick:function(){var e=this;this.allowEdit&&(this.isInEditMode=!this.isInEditMode,this.$nextTick((function(){return e.$refs.updateValueInput.focus()})))},saveValue:function(){this.isInEditMode=!this.isInEditMode,this.updateValue(this.id,this.column,this.updatedValue)}}},T=L,k=Object(l["a"])(T,b,v,!1,null,null,null),D=k.exports,S=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("thead",[o("tr",e._l(e.columns,(function(t){return t?o("th",{key:t.__id,attrs:{"data-c":e.current,"data-eq":""+(e.current===t.name),"data-type":e.orderType},on:{click:function(o){return o.preventDefault(),e.orderClick(t.name)}}},[o("div",{staticStyle:{display:"flex","flex-direction":"row"}},[o("span",{staticStyle:{flex:"1 1 auto"}},[e._v(e._s(t.name))]),e.current===t.name?o("i",{class:"asc"===e.type.toLowerCase()?"sort-descending":"sort-ascending"}):e._e(),e.current!==t.name?o("div",{staticStyle:{width:"14px",height:"2px"}}):e._e()])]):e._e()})),0)])},H=[],P={props:{columns:Array,current:String,type:String,orderHandler:Function},mounted:function(){console.log(this.columns,this.current)},computed:{orderType:function(){return"asc"===this.type.toLowerCase()?"desc":"asc"}},methods:{orderClick:function(e){this.orderHandler(this.orderType,e)}}},A=P,z=Object(l["a"])(A,S,H,!1,null,null,null),F=z.exports,_=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"table-filters",staticStyle:{"min-height":"42px",position:"relative"}},[e._l(e.filters,(function(t,i){return o("div",{staticClass:"table-filter"},[o("select",{directives:[{name:"model",rawName:"v-model",value:t.column,expression:"f.column"}],staticClass:"mr-0-5",attrs:{name:"column"},on:{change:[function(o){var i=Array.prototype.filter.call(o.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(t,"column",o.target.multiple?i:i[0])},function(o){return e.handleColumnChange(t)}]}},e._l(e.columns,(function(t){return o("option",{domProps:{value:t.name}},[e._v(e._s(t.name)+" ")])})),0),o("select",{directives:[{name:"model",rawName:"v-model",value:t.operator,expression:"f.operator"}],staticClass:"mr-0-5",attrs:{name:"filter"},on:{change:[function(o){var i=Array.prototype.filter.call(o.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(t,"operator",o.target.multiple?i:i[0])},function(o){return e.handleOperatorChange(t)}]}},e._l(e.filterOperators,(function(t){return o("option",{domProps:{value:t}},[e._v(e._s(t)+" ")])})),0),o("input",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"f.value"}],staticClass:"mr-0-5",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.value},on:{input:[function(o){o.target.composing||e.$set(t,"value",o.target.value)},function(o){return e.validateInputValue(t)}]}}),o("button",{staticClass:"btn-octicon mr-0-5",on:{click:function(t){return t.preventDefault(),e.addFilter(t)}}},[e._v("+ ")]),o("button",{class:"btn-octicon mr-0-5",on:{click:function(t){return t.preventDefault(),e.removeFilter(i)}}},[e._v("- ")]),o("button",{staticClass:"btn btn-primary",attrs:{disabled:!t.isButtonEnabled},on:{click:function(t){return t.preventDefault(),e.apply(t)}}},[e._v("Apply")])])})),0===e.filters.length?o("button",{staticClass:"btn btn-primary",staticStyle:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:"8px"},on:{click:function(t){return t.preventDefault(),e.addFilter(t)}}},[e._v("Add Filter")]):e._e()],2)},N=[],O={props:{database:String,table:String,columns:Array,applyFilters:Function},data:function(){var e=Object.keys(x.provider.filterOperators),t=this.$store.getters.getFilters(this.database,this.table);return{filterOperators:e,value:null,filters:t}},watch:{filters:function(){var e=Math.max(42,42*this.filters.length);this.$store.commit("updateTableFiltersHeight",e)}},methods:{handleOperatorChange:function(e){e.placeholder=x.provider.operatorInputPlaceholder[e.operator],this.apply()},handleColumnChange:function(e){this.apply()},validateInputValue:function(e){e.isButtonEnabled=x.provider.operatorValueValidators[e.operator].test(e.value),e.isButtonEnabled&&this.apply()},removeFilter:function(e){i["a"].delete(this.filters,e),this.apply()},addFilter:function(){var e;this.filters.push({value:null,column:null===(e=this.columns[0])||void 0===e?void 0:e.name,operator:this.filterOperators[0],placeholder:x.provider.operatorInputPlaceholder[this.filterOperators[0]],isButtonEnabled:!1})},apply:function(){this.applyFilters(this.filters),this.save()},save:function(){this.$store.commit("updateByKey",{database:this.database,table:this.table,key:"filters",value:JSON.stringify(this.filters)})}}},B=O,I=Object(l["a"])(B,_,N,!1,null,null,null),j=I.exports,V=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"limit-offset",style:"bottom: "+e.sqlLogsHeight+"px"},[o("div",{staticClass:"mr-1-em"}),o("label",{staticClass:"mr-0-5",attrs:{for:"limit"}},[e._v("Limit")]),o("input",{staticClass:"mr-1-em",staticStyle:{"max-width":"80px"},attrs:{type:"number",name:"limit",min:"0",id:"limit"},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",t.target.valueAsNumber)}}}),o("button",{staticClass:"btn btn-primary",on:{click:function(t){return t.preventDefault(),e.resetOrderTypeLimit(t)}}},[e._v("Reset")])])},W=[],G={props:{value:Number,resetOrderTypeLimit:Function},computed:{sqlLogsHeight:function(){return this.$store.state.sqlLogsHeight}}},U=G,q=(o("ce1f"),Object(l["a"])(U,V,W,!1,null,"65c31891",null)),Y=q.exports,$=o("6d09"),X=o.n($);function K(e,t,o,i,n,s,a){try{var r=e[s](a),l=r.value}catch(u){return void o(u)}r.done?t(l):Promise.resolve(l).then(i,n)}function J(e){return function(){var t=this,o=arguments;return new Promise((function(i,n){var s=e.apply(t,o);function a(e){K(s,i,n,a,r,"next",e)}function r(e){K(s,i,n,a,r,"throw",e)}a(void 0)}))}}var Q={components:{Row:D,TableHeader:F,TableFilters:j,LimitOffset:Y},data:function(){return{key:this.$route.fullPath,columns:[],columnTypes:{},rowsCount:0,tableData:null,skippedFirstLimitChange:!1,limit:20,offset:0,order:1,type:"asc",clause:null}},mounted:function(){this.table&&this.setup()},computed:{table:function(){var e=this.$route.params.table;return this.$store.state.tables.find((function(t){return t.tableName===e}))},tableFilterHeight:function(){return this.$store.state.tableFiltersHeight}},watch:{table:function(){this.setup()},limit:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"limit",value:this.limit}),this.tableData.setPageSize(this.limit),this.tableData.setMaxPage(Math.round(this.rowsCount/this.limit))},order:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"order",value:this.order})},type:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"type",value:this.type})}},methods:{setup:function(){var e=this;console.log("setup");var t=this.$route.params.database;this.columns=this.table.columns.sort((function(e){return e.cid})),this.table.columns.forEach((function(t){return e.columnTypes[t.name]=t.type})),this.rowsCount=this.table.count,this.limit=this.$store.getters.getLimit(t,this.table.tableName),this.order=this.$store.getters.getByKey(t,this.table.tableName,"order")||"1",this.type=this.$store.getters.getByKey(t,this.table.tableName,"type")||"asc";var o=this.$store.getters.getFilters(t,this.table.tableName);(null===o||void 0===o?void 0:o.length)>0&&(this.clause=x.provider.selectQuery(this.table.tableName,o)),this.tableData=new X.a(".table-data",{height:"100%",layout:"fitColumns",placeholder:"No Data Set",columnHeaderSortMulti:!1,ajaxSorting:!0,ajaxLoader:!1,ajaxURL:"https://local",ajaxFiltering:!0,paginationSize:this.limit,paginationInitialPage:1,pagination:"remote",ajaxRequestFunc:function(){var t=J(f.a.mark((function t(o,i,n){var s,a,r,l,u,c,d,h,p;return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("ajaxRequestFunc",o,i,n),n.sorters){t.next=3;break}return t.abrupt("return");case 3:return s=e.$route.query,a=s.type,r=s.order,s.clause,l=n.sorters[0]||{dir:a,field:r},u=l.dir,c=l.field,e.order=c,e.type=u,d=n.page,h=n.size,e.offset=d-1,t.next=12,e.fetchData();case 12:if(t.t0=t.sent,t.t0){t.next=15;break}t.t0=[];case 15:return p=t.t0,t.abrupt("return",{data:p,last_page:Math.round(e.rowsCount/h)});case 17:case"end":return t.stop()}}),t)})));function o(e,o,i){return t.apply(this,arguments)}return o}(),initialSort:[{column:this.order,dir:this.type}],data:[],columns:this.columns.map((function(t){return{title:t.name,field:t.name,vertAlign:"middle",formatter:function(t,o,i){var n=t.getColumn().getField();return M(n,e.columnTypes[n],t.getValue())}}}))}),this.tableData.setMaxPage(Math.round(this.rowsCount/this.limit))},resetOrderTypeLimit:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"limit",value:20}),this.$store.commit("updateByKey",{database:t,table:o,key:"order",value:1}),this.$store.commit("updateByKey",{database:t,table:o,key:"type",value:"asc"}),this.order=1,this.type="asc",this.limit=20,this.tableData.setData()},fetchData:function(){var e=this;return J(f.a.mark((function t(){var o,i,n,s,a,r,l,u;return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=e.$route.params,i=o.database,n=o.table,s="".concat(e.order," ").concat(e.type),a=isNaN(e.limit)?20:e.limit,r=isNaN(e.offset)?0:e.offset,l={type:"rows",databaseName:i,tableName:n,order:s,limit:"".concat(a),offset:"".concat(r*a),clause:e.clause},console.log("fetchData",l),t.next=8,g["a"].sendRequest(l);case 8:return u=t.sent,t.abrupt("return",u.data.rows);case 10:case"end":return t.stop()}}),t)})))()},applyFilters:function(e){var t=this;return J(f.a.mark((function o(){var i;return f.a.wrap((function(o){while(1)switch(o.prev=o.next){case 0:i=t.$route.params.table,t.clause=x.provider.selectQuery(i,e),t.tableData.setData();case 3:case"end":return o.stop()}}),o)})))()}}},Z=Q,ee=Object(l["a"])(Z,h,p,!1,null,null,null),te=ee.exports,oe=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"col-11 p-2 mx-auto col-md-6"},[o("div",{staticClass:"Box"},[e._m(0),e._l(e.databases,(function(t){return o("div",{staticClass:"Box-body"},[o("router-link",{attrs:{to:"/database/"+t}},[e._v(e._s(t))])],1)}))],2)])},ie=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"Box-header"},[o("h3",{staticClass:"Box-title"},[e._v(" Choose database ")])])}];function ne(e,t,o,i,n,s,a){try{var r=e[s](a),l=r.value}catch(u){return void o(u)}r.done?t(l):Promise.resolve(l).then(i,n)}function se(e){return function(){var t=this,o=arguments;return new Promise((function(i,n){var s=e.apply(t,o);function a(e){ne(s,i,n,a,r,"next",e)}function r(e){ne(s,i,n,a,r,"throw",e)}a(void 0)}))}}var ae={data:function(){return{databases:[]}},mounted:function(){var e=this;return se(f.a.mark((function t(){return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,g["a"].open();case 2:return t.next=4,g["a"].sendRequest({type:"databases"});case 4:if(e.databases=t.sent.data,1!==e.databases.length){t.next=8;break}return t.next=8,e.$router.replace("/database/".concat(e.databases[0]));case 8:case"end":return t.stop()}}),t)})))()}},re=ae,le=Object(l["a"])(re,oe,ie,!1,null,null,null),ue=le.exports;i["a"].use(d["a"]);var ce=[{path:"/",name:"Databases",component:ue},{path:"/database/:database",name:"database",component:function(){return o.e("about").then(o.bind(null,"076a"))},children:[{path:"table/:table",component:te,name:"table"}]},{path:"/not-found",name:"NotFound",component:o.e("about").then(o.bind(null,"9703"))},{path:"*",redirect:"/not-found"}],de=new d["a"]({mode:"history",base:"/",routes:ce}),he=de,pe=o("2f62");i["a"].use(pe["a"]);var me=new pe["a"].Store({state:{selectedRow:null,tables:[],databases:[],tablesSidebarWidth:250,isTablesSideBarHidden:!1,isSqlLogsHidden:!1,sqlLogsHeight:200,tableFiltersHeight:42},mutations:{setDatabases:function(e,t){e.databases=t},setTables:function(e,t){e.tables=t},updateByKey:function(e,t){var o=t.value,i=t.database,n=t.table,s=t.key;localStorage.setItem("".concat(i,"_").concat(n,"_").concat(s),o)},updateOffset:function(e,t,o,i){localStorage.setItem("".concat(t,"_").concat(o,"_offset"),i)},updateSqlLogsHeight:function(e,t){e.sqlLogsHeight=t},updateTableFiltersHeight:function(e,t){e.tableFiltersHeight=t},updateTablesSidebarWidth:function(e,t){e.tablesSidebarWidth=t},toggleTablesSideBarHidden:function(e){e.isTablesSideBarHidden=!e.isTablesSideBarHidden,e.tablesSidebarWidth=e.isTablesSideBarHidden?1:250},toggleSqlLogsHidden:function(e){e.isSqlLogsHidden=!e.isSqlLogsHidden,e.sqlLogsHeight=e.isSqlLogsHidden?1:200}},actions:{},modules:{},getters:{getLimit:function(e){return function(e,t){var o=localStorage.getItem("".concat(e,"_").concat(t,"_limit"));return parseInt(o||20,10)}},getByKey:function(e){return function(e,t,o){return localStorage.getItem("".concat(e,"_").concat(t,"_").concat(o))}},getFilters:function(e){return function(e,t){var o=localStorage.getItem("".concat(e,"_").concat(t,"_filters"));return o?JSON.parse(o):[]}},getTablePrimaryKey:function(e){return function(t){var o,i;return null===(o=e.tables.find((function(e){return e.tableName===t})))||void 0===o||null===(i=o.columns.find((function(e){return 1===e.pk})))||void 0===i?void 0:i.name}}}}),fe=o("fb19"),ge=o.n(fe);o("278f"),o("fb98");i["a"].config.productionTip=!1,i["a"].component("vue-draggable-resizable",ge.a),new i["a"]({router:he,store:me,render:function(e){return e(c)}}).$mount("#app")},"6d09":function(t,o,n){var s,a;function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var l="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)};(function(e,i){"object"===l(o)&&"undefined"!==typeof t?t.exports=i():(s=i,a="function"===typeof s?s.call(o,n,o,t):s,void 0===a||(t.exports=a))})(0,(function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!==typeof e)throw new TypeError("predicate must be a function");var i=arguments[1],n=0;while(n>>0;if("function"!==typeof e)throw new TypeError("predicate must be a function");var i=arguments[1],n=0;while(n>>0;if(0===i)return!1;var n=0|t,s=Math.max(n>=0?n:i-Math.abs(n),0);function a(e,t){return e===t||"number"===typeof e&&"number"===typeof t&&isNaN(e)&&isNaN(t)}while(so?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){for(var n in t=e[0],t){var s={field:n,title:n},a=t[n];switch("undefined"===typeof a?"undefined":l(a)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(a)?"array":"string";break;default:o=isNaN(a)||""===a?a.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number";break}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){var o=this;while(o.headersElement.firstChild)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),e.forEach((function(e,t){o._addColumn(e)})),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var i=new n(e,this),s=i.getElement(),a=o?this.findColumnIndex(o):o;if(o&&a>-1){var r=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(r,0,i),l.parentNode.insertBefore(s,l)):(this.columns.splice(r+1,0,i),l.parentNode.insertBefore(s,l.nextSibling))}else t?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},t.prototype.registerColumnField=function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach((function(e){var o;e.clearVerticalAlign(),o=e.getHeight(),o>t&&(t=o)})),e.columns.forEach((function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=("undefined"===typeof e?"undefined":l(e)))return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement){var i=t.columns.find((function(t){return t.element===e}));return i||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach((function(i){var n=i.split(".")[0];n===e&&o.push(t.columnsByField[i])})),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){e=this.columnsByIndex.findIndex((function(e){return e.visible}));return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){var t=this;t.columnsByIndex.forEach((function(t,o){e(t,o)}))},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach((function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())})),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach((function(e){t.push(e.getDefinition(!0))})),t},t.prototype.getComponents=function(e){var t=this,o=[],i=e?t.columns:t.columnsByIndex;return i.forEach((function(e){o.push(e.getComponent())})),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,o),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),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.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")},t.prototype._moveColumnInArray=function(e,t,o,i,n){var s,a=e.indexOf(t);a>-1&&(e.splice(a,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=a,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach((function(e){if(e.cells.length){var t=e.cells.splice(a,1)[0];e.cells.splice(s,0,t)}})))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,a=0,r=e.getElement();return new Promise((function(l,u){if("undefined"===typeof t&&(t=i.table.options.scrollToColumnPosition),"undefined"===typeof o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":a=-i.element.clientWidth/2;break;case"right":a=r.clientWidth-i.headersElement.clientWidth;break}if(!o&&(s=r.offsetLeft,s>0&&s+r.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s="undefined"==typeof i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)})),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i._addColumn(e,t,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&a.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(a)}))},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(h.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1||e?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),e&&(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()};var o=function(e){this._column=e,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e},o.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},o.prototype.isVisible=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){return this._column.delete()},o.prototype.getSubColumns=function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e},o.prototype.getParentColumn=function(){return this._column.parent instanceof n&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},o.prototype.setHeaderFilterValue=function(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(e){return!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e)},o.prototype.validate=function(){return this._column.validate()};var n=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!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.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach((function(t,o){var n=new e(t,i);i.attachColumn(n)})),i.checkColumnVisibility()):o.registerColumnField(this),t.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};n.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},n.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},n.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))},n.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},n.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)},n.prototype._mapDepricatedFunctionality=function(){"undefined"!==typeof this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),"undefined"!==typeof this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),"undefined"!==typeof this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},n.prototype.setTooltip=function(){var e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,(function(o){e.element.setAttribute("title",o||t.title)})):e.element.setAttribute("title",t.title):("function"==typeof o&&(o=o(e.getComponent()),!1===o&&(o="")),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},n.prototype._buildHeader=function(){var e=this,t=e.definition;while(e.element.firstChild)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&("undefined"!==typeof t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",(function(t){e.setTooltip()}))},n.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",(function(e){n.headerClick(e,i.getComponent())})),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",(function(e){n.headerDblClick(e,i.getComponent())})),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",(function(e){n.headerContext(e,i.getComponent())})),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",(function(e){o=!0}),{passive:!0}),i.element.addEventListener("touchend",(function(e){o&&n.headerTap(e,i.getComponent()),o=!1}))),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",(function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout((function(){clearTimeout(e),e=null}),300)}))),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",(function(e){clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())}),1e3)}),{passive:!0}),i.element.addEventListener("touchend",(function(e){clearTimeout(t),t=null}))),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},n.prototype._buildColumnHeader=function(){var e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),"undefined"!=typeof t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),"undefined"!=typeof t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),l(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),"undefined"!=typeof t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){var i=t.cssClass.split(" ");i.forEach((function(t){e.element.classList.add(t)}))}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth("undefined"==typeof t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign="undefined"==typeof e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign="undefined"==typeof e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},n.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},n.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())})),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,(function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")})):e._formatColumnHeaderTitle(i,t.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(e,t){var o,i,n,s,a,r=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),a=function(e){r.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},n=this.definition.titleFormatterParams||{},n="function"===typeof n?n():n,i=o.call(this.table.modules.format,s,n,a),"undefined"===typeof i?"undefined":l(i)){case"object":i instanceof Node?e.appendChild(i):(e.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:",i));break;case"undefined":case"null":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},n.prototype._buildGroupHeader=function(){var e=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 t=this.definition.cssClass.split(" ");t.forEach((function(t){e.element.classList.add(t)}))}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(e){return e[this.field]},n.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},n.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},n.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},n.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},n.prototype.reinitializeWidth=function(e){this.widthFixed=!1,"undefined"===typeof this.definition.width||e||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()},n.prototype.fitToData=function(){var e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach((function(e){var o=e.getWidth();o>t&&(t=o)})),t&&e.setWidthActual(t+1))},n.prototype.updateDefinition=function(e){var t=this;return new Promise((function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then((function(e){n.field==t.field&&(t.field=!1),t.delete().then((function(){o(e.getComponent())})).catch((function(e){i(e)}))})).catch((function(e){i(e)})))}))},n.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","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","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],n.prototype.getComponent=function(){return this.component||(this.component=new o(this)),this.component};var s=function(e){this.table=e,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};s.prototype.createHolderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},s.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},s.prototype.setColumnManager=function(e){this.columnManager=e},s.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",(function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t})),"virtual"===this.renderMode&&e.element.addEventListener("scroll",(function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t}))},s.prototype.findRow=function(e){var t=this;if("object"!=("undefined"===typeof e?"undefined":l(e))){if("undefined"==typeof e||null===e)return!1;var o=t.rows.find((function(o){return o.data[t.table.options.index]==e}));return o||!1}if(e instanceof r)return e;if(e instanceof a)return e._getSelf()||!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement){var i=t.rows.find((function(t){return t.element===e}));return i||!1}return!1},s.prototype.getRowFromDataObject=function(e){var t=this.rows.find((function(t){return t.data===e}));return t||!1},s.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},s.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),a=e.getElement(),r=0;return new Promise((function(e,l){if(s>-1){if("undefined"===typeof t&&(t=n.table.options.scrollToRowPosition),"undefined"===typeof o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=h.prototype.helpers.elOffset(a).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top";break}if(!o&&h.prototype.helpers.elVisible(a)&&(r=h.prototype.helpers.elOffset(a).top-h.prototype.helpers.elOffset(n.element).top,r>0&&r-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.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")},s.prototype.addRow=function(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},s.prototype.addRows=function(e,t,o){var i=this,n=this,s=[];return new Promise((function(a,r){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length-1,("undefined"==typeof o&&t||"undefined"!==typeof o&&!t)&&e.reverse(),e.forEach((function(e,i){var a=n.addRow(e,t,o,!0);s.push(a)})),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(s)}))},s.prototype.findAddRowPos=function(e){return"undefined"===typeof e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},s.prototype.addRowActual=function(e,t,o,i){var n,s,a=e instanceof r?e:new r(e||{},this),l=this.findAddRowPos(t),u=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==c.indexOf(o)?l?c[0]!==a&&(o=c[0],this._moveRowInArray(a.getGroup().rows,a,o,!l)):c[c.length-1]!==a&&(o=c[c.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!l)):this._moveRowInArray(a.getGroup().rows,a,o,!l))}return o&&(u=this.rows.indexOf(o)),o&&u>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator((function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,a)})),n>-1&&this.activeRows.splice(l?n:n+1,0,a),this.rows.splice(l?u:u+1,0,a)):l?(this.displayRowIterator((function(e){e.unshift(a)})),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator((function(e){e.push(a)})),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),a},s.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},s.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator((function(n){i._moveRowInArray(n,e,t,o)})),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof H&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},s.prototype._moveRowInArray=function(e,t,o,i){var n,s,a,r;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){a=nn?s:n+1;for(var l=a;l<=r;l++)e[l]&&this.styleRow(e[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},s.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},s.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1))&&o},s.prototype.getData=function(e,t){var o=[],i=this.getRows(e);return i.forEach((function(e){"row"==e.type&&o.push(e.getData(t||"data"))})),o},s.prototype.getComponents=function(e){var t=[],o=this.getRows(e);return o.forEach((function(e){t.push(e.getComponent())})),t},s.prototype.getDataCount=function(e){var t=this.getRows(e);return t.length},s.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach((function(e){delete e.column})),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}console.log("======-=-=",o.pagination,i),o.pagination,t.modules.ajax.sendRequest().then((function(t){e._setDataActual(t,!0)})).catch((function(e){}))},s.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then((function(){})).catch((function(){}))):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then((function(){})).catch((function(){})):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?(console.log(t.modules.page),("remote"===o.pagination||o.progressiveLoad)&&t.modExists("page")?t.modules.page.setPage(t.modules.page.page).then((function(){})).catch((function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then((function(){})).catch((function(){})):this._genRemoteRequest()):this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},s.prototype.refreshActiveData=function(e,t,o){var i,n=this,s=this.table,a=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)(!this.redrawBlockRestoreConfig||a.indexOf(e)=0))break;s=r}else if(t-a[r].getElement().offsetTop>=0)n=r;else{if(i=!0,!(o-a[r].getElement().offsetTop>=0))break;s=r}}else n=this.vDomTop,s=this.vDomBottom;return a.slice(n,s+1)},s.prototype.displayRowIterator=function(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},s.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(s[a]){var r=t-s[a].getElement().offsetTop;if(!(!1===i||Math.abs(r)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(c=!1),i.vDomBottom++,u++}e?(i.vDomTopPad=t?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-r-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((r+l)/u),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+r+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",t&&(this.scrollTop=i.vDomTopPad+l+o-(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&&t&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=c?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},s.prototype.scrollVertical=function(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],a=s.getHeight()||this.vDomRowHeight;e>=a&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=a,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=a,this.vDomTop--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},s.prototype._addBottomRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=a&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=a,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=a,this.vDomBottom++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},s.prototype._quickNormalizeRowHeight=function(e){e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()})),e.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach((function(e){e.normalizeHeight()}))},s.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"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||(e=this.table.modExists("resizeTable"),(e&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw())}},s.prototype.reinitialize=function(){this.rows.forEach((function(e){e.reinitialize()}))},s.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},s.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},s.prototype.redraw=function(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},s.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var a=function(e){this._row=e};a.prototype.getData=function(e){return this._row.getData(e)},a.prototype.getElement=function(){return this._row.getElement()},a.prototype.getCells=function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e},a.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},a.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},a.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},a.prototype.delete=function(){return this._row.delete()},a.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},a.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},a.prototype.move=function(e,t){this._row.moveToRow(e,t)},a.prototype.update=function(e){return this._row.updateData(e)},a.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},a.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},a.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},a.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},a.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},a.prototype._getSelf=function(){return this._row},a.prototype.validate=function(){return this._row.validate()},a.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},a.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},a.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){var e=this._row.table.modules.frozenRows.rows.indexOf(this._row);return e>-1}return!1},a.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},a.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},a.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},a.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},a.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},a.prototype.addTreeChild=function(e,t,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,e,t,o)},a.prototype.reformat=function(){return this._row.reinitialize()},a.prototype.getGroup=function(){return this._row.getGroup().getComponent()},a.prototype.getTable=function(){return this._row.table},a.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},a.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),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.setData(e),this.generateElement()};r.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var e,t,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",(function(e){i.table.options.rowClick(e,i.getComponent())})),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",(function(e){i.table.options.rowDblClick(e,i.getComponent())})),i.table.options.rowContext&&i.element.addEventListener("contextmenu",(function(e){i.table.options.rowContext(e,i.getComponent())})),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",(function(e){i.table.options.rowMouseEnter(e,i.getComponent())})),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",(function(e){i.table.options.rowMouseLeave(e,i.getComponent())})),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",(function(e){i.table.options.rowMouseOver(e,i.getComponent())})),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",(function(e){i.table.options.rowMouseOut(e,i.getComponent())})),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",(function(e){i.table.options.rowMouseMove(e,i.getComponent())})),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",(function(e){o=!0}),{passive:!0}),i.element.addEventListener("touchend",(function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1}))),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",(function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout((function(){clearTimeout(e),e=null}),300)}))),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",(function(e){clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())}),1e3)}),{passive:!0}),i.element.addEventListener("touchend",(function(e){clearTimeout(t),t=null})))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(e){var t=this;if(!t.initialized||e){t.deleteCells();while(t.element.firstChild)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach((function(e){t.element.appendChild(e.getElement()),e.cellRendered()})),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach((function(e){var o=e.getHeight();o>t&&(t=o)})),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},r.prototype.setCellHeight=function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0},r.prototype.clearCellHeight=function(){this.cells.forEach((function(e){e.clearHeight()}))},r.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},r.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},r.prototype.getHeight=function(){return this.outerHeight},r.prototype.getWidth=function(){return this.element.offsetWidth},r.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},r.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},r.prototype.updateData=function(e){var t,o=this,i=h.prototype.helpers.elVisible(this.element),n={};return new Promise((function(s,a){for(var r in"string"===typeof e&&(e=JSON.parse(e)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e,t)o.data[r]=t[r];for(var r in o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock(),e){var l=o.table.columnManager.getColumnsByFieldRoot(r);l.forEach((function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}}))}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()}))},r.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},r.prototype.getCell=function(e){var t=!1;return e=this.table.columnManager.findColumn(e),t=this.cells.find((function(t){return t.column===e})),t},r.prototype.getCellIndex=function(e){return this.cells.findIndex((function(t){return t===e}))},r.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&h.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},r.prototype.getCells=function(){return this.cells},r.prototype.nextRow=function(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1},r.prototype.prevRow=function(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1},r.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},r.prototype.validate=function(){var e=[];return this.cells.forEach((function(t){t.validate()||e.push(t.getComponent())})),!e.length||e},r.prototype.delete=function(){var e=this;return new Promise((function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,i=n.indexOf(e),i&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e),i&&(i=e.table.rowManager.rows[i-1])),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()}))},r.prototype.deleteActual=function(e){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,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!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))},r.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)},r.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.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(e)||/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(e.substr(0,4))},h.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},h.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},h.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise((function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",(function(e){var s,a=n.files[0],r=new FileReader;r.readAsText(a),r.onload=function(e){try{s=JSON.parse(r.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t.setData(s).then((function(e){o(e)})).catch((function(e){o(e)}))},r.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}})),n.click()}))},h.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},h.prototype._setData=function(e,t,o,i,n){var s=this;if("string"===typeof e){if(0==e.indexOf("{")||0==e.indexOf("["))return s.rowManager.setData(JSON.parse(e),i,n);if(s.modExists("ajax",!0))return t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)}else if(console.log("========",e),!e)return s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n)},h.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},h.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},h.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},h.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},h.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},h.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},h.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},h.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},h.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},h.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise((function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then((function(){i--,i||n()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))},h.prototype.addData=function(e,t,o){var i=this;return new Promise((function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),n(t)})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))},h.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise((function(s,a){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then((function(){n--,i.push(t.getComponent()),n||s(i)})):o.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||s(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))},h.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},h.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},h.prototype.deleteRow=function(e){var t=this;return new Promise((function(o,i){var n=t,s=0,a=0,r=[];function l(){s++,s==e.length&&a&&(n.rowManager.reRenderInPosition(),o())}Array.isArray(e)||(e=[e]),e.forEach((function(e){var o=t.rowManager.findRow(e,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),l())})),r.sort((function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1})),r.forEach((function(e){e.delete().then((function(){a++,l()})).catch((function(e){l(),i(e)}))}))}))},h.prototype.addRow=function(e,t,o){var i=this;return new Promise((function(n,s){"string"===typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then((function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())}))}))},h.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise((function(i,n){var s=o.rowManager.findRow(e);"string"===typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then((function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())})).catch((function(e){n(e)})):s=o.rowManager.addRows(t).then((function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())})).catch((function(e){n(e)}))}))},h.prototype.updateRow=function(e,t){var o=this;return new Promise((function(i,n){var s=o.rowManager.findRow(e);"string"===typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then((function(){i(s.getComponent())})).catch((function(e){n(e)})):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))}))},h.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.rowManager.findRow(e);a?i.rowManager.scrollToRow(a,t,o).then((function(){n()})).catch((function(e){s(e)})):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))}))},h.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},h.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},h.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},h.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},h.prototype.setColumns=function(e){this.columnManager.setColumns(e)},h.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},h.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},h.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},h.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},h.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},h.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},h.prototype.addColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,a).then((function(e){n(e.getComponent())})).catch((function(e){s(e)}))}))},h.prototype.deleteColumn=function(e){var t=this;return new Promise((function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then((function(){o()})).catch((function(e){i(e)})):(console.warn("Column Delete Error - No matching column found:",e),i())}))},h.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise((function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then((function(e){i(e)})).catch((function(e){n(e)})):(console.warn("Column Update Error - No matching column found:",e),n())}))},h.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)},h.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.columnManager.findColumn(e);a?i.columnManager.scrollToColumn(a,t,o).then((function(){n()})).catch((function(e){s(e)})):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))}))},h.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},h.prototype.getLocale=function(){return this.modules.localize.getLocale()},h.prototype.getLang=function(e){return this.modules.localize.getLang(e)},h.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},h.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"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")},h.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},h.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},h.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},h.prototype.setFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o,i),this.rowManager.filterRefresh())},h.prototype.addFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o,i),this.rowManager.filterRefresh())},h.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},h.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},h.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},h.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},h.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},h.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},h.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},h.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},h.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},h.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},h.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},h.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},h.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},h.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},h.prototype.clearCellValidation=function(e){var t=this;this.modExists("validate",!0)&&(e||(e=this.modules.validate.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.modules.validate.clearValidation(e._getSelf())})))},h.prototype.validate=function(e){var t=[];return this.rowManager.rows.forEach((function(e){var o=e.validate();!0!==o&&(t=t.concat(o))})),!t.length||t},h.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},h.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise((function(e,t){t()}))},h.prototype.setPageToRow=function(e){var t=this;return new Promise((function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then((function(){o()})).catch((function(){i()})):i()):i()}))},h.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then((function(){})).catch((function(){}))},h.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},h.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},h.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},h.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},h.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},h.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,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")},h.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,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")},h.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,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")},h.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},h.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},h.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},h.prototype.clearCellEdited=function(e){var t=this;this.modExists("edit",!0)&&(e||(e=this.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.modules.edit.clearEdited(e._getSelf())})))},h.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},h.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},h.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||(e=this.modules.edit.currentCell,!e))&&e.nav().prev()},h.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||(e=this.modules.edit.currentCell,!e))&&e.nav().next()},h.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().left())},h.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().right())},h.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().up())},h.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().down())},h.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},h.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},h.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},h.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},h.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},h.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},h.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},h.prototype.moduleBindings={},h.prototype.extendModule=function(e,t,o){if(h.prototype.moduleBindings[e]){var i=h.prototype.moduleBindings[e].prototype[t];if(i)if("object"==("undefined"===typeof o?"undefined":l(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)},h.prototype.registerModule=function(e,t){h.prototype.moduleBindings[e]=t},h.prototype.bindModules=function(){for(var e in this.modules={},h.prototype.moduleBindings)this.modules[e]=new h.prototype.moduleBindings[e](this)},h.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},h.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===l(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},h.prototype.comms={tables:[],register:function(e){h.prototype.comms.tables.push(e)},deregister:function(e){var t=h.prototype.comms.tables.indexOf(e);t>-1&&h.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"===typeof e){if(o=document.querySelectorAll(e),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t=this,o=t.table.element.clientWidth,i=0,n=0,s=0,a=0,r=[],l=[],u=0,c=0,d=0;function h(e){var t;return t="string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e,t}function p(e,t,o,i){var n=[],s=0,a=0,r=0,l=0,u=0,c=[];function d(e){return o*(e.column.definition.widthGrow||1)}function m(e){return h(e.width)-o*(e.column.definition.widthShrink||0)}return e.forEach((function(e,t){var o=i?m(e):d(e);e.column.minWidth>=o?n.push(e):(c.push(e),u+=i?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)})),n.length?(n.forEach((function(e){s+=i?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth})),a=t-s,r=u?Math.floor(a/u):a,l=a-r*u,l+=p(c,a,r,i)):(l=u?t-Math.floor(t/u)*u:t,c.forEach((function(e){e.width=i?m(e):d(e)}))),l}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,o,n;e.visible&&(t=e.definition.width,o=parseInt(e.minWidth),t?(n=h(t),i+=n>o?n:o,e.definition.widthShrink&&(l.push({column:e,width:n>o?n:o}),u+=e.definition.widthShrink)):(r.push({column:e,width:0}),s+=e.definition.widthGrow||1))})),n=o-i,a=Math.floor(n/s);d=p(r,n,a,!1);r.length&&d>0&&(r[r.length-1].width+=+d),r.forEach((function(e){n-=e.width})),c=Math.abs(d)+n,c>0&&u&&(d=p(l,c,Math.floor(c/u),!0)),l.length&&(l[l.length-1].width-=d),r.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}},h.prototype.registerModule("layout",p);var m=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};m.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},m.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},m.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},m.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==l(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},m.prototype.setLocale=function(e){var t=this;function o(e,t){for(var i in e)"object"==l(e[i])?(t[i]||(t[i]={}),o(e[i],t[i])):t[i]=e[i]}if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!t.langs[e]){var i=e.split("-")[0];t.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}t.locale=e,t.lang=h.prototype.helpers.deepClone(t.langs.default||{}),"default"!=e&&o(t.langs[e],t.lang),t.table.options.localized.call(t.table,t.locale,t.lang),t._executeBindings()},m.prototype.getLocale=function(e){return self.locale},m.prototype.getLang=function(e){return e?this.langs[e]:this.lang},m.prototype.getText=function(e,t){e=t?e+"|"+t:e;var o=e.split("|"),i=this._getLangElement(o,this.locale);return i||""},m.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach((function(e){var t;i&&(t=i[e],i="undefined"!=typeof t&&t)})),i},m.prototype.bind=function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},m.prototype._executeBindings=function(){var e=this,t=function(t){e.bindings[t].forEach((function(o){o(e.getText(t),e.lang)}))};for(var o in e.bindings)t(o)},m.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:{}}}},h.prototype.registerModule("localize",m);var f=function(e){this.table=e};f.prototype.getConnections=function(e){var t,o=this,i=[];return t=h.prototype.comms.lookupTable(e),t.forEach((function(e){o.table!==e&&i.push(e)})),i},f.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach((function(e){e.tableComms(n.table.element,t,o,i)})),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},f.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},h.prototype.registerModule("comms",f);var g=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};g.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach((function(n){var s,a="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupAccessor(e.definition[a]),s&&(o=!0,i[a]={accessor:s,params:e.definition[a+"Params"]||{}}))})),o&&(e.modules.accessor=i)},g.prototype.lookupAccessor=function(e){var t=!1;switch("undefined"===typeof e?"undefined":l(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t},g.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=h.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse((function(e){var o,s,a,r;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1,s&&(o=e.getFieldValue(n),"undefined"!=o&&(r=e.getComponent(),a="function"===typeof s.params?s.params(o,n,t,r):s.params,e.setFieldValue(n,s.accessor(o,n,t,a,r)))))})),n},g.prototype.accessors={},h.prototype.registerModule("accessor",g);var b=function(e){this.table=e,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};b.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.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&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.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"))},b.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},b.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},b.prototype.setParams=function(e,t){if(t)for(var o in this.params=this.params||{},e)this.params[o]=e[o];else this.params=e},b.prototype.getParams=function(){return this.params||{}},b.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},b.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e)for(var o in t.config={},t.defaultConfig)t.config[o]=t.defaultConfig[o]},b.prototype.setUrl=function(e){this.url=e},b.prototype.getUrl=function(){return this.url},b.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},b.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)})),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n="undefined"!==typeof o.precision&&o.precision;return e.forEach((function(e){e=Number(e),(e"),o.dataTreeExpandElement?"string"===typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),l(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]};break}},w.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===("undefined"===typeof t?"undefined":l(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},w.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},w.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,n=(t=t||e.getCells()[0].getElement(),i.controlEl);!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(function(t){t.stopPropagation(),o.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(function(t){t.stopPropagation(),o.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},w.prototype.setDisplayIndex=function(e){this.displayIndex=e},w.prototype.getDisplayIndex=function(){return this.displayIndex},w.prototype.getRows=function(e){var t=this,o=[];return e.forEach((function(e,i){var n,s;o.push(e),e instanceof r&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach((function(e){o.push(e)}))))})),o},w.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach((function(e){n.push(e);var o=t.getChildren(e);o.forEach((function(e){n.push(e)}))}))),n},w.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((function(i){var n=new r(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)})),o},w.prototype.expandRow=function(e,t){var o=e.modules.dataTree;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},w.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},w.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},w.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},w.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach((function(e){e instanceof r&&i.push(e)}))),i},w.prototype.rowDelete=function(e){var t,o=e.modules.dataTree.parent;o&&(t=this.findChildIndex(e,o),!1!==t&&o.data[this.field].splice(t,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},w.prototype.addTreeChildRow=function(e,t,o,i){var n=!1;"string"===typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),"undefined"!==typeof i&&(n=this.findChildIndex(i,e),!1!==n&&e.data[this.field].splice(o?n:n+1,0,t)),!1===n&&(o?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},w.prototype.findChildIndex=function(e,t){var o=this,i=!1;return"object"==("undefined"===typeof e?"undefined":l(e))?e instanceof r?i=e.data:e instanceof a?i=e._getSelf().data:"undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find((function(t){return t instanceof r&&t.element===e})),i&&(i=i.data)):i="undefined"!=typeof e&&null!==e&&t.data[this.field].find((function(t){return t.data[o.table.options.index]==e})),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},w.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach((function(e){e instanceof r&&o.push(e.getComponent())}))),o},w.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},w.prototype.getChildField=function(){return this.field},w.prototype.redrawNeeded=function(e){return!!this.field&&"undefined"!==typeof e[this.field]||!!this.elementField&&"undefined"!==typeof e[this.elementField]},h.prototype.registerModule("dataTree",w);var E=function(e){this.table=e};E.prototype.download=function(e,t,o,i,n){var s=this,a=!1;function r(o,i){n?!0===n?s.triggerDownload(o,i,e,t,!0):n(o):s.triggerDownload(o,i,e,t)}if("function"==typeof e?a=e:s.downloaders[e]?a=s.downloaders[e]:console.warn("Download Error - No such download type found: ",e),a){var l=this.generateExportList(i);a.call(this.table,l,o||{},r)}},E.prototype.generateExportList=function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],o&&o[e.indent]&&(t.value=o[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t},E.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),a=new Blob([e],{type:t});i=i||"Tabulator."+("function"===typeof o?"txt":o);a=this.table.options.downloadReady.call(this.table,e,a),a&&(n?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,i):(s.setAttribute("href",window.URL.createObjectURL(a)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},E.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept);break}},E.prototype.downloaders={csv:function(e,t,o){var i=t&&t.delimiter?t.delimiter:",",n=[],s=[];e.forEach((function(e){var t=[];switch(e.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":e.columns.forEach((function(e,t){e&&1===e.depth&&(s[t]="undefined"==typeof e.value||"null"==typeof e.value?"":e.value)}));break;case"row":e.columns.forEach((function(e){if(e){switch(l(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value="";break}t.push('"'+String(e.value).split('"').join('""')+'"')}})),n.push(t.join(i));break}})),s.length&&(n=[s].concat(n)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(e,t,o){var i=[];e.forEach((function(e){var t={};switch(e.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":e.columns.forEach((function(e){e&&(t[e.component.getField()]=e.value)})),i.push(t);break}})),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(e,t,o){var i=[],n=[],s={},a=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},r=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=t.jsPDF||{},c=t&&t.title?t.title:"";function d(e,t){var o=[];return e.columns.forEach((function(e){var i;if(e){switch(l(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value="";break}i={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(i.styles=t),o.push(i)}else o.push("")})),o}u.orientation||(u.orientation=t.orientation||"landscape"),u.unit||(u.unit="pt"),e.forEach((function(e){switch(e.type){case"header":i.push(d(e));break;case"group":n.push(d(e,a));break;case"calc":n.push(d(e,r));break;case"row":n.push(d(e));break}}));var h=new jsPDF(u);t&&t.autoTable&&(s="function"===typeof t.autoTable?t.autoTable(h)||{}:t.autoTable),c&&(s.addPageContent=function(e){h.text(c,40,30)}),s.head=i,s.body=n,h.autoTable(s),t&&t.documentProcessing&&t.documentProcessing(h),o(h.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o){var i,n=this,s=t.sheetName||"Sheet1",a=XLSX.utils.book_new();function r(){var t=[],o=[],i={},n={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:e.length}};return e.forEach((function(e,i){var n=[];e.columns.forEach((function(e,t){e?(n.push(e.value instanceof Date||"object"!==l(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&o.push({s:{r:i,c:t},e:{r:i+e.height-1,c:t+e.width-1}})):n.push("")})),t.push(n)})),XLSX.utils.sheet_add_aoa(i,t),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}if(a.SheetNames=[],a.Sheets={},t.sheetOnly)o(r());else{if(t.sheets)for(var u in t.sheets)!0===t.sheets[u]?(a.SheetNames.push(u),a.Sheets[u]=r()):(a.SheetNames.push(u),this.table.modules.comms.send(t.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:n.active,intercept:function(e){a.Sheets[u]=e}}));else a.SheetNames.push(s),a.Sheets[s]=r();t.documentProcessing&&(a=t.documentProcessing(a)),i=XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(c(i),"application/octet-stream")}function c(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i!=e.length;++i)o[i]=255&e.charCodeAt(i);return t}},html:function(e,t,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(e),"text/html")}},h.prototype.registerModule("download",E);var C=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};C.prototype.initializeColumn=function(e){var t=this,o={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(l(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?o.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":o.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!==typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?o.editor=t.editors[e.definition.formatter]:o.editor=t.editors["input"]):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter));break}o.editor&&(e.modules.edit=o)},C.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},C.prototype.clearEditor=function(e){var t,o=this.currentCell;if(this.invalidEdit=!1,o){this.currentCell=!1,t=o.getElement(),e?o.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");while(t.firstChild)t.removeChild(t.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},C.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},C.prototype.bindEditor=function(e){var t=this,o=e.getElement();o.setAttribute("tabindex",0),o.addEventListener("click",(function(e){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})})),o.addEventListener("mousedown",(function(e){t.mouseClick=!0})),o.addEventListener("focus",(function(o){t.recursionBlock||t.edit(e,o,!1)}))},C.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},C.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},C.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=e.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o);var n=this.table.rowManager.element.scrollLeft,s=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,a=e.getElement();a.offsetLeft;this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin),s-=parseInt(this.table.modules.frozenColumns.rightMargin)),a.offsetLefts&&(this.table.rowManager.element.scrollLeft+=a.offsetLeft+a.offsetWidth-s)}},C.prototype.edit=function(e,t,o){var i,n,s,a=this,r=!0,u=function(){},c=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,c.blur(),!1;switch(t&&t.stopPropagation(),l(e.column.modules.edit.check)){case"function":r=e.column.modules.edit.check(e.getComponent());break;case"boolean":r=e.column.modules.edit.check;break}if(r||o){if(a.cancelEdit(),a.currentCell=e,this.focusScrollAdjust(e),n=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,n)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,n),a.table.options.cellEditing.call(this.table,n),s="function"===typeof e.column.modules.edit.params?e.column.modules.edit.params(n):e.column.modules.edit.params,i=e.column.modules.edit.editor.call(a,n,f,p,m,s),!1===i)return c.blur(),!1;if(!(i instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",i),c.blur(),!1;c.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");while(c.firstChild)c.removeChild(c.firstChild);c.appendChild(i),u();for(var d=c.children,h=0;h46){if(a>=o.length)return t.preventDefault(),t.stopPropagation(),!1,!1;switch(o[a]){case i:if(r.toUpperCase()==r.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1,!1;break;case n:if(isNaN(r))return t.preventDefault(),t.stopPropagation(),!1,!1;break;case s:break;default:if(r!==o[a])return t.preventDefault(),t.stopPropagation(),!1,!1}!0}})),e.addEventListener("keyup",(function(o){o.keyCode>46&&t.maskAutoFill&&a(e.value.length)})),e.placeholder||(e.placeholder=o),t.maskAutoFill&&a(e.value.length)},C.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach((function(t){e.push(t.getComponent())})),e},C.prototype.clearEdited=function(e){var t;e.modules.validate&&e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,t=this.editedCells.indexOf(e),t>-1&&this.editedCells.splice(t,1))},C.prototype.editors={input:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var r in n.elementAttributes)"+"==r.charAt(0)?(r=r.slice(1),a.setAttribute(r,a.getAttribute(r)+n.elementAttributes["+"+r])):a.setAttribute(r,n.elementAttributes[r]);function u(e){(null===s||"undefined"===typeof s)&&""!==a.value||a.value!==s?o(a.value)&&(s=a.value):i()}return a.value="undefined"!==typeof s?s:"",t((function(){a.focus({preventScroll:!0}),a.style.height="100%"})),a.addEventListener("change",u),a.addEventListener("blur",u),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u(e);break;case 27:i();break}})),n.mask&&this.table.modules.edit.maskInput(a,n),a},textarea:function(e,t,o,i,n){var s=e.getValue(),a=n.verticalNavigation||"hybrid",r=String(null!==s&&"undefined"!==typeof s?s:""),u=((r.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",n.elementAttributes&&"object"==l(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+n.elementAttributes["+"+d])):u.setAttribute(d,n.elementAttributes[d]);function h(t){(null===s||"undefined"===typeof s)&&""!==u.value||u.value!==s?(o(u.value)&&(s=u.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):i()}return u.value=r,t((function(){u.focus({preventScroll:!0}),u.style.height="100%"})),u.addEventListener("change",h),u.addEventListener("blur",h),u.addEventListener("keyup",(function(){u.style.height="";var t=u.scrollHeight;u.style.height=t+"px",t!=c&&(c=t,e.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==a||"hybrid"==a&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break}})),n.mask&&this.table.modules.edit.maskInput(u,n),u},number:function(e,t,o,i,n){var s=e.getValue(),a=n.verticalNavigation||"editor",r=document.createElement("input");if(r.setAttribute("type","number"),"undefined"!=typeof n.max&&r.setAttribute("max",n.max),"undefined"!=typeof n.min&&r.setAttribute("min",n.min),"undefined"!=typeof n.step&&r.setAttribute("step",n.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var u in n.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),r.setAttribute(u,r.getAttribute(u)+n.elementAttributes["+"+u])):r.setAttribute(u,n.elementAttributes[u]);r.value=s;var c=function(e){d()};function d(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!==s?o(e)&&(s=e):i()}return t((function(){r.removeEventListener("blur",c),r.focus({preventScroll:!0}),r.style.height="100%",r.addEventListener("blur",c)})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:i();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation());break}})),n.mask&&this.table.modules.edit.maskInput(r,n),r},range:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),"undefined"!=typeof n.max&&a.setAttribute("max",n.max),"undefined"!=typeof n.min&&a.setAttribute("min",n.min),"undefined"!=typeof n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var r in n.elementAttributes)"+"==r.charAt(0)?(r=r.slice(1),a.setAttribute(r,a.getAttribute(r)+n.elementAttributes["+"+r])):a.setAttribute(r,n.elementAttributes[r]);function u(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=s?o(e)&&(s=e):i()}return a.value=s,t((function(){a.focus({preventScroll:!0}),a.style.height="100%"})),a.addEventListener("blur",(function(e){u()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:i();break}})),a},select:function(e,t,o,i,n){var s=this,a=this,r=e.getElement(),u=e.getValue(),c=n.verticalNavigation||"editor",d="undefined"!==typeof u||null===u?Array.isArray(u)?u:[u]:"undefined"!==typeof n.defaultValue?n.defaultValue:[],p=document.createElement("input"),m=document.createElement("div"),f=n.multiselect,g=[],b={},v=[],y=[],w=!0,E=!1;function C(t){var o,i={},s=a.table.getData();return o=t?a.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach((function(e){var t=o.getFieldValue(e);null!==t&&"undefined"!==typeof t&&""!==t&&(i[t]=!0)})),i=n.sortValuesList?"asc"==n.sortValuesList?Object.keys(i).sort():Object.keys(i).sort().reverse():Object.keys(i)):console.warn("unable to find matching column to create select lookup list:",t),i}function x(t,o){var i=[],n=[];function s(e){e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return o.indexOf(e.value)>-1&&L(e),i.push(e),n.push(e),e}if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach((function(e){var t;"object"===("undefined"===typeof e?"undefined":l(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},n.push(t),e.options.forEach((function(e){s(e)}))):s(e):(t={label:e,value:e,element:!1},o.indexOf(t.value)>-1&&L(t),i.push(t),n.push(t))}));else for(var a in t){var r={label:t[a],value:a,element:!1};o.indexOf(r.value)>-1&&L(r),i.push(r),n.push(r)}g=i,v=n,R()}function R(){while(m.firstChild)m.removeChild(m.firstChild);v.forEach((function(t){var o=t.element;if(!o){if(o=document.createElement("div"),t.label=n.listItemFormatter?n.listItemFormatter(t.value,t.label,e,o,t.itemParams):t.label,t.group?(o.classList.add("tabulator-edit-select-list-group"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label):(o.classList.add("tabulator-edit-select-list-item"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label,o.addEventListener("click",(function(){E=!0,setTimeout((function(){E=!1}),10),f?(k(t),p.focus()):D(t)})),y.indexOf(t)>-1&&o.classList.add("active")),t.elementAttributes&&"object"==l(t.elementAttributes))for(var i in t.elementAttributes)"+"==i.charAt(0)?(i=i.slice(1),o.setAttribute(i,p.getAttribute(i)+t.elementAttributes["+"+i])):o.setAttribute(i,t.elementAttributes[i]);o.addEventListener("mousedown",(function(){w=!1,setTimeout((function(){w=!0}),10)})),t.element=o}m.appendChild(o)}))}function M(e,t){!f&&b&&b.element&&b.element.classList.remove("active"),b&&b.element&&b.element.classList.remove("focused"),b=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function L(e){var t=y.indexOf(e);-1==t&&(y.push(e),M(e,!0)),H()}function T(e){var t=y[e];e>-1&&(y.splice(e,1),t.element&&t.element.classList.remove("active"))}function k(e){e||(e=b);var t=y.indexOf(e);t>-1?T(t):(!0!==f&&y.length>=f&&T(0),L(e)),H()}function D(e){F(),e||(e=b),e&&(p.value=e.label,o(e.value)),d=p.value}function S(e){e||F();var t=[];y.forEach((function(e){t.push(e.value)})),d=p.value,o(t)}function H(){var e=[];y.forEach((function(t){e.push(t.label)})),p.value=e.join(", "),!1===a.currentCell&&S(!0)}function P(){for(var e=y.length,t=0;t0&&M(g[t-1],!f));break;case 40:t=g.indexOf(b),("editor"==c||"hybrid"==c&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&s.push(t)})),L(s,t))}function x(e){var t=document.createElement("div");M(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,m.appendChild(t))}function R(e){var t=[];if(Array.isArray(e))e.forEach((function(e){var o={};"object"===("undefined"===typeof e?"undefined":l(e))?(o.title=n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,o.value=e.value):(o.title=n.listItemFormatter?n.listItemFormatter(e,e):e,o.value=e),t.push(o)}));else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function M(){while(m.firstChild)m.removeChild(m.firstChild)}function L(e,t){e.length?T(e,t):n.emptyPlaceholder&&x(n.emptyPlaceholder)}function T(e,t){var o=!1;M(),f=e,f.forEach((function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",(function(t){S(e),k()})),i.addEventListener("mousedown",(function(e){b=!1,setTimeout((function(){b=!0}),10)})),e.element=i,t&&e.value==u&&(p.value=e.title,e.element.classList.add("active"),o=!0),e===g&&(e.element.classList.add("active"),o=!0)),m.appendChild(i)})),o||S(!1)}function k(){H(),g?u!==g.value?(u=g.value,p.value=g.title,o(g.value)):i():n.freetext||n.allowEmpty&&""===p.value?(u=p.value,o(p.value)):i()}function D(){if(!m.parentNode){while(m.firstChild)m.removeChild(m.firstChild);var e=h.prototype.helpers.elOffset(r);m.style.minWidth=r.offsetWidth+"px",m.style.top=e.top+r.offsetHeight+"px",m.style.left=e.left+"px",document.body.appendChild(m)}}function S(e,t){g&&g.element&&g.element.classList.remove("active"),g=e,e&&e.element&&e.element.classList.add("active")}function H(){m.parentNode&&m.parentNode.removeChild(m),A()}function P(){H(),i()}function A(){a.table.rowManager.element.removeEventListener("scroll",P)}return m.classList.add("tabulator-edit-select-list"),m.addEventListener("mousedown",(function(e){b=!1,setTimeout((function(){b=!0}),10)})),p.addEventListener("keydown",(function(e){var t;switch(e.keyCode){case 38:t=f.indexOf(g),("editor"==c||"hybrid"==c&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),S(t>0&&f[t-1]));break;case 40:t=f.indexOf(g),("editor"==c||"hybrid"==c&&t'):("ie"==s.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=p.cloneNode(!0);d.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e),a.blur()})),t.appendChild(i),h.appendChild(t)}function g(e){r=e,m(e)}if(a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",h.style.verticalAlign="middle",h.style.display="inline-block",h.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",n.elementAttributes&&"object"==l(n.elementAttributes))for(var b in n.elementAttributes)"+"==b.charAt(0)?(b=b.slice(1),h.setAttribute(b,h.getAttribute(b)+n.elementAttributes["+"+b])):h.setAttribute(b,n.elementAttributes[b]);for(var v=1;v<=u;v++)f(v);return r=Math.min(parseInt(r),u),m(r),h.addEventListener("mousemove",(function(e){m(0)})),h.addEventListener("click",(function(e){o(0)})),a.addEventListener("blur",(function(e){i()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(r+1);break;case 37:g(r-1);break;case 13:o(r);break;case 27:i();break}})),h},progress:function(e,t,o,i,n){var s,a,r=e.getElement(),u="undefined"===typeof n.max?r.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,c="undefined"===typeof n.min?r.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(u-c)/100,h=e.getValue()||0,p=document.createElement("div"),m=document.createElement("div");function f(){var e=d*Math.round(m.offsetWidth/(r.clientWidth/100))+c;o(e),r.setAttribute("aria-valuenow",e),r.setAttribute("aria-label",h)}if(p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",n.elementAttributes&&"object"==l(n.elementAttributes))for(var g in n.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),m.setAttribute(g,m.getAttribute(g)+n.elementAttributes["+"+g])):m.setAttribute(g,n.elementAttributes[g]);return r.style.padding="4px 4px",h=Math.min(parseFloat(h),u),h=Math.max(parseFloat(h),c),h=Math.round((h-c)/d),m.style.width=h+"%",r.setAttribute("aria-valuemin",c),r.setAttribute("aria-valuemax",u),m.appendChild(p),p.addEventListener("mousedown",(function(e){s=e.screenX,a=m.offsetWidth})),p.addEventListener("mouseover",(function(){p.style.cursor="ew-resize"})),r.addEventListener("mousemove",(function(e){s&&(m.style.width=a+e.screenX-s+"px")})),r.addEventListener("mouseup",(function(e){s&&(e.stopPropagation(),e.stopImmediatePropagation(),s=!1,a=!1,f())})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+r.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-r.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:i();break}})),r.addEventListener("blur",(function(){i()})),m},tickCross:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input"),r=n.tristate,u="undefined"===typeof n.indeterminateValue?null:n.indeterminateValue,c=!1;if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),a.setAttribute(d,a.getAttribute(d)+n.elementAttributes["+"+d])):a.setAttribute(d,n.elementAttributes[d]);function h(e){return r?e?c?u:a.checked:a.checked&&!c?(a.checked=!1,a.indeterminate=!0,c=!0,u):(c=!1,a.checked):a.checked}return a.value=s,!r||"undefined"!==typeof s&&s!==u&&""!==s||(c=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){a.focus({preventScroll:!0})})),a.checked=!0===s||"true"===s||"True"===s||1===s,a.addEventListener("change",(function(e){o(h())})),a.addEventListener("blur",(function(e){o(h(!0))})),a.addEventListener("keydown",(function(e){13==e.keyCode&&o(h()),27==e.keyCode&&i()})),a}},h.prototype.registerModule("edit",C);var x=function(e,t,o,i){this.type=e,this.columns=t,this.component=o||!1,this.indent=i||0},R=function(e,t,o,i,n){this.value=e,this.component=t||!1,this.width=o,this.height=i,this.depth=n},M=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};M.prototype.generateExportList=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},M.prototype.genereateTable=function(e,t,o,i){var n=this.generateExportList(e,t,o,i);return this.genereateTableElement(n)},M.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach((function(e){e=t.table.rowManager.findRow(e),e&&o.push(e)}));else switch(e){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},M.prototype.generateColumnGroupHeaders=function(){var e=this,t=[],o=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex;return o.forEach((function(o){var i=e.processColumnGroup(o);i&&t.push(i)})),t},M.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,s={title:n,column:e,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach((function(e){var o=t.processColumnGroup(e);o&&(s.width+=o.width,s.subGroups.push(o),o.depth>i&&(i=o.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s},M.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},M.prototype.headersToExportRows=function(e){var t=[],o=0,i=[];function n(e,i){var s=o-i;if("undefined"===typeof t[i]&&(t[i]=[]),e.height=e.subGroups?1:s-e.depth+1,t[i].push(e),e.height>1)for(var a=1;a1)for(var r=1;ro&&(o=e.depth)})),e.forEach((function(e){n(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){e?t.push(new R(e.title,e.column.getComponent(),e.width,e.height,e.depth)):t.push(null)})),i.push(new x("header",t))})),i},M.prototype.bodyToExportRows=function(e){var t=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&o.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0})),e.forEach((function(e,n){var s=e.getData(t.colVisProp),a=[],r=0;switch(e.type){case"group":r=e.level,a.push(new R(e.key,e.getComponent(),o.length,1));break;case"calc":case"row":o.forEach((function(e){a.push(new R(e._column.getFieldValue(s),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(r=e.modules.dataTree.index);break}i.push(new x(e.type,a,e.getComponent(),r))})),i},M.prototype.genereateTableElement=function(e){var t=this,o=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),a=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==a?a:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),o.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,o){switch(e.type){case"header":i.appendChild(t.genereateHeaderElement(e,r,s));break;case"group":n.appendChild(t.genereateGroupElement(e,r,s));break;case"calc":n.appendChild(t.genereateCalcElement(e,r,s));break;case"row":var a=t.genereateRowElement(e,r,s);t.mapElementStyles(o%2&&s.evenRow?s.evenRow:s.oddRow,a,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(a);break}})),i.innerHTML&&o.appendChild(i),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},M.prototype.lookupTableStyles=function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e},M.prototype.genereateHeaderElement=function(e,t,o){var i=this,n=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),o=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,i.cloneTableStyle&&(t.style.boxSizing="border-box"),o.forEach((function(e){t.classList.add(e)})),i.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?i.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&i.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),n.appendChild(t)}})),n},M.prototype.genereateGroupElement=function(e,t,o){var i=document.createElement("tr"),n=document.createElement("td"),s=e.columns[0];return i.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?s.value=t.groupHeader[e.indent](s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?s.value=s.value:s.value=e.component._group.generator(s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+e.indent),s.component.getVisibility()&&i.classList.add("tabulator-group-visible"),this.mapElementStyles(o.firstGroup,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(o.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),i.appendChild(n),i},M.prototype.genereateCalcElement=function(e,t,o){var i=this.genereateRowElement(e,t,o);return i.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(o.calcRow,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i},M.prototype.genereateRowElement=function(e,t,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach((function(a){if(a){var r=document.createElement("td"),u=a.component._column,c=a.value,d={modules:{},getValue:function(){return c},getField:function(){return u.definition.field},getElement:function(){return r},getColumn:function(){return u.getComponent()},getData:function(){return rowData},getRow:function(){return e.getComponent()},getComponent:function(){return d},column:u},h=u.definition.cssClass?u.definition.cssClass.split(" "):[];if(h.forEach((function(e){r.classList.add(e)})),n.table.modExists("format")&&!1!==n.config.formatCells)c=n.table.modules.format.formatExportValue(d,n.colVisProp);else switch("undefined"===typeof c?"undefined":l(c)){case"object":c=JSON.stringify(c);break;case"undefined":case"null":c="";break;default:c=c}if(c instanceof Node?r.appendChild(c):r.innerHTML=c,o.firstCell&&(n.mapElementStyles(o.firstCell,r,["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&&(r.style.textAlign=u.definition.align)),n.table.options.dataTree&&!1!==n.config.dataTree&&(t.treeElementField&&t.treeElementField==u.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&r.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),e.component._row.modules.dataTree.branchEl&&r.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),s.appendChild(r),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),t.rowFormatter&&!1!==n.config.formatCells){var p=e.getComponent();p.getElement=function(){return s},t.rowFormatter(p)}}})),s},M.prototype.genereateHTMLTable=function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML},M.prototype.getHtml=function(e,t,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput");return this.genereateHTMLTable(n)},M.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){var i={"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 n=window.getComputedStyle(e);o.forEach((function(e){t.style[i[e]]=n.getPropertyValue(e)}))}}},h.prototype.registerModule("export",M);var L=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};L.prototype.initializeColumn=function(e,t){var o,i=this,n=e.getField();function s(t){var s,a="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",u="";if("undefined"===typeof e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[n];else{switch(e.modules.filter.value=t,l(e.definition.headerFilterFunc)){case"string":i.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,s=function(o){var n=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return n="function"===typeof n?n(t,s,o):n,i.filters[e.definition.headerFilterFunc](t,s,o,n)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":s=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"===typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},r=s;break}if(!s)switch(a){case"partial":s=function(o){var i=e.getFieldValue(o);return"undefined"!==typeof i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:s=function(o){return e.getFieldValue(o)==t},r="="}i.headerFilters[n]={value:t,func:s,type:r,params:o||{}}}u=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==u&&(i.prevHeaderFilterChangeCheck=u,i.changed=!0,i.table.rowManager.filterRefresh())}return!0}e.modules.filter={success:s,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},L.prototype.generateHeaderFilterElement=function(e,t,o){var i,n,s,a,r,u,c,d=this,h=this,p=e.modules.filter.success,m=e.getField();function f(){}if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},i=document.createElement("div"),i.classList.add("tabulator-header-filter"),l(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(n=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":n=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?n=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(n=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):n=h.table.modules.edit.editors["input"];break}if(n){if(a={getValue:function(){return"undefined"!==typeof t?t:""},getField:function(){return e.definition.field},getElement:function(){return i},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},c=e.definition.headerFilterParams||{},c="function"===typeof c?c.call(h.table):c,s=n.call(this.table.modules.edit,a,(function(){}),p,f,c),!s)return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(s instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",s);m?h.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,(function(e){s.setAttribute("placeholder","undefined"!==typeof e&&e?e:h.table.modules.localize.getText("headerFilters|default"))})):h.table.modules.localize.bind("headerFilters|default",(function(e){s.setAttribute("placeholder","undefined"!==typeof h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)})),s.addEventListener("click",(function(e){e.stopPropagation(),s.focus()})),s.addEventListener("focus",(function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))})),r=!1,u=function(e){r&&clearTimeout(r),r=setTimeout((function(){p(s.value)}),h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=s,e.modules.filter.attrType=s.hasAttribute("type")?s.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=s.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(s.addEventListener("keyup",u),s.addEventListener("search",u),"number"==e.modules.filter.attrType&&s.addEventListener("change",(function(e){p(s.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&s.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||s.addEventListener("mousedown",(function(e){e.stopPropagation()}))),i.appendChild(s),e.contentElement.appendChild(i),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},L.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))},L.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))},L.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},L.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},L.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},L.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},L.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},L.prototype.setFilter=function(e,t,o,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),n.addFilter(e)},L.prototype.addFilter=function(e,t,o,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),e.forEach((function(e){e=n.findFilter(e),e&&(n.filterList.push(e),n.changed=!0)})),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},L.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return o.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},L.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach((function(e){e=t.findFilter(e),e&&o.push(e)})),!!o.length&&o},L.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),o=o.concat(this.filtersToArray(this.filterList,t)),o},L.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach((function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))})),i},L.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},L.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach((function(e){var t=-1;t="object"==l(e.field)?i.filterList.findIndex((function(t){return e===t})):i.filterList.findIndex((function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value})),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},L.prototype.clearFilter=function(e){this.filterList=[],e&&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")},L.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.changed=!0},L.prototype.search=function(e,t,o,i){var n=this,s=[],a=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach((function(e){e=n.findFilter(e),e&&a.push(e)})),this.table.rowManager.rows.forEach((function(t){var o=!0;a.forEach((function(e){n.filterRecurse(e,t.getData())||(o=!1)})),o&&s.push("data"===e?t.getData("data"):t.getComponent())})),s},L.prototype.filter=function(e,t){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=e.slice(0):e.forEach((function(e){o.filterRow(e)&&i.push(e)})),o.table.options.dataFiltered&&(i.forEach((function(e){n.push(e.getComponent())})),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},L.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();for(var s in o.filterList.forEach((function(e){o.filterRecurse(e,n)||(i=!1)})),o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},L.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach((function(e){o.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i},L.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,o,i){var n=e.toLowerCase().split("undefined"===typeof i.separator?" ":i.separator),s=String(null===t||"undefined"===typeof t?"":t).toLowerCase(),a=[];return n.forEach((function(e){s.includes(e)&&a.push(!0)})),i.matchAll?a.length===n.length:!!a.length},starts:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,o,i){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},h.prototype.registerModule("filter",L);var T=function(e){this.table=e};T.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),"undefined"!==typeof e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),"undefined"!==typeof e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),"undefined"!==typeof e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},T.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];switch("undefined"===typeof i?"undefined":l(i)){case"string":"tick"===i&&(i="tickCross","undefined"==typeof o.params.crossElement&&(o.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[i]?o.formatter=this.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=i;break;default:o.formatter=this.formatters.plaintext;break}return o},T.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},T.prototype.formatValue=function(e){var t=e.getComponent(),o="function"===typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;function i(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}return e.column.modules.format.formatter.call(this,t,o,i)},T.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"===typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},T.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e},T.prototype.emptyToSpace=function(e){return null===e||"undefined"===typeof e||""===e?" ":e},T.prototype.getFormatter=function(e){switch("undefined"===typeof e?"undefined":l(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext;break}return e},T.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,a,r=parseFloat(e.getValue()),l=t.decimal||".",u=t.thousand||",",c=t.symbol||"",d=!!t.symbolAfter,h="undefined"!==typeof t.precision?t.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));i=!1!==h?r.toFixed(h):r,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",a=/(\d+)(\d{3})/;while(a.test(n))n=n.replace(a,"$1"+u+"$2");return d?n+s+c:c+n+s},link:function(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",a=t.download,r=n,u=document.createElement("a");if(t.labelField&&(i=e.getData(),r=i[t.labelField]),t.label)switch(l(t.label)){case"string":r=t.label;break;case"function":r=t.label(e);break}if(r){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(l(t.url)){case"string":n=t.url;break;case"function":n=t.url(e);break}return u.setAttribute("href",s+n),t.target&&u.setAttribute("target",t.target),t.download&&(a="function"==typeof a?a(e):!0===a?"":a,u.setAttribute("download",a)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),u}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),l(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height;break}switch(l(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width;break}return i.addEventListener("load",(function(){e.getRow().normalizeHeight()})),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,a=t.allowTruthy,r="undefined"!==typeof t.tickElement?t.tickElement:'',l="undefined"!==typeof t.crossElement?t.crossElement:'';return a&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),r||""):!s||"null"!==i&&""!==i&&null!==i&&"undefined"!==typeof i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s="undefined"!==typeof t.invalidPlaceholder?t.invalidPlaceholder:"",a=e.getValue(),r=moment(a,i);return r.isValid()?t.timezone?r.tz(t.timezone).format(n):r.format(n):!0===s?a:"function"===typeof s?s(a):s},datetimediff:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n="undefined"!==typeof t.invalidPlaceholder?t.invalidPlaceholder:"",s="undefined"!==typeof t.suffix&&t.suffix,a="undefined"!==typeof t.unit?t.unit:void 0,r="undefined"!==typeof t.humanize&&t.humanize,l="undefined"!==typeof t.date?t.date:moment(),u=e.getValue(),c=moment(u,i);return c.isValid()?r?moment.duration(c.diff(l)).humanize(s):c.diff(l,a)+(s?" "+s:""):!0===n?u:"function"===typeof n?n(u):n},lookup:function(e,t,o){var i=e.getValue();return"undefined"===typeof t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.stars:5,a=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l='',u='';a.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,s));for(var c=1;c<=s;c++){var d=r.cloneNode(!0);d.innerHTML=c<=i?l:u,a.appendChild(d)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),a},traffic:function(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,a=document.createElement("span"),r=t&&t.max?t.max:100,u=t&&t.min?t.min:0,c=t&&"undefined"!==typeof t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(s)&&"undefined"!==typeof e.getValue()){switch(a.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=r?parseFloat(s):r,n=parseFloat(n)>=u?parseFloat(n):u,i=(r-u)/100,n=Math.round((n-u)/i),"undefined"===typeof c?"undefined":l(c)){case"string":d=c;break;case"function":d=c(s);break;case"object":if(Array.isArray(c)){var h=100/c.length,p=Math.floor(n/h);p=Math.min(p,c.length-1),p=Math.max(p,0),d=c[p];break}}return a.style.backgroundColor=d,a}},progress:function(e,t,o){var i,n,s,a,r,c=this.sanitizeHTML(e.getValue())||0,d=e.getElement(),h=t&&t.max?t.max:100,p=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=h?parseFloat(c):h,n=parseFloat(n)>=p?parseFloat(n):p,i=(h-p)/100,n=Math.round((n-p)/i),l(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var f=100/t.color.length,g=Math.floor(n/f);g=Math.min(g,t.color.length-1),g=Math.max(g,0),s=t.color[g];break}default:s="#2DC214"}switch(l(t.legend)){case"string":a=t.legend;break;case"function":a=t.legend(c);break;case"boolean":a=c;break;default:a=!1}switch(l(t.legendColor)){case"string":r=t.legendColor;break;case"function":r=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){f=100/t.legendColor.length,g=Math.floor(n/f);g=Math.min(g,t.legendColor.length-1),g=Math.max(g,0),r=t.legendColor[g]}break;default:r="#000"}d.style.minWidth="30px",d.style.position="relative",d.setAttribute("aria-label",n);var b=document.createElement("div");if(b.style.display="inline-block",b.style.position="relative",b.style.width=n+"%",b.style.backgroundColor=s,b.style.height="100%",b.setAttribute("data-max",h),b.setAttribute("data-min",p),a){var v=document.createElement("div");v.style.position="absolute",v.style.top="4px",v.style.left=0,v.style.textAlign=m,v.style.width="100%",v.style.color=r,v.innerHTML=a}return o((function(){if(!(e instanceof u)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",d.appendChild(t),d=t}d.appendChild(b),a&&d.appendChild(v)})),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){var i=document.createElement("div"),n=e.getRow()._row.modules.responsiveLayout;function s(e){var t=n.element;n.open=e,t&&(n.open?(i.classList.add("open"),t.style.display=""):(i.classList.remove("open"),t.style.display="none"))}return i.classList.add("tabulator-responsive-collapse-toggle"),i.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),i.addEventListener("click",(function(e){e.stopImmediatePropagation(),s(!n.open)})),s(n.open),i},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",(function(e){i.toggleSelect()})),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",(function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},h.prototype.registerModule("format",T);var k=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};k.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},k.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},k.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},k.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout((function(){t.layout()}),100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach((function(e){"row"===e.type&&t.layoutRow(e)})),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.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},k.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))},k.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach((function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(),i)}))})),this.rightColumns.forEach((function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(),o)}))}))},k.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},k.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach((function(t){"row"===t.type&&e.layoutRow(t)})),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.prototype.layoutRow=function(e){var t=this,o=e.getElement();o.style.paddingLeft=this.leftMargin,this.leftColumns.forEach((function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})),this.rightColumns.forEach((function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}))},k.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},k.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)})),t},D.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},D.prototype.unfreezeRow=function(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")},D.prototype.detachRow=function(e){var t=this.rows.indexOf(e);if(t>-1){var o=e.getElement();o.parentNode.removeChild(o),this.rows.splice(t,1)}},D.prototype.styleRows=function(e){var t=this;this.rows.forEach((function(e,o){t.table.rowManager.styleRow(e,o)}))},h.prototype.registerModule("frozenRows",D);var S=function(e){this._group=e,this.type="GroupComponent"};S.prototype.getKey=function(){return this._group.key},S.prototype.getField=function(){return this._group.field},S.prototype.getElement=function(){return this._group.element},S.prototype.getRows=function(){return this._group.getRows(!0)},S.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},S.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},S.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},S.prototype.isVisible=function(){return this._group.visible},S.prototype.show=function(){this._group.show()},S.prototype.hide=function(){this._group.hide()},S.prototype.toggle=function(){this._group.toggleVisibility()},S.prototype._getSelf=function(){return this._group},S.prototype.getTable=function(){return this._group.groupManager.table};var H=function(e,t,o,i,n,s,a){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},H.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)}))},H.prototype.getRowIndex=function(e){},H.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},H.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(o.parentNode&&o.parentNode.removeChild(o),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},H.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},H.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(o){t=t.concat(o.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&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),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&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),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&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),t.push(this.calcs.top))),!e&&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),t.push(this.calcs.bottom)))),t},H.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){o.push(e.getData(t||"data"))})),o},H.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e},H.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},H.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){var t=e.getHeadersAndRows();t.forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},H.prototype.show=function(){var e=this;if(e.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=e.getElement();this.groupList.length?this.groupList.forEach((function(e){var o=e.getHeadersAndRows();o.forEach((function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o}))})):e.rows.forEach((function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},H.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},H.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(o){var i=o.getRowGroup(e);i&&(t=i)})):this.rows.find((function(t){return t===e}))&&(t=this),t},H.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach((function(o){t.push(e?o.getComponent():o)})),t},H.prototype.getRows=function(e){var t=[];return this.rows.forEach((function(o){t.push(e?o.getComponent():o)})),t},H.prototype.generateGroupHeaderContents=function(){var e=[];this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());while(this.element.firstChild)this.element.removeChild(this.element.firstChild);"string"===typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},H.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 e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",(function(t,o){e.headerGenerator[0]=function(e,i,n){return("undefined"===typeof e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}))}Array.isArray(t)||(t=[t]),t.forEach((function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!==typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})})),o&&(Array.isArray(o)||(o=[o]),o.forEach((function(e){e="function"==typeof e?e:function(){return!0}})),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},P.prototype.setDisplayIndex=function(e){this.displayIndex=e},P.prototype.getDisplayIndex=function(){return this.displayIndex},P.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},P.prototype.getGroups=function(e){var t=[];return this.groupList.forEach((function(o){t.push(e?o.getComponent():o)})),t},P.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)})),o},P.prototype.wipe=function(){this.groupList.forEach((function(e){e.wipe()}))},P.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach((function(e){var i={level:0,rowCount:0,headerContent:""},n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach((function(e){o.push(e.getData("data"))})))})),o},P.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},P.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach((function(o){var i=o.getRowGroup(e);i&&(t=i)})),t},P.prototype.countGroups=function(){return this.groupList.length},P.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,o)})),e.forEach((function(e){t.assignRowToExistingGroup(e,o)}))):e.forEach((function(e){t.assignRowToGroup(e,o)}))},P.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new H(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},P.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},P.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},P.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach((function(e){o=o.concat(e.getHeadersAndRows())})),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},P.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)}))},P.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1))},h.prototype.registerModule("groupRows",P);var A=function(e){this.table=e,this.history=[],this.index=-1};A.prototype.clear=function(){this.history=[],this.index=-1},A.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},A.prototype.getHistoryUndoSize=function(){return this.index+1},A.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},A.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},A.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},A.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},A.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},A.prototype._rebindRow=function(e,t){this.history.forEach((function(o){if(o.component instanceof r)o.component===e&&(o.component=t);else if(o.component instanceof c&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}}))},h.prototype.registerModule("history",A);var z=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};z.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},F.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},F.prototype.checkBinding=function(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){var t=o.pressedKeys.indexOf(e);-1==t&&(i=!1)})),i&&t.action.call(o,e),!0)},F.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"},F.prototype.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().prev()))},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell,o&&(e.preventDefault(),t=o.nav(),t.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(Object.assign({},i)),i.then((function(){setTimeout((function(){t.next()}))})))))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().left()))},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().right()))},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().up()))},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().down()))},undo:function(e){var t=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){var t=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},h.prototype.registerModule("keybindings",F);var _=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1};_.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",(function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)})),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",(function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)})),e.titleElement.insertBefore(t,e.titleElement.firstChild))},_.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;i&&o.stopImmediatePropagation(),t.loadMenu(o,e,i)}))},_.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;t.loadMenu(o,e,i)}))},_.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;t.loadMenu(o,e,i)}))},_.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);if(e.preventDefault(),o&&o.length){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout((function(){i.nestedMenuBlock=!1}),100);this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach((function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",(function(e){e.stopPropagation()}))):o.addEventListener("click",(function(o){i.hideMenu(),e.action(o,t.getComponent())}))),i.menuEl.appendChild(o)})),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout((function(){document.body.addEventListener("contextmenu",i.blurEvent)}),100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px")}},_.prototype.isOpen=function(){return!!this.menuEl.parentNode},_.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},_.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},_.prototype.menus={},h.prototype.registerModule("menu",_);var N=function(e){this.table=e,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)};N.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},N.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-h.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",(function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout((function(){o.startMove(t,e)}),o.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),o.bindTouchEvents(e)),e.modules.moveColumn=i},N.prototype.bindTouchEvents=function(e){var t,o,i,n,s,a,r=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){r.checkTimeout=setTimeout((function(){r.touchMove=!0,e,t=e.nextColumn(),i=t?t.getWidth()/2:0,o=e.prevColumn(),n=o?o.getWidth()/2:0,s=0,a=0,u=!1,r.startMove(l,e)}),r.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,d;r.moving&&(r.moveHover(l),u||(u=l.touches[0].pageX),c=l.touches[0].pageX-u,c>0?t&&c-s>i&&(d=t,d!==e&&(u=l.touches[0].pageX,d.getElement().parentNode.insertBefore(r.placeholderElement,d.getElement().nextSibling),r.moveColumn(d,!0))):o&&-c-a>n&&(d=o,d!==e&&(u=l.touches[0].pageX,d.getElement().parentNode.insertBefore(r.placeholderElement,d.getElement()),r.moveColumn(d,!1))),d&&(d,t=d.nextColumn(),s=i,i=t?t.getWidth()/2:0,o=d.prevColumn(),a=n,n=o?o.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)}))},N.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-h.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.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(e)},N.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))},N.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))},N.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)})):e.getCells().forEach((function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)}))},N.prototype.endMove=function(e){(1===e.which||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)))},N.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-h.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},O.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-h.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",(function(t){1===t.which&&(o.checkTimeout=setTimeout((function(){o.startMove(t,e)}),o.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},O.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",(function(o){1===o.which&&(t.checkTimeout=setTimeout((function(){t.startMove(o,e.row)}),t.checkPeriod))})),o.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,e.getElement())},O.prototype.bindTouchEvents=function(e,t){var o,i,n,s,a,r,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,e,o=e.nextRow(),n=o?o.getHeight()/2:0,i=e.prevRow(),s=i?i.getHeight()/2:0,a=0,r=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,d;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),c=t.touches[0].pageY-u,c>0?o&&c-a>n&&(d=o,d!==e&&(u=t.touches[0].pageY,d.getElement().parentNode.insertBefore(l.placeholderElement,d.getElement().nextSibling),l.moveRow(d,!0))):i&&-c-r>s&&(d=i,d!==e&&(u=t.touches[0].pageY,d.getElement().parentNode.insertBefore(l.placeholderElement,d.getElement()),l.moveRow(d,!1))),d&&(d,o=d.nextRow(),a=n,n=o?o.getHeight()/2:0,i=d.prevRow(),r=s,s=i?i.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))},O.prototype._bindMouseMove=function(){var e=this;e.table.rowManager.getDisplayRows().forEach((function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))},O.prototype._unbindMouseMove=function(){var e=this;e.table.rowManager.getDisplayRows().forEach((function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))},O.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.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(e)},O.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.pageXOffset,this.startY=i.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},O.prototype.endMove=function(e){e&&1!==e.which&&!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()))},O.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},O.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},O.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},O.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},O.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},O.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"===typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))},O.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))},O.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},O.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},O.prototype.dropComplete=function(e,t,o){var i=!1;if(o){switch(l(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender;break}i?i.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):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(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},O.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(console.trace("drop"),e.stopImmediatePropagation(),l(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver;break}o?i=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},O.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},O.prototype.senders={delete:function(e,t,o){e.delete()}},O.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},h.prototype.registerModule("moveRow",O);var B=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};B.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach((function(n){var s,a="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupMutator(e.definition[a]),s&&(o=!0,i[a]={mutator:s,params:e.definition[a+"Params"]||{}}))})),o&&(e.modules.mutate=i)},B.prototype.lookupMutator=function(e){var t=!1;switch("undefined"===typeof e?"undefined":l(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e;break}return t},B.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&n.table.columnManager.traverse((function(n){var a,r,l;n.modules.mutate&&(a=n.modules.mutate[s]||n.modules.mutate.mutator||!1,a&&(i=n.getFieldValue("undefined"!==typeof o?o:e),"data"!=t&&"undefined"===typeof i||(l=n.getComponent(),r="function"===typeof a.params?a.params(i,e,t,l):a.params,n.setFieldValue(e,a.mutator(i,e,t,r,l)))))})),e},B.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},B.prototype.enable=function(){this.enabled=!0},B.prototype.disable=function(){this.enabled=!1},B.prototype.mutators={},h.prototype.registerModule("mutator",B);var I=function(e){this.table=e,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 e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.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 e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes;while(this.pageSizeSelect.firstChild)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach((function(t){var o=document.createElement("option");o.value=t,!0===t?e.table.modules.localize.bind("pagination|all",(function(e){o.innerHTML=e})):o.innerHTML=t,e.pageSizeSelect.appendChild(o)})),this.pageSizeSelect.value=this.size}},I.prototype.initialize=function(e){var t,o,i,n=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),n.table.modules.localize.bind("pagination|first",(function(e){n.firstBut.innerHTML=e})),n.table.modules.localize.bind("pagination|first_title",(function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|prev",(function(e){n.prevBut.innerHTML=e})),n.table.modules.localize.bind("pagination|prev_title",(function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|next",(function(e){n.nextBut.innerHTML=e})),n.table.modules.localize.bind("pagination|next_title",(function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|last",(function(e){n.lastBut.innerHTML=e})),n.table.modules.localize.bind("pagination|last_title",(function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)})),n.firstBut.addEventListener("click",(function(){n.setPage(1)})),n.prevBut.addEventListener("click",(function(){n.previousPage()})),n.nextBut.addEventListener("click",(function(){n.nextPage().then((function(){})).catch((function(){}))})),n.lastBut.addEventListener("click",(function(){n.setPage(n.max)})),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",(function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",(function(e){n.setPageSize("true"==n.pageSizeSelect.value||n.pageSizeSelect.value),n.setPage(1).then((function(){})).catch((function(){}))}))),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||e||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.table.options.paginationSize?n.size=n.table.options.paginationSize:(o=document.createElement("div"),o.classList.add("tabulator-row"),o.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",o.appendChild(i),n.table.rowManager.getTableElement().appendChild(o),n.size=Math.floor(n.table.rowManager.getElement().clientHeight/o.offsetHeight),n.table.rowManager.getTableElement().removeChild(o)),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},I.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},I.prototype.setDisplayIndex=function(e){this.displayIndex=e},I.prototype.getDisplayIndex=function(){return this.displayIndex},I.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},I.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},I.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},I.prototype.setPage=function(e){var t=this,o=this;switch(e){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(i,n){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then((function(){i()})).catch((function(){n()})),o.table.options.persistence&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.config.page&&o.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),n())}))},I.prototype.setPageToRow=function(e){var t=this;return new Promise((function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var a=!0===t.size?1:Math.ceil((s+1)/t.size);t.setPage(a).then((function(){o()})).catch((function(){i()}))}else console.warn("Pagination Error - Requested row is not visible"),i()}))},I.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},I.prototype._setPageButtons=function(){var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},I.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",(function(t){o.setAttribute("aria-label",t+" "+e),o.setAttribute("title",t+" "+e)})),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",(function(o){t.setPage(e)})),o},I.prototype.previousPage=function(){var e=this;return new Promise((function(t,o){e.page>1?(e.page--,e.trigger().then((function(){t()})).catch((function(){o()})),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())}))},I.prototype.nextPage=function(){var e=this;return new Promise((function(t,o){e.pagen?i.splice(n,0,e):i.push(e))})),i},j.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))},j.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,e,t)},j.prototype.validateSorters=function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e},j.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},j.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},j.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach((function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach((function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}}))),o.push(n)})),o},j.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,a=n.indexOf(s+"=");return a>-1&&(n=n.substr(a),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},j.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},h.prototype.registerModule("persistence",j);var V=function(e){this.table=e,this.element=!1,this.manualBlock=!1};V.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},V.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.options.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))},V.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="")},V.prototype.printFullscreen=function(e,t,o){var i,n,s=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable("undefined"!=typeof o?o:this.table.options.printConfig,"undefined"!=typeof t?t:this.table.options.printStyled,e,"print");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"),i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof n?l.innerHTML=n:l.appendChild(n),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},h.prototype.registerModule("print",V);var W=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};W.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach((function(e){o.table.rowManager.addRowActual(e,!1)})),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach((function(e){o.table.rowManager.addRowActual(e,!0)})),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]),i&&i.deleteActual()),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]),i&&i.deleteActual()),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],a=n[1],r=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(r&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?r.forEach((function(e){o.table.rowManager.addRowActual(e,!0,i,!0)})):(r=r.slice().reverse(),r.forEach((function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)})))),0!==a){var l=e.slice(s,"undefined"===typeof n[1]?n[1]:s+a);l.forEach((function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)}))}(r||0!==a)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},W.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},W.prototype.watchRow=function(e){var t=e.getData();for(var o in this.blocked=!0,t)this.watchKey(e,t,o);this.blocked=!1},W.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],a=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&a===i.currentVersion){var r={};r[o]=t,e.updateData(r)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},W.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},W.prototype.block=function(){this.blocked=!0},W.prototype.unblock=function(){this.blocked=!1},h.prototype.registerModule("reactiveData",W);var G=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};G.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var r=document.createElement("div");r.className="tabulator-col-resize-handle prev",a.addEventListener("click",(function(e){e.stopPropagation()}));var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),a.addEventListener("dblclick",(function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))})),r.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){var o,n,s;o=t.getFirstColumn(),o&&(n=i.table.columnManager.findColumnIndex(o),s=n>0&&i.table.columnManager.getColumnByIndex(n-1),s&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,r)))};r.addEventListener("mousedown",u),r.addEventListener("touchstart",u,{passive:!0}),r.addEventListener("dblclick",(function(e){var o,n,s;o=t.getFirstColumn(),o&&(n=i.table.columnManager.findColumnIndex(o),s=n>0&&i.table.columnManager.getColumnByIndex(n-1),s&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))})),o.appendChild(a),o.appendChild(r)}},G.prototype._checkResizability=function(e){return"undefined"!=typeof e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},G.prototype._mouseDown=function(e,t,o){var i=this;function n(e){t.setWidth(i.startWidth+(("undefined"===typeof e.screenX?e.touches[0].screenX:e.screenX)-i.startX)),!i.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function s(e){i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!1),i.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",s),document.body.removeEventListener("mousemove",n),o.removeEventListener("touchmove",n),o.removeEventListener("touchend",s),i.table.element.classList.remove("tabulator-block-select"),i.table.options.persistence&&i.table.modExists("persistence",!0)&&i.table.modules.persistence.config.columns&&i.table.modules.persistence.save("columns"),i.table.options.columnResized.call(i.table,t.getComponent())}i.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!0),i.startX="undefined"===typeof e.screenX?e.touches[0].screenX:e.screenX,i.startWidth=t.getWidth(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",s),o.addEventListener("touchmove",n,{passive:!0}),o.addEventListener("touchend",s)},h.prototype.registerModule("resizeColumns",G);var U=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};U.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",(function(e){e.stopPropagation()}));var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.appendChild(i),o.appendChild(n)},U.prototype._mouseDown=function(e,t,o){var i=this;function n(e){t.setHeight(i.startHeight+(("undefined"===typeof e.screenY?e.touches[0].screenY:e.screenY)-i.startY))}function s(e){document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",n),o.removeEventListener("touchmove",n),o.removeEventListener("touchend",s),i.table.element.classList.remove("tabulator-block-select"),i.table.options.rowResized.call(this.table,t.getComponent())}i.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),i.startY="undefined"===typeof e.screenY?e.touches[0].screenY:e.screenY,i.startHeight=t.getHeight(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",s),o.addEventListener("touchmove",n,{passive:!0}),o.addEventListener("touchend",s)},h.prototype.registerModule("resizeRows",U);var q=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};q.prototype.initialize=function(e){var t,o=this,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!==typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}})),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}})),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},q.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},h.prototype.registerModule("resizeTable",q);var Y=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var e=this,t=[];this.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(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))})),t=t.reverse(),t=t.sort((function(e,t){var o=t.modules.responsive.order-e.modules.responsive.order;return o||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var o=this.table.columnManager.columnsByIndex,i=Array.isArray(o),n=0;for(o=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var a=s;if("responsiveCollapse"==a.definition.formatter){this.collapseHandleColumn=a;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},Y.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:"undefined"===typeof t.responsive?1:t.responsive,visible:!1!==t.visible}},Y.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},Y.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},Y.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},Y.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){var e=this,t=!0;while(t){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1];s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var e=this,t=this.table.rowManager.getDisplayRows();t.forEach((function(t){e.generateCollapsedRowContent(t)}))},Y.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){t=e.modules.responsiveLayout.element;while(t.firstChild)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.getData(),n=[];return this.hiddenColumns.forEach((function(s){var a=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return a},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:a}))})),n},Y.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach((function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""})),t.innerHTML=o,Object.keys(e).length?t:""},h.prototype.registerModule("responsiveLayout",Y);var $=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};$.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},$.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",(function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,a=i>=n?i:n,r=t.table.rowManager.getDisplayRows().slice(0),l=r.splice(s,a-s+1);o.ctrlKey||o.metaKey?(l.forEach((function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)||t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)})):(o.addEventListener("click",(function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),o.addEventListener("mousedown",(function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1})),o.addEventListener("mouseenter",(function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),o.addEventListener("mouseout",(function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},$.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},$.prototype.selectRows=function(e){var t,o=this;switch("undefined"===typeof e?"undefined":l(e)){case"undefined":this.table.rowManager.rows.forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0);break}},$.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},$.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},$.prototype.deselectRows=function(e,t){var o,i=this;if("undefined"==typeof e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t))):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},$.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e},$.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e},$.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(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)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},$.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},$.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},$.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t){var i=o,n=Array.isArray(i),s=0;for(i=n?i:i[Symbol.iterator]();;){var a;if(n){if(s>=i.length)break;a=i[s++]}else{if(s=i.next(),s.done)break;a=s.value}var r=a;this._selectRow(r,!0)}}else{var l=o,u=Array.isArray(l),c=0;for(l=u?l:l[Symbol.iterator]();;){var d;if(u){if(c>=l.length)break;d=l[c++]}else{if(c=l.next(),c.done)break;d=c.value}var h=d;this._deselectRow(h,!0)}}},h.prototype.registerModule("selectRow",$);var X=function(e){this.table=e,this.sortList=[],this.changed=!1};X.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(l(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter;break}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:"undefined"!==typeof e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},("undefined"===typeof e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",(function(t){var o="",i=[],s=!1;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex((function(t){return t.field===e.getField()})),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}})))},X.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},X.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach((function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})})),t},X.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},X.prototype.clear=function(){this.setSort([])},X.prototype.findSorter=function(e){var t,o,i=this.table.rowManager.activeRows[0],n="string";if(i&&(i=i.getData(),t=e.getField(),t))switch(o=e.getFieldValue(i),"undefined"===typeof o?"undefined":l(o)){case"undefined":n="string";break;case"boolean":n="boolean";break;default:isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(n="alphanum"):n="number";break}return this.sorters[n]},X.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[],n=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach((function(e,o){t.setColumnHeader(e.column,e.dir)})):(o.forEach((function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"===typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)})),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&(e.forEach((function(e){n.push(e.getComponent())})),t.table.options.dataSorted.call(t.table,t.getSort(),n))},X.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))},X.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},X.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort((function(e,n){for(var s,a=i;a>=0;a--){var r=t[a];if(s=o._sortRow(e,n,r.column,r.dir,r.params),0!==s)break}return s}))},X.prototype._sortRow=function(e,t,o,i,n){var s,a,r="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(r.getData()),t=o.getFieldValue(l.getData()),e="undefined"!==typeof e?e:"",t="undefined"!==typeof t?t:"",s=r.getComponent(),a=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,a,o.getComponent(),i,n)},X.prototype.sorters={number:function(e,t,o,i,n,s,a){var r=a.alignEmptyValues,l=a.decimalSeparator||".",u=a.thousandSeparator||",",c=0;if(e=parseFloat(String(e).split(u).join("").split(l).join(".")),t=parseFloat(String(t).split(u).join("").split(l).join(".")),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===r&&"desc"===s||"bottom"===r&&"asc"===s)&&(c*=-1),c},string:function(e,t,o,i,n,s,a){var r,u=a.alignEmptyValues,c=0;if(e){if(t){switch(l(a.locale)){case"boolean":a.locale&&(r=this.table.modules.localize.getLocale());break;case"string":r=a.locale;break}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),r)}c=1}else c=t?-1:0;return("top"===u&&"desc"===s||"bottom"===u&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,a){return a.format||(a.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},time:function(e,t,o,i,n,s,a){return a.format||(a.format="HH:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},datetime:function(e,t,o,i,n,s,a){var r=a.format||"DD/MM/YYYY HH:mm:ss",l=a.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(e=moment(e,r),t=moment(t,r),e.isValid()){if(t.isValid())return e-t;u=1}else u=t.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(e,t,o,i,n,s,a){var r=!0===e||"true"===e||"True"===e||1===e?1:0,l=!0===t||"true"===t||"True"===t||1===t?1:0;return r-l},array:function(e,t,o,i,n,s,a){var r=0,l=0,u=a.type||"length",c=a.alignEmptyValues,d=0;function h(e){switch(u){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return r=e?h(e):0,l=t?h(t):0,r-l;c=1}else c=Array.isArray(t)?-1:0;return("top"===c&&"desc"===s||"bottom"===c&&"asc"===s)&&(d*=-1),d},exists:function(e,t,o,i,n,s,a){var r="undefined"==typeof e?0:1,l="undefined"==typeof t?0:1;return r-l},alphanum:function(e,t,o,i,n,s,a){var r,l,u,c,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=a.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(r=String(e).toLowerCase(),l=String(t).toLowerCase(),r===l)return 0;if(!m.test(r)||!m.test(l))return r>l?1:-1;r=r.match(p),l=l.match(p),d=r.length>l.length?l.length:r.length;while(hc?1:-1;return r.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},h.prototype.registerModule("sort",X);var K=function(e){this.table=e,this.invalidCells=[]};return K.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){t=o._extractValidator(e),t&&i.push(t)})):(t=this._extractValidator(e.definition.validator),t&&i.push(t)),e.modules.validate=!!i.length&&i)},K.prototype._extractValidator=function(e){var t,o,i;switch("undefined"===typeof e?"undefined":l(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},K.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},K.prototype.validate=function(e,t,o){var i=this,n=[],s=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(i,t.getComponent(),o,e.params)||n.push({type:e.type,parameters:e.params})})),n=!n.length||n,t.modules.validate||(t.modules.validate={}),!0===n?(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(t.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(t)),n},K.prototype.getInvalidCells=function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e},K.prototype.clearValidation=function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.element.classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,t=this.invalidCells.indexOf(e),t>-1&&this.invalidCells.splice(t,1))},K.prototype.validators={integer:function(e,t,o){return""===t||null===t||"undefined"===typeof t||(t=Number(t),"number"===typeof t&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,o){return""===t||null===t||"undefined"===typeof t||(t=Number(t),"number"===typeof t&&isFinite(t)&&t%1!==0)},numeric:function(e,t,o){return""===t||null===t||"undefined"===typeof t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||"undefined"===typeof t||isNaN(t)},max:function(e,t,o){return""===t||null===t||"undefined"===typeof t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||"undefined"===typeof t||parseFloat(t)>=o},starts:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||"undefined"===typeof t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){if(""===t||null===t||"undefined"===typeof t)return!0;var i=new RegExp(o);return i.test(t)},unique:function(e,t,o){if(""===t||null===t||"undefined"===typeof t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)})),i},required:function(e,t,o){return""!==t&&null!==t&&"undefined"!==typeof t}},h.prototype.registerModule("validate",K),h}))},7626:function(e,t,o){},ce1f:function(e,t,o){"use strict";var i=o("7626"),n=o.n(i);n.a},fb98:function(e,t,o){}}); +//# sourceMappingURL=app.01f46d27.js.map \ No newline at end of file diff --git a/Sources/Assets/js/app.874d57d0.js b/Sources/Assets/js/app.874d57d0.js deleted file mode 100644 index 78806c3..0000000 --- a/Sources/Assets/js/app.874d57d0.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(e){function t(t){for(var i,n,r=t[0],l=t[1],u=t[2],c=0,d=[];c=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw s}}}}function w(e,t){if(e){if("string"===typeof e)return E(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oEMPTY",VARCHAR:"EMPTY",REAL:0,BLOB:0},filterOperators:{"=":"=","<>":"<>","<":"<",">":">","<=":"<=",">=":">=",IN:"IN","NOT IN":"NOT IN","IS NULL":"IS NULL",BETWEEN:"BETWEEN","NOT BETWEEN":"NOT BETWEEN",contains:"contains","Not contains":"Not contains","Has prefix":"Has prefix","Has suffix":"Has suffix"},operatorInputPlaceholder:{"=":"EMPTY","<>":"EMPTY","<":"EMPTY",">":"EMPTY","<=":"EMPTY",">=":"EMPTY",IN:"1,2,3","NOT IN":"1,2,3","IS NULL":"","IS NOT NULL":"",BETWEEN:"1 AND 100","NOT BETWEEN":"1 AND 100",contains:"Pattern","Not contains":"Pattern","Has suffix":"Pattern","Has prefix":"Pattern"},operatorString:{"=":function(e){return"= '".concat(e,"'")},"<>":function(e){return"<> '".concat(e,"'")},"<":function(e){return"< '".concat(e,"'")},">":function(e){return"> '".concat(e,"'")},"<=":function(e){return"<= '".concat(e,"'")},">=":function(e){return">= '".concat(e,"'")},IN:function(e){return"IN (".concat(e,")")},"NOT IN":function(e){return"NOT IN (".concat(e,")")},"IS NULL":function(){return"IS NULL"},"IS NOT NULL":function(){return"IS NOT NULL"},BETWEEN:function(e){return"BETWEEN ".concat(e)},"NOT BETWEEN":function(e){return"NOT BETWEEN ".concat(e)},contains:function(e){return"LIKE '%".concat(e,"%'")},"Not contains":function(e){return"NOT LIKE '%".concat(e,"%'")},"Has suffix":function(e){return"LIKE '%".concat(e,"'")},"Has prefix":function(e){return"LIKE '".concat(e,"%'")}},operatorValueValidators:{"=":/.+/,"<>":/.+/,"<":/.+/,">":/.+/,"<=":/.+/,">=":/.+/,IN:/(.+?)(?:,|$)/,"NOT IN":/(.+?)(?:,|$)/,"IS NULL":/\s{0}/,"IS NOT NULL":/\s{0}/,BETWEEN:/\w+\s(and|AND)\s\w+/,"NOT BETWEEN":/\w+\s(and|AND)\s\w+/,contains:/.+/,"Not contains":/.+/,"Has suffix":/.+/,"Has prefix":/.+/},selectQuery:function(e,t){var o,i="",n=[],s=y(t);try{for(s.s();!(o=s.n()).done;){var a=o.value;if(a.value){var r=C.operatorString[a.operator](a.value);n.push('("'.concat(a.column," ").concat(r,'")'))}}}catch(l){s.e(l)}finally{s.f()}return 0===n.length?null:(i+=" ".concat(n.join(" AND ").replace(/"/g,"")),i)}},x={provider:C},R=function(e,t,o){return null===o||void 0===o?"NULL":"BLOB"===e.type?"BLOB":o||("surname"===e&&console.log(e,o,!!o),x.provider.defaultValues[t])},M=R,L={props:["id","column","row","updateValue"],data:function(){return{allowEdit:!1,isInEditMode:!1,updatedValue:null}},computed:{value:function(){return M(this.column,this.row)},inputModel:{set:function(e){this.updatedValue=e},get:function(){return this.value}}},methods:{handleRowClick:function(){var e=this;this.allowEdit&&(this.isInEditMode=!this.isInEditMode,this.$nextTick((function(){return e.$refs.updateValueInput.focus()})))},saveValue:function(){this.isInEditMode=!this.isInEditMode,this.updateValue(this.id,this.column,this.updatedValue)}}},T=L,k=Object(l["a"])(T,b,v,!1,null,null,null),D=k.exports,S=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("thead",[o("tr",e._l(e.columns,(function(t){return t?o("th",{key:t.__id,attrs:{"data-c":e.current,"data-eq":""+(e.current===t.name),"data-type":e.orderType},on:{click:function(o){return o.preventDefault(),e.orderClick(t.name)}}},[o("div",{staticStyle:{display:"flex","flex-direction":"row"}},[o("span",{staticStyle:{flex:"1 1 auto"}},[e._v(e._s(t.name))]),e.current===t.name?o("i",{class:"asc"===e.type.toLowerCase()?"sort-descending":"sort-ascending"}):e._e(),e.current!==t.name?o("div",{staticStyle:{width:"14px",height:"2px"}}):e._e()])]):e._e()})),0)])},H=[],P={props:{columns:Array,current:String,type:String,orderHandler:Function},mounted:function(){console.log(this.columns,this.current)},computed:{orderType:function(){return"asc"===this.type.toLowerCase()?"desc":"asc"}},methods:{orderClick:function(e){this.orderHandler(this.orderType,e)}}},A=P,z=Object(l["a"])(A,S,H,!1,null,null,null),F=z.exports,_=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"table-filters",staticStyle:{"min-height":"42px",position:"relative"}},[e._l(e.filters,(function(t,i){return o("div",{staticClass:"table-filter"},[o("select",{directives:[{name:"model",rawName:"v-model",value:t.column,expression:"f.column"}],staticClass:"mr-0-5",attrs:{name:"column"},on:{change:[function(o){var i=Array.prototype.filter.call(o.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(t,"column",o.target.multiple?i:i[0])},function(o){return e.handleColumnChange(t)}]}},e._l(e.columns,(function(t){return o("option",{domProps:{value:t.name}},[e._v(e._s(t.name)+" ")])})),0),o("select",{directives:[{name:"model",rawName:"v-model",value:t.operator,expression:"f.operator"}],staticClass:"mr-0-5",attrs:{name:"filter"},on:{change:[function(o){var i=Array.prototype.filter.call(o.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(t,"operator",o.target.multiple?i:i[0])},function(o){return e.handleOperatorChange(t)}]}},e._l(e.filterOperators,(function(t){return o("option",{domProps:{value:t}},[e._v(e._s(t)+" ")])})),0),o("input",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"f.value"}],staticClass:"mr-0-5",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.value},on:{input:[function(o){o.target.composing||e.$set(t,"value",o.target.value)},function(o){return e.validateInputValue(t)}]}}),o("button",{staticClass:"btn-octicon mr-0-5",on:{click:function(t){return t.preventDefault(),e.addFilter(t)}}},[e._v("+ ")]),o("button",{class:"btn-octicon mr-0-5",on:{click:function(t){return t.preventDefault(),e.removeFilter(i)}}},[e._v("- ")]),o("button",{staticClass:"btn btn-primary",attrs:{disabled:!t.isButtonEnabled},on:{click:function(t){return t.preventDefault(),e.apply(t)}}},[e._v("Apply")])])})),0===e.filters.length?o("button",{staticClass:"btn btn-primary",staticStyle:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:"8px"},on:{click:function(t){return t.preventDefault(),e.addFilter(t)}}},[e._v("Add Filter")]):e._e()],2)},N=[],O={props:{database:String,table:String,columns:Array,applyFilters:Function},data:function(){var e=Object.keys(x.provider.filterOperators),t=this.$store.getters.getFilters(this.database,this.table);return{filterOperators:e,value:null,filters:t}},watch:{filters:function(){var e=Math.max(42,42*this.filters.length);this.$store.commit("updateTableFiltersHeight",e)}},methods:{handleOperatorChange:function(e){e.placeholder=x.provider.operatorInputPlaceholder[e.operator],this.apply()},handleColumnChange:function(e){this.apply()},validateInputValue:function(e){e.isButtonEnabled=x.provider.operatorValueValidators[e.operator].test(e.value),e.isButtonEnabled&&this.apply()},removeFilter:function(e){i["a"].delete(this.filters,e),this.apply()},addFilter:function(){var e;this.filters.push({value:null,column:null===(e=this.columns[0])||void 0===e?void 0:e.name,operator:this.filterOperators[0],placeholder:x.provider.operatorInputPlaceholder[this.filterOperators[0]],isButtonEnabled:!1})},apply:function(){this.applyFilters(this.filters),this.save()},save:function(){this.$store.commit("updateByKey",{database:this.database,table:this.table,key:"filters",value:JSON.stringify(this.filters)})}}},B=O,I=Object(l["a"])(B,_,N,!1,null,null,null),j=I.exports,V=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"limit-offset",style:"bottom: "+e.sqlLogsHeight+"px"},[o("div",{staticClass:"mr-1-em"}),o("label",{staticClass:"mr-0-5",attrs:{for:"limit"}},[e._v("Limit")]),o("input",{staticClass:"mr-1-em",staticStyle:{"max-width":"80px"},attrs:{type:"number",name:"limit",min:"0",id:"limit"},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",t.target.valueAsNumber)}}}),o("button",{staticClass:"btn btn-primary",on:{click:function(t){return t.preventDefault(),e.resetOrderTypeLimit(t)}}},[e._v("Reset")])])},W=[],G={props:{value:Number,resetOrderTypeLimit:Function},computed:{sqlLogsHeight:function(){return this.$store.state.sqlLogsHeight}}},U=G,q=(o("ce1f"),Object(l["a"])(U,V,W,!1,null,"65c31891",null)),Y=q.exports,$=o("6d09"),X=o.n($);function K(e,t,o,i,n,s,a){try{var r=e[s](a),l=r.value}catch(u){return void o(u)}r.done?t(l):Promise.resolve(l).then(i,n)}function J(e){return function(){var t=this,o=arguments;return new Promise((function(i,n){var s=e.apply(t,o);function a(e){K(s,i,n,a,r,"next",e)}function r(e){K(s,i,n,a,r,"throw",e)}a(void 0)}))}}var Q={components:{Row:D,TableHeader:F,TableFilters:j,LimitOffset:Y},data:function(){return{key:this.$route.fullPath,columns:[],columnTypes:{},rowsCount:0,tableData:null,skippedFirstLimitChange:!1,limit:20,offset:0,order:1,type:"asc",clause:null}},mounted:function(){this.table&&this.setup()},computed:{table:function(){var e=this.$route.params.table;return this.$store.state.tables.find((function(t){return t.tableName===e}))},tableFilterHeight:function(){return this.$store.state.tableFiltersHeight}},watch:{table:function(){this.setup()},limit:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"limit",value:this.limit}),this.tableData.setPageSize(this.limit),this.tableData.setMaxPage(Math.round(this.rowsCount/this.limit))},order:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"order",value:this.order})},type:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"type",value:this.type})}},methods:{setup:function(){var e=this;console.log("setup");var t=this.$route.params.database;this.columns=this.table.columns.sort((function(e){return e.cid})),this.table.columns.forEach((function(t){return e.columnTypes[t.name]=t.type})),this.rowsCount=this.table.count,this.limit=this.$store.getters.getLimit(t,this.table.tableName),this.order=this.$store.getters.getByKey(t,this.table.tableName,"order")||"1",this.type=this.$store.getters.getByKey(t,this.table.tableName,"type")||"asc";var o=this.$store.getters.getFilters(t,this.table.tableName);(null===o||void 0===o?void 0:o.length)>0&&(this.clause=x.provider.selectQuery(this.table.tableName,o)),this.tableData=new X.a(".table-data",{height:"100%",layout:"fitColumns",placeholder:"No Data Set",columnHeaderSortMulti:!1,ajaxSorting:!0,ajaxLoader:!1,ajaxURL:"https://local",ajaxFiltering:!0,paginationSize:this.limit,paginationInitialPage:1,pagination:"remote",ajaxRequestFunc:function(){var t=J(f.a.mark((function t(o,i,n){var s,a,r,l,u,c,d,h,p;return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("ajaxRequestFunc",o,i,n),n.sorters){t.next=3;break}return t.abrupt("return");case 3:return s=e.$route.query,a=s.type,r=s.order,s.clause,l=n.sorters[0]||{dir:a,field:r},u=l.dir,c=l.field,e.order=c,e.type=u,d=n.page,h=n.size,e.offset=d-1,t.next=12,e.fetchData();case 12:if(t.t0=t.sent,t.t0){t.next=15;break}t.t0=[];case 15:return p=t.t0,t.abrupt("return",{data:p,last_page:Math.round(e.rowsCount/h)});case 17:case"end":return t.stop()}}),t)})));function o(e,o,i){return t.apply(this,arguments)}return o}(),initialSort:[{column:this.order,dir:this.type}],data:[],columns:this.columns.map((function(t){return{title:t.name,field:t.name,vertAlign:"middle",formatter:function(t,o,i){var n=t.getColumn().getField();return M(n,e.columnTypes[n],t.getValue())}}}))}),this.tableData.setMaxPage(Math.round(this.rowsCount/this.limit))},resetOrderTypeLimit:function(){var e=this.$route.params,t=e.database,o=e.table;this.$store.commit("updateByKey",{database:t,table:o,key:"limit",value:20}),this.$store.commit("updateByKey",{database:t,table:o,key:"order",value:1}),this.$store.commit("updateByKey",{database:t,table:o,key:"type",value:"asc"}),this.order=1,this.type="asc",this.limit=20,this.tableData.setData()},fetchData:function(){var e=this;return J(f.a.mark((function t(){var o,i,n,s,a,r,l,u;return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=e.$route.params,i=o.database,n=o.table,s="".concat(e.order," ").concat(e.type),a=isNaN(e.limit)?20:e.limit,r=isNaN(e.offset)?0:e.offset,l={type:"rows",databaseName:i,tableName:n,order:s,limit:"".concat(a),offset:"".concat(r*a),clause:e.clause},console.log("fetchData",l),t.next=8,g["a"].sendRequest(l);case 8:return u=t.sent,t.abrupt("return",u.data.rows);case 10:case"end":return t.stop()}}),t)})))()},applyFilters:function(e){var t=this;return J(f.a.mark((function o(){var i;return f.a.wrap((function(o){while(1)switch(o.prev=o.next){case 0:i=t.$route.params.table,t.clause=x.provider.selectQuery(i,e),t.tableData.setData();case 3:case"end":return o.stop()}}),o)})))()}}},Z=Q,ee=Object(l["a"])(Z,h,p,!1,null,null,null),te=ee.exports,oe=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"col-11 p-2 mx-auto col-md-6"},[o("div",{staticClass:"Box"},[e._m(0),e._l(e.databases,(function(t){return o("div",{staticClass:"Box-body"},[o("router-link",{attrs:{to:"/database/"+t}},[e._v(e._s(t))])],1)}))],2)])},ie=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"Box-header"},[o("h3",{staticClass:"Box-title"},[e._v(" Choose database ")])])}];function ne(e,t,o,i,n,s,a){try{var r=e[s](a),l=r.value}catch(u){return void o(u)}r.done?t(l):Promise.resolve(l).then(i,n)}function se(e){return function(){var t=this,o=arguments;return new Promise((function(i,n){var s=e.apply(t,o);function a(e){ne(s,i,n,a,r,"next",e)}function r(e){ne(s,i,n,a,r,"throw",e)}a(void 0)}))}}var ae={data:function(){return{databases:[]}},mounted:function(){var e=this;return se(f.a.mark((function t(){return f.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,g["a"].open();case 2:return t.next=4,g["a"].sendRequest({type:"databases"});case 4:if(e.databases=t.sent.data,1!==e.databases.length){t.next=8;break}return t.next=8,e.$router.replace("/database/".concat(e.databases[0]));case 8:case"end":return t.stop()}}),t)})))()}},re=ae,le=Object(l["a"])(re,oe,ie,!1,null,null,null),ue=le.exports;i["a"].use(d["a"]);var ce=[{path:"/",name:"Databases",component:ue},{path:"/database/:database",name:"database",component:function(){return o.e("about").then(o.bind(null,"076a"))},children:[{path:"table/:table",component:te,name:"table"}]},{path:"/not-found",name:"NotFound",component:o.e("about").then(o.bind(null,"9703"))},{path:"*",redirect:"/not-found"}],de=new d["a"]({mode:"history",base:"/",routes:ce}),he=de,pe=o("2f62");i["a"].use(pe["a"]);var me=new pe["a"].Store({state:{selectedRow:null,tables:[],databases:[],tablesSidebarWidth:250,isTablesSideBarHidden:!1,isSqlLogsHidden:!1,sqlLogsHeight:200,tableFiltersHeight:42},mutations:{setDatabases:function(e,t){e.databases=t},setTables:function(e,t){e.tables=t},updateByKey:function(e,t){var o=t.value,i=t.database,n=t.table,s=t.key;localStorage.setItem("".concat(i,"_").concat(n,"_").concat(s),o)},updateOffset:function(e,t,o,i){localStorage.setItem("".concat(t,"_").concat(o,"_offset"),i)},updateSqlLogsHeight:function(e,t){e.sqlLogsHeight=t},updateTableFiltersHeight:function(e,t){e.tableFiltersHeight=t},updateTablesSidebarWidth:function(e,t){e.tablesSidebarWidth=t},toggleTablesSideBarHidden:function(e){e.isTablesSideBarHidden=!e.isTablesSideBarHidden,e.tablesSidebarWidth=e.isTablesSideBarHidden?1:250},toggleSqlLogsHidden:function(e){e.isSqlLogsHidden=!e.isSqlLogsHidden,e.sqlLogsHeight=e.isSqlLogsHidden?1:200}},actions:{},modules:{},getters:{getLimit:function(e){return function(e,t){var o=localStorage.getItem("".concat(e,"_").concat(t,"_limit"));return parseInt(o||20,10)}},getByKey:function(e){return function(e,t,o){return localStorage.getItem("".concat(e,"_").concat(t,"_").concat(o))}},getFilters:function(e){return function(e,t){var o=localStorage.getItem("".concat(e,"_").concat(t,"_filters"));return o?JSON.parse(o):[]}},getTablePrimaryKey:function(e){return function(t){var o,i;return null===(o=e.tables.find((function(e){return e.tableName===t})))||void 0===o||null===(i=o.columns.find((function(e){return 1===e.pk})))||void 0===i?void 0:i.name}}}}),fe=o("fb19"),ge=o.n(fe);o("278f"),o("fb98");i["a"].config.productionTip=!1,i["a"].component("vue-draggable-resizable",ge.a),new i["a"]({router:he,store:me,render:function(e){return e(c)}}).$mount("#app")},"6d09":function(t,o,n){var s,a;function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var l="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)};(function(e,i){"object"===l(o)&&"undefined"!==typeof t?t.exports=i():(s=i,a="function"===typeof s?s.call(o,n,o,t):s,void 0===a||(t.exports=a))})(0,(function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!==typeof e)throw new TypeError("predicate must be a function");var i=arguments[1],n=0;while(n>>0;if("function"!==typeof e)throw new TypeError("predicate must be a function");var i=arguments[1],n=0;while(n>>0;if(0===i)return!1;var n=0|t,s=Math.max(n>=0?n:i-Math.abs(n),0);function a(e,t){return e===t||"number"===typeof e&&"number"===typeof t&&isNaN(e)&&isNaN(t)}while(so?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){for(var n in t=e[0],t){var s={field:n,title:n},a=t[n];switch("undefined"===typeof a?"undefined":l(a)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(a)?"array":"string";break;default:o=isNaN(a)||""===a?a.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number";break}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){var o=this;while(o.headersElement.firstChild)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),e.forEach((function(e,t){o._addColumn(e)})),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var i=new n(e,this),s=i.getElement(),a=o?this.findColumnIndex(o):o;if(o&&a>-1){var r=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(r,0,i),l.parentNode.insertBefore(s,l)):(this.columns.splice(r+1,0,i),l.parentNode.insertBefore(s,l.nextSibling))}else t?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},t.prototype.registerColumnField=function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach((function(e){var o;e.clearVerticalAlign(),o=e.getHeight(),o>t&&(t=o)})),e.columns.forEach((function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=("undefined"===typeof e?"undefined":l(e)))return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement){var i=t.columns.find((function(t){return t.element===e}));return i||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach((function(i){var n=i.split(".")[0];n===e&&o.push(t.columnsByField[i])})),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){e=this.columnsByIndex.findIndex((function(e){return e.visible}));return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){var t=this;t.columnsByIndex.forEach((function(t,o){e(t,o)}))},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach((function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())})),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach((function(e){t.push(e.getDefinition(!0))})),t},t.prototype.getComponents=function(e){var t=this,o=[],i=e?t.columns:t.columnsByIndex;return i.forEach((function(e){o.push(e.getComponent())})),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,o),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),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.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")},t.prototype._moveColumnInArray=function(e,t,o,i,n){var s,a=e.indexOf(t);a>-1&&(e.splice(a,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=a,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach((function(e){if(e.cells.length){var t=e.cells.splice(a,1)[0];e.cells.splice(s,0,t)}})))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,a=0,r=e.getElement();return new Promise((function(l,u){if("undefined"===typeof t&&(t=i.table.options.scrollToColumnPosition),"undefined"===typeof o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":a=-i.element.clientWidth/2;break;case"right":a=r.clientWidth-i.headersElement.clientWidth;break}if(!o&&(s=r.offsetLeft,s>0&&s+r.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s="undefined"==typeof i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)})),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i._addColumn(e,t,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&a.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(a)}))},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(h.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1||e?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),e&&(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()};var o=function(e){this._column=e,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e},o.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},o.prototype.isVisible=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){return this._column.delete()},o.prototype.getSubColumns=function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e},o.prototype.getParentColumn=function(){return this._column.parent instanceof n&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},o.prototype.setHeaderFilterValue=function(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(e){return!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e)},o.prototype.validate=function(){return this._column.validate()};var n=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!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.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach((function(t,o){var n=new e(t,i);i.attachColumn(n)})),i.checkColumnVisibility()):o.registerColumnField(this),t.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};n.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},n.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},n.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))},n.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},n.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)},n.prototype._mapDepricatedFunctionality=function(){"undefined"!==typeof this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),"undefined"!==typeof this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),"undefined"!==typeof this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},n.prototype.setTooltip=function(){var e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,(function(o){e.element.setAttribute("title",o||t.title)})):e.element.setAttribute("title",t.title):("function"==typeof o&&(o=o(e.getComponent()),!1===o&&(o="")),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},n.prototype._buildHeader=function(){var e=this,t=e.definition;while(e.element.firstChild)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&("undefined"!==typeof t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",(function(t){e.setTooltip()}))},n.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",(function(e){n.headerClick(e,i.getComponent())})),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",(function(e){n.headerDblClick(e,i.getComponent())})),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",(function(e){n.headerContext(e,i.getComponent())})),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",(function(e){o=!0}),{passive:!0}),i.element.addEventListener("touchend",(function(e){o&&n.headerTap(e,i.getComponent()),o=!1}))),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",(function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout((function(){clearTimeout(e),e=null}),300)}))),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",(function(e){clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())}),1e3)}),{passive:!0}),i.element.addEventListener("touchend",(function(e){clearTimeout(t),t=null}))),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},n.prototype._buildColumnHeader=function(){var e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),"undefined"!=typeof t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),"undefined"!=typeof t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),l(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),"undefined"!=typeof t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){var i=t.cssClass.split(" ");i.forEach((function(t){e.element.classList.add(t)}))}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth("undefined"==typeof t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign="undefined"==typeof e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign="undefined"==typeof e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},n.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},n.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())})),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,(function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")})):e._formatColumnHeaderTitle(i,t.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(e,t){var o,i,n,s,a,r=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),a=function(e){r.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},n=this.definition.titleFormatterParams||{},n="function"===typeof n?n():n,i=o.call(this.table.modules.format,s,n,a),"undefined"===typeof i?"undefined":l(i)){case"object":i instanceof Node?e.appendChild(i):(e.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:",i));break;case"undefined":case"null":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},n.prototype._buildGroupHeader=function(){var e=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 t=this.definition.cssClass.split(" ");t.forEach((function(t){e.element.classList.add(t)}))}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(e){return e[this.field]},n.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},n.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},n.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},n.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},n.prototype.reinitializeWidth=function(e){this.widthFixed=!1,"undefined"===typeof this.definition.width||e||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()},n.prototype.fitToData=function(){var e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach((function(e){var o=e.getWidth();o>t&&(t=o)})),t&&e.setWidthActual(t+1))},n.prototype.updateDefinition=function(e){var t=this;return new Promise((function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then((function(e){n.field==t.field&&(t.field=!1),t.delete().then((function(){o(e.getComponent())})).catch((function(e){i(e)}))})).catch((function(e){i(e)})))}))},n.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","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","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],n.prototype.getComponent=function(){return this.component||(this.component=new o(this)),this.component};var s=function(e){this.table=e,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};s.prototype.createHolderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},s.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},s.prototype.setColumnManager=function(e){this.columnManager=e},s.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",(function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t})),"virtual"===this.renderMode&&e.element.addEventListener("scroll",(function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t}))},s.prototype.findRow=function(e){var t=this;if("object"!=("undefined"===typeof e?"undefined":l(e))){if("undefined"==typeof e||null===e)return!1;var o=t.rows.find((function(o){return o.data[t.table.options.index]==e}));return o||!1}if(e instanceof r)return e;if(e instanceof a)return e._getSelf()||!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement){var i=t.rows.find((function(t){return t.element===e}));return i||!1}return!1},s.prototype.getRowFromDataObject=function(e){var t=this.rows.find((function(t){return t.data===e}));return t||!1},s.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},s.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),a=e.getElement(),r=0;return new Promise((function(e,l){if(s>-1){if("undefined"===typeof t&&(t=n.table.options.scrollToRowPosition),"undefined"===typeof o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=h.prototype.helpers.elOffset(a).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top";break}if(!o&&h.prototype.helpers.elVisible(a)&&(r=h.prototype.helpers.elOffset(a).top-h.prototype.helpers.elOffset(n.element).top,r>0&&r-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.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")},s.prototype.addRow=function(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},s.prototype.addRows=function(e,t,o){var i=this,n=this,s=[];return new Promise((function(a,r){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length-1,("undefined"==typeof o&&t||"undefined"!==typeof o&&!t)&&e.reverse(),e.forEach((function(e,i){var a=n.addRow(e,t,o,!0);s.push(a)})),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(s)}))},s.prototype.findAddRowPos=function(e){return"undefined"===typeof e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},s.prototype.addRowActual=function(e,t,o,i){var n,s,a=e instanceof r?e:new r(e||{},this),l=this.findAddRowPos(t),u=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==c.indexOf(o)?l?c[0]!==a&&(o=c[0],this._moveRowInArray(a.getGroup().rows,a,o,!l)):c[c.length-1]!==a&&(o=c[c.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!l)):this._moveRowInArray(a.getGroup().rows,a,o,!l))}return o&&(u=this.rows.indexOf(o)),o&&u>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator((function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,a)})),n>-1&&this.activeRows.splice(l?n:n+1,0,a),this.rows.splice(l?u:u+1,0,a)):l?(this.displayRowIterator((function(e){e.unshift(a)})),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator((function(e){e.push(a)})),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),a},s.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},s.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator((function(n){i._moveRowInArray(n,e,t,o)})),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof H&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},s.prototype._moveRowInArray=function(e,t,o,i){var n,s,a,r;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){a=nn?s:n+1;for(var l=a;l<=r;l++)e[l]&&this.styleRow(e[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},s.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},s.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1))&&o},s.prototype.getData=function(e,t){var o=[],i=this.getRows(e);return i.forEach((function(e){"row"==e.type&&o.push(e.getData(t||"data"))})),o},s.prototype.getComponents=function(e){var t=[],o=this.getRows(e);return o.forEach((function(e){t.push(e.getComponent())})),t},s.prototype.getDataCount=function(e){var t=this.getRows(e);return t.length},s.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach((function(e){delete e.column})),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}console.log("======-=-=",o.pagination,i),o.pagination,t.modules.ajax.sendRequest().then((function(t){e._setDataActual(t,!0)})).catch((function(e){}))},s.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then((function(){})).catch((function(){}))):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then((function(){})).catch((function(){})):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?(console.log(t.modules.page),("remote"===o.pagination||o.progressiveLoad)&&t.modExists("page")?t.modules.page.setPage(t.modules.page.page).then((function(){})).catch((function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then((function(){})).catch((function(){})):this._genRemoteRequest()):this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},s.prototype.refreshActiveData=function(e,t,o){var i,n=this,s=this.table,a=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)(!this.redrawBlockRestoreConfig||a.indexOf(e)=0))break;s=r}else if(t-a[r].getElement().offsetTop>=0)n=r;else{if(i=!0,!(o-a[r].getElement().offsetTop>=0))break;s=r}}else n=this.vDomTop,s=this.vDomBottom;return a.slice(n,s+1)},s.prototype.displayRowIterator=function(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},s.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(s[a]){var r=t-s[a].getElement().offsetTop;if(!(!1===i||Math.abs(r)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(c=!1),i.vDomBottom++,u++}e?(i.vDomTopPad=t?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-r-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((r+l)/u),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+r+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",t&&(this.scrollTop=i.vDomTopPad+l+o-(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&&t&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=c?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},s.prototype.scrollVertical=function(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],a=s.getHeight()||this.vDomRowHeight;e>=a&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=a,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=a,this.vDomTop--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},s.prototype._addBottomRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=a&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=a,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=a,this.vDomBottom++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},s.prototype._quickNormalizeRowHeight=function(e){e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()})),e.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach((function(e){e.normalizeHeight()}))},s.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"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||(e=this.table.modExists("resizeTable"),(e&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw())}},s.prototype.reinitialize=function(){this.rows.forEach((function(e){e.reinitialize()}))},s.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},s.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},s.prototype.redraw=function(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},s.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var a=function(e){this._row=e};a.prototype.getData=function(e){return this._row.getData(e)},a.prototype.getElement=function(){return this._row.getElement()},a.prototype.getCells=function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e},a.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},a.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},a.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},a.prototype.delete=function(){return this._row.delete()},a.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},a.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},a.prototype.move=function(e,t){this._row.moveToRow(e,t)},a.prototype.update=function(e){return this._row.updateData(e)},a.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},a.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},a.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},a.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},a.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},a.prototype._getSelf=function(){return this._row},a.prototype.validate=function(){return this._row.validate()},a.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},a.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},a.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){var e=this._row.table.modules.frozenRows.rows.indexOf(this._row);return e>-1}return!1},a.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},a.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},a.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},a.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},a.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},a.prototype.addTreeChild=function(e,t,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,e,t,o)},a.prototype.reformat=function(){return this._row.reinitialize()},a.prototype.getGroup=function(){return this._row.getGroup().getComponent()},a.prototype.getTable=function(){return this._row.table},a.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},a.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),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.setData(e),this.generateElement()};r.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var e,t,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",(function(e){i.table.options.rowClick(e,i.getComponent())})),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",(function(e){i.table.options.rowDblClick(e,i.getComponent())})),i.table.options.rowContext&&i.element.addEventListener("contextmenu",(function(e){i.table.options.rowContext(e,i.getComponent())})),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",(function(e){i.table.options.rowMouseEnter(e,i.getComponent())})),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",(function(e){i.table.options.rowMouseLeave(e,i.getComponent())})),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",(function(e){i.table.options.rowMouseOver(e,i.getComponent())})),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",(function(e){i.table.options.rowMouseOut(e,i.getComponent())})),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",(function(e){i.table.options.rowMouseMove(e,i.getComponent())})),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",(function(e){o=!0}),{passive:!0}),i.element.addEventListener("touchend",(function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1}))),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",(function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout((function(){clearTimeout(e),e=null}),300)}))),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",(function(e){clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())}),1e3)}),{passive:!0}),i.element.addEventListener("touchend",(function(e){clearTimeout(t),t=null})))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(e){var t=this;if(!t.initialized||e){t.deleteCells();while(t.element.firstChild)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach((function(e){t.element.appendChild(e.getElement()),e.cellRendered()})),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach((function(e){var o=e.getHeight();o>t&&(t=o)})),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},r.prototype.setCellHeight=function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0},r.prototype.clearCellHeight=function(){this.cells.forEach((function(e){e.clearHeight()}))},r.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},r.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},r.prototype.getHeight=function(){return this.outerHeight},r.prototype.getWidth=function(){return this.element.offsetWidth},r.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},r.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},r.prototype.updateData=function(e){var t,o=this,i=h.prototype.helpers.elVisible(this.element),n={};return new Promise((function(s,a){for(var r in"string"===typeof e&&(e=JSON.parse(e)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e,t)o.data[r]=t[r];for(var r in o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock(),e){var l=o.table.columnManager.getColumnsByFieldRoot(r);l.forEach((function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}}))}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()}))},r.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},r.prototype.getCell=function(e){var t=!1;return e=this.table.columnManager.findColumn(e),t=this.cells.find((function(t){return t.column===e})),t},r.prototype.getCellIndex=function(e){return this.cells.findIndex((function(t){return t===e}))},r.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&h.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},r.prototype.getCells=function(){return this.cells},r.prototype.nextRow=function(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1},r.prototype.prevRow=function(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1},r.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},r.prototype.validate=function(){var e=[];return this.cells.forEach((function(t){t.validate()||e.push(t.getComponent())})),!e.length||e},r.prototype.delete=function(){var e=this;return new Promise((function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,i=n.indexOf(e),i&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e),i&&(i=e.table.rowManager.rows[i-1])),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()}))},r.prototype.deleteActual=function(e){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,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!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))},r.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)},r.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.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(e)||/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(e.substr(0,4))},h.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},h.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},h.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise((function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",(function(e){var s,a=n.files[0],r=new FileReader;r.readAsText(a),r.onload=function(e){try{s=JSON.parse(r.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t.setData(s).then((function(e){o(e)})).catch((function(e){o(e)}))},r.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}})),n.click()}))},h.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},h.prototype._setData=function(e,t,o,i,n){var s=this;if("string"===typeof e){if(0==e.indexOf("{")||0==e.indexOf("["))return s.rowManager.setData(JSON.parse(e),i,n);if(s.modExists("ajax",!0))return t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)}else if(console.log("========",e),!e)return s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n)},h.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},h.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},h.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},h.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},h.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},h.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},h.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},h.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},h.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},h.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise((function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then((function(){i--,i||n()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))},h.prototype.addData=function(e,t,o){var i=this;return new Promise((function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),n(t)})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))},h.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise((function(s,a){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"===typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then((function(){n--,i.push(t.getComponent()),n||s(i)})):o.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||s(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))},h.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},h.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},h.prototype.deleteRow=function(e){var t=this;return new Promise((function(o,i){var n=t,s=0,a=0,r=[];function l(){s++,s==e.length&&a&&(n.rowManager.reRenderInPosition(),o())}Array.isArray(e)||(e=[e]),e.forEach((function(e){var o=t.rowManager.findRow(e,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),l())})),r.sort((function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1})),r.forEach((function(e){e.delete().then((function(){a++,l()})).catch((function(e){l(),i(e)}))}))}))},h.prototype.addRow=function(e,t,o){var i=this;return new Promise((function(n,s){"string"===typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then((function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())}))}))},h.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise((function(i,n){var s=o.rowManager.findRow(e);"string"===typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then((function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())})).catch((function(e){n(e)})):s=o.rowManager.addRows(t).then((function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())})).catch((function(e){n(e)}))}))},h.prototype.updateRow=function(e,t){var o=this;return new Promise((function(i,n){var s=o.rowManager.findRow(e);"string"===typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then((function(){i(s.getComponent())})).catch((function(e){n(e)})):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))}))},h.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.rowManager.findRow(e);a?i.rowManager.scrollToRow(a,t,o).then((function(){n()})).catch((function(e){s(e)})):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))}))},h.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},h.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},h.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},h.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},h.prototype.setColumns=function(e){this.columnManager.setColumns(e)},h.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},h.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},h.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},h.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},h.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},h.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},h.prototype.addColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,a).then((function(e){n(e.getComponent())})).catch((function(e){s(e)}))}))},h.prototype.deleteColumn=function(e){var t=this;return new Promise((function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then((function(){o()})).catch((function(e){i(e)})):(console.warn("Column Delete Error - No matching column found:",e),i())}))},h.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise((function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then((function(e){i(e)})).catch((function(e){n(e)})):(console.warn("Column Update Error - No matching column found:",e),n())}))},h.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)},h.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise((function(n,s){var a=i.columnManager.findColumn(e);a?i.columnManager.scrollToColumn(a,t,o).then((function(){n()})).catch((function(e){s(e)})):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))}))},h.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},h.prototype.getLocale=function(){return this.modules.localize.getLocale()},h.prototype.getLang=function(e){return this.modules.localize.getLang(e)},h.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},h.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"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")},h.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},h.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},h.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},h.prototype.setFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o,i),this.rowManager.filterRefresh())},h.prototype.addFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o,i),this.rowManager.filterRefresh())},h.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},h.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},h.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},h.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},h.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},h.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},h.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},h.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},h.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},h.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},h.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},h.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},h.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},h.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},h.prototype.clearCellValidation=function(e){var t=this;this.modExists("validate",!0)&&(e||(e=this.modules.validate.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.modules.validate.clearValidation(e._getSelf())})))},h.prototype.validate=function(e){var t=[];return this.rowManager.rows.forEach((function(e){var o=e.validate();!0!==o&&(t=t.concat(o))})),!t.length||t},h.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},h.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise((function(e,t){t()}))},h.prototype.setPageToRow=function(e){var t=this;return new Promise((function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then((function(){o()})).catch((function(){i()})):i()):i()}))},h.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then((function(){})).catch((function(){}))},h.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},h.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},h.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},h.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},h.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},h.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,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")},h.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,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")},h.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,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")},h.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},h.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},h.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},h.prototype.clearCellEdited=function(e){var t=this;this.modExists("edit",!0)&&(e||(e=this.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.modules.edit.clearEdited(e._getSelf())})))},h.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},h.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},h.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||(e=this.modules.edit.currentCell,!e))&&e.nav().prev()},h.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||(e=this.modules.edit.currentCell,!e))&&e.nav().next()},h.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().left())},h.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().right())},h.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().up())},h.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||(t=this.modules.edit.currentCell,!t))&&(e.preventDefault(),t.nav().down())},h.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},h.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},h.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},h.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},h.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},h.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},h.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},h.prototype.moduleBindings={},h.prototype.extendModule=function(e,t,o){if(h.prototype.moduleBindings[e]){var i=h.prototype.moduleBindings[e].prototype[t];if(i)if("object"==("undefined"===typeof o?"undefined":l(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)},h.prototype.registerModule=function(e,t){h.prototype.moduleBindings[e]=t},h.prototype.bindModules=function(){for(var e in this.modules={},h.prototype.moduleBindings)this.modules[e]=new h.prototype.moduleBindings[e](this)},h.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},h.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===l(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},h.prototype.comms={tables:[],register:function(e){h.prototype.comms.tables.push(e)},deregister:function(e){var t=h.prototype.comms.tables.indexOf(e);t>-1&&h.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"===typeof e){if(o=document.querySelectorAll(e),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t=this,o=t.table.element.clientWidth,i=0,n=0,s=0,a=0,r=[],l=[],u=0,c=0,d=0;function h(e){var t;return t="string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e,t}function p(e,t,o,i){var n=[],s=0,a=0,r=0,l=0,u=0,c=[];function d(e){return o*(e.column.definition.widthGrow||1)}function m(e){return h(e.width)-o*(e.column.definition.widthShrink||0)}return e.forEach((function(e,t){var o=i?m(e):d(e);e.column.minWidth>=o?n.push(e):(c.push(e),u+=i?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)})),n.length?(n.forEach((function(e){s+=i?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth})),a=t-s,r=u?Math.floor(a/u):a,l=a-r*u,l+=p(c,a,r,i)):(l=u?t-Math.floor(t/u)*u:t,c.forEach((function(e){e.width=i?m(e):d(e)}))),l}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,o,n;e.visible&&(t=e.definition.width,o=parseInt(e.minWidth),t?(n=h(t),i+=n>o?n:o,e.definition.widthShrink&&(l.push({column:e,width:n>o?n:o}),u+=e.definition.widthShrink)):(r.push({column:e,width:0}),s+=e.definition.widthGrow||1))})),n=o-i,a=Math.floor(n/s);d=p(r,n,a,!1);r.length&&d>0&&(r[r.length-1].width+=+d),r.forEach((function(e){n-=e.width})),c=Math.abs(d)+n,c>0&&u&&(d=p(l,c,Math.floor(c/u),!0)),l.length&&(l[l.length-1].width-=d),r.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}},h.prototype.registerModule("layout",p);var m=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};m.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},m.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},m.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},m.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==l(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},m.prototype.setLocale=function(e){var t=this;function o(e,t){for(var i in e)"object"==l(e[i])?(t[i]||(t[i]={}),o(e[i],t[i])):t[i]=e[i]}if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!t.langs[e]){var i=e.split("-")[0];t.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}t.locale=e,t.lang=h.prototype.helpers.deepClone(t.langs.default||{}),"default"!=e&&o(t.langs[e],t.lang),t.table.options.localized.call(t.table,t.locale,t.lang),t._executeBindings()},m.prototype.getLocale=function(e){return self.locale},m.prototype.getLang=function(e){return e?this.langs[e]:this.lang},m.prototype.getText=function(e,t){e=t?e+"|"+t:e;var o=e.split("|"),i=this._getLangElement(o,this.locale);return i||""},m.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach((function(e){var t;i&&(t=i[e],i="undefined"!=typeof t&&t)})),i},m.prototype.bind=function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},m.prototype._executeBindings=function(){var e=this,t=function(t){e.bindings[t].forEach((function(o){o(e.getText(t),e.lang)}))};for(var o in e.bindings)t(o)},m.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:{}}}},h.prototype.registerModule("localize",m);var f=function(e){this.table=e};f.prototype.getConnections=function(e){var t,o=this,i=[];return t=h.prototype.comms.lookupTable(e),t.forEach((function(e){o.table!==e&&i.push(e)})),i},f.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach((function(e){e.tableComms(n.table.element,t,o,i)})),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},f.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},h.prototype.registerModule("comms",f);var g=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};g.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach((function(n){var s,a="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupAccessor(e.definition[a]),s&&(o=!0,i[a]={accessor:s,params:e.definition[a+"Params"]||{}}))})),o&&(e.modules.accessor=i)},g.prototype.lookupAccessor=function(e){var t=!1;switch("undefined"===typeof e?"undefined":l(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t},g.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=h.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse((function(e){var o,s,a,r;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1,s&&(o=e.getFieldValue(n),"undefined"!=o&&(r=e.getComponent(),a="function"===typeof s.params?s.params(o,n,t,r):s.params,e.setFieldValue(n,s.accessor(o,n,t,a,r)))))})),n},g.prototype.accessors={},h.prototype.registerModule("accessor",g);var b=function(e){this.table=e,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};b.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.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&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.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"))},b.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},b.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},b.prototype.setParams=function(e,t){if(t)for(var o in this.params=this.params||{},e)this.params[o]=e[o];else this.params=e},b.prototype.getParams=function(){return this.params||{}},b.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},b.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e)for(var o in t.config={},t.defaultConfig)t.config[o]=t.defaultConfig[o]},b.prototype.setUrl=function(e){this.url=e},b.prototype.getUrl=function(){return this.url},b.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},b.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)})),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n="undefined"!==typeof o.precision&&o.precision;return e.forEach((function(e){e=Number(e),(e"),o.dataTreeExpandElement?"string"===typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),l(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]};break}},w.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===("undefined"===typeof t?"undefined":l(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},w.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},w.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,n=(t=t||e.getCells()[0].getElement(),i.controlEl);!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(function(t){t.stopPropagation(),o.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(function(t){t.stopPropagation(),o.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},w.prototype.setDisplayIndex=function(e){this.displayIndex=e},w.prototype.getDisplayIndex=function(){return this.displayIndex},w.prototype.getRows=function(e){var t=this,o=[];return e.forEach((function(e,i){var n,s;o.push(e),e instanceof r&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach((function(e){o.push(e)}))))})),o},w.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach((function(e){n.push(e);var o=t.getChildren(e);o.forEach((function(e){n.push(e)}))}))),n},w.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((function(i){var n=new r(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)})),o},w.prototype.expandRow=function(e,t){var o=e.modules.dataTree;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},w.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},w.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},w.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},w.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach((function(e){e instanceof r&&i.push(e)}))),i},w.prototype.rowDelete=function(e){var t,o=e.modules.dataTree.parent;o&&(t=this.findChildIndex(e,o),!1!==t&&o.data[this.field].splice(t,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},w.prototype.addTreeChildRow=function(e,t,o,i){var n=!1;"string"===typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),"undefined"!==typeof i&&(n=this.findChildIndex(i,e),!1!==n&&e.data[this.field].splice(o?n:n+1,0,t)),!1===n&&(o?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},w.prototype.findChildIndex=function(e,t){var o=this,i=!1;return"object"==("undefined"===typeof e?"undefined":l(e))?e instanceof r?i=e.data:e instanceof a?i=e._getSelf().data:"undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find((function(t){return t instanceof r&&t.element===e})),i&&(i=i.data)):i="undefined"!=typeof e&&null!==e&&t.data[this.field].find((function(t){return t.data[o.table.options.index]==e})),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},w.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach((function(e){e instanceof r&&o.push(e.getComponent())}))),o},w.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},w.prototype.getChildField=function(){return this.field},w.prototype.redrawNeeded=function(e){return!!this.field&&"undefined"!==typeof e[this.field]||!!this.elementField&&"undefined"!==typeof e[this.elementField]},h.prototype.registerModule("dataTree",w);var E=function(e){this.table=e};E.prototype.download=function(e,t,o,i,n){var s=this,a=!1;function r(o,i){n?!0===n?s.triggerDownload(o,i,e,t,!0):n(o):s.triggerDownload(o,i,e,t)}if("function"==typeof e?a=e:s.downloaders[e]?a=s.downloaders[e]:console.warn("Download Error - No such download type found: ",e),a){var l=this.generateExportList(i);a.call(this.table,l,o||{},r)}},E.prototype.generateExportList=function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],o&&o[e.indent]&&(t.value=o[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t},E.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),a=new Blob([e],{type:t});i=i||"Tabulator."+("function"===typeof o?"txt":o);a=this.table.options.downloadReady.call(this.table,e,a),a&&(n?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,i):(s.setAttribute("href",window.URL.createObjectURL(a)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},E.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept);break}},E.prototype.downloaders={csv:function(e,t,o){var i=t&&t.delimiter?t.delimiter:",",n=[],s=[];e.forEach((function(e){var t=[];switch(e.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":e.columns.forEach((function(e,t){e&&1===e.depth&&(s[t]="undefined"==typeof e.value||"null"==typeof e.value?"":e.value)}));break;case"row":e.columns.forEach((function(e){if(e){switch(l(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value="";break}t.push('"'+String(e.value).split('"').join('""')+'"')}})),n.push(t.join(i));break}})),s.length&&(n=[s].concat(n)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(e,t,o){var i=[];e.forEach((function(e){var t={};switch(e.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":e.columns.forEach((function(e){e&&(t[e.component.getField()]=e.value)})),i.push(t);break}})),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(e,t,o){var i=[],n=[],s={},a=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},r=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=t.jsPDF||{},c=t&&t.title?t.title:"";function d(e,t){var o=[];return e.columns.forEach((function(e){var i;if(e){switch(l(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value="";break}i={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(i.styles=t),o.push(i)}else o.push("")})),o}u.orientation||(u.orientation=t.orientation||"landscape"),u.unit||(u.unit="pt"),e.forEach((function(e){switch(e.type){case"header":i.push(d(e));break;case"group":n.push(d(e,a));break;case"calc":n.push(d(e,r));break;case"row":n.push(d(e));break}}));var h=new jsPDF(u);t&&t.autoTable&&(s="function"===typeof t.autoTable?t.autoTable(h)||{}:t.autoTable),c&&(s.addPageContent=function(e){h.text(c,40,30)}),s.head=i,s.body=n,h.autoTable(s),t&&t.documentProcessing&&t.documentProcessing(h),o(h.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o){var i,n=this,s=t.sheetName||"Sheet1",a=XLSX.utils.book_new();function r(){var t=[],o=[],i={},n={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:e.length}};return e.forEach((function(e,i){var n=[];e.columns.forEach((function(e,t){e?(n.push(e.value instanceof Date||"object"!==l(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&o.push({s:{r:i,c:t},e:{r:i+e.height-1,c:t+e.width-1}})):n.push("")})),t.push(n)})),XLSX.utils.sheet_add_aoa(i,t),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}if(a.SheetNames=[],a.Sheets={},t.sheetOnly)o(r());else{if(t.sheets)for(var u in t.sheets)!0===t.sheets[u]?(a.SheetNames.push(u),a.Sheets[u]=r()):(a.SheetNames.push(u),this.table.modules.comms.send(t.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:n.active,intercept:function(e){a.Sheets[u]=e}}));else a.SheetNames.push(s),a.Sheets[s]=r();t.documentProcessing&&(a=t.documentProcessing(a)),i=XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(c(i),"application/octet-stream")}function c(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i!=e.length;++i)o[i]=255&e.charCodeAt(i);return t}},html:function(e,t,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(e),"text/html")}},h.prototype.registerModule("download",E);var C=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};C.prototype.initializeColumn=function(e){var t=this,o={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(l(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?o.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":o.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!==typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?o.editor=t.editors[e.definition.formatter]:o.editor=t.editors["input"]):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter));break}o.editor&&(e.modules.edit=o)},C.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},C.prototype.clearEditor=function(e){var t,o=this.currentCell;if(this.invalidEdit=!1,o){this.currentCell=!1,t=o.getElement(),e?o.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");while(t.firstChild)t.removeChild(t.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},C.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},C.prototype.bindEditor=function(e){var t=this,o=e.getElement();o.setAttribute("tabindex",0),o.addEventListener("click",(function(e){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})})),o.addEventListener("mousedown",(function(e){t.mouseClick=!0})),o.addEventListener("focus",(function(o){t.recursionBlock||t.edit(e,o,!1)}))},C.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},C.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},C.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=e.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o);var n=this.table.rowManager.element.scrollLeft,s=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,a=e.getElement();a.offsetLeft;this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin),s-=parseInt(this.table.modules.frozenColumns.rightMargin)),a.offsetLefts&&(this.table.rowManager.element.scrollLeft+=a.offsetLeft+a.offsetWidth-s)}},C.prototype.edit=function(e,t,o){var i,n,s,a=this,r=!0,u=function(){},c=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,c.blur(),!1;switch(t&&t.stopPropagation(),l(e.column.modules.edit.check)){case"function":r=e.column.modules.edit.check(e.getComponent());break;case"boolean":r=e.column.modules.edit.check;break}if(r||o){if(a.cancelEdit(),a.currentCell=e,this.focusScrollAdjust(e),n=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,n)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,n),a.table.options.cellEditing.call(this.table,n),s="function"===typeof e.column.modules.edit.params?e.column.modules.edit.params(n):e.column.modules.edit.params,i=e.column.modules.edit.editor.call(a,n,f,p,m,s),!1===i)return c.blur(),!1;if(!(i instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",i),c.blur(),!1;c.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");while(c.firstChild)c.removeChild(c.firstChild);c.appendChild(i),u();for(var d=c.children,h=0;h46){if(a>=o.length)return t.preventDefault(),t.stopPropagation(),!1,!1;switch(o[a]){case i:if(r.toUpperCase()==r.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1,!1;break;case n:if(isNaN(r))return t.preventDefault(),t.stopPropagation(),!1,!1;break;case s:break;default:if(r!==o[a])return t.preventDefault(),t.stopPropagation(),!1,!1}!0}})),e.addEventListener("keyup",(function(o){o.keyCode>46&&t.maskAutoFill&&a(e.value.length)})),e.placeholder||(e.placeholder=o),t.maskAutoFill&&a(e.value.length)},C.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach((function(t){e.push(t.getComponent())})),e},C.prototype.clearEdited=function(e){var t;e.modules.validate&&e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,t=this.editedCells.indexOf(e),t>-1&&this.editedCells.splice(t,1))},C.prototype.editors={input:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var r in n.elementAttributes)"+"==r.charAt(0)?(r=r.slice(1),a.setAttribute(r,a.getAttribute(r)+n.elementAttributes["+"+r])):a.setAttribute(r,n.elementAttributes[r]);function u(e){(null===s||"undefined"===typeof s)&&""!==a.value||a.value!==s?o(a.value)&&(s=a.value):i()}return a.value="undefined"!==typeof s?s:"",t((function(){a.focus({preventScroll:!0}),a.style.height="100%"})),a.addEventListener("change",u),a.addEventListener("blur",u),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u(e);break;case 27:i();break}})),n.mask&&this.table.modules.edit.maskInput(a,n),a},textarea:function(e,t,o,i,n){var s=e.getValue(),a=n.verticalNavigation||"hybrid",r=String(null!==s&&"undefined"!==typeof s?s:""),u=((r.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",n.elementAttributes&&"object"==l(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+n.elementAttributes["+"+d])):u.setAttribute(d,n.elementAttributes[d]);function h(t){(null===s||"undefined"===typeof s)&&""!==u.value||u.value!==s?(o(u.value)&&(s=u.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):i()}return u.value=r,t((function(){u.focus({preventScroll:!0}),u.style.height="100%"})),u.addEventListener("change",h),u.addEventListener("blur",h),u.addEventListener("keyup",(function(){u.style.height="";var t=u.scrollHeight;u.style.height=t+"px",t!=c&&(c=t,e.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==a||"hybrid"==a&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break}})),n.mask&&this.table.modules.edit.maskInput(u,n),u},number:function(e,t,o,i,n){var s=e.getValue(),a=n.verticalNavigation||"editor",r=document.createElement("input");if(r.setAttribute("type","number"),"undefined"!=typeof n.max&&r.setAttribute("max",n.max),"undefined"!=typeof n.min&&r.setAttribute("min",n.min),"undefined"!=typeof n.step&&r.setAttribute("step",n.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var u in n.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),r.setAttribute(u,r.getAttribute(u)+n.elementAttributes["+"+u])):r.setAttribute(u,n.elementAttributes[u]);r.value=s;var c=function(e){d()};function d(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!==s?o(e)&&(s=e):i()}return t((function(){r.removeEventListener("blur",c),r.focus({preventScroll:!0}),r.style.height="100%",r.addEventListener("blur",c)})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:i();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation());break}})),n.mask&&this.table.modules.edit.maskInput(r,n),r},range:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),"undefined"!=typeof n.max&&a.setAttribute("max",n.max),"undefined"!=typeof n.min&&a.setAttribute("min",n.min),"undefined"!=typeof n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var r in n.elementAttributes)"+"==r.charAt(0)?(r=r.slice(1),a.setAttribute(r,a.getAttribute(r)+n.elementAttributes["+"+r])):a.setAttribute(r,n.elementAttributes[r]);function u(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=s?o(e)&&(s=e):i()}return a.value=s,t((function(){a.focus({preventScroll:!0}),a.style.height="100%"})),a.addEventListener("blur",(function(e){u()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:i();break}})),a},select:function(e,t,o,i,n){var s=this,a=this,r=e.getElement(),u=e.getValue(),c=n.verticalNavigation||"editor",d="undefined"!==typeof u||null===u?Array.isArray(u)?u:[u]:"undefined"!==typeof n.defaultValue?n.defaultValue:[],p=document.createElement("input"),m=document.createElement("div"),f=n.multiselect,g=[],b={},v=[],y=[],w=!0,E=!1;function C(t){var o,i={},s=a.table.getData();return o=t?a.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach((function(e){var t=o.getFieldValue(e);null!==t&&"undefined"!==typeof t&&""!==t&&(i[t]=!0)})),i=n.sortValuesList?"asc"==n.sortValuesList?Object.keys(i).sort():Object.keys(i).sort().reverse():Object.keys(i)):console.warn("unable to find matching column to create select lookup list:",t),i}function x(t,o){var i=[],n=[];function s(e){e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return o.indexOf(e.value)>-1&&L(e),i.push(e),n.push(e),e}if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach((function(e){var t;"object"===("undefined"===typeof e?"undefined":l(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},n.push(t),e.options.forEach((function(e){s(e)}))):s(e):(t={label:e,value:e,element:!1},o.indexOf(t.value)>-1&&L(t),i.push(t),n.push(t))}));else for(var a in t){var r={label:t[a],value:a,element:!1};o.indexOf(r.value)>-1&&L(r),i.push(r),n.push(r)}g=i,v=n,R()}function R(){while(m.firstChild)m.removeChild(m.firstChild);v.forEach((function(t){var o=t.element;if(!o){if(o=document.createElement("div"),t.label=n.listItemFormatter?n.listItemFormatter(t.value,t.label,e,o,t.itemParams):t.label,t.group?(o.classList.add("tabulator-edit-select-list-group"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label):(o.classList.add("tabulator-edit-select-list-item"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label,o.addEventListener("click",(function(){E=!0,setTimeout((function(){E=!1}),10),f?(k(t),p.focus()):D(t)})),y.indexOf(t)>-1&&o.classList.add("active")),t.elementAttributes&&"object"==l(t.elementAttributes))for(var i in t.elementAttributes)"+"==i.charAt(0)?(i=i.slice(1),o.setAttribute(i,p.getAttribute(i)+t.elementAttributes["+"+i])):o.setAttribute(i,t.elementAttributes[i]);o.addEventListener("mousedown",(function(){w=!1,setTimeout((function(){w=!0}),10)})),t.element=o}m.appendChild(o)}))}function M(e,t){!f&&b&&b.element&&b.element.classList.remove("active"),b&&b.element&&b.element.classList.remove("focused"),b=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function L(e){var t=y.indexOf(e);-1==t&&(y.push(e),M(e,!0)),H()}function T(e){var t=y[e];e>-1&&(y.splice(e,1),t.element&&t.element.classList.remove("active"))}function k(e){e||(e=b);var t=y.indexOf(e);t>-1?T(t):(!0!==f&&y.length>=f&&T(0),L(e)),H()}function D(e){F(),e||(e=b),e&&(p.value=e.label,o(e.value)),d=p.value}function S(e){e||F();var t=[];y.forEach((function(e){t.push(e.value)})),d=p.value,o(t)}function H(){var e=[];y.forEach((function(t){e.push(t.label)})),p.value=e.join(", "),!1===a.currentCell&&S(!0)}function P(){for(var e=y.length,t=0;t0&&M(g[t-1],!f));break;case 40:t=g.indexOf(b),("editor"==c||"hybrid"==c&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&s.push(t)})),L(s,t))}function x(e){var t=document.createElement("div");M(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,m.appendChild(t))}function R(e){var t=[];if(Array.isArray(e))e.forEach((function(e){var o={};"object"===("undefined"===typeof e?"undefined":l(e))?(o.title=n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,o.value=e.value):(o.title=n.listItemFormatter?n.listItemFormatter(e,e):e,o.value=e),t.push(o)}));else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function M(){while(m.firstChild)m.removeChild(m.firstChild)}function L(e,t){e.length?T(e,t):n.emptyPlaceholder&&x(n.emptyPlaceholder)}function T(e,t){var o=!1;M(),f=e,f.forEach((function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",(function(t){S(e),k()})),i.addEventListener("mousedown",(function(e){b=!1,setTimeout((function(){b=!0}),10)})),e.element=i,t&&e.value==u&&(p.value=e.title,e.element.classList.add("active"),o=!0),e===g&&(e.element.classList.add("active"),o=!0)),m.appendChild(i)})),o||S(!1)}function k(){H(),g?u!==g.value?(u=g.value,p.value=g.title,o(g.value)):i():n.freetext||n.allowEmpty&&""===p.value?(u=p.value,o(p.value)):i()}function D(){if(!m.parentNode){while(m.firstChild)m.removeChild(m.firstChild);var e=h.prototype.helpers.elOffset(r);m.style.minWidth=r.offsetWidth+"px",m.style.top=e.top+r.offsetHeight+"px",m.style.left=e.left+"px",document.body.appendChild(m)}}function S(e,t){g&&g.element&&g.element.classList.remove("active"),g=e,e&&e.element&&e.element.classList.add("active")}function H(){m.parentNode&&m.parentNode.removeChild(m),A()}function P(){H(),i()}function A(){a.table.rowManager.element.removeEventListener("scroll",P)}return m.classList.add("tabulator-edit-select-list"),m.addEventListener("mousedown",(function(e){b=!1,setTimeout((function(){b=!0}),10)})),p.addEventListener("keydown",(function(e){var t;switch(e.keyCode){case 38:t=f.indexOf(g),("editor"==c||"hybrid"==c&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),S(t>0&&f[t-1]));break;case 40:t=f.indexOf(g),("editor"==c||"hybrid"==c&&t'):("ie"==s.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=p.cloneNode(!0);d.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e),a.blur()})),t.appendChild(i),h.appendChild(t)}function g(e){r=e,m(e)}if(a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",h.style.verticalAlign="middle",h.style.display="inline-block",h.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",n.elementAttributes&&"object"==l(n.elementAttributes))for(var b in n.elementAttributes)"+"==b.charAt(0)?(b=b.slice(1),h.setAttribute(b,h.getAttribute(b)+n.elementAttributes["+"+b])):h.setAttribute(b,n.elementAttributes[b]);for(var v=1;v<=u;v++)f(v);return r=Math.min(parseInt(r),u),m(r),h.addEventListener("mousemove",(function(e){m(0)})),h.addEventListener("click",(function(e){o(0)})),a.addEventListener("blur",(function(e){i()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(r+1);break;case 37:g(r-1);break;case 13:o(r);break;case 27:i();break}})),h},progress:function(e,t,o,i,n){var s,a,r=e.getElement(),u="undefined"===typeof n.max?r.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,c="undefined"===typeof n.min?r.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(u-c)/100,h=e.getValue()||0,p=document.createElement("div"),m=document.createElement("div");function f(){var e=d*Math.round(m.offsetWidth/(r.clientWidth/100))+c;o(e),r.setAttribute("aria-valuenow",e),r.setAttribute("aria-label",h)}if(p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",n.elementAttributes&&"object"==l(n.elementAttributes))for(var g in n.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),m.setAttribute(g,m.getAttribute(g)+n.elementAttributes["+"+g])):m.setAttribute(g,n.elementAttributes[g]);return r.style.padding="4px 4px",h=Math.min(parseFloat(h),u),h=Math.max(parseFloat(h),c),h=Math.round((h-c)/d),m.style.width=h+"%",r.setAttribute("aria-valuemin",c),r.setAttribute("aria-valuemax",u),m.appendChild(p),p.addEventListener("mousedown",(function(e){s=e.screenX,a=m.offsetWidth})),p.addEventListener("mouseover",(function(){p.style.cursor="ew-resize"})),r.addEventListener("mousemove",(function(e){s&&(m.style.width=a+e.screenX-s+"px")})),r.addEventListener("mouseup",(function(e){s&&(e.stopPropagation(),e.stopImmediatePropagation(),s=!1,a=!1,f())})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+r.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-r.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:i();break}})),r.addEventListener("blur",(function(){i()})),m},tickCross:function(e,t,o,i,n){var s=e.getValue(),a=document.createElement("input"),r=n.tristate,u="undefined"===typeof n.indeterminateValue?null:n.indeterminateValue,c=!1;if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==l(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),a.setAttribute(d,a.getAttribute(d)+n.elementAttributes["+"+d])):a.setAttribute(d,n.elementAttributes[d]);function h(e){return r?e?c?u:a.checked:a.checked&&!c?(a.checked=!1,a.indeterminate=!0,c=!0,u):(c=!1,a.checked):a.checked}return a.value=s,!r||"undefined"!==typeof s&&s!==u&&""!==s||(c=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){a.focus({preventScroll:!0})})),a.checked=!0===s||"true"===s||"True"===s||1===s,a.addEventListener("change",(function(e){o(h())})),a.addEventListener("blur",(function(e){o(h(!0))})),a.addEventListener("keydown",(function(e){13==e.keyCode&&o(h()),27==e.keyCode&&i()})),a}},h.prototype.registerModule("edit",C);var x=function(e,t,o,i){this.type=e,this.columns=t,this.component=o||!1,this.indent=i||0},R=function(e,t,o,i,n){this.value=e,this.component=t||!1,this.width=o,this.height=i,this.depth=n},M=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};M.prototype.generateExportList=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},M.prototype.genereateTable=function(e,t,o,i){var n=this.generateExportList(e,t,o,i);return this.genereateTableElement(n)},M.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach((function(e){e=t.table.rowManager.findRow(e),e&&o.push(e)}));else switch(e){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},M.prototype.generateColumnGroupHeaders=function(){var e=this,t=[],o=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex;return o.forEach((function(o){var i=e.processColumnGroup(o);i&&t.push(i)})),t},M.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,s={title:n,column:e,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach((function(e){var o=t.processColumnGroup(e);o&&(s.width+=o.width,s.subGroups.push(o),o.depth>i&&(i=o.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s},M.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},M.prototype.headersToExportRows=function(e){var t=[],o=0,i=[];function n(e,i){var s=o-i;if("undefined"===typeof t[i]&&(t[i]=[]),e.height=e.subGroups?1:s-e.depth+1,t[i].push(e),e.height>1)for(var a=1;a1)for(var r=1;ro&&(o=e.depth)})),e.forEach((function(e){n(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){e?t.push(new R(e.title,e.column.getComponent(),e.width,e.height,e.depth)):t.push(null)})),i.push(new x("header",t))})),i},M.prototype.bodyToExportRows=function(e){var t=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&o.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0})),e.forEach((function(e,n){var s=e.getData(t.colVisProp),a=[],r=0;switch(e.type){case"group":r=e.level,a.push(new R(e.key,e.getComponent(),o.length,1));break;case"calc":case"row":o.forEach((function(e){a.push(new R(e._column.getFieldValue(s),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(r=e.modules.dataTree.index);break}i.push(new x(e.type,a,e.getComponent(),r))})),i},M.prototype.genereateTableElement=function(e){var t=this,o=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),a=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==a?a:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),o.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,o){switch(e.type){case"header":i.appendChild(t.genereateHeaderElement(e,r,s));break;case"group":n.appendChild(t.genereateGroupElement(e,r,s));break;case"calc":n.appendChild(t.genereateCalcElement(e,r,s));break;case"row":var a=t.genereateRowElement(e,r,s);t.mapElementStyles(o%2&&s.evenRow?s.evenRow:s.oddRow,a,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(a);break}})),i.innerHTML&&o.appendChild(i),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},M.prototype.lookupTableStyles=function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e},M.prototype.genereateHeaderElement=function(e,t,o){var i=this,n=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),o=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,i.cloneTableStyle&&(t.style.boxSizing="border-box"),o.forEach((function(e){t.classList.add(e)})),i.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?i.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&i.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),n.appendChild(t)}})),n},M.prototype.genereateGroupElement=function(e,t,o){var i=document.createElement("tr"),n=document.createElement("td"),s=e.columns[0];return i.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?s.value=t.groupHeader[e.indent](s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?s.value=s.value:s.value=e.component._group.generator(s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+e.indent),s.component.getVisibility()&&i.classList.add("tabulator-group-visible"),this.mapElementStyles(o.firstGroup,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(o.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),i.appendChild(n),i},M.prototype.genereateCalcElement=function(e,t,o){var i=this.genereateRowElement(e,t,o);return i.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(o.calcRow,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i},M.prototype.genereateRowElement=function(e,t,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach((function(a){if(a){var r=document.createElement("td"),u=a.component._column,c=a.value,d={modules:{},getValue:function(){return c},getField:function(){return u.definition.field},getElement:function(){return r},getColumn:function(){return u.getComponent()},getData:function(){return rowData},getRow:function(){return e.getComponent()},getComponent:function(){return d},column:u},h=u.definition.cssClass?u.definition.cssClass.split(" "):[];if(h.forEach((function(e){r.classList.add(e)})),n.table.modExists("format")&&!1!==n.config.formatCells)c=n.table.modules.format.formatExportValue(d,n.colVisProp);else switch("undefined"===typeof c?"undefined":l(c)){case"object":c=JSON.stringify(c);break;case"undefined":case"null":c="";break;default:c=c}if(c instanceof Node?r.appendChild(c):r.innerHTML=c,o.firstCell&&(n.mapElementStyles(o.firstCell,r,["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&&(r.style.textAlign=u.definition.align)),n.table.options.dataTree&&!1!==n.config.dataTree&&(t.treeElementField&&t.treeElementField==u.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&r.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),e.component._row.modules.dataTree.branchEl&&r.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),s.appendChild(r),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),t.rowFormatter&&!1!==n.config.formatCells){var p=e.getComponent();p.getElement=function(){return s},t.rowFormatter(p)}}})),s},M.prototype.genereateHTMLTable=function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML},M.prototype.getHtml=function(e,t,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput");return this.genereateHTMLTable(n)},M.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){var i={"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 n=window.getComputedStyle(e);o.forEach((function(e){t.style[i[e]]=n.getPropertyValue(e)}))}}},h.prototype.registerModule("export",M);var L=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};L.prototype.initializeColumn=function(e,t){var o,i=this,n=e.getField();function s(t){var s,a="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",u="";if("undefined"===typeof e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[n];else{switch(e.modules.filter.value=t,l(e.definition.headerFilterFunc)){case"string":i.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,s=function(o){var n=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return n="function"===typeof n?n(t,s,o):n,i.filters[e.definition.headerFilterFunc](t,s,o,n)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":s=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"===typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},r=s;break}if(!s)switch(a){case"partial":s=function(o){var i=e.getFieldValue(o);return"undefined"!==typeof i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:s=function(o){return e.getFieldValue(o)==t},r="="}i.headerFilters[n]={value:t,func:s,type:r,params:o||{}}}u=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==u&&(i.prevHeaderFilterChangeCheck=u,i.changed=!0,i.table.rowManager.filterRefresh())}return!0}e.modules.filter={success:s,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},L.prototype.generateHeaderFilterElement=function(e,t,o){var i,n,s,a,r,u,c,d=this,h=this,p=e.modules.filter.success,m=e.getField();function f(){}if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},i=document.createElement("div"),i.classList.add("tabulator-header-filter"),l(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(n=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":n=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?n=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(n=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):n=h.table.modules.edit.editors["input"];break}if(n){if(a={getValue:function(){return"undefined"!==typeof t?t:""},getField:function(){return e.definition.field},getElement:function(){return i},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},c=e.definition.headerFilterParams||{},c="function"===typeof c?c.call(h.table):c,s=n.call(this.table.modules.edit,a,(function(){}),p,f,c),!s)return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(s instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",s);m?h.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,(function(e){s.setAttribute("placeholder","undefined"!==typeof e&&e?e:h.table.modules.localize.getText("headerFilters|default"))})):h.table.modules.localize.bind("headerFilters|default",(function(e){s.setAttribute("placeholder","undefined"!==typeof h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)})),s.addEventListener("click",(function(e){e.stopPropagation(),s.focus()})),s.addEventListener("focus",(function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))})),r=!1,u=function(e){r&&clearTimeout(r),r=setTimeout((function(){p(s.value)}),h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=s,e.modules.filter.attrType=s.hasAttribute("type")?s.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=s.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(s.addEventListener("keyup",u),s.addEventListener("search",u),"number"==e.modules.filter.attrType&&s.addEventListener("change",(function(e){p(s.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&s.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||s.addEventListener("mousedown",(function(e){e.stopPropagation()}))),i.appendChild(s),e.contentElement.appendChild(i),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},L.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))},L.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))},L.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},L.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},L.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},L.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},L.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},L.prototype.setFilter=function(e,t,o,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),n.addFilter(e)},L.prototype.addFilter=function(e,t,o,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),e.forEach((function(e){e=n.findFilter(e),e&&(n.filterList.push(e),n.changed=!0)})),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},L.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return o.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},L.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach((function(e){e=t.findFilter(e),e&&o.push(e)})),!!o.length&&o},L.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),o=o.concat(this.filtersToArray(this.filterList,t)),o},L.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach((function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))})),i},L.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},L.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach((function(e){var t=-1;t="object"==l(e.field)?i.filterList.findIndex((function(t){return e===t})):i.filterList.findIndex((function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value})),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},L.prototype.clearFilter=function(e){this.filterList=[],e&&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")},L.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.changed=!0},L.prototype.search=function(e,t,o,i){var n=this,s=[],a=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach((function(e){e=n.findFilter(e),e&&a.push(e)})),this.table.rowManager.rows.forEach((function(t){var o=!0;a.forEach((function(e){n.filterRecurse(e,t.getData())||(o=!1)})),o&&s.push("data"===e?t.getData("data"):t.getComponent())})),s},L.prototype.filter=function(e,t){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=e.slice(0):e.forEach((function(e){o.filterRow(e)&&i.push(e)})),o.table.options.dataFiltered&&(i.forEach((function(e){n.push(e.getComponent())})),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},L.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();for(var s in o.filterList.forEach((function(e){o.filterRecurse(e,n)||(i=!1)})),o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},L.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach((function(e){o.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i},L.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,o,i){var n=e.toLowerCase().split("undefined"===typeof i.separator?" ":i.separator),s=String(null===t||"undefined"===typeof t?"":t).toLowerCase(),a=[];return n.forEach((function(e){s.includes(e)&&a.push(!0)})),i.matchAll?a.length===n.length:!!a.length},starts:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,o,i){return null===e||"undefined"===typeof e?t===e:"undefined"!==typeof t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,o,i){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},h.prototype.registerModule("filter",L);var T=function(e){this.table=e};T.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),"undefined"!==typeof e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),"undefined"!==typeof e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),"undefined"!==typeof e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},T.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];switch("undefined"===typeof i?"undefined":l(i)){case"string":"tick"===i&&(i="tickCross","undefined"==typeof o.params.crossElement&&(o.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[i]?o.formatter=this.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=i;break;default:o.formatter=this.formatters.plaintext;break}return o},T.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},T.prototype.formatValue=function(e){var t=e.getComponent(),o="function"===typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;function i(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}return e.column.modules.format.formatter.call(this,t,o,i)},T.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"===typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},T.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e},T.prototype.emptyToSpace=function(e){return null===e||"undefined"===typeof e||""===e?" ":e},T.prototype.getFormatter=function(e){switch("undefined"===typeof e?"undefined":l(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext;break}return e},T.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,a,r=parseFloat(e.getValue()),l=t.decimal||".",u=t.thousand||",",c=t.symbol||"",d=!!t.symbolAfter,h="undefined"!==typeof t.precision?t.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));i=!1!==h?r.toFixed(h):r,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",a=/(\d+)(\d{3})/;while(a.test(n))n=n.replace(a,"$1"+u+"$2");return d?n+s+c:c+n+s},link:function(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",a=t.download,r=n,u=document.createElement("a");if(t.labelField&&(i=e.getData(),r=i[t.labelField]),t.label)switch(l(t.label)){case"string":r=t.label;break;case"function":r=t.label(e);break}if(r){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(l(t.url)){case"string":n=t.url;break;case"function":n=t.url(e);break}return u.setAttribute("href",s+n),t.target&&u.setAttribute("target",t.target),t.download&&(a="function"==typeof a?a(e):!0===a?"":a,u.setAttribute("download",a)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),u}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),l(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height;break}switch(l(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width;break}return i.addEventListener("load",(function(){e.getRow().normalizeHeight()})),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,a=t.allowTruthy,r="undefined"!==typeof t.tickElement?t.tickElement:'',l="undefined"!==typeof t.crossElement?t.crossElement:'';return a&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),r||""):!s||"null"!==i&&""!==i&&null!==i&&"undefined"!==typeof i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s="undefined"!==typeof t.invalidPlaceholder?t.invalidPlaceholder:"",a=e.getValue(),r=moment(a,i);return r.isValid()?t.timezone?r.tz(t.timezone).format(n):r.format(n):!0===s?a:"function"===typeof s?s(a):s},datetimediff:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n="undefined"!==typeof t.invalidPlaceholder?t.invalidPlaceholder:"",s="undefined"!==typeof t.suffix&&t.suffix,a="undefined"!==typeof t.unit?t.unit:void 0,r="undefined"!==typeof t.humanize&&t.humanize,l="undefined"!==typeof t.date?t.date:moment(),u=e.getValue(),c=moment(u,i);return c.isValid()?r?moment.duration(c.diff(l)).humanize(s):c.diff(l,a)+(s?" "+s:""):!0===n?u:"function"===typeof n?n(u):n},lookup:function(e,t,o){var i=e.getValue();return"undefined"===typeof t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.stars:5,a=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l='',u='';a.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,s));for(var c=1;c<=s;c++){var d=r.cloneNode(!0);d.innerHTML=c<=i?l:u,a.appendChild(d)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),a},traffic:function(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,a=document.createElement("span"),r=t&&t.max?t.max:100,u=t&&t.min?t.min:0,c=t&&"undefined"!==typeof t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(s)&&"undefined"!==typeof e.getValue()){switch(a.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=r?parseFloat(s):r,n=parseFloat(n)>=u?parseFloat(n):u,i=(r-u)/100,n=Math.round((n-u)/i),"undefined"===typeof c?"undefined":l(c)){case"string":d=c;break;case"function":d=c(s);break;case"object":if(Array.isArray(c)){var h=100/c.length,p=Math.floor(n/h);p=Math.min(p,c.length-1),p=Math.max(p,0),d=c[p];break}}return a.style.backgroundColor=d,a}},progress:function(e,t,o){var i,n,s,a,r,c=this.sanitizeHTML(e.getValue())||0,d=e.getElement(),h=t&&t.max?t.max:100,p=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=h?parseFloat(c):h,n=parseFloat(n)>=p?parseFloat(n):p,i=(h-p)/100,n=Math.round((n-p)/i),l(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var f=100/t.color.length,g=Math.floor(n/f);g=Math.min(g,t.color.length-1),g=Math.max(g,0),s=t.color[g];break}default:s="#2DC214"}switch(l(t.legend)){case"string":a=t.legend;break;case"function":a=t.legend(c);break;case"boolean":a=c;break;default:a=!1}switch(l(t.legendColor)){case"string":r=t.legendColor;break;case"function":r=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){f=100/t.legendColor.length,g=Math.floor(n/f);g=Math.min(g,t.legendColor.length-1),g=Math.max(g,0),r=t.legendColor[g]}break;default:r="#000"}d.style.minWidth="30px",d.style.position="relative",d.setAttribute("aria-label",n);var b=document.createElement("div");if(b.style.display="inline-block",b.style.position="relative",b.style.width=n+"%",b.style.backgroundColor=s,b.style.height="100%",b.setAttribute("data-max",h),b.setAttribute("data-min",p),a){var v=document.createElement("div");v.style.position="absolute",v.style.top="4px",v.style.left=0,v.style.textAlign=m,v.style.width="100%",v.style.color=r,v.innerHTML=a}return o((function(){if(!(e instanceof u)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",d.appendChild(t),d=t}d.appendChild(b),a&&d.appendChild(v)})),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){var i=document.createElement("div"),n=e.getRow()._row.modules.responsiveLayout;function s(e){var t=n.element;n.open=e,t&&(n.open?(i.classList.add("open"),t.style.display=""):(i.classList.remove("open"),t.style.display="none"))}return i.classList.add("tabulator-responsive-collapse-toggle"),i.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),i.addEventListener("click",(function(e){e.stopImmediatePropagation(),s(!n.open)})),s(n.open),i},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",(function(e){i.toggleSelect()})),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",(function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},h.prototype.registerModule("format",T);var k=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};k.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},k.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},k.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},k.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout((function(){t.layout()}),100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach((function(e){"row"===e.type&&t.layoutRow(e)})),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.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},k.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))},k.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach((function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(),i)}))})),this.rightColumns.forEach((function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(),o)}))}))},k.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},k.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach((function(t){"row"===t.type&&e.layoutRow(t)})),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},k.prototype.layoutRow=function(e){var t=this,o=e.getElement();o.style.paddingLeft=this.leftMargin,this.leftColumns.forEach((function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})),this.rightColumns.forEach((function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}))},k.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},k.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)})),t},D.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},D.prototype.unfreezeRow=function(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")},D.prototype.detachRow=function(e){var t=this.rows.indexOf(e);if(t>-1){var o=e.getElement();o.parentNode.removeChild(o),this.rows.splice(t,1)}},D.prototype.styleRows=function(e){var t=this;this.rows.forEach((function(e,o){t.table.rowManager.styleRow(e,o)}))},h.prototype.registerModule("frozenRows",D);var S=function(e){this._group=e,this.type="GroupComponent"};S.prototype.getKey=function(){return this._group.key},S.prototype.getField=function(){return this._group.field},S.prototype.getElement=function(){return this._group.element},S.prototype.getRows=function(){return this._group.getRows(!0)},S.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},S.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},S.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},S.prototype.isVisible=function(){return this._group.visible},S.prototype.show=function(){this._group.show()},S.prototype.hide=function(){this._group.hide()},S.prototype.toggle=function(){this._group.toggleVisibility()},S.prototype._getSelf=function(){return this._group},S.prototype.getTable=function(){return this._group.groupManager.table};var H=function(e,t,o,i,n,s,a){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},H.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)}))},H.prototype.getRowIndex=function(e){},H.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},H.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(o.parentNode&&o.parentNode.removeChild(o),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},H.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},H.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(o){t=t.concat(o.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&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),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&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),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&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),t.push(this.calcs.top))),!e&&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),t.push(this.calcs.bottom)))),t},H.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){o.push(e.getData(t||"data"))})),o},H.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e},H.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},H.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){var t=e.getHeadersAndRows();t.forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},H.prototype.show=function(){var e=this;if(e.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=e.getElement();this.groupList.length?this.groupList.forEach((function(e){var o=e.getHeadersAndRows();o.forEach((function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o}))})):e.rows.forEach((function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},H.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},H.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(o){var i=o.getRowGroup(e);i&&(t=i)})):this.rows.find((function(t){return t===e}))&&(t=this),t},H.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach((function(o){t.push(e?o.getComponent():o)})),t},H.prototype.getRows=function(e){var t=[];return this.rows.forEach((function(o){t.push(e?o.getComponent():o)})),t},H.prototype.generateGroupHeaderContents=function(){var e=[];this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());while(this.element.firstChild)this.element.removeChild(this.element.firstChild);"string"===typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},H.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 e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",(function(t,o){e.headerGenerator[0]=function(e,i,n){return("undefined"===typeof e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}))}Array.isArray(t)||(t=[t]),t.forEach((function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!==typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})})),o&&(Array.isArray(o)||(o=[o]),o.forEach((function(e){e="function"==typeof e?e:function(){return!0}})),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},P.prototype.setDisplayIndex=function(e){this.displayIndex=e},P.prototype.getDisplayIndex=function(){return this.displayIndex},P.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},P.prototype.getGroups=function(e){var t=[];return this.groupList.forEach((function(o){t.push(e?o.getComponent():o)})),t},P.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)})),o},P.prototype.wipe=function(){this.groupList.forEach((function(e){e.wipe()}))},P.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach((function(e){var i={level:0,rowCount:0,headerContent:""},n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach((function(e){o.push(e.getData("data"))})))})),o},P.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},P.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach((function(o){var i=o.getRowGroup(e);i&&(t=i)})),t},P.prototype.countGroups=function(){return this.groupList.length},P.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,o)})),e.forEach((function(e){t.assignRowToExistingGroup(e,o)}))):e.forEach((function(e){t.assignRowToGroup(e,o)}))},P.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new H(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},P.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},P.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},P.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach((function(e){o=o.concat(e.getHeadersAndRows())})),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},P.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)}))},P.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1))},h.prototype.registerModule("groupRows",P);var A=function(e){this.table=e,this.history=[],this.index=-1};A.prototype.clear=function(){this.history=[],this.index=-1},A.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},A.prototype.getHistoryUndoSize=function(){return this.index+1},A.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},A.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},A.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},A.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},A.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},A.prototype._rebindRow=function(e,t){this.history.forEach((function(o){if(o.component instanceof r)o.component===e&&(o.component=t);else if(o.component instanceof c&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}}))},h.prototype.registerModule("history",A);var z=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};z.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},F.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},F.prototype.checkBinding=function(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){var t=o.pressedKeys.indexOf(e);-1==t&&(i=!1)})),i&&t.action.call(o,e),!0)},F.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"},F.prototype.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().prev()))},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell,o&&(e.preventDefault(),t=o.nav(),t.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(Object.assign({},i)),i.then((function(){setTimeout((function(){t.next()}))})))))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().left()))},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().right()))},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().up()))},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t&&(e.preventDefault(),t.nav().down()))},undo:function(e){var t=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){var t=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell,t||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},h.prototype.registerModule("keybindings",F);var _=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1};_.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",(function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)})),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",(function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)})),e.titleElement.insertBefore(t,e.titleElement.firstChild))},_.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;i&&o.stopImmediatePropagation(),t.loadMenu(o,e,i)}))},_.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;t.loadMenu(o,e,i)}))},_.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",(function(o){var i="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;t.loadMenu(o,e,i)}))},_.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);if(e.preventDefault(),o&&o.length){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout((function(){i.nestedMenuBlock=!1}),100);this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach((function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",(function(e){e.stopPropagation()}))):o.addEventListener("click",(function(o){i.hideMenu(),e.action(o,t.getComponent())}))),i.menuEl.appendChild(o)})),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout((function(){document.body.addEventListener("contextmenu",i.blurEvent)}),100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px")}},_.prototype.isOpen=function(){return!!this.menuEl.parentNode},_.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},_.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},_.prototype.menus={},h.prototype.registerModule("menu",_);var N=function(e){this.table=e,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)};N.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},N.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-h.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",(function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout((function(){o.startMove(t,e)}),o.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),o.bindTouchEvents(e)),e.modules.moveColumn=i},N.prototype.bindTouchEvents=function(e){var t,o,i,n,s,a,r=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){r.checkTimeout=setTimeout((function(){r.touchMove=!0,e,t=e.nextColumn(),i=t?t.getWidth()/2:0,o=e.prevColumn(),n=o?o.getWidth()/2:0,s=0,a=0,u=!1,r.startMove(l,e)}),r.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,d;r.moving&&(r.moveHover(l),u||(u=l.touches[0].pageX),c=l.touches[0].pageX-u,c>0?t&&c-s>i&&(d=t,d!==e&&(u=l.touches[0].pageX,d.getElement().parentNode.insertBefore(r.placeholderElement,d.getElement().nextSibling),r.moveColumn(d,!0))):o&&-c-a>n&&(d=o,d!==e&&(u=l.touches[0].pageX,d.getElement().parentNode.insertBefore(r.placeholderElement,d.getElement()),r.moveColumn(d,!1))),d&&(d,t=d.nextColumn(),s=i,i=t?t.getWidth()/2:0,o=d.prevColumn(),a=n,n=o?o.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)}))},N.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-h.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.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(e)},N.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))},N.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))},N.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)})):e.getCells().forEach((function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)}))},N.prototype.endMove=function(e){(1===e.which||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)))},N.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-h.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},O.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-h.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",(function(t){1===t.which&&(o.checkTimeout=setTimeout((function(){o.startMove(t,e)}),o.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},O.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",(function(o){1===o.which&&(t.checkTimeout=setTimeout((function(){t.startMove(o,e.row)}),t.checkPeriod))})),o.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,e.getElement())},O.prototype.bindTouchEvents=function(e,t){var o,i,n,s,a,r,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,e,o=e.nextRow(),n=o?o.getHeight()/2:0,i=e.prevRow(),s=i?i.getHeight()/2:0,a=0,r=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,d;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),c=t.touches[0].pageY-u,c>0?o&&c-a>n&&(d=o,d!==e&&(u=t.touches[0].pageY,d.getElement().parentNode.insertBefore(l.placeholderElement,d.getElement().nextSibling),l.moveRow(d,!0))):i&&-c-r>s&&(d=i,d!==e&&(u=t.touches[0].pageY,d.getElement().parentNode.insertBefore(l.placeholderElement,d.getElement()),l.moveRow(d,!1))),d&&(d,o=d.nextRow(),a=n,n=o?o.getHeight()/2:0,i=d.prevRow(),r=s,s=i?i.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))},O.prototype._bindMouseMove=function(){var e=this;e.table.rowManager.getDisplayRows().forEach((function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))},O.prototype._unbindMouseMove=function(){var e=this;e.table.rowManager.getDisplayRows().forEach((function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))},O.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.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(e)},O.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.pageXOffset,this.startY=i.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},O.prototype.endMove=function(e){e&&1!==e.which&&!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()))},O.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},O.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},O.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},O.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},O.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},O.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"===typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))},O.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))},O.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},O.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},O.prototype.dropComplete=function(e,t,o){var i=!1;if(o){switch(l(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender;break}i?i.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):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(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},O.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(console.trace("drop"),e.stopImmediatePropagation(),l(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver;break}o?i=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},O.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},O.prototype.senders={delete:function(e,t,o){e.delete()}},O.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},h.prototype.registerModule("moveRow",O);var B=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};B.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach((function(n){var s,a="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[a]&&(s=t.lookupMutator(e.definition[a]),s&&(o=!0,i[a]={mutator:s,params:e.definition[a+"Params"]||{}}))})),o&&(e.modules.mutate=i)},B.prototype.lookupMutator=function(e){var t=!1;switch("undefined"===typeof e?"undefined":l(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e;break}return t},B.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&n.table.columnManager.traverse((function(n){var a,r,l;n.modules.mutate&&(a=n.modules.mutate[s]||n.modules.mutate.mutator||!1,a&&(i=n.getFieldValue("undefined"!==typeof o?o:e),"data"!=t&&"undefined"===typeof i||(l=n.getComponent(),r="function"===typeof a.params?a.params(i,e,t,l):a.params,n.setFieldValue(e,a.mutator(i,e,t,r,l)))))})),e},B.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},B.prototype.enable=function(){this.enabled=!0},B.prototype.disable=function(){this.enabled=!1},B.prototype.mutators={},h.prototype.registerModule("mutator",B);var I=function(e){this.table=e,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 e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.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 e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes;while(this.pageSizeSelect.firstChild)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach((function(t){var o=document.createElement("option");o.value=t,!0===t?e.table.modules.localize.bind("pagination|all",(function(e){o.innerHTML=e})):o.innerHTML=t,e.pageSizeSelect.appendChild(o)})),this.pageSizeSelect.value=this.size}},I.prototype.initialize=function(e){var t,o,i,n=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),n.table.modules.localize.bind("pagination|first",(function(e){n.firstBut.innerHTML=e})),n.table.modules.localize.bind("pagination|first_title",(function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|prev",(function(e){n.prevBut.innerHTML=e})),n.table.modules.localize.bind("pagination|prev_title",(function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|next",(function(e){n.nextBut.innerHTML=e})),n.table.modules.localize.bind("pagination|next_title",(function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)})),n.table.modules.localize.bind("pagination|last",(function(e){n.lastBut.innerHTML=e})),n.table.modules.localize.bind("pagination|last_title",(function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)})),n.firstBut.addEventListener("click",(function(){n.setPage(1)})),n.prevBut.addEventListener("click",(function(){n.previousPage()})),n.nextBut.addEventListener("click",(function(){n.nextPage().then((function(){})).catch((function(){}))})),n.lastBut.addEventListener("click",(function(){n.setPage(n.max)})),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",(function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",(function(e){n.setPageSize("true"==n.pageSizeSelect.value||n.pageSizeSelect.value),n.setPage(1).then((function(){})).catch((function(){}))}))),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||e||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.table.options.paginationSize?n.size=n.table.options.paginationSize:(o=document.createElement("div"),o.classList.add("tabulator-row"),o.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",o.appendChild(i),n.table.rowManager.getTableElement().appendChild(o),n.size=Math.floor(n.table.rowManager.getElement().clientHeight/o.offsetHeight),n.table.rowManager.getTableElement().removeChild(o)),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},I.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},I.prototype.setDisplayIndex=function(e){this.displayIndex=e},I.prototype.getDisplayIndex=function(){return this.displayIndex},I.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},I.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},I.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},I.prototype.setPage=function(e){var t=this,o=this;switch(e){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(i,n){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then((function(){i()})).catch((function(){n()})),o.table.options.persistence&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.config.page&&o.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),n())}))},I.prototype.setPageToRow=function(e){var t=this;return new Promise((function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var a=!0===t.size?1:Math.ceil((s+1)/t.size);t.setPage(a).then((function(){o()})).catch((function(){i()}))}else console.warn("Pagination Error - Requested row is not visible"),i()}))},I.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},I.prototype._setPageButtons=function(){var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},I.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",(function(t){o.setAttribute("aria-label",t+" "+e),o.setAttribute("title",t+" "+e)})),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",(function(o){t.setPage(e)})),o},I.prototype.previousPage=function(){var e=this;return new Promise((function(t,o){e.page>1?(e.page--,e.trigger().then((function(){t()})).catch((function(){o()})),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())}))},I.prototype.nextPage=function(){var e=this;return new Promise((function(t,o){e.pagen?i.splice(n,0,e):i.push(e))})),i},j.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))},j.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,e,t)},j.prototype.validateSorters=function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e},j.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},j.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},j.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach((function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach((function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}}))),o.push(n)})),o},j.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,a=n.indexOf(s+"=");return a>-1&&(n=n.substr(a),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},j.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},h.prototype.registerModule("persistence",j);var V=function(e){this.table=e,this.element=!1,this.manualBlock=!1};V.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},V.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.options.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))},V.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="")},V.prototype.printFullscreen=function(e,t,o){var i,n,s=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable("undefined"!=typeof o?o:this.table.options.printConfig,"undefined"!=typeof t?t:this.table.options.printStyled,e,"print");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"),i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof n?l.innerHTML=n:l.appendChild(n),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},h.prototype.registerModule("print",V);var W=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};W.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach((function(e){o.table.rowManager.addRowActual(e,!1)})),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach((function(e){o.table.rowManager.addRowActual(e,!0)})),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]),i&&i.deleteActual()),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]),i&&i.deleteActual()),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],a=n[1],r=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(r&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?r.forEach((function(e){o.table.rowManager.addRowActual(e,!0,i,!0)})):(r=r.slice().reverse(),r.forEach((function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)})))),0!==a){var l=e.slice(s,"undefined"===typeof n[1]?n[1]:s+a);l.forEach((function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)}))}(r||0!==a)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},W.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},W.prototype.watchRow=function(e){var t=e.getData();for(var o in this.blocked=!0,t)this.watchKey(e,t,o);this.blocked=!1},W.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],a=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&a===i.currentVersion){var r={};r[o]=t,e.updateData(r)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},W.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},W.prototype.block=function(){this.blocked=!0},W.prototype.unblock=function(){this.blocked=!1},h.prototype.registerModule("reactiveData",W);var G=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};G.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var r=document.createElement("div");r.className="tabulator-col-resize-handle prev",a.addEventListener("click",(function(e){e.stopPropagation()}));var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),a.addEventListener("dblclick",(function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))})),r.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){var o,n,s;o=t.getFirstColumn(),o&&(n=i.table.columnManager.findColumnIndex(o),s=n>0&&i.table.columnManager.getColumnByIndex(n-1),s&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,r)))};r.addEventListener("mousedown",u),r.addEventListener("touchstart",u,{passive:!0}),r.addEventListener("dblclick",(function(e){var o,n,s;o=t.getFirstColumn(),o&&(n=i.table.columnManager.findColumnIndex(o),s=n>0&&i.table.columnManager.getColumnByIndex(n-1),s&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))})),o.appendChild(a),o.appendChild(r)}},G.prototype._checkResizability=function(e){return"undefined"!=typeof e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},G.prototype._mouseDown=function(e,t,o){var i=this;function n(e){t.setWidth(i.startWidth+(("undefined"===typeof e.screenX?e.touches[0].screenX:e.screenX)-i.startX)),!i.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function s(e){i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!1),i.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",s),document.body.removeEventListener("mousemove",n),o.removeEventListener("touchmove",n),o.removeEventListener("touchend",s),i.table.element.classList.remove("tabulator-block-select"),i.table.options.persistence&&i.table.modExists("persistence",!0)&&i.table.modules.persistence.config.columns&&i.table.modules.persistence.save("columns"),i.table.options.columnResized.call(i.table,t.getComponent())}i.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!0),i.startX="undefined"===typeof e.screenX?e.touches[0].screenX:e.screenX,i.startWidth=t.getWidth(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",s),o.addEventListener("touchmove",n,{passive:!0}),o.addEventListener("touchend",s)},h.prototype.registerModule("resizeColumns",G);var U=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};U.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",(function(e){e.stopPropagation()}));var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.appendChild(i),o.appendChild(n)},U.prototype._mouseDown=function(e,t,o){var i=this;function n(e){t.setHeight(i.startHeight+(("undefined"===typeof e.screenY?e.touches[0].screenY:e.screenY)-i.startY))}function s(e){document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",n),o.removeEventListener("touchmove",n),o.removeEventListener("touchend",s),i.table.element.classList.remove("tabulator-block-select"),i.table.options.rowResized.call(this.table,t.getComponent())}i.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),i.startY="undefined"===typeof e.screenY?e.touches[0].screenY:e.screenY,i.startHeight=t.getHeight(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",s),o.addEventListener("touchmove",n,{passive:!0}),o.addEventListener("touchend",s)},h.prototype.registerModule("resizeRows",U);var q=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};q.prototype.initialize=function(e){var t,o=this,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!==typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}})),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}})),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},q.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},h.prototype.registerModule("resizeTable",q);var Y=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var e=this,t=[];this.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(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))})),t=t.reverse(),t=t.sort((function(e,t){var o=t.modules.responsive.order-e.modules.responsive.order;return o||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var o=this.table.columnManager.columnsByIndex,i=Array.isArray(o),n=0;for(o=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var a=s;if("responsiveCollapse"==a.definition.formatter){this.collapseHandleColumn=a;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},Y.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:"undefined"===typeof t.responsive?1:t.responsive,visible:!1!==t.visible}},Y.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},Y.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},Y.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},Y.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){var e=this,t=!0;while(t){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1];s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var e=this,t=this.table.rowManager.getDisplayRows();t.forEach((function(t){e.generateCollapsedRowContent(t)}))},Y.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){t=e.modules.responsiveLayout.element;while(t.firstChild)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.getData(),n=[];return this.hiddenColumns.forEach((function(s){var a=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return a},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:a}))})),n},Y.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach((function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""})),t.innerHTML=o,Object.keys(e).length?t:""},h.prototype.registerModule("responsiveLayout",Y);var $=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};$.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},$.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",(function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,a=i>=n?i:n,r=t.table.rowManager.getDisplayRows().slice(0),l=r.splice(s,a-s+1);o.ctrlKey||o.metaKey?(l.forEach((function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)||t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)})):(o.addEventListener("click",(function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),o.addEventListener("mousedown",(function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1})),o.addEventListener("mouseenter",(function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),o.addEventListener("mouseout",(function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},$.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},$.prototype.selectRows=function(e){var t,o=this;switch("undefined"===typeof e?"undefined":l(e)){case"undefined":this.table.rowManager.rows.forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach((function(e){o._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0);break}},$.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},$.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},$.prototype.deselectRows=function(e,t){var o,i=this;if("undefined"==typeof e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t))):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},$.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e},$.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e},$.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(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)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},$.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},$.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},$.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t){var i=o,n=Array.isArray(i),s=0;for(i=n?i:i[Symbol.iterator]();;){var a;if(n){if(s>=i.length)break;a=i[s++]}else{if(s=i.next(),s.done)break;a=s.value}var r=a;this._selectRow(r,!0)}}else{var l=o,u=Array.isArray(l),c=0;for(l=u?l:l[Symbol.iterator]();;){var d;if(u){if(c>=l.length)break;d=l[c++]}else{if(c=l.next(),c.done)break;d=c.value}var h=d;this._deselectRow(h,!0)}}},h.prototype.registerModule("selectRow",$);var X=function(e){this.table=e,this.sortList=[],this.changed=!1};X.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(l(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter;break}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:"undefined"!==typeof e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},("undefined"===typeof e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",(function(t){var o="",i=[],s=!1;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex((function(t){return t.field===e.getField()})),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}})))},X.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},X.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach((function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})})),t},X.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},X.prototype.clear=function(){this.setSort([])},X.prototype.findSorter=function(e){var t,o,i=this.table.rowManager.activeRows[0],n="string";if(i&&(i=i.getData(),t=e.getField(),t))switch(o=e.getFieldValue(i),"undefined"===typeof o?"undefined":l(o)){case"undefined":n="string";break;case"boolean":n="boolean";break;default:isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(n="alphanum"):n="number";break}return this.sorters[n]},X.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[],n=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach((function(e,o){t.setColumnHeader(e.column,e.dir)})):(o.forEach((function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"===typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)})),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&(e.forEach((function(e){n.push(e.getComponent())})),t.table.options.dataSorted.call(t.table,t.getSort(),n))},X.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))},X.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},X.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort((function(e,n){for(var s,a=i;a>=0;a--){var r=t[a];if(s=o._sortRow(e,n,r.column,r.dir,r.params),0!==s)break}return s}))},X.prototype._sortRow=function(e,t,o,i,n){var s,a,r="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(r.getData()),t=o.getFieldValue(l.getData()),e="undefined"!==typeof e?e:"",t="undefined"!==typeof t?t:"",s=r.getComponent(),a=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,a,o.getComponent(),i,n)},X.prototype.sorters={number:function(e,t,o,i,n,s,a){var r=a.alignEmptyValues,l=a.decimalSeparator||".",u=a.thousandSeparator||",",c=0;if(e=parseFloat(String(e).split(u).join("").split(l).join(".")),t=parseFloat(String(t).split(u).join("").split(l).join(".")),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===r&&"desc"===s||"bottom"===r&&"asc"===s)&&(c*=-1),c},string:function(e,t,o,i,n,s,a){var r,u=a.alignEmptyValues,c=0;if(e){if(t){switch(l(a.locale)){case"boolean":a.locale&&(r=this.table.modules.localize.getLocale());break;case"string":r=a.locale;break}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),r)}c=1}else c=t?-1:0;return("top"===u&&"desc"===s||"bottom"===u&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,a){return a.format||(a.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},time:function(e,t,o,i,n,s,a){return a.format||(a.format="HH:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,a)},datetime:function(e,t,o,i,n,s,a){var r=a.format||"DD/MM/YYYY HH:mm:ss",l=a.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(e=moment(e,r),t=moment(t,r),e.isValid()){if(t.isValid())return e-t;u=1}else u=t.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(e,t,o,i,n,s,a){var r=!0===e||"true"===e||"True"===e||1===e?1:0,l=!0===t||"true"===t||"True"===t||1===t?1:0;return r-l},array:function(e,t,o,i,n,s,a){var r=0,l=0,u=a.type||"length",c=a.alignEmptyValues,d=0;function h(e){switch(u){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return r=e?h(e):0,l=t?h(t):0,r-l;c=1}else c=Array.isArray(t)?-1:0;return("top"===c&&"desc"===s||"bottom"===c&&"asc"===s)&&(d*=-1),d},exists:function(e,t,o,i,n,s,a){var r="undefined"==typeof e?0:1,l="undefined"==typeof t?0:1;return r-l},alphanum:function(e,t,o,i,n,s,a){var r,l,u,c,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=a.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(r=String(e).toLowerCase(),l=String(t).toLowerCase(),r===l)return 0;if(!m.test(r)||!m.test(l))return r>l?1:-1;r=r.match(p),l=l.match(p),d=r.length>l.length?l.length:r.length;while(hc?1:-1;return r.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},h.prototype.registerModule("sort",X);var K=function(e){this.table=e,this.invalidCells=[]};return K.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){t=o._extractValidator(e),t&&i.push(t)})):(t=this._extractValidator(e.definition.validator),t&&i.push(t)),e.modules.validate=!!i.length&&i)},K.prototype._extractValidator=function(e){var t,o,i;switch("undefined"===typeof e?"undefined":l(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},K.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},K.prototype.validate=function(e,t,o){var i=this,n=[],s=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(i,t.getComponent(),o,e.params)||n.push({type:e.type,parameters:e.params})})),n=!n.length||n,t.modules.validate||(t.modules.validate={}),!0===n?(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(t.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(t)),n},K.prototype.getInvalidCells=function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e},K.prototype.clearValidation=function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.element.classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,t=this.invalidCells.indexOf(e),t>-1&&this.invalidCells.splice(t,1))},K.prototype.validators={integer:function(e,t,o){return""===t||null===t||"undefined"===typeof t||(t=Number(t),"number"===typeof t&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,o){return""===t||null===t||"undefined"===typeof t||(t=Number(t),"number"===typeof t&&isFinite(t)&&t%1!==0)},numeric:function(e,t,o){return""===t||null===t||"undefined"===typeof t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||"undefined"===typeof t||isNaN(t)},max:function(e,t,o){return""===t||null===t||"undefined"===typeof t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||"undefined"===typeof t||parseFloat(t)>=o},starts:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||"undefined"===typeof t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||"undefined"===typeof t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){if(""===t||null===t||"undefined"===typeof t)return!0;var i=new RegExp(o);return i.test(t)},unique:function(e,t,o){if(""===t||null===t||"undefined"===typeof t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)})),i},required:function(e,t,o){return""!==t&&null!==t&&"undefined"!==typeof t}},h.prototype.registerModule("validate",K),h}))},7626:function(e,t,o){},ce1f:function(e,t,o){"use strict";var i=o("7626"),n=o.n(i);n.a},fb98:function(e,t,o){}}); -//# sourceMappingURL=app.874d57d0.js.map \ No newline at end of file