1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-04-28 12:52:49 +02:00
TableFilter/dist/tablefilter/tf-0-4230fc9b49f13cb9eb22.js
2017-06-03 19:45:20 +10:00

8 lines
53 KiB
JavaScript

/**
* tablefilter v0.5.20 by Max Guglielmi
* build date: 2017-06-03T09:39:52.705Z
* MIT License
*/
webpackJsonp([0],{438:function(e,t,n){function r(e){return n(i(e))}function i(e){var t=o[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var o={"./array":67,"./array.js":67,"./const":14,"./const.js":14,"./cookie":109,"./cookie.js":109,"./dom":9,"./dom.js":9,"./emitter":69,"./emitter.js":69,"./event":17,"./event.js":17,"./extensions/advancedGrid/adapterEzEditTable":439,"./extensions/advancedGrid/adapterEzEditTable.js":439,"./extensions/advancedGrid/advancedGrid":441,"./extensions/advancedGrid/advancedGrid.js":441,"./extensions/colOps/colOps":442,"./extensions/colOps/colOps.js":442,"./extensions/colsVisibility/colsVisibility":443,"./extensions/colsVisibility/colsVisibility.js":443,"./extensions/filtersVisibility/filtersVisibility":444,"./extensions/filtersVisibility/filtersVisibility.js":444,"./extensions/sort/adapterSortabletable":440,"./extensions/sort/adapterSortabletable.js":440,"./extensions/sort/sort":445,"./extensions/sort/sort.js":445,"./feature":11,"./feature.js":11,"./modules/alternateRows":110,"./modules/alternateRows.js":110,"./modules/baseDropdown":68,"./modules/baseDropdown.js":68,"./modules/checkList":70,"./modules/checkList.js":70,"./modules/clearButton":111,"./modules/clearButton.js":111,"./modules/dateType":112,"./modules/dateType.js":112,"./modules/dropdown":71,"./modules/dropdown.js":71,"./modules/gridLayout":113,"./modules/gridLayout.js":113,"./modules/hash":114,"./modules/hash.js":114,"./modules/help":115,"./modules/help.js":115,"./modules/highlightKeywords":116,"./modules/highlightKeywords.js":116,"./modules/loader":117,"./modules/loader.js":117,"./modules/markActiveColumns":118,"./modules/markActiveColumns.js":118,"./modules/noResults":119,"./modules/noResults.js":119,"./modules/paging":120,"./modules/paging.js":120,"./modules/popupFilter":121,"./modules/popupFilter.js":121,"./modules/rowsCounter":122,"./modules/rowsCounter.js":122,"./modules/state":123,"./modules/state.js":123,"./modules/statusBar":124,"./modules/statusBar.js":124,"./modules/storage":125,"./modules/storage.js":125,"./number":52,"./number.js":52,"./root":15,"./root.js":15,"./sort":108,"./sort.js":108,"./string":19,"./string.js":19,"./tablefilter":126,"./tablefilter.js":126,"./types":6,"./types.js":6};r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id=438},439:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),l=n(9),d=n(14),c=n(15),u=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n.name));return o.desc=n.description||"ezEditTable adapter",o.filename=n.filename||"ezEditTable.js",o.vendorPath=n.vendor_path,o.loadStylesheet=Boolean(n.load_stylesheet),o.stylesheet=n.stylesheet||o.vendorPath+"ezEditTable.css",o.stylesheetName=n.stylesheet_name||"ezEditTableCss",n.scroll_into_view=!1!==n.scroll_into_view&&e.gridLayout,o._ezEditTable=null,o.cfg=n,o.enable(),o}return o(t,e),s(t,[{key:"init",value:function(){var e=this;if(!this.initialized){var t=this.tf;if(c.root.EditTable)this._setAdvancedGrid();else{var n=this.vendorPath+this.filename;t.import(this.filename,n,function(){return e._setAdvancedGrid()})}this.loadStylesheet&&!t.isImported(this.stylesheet,"link")&&t.import(this.stylesheetName,this.stylesheet,null,"link"),this.emitter.on(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!0}}},{key:"_setAdvancedGrid",value:function(){var e=this.tf,t=void 0,n=this.cfg;t=(0,l.tag)(e.dom(),"thead").length>0&&!n.startRow?void 0:n.startRow||e.refRow,n.base_path=n.base_path||e.basePath+"ezEditTable/";var r=n.editable,i=n.selection;i&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var o=0,s=0;if(i){var a=function(t,n,r){var i=t.Selection,a=function(r){if("row"===t.defaultSelection)i.SelectRowByIndex(r);else{t.ClearSelections();var o=n.cellIndex,s=e.dom().rows[r];"both"===t.defaultSelection&&i.SelectRowByIndex(r),s&&i.SelectCell(s.cells[o])}if(e.validRowsIndex.length!==e.getRowsNb()){var a=e.dom().rows[r];a&&a.scrollIntoView(!1),u&&(u.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===u.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:u.scrollIntoView(!1))}};if(e.validRowsIndex){var l=e.validRowsIndex,d=l.length,c="row"!==t.defaultSelection?n.parentNode:n,u="TD"===n.nodeName?n:null,h=void 0!==r?t.Event.GetKey(r):0,f=-1!==l.indexOf(c.rowIndex),p=void 0,b=e.feature("paging"),m=34===h||33===h?b&&b.pagingLength||t.nbRowsPerPage:1;if(f)34!==h&&33!==h?(o=l.indexOf(c.rowIndex),s=c.rowIndex):(p=34===h?o+m<=d-1?l[o+m]:[d-1]:o-m<=l[0]?l[0]:l[o-m],s=p,o=l.indexOf(p),a(p));else{if(c.rowIndex>s)if(c.rowIndex>=l[d-1])p=l[d-1];else{var g=o+m;p=g>d-1?l[d-1]:l[g]}else if(c.rowIndex<=l[0])p=l[0];else{var y=l[o-m];p=y||l[0]}s=c.rowIndex,a(p)}}},d=function(t,n){var r="row"!==t.defaultSelection?n.parentNode:n;if(e.paging&&e.feature("paging").nbPages>1){var i=e.feature("paging");t.nbRowsPerPage=i.pagingLength;var o=e.validRowsIndex,s=o.length,a=parseInt(i.startPagingRow,10)+parseInt(i.pagingLength,10),l=r.rowIndex;l===o[s-1]&&i.currentPageNb!==i.nbPages?i.setPage("last"):l===o[0]&&1!==i.currentPageNb?i.setPage("first"):l>o[a-1]&&l<o[s-1]?i.setPage("next"):l<o[i.startPagingRow]&&l>o[0]&&i.setPage("previous")}};if(e.paging&&(e.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid"),n=t._ezEditTable,r=n.Selection,i=r.GetActiveRow();i&&i.scrollIntoView(!1);var o=r.GetActiveCell();o&&o.scrollIntoView(!1)}),"row"===n.default_selection){var c=n.on_before_selected_row;n.on_before_selected_row=function(){var e=arguments;d(e[0],e[1],e[2]),c&&c.call(null,e[0],e[1],e[2])};var u=n.on_after_selected_row;n.on_after_selected_row=function(){var e=arguments;a(e[0],e[1],e[2]),u&&u.call(null,e[0],e[1],e[2])}}else{var h=n.on_before_selected_cell;n.on_before_selected_cell=function(){var e=arguments;d(e[0],e[1],e[2]),h&&h.call(null,e[0],e[1],e[2])};var f=n.on_after_selected_cell;n.on_after_selected_cell=function(){var e=arguments;a(e[0],e[1],e[2]),f&&f.call(null,e[0],e[1],e[2])}}}if(r){var p=n.on_added_dom_row;if(n.on_added_dom_row=function(){var t=arguments;e.nbFilterableRows++,e.paging?(e.nbFilterableRows++,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset()):e.emitter.emit("rows-changed",e,this),e.alternateRows&&e.feature("alternateRows").init(),p&&p.call(null,t[0],t[1],t[2])},n.actions&&n.actions.delete){var b=n.actions.delete.on_after_submit;n.actions.delete.on_after_submit=function(){var t=arguments;e.nbFilterableRows--,e.paging?(e.nbFilterableRows--,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset(!1)):e.emitter.emit("rows-changed",e,this),e.alternateRows&&e.feature("alternateRows").init(),b&&b.call(null,t[0],t[1])}}}try{this._ezEditTable=new EditTable(e.id,n,t),this._ezEditTable.Init()}catch(e){throw new Error('Failed to instantiate EditTable object.\n \n"ezEditTable" dependency not found.')}this.initialized=!0}},{key:"reset",value:function(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())}},{key:"toggle",value:function(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()}},{key:"_toggleForInputFilter",value:function(){var e=this.tf;if(e.getActiveFilterId()){var t=e.getColumnIndexFromFilterId(e.getActiveFilterId());e.getFilterType(t)===d.INPUT&&this.toggle()}}},{key:"destroy",value:function(){var e=this;if(this.initialized){var t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!1}}}]),t}(a.Feature);t.default=u},440:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.split(".");for(var n in t){for(var r=t[n];3>r.length;)r="0"+r;t[n]=r}return t.join(".")}function a(e,t){var n=s(e.value.toLowerCase()),r=s(t.value.toLowerCase());return n===r?0:n<r?-1:1}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=n(11),c=n(6),u=n(9),h=n(17),f=n(52),p=n(14),b=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n.name));return o.name=n.name,o.desc=n.description||"Sortable table",o.sorted=!1,o.sortTypes=(0,c.isArray)(n.types)?n.types:e.colTypes,o.sortColAtStart=(0,c.isArray)(n.sort_col_at_start)?n.sort_col_at_start:null,o.asyncSort=Boolean(n.async_sort),o.triggerIds=(0,c.isArray)(n.trigger_ids)?n.trigger_ids:[],o.imgPath=n.images_path||e.themesPath,o.imgBlank=n.image_blank||"blank.png",o.imgClassName=n.image_class_name||"sort-arrow",o.imgAscClassName=n.image_asc_class_name||"ascending",o.imgDescClassName=n.image_desc_class_name||"descending",o.customKey=n.custom_key||"data-tf-sortKey",o.onSortLoaded=(0,c.isFn)(n.on_sort_loaded)?n.on_sort_loaded:c.EMPTY_FN,o.onBeforeSort=(0,c.isFn)(n.on_before_sort)?n.on_before_sort:c.EMPTY_FN,o.onAfterSort=(0,c.isFn)(n.on_after_sort)?n.on_after_sort:c.EMPTY_FN,o.stt=null,o.enable(),o}return o(t,e),l(t,[{key:"init",value:function(){var e=this;if(!this.initialized){var t=this.tf,n=this;if((0,c.isUndef)(SortableTable))throw new Error("SortableTable class not found.");this.emitter.emit("add-date-type-formats",this.tf,this.sortTypes),this.overrideSortableTable(),this.setSortTypes(),this.onSortLoaded(t,this),this.stt.onbeforesort=function(){n.onBeforeSort(t,n.stt.sortColumn),t.paging&&t.feature("paging").disable()},this.stt.onsort=function(){if(n.sorted=!0,t.paging){var e=t.feature("paging");t.getValidRows(!0),e.enable(),e.setPage(e.getPage())}n.onAfterSort(t,n.stt.sortColumn,n.stt.descending),n.emitter.emit("column-sorted",t,n.stt.sortColumn,n.stt.descending)};var r=n.sortColAtStart;r&&this.stt.sort(r[0],r[1]),this.emitter.on(["sort"],function(t,n,r){return e.sortByColumnIndex(n,r)}),this.initialized=!0,this.emitter.emit("sort-initialized",t,this)}}},{key:"sortByColumnIndex",value:function(e,t){this.stt.sort(e,t)}},{key:"overrideSortableTable",value:function(){var e=this,t=this.tf;SortableTable.prototype.headerOnclick=function(t){if(e.initialized){for(var n=t.target||t.srcElement;n.tagName!==p.CELL_TAG&&n.tagName!==p.HEADER_TAG;)n=n.parentNode;this.sort(SortableTable.msie?SortableTable.getCellIndex(n):n.cellIndex)}},SortableTable.getCellIndex=function(e){var t=e.parentNode.cells,n=t.length,r=void 0;for(r=0;t[r]!==e&&r<n;r++);return r},SortableTable.prototype.initHeader=function(n){var r=this;if(!r.tHead){if(!t.gridLayout)return;r.tHead=t.feature("gridLayout").headTbl.tHead}r.headersRow=t.headersRow;var i=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var o=i.length,s=void 0,a=void 0,l=0;l<o;l++)a=i[l],null!==r.sortTypes[l]&&"None"!==r.sortTypes[l]?(a.style.cursor="pointer",s=(0,u.createElm)("img",["src",e.imgPath+e.imgBlank]),a.appendChild(s),null!==r.sortTypes[l]&&a.setAttribute("_sortType",r.sortTypes[l]),(0,h.addEvt)(a,"click",r._headerOnclick)):(a.setAttribute("_sortType",n[l]),a._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=this,n=void 0,r=void 0,i=void 0;if(e.asyncSort&&e.triggerIds.length>0){var o=e.triggerIds;n=[],r=o.length;for(var s=0;s<r;s++)n.push((0,u.elm)(o[s]))}else{if(!this.tHead)return;n=t.tHead.rows[t.headersRow].cells,r=n.length}for(var a=0;a<r;a++){var l=n[a];if(l){var d=l.getAttribute("_sortType");null!==d&&"None"!==d&&(i=l.lastChild||l,"img"!==i.nodeName.toLowerCase()&&(i=(0,u.createElm)("img",["src",e.imgPath+e.imgBlank]),l.appendChild(i)),a===t.sortColumn?i.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):i.className=e.imgClassName)}}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this,i=r._sortTypeInfo[t];if(i&&i.getRowValue)return i.getRowValue(e,n);var o=e.cells[n],s=SortableTable.getInnerText(o);return r.getValueFromString(s,t)},SortableTable.getInnerText=function(t){if(t)return t.getAttribute(e.customKey)?t.getAttribute(e.customKey):(0,u.getText)(t)}}},{key:"addSortType",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],i=t[1],o=t[2];SortableTable.prototype.addSortType(r,i,o)}},{key:"setSortTypes",value:function(){for(var e=this,t=this.tf,n=this.sortTypes,r=[],i=0;i<t.nbCells;i++){var o=void 0;if(n[i])if(o=n[i],(0,c.isObj)(o)){if(o.type===p.DATE)o=this._addDateType(i,n);else if(o.type===p.FORMATTED_NUMBER){var l=o.decimal||t.decimalSeparator;o=this._addNumberType(i,l)}}else o=o.toLowerCase(),o===p.DATE?o=this._addDateType(i,n):o===p.FORMATTED_NUMBER||o===p.NUMBER?o=this._addNumberType(i,t.decimalSeparator):o===p.NONE&&(o="None");else o=p.STRING;r.push(o)}this.addSortType("caseinsensitivestring",SortableTable.toUpperCase),this.addSortType(p.STRING),this.addSortType(p.IP_ADDRESS,s,a),this.stt=new SortableTable(t.dom(),r),this.asyncSort&&this.triggerIds.length>0&&function(){for(var t=e.triggerIds,n=0;n<t.length;n++)if(null!==t[n]){var i=(0,u.elm)(t[n]);i&&(i.style.cursor="pointer",(0,h.addEvt)(i,"click",function(n){var r=n.target;e.tf.sort&&e.stt.asyncSort(t.indexOf(r.id))}),i.setAttribute("_sortType",r[n]))}}()}},{key:"_addDateType",value:function(e,t){var n=this.tf,r=n.feature("dateType"),i=r.getOptions(e,t).locale||n.locale,o=p.DATE+"-"+i;return this.addSortType(o,function(e){var t=r.parse(e,i);return isNaN(+t)?new Date(-864e11):t}),o}},{key:"_addNumberType",value:function(e,t){var n=p.FORMATTED_NUMBER+("."===t?"":"-custom");return this.addSortType(n,function(e){return(0,f.parse)(e,t)}),n}},{key:"destroy",value:function(){var e=this;if(this.initialized){var t=this.tf;this.emitter.off(["sort"],function(t,n,r){return e.sortByColumnIndex(n,r)}),this.sorted=!1,this.stt.destroy();for(var n=t.getFiltersId(),r=0;r<n.length;r++){var i=t.getHeaderElement(r),o=(0,u.tag)(i,"img");1===o.length&&i.removeChild(o[0])}this.initialized=!1}}}]),t}(d.Feature);t.default=b},441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(439),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default},442:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),l=n(9),d=n(6),c=n(108),u=n(14),h=n(446),f=function(e){return e&&e.__esModule?e:{default:e}}(h),p=["after-filtering","after-page-change","after-page-length-change"],b=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n.name));return o.onBeforeOperation=(0,d.isFn)(n.on_before_operation)?n.on_before_operation:d.EMPTY_FN,o.onAfterOperation=(0,d.isFn)(n.on_after_operation)?n.on_after_operation:d.EMPTY_FN,o.opts=n,o.labelIds=n.id||[],o.colIndexes=n.col||[],o.operations=n.operation||[],o.outputTypes=n.write_method||[],o.formatResults=n.format_result||[],o.totRowIndexes=n.tot_row_index||[],o.excludeRows=n.exclude_row||[],o.decimalPrecisions=(0,d.isUndef)(n.decimal_precision)?2:n.decimal_precision,o.enable(),o}return o(t,e),s(t,[{key:"init",value:function(){var e=this;this.initialized||(this.emitter.on(p,function(){return e.calcAll()}),this.calcAll(),this.initialized=!0)}},{key:"calcAll",value:function(){var e=this.tf;if(e.isInitialized()){this.onBeforeOperation(e,this),this.emitter.emit("before-column-operation",e,this);var t=this.colIndexes,n=this.operations,r=this.outputTypes,i=this.totRowIndexes,o=this.excludeRows,s=this.formatResults,a=(0,d.isUndef)(this.decimalPrecisions)?2:this.decimalPrecisions,l=[];t.forEach(function(e){-1===l.indexOf(e)&&l.push(e)});for(var c=l.length,u=e.dom().rows,h=[],f=0;f<c;f++){h.push(e.getVisibleColumnData(l[f],!1,o));for(var p=h[f],b=0,m=[],g=[],y=[],v=void 0,T=[],_=0,w=0;w<t.length;w++)t[w]===l[f]&&(m[_]=(n[w]||"sum").toLowerCase(),g[_]=a[w],y[_]=this.labelIds[w],v=(0,d.isArray)(r)?r[w]:null,T[_]=this.configureFormat(l[f],s[w]),_++);for(var S=0;S<_;S++)this.emitter.emit("before-column-calc",e,this,l[f],p,m[S],g[S]),b=Number(this.calc(p,m[S],null)),this.emitter.emit("column-calc",e,this,l[f],b,m[S],g[S]),this.writeResult(b,y[S],v,g[S],T[S]);var C=i&&i[f]?u[i[f]]:null;C&&(C.style.display="")}this.onAfterOperation(e,this),this.emitter.emit("after-column-operation",e,this)}}},{key:"columnCalc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sum",n=arguments[2],r=this.excludeRows||[],i=tf.getVisibleColumnData(e,!1,r);return Number(this.calc(i,t,n))}},{key:"calc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sum",n=arguments[2],r=0;switch("q1"!==t&&"q3"!==t&&"median"!==t||(e=this.sortColumnValues(e,c.numSortAsc)),t){case"mean":r=this.calcMean(e);break;case"sum":r=this.calcSum(e);break;case"min":r=this.calcMin(e);break;case"max":r=this.calcMax(e);break;case"median":r=this.calcMedian(e);break;case"q1":r=this.calcQ1(e);break;case"q3":r=this.calcQ3(e)}return(0,d.isEmpty)(n)?r:r.toFixed(n)}},{key:"calcSum",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,d.isEmpty)(e)?0:e.reduce(function(e,t){return Number(e)+Number(t)})}},{key:"calcMean",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.calcSum(e)/e.length;return Number(t)}},{key:"calcMax",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Math.max.apply(null,e)}},{key:"calcMin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Math.min.apply(null,e)}},{key:"calcMedian",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length,n=0;return t%2==1?(n=Math.floor(t/2),Number(e[n])):(Number(e[t/2])+Number(e[t/2-1]))/2}},{key:"calcQ1",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length,n=0;return n=Math.floor(t/4),4*n===t?(Number(e[n-1])+Number(e[n]))/2:Number(e[n])}},{key:"calcQ3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length,n=0,r=0;return n=Math.floor(t/4),4*n===t?(r=3*n,(Number(e[r])+Number(e[r-1]))/2):Number(e[t-n-1])}},{key:"sortColumnValues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];return e.sort(t)}},{key:"writeResult",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"innerhtml",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=(0,l.elm)(t);if(o)switch(e=e.toFixed(r),e=isNaN(e)||!isFinite(e)?"":(0,f.default)(i)(e),n.toLowerCase()){case"innerhtml":o.innerHTML=e;break;case"setvalue":o.value=e;break;case"createtextnode":var s=o.firstChild,a=(0,l.createText)(e);o.replaceChild(a,s)}}},{key:"configureFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.tf;if(n.hasType(e,[u.FORMATTED_NUMBER])){var r=n.colTypes[e];r.decimal&&!t.decimal&&(t.decimal=r.decimal),r.thousands&&!t.integerSeparator&&(t.integerSeparator=r.thousands)}else t.decimal=t.decimal||"",t.integerSeparator=t.integerSeparator||"";return t}},{key:"destroy",value:function(){var e=this;this.initialized&&(this.emitter.off(p,function(){return e.calcAll()}),this.initialized=!1)}}]),t}(a.Feature);t.default=b},443:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),l=n(9),d=n(6),c=n(17),u=n(15),h=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n.name)),s=o.config;return o.name=n.name,o.desc=n.description||"Columns visibility manager",o.spanEl=null,o.btnEl=null,o.contEl=null,o.tickToHide=!1!==n.tick_to_hide,o.manager=!1!==n.manager,o.headersTbl=n.headers_table||null,o.headersIndex=n.headers_index||1,o.contElTgtId=n.container_target_id||null,o.headersText=n.headers_text||null,o.btnTgtId=n.btn_target_id||null,o.btnText=n.btn_text||"Columns&#9660;",o.btnHtml=n.btn_html||null,o.btnCssClass=n.btn_css_class||"colVis",o.btnCloseText=n.btn_close_text||"Close",o.btnCloseHtml=n.btn_close_html||null,o.btnCloseCssClass=n.btn_close_css_class||o.btnCssClass,o.stylesheet=n.stylesheet||"colsVisibility.css",o.spanCssClass=n.span_css_class||"colVisSpan",o.contCssClass=n.cont_css_class||"colVisCont",o.listCssClass=s.list_css_class||"cols_checklist",o.listItemCssClass=s.checklist_item_css_class||"cols_checklist_item",o.listSlcItemCssClass=s.checklist_selected_item_css_class||"cols_checklist_slc_item",o.text=n.text||(o.tickToHide?"Hide: ":"Show: "),o.atStart=n.at_start||[],o.enableHover=Boolean(n.enable_hover),o.enableTickAll=Boolean(n.enable_tick_all),o.tickAllText=n.tick_all_text||"Select all:",o.hiddenCols=[],o.boundMouseup=null,o.onLoaded=(0,d.isFn)(n.on_loaded)?n.on_loaded:d.EMPTY_FN,o.onBeforeOpen=(0,d.isFn)(n.on_before_open)?n.on_before_open:d.EMPTY_FN,o.onAfterOpen=(0,d.isFn)(n.on_after_open)?n.on_after_open:d.EMPTY_FN,o.onBeforeClose=(0,d.isFn)(n.on_before_close)?n.on_before_close:d.EMPTY_FN,o.onAfterClose=(0,d.isFn)(n.on_after_close)?n.on_after_close:d.EMPTY_FN,o.onBeforeColHidden=(0,d.isFn)(n.on_before_col_hidden)?n.on_before_col_hidden:d.EMPTY_FN,o.onAfterColHidden=(0,d.isFn)(n.on_after_col_hidden)?n.on_after_col_hidden:d.EMPTY_FN,o.onBeforeColDisplayed=(0,d.isFn)(n.on_before_col_displayed)?n.on_before_col_displayed:d.EMPTY_FN,o.onAfterColDisplayed=(0,d.isFn)(n.on_after_col_displayed)?n.on_after_col_displayed:d.EMPTY_FN,e.gridLayout&&(o.headersTbl=e.feature("gridLayout").headTbl,o.headersIndex=0,o.onAfterColDisplayed=function(){},o.onAfterColHidden=function(){}),e.import(n.name+"Style",e.stylePath+o.stylesheet,null,"link"),o.enable(),o}return o(t,e),s(t,[{key:"onMouseup",value:function(e){for(var t=(0,c.targetEvt)(e);t&&t!==this.contEl&&t!==this.btnEl;)t=t.parentNode;t!==this.contEl&&t!==this.btnEl&&this.toggle()}},{key:"toggle",value:function(){(0,c.removeEvt)(u.root,"mouseup",this.boundMouseup);var e=this.contEl.style.display;"inline"!==e&&this.onBeforeOpen(this),"inline"===e&&this.onBeforeClose(this),this.contEl.style.display="inline"===e?"none":"inline","inline"!==e&&(this.onAfterOpen(this),(0,c.addEvt)(u.root,"mouseup",this.boundMouseup)),"inline"===e&&this.onAfterClose(this)}},{key:"checkItem",value:function(e){var t=e.parentNode;if(t&&e){var n=e.firstChild.checked,r=e.firstChild.getAttribute("id").split("_")[1];r=parseInt(r,10),n?(0,l.addClass)(t,this.listSlcItemCssClass):(0,l.removeClass)(t,this.listSlcItemCssClass);var i=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(i=!0),this.setHidden(r,i)}}},{key:"init",value:function(){var e=this;!this.initialized&&this.manager&&(this.emitter.on(["hide-column"],function(t,n){return e.hideCol(n)}),this.buildBtn(),this.buildManager(),this.initialized=!0,this.boundMouseup=this.onMouseup.bind(this),this.emitter.emit("columns-visibility-initialized",this.tf,this),this._hideAtStart())}},{key:"buildBtn",value:function(){var e=this;if(!this.btnEl){var t=this.tf,n=(0,l.createElm)("span");n.className=this.spanCssClass,this.btnTgtId||t.setToolbar();var r=this.btnTgtId?(0,l.elm)(this.btnTgtId):t.rDiv;if(this.btnTgtId)r.appendChild(n);else{var i=r.firstChild;i.parentNode.insertBefore(n,i)}if(this.btnHtml){n.innerHTML=this.btnHtml;var o=n.firstChild;this.enableHover?(0,c.addEvt)(o,"mouseover",function(t){return e.toggle(t)}):(0,c.addEvt)(o,"click",function(t){return e.toggle(t)})}else{var s=(0,l.createElm)("a",["href","javascript:;"]);s.className=this.btnCssClass,s.title=this.desc,s.innerHTML=this.btnText,n.appendChild(s),this.enableHover?(0,c.addEvt)(s,"mouseover",function(t){return e.toggle(t)}):(0,c.addEvt)(s,"click",function(t){return e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded(this)}}},{key:"buildManager",value:function(){var e=this,t=this.tf,n=this.contElTgtId?(0,l.elm)(this.contElTgtId):(0,l.createElm)("div");n.className=this.contCssClass;var r=(0,l.createElm)("p");r.innerHTML=this.text,n.appendChild(r);var i=(0,l.createElm)("ul");i.className=this.listCssClass;var o=this.headersTbl?this.headersTbl:t.dom(),s=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),a=o.rows[s];if(this.enableTickAll){var d=(0,l.createCheckItem)("col__"+t.id,this.tickAllText,this.tickAllText);(0,l.addClass)(d,this.listItemCssClass),i.appendChild(d),d.check.checked=!this.tickToHide,(0,c.addEvt)(d.check,"click",function(){for(var e=0;e<a.cells.length;e++){var n=(0,l.elm)("col_"+e+"_"+t.id);n&&d.check.checked!==n.checked&&(n.click(),n.checked=d.check.checked)}})}for(var u=0;u<a.cells.length;u++){var h=a.cells[u],f=this.headersText&&this.headersText[u]?this.headersText[u]:this._getHeaderText(h),p=(0,l.createCheckItem)("col_"+u+"_"+t.id,f,f);(0,l.addClass)(p,this.listItemCssClass),this.tickToHide||(0,l.addClass)(p,this.listSlcItemCssClass),i.appendChild(p),this.tickToHide||(p.check.checked=!0),(0,c.addEvt)(p.check,"click",function(t){var n=(0,c.targetEvt)(t),r=n.parentNode;e.checkItem(r)})}var b=(0,l.createElm)("p",["align","center"]),m=void 0;this.btnCloseHtml?(b.innerHTML=this.btnCloseHtml,m=b.firstChild,(0,c.addEvt)(m,"click",function(t){return e.toggle(t)})):(m=(0,l.createElm)("a",["href","javascript:;"]),m.className=this.btnCloseCssClass,m.innerHTML=this.btnCloseText,(0,c.addEvt)(m,"click",function(t){return e.toggle(t)}),b.appendChild(m)),n.appendChild(i),n.appendChild(b),this.btnEl.parentNode.insertBefore(n,this.btnEl),this.contEl=n}},{key:"setHidden",value:function(e,t){var n=this.tf,r=n.dom();t&&this.onBeforeColHidden(this,e),t||this.onBeforeColDisplayed(this,e),this._hideCells(r,e,t),this.headersTbl&&this._hideCells(this.headersTbl,e,t);var i=this.hiddenCols,o=i.indexOf(e);t?-1===o&&this.hiddenCols.push(e):-1!==o&&this.hiddenCols.splice(o,1);var s=void 0,a=void 0,l=void 0;if(t){if(n.gridLayout){s=n.feature("gridLayout"),a=s.headTbl,l=s.colElms;var d=parseInt(l[e].style.width,10),c=parseInt(a.style.width,10);a.style.width=c-d+"px",r.style.width=a.style.width}this.onAfterColHidden(this,e),this.emitter.emit("column-hidden",n,this,e,this.hiddenCols)}if(!t){if(n.gridLayout){s=n.feature("gridLayout"),a=s.headTbl,l=s.colElms;var u=parseInt(l[e].style.width,10);a.style.width=parseInt(a.style.width,10)+u+"px",n.dom().style.width=a.style.width}this.onAfterColDisplayed(this,e),this.emitter.emit("column-shown",n,this,e,this.hiddenCols)}}},{key:"showCol",value:function(e){if(void 0!==e&&this.isColHidden(e))if(this.manager&&this.contEl){var t=(0,l.elm)("col_"+e+"_"+this.tf.id);t&&t.click()}else this.setHidden(e,!1)}},{key:"hideCol",value:function(e){if(void 0!==e&&!this.isColHidden(e))if(this.manager&&this.contEl){var t=(0,l.elm)("col_"+e+"_"+this.tf.id);t&&t.click()}else this.setHidden(e,!0)}},{key:"isColHidden",value:function(e){return-1!==this.hiddenCols.indexOf(e)}},{key:"toggleCol",value:function(e){void 0===e||this.isColHidden(e)?this.showCol(e):this.hideCol(e)}},{key:"getHiddenCols",value:function(){return this.hiddenCols}},{key:"destroy",value:function(){var e=this;this.initialized&&((0,l.elm)(this.contElTgtId)?(0,l.elm)(this.contElTgtId).innerHTML="":(this.contEl.innerHTML="",(0,l.removeElm)(this.contEl),this.contEl=null),this.btnEl.innerHTML="",(0,l.removeElm)(this.btnEl),this.btnEl=null,this.emitter.off(["hide-column"],function(t,n){return e.hideCol(n)}),this.boundMouseup=null,this.initialized=!1)}},{key:"_getHeaderText",value:function(e){if(!e.hasChildNodes)return"";for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(3===n.nodeType)return n.nodeValue;if(1===n.nodeType){if(n.id&&-1!==n.id.indexOf("popUp"))continue;return(0,l.getText)(n)}}return""}},{key:"_hideCells",value:function(e,t,n){for(var r=0;r<e.rows.length;r++){var i=e.rows[r],o=i.cells[t];o&&(o.style.display=n?"none":"")}}},{key:"_hideAtStart",value:function(){var e=this;this.atStart.forEach(function(t){e.hideCol(t)})}}]),t}(a.Feature);t.default=h},444:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),l=n(9),d=n(6),c=n(17),u=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n.name));return o.name=n.name,o.desc=n.description||"Filters row visibility manager",o.stylesheet=n.stylesheet||"filtersVisibility.css",o.icnExpand=n.expand_icon_name||"icn_exp.png",o.icnCollapse=n.collapse_icon_name||"icn_clp.png",o.contEl=null,o.btnEl=null,o.icnExpandHtml='<img src="'+e.themesPath+o.icnExpand+'" alt="Expand filters" >',o.icnCollapseHtml='<img src="'+e.themesPath+o.icnCollapse+'" alt="Collapse filters" >',o.defaultText="Toggle filters",o.targetId=n.target_id||null,o.enableIcon=!1!==n.enable_icon,o.btnText=n.btn_text||"",o.collapseBtnHtml=o.enableIcon?o.icnCollapseHtml+o.btnText:o.btnText||o.defaultText,o.expandBtnHtml=o.enableIcon?o.icnExpandHtml+o.btnText:o.btnText||o.defaultText,o.btnHtml=n.btn_html||null,o.btnCssClass=n.btn_css_class||"btnExpClpFlt",o.contCssClass=n.cont_css_class||"expClpFlt",o.filtersRowIndex=(0,d.isUndef)(n.filters_row_index)?e.getFiltersRowIndex():n.filters_row_index,o.visibleAtStart=!!(0,d.isUndef)(n.visible_at_start)||Boolean(n.visible_at_start),o.onBeforeShow=(0,d.isFn)(n.on_before_show)?n.on_before_show:d.EMPTY_FN,o.onAfterShow=(0,d.isFn)(n.on_after_show)?n.on_after_show:d.EMPTY_FN,o.onBeforeHide=(0,d.isFn)(n.on_before_hide)?n.on_before_hide:d.EMPTY_FN,o.onAfterHide=(0,d.isFn)(n.on_after_hide)?n.on_after_hide:d.EMPTY_FN,e.import(n.name+"Style",e.stylePath+o.stylesheet,null,"link"),o.enable(),o}return o(t,e),s(t,[{key:"init",value:function(){var e=this;this.initialized||(this.buildUI(),this.initialized=!0,this.emitter.on(["show-filters"],function(t,n){return e.show(n)}),this.emitter.emit("filters-visibility-initialized",this.tf,this))}},{key:"buildUI",value:function(){var e=this,t=this.tf,n=(0,l.createElm)("span");n.className=this.contCssClass,this.targetId||t.setToolbar();var r=this.targetId?(0,l.elm)(this.targetId):t.rDiv;if(this.targetId)r.appendChild(n);else{var i=r.firstChild;i.parentNode.insertBefore(n,i)}var o=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,o=n.firstChild):(o=(0,l.createElm)("a",["href","javascript:void(0);"]),o.className=this.btnCssClass,o.title=this.btnText||this.defaultText,o.innerHTML=this.collapseBtnHtml,n.appendChild(o)),(0,c.addEvt)(o,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=o,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function(){var e=this.tf,t=e.gridLayout?e.feature("gridLayout").headTbl:e.dom(),n=t.rows[this.filtersRowIndex],r=""===n.style.display;this.show(!r)}},{key:"show",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.tf,n=t.gridLayout?t.feature("gridLayout").headTbl:t.dom(),r=n.rows[this.filtersRowIndex];e&&this.onBeforeShow(this),e||this.onBeforeHide(this),r.style.display=e?"":"none",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=e?this.collapseBtnHtml:this.expandBtnHtml),e&&this.onAfterShow(this),e||this.onAfterHide(this),this.emitter.emit("filters-toggled",t,this,e)}},{key:"destroy",value:function(){var e=this;this.initialized&&(this.emitter.off(["show-filters"],function(t,n){return e.show(n)}),this.btnEl.innerHTML="",(0,l.removeElm)(this.btnEl),this.btnEl=null,this.contEl.innerHTML="",(0,l.removeElm)(this.contEl),this.contEl=null,this.initialized=!1)}}]),t}(a.Feature);t.default=u},445:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(440),i=function(e){return e&&e.__esModule?e:{default:e}}(r);n(15).root.SortableTable||n(449),t.default=i.default},446:function(e,t){function n(e){function t(t,n){if(n=n||{},!t&&0!==t)return"";t=""+t;var d=[],c="-"===t.charAt(0);return t=t.replace(/^\-/g,""),e.negativeLeftOut||n.noUnits||d.push(e.prefix),c&&d.push(e.negativeLeftSymbol),e.negativeLeftOut&&!n.noUnits&&d.push(e.prefix),t=t.split("."),null!=e.round&&l(t,e.round),null!=e.truncate&&(t[1]=a(t[1],e.truncate)),e.padLeft>0&&(t[0]=o(t[0],e.padLeft)),e.padRight>0&&(t[1]=s(t[1],e.padRight)),!n.noSeparator&&t[1]&&(t[1]=i(t[1],e.decimalsSeparator)),!n.noSeparator&&t[0]&&(t[0]=r(t[0],e.integerSeparator)),d.push(t[0]),t[1]&&(d.push(e.decimal),d.push(t[1])),e.negativeRightOut&&!n.noUnits&&d.push(e.suffix),c&&d.push(e.negativeRightSymbol),e.negativeRightOut||n.noUnits||d.push(e.suffix),d.join("")}function n(t,n){n=n||[],e.allowedSeparators&&e.allowedSeparators.forEach(function(e){n.push(e)}),n.push(e.integerSeparator),n.push(e.decimalsSeparator),t=t.replace(e.prefix,""),t=t.replace(e.suffix,"");var r=t;do{t=r;for(var i=0;i<n.length;i++)r=r.replace(n[i],"")}while(r!=t);return t}if(e=e||{},e.negativeType=e.negativeType||("R"===e.negative?"right":"left"),"string"!=typeof e.negativeLeftSymbol)switch(e.negativeType){case"left":e.negativeLeftSymbol="-";break;case"brackets":e.negativeLeftSymbol="(";break;default:e.negativeLeftSymbol=""}if("string"!=typeof e.negativeRightSymbol)switch(e.negativeType){case"right":e.negativeRightSymbol="-";break;case"brackets":e.negativeRightSymbol=")";break;default:e.negativeRightSymbol=""}return"boolean"!=typeof e.negativeLeftOut&&(e.negativeLeftOut=!1!==e.negativeOut),"boolean"!=typeof e.negativeRightOut&&(e.negativeRightOut=!1!==e.negativeOut),e.prefix=e.prefix||"",e.suffix=e.suffix||"","string"!=typeof e.integerSeparator&&(e.integerSeparator="string"==typeof e.separator?e.separator:","),e.decimalsSeparator="string"==typeof e.decimalsSeparator?e.decimalsSeparator:"",e.decimal=e.decimal||".",e.padLeft=e.padLeft||-1,e.padRight=e.padRight||-1,t.negative=e.negative,t.negativeOut=e.negativeOut,t.negativeType=e.negativeType,t.negativeLeftOut=e.negativeLeftOut,t.negativeLeftSymbol=e.negativeLeftSymbol,t.negativeRightOut=e.negativeRightOut,t.negativeRightSymbol=e.negativeRightSymbol,t.prefix=e.prefix,t.suffix=e.suffix,t.separate=e.separate,t.integerSeparator=e.integerSeparator,t.decimalsSeparator=e.decimalsSeparator,t.decimal=e.decimal,t.padLeft=e.padLeft,t.padRight=e.padRight,t.truncate=e.truncate,t.round=e.round,t.unformat=n,t}function r(e,t){if(e+="",!t)return e;for(var n=/(\d+)(\d{3})/;n.test(e);)e=e.replace(n,"$1"+t+"$2");return e}function i(e,t){if(e+="",!t)return e;for(var n=/(\d{3})(\d+)/;n.test(e);)e=e.replace(n,"$1"+t+"$2");return e}function o(e,t){e+="";for(var n=[];n.length+e.length<t;)n.push("0");return n.join("")+e}function s(e,t){e?e+="":e="";for(var n=[];n.length+e.length<t;)n.push("0");return e+n.join("")}function a(e,t){return e&&(e+=""),e&&e.length>t?e.substr(0,t):e}function l(e,t){if(e[1]&&t>=0&&e[1].length>t){var n=e[1].slice(0,t);if(+e[1].substr(t,1)>=5){for(var r="";"0"===n.charAt(0);)r+="0",n=n.substr(1);n=+n+1+"",n=r+n,n.length>t&&(e[0]=+e[0]+ +n.charAt(0)+"",n=n.substring(1))}e[1]=n}return e}e.exports=n},447:function(e,t){e.exports='/*----------------------------------------------------------------------------\\\r\n| Sortable Table 1.12 |\r\n|-----------------------------------------------------------------------------|\r\n| Created by Erik Arvidsson |\r\n| (http://webfx.eae.net/contact.html#erik) |\r\n| For WebFX (http://webfx.eae.net/) |\r\n|-----------------------------------------------------------------------------|\r\n| A DOM 1 based script that allows an ordinary HTML table to be sortable. |\r\n|-----------------------------------------------------------------------------|\r\n| Copyright (c) 1998 - 2006 Erik Arvidsson |\r\n|-----------------------------------------------------------------------------|\r\n| Licensed under the Apache License, Version 2.0 (the "License"); you may not |\r\n| use this file except in compliance with the License. You may obtain a copy |\r\n| of the License at http://www.apache.org/licenses/LICENSE-2.0 |\r\n| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |\r\n| Unless required by applicable law or agreed to in writing, software |\r\n| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |\r\n| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |\r\n| License for the specific language governing permissions and limitations |\r\n| under the License. |\r\n|-----------------------------------------------------------------------------|\r\n| 2003-01-10 | First version |\r\n| 2003-01-19 | Minor changes to the date parsing |\r\n| 2003-01-28 | JScript 5.0 fixes (no support for \'in\' operator) |\r\n| 2003-02-01 | Sloppy typo like error fixed in getInnerText |\r\n| 2003-07-04 | Added workaround for IE cellIndex bug. |\r\n| 2003-11-09 | The bDescending argument to sort was not correctly working |\r\n| | Using onclick DOM0 event if no support for addEventListener |\r\n| | or attachEvent |\r\n| 2004-01-13 | Adding addSortType and removeSortType which makes it a lot |\r\n| | easier to add new, custom sort types. |\r\n| 2004-01-27 | Switch to use descending = false as the default sort order. |\r\n| | Change defaultDescending to suit your needs. |\r\n| 2004-03-14 | Improved sort type None look and feel a bit |\r\n| 2004-08-26 | Made the handling of tBody and tHead more flexible. Now you |\r\n| | can use another tHead or no tHead, and you can chose some |\r\n| | other tBody. |\r\n| 2006-04-25 | Changed license to Apache Software License 2.0 |\r\n|-----------------------------------------------------------------------------|\r\n| Created 2003-01-10 | All changes are in the log above. | Updated 2006-04-25 |\r\n\\----------------------------------------------------------------------------*/\r\n\r\n\r\nfunction SortableTable(oTable, oSortTypes) {\r\n\r\n\tthis.sortTypes = oSortTypes || [];\r\n\r\n\tthis.sortColumn = null;\r\n\tthis.descending = null;\r\n\r\n\tvar oThis = this;\r\n\tthis._headerOnclick = function (e) {\r\n\t\toThis.headerOnclick(e);\r\n\t};\r\n\r\n\tif (oTable) {\r\n\t\tthis.setTable( oTable );\r\n\t\tthis.document = oTable.ownerDocument || oTable.document;\r\n\t}\r\n\telse {\r\n\t\tthis.document = document;\r\n\t}\r\n\r\n\r\n\t// only IE needs this\r\n\tvar win = this.document.defaultView || this.document.parentWindow;\r\n\tthis._onunload = function () {\r\n\t\toThis.destroy();\r\n\t};\r\n\tif (win && typeof win.attachEvent != "undefined") {\r\n\t\twin.attachEvent("onunload", this._onunload);\r\n\t}\r\n}\r\n\r\nSortableTable.gecko = navigator.product == "Gecko";\r\nSortableTable.msie = /msie/i.test(navigator.userAgent);\r\n// Mozilla is faster when doing the DOM manipulations on\r\n// an orphaned element. MSIE is not\r\nSortableTable.removeBeforeSort = SortableTable.gecko;\r\n\r\nSortableTable.prototype.onsort = function () {};\r\n\r\n// default sort order. true -> descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.element = oTable;\r\n\tthis.setTHead( oTable.tHead );\r\n\tthis.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n\tif (this.tHead && this.tHead != oTHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.tHead = oTHead;\r\n\tthis.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n\tthis.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tif ( this.tHead )\r\n\t\tthis.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar doc = this.tHead.ownerDocument || this.tHead.document;\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tvar l = cells.length;\r\n\tvar img, c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n\t\t\timg = doc.createElement("IMG");\r\n\t\t\timg.src = "images/blank.png";\r\n\t\t\tc.appendChild(img);\r\n\t\t\tif (this.sortTypes[i] != null)\r\n\t\t\t\tc._sortType = this.sortTypes[i];\r\n\t\t\tif (typeof c.addEventListener != "undefined")\r\n\t\t\t\tc.addEventListener("click", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.attachEvent != "undefined")\r\n\t\t\t\tc.attachEvent("onclick", this._headerOnclick);\r\n\t\t\telse\r\n\t\t\t\tc.onclick = this._headerOnclick;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tc.setAttribute( "_sortType", oSortTypes[i] );\r\n\t\t\tc._sortType = "None";\r\n\t\t}\r\n\t}\r\n\tthis.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (c._sortType != null && c._sortType != "None") {\r\n\t\t\tc.removeChild(c.lastChild);\r\n\t\t\tif (typeof c.removeEventListener != "undefined")\r\n\t\t\t\tc.removeEventListener("click", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.detachEvent != "undefined")\r\n\t\t\t\tc.detachEvent("onclick", this._headerOnclick);\r\n\t\t\tc._sortType = null;\r\n\t\t\tc.removeAttribute( "_sortType" );\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar img;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tif (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n\t\t\timg = cells[i].lastChild;\r\n\t\t\tif (i == this.sortColumn)\r\n\t\t\t\timg.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n\t\t\telse\r\n\t\t\t\timg.className = "sort-arrow";\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n\t// find TD element\r\n\tvar el = e.target || e.srcElement;\r\n\twhile (el.tagName != "TD")\r\n\t\tel = el.parentNode;\r\n\r\n\tthis.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n\tvar cells = oTd.parentNode.childNodes\r\n\tvar l = cells.length;\r\n\tvar i;\r\n\tfor (i = 0; cells[i] != oTd && i < l; i++)\r\n\t\t;\r\n\treturn i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n\treturn this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n\tif (!this.tBody) return;\r\n\tif (sSortType == null)\r\n\t\tsSortType = this.getSortType(nColumn);\r\n\r\n\t// exit if None\r\n\tif (sSortType == "None")\r\n\t\treturn;\r\n\r\n\tif (bDescending == null) {\r\n\t\tif (this.sortColumn != nColumn)\r\n\t\t\tthis.descending = this.defaultDescending;\r\n\t\telse\r\n\t\t\tthis.descending = !this.descending;\r\n\t}\r\n\telse\r\n\t\tthis.descending = bDescending;\r\n\r\n\tthis.sortColumn = nColumn;\r\n\r\n\tif (typeof this.onbeforesort == "function")\r\n\t\tthis.onbeforesort();\r\n\r\n\tvar f = this.getSortFunction(sSortType, nColumn);\r\n\tvar a = this.getCache(sSortType, nColumn);\r\n\tvar tBody = this.tBody;\r\n\r\n\ta.sort(f);\r\n\r\n\tif (this.descending)\r\n\t\ta.reverse();\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// remove from doc\r\n\t\tvar nextSibling = tBody.nextSibling;\r\n\t\tvar p = tBody.parentNode;\r\n\t\tp.removeChild(tBody);\r\n\t}\r\n\r\n\t// insert in the new order\r\n\tvar l = a.length;\r\n\tfor (var i = 0; i < l; i++)\r\n\t\ttBody.appendChild(a[i].element);\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// insert into doc\r\n\t\tp.insertBefore(tBody, nextSibling);\r\n\t}\r\n\r\n\tthis.updateHeaderArrows();\r\n\r\n\tthis.destroyCache(a);\r\n\r\n\tif (typeof this.onsort == "function")\r\n\t\tthis.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n\tvar oThis = this;\r\n\tthis._asyncsort = function () {\r\n\t\toThis.sort(nColumn, bDescending, sSortType);\r\n\t};\r\n\twindow.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n\tif (!this.tBody) return [];\r\n\tvar rows = this.tBody.rows;\r\n\tvar l = rows.length;\r\n\tvar a = new Array(l);\r\n\tvar r;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tr = rows[i];\r\n\t\ta[i] = {\r\n\t\t\tvalue:\t\tthis.getRowValue(r, sType, nColumn),\r\n\t\t\telement:\tr\r\n\t\t};\r\n\t};\r\n\treturn a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n\tvar l = oArray.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\toArray[i].value = null;\r\n\t\toArray[i].element = null;\r\n\t\toArray[i] = null;\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n\t// if we have defined a custom getRowValue use that\r\n\tif (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n\t\treturn this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n\tvar s;\r\n\tvar c = oRow.cells[nColumn];\r\n\tif (typeof c.innerText != "undefined")\r\n\t\ts = c.innerText;\r\n\telse\r\n\t\ts = SortableTable.getInnerText(c);\r\n\treturn this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n\tvar s = "";\r\n\tvar cs = oNode.childNodes;\r\n\tvar l = cs.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tswitch (cs[i].nodeType) {\r\n\t\t\tcase 1: //ELEMENT_NODE\r\n\t\t\t\ts += SortableTable.getInnerText(cs[i]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\t//TEXT_NODE\r\n\t\t\t\ts += cs[i].nodeValue;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].getValueFromString( sText );\r\n\treturn sText;\r\n\t/*\r\n\tswitch (sType) {\r\n\t\tcase "Number":\r\n\t\t\treturn Number(sText);\r\n\t\tcase "CaseInsensitiveString":\r\n\t\t\treturn sText.toUpperCase();\r\n\t\tcase "Date":\r\n\t\t\tvar parts = sText.split("-");\r\n\t\t\tvar d = new Date(0);\r\n\t\t\td.setFullYear(parts[0]);\r\n\t\t\td.setDate(parts[2]);\r\n\t\t\td.setMonth(parts[1] - 1);\r\n\t\t\treturn d.valueOf();\r\n\t}\r\n\treturn sText;\r\n\t*/\r\n\t};\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].compare;\r\n\treturn SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n\tthis.uninitHeader();\r\n\tvar win = this.document.parentWindow;\r\n\tif (win && typeof win.detachEvent != "undefined") {\t// only IE needs this\r\n\t\twin.detachEvent("onunload", this._onunload);\r\n\t}\r\n\tthis._onunload = null;\r\n\tthis.element = null;\r\n\tthis.tHead = null;\r\n\tthis.tBody = null;\r\n\tthis.document = null;\r\n\tthis._headerOnclick = null;\r\n\tthis.sortTypes = null;\r\n\tthis._asyncsort = null;\r\n\tthis.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n\tthis._sortTypeInfo[sType] = {\r\n\t\ttype:\t\t\t\tsType,\r\n\t\tgetValueFromString:\tfGetValueFromString || SortableTable.idFunction,\r\n\t\tcompare:\t\t\tfCompareFunction || SortableTable.basicCompare,\r\n\t\tgetRowValue:\t\tfGetRowValue\r\n\t};\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n\tdelete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n\tif (n1.value < n2.value)\r\n\t\treturn -1;\r\n\tif (n2.value < n1.value)\r\n\t\treturn 1;\r\n\treturn 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n\treturn x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n\treturn s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n\tvar parts = s.split("-");\r\n\tvar d = new Date(0);\r\n\td.setFullYear(parts[0]);\r\n\td.setDate(parts[2]);\r\n\td.setMonth(parts[1] - 1);\r\n\treturn d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'},448:function(e,t){e.exports=function(e){"undefined"!=typeof execScript?execScript(e):eval.call(null,e)}},449:function(e,t,n){n(448)(n(447))}});
//# sourceMappingURL=tf-0-4230fc9b49f13cb9eb22.js.map