')
- .css(blockerCSS)
- .css('right', 0)
- .addClass(this.classes.rightBottomBlocker),
- rightTopBlocker: $('
')
- .css(blockerCSS)
- .css({
- right: 0,
- top: 0
- })
- .addClass(this.classes.rightTopBlocker)
- };
- if (this.s.dt.settings()[0]._bInitComplete) {
- // Fixed Columns Initialisation
- this._addStyles();
- this._setKeyTableListener();
- }
- else {
- table.one('init.dt', function () {
- // Fixed Columns Initialisation
- _this._addStyles();
- _this._setKeyTableListener();
- });
- }
- table.on('column-sizing.dt', function () { return _this._addStyles(); });
- // Make class available through dt object
- table.settings()[0]._fixedColumns = this;
- return this;
- }
- /**
- * Getter/Setter for the `fixedColumns.left` property
- *
- * @param newVal Optional. If present this will be the new value for the number of left fixed columns
- * @returns The number of left fixed columns
- */
- FixedColumns.prototype.left = function (newVal) {
- // If the value is to change
- if (newVal !== undefined) {
- // Set the new values and redraw the columns
- this.c.left = newVal;
- this._addStyles();
- }
- return this.c.left;
- };
- /**
- * Getter/Setter for the `fixedColumns.left` property
- *
- * @param newVal Optional. If present this will be the new value for the number of right fixed columns
- * @returns The number of right fixed columns
- */
- FixedColumns.prototype.right = function (newVal) {
- // If the value is to change
- if (newVal !== undefined) {
- // Set the new values and redraw the columns
- this.c.right = newVal;
- this._addStyles();
- }
- return this.c.right;
- };
- /**
- * Iterates over the columns, fixing the appropriate ones to the left and right
- */
- FixedColumns.prototype._addStyles = function () {
- // Set the bar width if vertical scrolling is enabled
- if (this.s.dt.settings()[0].oScroll.sY) {
- var scroll_1 = $(this.s.dt.table().node()).closest('div.dataTables_scrollBody')[0];
- var barWidth = this.s.dt.settings()[0].oBrowser.barWidth;
- if (scroll_1.offsetWidth - scroll_1.clientWidth >= barWidth) {
- this.s.barWidth = barWidth;
- }
- else {
- this.s.barWidth = 0;
- }
- this.dom.rightTopBlocker.css('width', this.s.barWidth + 1);
- this.dom.leftTopBlocker.css('width', this.s.barWidth + 1);
- this.dom.rightBottomBlocker.css('width', this.s.barWidth + 1);
- this.dom.leftBottomBlocker.css('width', this.s.barWidth + 1);
- }
- var parentDiv = null;
- // Get the header and it's height
- var header = this.s.dt.column(0).header();
- var headerHeight = null;
- if (header !== null) {
- header = $(header);
- headerHeight = header.outerHeight() + 1;
- parentDiv = $(header.closest('div.dataTables_scroll')).css('position', 'relative');
- }
- // Get the footer and it's height
- var footer = this.s.dt.column(0).footer();
- var footerHeight = null;
- if (footer !== null) {
- footer = $(footer);
- footerHeight = footer.outerHeight();
- // Only attempt to retrieve the parentDiv if it has not been retrieved already
- if (parentDiv === null) {
- parentDiv = $(footer.closest('div.dataTables_scroll')).css('position', 'relative');
- }
- }
- // Get the number of columns in the table - this is used often so better to only make 1 api call
- var numCols = this.s.dt.columns().data().toArray().length;
- // Tracker for the number of pixels should be left to the left of the table
- var distLeft = 0;
- // Sometimes the headers have slightly different widths so need to track them individually
- var headLeft = 0;
- // Get all of the row elements in the table
- var rows = $(this.s.dt.table().node()).children('tbody').children('tr');
- var invisibles = 0;
- // When working from right to left we need to know how many are invisible before a point,
- // without including those that are invisible after
- var prevInvisible = new Map();
- // Iterate over all of the columns
- for (var i = 0; i < numCols; i++) {
- var column = this.s.dt.column(i);
- // Set the map for the previous column
- if (i > 0) {
- prevInvisible.set(i - 1, invisibles);
- }
- if (!column.visible()) {
- invisibles++;
- continue;
- }
- // Get the columns header and footer element
- var colHeader = $(column.header());
- var colFooter = $(column.footer());
- // If i is less than the value of left then this column should be fixed left
- if (i - invisibles < this.c.left) {
- $(this.s.dt.table().node()).addClass(this.classes.tableFixedLeft);
- parentDiv.addClass(this.classes.tableFixedLeft);
- // Add the width of the previous node - only if we are on atleast the second column
- if (i - invisibles > 0) {
- var prevIdx = i;
- // Simply using the number of hidden columns doesn't work here,
- // if the first is hidden then this would be thrown off
- while (prevIdx + 1 < numCols) {
- var prevCol = this.s.dt.column(prevIdx - 1, { page: 'current' });
- if (prevCol.visible()) {
- distLeft += $(prevCol.nodes()[0]).outerWidth();
- headLeft += prevCol.header() ?
- $(prevCol.header()).outerWidth() :
- prevCol.footer() ?
- $(prevCol.header()).outerWidth() :
- 0;
- break;
- }
- prevIdx--;
- }
- }
- // Iterate over all of the rows, fixing the cell to the left
- for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
- var row = rows_1[_i];
- $($(row).children()[i - invisibles])
- .css(this._getCellCSS(false, distLeft, 'left'))
- .addClass(this.classes.fixedLeft);
- }
- // Add the css for the header and the footer
- colHeader
- .css(this._getCellCSS(true, headLeft, 'left'))
- .addClass(this.classes.fixedLeft);
- colFooter
- .css(this._getCellCSS(true, headLeft, 'left'))
- .addClass(this.classes.fixedLeft);
- }
- else {
- // Iteriate through all of the rows, making sure they aren't currently trying to fix left
- for (var _a = 0, rows_2 = rows; _a < rows_2.length; _a++) {
- var row = rows_2[_a];
- var cell = $($(row).children()[i - invisibles]);
- // If the cell is trying to fix to the left, remove the class and the css
- if (cell.hasClass(this.classes.fixedLeft)) {
- cell
- .css(this._clearCellCSS('left'))
- .removeClass(this.classes.fixedLeft);
- }
- }
- // Make sure the header for this column isn't fixed left
- if (colHeader.hasClass(this.classes.fixedLeft)) {
- colHeader
- .css(this._clearCellCSS('left'))
- .removeClass(this.classes.fixedLeft);
- }
- // Make sure the footer for this column isn't fixed left
- if (colFooter.hasClass(this.classes.fixedLeft)) {
- colFooter
- .css(this._clearCellCSS('left'))
- .removeClass(this.classes.fixedLeft);
- }
- }
- }
- // If there is a header with the index class and reading rtl then add left top blocker
- if (header !== null && !header.hasClass('index')) {
- if (this.s.rtl) {
- this.dom.leftTopBlocker.outerHeight(headerHeight);
- parentDiv.append(this.dom.leftTopBlocker);
- }
- else {
- this.dom.rightTopBlocker.outerHeight(headerHeight);
- parentDiv.append(this.dom.rightTopBlocker);
- }
- }
- // If there is a footer with the index class and reading rtl then add left bottom blocker
- if (footer !== null && !footer.hasClass('index')) {
- if (this.s.rtl) {
- this.dom.leftBottomBlocker.outerHeight(footerHeight);
- parentDiv.append(this.dom.leftBottomBlocker);
- }
- else {
- this.dom.rightBottomBlocker.outerHeight(footerHeight);
- parentDiv.append(this.dom.rightBottomBlocker);
- }
- }
- var distRight = 0;
- var headRight = 0;
- // Counter for the number of invisible columns so far
- var rightInvisibles = 0;
- for (var i = numCols - 1; i >= 0; i--) {
- var column = this.s.dt.column(i);
- // If a column is invisible just skip it
- if (!column.visible()) {
- rightInvisibles++;
- continue;
- }
- // Get the columns header and footer element
- var colHeader = $(column.header());
- var colFooter = $(column.footer());
- // Get the number of visible columns that came before this one
- var prev = prevInvisible.get(i);
- if (prev === undefined) {
- // If it wasn't set then it was the last column so just use the final value
- prev = invisibles;
- }
- if (i + rightInvisibles >= numCols - this.c.right) {
- $(this.s.dt.table().node()).addClass(this.classes.tableFixedRight);
- parentDiv.addClass(this.classes.tableFixedRight);
- // Add the widht of the previous node, only if we are on atleast the second column
- if (i + 1 + rightInvisibles < numCols) {
- var prevIdx = i;
- // Simply using the number of hidden columns doesn't work here,
- // if the first is hidden then this would be thrown off
- while (prevIdx + 1 < numCols) {
- var prevCol = this.s.dt.column(prevIdx + 1, { page: 'current' });
- if (prevCol.visible()) {
- distRight += $(prevCol.nodes()[0]).outerWidth();
- headRight += prevCol.header() ?
- $(prevCol.header()).outerWidth() :
- prevCol.footer() ?
- $(prevCol.header()).outerWidth() :
- 0;
- break;
- }
- prevIdx++;
- }
- }
- // Iterate over all of the rows, fixing the cell to the right
- for (var _b = 0, rows_3 = rows; _b < rows_3.length; _b++) {
- var row = rows_3[_b];
- $($(row).children()[i - prev])
- .css(this._getCellCSS(false, distRight, 'right'))
- .addClass(this.classes.fixedRight);
- }
- // Add the css for the header and the footer
- colHeader
- .css(this._getCellCSS(true, headRight, 'right'))
- .addClass(this.classes.fixedRight);
- colFooter
- .css(this._getCellCSS(true, headRight, 'right'))
- .addClass(this.classes.fixedRight);
- }
- else {
- // Iteriate through all of the rows, making sure they aren't currently trying to fix right
- for (var _c = 0, rows_4 = rows; _c < rows_4.length; _c++) {
- var row = rows_4[_c];
- var cell = $($(row).children()[i - prev]);
- // If the cell is trying to fix to the right, remove the class and the css
- if (cell.hasClass(this.classes.fixedRight)) {
- cell
- .css(this._clearCellCSS('right'))
- .removeClass(this.classes.fixedRight);
- }
- }
- // Make sure the header for this column isn't fixed right
- if (colHeader.hasClass(this.classes.fixedRight)) {
- colHeader
- .css(this._clearCellCSS('right'))
- .removeClass(this.classes.fixedRight);
- }
- // Make sure the footer for this column isn't fixed right
- if (colFooter.hasClass(this.classes.fixedRight)) {
- colFooter
- .css(this._clearCellCSS('right'))
- .removeClass(this.classes.fixedRight);
- }
- }
- }
- // If there is a header with the index class and reading rtl then add right top blocker
- if (header) {
- if (!this.s.rtl) {
- this.dom.rightTopBlocker.outerHeight(headerHeight);
- parentDiv.append(this.dom.rightTopBlocker);
- }
- else {
- this.dom.leftTopBlocker.outerHeight(headerHeight);
- parentDiv.append(this.dom.leftTopBlocker);
- }
- }
- // If there is a footer with the index class and reading rtl then add right bottom blocker
- if (footer) {
- if (!this.s.rtl) {
- this.dom.rightBottomBlocker.outerHeight(footerHeight);
- parentDiv.append(this.dom.rightBottomBlocker);
- }
- else {
- this.dom.leftBottomBlocker.outerHeight(footerHeight);
- parentDiv.append(this.dom.leftBottomBlocker);
- }
- }
- };
- /**
- * Gets the correct CSS for the cell, header or footer based on options provided
- *
- * @param header Whether this cell is a header or a footer
- * @param dist The distance that the cell should be moved away from the edge
- * @param lr Indicator of fixing to the left or the right
- * @returns An object containing the correct css
- */
- FixedColumns.prototype._getCellCSS = function (header, dist, lr) {
- if (lr === 'left') {
- return this.s.rtl
- ? {
- position: 'sticky',
- right: dist + 'px'
- }
- : {
- left: dist + 'px',
- position: 'sticky'
- };
- }
- else {
- return this.s.rtl
- ? {
- left: dist + (header ? this.s.barWidth : 0) + 'px',
- position: 'sticky'
- }
- : {
- position: 'sticky',
- right: dist + (header ? this.s.barWidth : 0) + 'px'
- };
- }
- };
- /**
- * Gets the css that is required to clear the fixing to a side
- *
- * @param lr Indicator of fixing to the left or the right
- * @returns An object containing the correct css
- */
- FixedColumns.prototype._clearCellCSS = function (lr) {
- if (lr === 'left') {
- return !this.s.rtl ?
- {
- left: '',
- position: ''
- } :
- {
- position: '',
- right: ''
- };
- }
- else {
- return !this.s.rtl ?
- {
- position: '',
- right: ''
- } :
- {
- left: '',
- position: ''
- };
- }
- };
- FixedColumns.prototype._setKeyTableListener = function () {
- var _this = this;
- this.s.dt.on('key-focus', function (e, dt, cell) {
- var cellPos = $(cell.node()).offset();
- var scroll = $($(_this.s.dt.table().node()).closest('div.dataTables_scrollBody'));
- // If there are fixed columns to the left
- if (_this.c.left > 0) {
- // Get the rightmost left fixed column header, it's position and it's width
- var rightMost = $(_this.s.dt.column(_this.c.left - 1).header());
- var rightMostPos = rightMost.offset();
- var rightMostWidth = rightMost.outerWidth();
- // If the current highlighted cell is left of the rightmost cell on the screen
- if (cellPos.left < rightMostPos.left + rightMostWidth) {
- // Scroll it into view
- var currScroll = scroll.scrollLeft();
- scroll.scrollLeft(currScroll - (rightMostPos.left + rightMostWidth - cellPos.left));
- }
- }
- // If there are fixed columns to the right
- if (_this.c.right > 0) {
- // Get the number of columns and the width of the cell as doing right side calc
- var numCols = _this.s.dt.columns().data().toArray().length;
- var cellWidth = $(cell.node()).outerWidth();
- // Get the leftmost right fixed column header and it's position
- var leftMost = $(_this.s.dt.column(numCols - _this.c.right).header());
- var leftMostPos = leftMost.offset();
- // If the current highlighted cell is right of the leftmost cell on the screen
- if (cellPos.left + cellWidth > leftMostPos.left) {
- // Scroll it into view
- var currScroll = scroll.scrollLeft();
- scroll.scrollLeft(currScroll - (leftMostPos.left - (cellPos.left + cellWidth)));
- }
- }
- });
- // Whenever a draw occurs there is potential for the data to have changed and therefore also the column widths
- // Therefore it is necessary to recalculate the values for the fixed columns
- this.s.dt.on('draw', function () {
- _this._addStyles();
- });
- this.s.dt.on('column-reorder', function () {
- _this._addStyles();
- });
- this.s.dt.on('column-visibility', function (e, settings, column, state, recalc) {
- if (recalc && !settings.bDestroying) {
- setTimeout(function () {
- _this._addStyles();
- }, 50);
- }
- });
- };
- FixedColumns.version = '4.1.0';
- FixedColumns.classes = {
- fixedLeft: 'dtfc-fixed-left',
- fixedRight: 'dtfc-fixed-right',
- leftBottomBlocker: 'dtfc-left-bottom-blocker',
- leftTopBlocker: 'dtfc-left-top-blocker',
- rightBottomBlocker: 'dtfc-right-bottom-blocker',
- rightTopBlocker: 'dtfc-right-top-blocker',
- tableFixedLeft: 'dtfc-has-left',
- tableFixedRight: 'dtfc-has-right'
- };
- FixedColumns.defaults = {
- i18n: {
- button: 'FixedColumns'
- },
- left: 1,
- right: 0
- };
- return FixedColumns;
- }());
-
- /*! FixedColumns 4.1.0
- * 2019-2022 SpryMedia Ltd - datatables.net/license
- */
- // DataTables extensions common UMD. Note that this allows for AMD, CommonJS
- // (with window and jQuery being allowed as parameters to the returned
- // function) or just default browser loading.
- (function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net'], function ($) {
- return factory($, window, document);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net')(root, $).$;
- }
- return factory($, root, root.document);
- };
- }
- else {
- // Browser - assume jQuery has already been loaded
- factory(window.jQuery, window, document);
- }
- }(function ($, window, document) {
- setJQuery($);
- var dataTable = $.fn.dataTable;
- $.fn.dataTable.FixedColumns = FixedColumns;
- $.fn.DataTable.FixedColumns = FixedColumns;
- var apiRegister = $.fn.dataTable.Api.register;
- apiRegister('fixedColumns()', function () {
- return this;
- });
- apiRegister('fixedColumns().left()', function (newVal) {
- var ctx = this.context[0];
- if (newVal !== undefined) {
- ctx._fixedColumns.left(newVal);
- return this;
- }
- else {
- return ctx._fixedColumns.left();
- }
- });
- apiRegister('fixedColumns().right()', function (newVal) {
- var ctx = this.context[0];
- if (newVal !== undefined) {
- ctx._fixedColumns.right(newVal);
- return this;
- }
- else {
- return ctx._fixedColumns.right();
- }
- });
- $.fn.dataTable.ext.buttons.fixedColumns = {
- action: function (e, dt, node, config) {
- if ($(node).attr('active')) {
- $(node).removeAttr('active').removeClass('active');
- dt.fixedColumns().left(0);
- dt.fixedColumns().right(0);
- }
- else {
- $(node).attr('active', true).addClass('active');
- dt.fixedColumns().left(config.config.left);
- dt.fixedColumns().right(config.config.right);
- }
- },
- config: {
- left: 1,
- right: 0
- },
- init: function (dt, node, config) {
- if (dt.settings()[0]._fixedColumns === undefined) {
- _init(dt.settings(), config);
- }
- $(node).attr('active', true).addClass('active');
- dt.button(node).text(config.text || dt.i18n('buttons.fixedColumns', dt.settings()[0]._fixedColumns.c.i18n.button));
- },
- text: null
- };
- function _init(settings, options) {
- if (options === void 0) { options = null; }
- var api = new dataTable.Api(settings);
- var opts = options
- ? options
- : api.init().fixedColumns || dataTable.defaults.fixedColumns;
- var fixedColumns = new FixedColumns(api, opts);
- return fixedColumns;
- }
- // Attach a listener to the document which listens for DataTables initialisation
- // events so we can automatically initialise
- $(document).on('plugin-init.dt', function (e, settings) {
- if (e.namespace !== 'dt') {
- return;
- }
- if (settings.oInit.fixedColumns ||
- dataTable.defaults.fixedColumns) {
- if (!settings._fixedColumns) {
- _init(settings, null);
- }
- }
- });
- }));
-
-})();
diff --git a/web/DataTables/FixedColumns-4.1.0/js/dataTables.fixedColumns.min.js b/web/DataTables/FixedColumns-4.1.0/js/dataTables.fixedColumns.min.js
deleted file mode 100644
index 5a44110..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/dataTables.fixedColumns.min.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*!
- FixedColumns 4.1.0
- 2019-2022 SpryMedia Ltd - datatables.net/license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var h=0;h
").css(g).css("left",0).addClass(this.classes.leftBottomBlocker),leftTopBlocker:a("").css(g).css({left:0,top:0}).addClass(this.classes.leftTopBlocker),rightBottomBlocker:a("
").css(g).css("right",0).addClass(this.classes.rightBottomBlocker),rightTopBlocker:a("
").css(g).css({right:0,top:0}).addClass(this.classes.rightTopBlocker)};if(this.s.dt.settings()[0]._bInitComplete)this._addStyles(),
-this._setKeyTableListener();else d.one("init.dt",function(){m._addStyles();m._setKeyTableListener()});d.on("column-sizing.dt",function(){return m._addStyles()});d.settings()[0]._fixedColumns=this;return this}e.prototype.left=function(d){void 0!==d&&(this.c.left=d,this._addStyles());return this.c.left};e.prototype.right=function(d){void 0!==d&&(this.c.right=d,this._addStyles());return this.c.right};e.prototype._addStyles=function(){if(this.s.dt.settings()[0].oScroll.sY){var d=a(this.s.dt.table().node()).closest("div.dataTables_scrollBody")[0],
-g=this.s.dt.settings()[0].oBrowser.barWidth;this.s.barWidth=d.offsetWidth-d.clientWidth>=g?g:0;this.dom.rightTopBlocker.css("width",this.s.barWidth+1);this.dom.leftTopBlocker.css("width",this.s.barWidth+1);this.dom.rightBottomBlocker.css("width",this.s.barWidth+1);this.dom.leftBottomBlocker.css("width",this.s.barWidth+1)}d=null;g=this.s.dt.column(0).header();var m=null;null!==g&&(g=a(g),m=g.outerHeight()+1,d=a(g.closest("div.dataTables_scroll")).css("position","relative"));var n=this.s.dt.column(0).footer(),
-c=null;null!==n&&(n=a(n),c=n.outerHeight(),null===d&&(d=a(n.closest("div.dataTables_scroll")).css("position","relative")));for(var b=this.s.dt.columns().data().toArray().length,f=0,l=0,u=a(this.s.dt.table().node()).children("tbody").children("tr"),x=0,A=new Map,r=0;r
=b-this.c.right){a(this.s.dt.table().node()).addClass(this.classes.tableFixedRight);d.addClass(this.classes.tableFixedRight);
-if(r+1+vb.left&&(c=m.scrollLeft(),m.scrollLeft(c-(b.left-(g.left+n)))))});this.s.dt.on("draw",function(){d._addStyles()});this.s.dt.on("column-reorder",function(){d._addStyles()});this.s.dt.on("column-visibility",function(g,m,n,c,b){b&&!m.bDestroying&&setTimeout(function(){d._addStyles()},50)})};e.version="4.1.0";e.classes={fixedLeft:"dtfc-fixed-left",fixedRight:"dtfc-fixed-right",leftBottomBlocker:"dtfc-left-bottom-blocker",
-leftTopBlocker:"dtfc-left-top-blocker",rightBottomBlocker:"dtfc-right-bottom-blocker",rightTopBlocker:"dtfc-right-top-blocker",tableFixedLeft:"dtfc-has-left",tableFixedRight:"dtfc-has-right"};e.defaults={i18n:{button:"FixedColumns"},left:1,right:0};return e}();(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(d){return e(d,window,document)}):"object"===typeof exports?module.exports=function(d,g){d||(d=window);g&&g.fn.dataTable||(g=require("datatables.net")(d,
-g).$);return e(g,d,d.document)}:e(window.jQuery,window,document)})(function(e,d,g){function m(c,b){void 0===b&&(b=null);c=new n.Api(c);b=b?b:c.init().fixedColumns||n.defaults.fixedColumns;return new k(c,b)}a=e;h=a.fn.dataTable;var n=e.fn.dataTable;e.fn.dataTable.FixedColumns=k;e.fn.DataTable.FixedColumns=k;d=e.fn.dataTable.Api.register;d("fixedColumns()",function(){return this});d("fixedColumns().left()",function(c){var b=this.context[0];return void 0!==c?(b._fixedColumns.left(c),this):b._fixedColumns.left()});
-d("fixedColumns().right()",function(c){var b=this.context[0];return void 0!==c?(b._fixedColumns.right(c),this):b._fixedColumns.right()});e.fn.dataTable.ext.buttons.fixedColumns={action:function(c,b,f,l){e(f).attr("active")?(e(f).removeAttr("active").removeClass("active"),b.fixedColumns().left(0),b.fixedColumns().right(0)):(e(f).attr("active",!0).addClass("active"),b.fixedColumns().left(l.config.left),b.fixedColumns().right(l.config.right))},config:{left:1,right:0},init:function(c,b,f){void 0===c.settings()[0]._fixedColumns&&
-m(c.settings(),f);e(b).attr("active",!0).addClass("active");c.button(b).text(f.text||c.i18n("buttons.fixedColumns",c.settings()[0]._fixedColumns.c.i18n.button))},text:null};e(g).on("plugin-init.dt",function(c,b){"dt"===c.namespace&&(b.oInit.fixedColumns||n.defaults.fixedColumns)&&(b._fixedColumns||m(b,null))})})})();
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.js
deleted file mode 100644
index 3e57e8e..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.js
+++ /dev/null
@@ -1,33 +0,0 @@
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-bs', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-bs')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.min.js
deleted file mode 100644
index cc7e37b..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-bs")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.js
deleted file mode 100644
index 34060a6..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! Bootstrap 4 integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-bs4', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-bs4')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.min.js
deleted file mode 100644
index cca66d8..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap4.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 4 integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-bs4")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.js
deleted file mode 100644
index 18aade1..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! Bootstrap 5 integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-bs5', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-bs5')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.min.js
deleted file mode 100644
index 5d76791..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bootstrap5.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 5 integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-bs5")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.js
deleted file mode 100644
index 283a721..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! Bulma integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-bm', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-bm')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.min.js
deleted file mode 100644
index ae3a09c..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.bulma.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bulma integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-bm")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.js
deleted file mode 100644
index 9f4f2ca..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! DataTables integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-dt', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-dt')(root, $).$;
- }
- if (!$.fn.dataTable.FixedColumns) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.min.js
deleted file mode 100644
index 22a217b..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.dataTables.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- DataTables integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-dt")(b,a).$);a.fn.dataTable.FixedColumns||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.js
deleted file mode 100644
index 7aa7b91..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! Foundation integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-zf', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-zf')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.min.js
deleted file mode 100644
index 5e91831..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.foundation.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Foundation integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-zf")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.js
deleted file mode 100644
index aacadba..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! jquery ui integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-ju', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-ju')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.min.js
deleted file mode 100644
index 93a454a..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.jqueryui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- jquery ui integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-ju","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-ju")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.js
deleted file mode 100644
index e27734c..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*! Semantic ui integration for DataTables' FixedColumns
- * ©2016 SpryMedia Ltd - datatables.net/license
- */
-(function (factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD
- define(['jquery', 'datatables.net-se', 'datatables.net-fixedcolumns'], function ($) {
- return factory($);
- });
- }
- else if (typeof exports === 'object') {
- // CommonJS
- module.exports = function (root, $) {
- if (!root) {
- root = window;
- }
- if (!$ || !$.fn.dataTable) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- $ = require('datatables.net-se')(root, $).$;
- }
- if (!$.fn.dataTable.SearchPanes) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require('datatables.net-fixedcolumns')(root, $);
- }
- return factory($);
- };
- }
- else {
- // Browser
- factory(jQuery);
- }
-}(function ($) {
- 'use strict';
- var dataTable = $.fn.dataTable;
- return dataTable.fixedColumns;
-}));
diff --git a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.min.js b/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.min.js
deleted file mode 100644
index 38fc96a..0000000
--- a/web/DataTables/FixedColumns-4.1.0/js/fixedColumns.semanticui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Semantic ui integration for DataTables' FixedColumns
- ©2016 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-se","datatables.net-fixedcolumns"],function(b){return c(b)}):"object"===typeof exports?module.exports=function(b,a){b||(b=window);a&&a.fn.dataTable||(a=require("datatables.net-se")(b,a).$);a.fn.dataTable.SearchPanes||require("datatables.net-fixedcolumns")(b,a);return c(a)}:c(jQuery)})(function(c){return c.fn.dataTable.fixedColumns});
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.css
deleted file mode 100644
index 12b5440..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.css
+++ /dev/null
@@ -1,16 +0,0 @@
-table.dataTable.fixedHeader-floating,
-table.dataTable.fixedHeader-locked {
- background-color: white;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-table.dataTable.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.min.css
deleted file mode 100644
index 69dfd4b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.css
deleted file mode 100644
index 12b5440..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.css
+++ /dev/null
@@ -1,16 +0,0 @@
-table.dataTable.fixedHeader-floating,
-table.dataTable.fixedHeader-locked {
- background-color: white;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-table.dataTable.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.min.css
deleted file mode 100644
index 69dfd4b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap4.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.css
deleted file mode 100644
index 12b5440..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.css
+++ /dev/null
@@ -1,16 +0,0 @@
-table.dataTable.fixedHeader-floating,
-table.dataTable.fixedHeader-locked {
- background-color: white;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-table.dataTable.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.min.css
deleted file mode 100644
index 69dfd4b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bootstrap5.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.css
deleted file mode 100644
index 12b5440..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.css
+++ /dev/null
@@ -1,16 +0,0 @@
-table.dataTable.fixedHeader-floating,
-table.dataTable.fixedHeader-locked {
- background-color: white;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-table.dataTable.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.min.css
deleted file mode 100644
index 69dfd4b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.bulma.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.css
deleted file mode 100644
index 6fc923f..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.css
+++ /dev/null
@@ -1,18 +0,0 @@
-table.fixedHeader-floating {
- background-color: white;
-}
-
-table.fixedHeader-floating.no-footer {
- border-bottom-width: 0;
-}
-
-table.fixedHeader-locked {
- position: absolute !important;
- background-color: white;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.min.css
deleted file mode 100644
index 97a2b1b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.dataTables.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.fixedHeader-floating{background-color:white}table.fixedHeader-floating.no-footer{border-bottom-width:0}table.fixedHeader-locked{position:absolute !important;background-color:white}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.css
deleted file mode 100644
index 12b5440..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.css
+++ /dev/null
@@ -1,16 +0,0 @@
-table.dataTable.fixedHeader-floating,
-table.dataTable.fixedHeader-locked {
- background-color: white;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-table.dataTable.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.min.css
deleted file mode 100644
index 69dfd4b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.foundation.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.css
deleted file mode 100644
index a9df0a1..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.css
+++ /dev/null
@@ -1,14 +0,0 @@
-table.fixedHeader-floating {
- background-color: white;
-}
-
-table.fixedHeader-locked {
- position: absolute !important;
- background-color: white;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.min.css
deleted file mode 100644
index 15ec73b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.jqueryui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.fixedHeader-floating{background-color:white}table.fixedHeader-locked{position:absolute !important;background-color:white}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.css
deleted file mode 100644
index 0322419..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.css
+++ /dev/null
@@ -1,13 +0,0 @@
-table.fixedHeader-floating {
- border-bottom-width: 0 !important;
-}
-
-table.fixedHeader-locked {
- position: absolute !important;
-}
-
-@media print {
- table.fixedHeader-floating {
- display: none;
- }
-}
diff --git a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.min.css b/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.min.css
deleted file mode 100644
index 431004f..0000000
--- a/web/DataTables/FixedHeader-3.2.4/css/fixedHeader.semanticui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.fixedHeader-floating{border-bottom-width:0 !important}table.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}}
diff --git a/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.js b/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.js
deleted file mode 100644
index 616f318..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.js
+++ /dev/null
@@ -1,1079 +0,0 @@
-/*! FixedHeader 3.2.4
- * ©2009-2022 SpryMedia Ltd - datatables.net/license
- */
-
-/**
- * @summary FixedHeader
- * @description Fix a table's header or footer, so it is always visible while
- * scrolling
- * @version 3.2.4
- * @author SpryMedia Ltd (www.sprymedia.co.uk)
- * @contact www.sprymedia.co.uk
- * @copyright SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license/mit
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net')(root, $).$;
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-'use strict';
-var DataTable = $.fn.dataTable;
-
-
-var _instCounter = 0;
-
-var FixedHeader = function ( dt, config ) {
- // Sanity check - you just know it will happen
- if ( ! (this instanceof FixedHeader) ) {
- throw "FixedHeader must be initialised with the 'new' keyword.";
- }
-
- // Allow a boolean true for defaults
- if ( config === true ) {
- config = {};
- }
-
- dt = new DataTable.Api( dt );
-
- this.c = $.extend( true, {}, FixedHeader.defaults, config );
-
- this.s = {
- dt: dt,
- position: {
- theadTop: 0,
- tbodyTop: 0,
- tfootTop: 0,
- tfootBottom: 0,
- width: 0,
- left: 0,
- tfootHeight: 0,
- theadHeight: 0,
- windowHeight: $(window).height(),
- visible: true
- },
- headerMode: null,
- footerMode: null,
- autoWidth: dt.settings()[0].oFeatures.bAutoWidth,
- namespace: '.dtfc'+(_instCounter++),
- scrollLeft: {
- header: -1,
- footer: -1
- },
- enable: true
- };
-
- this.dom = {
- floatingHeader: null,
- thead: $(dt.table().header()),
- tbody: $(dt.table().body()),
- tfoot: $(dt.table().footer()),
- header: {
- host: null,
- floating: null,
- floatingParent: $(''),
- placeholder: null
- },
- footer: {
- host: null,
- floating: null,
- floatingParent: $('
'),
- placeholder: null
- }
- };
-
- this.dom.header.host = this.dom.thead.parent();
- this.dom.footer.host = this.dom.tfoot.parent();
-
- var dtSettings = dt.settings()[0];
- if ( dtSettings._fixedHeader ) {
- throw "FixedHeader already initialised on table "+dtSettings.nTable.id;
- }
-
- dtSettings._fixedHeader = this;
-
- this._constructor();
-};
-
-
-/*
- * Variable: FixedHeader
- * Purpose: Prototype for FixedHeader
- * Scope: global
- */
-$.extend( FixedHeader.prototype, {
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * API methods
- */
-
- /**
- * Kill off FH and any events
- */
- destroy: function () {
- var dom = this.dom;
-
- this.s.dt.off( '.dtfc' );
- $(window).off( this.s.namespace );
-
- // Remove clones of FC blockers
- if (dom.header.rightBlocker) {
- dom.header.rightBlocker.remove();
- }
- if (dom.header.leftBlocker) {
- dom.header.leftBlocker.remove();
- }
- if (dom.footer.rightBlocker) {
- dom.footer.rightBlocker.remove();
- }
- if (dom.footer.leftBlocker) {
- dom.footer.leftBlocker.remove();
- }
-
- if ( this.c.header ) {
- this._modeChange( 'in-place', 'header', true );
- }
-
- if ( this.c.footer && dom.tfoot.length ) {
- this._modeChange( 'in-place', 'footer', true );
- }
- },
-
- /**
- * Enable / disable the fixed elements
- *
- * @param {boolean} enable `true` to enable, `false` to disable
- */
- enable: function ( enable, update )
- {
- this.s.enable = enable;
-
- if ( update || update === undefined ) {
- this._positions();
- this._scroll( true );
- }
- },
-
- /**
- * Get enabled status
- */
- enabled: function ()
- {
- return this.s.enable;
- },
-
- /**
- * Set header offset
- *
- * @param {int} new value for headerOffset
- */
- headerOffset: function ( offset )
- {
- if ( offset !== undefined ) {
- this.c.headerOffset = offset;
- this.update();
- }
-
- return this.c.headerOffset;
- },
-
- /**
- * Set footer offset
- *
- * @param {int} new value for footerOffset
- */
- footerOffset: function ( offset )
- {
- if ( offset !== undefined ) {
- this.c.footerOffset = offset;
- this.update();
- }
-
- return this.c.footerOffset;
- },
-
-
- /**
- * Recalculate the position of the fixed elements and force them into place
- */
- update: function (force)
- {
- if (! this.s.enable) {
- return;
- }
-
- var table = this.s.dt.table().node();
-
- if ( $(table).is(':visible') ) {
- this.enable( true, false );
- }
- else {
- this.enable( false, false );
- }
-
- // Don't update if header is not in the document atm (due to
- // async events)
- if ($(table).children('thead').length === 0) {
- return;
- }
-
- this._positions();
- this._scroll( force !== undefined ? force : true );
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constructor
- */
-
- /**
- * FixedHeader constructor - adding the required event listeners and
- * simple initialisation
- *
- * @private
- */
- _constructor: function ()
- {
- var that = this;
- var dt = this.s.dt;
-
- $(window)
- .on( 'scroll'+this.s.namespace, function () {
- that._scroll();
- } )
- .on( 'resize'+this.s.namespace, DataTable.util.throttle( function () {
- that.s.position.windowHeight = $(window).height();
- that.update();
- }, 50 ) );
-
- var autoHeader = $('.fh-fixedHeader');
- if ( ! this.c.headerOffset && autoHeader.length ) {
- this.c.headerOffset = autoHeader.outerHeight();
- }
-
- var autoFooter = $('.fh-fixedFooter');
- if ( ! this.c.footerOffset && autoFooter.length ) {
- this.c.footerOffset = autoFooter.outerHeight();
- }
-
- dt
- .on( 'column-reorder.dt.dtfc column-visibility.dt.dtfc column-sizing.dt.dtfc responsive-display.dt.dtfc', function (e, ctx) {
- that.update();
- } )
- .on( 'draw.dt.dtfc', function (e, ctx) {
- // For updates from our own table, don't reclone, but for all others, do
- that.update(ctx === dt.settings()[0] ? false : true);
- } );
-
- dt.on( 'destroy.dtfc', function () {
- that.destroy();
- } );
-
- this._positions();
- this._scroll();
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods
- */
-
- /**
- * Clone a fixed item to act as a place holder for the original element
- * which is moved into a clone of the table element, and moved around the
- * document to give the fixed effect.
- *
- * @param {string} item 'header' or 'footer'
- * @param {boolean} force Force the clone to happen, or allow automatic
- * decision (reuse existing if available)
- * @private
- */
- _clone: function ( item, force )
- {
- var that = this;
- var dt = this.s.dt;
- var itemDom = this.dom[ item ];
- var itemElement = item === 'header' ?
- this.dom.thead :
- this.dom.tfoot;
-
- // If footer and scrolling is enabled then we don't clone
- // Instead the table's height is decreased accordingly - see `_scroll()`
- if (item === 'footer' && this._scrollEnabled()) {
- return;
- }
-
- if ( ! force && itemDom.floating ) {
- // existing floating element - reuse it
- itemDom.floating.removeClass( 'fixedHeader-floating fixedHeader-locked' );
- }
- else {
- var docScrollLeft = $(document).scrollLeft();
- var docScrollTop = $(document).scrollTop();
-
- if ( itemDom.floating ) {
- if(itemDom.placeholder !== null) {
- itemDom.placeholder.remove();
- }
- this._unsize( item );
- itemDom.floating.children().detach();
- itemDom.floating.remove();
- }
-
- var tableNode = $(dt.table().node());
- var scrollBody = $(tableNode.parent());
- var scrollEnabled = this._scrollEnabled();
-
- itemDom.floating = $( dt.table().node().cloneNode( false ) )
- .attr( 'aria-hidden', 'true' )
- .css({
- 'table-layout': 'fixed',
- top: 0,
- left: 0
- })
- .removeAttr( 'id' )
- .append( itemElement );
-
- itemDom.floatingParent
- .css({
- width: scrollBody.width(),
- overflow: 'hidden',
- height: 'fit-content',
- position: 'fixed',
- left: scrollEnabled ? tableNode.offset().left + scrollBody.scrollLeft() : 0
- })
- .css(
- item === 'header' ?
- {
- top: this.c.headerOffset,
- bottom: ''
- } :
- {
- top: '',
- bottom: this.c.footerOffset
- }
- )
- .addClass(item === 'footer' ? 'dtfh-floatingparentfoot' : 'dtfh-floatingparenthead')
- .append(itemDom.floating)
- .appendTo( 'body' );
-
- this._stickyPosition(itemDom.floating, '-');
-
- var scrollLeftUpdate = function () {
- var scrollLeft = scrollBody.scrollLeft()
- that.s.scrollLeft = {footer: scrollLeft, header: scrollLeft};
- itemDom.floatingParent.scrollLeft(that.s.scrollLeft.header);
- }
-
- scrollLeftUpdate();
- scrollBody
- .off('scroll.dtfh')
- .on('scroll.dtfh', scrollLeftUpdate);
-
- // Insert a fake thead/tfoot into the DataTable to stop it jumping around
- itemDom.placeholder = itemElement.clone( false );
- itemDom.placeholder
- .find( '*[id]' )
- .removeAttr( 'id' );
-
- itemDom.host.prepend( itemDom.placeholder );
-
- // Clone widths
- this._matchWidths( itemDom.placeholder, itemDom.floating );
-
- // The above action will remove the table header, potentially causing the table to
- // collapse to a smaller size, before it is then re-inserted (append). The result
- // can be that the document, if scrolling, can "jump".
- $(document)
- .scrollTop(docScrollTop)
- .scrollLeft(docScrollLeft);
- }
- },
-
- /**
- * This method sets the sticky position of the header elements to match fixed columns
- * @param {JQuery
} el
- * @param {string} sign
- */
- _stickyPosition: function(el, sign) {
- if (this._scrollEnabled()) {
- var that = this
- var rtl = $(that.s.dt.table().node()).css('direction') === 'rtl';
-
- el.find('th').each(function() {
- // Find out if fixed header has previously set this column
- if ($(this).css('position') === 'sticky') {
- var right = $(this).css('right');
- var left = $(this).css('left');
- if (right !== 'auto' && !rtl) {
- // New position either adds or dismisses the barWidth
- var potential = +right.replace(/px/g, '') + (sign === '-' ? -1 : 1) * that.s.dt.settings()[0].oBrowser.barWidth;
- $(this).css('right', potential > 0 ? potential : 0);
- }
- else if(left !== 'auto' && rtl) {
- var potential = +left.replace(/px/g, '') + (sign === '-' ? -1 : 1) * that.s.dt.settings()[0].oBrowser.barWidth;
- $(this).css('left', potential > 0 ? potential : 0);
- }
- }
- });
- }
- },
-
- /**
- * Copy widths from the cells in one element to another. This is required
- * for the footer as the footer in the main table takes its sizes from the
- * header columns. That isn't present in the footer so to have it still
- * align correctly, the sizes need to be copied over. It is also required
- * for the header when auto width is not enabled
- *
- * @param {jQuery} from Copy widths from
- * @param {jQuery} to Copy widths to
- * @private
- */
- _matchWidths: function ( from, to ) {
- var get = function ( name ) {
- return $(name, from)
- .map( function () {
- return $(this).css('width').replace(/[^\d\.]/g, '') * 1;
- } ).toArray();
- };
-
- var set = function ( name, toWidths ) {
- $(name, to).each( function ( i ) {
- $(this).css( {
- width: toWidths[i],
- minWidth: toWidths[i]
- } );
- } );
- };
-
- var thWidths = get( 'th' );
- var tdWidths = get( 'td' );
-
- set( 'th', thWidths );
- set( 'td', tdWidths );
- },
-
- /**
- * Remove assigned widths from the cells in an element. This is required
- * when inserting the footer back into the main table so the size is defined
- * by the header columns and also when auto width is disabled in the
- * DataTable.
- *
- * @param {string} item The `header` or `footer`
- * @private
- */
- _unsize: function ( item ) {
- var el = this.dom[ item ].floating;
-
- if ( el && (item === 'footer' || (item === 'header' && ! this.s.autoWidth)) ) {
- $('th, td', el).css( {
- width: '',
- minWidth: ''
- } );
- }
- else if ( el && item === 'header' ) {
- $('th, td', el).css( 'min-width', '' );
- }
- },
-
- /**
- * Reposition the floating elements to take account of horizontal page
- * scroll
- *
- * @param {string} item The `header` or `footer`
- * @param {int} scrollLeft Document scrollLeft
- * @private
- */
- _horizontal: function ( item, scrollLeft )
- {
- var itemDom = this.dom[ item ];
- var position = this.s.position;
- var lastScrollLeft = this.s.scrollLeft;
-
- if ( itemDom.floating && lastScrollLeft[ item ] !== scrollLeft ) {
- // If scrolling is enabled we need to match the floating header to the body
- if (this._scrollEnabled()) {
- var newScrollLeft = $($(this.s.dt.table().node()).parent()).scrollLeft()
- itemDom.floating.scrollLeft(newScrollLeft);
- itemDom.floatingParent.scrollLeft(newScrollLeft);
- }
-
- lastScrollLeft[ item ] = scrollLeft;
- }
- },
-
- /**
- * Change from one display mode to another. Each fixed item can be in one
- * of:
- *
- * * `in-place` - In the main DataTable
- * * `in` - Floating over the DataTable
- * * `below` - (Header only) Fixed to the bottom of the table body
- * * `above` - (Footer only) Fixed to the top of the table body
- *
- * @param {string} mode Mode that the item should be shown in
- * @param {string} item 'header' or 'footer'
- * @param {boolean} forceChange Force a redraw of the mode, even if already
- * in that mode.
- * @private
- */
- _modeChange: function ( mode, item, forceChange )
- {
- var dt = this.s.dt;
- var itemDom = this.dom[ item ];
- var position = this.s.position;
-
- // Just determine if scroll is enabled once
- var scrollEnabled = this._scrollEnabled();
-
- // If footer and scrolling is enabled then we don't clone
- // Instead the table's height is decreased accordingly - see `_scroll()`
- if (item === 'footer' && scrollEnabled) {
- return;
- }
-
- // It isn't trivial to add a !important css attribute...
- var importantWidth = function (w) {
- itemDom.floating.attr('style', function(i,s) {
- return (s || '') + 'width: '+w+'px !important;';
- });
-
- // If not scrolling also have to update the floatingParent
- if (!scrollEnabled) {
- itemDom.floatingParent.attr('style', function(i,s) {
- return (s || '') + 'width: '+w+'px !important;';
- });
- }
- };
-
- // Record focus. Browser's will cause input elements to loose focus if
- // they are inserted else where in the doc
- var tablePart = this.dom[ item==='footer' ? 'tfoot' : 'thead' ];
- var focus = $.contains( tablePart[0], document.activeElement ) ?
- document.activeElement :
- null;
- var scrollBody = $($(this.s.dt.table().node()).parent());
-
- if ( mode === 'in-place' ) {
- // Insert the header back into the table's real header
- if ( itemDom.placeholder ) {
- itemDom.placeholder.remove();
- itemDom.placeholder = null;
- }
-
- this._unsize( item );
-
- if ( item === 'header' ) {
- itemDom.host.prepend( tablePart );
- }
- else {
- itemDom.host.append( tablePart );
- }
-
- if ( itemDom.floating ) {
- itemDom.floating.remove();
- itemDom.floating = null;
- this._stickyPosition(itemDom.host, '+');
- }
-
- if ( itemDom.floatingParent ) {
- itemDom.floatingParent.remove();
- }
-
- $($(itemDom.host.parent()).parent()).scrollLeft(scrollBody.scrollLeft())
- }
- else if ( mode === 'in' ) {
- // Remove the header from the read header and insert into a fixed
- // positioned floating table clone
- this._clone( item, forceChange );
-
- // Get useful position values
- var scrollOffset = scrollBody.offset();
- var windowTop = $(document).scrollTop();
- var windowHeight = $(window).height();
- var windowBottom = windowTop + windowHeight;
- var bodyTop = scrollEnabled ? scrollOffset.top : position.tbodyTop;
- var bodyBottom = scrollEnabled ? scrollOffset.top + scrollBody.outerHeight() : position.tfootTop
-
- // Calculate the amount that the footer or header needs to be shuffled
- var shuffle = item === 'footer' ?
- // footer and top of body isn't on screen
- bodyTop > windowBottom ?
- // Yes - push the footer below
- position.tfootHeight :
- // No - bottom set to the gap between the top of the body and the bottom of the window
- bodyTop + position.tfootHeight - windowBottom :
- // Otherwise must be a header so get the difference from the bottom of the
- // desired floating header and the bottom of the table body
- windowTop + this.c.headerOffset + position.theadHeight - bodyBottom
-
- // Set the top or bottom based off of the offset and the shuffle value
- var prop = item === 'header' ? 'top' : 'bottom';
- var val = this.c[item+'Offset'] - (shuffle > 0 ? shuffle : 0);
-
- itemDom.floating.addClass( 'fixedHeader-floating' );
- itemDom.floatingParent
- .css(prop, val)
- .css( {
- 'left': position.left,
- 'height': item === 'header' ? position.theadHeight : position.tfootHeight,
- 'z-index': 2
- })
- .append(itemDom.floating);
-
- importantWidth(position.width);
-
- if ( item === 'footer' ) {
- itemDom.floating.css( 'top', '' );
- }
- }
- else if ( mode === 'below' ) { // only used for the header
- // Fix the position of the floating header at base of the table body
- this._clone( item, forceChange );
-
- itemDom.floating.addClass( 'fixedHeader-locked' );
- itemDom.floatingParent.css({
- position: 'absolute',
- top: position.tfootTop - position.theadHeight,
- left: position.left+'px'
- });
-
- importantWidth(position.width);
- }
- else if ( mode === 'above' ) { // only used for the footer
- // Fix the position of the floating footer at top of the table body
- this._clone( item, forceChange );
-
- itemDom.floating.addClass( 'fixedHeader-locked' );
- itemDom.floatingParent.css({
- position: 'absolute',
- top: position.tbodyTop,
- left: position.left+'px'
- });
-
- importantWidth(position.width);
- }
-
- // Restore focus if it was lost
- if ( focus && focus !== document.activeElement ) {
- setTimeout( function () {
- focus.focus();
- }, 10 );
- }
-
- this.s.scrollLeft.header = -1;
- this.s.scrollLeft.footer = -1;
- this.s[item+'Mode'] = mode;
- },
-
- /**
- * Cache the positional information that is required for the mode
- * calculations that FixedHeader performs.
- *
- * @private
- */
- _positions: function ()
- {
- var dt = this.s.dt;
- var table = dt.table();
- var position = this.s.position;
- var dom = this.dom;
- var tableNode = $(table.node());
- var scrollEnabled = this._scrollEnabled();
-
- // Need to use the header and footer that are in the main table,
- // regardless of if they are clones, since they hold the positions we
- // want to measure from
- var thead = $(dt.table().header());
- var tfoot = $(dt.table().footer());
- var tbody = dom.tbody;
- var scrollBody = tableNode.parent();
-
- position.visible = tableNode.is(':visible');
- position.width = tableNode.outerWidth();
- position.left = tableNode.offset().left;
- position.theadTop = thead.offset().top;
- position.tbodyTop = scrollEnabled ? scrollBody.offset().top : tbody.offset().top;
- position.tbodyHeight = scrollEnabled ? scrollBody.outerHeight() : tbody.outerHeight();
- position.theadHeight = thead.outerHeight();
- position.theadBottom = position.theadTop + position.theadHeight;
-
- if ( tfoot.length ) {
- position.tfootTop = position.tbodyTop + position.tbodyHeight; //tfoot.offset().top;
- position.tfootBottom = position.tfootTop + tfoot.outerHeight();
- position.tfootHeight = tfoot.outerHeight();
- }
- else {
- position.tfootTop = position.tbodyTop + tbody.outerHeight();
- position.tfootBottom = position.tfootTop;
- position.tfootHeight = position.tfootTop;
- }
- },
-
-
- /**
- * Mode calculation - determine what mode the fixed items should be placed
- * into.
- *
- * @param {boolean} forceChange Force a redraw of the mode, even if already
- * in that mode.
- * @private
- */
- _scroll: function ( forceChange )
- {
- if (this.s.dt.settings()[0].bDestroying) {
- return;
- }
-
- // ScrollBody details
- var scrollEnabled = this._scrollEnabled();
- var scrollBody = $(this.s.dt.table().node()).parent();
- var scrollOffset = scrollBody.offset();
- var scrollHeight = scrollBody.outerHeight();
-
- // Window details
- var windowLeft = $(document).scrollLeft();
- var windowTop = $(document).scrollTop();
- var windowHeight = $(window).height();
- var windowBottom = windowHeight + windowTop
-
-
- var position = this.s.position;
- var headerMode, footerMode;
-
- // Body Details
- var bodyTop = (scrollEnabled ? scrollOffset.top : position.tbodyTop);
- var bodyLeft = (scrollEnabled ? scrollOffset.left : position.left);
- var bodyBottom = (scrollEnabled ? scrollOffset.top + scrollHeight : position.tfootTop);
- var bodyWidth = (scrollEnabled ? scrollBody.outerWidth() : position.tbodyWidth);
-
- var windowBottom = windowTop + windowHeight;
-
- if ( this.c.header ) {
- if ( ! this.s.enable ) {
- headerMode = 'in-place';
- }
- // The header is in it's normal place if the body top is lower than
- // the scroll of the window plus the headerOffset and the height of the header
- else if ( ! position.visible || windowTop + this.c.headerOffset + position.theadHeight <= bodyTop) {
- headerMode = 'in-place';
- }
- // The header should be floated if
- else if (
- // The scrolling plus the header offset plus the height of the header is lower than the top of the body
- windowTop + this.c.headerOffset + position.theadHeight > bodyTop &&
- // And the scrolling at the top plus the header offset is above the bottom of the body
- windowTop + this.c.headerOffset + position.theadHeight < bodyBottom
- ) {
- headerMode = 'in';
- var scrollBody = $($(this.s.dt.table().node()).parent());
-
- // Further to the above, If the scrolling plus the header offset plus the header height is lower
- // than the bottom of the table a shuffle is required so have to force the calculation
- if(windowTop + this.c.headerOffset + position.theadHeight > bodyBottom || this.dom.header.floatingParent === undefined){
- forceChange = true;
- }
- else {
- this.dom.header.floatingParent
- .css({
- 'top': this.c.headerOffset,
- 'position': 'fixed'
- })
- .append(this.dom.header.floating);
- }
- }
- // Anything else and the view is below the table
- else {
- headerMode = 'below';
- }
-
- if ( forceChange || headerMode !== this.s.headerMode ) {
- this._modeChange( headerMode, 'header', forceChange );
- }
-
- this._horizontal( 'header', windowLeft );
- }
-
- var header = {
- offset: {top: 0, left: 0},
- height: 0
- }
- var footer = {
- offset: {top: 0, left: 0},
- height: 0
- }
-
- if ( this.c.footer && this.dom.tfoot.length ) {
- if ( ! this.s.enable ) {
- footerMode = 'in-place';
- }
- else if ( ! position.visible || position.tfootBottom + this.c.footerOffset <= windowBottom ) {
- footerMode = 'in-place';
- }
- else if (
- bodyBottom + position.tfootHeight + this.c.footerOffset > windowBottom &&
- bodyTop + this.c.footerOffset < windowBottom
- ) {
- footerMode = 'in';
- forceChange = true;
- }
- else {
- footerMode = 'above';
- }
-
- if ( forceChange || footerMode !== this.s.footerMode ) {
- this._modeChange( footerMode, 'footer', forceChange );
- }
-
- this._horizontal( 'footer', windowLeft );
-
- var getOffsetHeight = function (el) {
- return {
- offset: el.offset(),
- height: el.outerHeight()
- };
- };
-
- header = this.dom.header.floating ? getOffsetHeight(this.dom.header.floating) : getOffsetHeight(this.dom.thead);
- footer = this.dom.footer.floating ? getOffsetHeight(this.dom.footer.floating) : getOffsetHeight(this.dom.tfoot);
-
- // If scrolling is enabled and the footer is off the screen
- if (scrollEnabled && footer.offset.top > windowTop){// && footer.offset.top >= windowBottom) {
- // Calculate the gap between the top of the scrollBody and the top of the window
- var overlap = windowTop - scrollOffset.top;
- // The new height is the bottom of the window
- var newHeight = windowBottom +
- // If the gap between the top of the scrollbody and the window is more than
- // the height of the header then the top of the table is still visible so add that gap
- // Doing this has effectively calculated the height from the top of the table to the bottom of the current page
- (overlap > -header.height ? overlap : 0) -
- // Take from that
- (
- // The top of the header plus
- header.offset.top +
- // The header height if the standard header is present
- (overlap < -header.height ? header.height : 0) +
- // And the height of the footer
- footer.height
- )
-
- // Don't want a negative height
- if (newHeight < 0) {
- newHeight = 0;
- }
-
- // At the end of the above calculation the space between the header (top of the page if floating)
- // and the point just above the footer should be the new value for the height of the table.
- scrollBody.outerHeight(newHeight);
-
- // Need some rounding here as sometimes very small decimal places are encountered
- // If the actual height is bigger or equal to the height we just applied then the footer is "Floating"
- if(Math.round(scrollBody.outerHeight()) >= Math.round(newHeight)) {
- $(this.dom.tfoot.parent()).addClass("fixedHeader-floating");
- }
- // Otherwise max-width has kicked in so it is not floating
- else {
- $(this.dom.tfoot.parent()).removeClass("fixedHeader-floating");
- }
- }
- }
-
- if(this.dom.header.floating){
- this.dom.header.floatingParent.css('left', bodyLeft-windowLeft);
- }
- if(this.dom.footer.floating){
- this.dom.footer.floatingParent.css('left', bodyLeft-windowLeft);
- }
-
- // If fixed columns is being used on this table then the blockers need to be copied across
- // Cloning these is cleaner than creating as our own as it will keep consistency with fixedColumns automatically
- // ASSUMING that the class remains the same
- if (this.s.dt.settings()[0]._fixedColumns !== undefined) {
- var adjustBlocker = function (side, end, el) {
- if (el === undefined) {
- var blocker = $('div.dtfc-'+side+'-'+end+'-blocker');
-
- el = blocker.length === 0 ?
- null :
- blocker.clone().appendTo('body').css('z-index', 1);
- }
-
- if(el !== null) {
- el.css({
- top: end === 'top' ? header.offset.top : footer.offset.top,
- left: side === 'right' ? bodyLeft + bodyWidth - el.width() : bodyLeft
- });
- }
-
- return el;
- }
-
- // Adjust all blockers
- this.dom.header.rightBlocker = adjustBlocker('right', 'top', this.dom.header.rightBlocker);
- this.dom.header.leftBlocker = adjustBlocker('left', 'top', this.dom.header.leftBlocker);
- this.dom.footer.rightBlocker = adjustBlocker('right', 'bottom', this.dom.footer.rightBlocker);
- this.dom.footer.leftBlocker = adjustBlocker('left', 'bottom', this.dom.footer.leftBlocker);
- }
- },
-
- /**
- * Function to check if scrolling is enabled on the table or not
- * @returns Boolean value indicating if scrolling on the table is enabled or not
- */
- _scrollEnabled: function() {
- var oScroll = this.s.dt.settings()[0].oScroll;
- if(oScroll.sY !== "" || oScroll.sX !== "") {
- return true;
- }
- return false
- }
-} );
-
-
-/**
- * Version
- * @type {String}
- * @static
- */
-FixedHeader.version = "3.2.4";
-
-/**
- * Defaults
- * @type {Object}
- * @static
- */
-FixedHeader.defaults = {
- header: true,
- footer: false,
- headerOffset: 0,
- footerOffset: 0
-};
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables interfaces
- */
-
-// Attach for constructor access
-$.fn.dataTable.FixedHeader = FixedHeader;
-$.fn.DataTable.FixedHeader = FixedHeader;
-
-
-// DataTables creation - check if the FixedHeader option has been defined on the
-// table and if so, initialise
-$(document).on( 'init.dt.dtfh', function (e, settings, json) {
- if ( e.namespace !== 'dt' ) {
- return;
- }
-
- var init = settings.oInit.fixedHeader;
- var defaults = DataTable.defaults.fixedHeader;
-
- if ( (init || defaults) && ! settings._fixedHeader ) {
- var opts = $.extend( {}, defaults, init );
-
- if ( init !== false ) {
- new FixedHeader( settings, opts );
- }
- }
-} );
-
-// DataTables API methods
-DataTable.Api.register( 'fixedHeader()', function () {} );
-
-DataTable.Api.register( 'fixedHeader.adjust()', function () {
- return this.iterator( 'table', function ( ctx ) {
- var fh = ctx._fixedHeader;
-
- if ( fh ) {
- fh.update();
- }
- } );
-} );
-
-DataTable.Api.register( 'fixedHeader.enable()', function ( flag ) {
- return this.iterator( 'table', function ( ctx ) {
- var fh = ctx._fixedHeader;
-
- flag = ( flag !== undefined ? flag : true );
- if ( fh && flag !== fh.enabled() ) {
- fh.enable( flag );
- }
- } );
-} );
-
-DataTable.Api.register( 'fixedHeader.enabled()', function () {
- if ( this.context.length ) {
- var fh = this.context[0]._fixedHeader;
-
- if ( fh ) {
- return fh.enabled();
- }
- }
-
- return false;
-} );
-
-DataTable.Api.register( 'fixedHeader.disable()', function ( ) {
- return this.iterator( 'table', function ( ctx ) {
- var fh = ctx._fixedHeader;
-
- if ( fh && fh.enabled() ) {
- fh.enable( false );
- }
- } );
-} );
-
-$.each( ['header', 'footer'], function ( i, el ) {
- DataTable.Api.register( 'fixedHeader.'+el+'Offset()', function ( offset ) {
- var ctx = this.context;
-
- if ( offset === undefined ) {
- return ctx.length && ctx[0]._fixedHeader ?
- ctx[0]._fixedHeader[el +'Offset']() :
- undefined;
- }
-
- return this.iterator( 'table', function ( ctx ) {
- var fh = ctx._fixedHeader;
-
- if ( fh ) {
- fh[ el +'Offset' ]( offset );
- }
- } );
- } );
-} );
-
-
-return FixedHeader;
-}));
diff --git a/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.min.js b/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.min.js
deleted file mode 100644
index a854946..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/dataTables.fixedHeader.min.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*!
- SpryMedia Ltd.
-
- This source file is free software, available under the following license:
- MIT license - http://datatables.net/license/mit
-
- This source file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
-
- For details please refer to: http://www.datatables.net
- FixedHeader 3.2.4
- ©2009-2022 SpryMedia Ltd - datatables.net/license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,h,g){b instanceof String&&(b=String(b));for(var l=b.length,k=0;k'),
-placeholder:null},footer:{host:null,floating:null,floatingParent:b(''),placeholder:null}};this.dom.header.host=this.dom.thead.parent();this.dom.footer.host=this.dom.tfoot.parent();a=a.settings()[0];if(a._fixedHeader)throw"FixedHeader already initialised on table "+a.nTable.id;a._fixedHeader=this;this._constructor()};b.extend(t.prototype,{destroy:function(){var a=this.dom;this.s.dt.off(".dtfc");b(h).off(this.s.namespace);a.header.rightBlocker&&a.header.rightBlocker.remove();
-a.header.leftBlocker&&a.header.leftBlocker.remove();a.footer.rightBlocker&&a.footer.rightBlocker.remove();a.footer.leftBlocker&&a.footer.leftBlocker.remove();this.c.header&&this._modeChange("in-place","header",!0);this.c.footer&&a.tfoot.length&&this._modeChange("in-place","footer",!0)},enable:function(a,d){this.s.enable=a;if(d||d===l)this._positions(),this._scroll(!0)},enabled:function(){return this.s.enable},headerOffset:function(a){a!==l&&(this.c.headerOffset=a,this.update());return this.c.headerOffset},
-footerOffset:function(a){a!==l&&(this.c.footerOffset=a,this.update());return this.c.footerOffset},update:function(a){if(this.s.enable){var d=this.s.dt.table().node();b(d).is(":visible")?this.enable(!0,!1):this.enable(!1,!1);0!==b(d).children("thead").length&&(this._positions(),this._scroll(a!==l?a:!0))}},_constructor:function(){var a=this,d=this.s.dt;b(h).on("scroll"+this.s.namespace,function(){a._scroll()}).on("resize"+this.s.namespace,k.util.throttle(function(){a.s.position.windowHeight=b(h).height();
-a.update()},50));var c=b(".fh-fixedHeader");!this.c.headerOffset&&c.length&&(this.c.headerOffset=c.outerHeight());c=b(".fh-fixedFooter");!this.c.footerOffset&&c.length&&(this.c.footerOffset=c.outerHeight());d.on("column-reorder.dt.dtfc column-visibility.dt.dtfc column-sizing.dt.dtfc responsive-display.dt.dtfc",function(f,e){a.update()}).on("draw.dt.dtfc",function(f,e){a.update(e===d.settings()[0]?!1:!0)});d.on("destroy.dtfc",function(){a.destroy()});this._positions();this._scroll()},_clone:function(a,
-d){var c=this,f=this.s.dt,e=this.dom[a],n="header"===a?this.dom.thead:this.dom.tfoot;if("footer"!==a||!this._scrollEnabled())if(!d&&e.floating)e.floating.removeClass("fixedHeader-floating fixedHeader-locked");else{d=b(g).scrollLeft();var q=b(g).scrollTop();e.floating&&(null!==e.placeholder&&e.placeholder.remove(),this._unsize(a),e.floating.children().detach(),e.floating.remove());var p=b(f.table().node()),r=b(p.parent()),m=this._scrollEnabled();e.floating=b(f.table().node().cloneNode(!1)).attr("aria-hidden",
-"true").css({"table-layout":"fixed",top:0,left:0}).removeAttr("id").append(n);e.floatingParent.css({width:r.width(),overflow:"hidden",height:"fit-content",position:"fixed",left:m?p.offset().left+r.scrollLeft():0}).css("header"===a?{top:this.c.headerOffset,bottom:""}:{top:"",bottom:this.c.footerOffset}).addClass("footer"===a?"dtfh-floatingparentfoot":"dtfh-floatingparenthead").append(e.floating).appendTo("body");this._stickyPosition(e.floating,"-");a=function(){var u=r.scrollLeft();c.s.scrollLeft=
-{footer:u,header:u};e.floatingParent.scrollLeft(c.s.scrollLeft.header)};a();r.off("scroll.dtfh").on("scroll.dtfh",a);e.placeholder=n.clone(!1);e.placeholder.find("*[id]").removeAttr("id");e.host.prepend(e.placeholder);this._matchWidths(e.placeholder,e.floating);b(g).scrollTop(q).scrollLeft(d)}},_stickyPosition:function(a,d){if(this._scrollEnabled()){var c=this,f="rtl"===b(c.s.dt.table().node()).css("direction");a.find("th").each(function(){if("sticky"===b(this).css("position")){var e=b(this).css("right"),
-n=b(this).css("left");"auto"===e||f?"auto"!==n&&f&&(e=+n.replace(/px/g,"")+("-"===d?-1:1)*c.s.dt.settings()[0].oBrowser.barWidth,b(this).css("left",0
u?e.tfootHeight:z+e.tfootHeight-u:c+this.c.headerOffset+e.theadHeight-m;m="header"===d?"top":"bottom";c=this.c[d+
-"Offset"]-(0u&&q+this.c.headerOffset+m.theadHeighte||this.dom.header.floatingParent===l?a=!0:this.dom.header.floatingParent.css({top:this.c.headerOffset,
-position:"fixed"}).append(this.dom.header.floating)):p="below":p="in-place",(a||p!==this.s.headerMode)&&this._modeChange(p,"header",a),this._horizontal("header",n));var x={offset:{top:0,left:0},height:0},y={offset:{top:0,left:0},height:0};this.c.footer&&this.dom.tfoot.length&&(this.s.enable?!m.visible||m.tfootBottom+this.c.footerOffset<=r?m="in-place":e+m.tfootHeight+this.c.footerOffset>r&&u+this.c.footerOffsetq&&(d=q-f.top,r=r+(d>-x.height?d:0)-(x.offset.top+(d<-x.height?x.height:0)+y.height),0>r&&(r=0),c.outerHeight(r),Math.round(c.outerHeight())>=Math.round(r)?b(this.dom.tfoot.parent()).addClass("fixedHeader-floating"):b(this.dom.tfoot.parent()).removeClass("fixedHeader-floating")));
-this.dom.header.floating&&this.dom.header.floatingParent.css("left",z-n);this.dom.footer.floating&&this.dom.footer.floatingParent.css("left",z-n);this.s.dt.settings()[0]._fixedColumns!==l&&(c=function(A,C,v){v===l&&(v=b("div.dtfc-"+A+"-"+C+"-blocker"),v=0===v.length?null:v.clone().appendTo("body").css("z-index",1));null!==v&&v.css({top:"top"===C?x.offset.top:y.offset.top,left:"right"===A?z+B-v.width():z});return v},this.dom.header.rightBlocker=c("right","top",this.dom.header.rightBlocker),this.dom.header.leftBlocker=
-c("left","top",this.dom.header.leftBlocker),this.dom.footer.rightBlocker=c("right","bottom",this.dom.footer.rightBlocker),this.dom.footer.leftBlocker=c("left","bottom",this.dom.footer.leftBlocker))}},_scrollEnabled:function(){var a=this.s.dt.settings()[0].oScroll;return""!==a.sY||""!==a.sX?!0:!1}});t.version="3.2.4";t.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0};b.fn.dataTable.FixedHeader=t;b.fn.DataTable.FixedHeader=t;b(g).on("init.dt.dtfh",function(a,d,c){"dt"===a.namespace&&(a=
-d.oInit.fixedHeader,c=k.defaults.fixedHeader,!a&&!c||d._fixedHeader||(c=b.extend({},c,a),!1!==a&&new t(d,c)))});k.Api.register("fixedHeader()",function(){});k.Api.register("fixedHeader.adjust()",function(){return this.iterator("table",function(a){(a=a._fixedHeader)&&a.update()})});k.Api.register("fixedHeader.enable()",function(a){return this.iterator("table",function(d){d=d._fixedHeader;a=a!==l?a:!0;d&&a!==d.enabled()&&d.enable(a)})});k.Api.register("fixedHeader.enabled()",function(){if(this.context.length){var a=
-this.context[0]._fixedHeader;if(a)return a.enabled()}return!1});k.Api.register("fixedHeader.disable()",function(){return this.iterator("table",function(a){(a=a._fixedHeader)&&a.enabled()&&a.enable(!1)})});b.each(["header","footer"],function(a,d){k.Api.register("fixedHeader."+d+"Offset()",function(c){var f=this.context;return c===l?f.length&&f[0]._fixedHeader?f[0]._fixedHeader[d+"Offset"]():l:this.iterator("table",function(e){if(e=e._fixedHeader)e[d+"Offset"](c)})})});return t});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.js
deleted file mode 100644
index a60b9a0..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 3 styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.min.js
deleted file mode 100644
index 56713ac..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 3 styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.js
deleted file mode 100644
index b2a77d2..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 4 styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs4', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs4')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.min.js
deleted file mode 100644
index b763197..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap4.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 4 styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs4")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.js
deleted file mode 100644
index 989f6b6..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 5 styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs5', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs5')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.min.js
deleted file mode 100644
index 96ca24b..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bootstrap5.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 5 styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs5")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.js
deleted file mode 100644
index 5095189..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bulma styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bm', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bm')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.min.js
deleted file mode 100644
index 0b04409..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.bulma.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bulma styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bm")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.js
deleted file mode 100644
index 19b4653..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! DataTables styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-dt', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-dt')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.min.js
deleted file mode 100644
index f165b14..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.dataTables.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- DataTables styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-dt")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.js
deleted file mode 100644
index 66f02ad..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Foundation styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-zf', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-zf')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.min.js
deleted file mode 100644
index b9fc113..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.foundation.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Foundation styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-zf")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.js
deleted file mode 100644
index 3fec986..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! jQuery UI styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-jqui', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-jqui')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.min.js
deleted file mode 100644
index 5512c16..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.jqueryui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- jQuery UI styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-jqui")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.js
deleted file mode 100644
index d709e86..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Semanic UI styling wrapper for FixedHeader
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-se', 'datatables.net-fixedheader'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-se')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.FixedHeader ) {
- require('datatables.net-fixedheader')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.min.js b/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.min.js
deleted file mode 100644
index 424038a..0000000
--- a/web/DataTables/FixedHeader-3.2.4/js/fixedHeader.semanticui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Semanic UI styling wrapper for FixedHeader
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-se","datatables.net-fixedheader"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-se")(a,b).$);b.fn.dataTable.FixedHeader||require("datatables.net-fixedheader")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/JSZip-2.5.0/jszip.js b/web/DataTables/JSZip-2.5.0/jszip.js
deleted file mode 100644
index 1546d7f..0000000
--- a/web/DataTables/JSZip-2.5.0/jszip.js
+++ /dev/null
@@ -1,9155 +0,0 @@
-/*!
-
-JSZip - A Javascript class for generating and reading zip files
-
-
-(c) 2009-2014 Stuart Knightley
-Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
-
-JSZip uses the library pako released under the MIT license :
-https://github.com/nodeca/pako/blob/master/LICENSE
-*/
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSZip=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- }
- else if (isNaN(chr3)) {
- enc4 = 64;
- }
-
- output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
-
- }
-
- return output;
-};
-
-// public method for decoding
-exports.decode = function(input, utf8) {
- var output = "";
- var chr1, chr2, chr3;
- var enc1, enc2, enc3, enc4;
- var i = 0;
-
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- while (i < input.length) {
-
- enc1 = _keyStr.indexOf(input.charAt(i++));
- enc2 = _keyStr.indexOf(input.charAt(i++));
- enc3 = _keyStr.indexOf(input.charAt(i++));
- enc4 = _keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- output = output + String.fromCharCode(chr1);
-
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
- }
-
- }
-
- return output;
-
-};
-
-},{}],2:[function(_dereq_,module,exports){
-'use strict';
-function CompressedObject() {
- this.compressedSize = 0;
- this.uncompressedSize = 0;
- this.crc32 = 0;
- this.compressionMethod = null;
- this.compressedContent = null;
-}
-
-CompressedObject.prototype = {
- /**
- * Return the decompressed content in an unspecified format.
- * The format will depend on the decompressor.
- * @return {Object} the decompressed content.
- */
- getContent: function() {
- return null; // see implementation
- },
- /**
- * Return the compressed content in an unspecified format.
- * The format will depend on the compressed conten source.
- * @return {Object} the compressed content.
- */
- getCompressedContent: function() {
- return null; // see implementation
- }
-};
-module.exports = CompressedObject;
-
-},{}],3:[function(_dereq_,module,exports){
-'use strict';
-exports.STORE = {
- magic: "\x00\x00",
- compress: function(content, compressionOptions) {
- return content; // no compression
- },
- uncompress: function(content) {
- return content; // no compression
- },
- compressInputType: null,
- uncompressInputType: null
-};
-exports.DEFLATE = _dereq_('./flate');
-
-},{"./flate":8}],4:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('./utils');
-
-var table = [
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
- 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
- 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
- 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
- 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
- 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
- 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
- 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
- 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
- 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
- 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
- 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
- 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
- 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
- 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
- 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
- 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
- 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
- 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
- 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
- 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
- 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
- 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
- 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
- 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
- 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
- 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
- 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
- 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
- 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
- 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
- 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
- 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
- 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
- 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
- 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
- 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
- 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
- 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
- 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
- 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
- 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
- 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
- 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
- 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
- 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
- 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
- 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
- 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
- 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
- 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
- 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
-];
-
-/**
- *
- * Javascript crc32
- * http://www.webtoolkit.info/
- *
- */
-module.exports = function crc32(input, crc) {
- if (typeof input === "undefined" || !input.length) {
- return 0;
- }
-
- var isArray = utils.getTypeOf(input) !== "string";
-
- if (typeof(crc) == "undefined") {
- crc = 0;
- }
- var x = 0;
- var y = 0;
- var b = 0;
-
- crc = crc ^ (-1);
- for (var i = 0, iTop = input.length; i < iTop; i++) {
- b = isArray ? input[i] : input.charCodeAt(i);
- y = (crc ^ b) & 0xFF;
- x = table[y];
- crc = (crc >>> 8) ^ x;
- }
-
- return crc ^ (-1);
-};
-// vim: set shiftwidth=4 softtabstop=4:
-
-},{"./utils":21}],5:[function(_dereq_,module,exports){
-'use strict';
-var utils = _dereq_('./utils');
-
-function DataReader(data) {
- this.data = null; // type : see implementation
- this.length = 0;
- this.index = 0;
-}
-DataReader.prototype = {
- /**
- * Check that the offset will not go too far.
- * @param {string} offset the additional offset to check.
- * @throws {Error} an Error if the offset is out of bounds.
- */
- checkOffset: function(offset) {
- this.checkIndex(this.index + offset);
- },
- /**
- * Check that the specifed index will not be too far.
- * @param {string} newIndex the index to check.
- * @throws {Error} an Error if the index is out of bounds.
- */
- checkIndex: function(newIndex) {
- if (this.length < newIndex || newIndex < 0) {
- throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
- }
- },
- /**
- * Change the index.
- * @param {number} newIndex The new index.
- * @throws {Error} if the new index is out of the data.
- */
- setIndex: function(newIndex) {
- this.checkIndex(newIndex);
- this.index = newIndex;
- },
- /**
- * Skip the next n bytes.
- * @param {number} n the number of bytes to skip.
- * @throws {Error} if the new index is out of the data.
- */
- skip: function(n) {
- this.setIndex(this.index + n);
- },
- /**
- * Get the byte at the specified index.
- * @param {number} i the index to use.
- * @return {number} a byte.
- */
- byteAt: function(i) {
- // see implementations
- },
- /**
- * Get the next number with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {number} the corresponding number.
- */
- readInt: function(size) {
- var result = 0,
- i;
- this.checkOffset(size);
- for (i = this.index + size - 1; i >= this.index; i--) {
- result = (result << 8) + this.byteAt(i);
- }
- this.index += size;
- return result;
- },
- /**
- * Get the next string with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {string} the corresponding string.
- */
- readString: function(size) {
- return utils.transformTo("string", this.readData(size));
- },
- /**
- * Get raw data without conversion, bytes.
- * @param {number} size the number of bytes to read.
- * @return {Object} the raw data, implementation specific.
- */
- readData: function(size) {
- // see implementations
- },
- /**
- * Find the last occurence of a zip signature (4 bytes).
- * @param {string} sig the signature to find.
- * @return {number} the index of the last occurence, -1 if not found.
- */
- lastIndexOfSignature: function(sig) {
- // see implementations
- },
- /**
- * Get the next date.
- * @return {Date} the date.
- */
- readDate: function() {
- var dostime = this.readInt(4);
- return new Date(
- ((dostime >> 25) & 0x7f) + 1980, // year
- ((dostime >> 21) & 0x0f) - 1, // month
- (dostime >> 16) & 0x1f, // day
- (dostime >> 11) & 0x1f, // hour
- (dostime >> 5) & 0x3f, // minute
- (dostime & 0x1f) << 1); // second
- }
-};
-module.exports = DataReader;
-
-},{"./utils":21}],6:[function(_dereq_,module,exports){
-'use strict';
-exports.base64 = false;
-exports.binary = false;
-exports.dir = false;
-exports.createFolders = false;
-exports.date = null;
-exports.compression = null;
-exports.compressionOptions = null;
-exports.comment = null;
-exports.unixPermissions = null;
-exports.dosPermissions = null;
-
-},{}],7:[function(_dereq_,module,exports){
-'use strict';
-var utils = _dereq_('./utils');
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.string2binary = function(str) {
- return utils.string2binary(str);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.string2Uint8Array = function(str) {
- return utils.transformTo("uint8array", str);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.uint8Array2String = function(array) {
- return utils.transformTo("string", array);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.string2Blob = function(str) {
- var buffer = utils.transformTo("arraybuffer", str);
- return utils.arrayBuffer2Blob(buffer);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.arrayBuffer2Blob = function(buffer) {
- return utils.arrayBuffer2Blob(buffer);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.transformTo = function(outputType, input) {
- return utils.transformTo(outputType, input);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.getTypeOf = function(input) {
- return utils.getTypeOf(input);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.checkSupport = function(type) {
- return utils.checkSupport(type);
-};
-
-/**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
-exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS;
-
-/**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
-exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS;
-
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.pretty = function(str) {
- return utils.pretty(str);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.findCompression = function(compressionMethod) {
- return utils.findCompression(compressionMethod);
-};
-
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.isRegExp = function (object) {
- return utils.isRegExp(object);
-};
-
-
-},{"./utils":21}],8:[function(_dereq_,module,exports){
-'use strict';
-var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
-
-var pako = _dereq_("pako");
-exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
-exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
-
-exports.magic = "\x08\x00";
-exports.compress = function(input, compressionOptions) {
- return pako.deflateRaw(input, {
- level : compressionOptions.level || -1 // default compression
- });
-};
-exports.uncompress = function(input) {
- return pako.inflateRaw(input);
-};
-
-},{"pako":24}],9:[function(_dereq_,module,exports){
-'use strict';
-
-var base64 = _dereq_('./base64');
-
-/**
-Usage:
- zip = new JSZip();
- zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
- zip.folder("images").file("smile.gif", base64Data, {base64: true});
- zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
- zip.remove("tempfile");
-
- base64zip = zip.generate();
-
-**/
-
-/**
- * Representation a of zip file in js
- * @constructor
- * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional).
- * @param {Object=} options the options for creating this objects (optional).
- */
-function JSZip(data, options) {
- // if this constructor is used without `new`, it adds `new` before itself:
- if(!(this instanceof JSZip)) return new JSZip(data, options);
-
- // object containing the files :
- // {
- // "folder/" : {...},
- // "folder/data.txt" : {...}
- // }
- this.files = {};
-
- this.comment = null;
-
- // Where we are in the hierarchy
- this.root = "";
- if (data) {
- this.load(data, options);
- }
- this.clone = function() {
- var newObj = new JSZip();
- for (var i in this) {
- if (typeof this[i] !== "function") {
- newObj[i] = this[i];
- }
- }
- return newObj;
- };
-}
-JSZip.prototype = _dereq_('./object');
-JSZip.prototype.load = _dereq_('./load');
-JSZip.support = _dereq_('./support');
-JSZip.defaults = _dereq_('./defaults');
-
-/**
- * @deprecated
- * This namespace will be removed in a future version without replacement.
- */
-JSZip.utils = _dereq_('./deprecatedPublicUtils');
-
-JSZip.base64 = {
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- encode : function(input) {
- return base64.encode(input);
- },
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- decode : function(input) {
- return base64.decode(input);
- }
-};
-JSZip.compressions = _dereq_('./compressions');
-module.exports = JSZip;
-
-},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){
-'use strict';
-var base64 = _dereq_('./base64');
-var ZipEntries = _dereq_('./zipEntries');
-module.exports = function(data, options) {
- var files, zipEntries, i, input;
- options = options || {};
- if (options.base64) {
- data = base64.decode(data);
- }
-
- zipEntries = new ZipEntries(data, options);
- files = zipEntries.files;
- for (i = 0; i < files.length; i++) {
- input = files[i];
- this.file(input.fileName, input.decompressed, {
- binary: true,
- optimizedBinaryString: true,
- date: input.date,
- dir: input.dir,
- comment : input.fileComment.length ? input.fileComment : null,
- unixPermissions : input.unixPermissions,
- dosPermissions : input.dosPermissions,
- createFolders: options.createFolders
- });
- }
- if (zipEntries.zipComment.length) {
- this.comment = zipEntries.zipComment;
- }
-
- return this;
-};
-
-},{"./base64":1,"./zipEntries":22}],11:[function(_dereq_,module,exports){
-(function (Buffer){
-'use strict';
-module.exports = function(data, encoding){
- return new Buffer(data, encoding);
-};
-module.exports.test = function(b){
- return Buffer.isBuffer(b);
-};
-
-}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
-},{}],12:[function(_dereq_,module,exports){
-'use strict';
-var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
-
-function NodeBufferReader(data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
-}
-NodeBufferReader.prototype = new Uint8ArrayReader();
-
-/**
- * @see DataReader.readData
- */
-NodeBufferReader.prototype.readData = function(size) {
- this.checkOffset(size);
- var result = this.data.slice(this.index, this.index + size);
- this.index += size;
- return result;
-};
-module.exports = NodeBufferReader;
-
-},{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){
-'use strict';
-var support = _dereq_('./support');
-var utils = _dereq_('./utils');
-var crc32 = _dereq_('./crc32');
-var signature = _dereq_('./signature');
-var defaults = _dereq_('./defaults');
-var base64 = _dereq_('./base64');
-var compressions = _dereq_('./compressions');
-var CompressedObject = _dereq_('./compressedObject');
-var nodeBuffer = _dereq_('./nodeBuffer');
-var utf8 = _dereq_('./utf8');
-var StringWriter = _dereq_('./stringWriter');
-var Uint8ArrayWriter = _dereq_('./uint8ArrayWriter');
-
-/**
- * Returns the raw data of a ZipObject, decompress the content if necessary.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
- */
-var getRawData = function(file) {
- if (file._data instanceof CompressedObject) {
- file._data = file._data.getContent();
- file.options.binary = true;
- file.options.base64 = false;
-
- if (utils.getTypeOf(file._data) === "uint8array") {
- var copy = file._data;
- // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array.
- // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file).
- file._data = new Uint8Array(copy.length);
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- if (copy.length !== 0) {
- file._data.set(copy, 0);
- }
- }
- }
- return file._data;
-};
-
-/**
- * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
- */
-var getBinaryData = function(file) {
- var result = getRawData(file),
- type = utils.getTypeOf(result);
- if (type === "string") {
- if (!file.options.binary) {
- // unicode text !
- // unicode string => binary string is a painful process, check if we can avoid it.
- if (support.nodebuffer) {
- return nodeBuffer(result, "utf-8");
- }
- }
- return file.asBinary();
- }
- return result;
-};
-
-/**
- * Transform this._data into a string.
- * @param {function} filter a function String -> String, applied if not null on the result.
- * @return {String} the string representing this._data.
- */
-var dataToString = function(asUTF8) {
- var result = getRawData(this);
- if (result === null || typeof result === "undefined") {
- return "";
- }
- // if the data is a base64 string, we decode it before checking the encoding !
- if (this.options.base64) {
- result = base64.decode(result);
- }
- if (asUTF8 && this.options.binary) {
- // JSZip.prototype.utf8decode supports arrays as input
- // skip to array => string step, utf8decode will do it.
- result = out.utf8decode(result);
- }
- else {
- // no utf8 transformation, do the array => string step.
- result = utils.transformTo("string", result);
- }
-
- if (!asUTF8 && !this.options.binary) {
- result = utils.transformTo("string", out.utf8encode(result));
- }
- return result;
-};
-/**
- * A simple object representing a file in the zip file.
- * @constructor
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
- * @param {Object} options the options of the file
- */
-var ZipObject = function(name, data, options) {
- this.name = name;
- this.dir = options.dir;
- this.date = options.date;
- this.comment = options.comment;
- this.unixPermissions = options.unixPermissions;
- this.dosPermissions = options.dosPermissions;
-
- this._data = data;
- this.options = options;
-
- /*
- * This object contains initial values for dir and date.
- * With them, we can check if the user changed the deprecated metadata in
- * `ZipObject#options` or not.
- */
- this._initialMetadata = {
- dir : options.dir,
- date : options.date
- };
-};
-
-ZipObject.prototype = {
- /**
- * Return the content as UTF8 string.
- * @return {string} the UTF8 string.
- */
- asText: function() {
- return dataToString.call(this, true);
- },
- /**
- * Returns the binary content.
- * @return {string} the content as binary.
- */
- asBinary: function() {
- return dataToString.call(this, false);
- },
- /**
- * Returns the content as a nodejs Buffer.
- * @return {Buffer} the content as a Buffer.
- */
- asNodeBuffer: function() {
- var result = getBinaryData(this);
- return utils.transformTo("nodebuffer", result);
- },
- /**
- * Returns the content as an Uint8Array.
- * @return {Uint8Array} the content as an Uint8Array.
- */
- asUint8Array: function() {
- var result = getBinaryData(this);
- return utils.transformTo("uint8array", result);
- },
- /**
- * Returns the content as an ArrayBuffer.
- * @return {ArrayBuffer} the content as an ArrayBufer.
- */
- asArrayBuffer: function() {
- return this.asUint8Array().buffer;
- }
-};
-
-/**
- * Transform an integer into a string in hexadecimal.
- * @private
- * @param {number} dec the number to convert.
- * @param {number} bytes the number of bytes to generate.
- * @returns {string} the result.
- */
-var decToHex = function(dec, bytes) {
- var hex = "",
- i;
- for (i = 0; i < bytes; i++) {
- hex += String.fromCharCode(dec & 0xff);
- dec = dec >>> 8;
- }
- return hex;
-};
-
-/**
- * Merge the objects passed as parameters into a new one.
- * @private
- * @param {...Object} var_args All objects to merge.
- * @return {Object} a new object with the data of the others.
- */
-var extend = function() {
- var result = {}, i, attr;
- for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
- for (attr in arguments[i]) {
- if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") {
- result[attr] = arguments[i][attr];
- }
- }
- }
- return result;
-};
-
-/**
- * Transforms the (incomplete) options from the user into the complete
- * set of options to create a file.
- * @private
- * @param {Object} o the options from the user.
- * @return {Object} the complete set of options.
- */
-var prepareFileAttrs = function(o) {
- o = o || {};
- if (o.base64 === true && (o.binary === null || o.binary === undefined)) {
- o.binary = true;
- }
- o = extend(o, defaults);
- o.date = o.date || new Date();
- if (o.compression !== null) o.compression = o.compression.toUpperCase();
-
- return o;
-};
-
-/**
- * Add a file in the current folder.
- * @private
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
- * @param {Object} o the options of the file
- * @return {Object} the new file.
- */
-var fileAdd = function(name, data, o) {
- // be sure sub folders exist
- var dataType = utils.getTypeOf(data),
- parent;
-
- o = prepareFileAttrs(o);
-
- if (typeof o.unixPermissions === "string") {
- o.unixPermissions = parseInt(o.unixPermissions, 8);
- }
-
- // UNX_IFDIR 0040000 see zipinfo.c
- if (o.unixPermissions && (o.unixPermissions & 0x4000)) {
- o.dir = true;
- }
- // Bit 4 Directory
- if (o.dosPermissions && (o.dosPermissions & 0x0010)) {
- o.dir = true;
- }
-
- if (o.dir) {
- name = forceTrailingSlash(name);
- }
-
- if (o.createFolders && (parent = parentFolder(name))) {
- folderAdd.call(this, parent, true);
- }
-
- if (o.dir || data === null || typeof data === "undefined") {
- o.base64 = false;
- o.binary = false;
- data = null;
- dataType = null;
- }
- else if (dataType === "string") {
- if (o.binary && !o.base64) {
- // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask
- if (o.optimizedBinaryString !== true) {
- // this is a string, not in a base64 format.
- // Be sure that this is a correct "binary string"
- data = utils.string2binary(data);
- }
- }
- }
- else { // arraybuffer, uint8array, ...
- o.base64 = false;
- o.binary = true;
-
- if (!dataType && !(data instanceof CompressedObject)) {
- throw new Error("The data of '" + name + "' is in an unsupported format !");
- }
-
- // special case : it's way easier to work with Uint8Array than with ArrayBuffer
- if (dataType === "arraybuffer") {
- data = utils.transformTo("uint8array", data);
- }
- }
-
- var object = new ZipObject(name, data, o);
- this.files[name] = object;
- return object;
-};
-
-/**
- * Find the parent folder of the path.
- * @private
- * @param {string} path the path to use
- * @return {string} the parent folder, or ""
- */
-var parentFolder = function (path) {
- if (path.slice(-1) == '/') {
- path = path.substring(0, path.length - 1);
- }
- var lastSlash = path.lastIndexOf('/');
- return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
-};
-
-
-/**
- * Returns the path with a slash at the end.
- * @private
- * @param {String} path the path to check.
- * @return {String} the path with a trailing slash.
- */
-var forceTrailingSlash = function(path) {
- // Check the name ends with a /
- if (path.slice(-1) != "/") {
- path += "/"; // IE doesn't like substr(-1)
- }
- return path;
-};
-/**
- * Add a (sub) folder in the current folder.
- * @private
- * @param {string} name the folder's name
- * @param {boolean=} [createFolders] If true, automatically create sub
- * folders. Defaults to false.
- * @return {Object} the new folder.
- */
-var folderAdd = function(name, createFolders) {
- createFolders = (typeof createFolders !== 'undefined') ? createFolders : false;
-
- name = forceTrailingSlash(name);
-
- // Does this folder already exist?
- if (!this.files[name]) {
- fileAdd.call(this, name, null, {
- dir: true,
- createFolders: createFolders
- });
- }
- return this.files[name];
-};
-
-/**
- * Generate a JSZip.CompressedObject for a given zipOject.
- * @param {ZipObject} file the object to read.
- * @param {JSZip.compression} compression the compression to use.
- * @param {Object} compressionOptions the options to use when compressing.
- * @return {JSZip.CompressedObject} the compressed result.
- */
-var generateCompressedObjectFrom = function(file, compression, compressionOptions) {
- var result = new CompressedObject(),
- content;
-
- // the data has not been decompressed, we might reuse things !
- if (file._data instanceof CompressedObject) {
- result.uncompressedSize = file._data.uncompressedSize;
- result.crc32 = file._data.crc32;
-
- if (result.uncompressedSize === 0 || file.dir) {
- compression = compressions['STORE'];
- result.compressedContent = "";
- result.crc32 = 0;
- }
- else if (file._data.compressionMethod === compression.magic) {
- result.compressedContent = file._data.getCompressedContent();
- }
- else {
- content = file._data.getContent();
- // need to decompress / recompress
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);
- }
- }
- else {
- // have uncompressed data
- content = getBinaryData(file);
- if (!content || content.length === 0 || file.dir) {
- compression = compressions['STORE'];
- content = "";
- }
- result.uncompressedSize = content.length;
- result.crc32 = crc32(content);
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);
- }
-
- result.compressedSize = result.compressedContent.length;
- result.compressionMethod = compression.magic;
-
- return result;
-};
-
-
-
-
-/**
- * Generate the UNIX part of the external file attributes.
- * @param {Object} unixPermissions the unix permissions or null.
- * @param {Boolean} isDir true if the entry is a directory, false otherwise.
- * @return {Number} a 32 bit integer.
- *
- * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute :
- *
- * TTTTsstrwxrwxrwx0000000000ADVSHR
- * ^^^^____________________________ file type, see zipinfo.c (UNX_*)
- * ^^^_________________________ setuid, setgid, sticky
- * ^^^^^^^^^________________ permissions
- * ^^^^^^^^^^______ not used ?
- * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only
- */
-var generateUnixExternalFileAttr = function (unixPermissions, isDir) {
-
- var result = unixPermissions;
- if (!unixPermissions) {
- // I can't use octal values in strict mode, hence the hexa.
- // 040775 => 0x41fd
- // 0100664 => 0x81b4
- result = isDir ? 0x41fd : 0x81b4;
- }
-
- return (result & 0xFFFF) << 16;
-};
-
-/**
- * Generate the DOS part of the external file attributes.
- * @param {Object} dosPermissions the dos permissions or null.
- * @param {Boolean} isDir true if the entry is a directory, false otherwise.
- * @return {Number} a 32 bit integer.
- *
- * Bit 0 Read-Only
- * Bit 1 Hidden
- * Bit 2 System
- * Bit 3 Volume Label
- * Bit 4 Directory
- * Bit 5 Archive
- */
-var generateDosExternalFileAttr = function (dosPermissions, isDir) {
-
- // the dir flag is already set for compatibility
-
- return (dosPermissions || 0) & 0x3F;
-};
-
-/**
- * Generate the various parts used in the construction of the final zip file.
- * @param {string} name the file name.
- * @param {ZipObject} file the file content.
- * @param {JSZip.CompressedObject} compressedObject the compressed object.
- * @param {number} offset the current offset from the start of the zip file.
- * @param {String} platform let's pretend we are this platform (change platform dependents fields)
- * @return {object} the zip parts.
- */
-var generateZipParts = function(name, file, compressedObject, offset, platform) {
- var data = compressedObject.compressedContent,
- utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
- comment = file.comment || "",
- utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
- useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,
- useUTF8ForComment = utfEncodedComment.length !== comment.length,
- o = file.options,
- dosTime,
- dosDate,
- extraFields = "",
- unicodePathExtraField = "",
- unicodeCommentExtraField = "",
- dir, date;
-
-
- // handle the deprecated options.dir
- if (file._initialMetadata.dir !== file.dir) {
- dir = file.dir;
- } else {
- dir = o.dir;
- }
-
- // handle the deprecated options.date
- if(file._initialMetadata.date !== file.date) {
- date = file.date;
- } else {
- date = o.date;
- }
-
- var extFileAttr = 0;
- var versionMadeBy = 0;
- if (dir) {
- // dos or unix, we set the dos dir flag
- extFileAttr |= 0x00010;
- }
- if(platform === "UNIX") {
- versionMadeBy = 0x031E; // UNIX, version 3.0
- extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir);
- } else { // DOS or other, fallback to DOS
- versionMadeBy = 0x0014; // DOS, version 2.0
- extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir);
- }
-
- // date
- // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html
- // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html
- // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html
-
- dosTime = date.getHours();
- dosTime = dosTime << 6;
- dosTime = dosTime | date.getMinutes();
- dosTime = dosTime << 5;
- dosTime = dosTime | date.getSeconds() / 2;
-
- dosDate = date.getFullYear() - 1980;
- dosDate = dosDate << 4;
- dosDate = dosDate | (date.getMonth() + 1);
- dosDate = dosDate << 5;
- dosDate = dosDate | date.getDate();
-
- if (useUTF8ForFileName) {
- // set the unicode path extra field. unzip needs at least one extra
- // field to correctly handle unicode path, so using the path is as good
- // as any other information. This could improve the situation with
- // other archive managers too.
- // This field is usually used without the utf8 flag, with a non
- // unicode path in the header (winrar, winzip). This helps (a bit)
- // with the messy Windows' default compressed folders feature but
- // breaks on p7zip which doesn't seek the unicode path extra field.
- // So for now, UTF-8 everywhere !
- unicodePathExtraField =
- // Version
- decToHex(1, 1) +
- // NameCRC32
- decToHex(crc32(utfEncodedFileName), 4) +
- // UnicodeName
- utfEncodedFileName;
-
- extraFields +=
- // Info-ZIP Unicode Path Extra Field
- "\x75\x70" +
- // size
- decToHex(unicodePathExtraField.length, 2) +
- // content
- unicodePathExtraField;
- }
-
- if(useUTF8ForComment) {
-
- unicodeCommentExtraField =
- // Version
- decToHex(1, 1) +
- // CommentCRC32
- decToHex(this.crc32(utfEncodedComment), 4) +
- // UnicodeName
- utfEncodedComment;
-
- extraFields +=
- // Info-ZIP Unicode Path Extra Field
- "\x75\x63" +
- // size
- decToHex(unicodeCommentExtraField.length, 2) +
- // content
- unicodeCommentExtraField;
- }
-
- var header = "";
-
- // version needed to extract
- header += "\x0A\x00";
- // general purpose bit flag
- // set bit 11 if utf8
- header += (useUTF8ForFileName || useUTF8ForComment) ? "\x00\x08" : "\x00\x00";
- // compression method
- header += compressedObject.compressionMethod;
- // last mod file time
- header += decToHex(dosTime, 2);
- // last mod file date
- header += decToHex(dosDate, 2);
- // crc-32
- header += decToHex(compressedObject.crc32, 4);
- // compressed size
- header += decToHex(compressedObject.compressedSize, 4);
- // uncompressed size
- header += decToHex(compressedObject.uncompressedSize, 4);
- // file name length
- header += decToHex(utfEncodedFileName.length, 2);
- // extra field length
- header += decToHex(extraFields.length, 2);
-
-
- var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields;
-
- var dirRecord = signature.CENTRAL_FILE_HEADER +
- // version made by (00: DOS)
- decToHex(versionMadeBy, 2) +
- // file header (common to file and central directory)
- header +
- // file comment length
- decToHex(utfEncodedComment.length, 2) +
- // disk number start
- "\x00\x00" +
- // internal file attributes TODO
- "\x00\x00" +
- // external file attributes
- decToHex(extFileAttr, 4) +
- // relative offset of local header
- decToHex(offset, 4) +
- // file name
- utfEncodedFileName +
- // extra field
- extraFields +
- // file comment
- utfEncodedComment;
-
- return {
- fileRecord: fileRecord,
- dirRecord: dirRecord,
- compressedObject: compressedObject
- };
-};
-
-
-// return the actual prototype of JSZip
-var out = {
- /**
- * Read an existing zip and merge the data in the current JSZip object.
- * The implementation is in jszip-load.js, don't forget to include it.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} stream The stream to load
- * @param {Object} options Options for loading the stream.
- * options.base64 : is the stream in base64 ? default : false
- * @return {JSZip} the current JSZip object
- */
- load: function(stream, options) {
- throw new Error("Load method is not defined. Is the file jszip-load.js included ?");
- },
-
- /**
- * Filter nested files/folders with the specified function.
- * @param {Function} search the predicate to use :
- * function (relativePath, file) {...}
- * It takes 2 arguments : the relative path and the file.
- * @return {Array} An array of matching elements.
- */
- filter: function(search) {
- var result = [],
- filename, relativePath, file, fileClone;
- for (filename in this.files) {
- if (!this.files.hasOwnProperty(filename)) {
- continue;
- }
- file = this.files[filename];
- // return a new object, don't let the user mess with our internal objects :)
- fileClone = new ZipObject(file.name, file._data, extend(file.options));
- relativePath = filename.slice(this.root.length, filename.length);
- if (filename.slice(0, this.root.length) === this.root && // the file is in the current root
- search(relativePath, fileClone)) { // and the file matches the function
- result.push(fileClone);
- }
- }
- return result;
- },
-
- /**
- * Add a file to the zip file, or search a file.
- * @param {string|RegExp} name The name of the file to add (if data is defined),
- * the name of the file to find (if no data) or a regex to match files.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded
- * @param {Object} o File options
- * @return {JSZip|Object|Array} this JSZip object (when adding a file),
- * a file (when searching by string) or an array of files (when searching by regex).
- */
- file: function(name, data, o) {
- if (arguments.length === 1) {
- if (utils.isRegExp(name)) {
- var regexp = name;
- return this.filter(function(relativePath, file) {
- return !file.dir && regexp.test(relativePath);
- });
- }
- else { // text
- return this.filter(function(relativePath, file) {
- return !file.dir && relativePath === name;
- })[0] || null;
- }
- }
- else { // more than one argument : we have data !
- name = this.root + name;
- fileAdd.call(this, name, data, o);
- }
- return this;
- },
-
- /**
- * Add a directory to the zip file, or search.
- * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders.
- * @return {JSZip} an object with the new directory as the root, or an array containing matching folders.
- */
- folder: function(arg) {
- if (!arg) {
- return this;
- }
-
- if (utils.isRegExp(arg)) {
- return this.filter(function(relativePath, file) {
- return file.dir && arg.test(relativePath);
- });
- }
-
- // else, name is a new folder
- var name = this.root + arg;
- var newFolder = folderAdd.call(this, name);
-
- // Allow chaining by returning a new object with this folder as the root
- var ret = this.clone();
- ret.root = newFolder.name;
- return ret;
- },
-
- /**
- * Delete a file, or a directory and all sub-files, from the zip
- * @param {string} name the name of the file to delete
- * @return {JSZip} this JSZip object
- */
- remove: function(name) {
- name = this.root + name;
- var file = this.files[name];
- if (!file) {
- // Look for any folders
- if (name.slice(-1) != "/") {
- name += "/";
- }
- file = this.files[name];
- }
-
- if (file && !file.dir) {
- // file
- delete this.files[name];
- } else {
- // maybe a folder, delete recursively
- var kids = this.filter(function(relativePath, file) {
- return file.name.slice(0, name.length) === name;
- });
- for (var i = 0; i < kids.length; i++) {
- delete this.files[kids[i].name];
- }
- }
-
- return this;
- },
-
- /**
- * Generate the complete zip file
- * @param {Object} options the options to generate the zip file :
- * - base64, (deprecated, use type instead) true to generate base64.
- * - compression, "STORE" by default.
- * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
- * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file
- */
- generate: function(options) {
- options = extend(options || {}, {
- base64: true,
- compression: "STORE",
- compressionOptions : null,
- type: "base64",
- platform: "DOS",
- comment: null,
- mimeType: 'application/zip'
- });
-
- utils.checkSupport(options.type);
-
- // accept nodejs `process.platform`
- if(
- options.platform === 'darwin' ||
- options.platform === 'freebsd' ||
- options.platform === 'linux' ||
- options.platform === 'sunos'
- ) {
- options.platform = "UNIX";
- }
- if (options.platform === 'win32') {
- options.platform = "DOS";
- }
-
- var zipData = [],
- localDirLength = 0,
- centralDirLength = 0,
- writer, i,
- utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || ""));
-
- // first, generate all the zip parts.
- for (var name in this.files) {
- if (!this.files.hasOwnProperty(name)) {
- continue;
- }
- var file = this.files[name];
-
- var compressionName = file.options.compression || options.compression.toUpperCase();
- var compression = compressions[compressionName];
- if (!compression) {
- throw new Error(compressionName + " is not a valid compression method !");
- }
- var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};
-
- var compressedObject = generateCompressedObjectFrom.call(this, file, compression, compressionOptions);
-
- var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength, options.platform);
- localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize;
- centralDirLength += zipPart.dirRecord.length;
- zipData.push(zipPart);
- }
-
- var dirEnd = "";
-
- // end of central dir signature
- dirEnd = signature.CENTRAL_DIRECTORY_END +
- // number of this disk
- "\x00\x00" +
- // number of the disk with the start of the central directory
- "\x00\x00" +
- // total number of entries in the central directory on this disk
- decToHex(zipData.length, 2) +
- // total number of entries in the central directory
- decToHex(zipData.length, 2) +
- // size of the central directory 4 bytes
- decToHex(centralDirLength, 4) +
- // offset of start of central directory with respect to the starting disk number
- decToHex(localDirLength, 4) +
- // .ZIP file comment length
- decToHex(utfEncodedComment.length, 2) +
- // .ZIP file comment
- utfEncodedComment;
-
-
- // we have all the parts (and the total length)
- // time to create a writer !
- var typeName = options.type.toLowerCase();
- if(typeName==="uint8array"||typeName==="arraybuffer"||typeName==="blob"||typeName==="nodebuffer") {
- writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length);
- }else{
- writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length);
- }
-
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].fileRecord);
- writer.append(zipData[i].compressedObject.compressedContent);
- }
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].dirRecord);
- }
-
- writer.append(dirEnd);
-
- var zip = writer.finalize();
-
-
-
- switch(options.type.toLowerCase()) {
- // case "zip is an Uint8Array"
- case "uint8array" :
- case "arraybuffer" :
- case "nodebuffer" :
- return utils.transformTo(options.type.toLowerCase(), zip);
- case "blob" :
- return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip), options.mimeType);
- // case "zip is a string"
- case "base64" :
- return (options.base64) ? base64.encode(zip) : zip;
- default : // case "string" :
- return zip;
- }
-
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- crc32: function (input, crc) {
- return crc32(input, crc);
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- utf8encode: function (string) {
- return utils.transformTo("string", utf8.utf8encode(string));
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- utf8decode: function (input) {
- return utf8.utf8decode(input);
- }
-};
-module.exports = out;
-
-},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(_dereq_,module,exports){
-'use strict';
-exports.LOCAL_FILE_HEADER = "PK\x03\x04";
-exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
-exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
-exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
-exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
-exports.DATA_DESCRIPTOR = "PK\x07\x08";
-
-},{}],15:[function(_dereq_,module,exports){
-'use strict';
-var DataReader = _dereq_('./dataReader');
-var utils = _dereq_('./utils');
-
-function StringReader(data, optimizedBinaryString) {
- this.data = data;
- if (!optimizedBinaryString) {
- this.data = utils.string2binary(this.data);
- }
- this.length = this.data.length;
- this.index = 0;
-}
-StringReader.prototype = new DataReader();
-/**
- * @see DataReader.byteAt
- */
-StringReader.prototype.byteAt = function(i) {
- return this.data.charCodeAt(i);
-};
-/**
- * @see DataReader.lastIndexOfSignature
- */
-StringReader.prototype.lastIndexOfSignature = function(sig) {
- return this.data.lastIndexOf(sig);
-};
-/**
- * @see DataReader.readData
- */
-StringReader.prototype.readData = function(size) {
- this.checkOffset(size);
- // this will work because the constructor applied the "& 0xff" mask.
- var result = this.data.slice(this.index, this.index + size);
- this.index += size;
- return result;
-};
-module.exports = StringReader;
-
-},{"./dataReader":5,"./utils":21}],16:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('./utils');
-
-/**
- * An object to write any content to a string.
- * @constructor
- */
-var StringWriter = function() {
- this.data = [];
-};
-StringWriter.prototype = {
- /**
- * Append any content to the current string.
- * @param {Object} input the content to add.
- */
- append: function(input) {
- input = utils.transformTo("string", input);
- this.data.push(input);
- },
- /**
- * Finalize the construction an return the result.
- * @return {string} the generated string.
- */
- finalize: function() {
- return this.data.join("");
- }
-};
-
-module.exports = StringWriter;
-
-},{"./utils":21}],17:[function(_dereq_,module,exports){
-(function (Buffer){
-'use strict';
-exports.base64 = true;
-exports.array = true;
-exports.string = true;
-exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
-// contains true if JSZip can read/generate nodejs Buffer, false otherwise.
-// Browserify will provide a Buffer implementation for browsers, which is
-// an augmented Uint8Array (i.e., can be used as either Buffer or U8).
-exports.nodebuffer = typeof Buffer !== "undefined";
-// contains true if JSZip can read/generate Uint8Array, false otherwise.
-exports.uint8array = typeof Uint8Array !== "undefined";
-
-if (typeof ArrayBuffer === "undefined") {
- exports.blob = false;
-}
-else {
- var buffer = new ArrayBuffer(0);
- try {
- exports.blob = new Blob([buffer], {
- type: "application/zip"
- }).size === 0;
- }
- catch (e) {
- try {
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
- var builder = new Builder();
- builder.append(buffer);
- exports.blob = builder.getBlob('application/zip').size === 0;
- }
- catch (e) {
- exports.blob = false;
- }
- }
-}
-
-}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
-},{}],18:[function(_dereq_,module,exports){
-'use strict';
-var DataReader = _dereq_('./dataReader');
-
-function Uint8ArrayReader(data) {
- if (data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
- }
-}
-Uint8ArrayReader.prototype = new DataReader();
-/**
- * @see DataReader.byteAt
- */
-Uint8ArrayReader.prototype.byteAt = function(i) {
- return this.data[i];
-};
-/**
- * @see DataReader.lastIndexOfSignature
- */
-Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) {
- var sig0 = sig.charCodeAt(0),
- sig1 = sig.charCodeAt(1),
- sig2 = sig.charCodeAt(2),
- sig3 = sig.charCodeAt(3);
- for (var i = this.length - 4; i >= 0; --i) {
- if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
- return i;
- }
- }
-
- return -1;
-};
-/**
- * @see DataReader.readData
- */
-Uint8ArrayReader.prototype.readData = function(size) {
- this.checkOffset(size);
- if(size === 0) {
- // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
- return new Uint8Array(0);
- }
- var result = this.data.subarray(this.index, this.index + size);
- this.index += size;
- return result;
-};
-module.exports = Uint8ArrayReader;
-
-},{"./dataReader":5}],19:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('./utils');
-
-/**
- * An object to write any content to an Uint8Array.
- * @constructor
- * @param {number} length The length of the array.
- */
-var Uint8ArrayWriter = function(length) {
- this.data = new Uint8Array(length);
- this.index = 0;
-};
-Uint8ArrayWriter.prototype = {
- /**
- * Append any content to the current array.
- * @param {Object} input the content to add.
- */
- append: function(input) {
- if (input.length !== 0) {
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- input = utils.transformTo("uint8array", input);
- this.data.set(input, this.index);
- this.index += input.length;
- }
- },
- /**
- * Finalize the construction an return the result.
- * @return {Uint8Array} the generated array.
- */
- finalize: function() {
- return this.data;
- }
-};
-
-module.exports = Uint8ArrayWriter;
-
-},{"./utils":21}],20:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('./utils');
-var support = _dereq_('./support');
-var nodeBuffer = _dereq_('./nodeBuffer');
-
-/**
- * The following functions come from pako, from pako/lib/utils/strings
- * released under the MIT license, see pako https://github.com/nodeca/pako/
- */
-
-// Table with utf8 lengths (calculated by first byte of sequence)
-// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
-// because max possible codepoint is 0x10ffff
-var _utf8len = new Array(256);
-for (var i=0; i<256; i++) {
- _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
-}
-_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
-
-// convert string to array (typed, when possible)
-var string2buf = function (str) {
- var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
-
- // count binary size
- for (m_pos = 0; m_pos < str_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
- }
-
- // allocate buffer
- if (support.uint8array) {
- buf = new Uint8Array(buf_len);
- } else {
- buf = new Array(buf_len);
- }
-
- // convert
- for (i=0, m_pos = 0; i < buf_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- if (c < 0x80) {
- /* one byte */
- buf[i++] = c;
- } else if (c < 0x800) {
- /* two bytes */
- buf[i++] = 0xC0 | (c >>> 6);
- buf[i++] = 0x80 | (c & 0x3f);
- } else if (c < 0x10000) {
- /* three bytes */
- buf[i++] = 0xE0 | (c >>> 12);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- } else {
- /* four bytes */
- buf[i++] = 0xf0 | (c >>> 18);
- buf[i++] = 0x80 | (c >>> 12 & 0x3f);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- }
- }
-
- return buf;
-};
-
-// Calculate max possible position in utf8 buffer,
-// that will not break sequence. If that's not possible
-// - (very small limits) return max size as is.
-//
-// buf[] - utf8 bytes array
-// max - length limit (mandatory);
-var utf8border = function(buf, max) {
- var pos;
-
- max = max || buf.length;
- if (max > buf.length) { max = buf.length; }
-
- // go back from last position, until start of sequence found
- pos = max-1;
- while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
-
- // Fuckup - very small and broken sequence,
- // return max, because we should return something anyway.
- if (pos < 0) { return max; }
-
- // If we came to start of buffer - that means vuffer is too small,
- // return max too.
- if (pos === 0) { return max; }
-
- return (pos + _utf8len[buf[pos]] > max) ? pos : max;
-};
-
-// convert array to string
-var buf2string = function (buf) {
- var str, i, out, c, c_len;
- var len = buf.length;
-
- // Reserve max possible length (2 words per char)
- // NB: by unknown reasons, Array is significantly faster for
- // String.fromCharCode.apply than Uint16Array.
- var utf16buf = new Array(len*2);
-
- for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
-
- // apply mask on first byte
- c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
- // join the rest
- while (c_len > 1 && i < len) {
- c = (c << 6) | (buf[i++] & 0x3f);
- c_len--;
- }
-
- // terminated by end of string?
- if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
-
- if (c < 0x10000) {
- utf16buf[out++] = c;
- } else {
- c -= 0x10000;
- utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
- utf16buf[out++] = 0xdc00 | (c & 0x3ff);
- }
- }
-
- // shrinkBuf(utf16buf, out)
- if (utf16buf.length !== out) {
- if(utf16buf.subarray) {
- utf16buf = utf16buf.subarray(0, out);
- } else {
- utf16buf.length = out;
- }
- }
-
- // return String.fromCharCode.apply(null, utf16buf);
- return utils.applyFromCharCode(utf16buf);
-};
-
-
-// That's all for the pako functions.
-
-
-/**
- * Transform a javascript string into an array (typed if possible) of bytes,
- * UTF-8 encoded.
- * @param {String} str the string to encode
- * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.
- */
-exports.utf8encode = function utf8encode(str) {
- if (support.nodebuffer) {
- return nodeBuffer(str, "utf-8");
- }
-
- return string2buf(str);
-};
-
-
-/**
- * Transform a bytes array (or a representation) representing an UTF-8 encoded
- * string into a javascript string.
- * @param {Array|Uint8Array|Buffer} buf the data de decode
- * @return {String} the decoded string.
- */
-exports.utf8decode = function utf8decode(buf) {
- if (support.nodebuffer) {
- return utils.transformTo("nodebuffer", buf).toString("utf-8");
- }
-
- buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);
-
- // return buf2string(buf);
- // Chrome prefers to work with "small" chunks of data
- // for the method buf2string.
- // Firefox and Chrome has their own shortcut, IE doesn't seem to really care.
- var result = [], k = 0, len = buf.length, chunk = 65536;
- while (k < len) {
- var nextBoundary = utf8border(buf, Math.min(k + chunk, len));
- if (support.uint8array) {
- result.push(buf2string(buf.subarray(k, nextBoundary)));
- } else {
- result.push(buf2string(buf.slice(k, nextBoundary)));
- }
- k = nextBoundary;
- }
- return result.join("");
-
-};
-// vim: set shiftwidth=4 softtabstop=4:
-
-},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){
-'use strict';
-var support = _dereq_('./support');
-var compressions = _dereq_('./compressions');
-var nodeBuffer = _dereq_('./nodeBuffer');
-/**
- * Convert a string to a "binary string" : a string containing only char codes between 0 and 255.
- * @param {string} str the string to transform.
- * @return {String} the binary string.
- */
-exports.string2binary = function(str) {
- var result = "";
- for (var i = 0; i < str.length; i++) {
- result += String.fromCharCode(str.charCodeAt(i) & 0xff);
- }
- return result;
-};
-exports.arrayBuffer2Blob = function(buffer, mimeType) {
- exports.checkSupport("blob");
- mimeType = mimeType || 'application/zip';
-
- try {
- // Blob constructor
- return new Blob([buffer], {
- type: mimeType
- });
- }
- catch (e) {
-
- try {
- // deprecated, browser only, old way
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
- var builder = new Builder();
- builder.append(buffer);
- return builder.getBlob(mimeType);
- }
- catch (e) {
-
- // well, fuck ?!
- throw new Error("Bug : can't construct the Blob.");
- }
- }
-
-
-};
-/**
- * The identity function.
- * @param {Object} input the input.
- * @return {Object} the same input.
- */
-function identity(input) {
- return input;
-}
-
-/**
- * Fill in an array with a string.
- * @param {String} str the string to use.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).
- * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.
- */
-function stringToArrayLike(str, array) {
- for (var i = 0; i < str.length; ++i) {
- array[i] = str.charCodeAt(i) & 0xFF;
- }
- return array;
-}
-
-/**
- * Transform an array-like object to a string.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
- * @return {String} the result.
- */
-function arrayLikeToString(array) {
- // Performances notes :
- // --------------------
- // String.fromCharCode.apply(null, array) is the fastest, see
- // see http://jsperf.com/converting-a-uint8array-to-a-string/2
- // but the stack is limited (and we can get huge arrays !).
- //
- // result += String.fromCharCode(array[i]); generate too many strings !
- //
- // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
- var chunk = 65536;
- var result = [],
- len = array.length,
- type = exports.getTypeOf(array),
- k = 0,
- canUseApply = true;
- try {
- switch(type) {
- case "uint8array":
- String.fromCharCode.apply(null, new Uint8Array(0));
- break;
- case "nodebuffer":
- String.fromCharCode.apply(null, nodeBuffer(0));
- break;
- }
- } catch(e) {
- canUseApply = false;
- }
-
- // no apply : slow and painful algorithm
- // default browser on android 4.*
- if (!canUseApply) {
- var resultStr = "";
- for(var i = 0; i < array.length;i++) {
- resultStr += String.fromCharCode(array[i]);
- }
- return resultStr;
- }
- while (k < len && chunk > 1) {
- try {
- if (type === "array" || type === "nodebuffer") {
- result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
- }
- else {
- result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));
- }
- k += chunk;
- }
- catch (e) {
- chunk = Math.floor(chunk / 2);
- }
- }
- return result.join("");
-}
-
-exports.applyFromCharCode = arrayLikeToString;
-
-
-/**
- * Copy the data from an array-like to an other array-like.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.
- * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.
- */
-function arrayLikeToArrayLike(arrayFrom, arrayTo) {
- for (var i = 0; i < arrayFrom.length; i++) {
- arrayTo[i] = arrayFrom[i];
- }
- return arrayTo;
-}
-
-// a matrix containing functions to transform everything into everything.
-var transform = {};
-
-// string to ?
-transform["string"] = {
- "string": identity,
- "array": function(input) {
- return stringToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return transform["string"]["uint8array"](input).buffer;
- },
- "uint8array": function(input) {
- return stringToArrayLike(input, new Uint8Array(input.length));
- },
- "nodebuffer": function(input) {
- return stringToArrayLike(input, nodeBuffer(input.length));
- }
-};
-
-// array to ?
-transform["array"] = {
- "string": arrayLikeToString,
- "array": identity,
- "arraybuffer": function(input) {
- return (new Uint8Array(input)).buffer;
- },
- "uint8array": function(input) {
- return new Uint8Array(input);
- },
- "nodebuffer": function(input) {
- return nodeBuffer(input);
- }
-};
-
-// arraybuffer to ?
-transform["arraybuffer"] = {
- "string": function(input) {
- return arrayLikeToString(new Uint8Array(input));
- },
- "array": function(input) {
- return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));
- },
- "arraybuffer": identity,
- "uint8array": function(input) {
- return new Uint8Array(input);
- },
- "nodebuffer": function(input) {
- return nodeBuffer(new Uint8Array(input));
- }
-};
-
-// uint8array to ?
-transform["uint8array"] = {
- "string": arrayLikeToString,
- "array": function(input) {
- return arrayLikeToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return input.buffer;
- },
- "uint8array": identity,
- "nodebuffer": function(input) {
- return nodeBuffer(input);
- }
-};
-
-// nodebuffer to ?
-transform["nodebuffer"] = {
- "string": arrayLikeToString,
- "array": function(input) {
- return arrayLikeToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return transform["nodebuffer"]["uint8array"](input).buffer;
- },
- "uint8array": function(input) {
- return arrayLikeToArrayLike(input, new Uint8Array(input.length));
- },
- "nodebuffer": identity
-};
-
-/**
- * Transform an input into any type.
- * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.
- * If no output type is specified, the unmodified input will be returned.
- * @param {String} outputType the output type.
- * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.
- * @throws {Error} an Error if the browser doesn't support the requested output type.
- */
-exports.transformTo = function(outputType, input) {
- if (!input) {
- // undefined, null, etc
- // an empty string won't harm.
- input = "";
- }
- if (!outputType) {
- return input;
- }
- exports.checkSupport(outputType);
- var inputType = exports.getTypeOf(input);
- var result = transform[inputType][outputType](input);
- return result;
-};
-
-/**
- * Return the type of the input.
- * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.
- * @param {Object} input the input to identify.
- * @return {String} the (lowercase) type of the input.
- */
-exports.getTypeOf = function(input) {
- if (typeof input === "string") {
- return "string";
- }
- if (Object.prototype.toString.call(input) === "[object Array]") {
- return "array";
- }
- if (support.nodebuffer && nodeBuffer.test(input)) {
- return "nodebuffer";
- }
- if (support.uint8array && input instanceof Uint8Array) {
- return "uint8array";
- }
- if (support.arraybuffer && input instanceof ArrayBuffer) {
- return "arraybuffer";
- }
-};
-
-/**
- * Throw an exception if the type is not supported.
- * @param {String} type the type to check.
- * @throws {Error} an Error if the browser doesn't support the requested type.
- */
-exports.checkSupport = function(type) {
- var supported = support[type.toLowerCase()];
- if (!supported) {
- throw new Error(type + " is not supported by this browser");
- }
-};
-exports.MAX_VALUE_16BITS = 65535;
-exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1
-
-/**
- * Prettify a string read as binary.
- * @param {string} str the string to prettify.
- * @return {string} a pretty string.
- */
-exports.pretty = function(str) {
- var res = '',
- code, i;
- for (i = 0; i < (str || "").length; i++) {
- code = str.charCodeAt(i);
- res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
- }
- return res;
-};
-
-/**
- * Find a compression registered in JSZip.
- * @param {string} compressionMethod the method magic to find.
- * @return {Object|null} the JSZip compression object, null if none found.
- */
-exports.findCompression = function(compressionMethod) {
- for (var method in compressions) {
- if (!compressions.hasOwnProperty(method)) {
- continue;
- }
- if (compressions[method].magic === compressionMethod) {
- return compressions[method];
- }
- }
- return null;
-};
-/**
-* Cross-window, cross-Node-context regular expression detection
-* @param {Object} object Anything
-* @return {Boolean} true if the object is a regular expression,
-* false otherwise
-*/
-exports.isRegExp = function (object) {
- return Object.prototype.toString.call(object) === "[object RegExp]";
-};
-
-
-},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){
-'use strict';
-var StringReader = _dereq_('./stringReader');
-var NodeBufferReader = _dereq_('./nodeBufferReader');
-var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
-var utils = _dereq_('./utils');
-var sig = _dereq_('./signature');
-var ZipEntry = _dereq_('./zipEntry');
-var support = _dereq_('./support');
-var jszipProto = _dereq_('./object');
-// class ZipEntries {{{
-/**
- * All the entries in the zip file.
- * @constructor
- * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load.
- * @param {Object} loadOptions Options for loading the stream.
- */
-function ZipEntries(data, loadOptions) {
- this.files = [];
- this.loadOptions = loadOptions;
- if (data) {
- this.load(data);
- }
-}
-ZipEntries.prototype = {
- /**
- * Check that the reader is on the speficied signature.
- * @param {string} expectedSignature the expected signature.
- * @throws {Error} if it is an other signature.
- */
- checkSignature: function(expectedSignature) {
- var signature = this.reader.readString(4);
- if (signature !== expectedSignature) {
- throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
- }
- },
- /**
- * Read the end of the central directory.
- */
- readBlockEndOfCentral: function() {
- this.diskNumber = this.reader.readInt(2);
- this.diskWithCentralDirStart = this.reader.readInt(2);
- this.centralDirRecordsOnThisDisk = this.reader.readInt(2);
- this.centralDirRecords = this.reader.readInt(2);
- this.centralDirSize = this.reader.readInt(4);
- this.centralDirOffset = this.reader.readInt(4);
-
- this.zipCommentLength = this.reader.readInt(2);
- // warning : the encoding depends of the system locale
- // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.
- // On a windows machine, this field is encoded with the localized windows code page.
- this.zipComment = this.reader.readString(this.zipCommentLength);
- // To get consistent behavior with the generation part, we will assume that
- // this is utf8 encoded.
- this.zipComment = jszipProto.utf8decode(this.zipComment);
- },
- /**
- * Read the end of the Zip 64 central directory.
- * Not merged with the method readEndOfCentral :
- * The end of central can coexist with its Zip64 brother,
- * I don't want to read the wrong number of bytes !
- */
- readBlockZip64EndOfCentral: function() {
- this.zip64EndOfCentralSize = this.reader.readInt(8);
- this.versionMadeBy = this.reader.readString(2);
- this.versionNeeded = this.reader.readInt(2);
- this.diskNumber = this.reader.readInt(4);
- this.diskWithCentralDirStart = this.reader.readInt(4);
- this.centralDirRecordsOnThisDisk = this.reader.readInt(8);
- this.centralDirRecords = this.reader.readInt(8);
- this.centralDirSize = this.reader.readInt(8);
- this.centralDirOffset = this.reader.readInt(8);
-
- this.zip64ExtensibleData = {};
- var extraDataSize = this.zip64EndOfCentralSize - 44,
- index = 0,
- extraFieldId,
- extraFieldLength,
- extraFieldValue;
- while (index < extraDataSize) {
- extraFieldId = this.reader.readInt(2);
- extraFieldLength = this.reader.readInt(4);
- extraFieldValue = this.reader.readString(extraFieldLength);
- this.zip64ExtensibleData[extraFieldId] = {
- id: extraFieldId,
- length: extraFieldLength,
- value: extraFieldValue
- };
- }
- },
- /**
- * Read the end of the Zip 64 central directory locator.
- */
- readBlockZip64EndOfCentralLocator: function() {
- this.diskWithZip64CentralDirStart = this.reader.readInt(4);
- this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);
- this.disksCount = this.reader.readInt(4);
- if (this.disksCount > 1) {
- throw new Error("Multi-volumes zip are not supported");
- }
- },
- /**
- * Read the local files, based on the offset read in the central part.
- */
- readLocalFiles: function() {
- var i, file;
- for (i = 0; i < this.files.length; i++) {
- file = this.files[i];
- this.reader.setIndex(file.localHeaderOffset);
- this.checkSignature(sig.LOCAL_FILE_HEADER);
- file.readLocalPart(this.reader);
- file.handleUTF8();
- file.processAttributes();
- }
- },
- /**
- * Read the central directory.
- */
- readCentralDir: function() {
- var file;
-
- this.reader.setIndex(this.centralDirOffset);
- while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) {
- file = new ZipEntry({
- zip64: this.zip64
- }, this.loadOptions);
- file.readCentralPart(this.reader);
- this.files.push(file);
- }
- },
- /**
- * Read the end of central directory.
- */
- readEndOfCentral: function() {
- var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
- if (offset === -1) {
- // Check if the content is a truncated zip or complete garbage.
- // A "LOCAL_FILE_HEADER" is not required at the beginning (auto
- // extractible zip for example) but it can give a good hint.
- // If an ajax request was used without responseType, we will also
- // get unreadable data.
- var isGarbage = true;
- try {
- this.reader.setIndex(0);
- this.checkSignature(sig.LOCAL_FILE_HEADER);
- isGarbage = false;
- } catch (e) {}
-
- if (isGarbage) {
- throw new Error("Can't find end of central directory : is this a zip file ? " +
- "If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html");
- } else {
- throw new Error("Corrupted zip : can't find end of central directory");
- }
- }
- this.reader.setIndex(offset);
- this.checkSignature(sig.CENTRAL_DIRECTORY_END);
- this.readBlockEndOfCentral();
-
-
- /* extract from the zip spec :
- 4) If one of the fields in the end of central directory
- record is too small to hold required data, the field
- should be set to -1 (0xFFFF or 0xFFFFFFFF) and the
- ZIP64 format record should be created.
- 5) The end of central directory record and the
- Zip64 end of central directory locator record must
- reside on the same disk when splitting or spanning
- an archive.
- */
- if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {
- this.zip64 = true;
-
- /*
- Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
- the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents
- all numbers as 64-bit double precision IEEE 754 floating point numbers.
- So, we have 53bits for integers and bitwise operations treat everything as 32bits.
- see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators
- and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5
- */
-
- // should look for a zip64 EOCD locator
- offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
- if (offset === -1) {
- throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
- }
- this.reader.setIndex(offset);
- this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
- this.readBlockZip64EndOfCentralLocator();
-
- // now the zip64 EOCD record
- this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);
- this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
- this.readBlockZip64EndOfCentral();
- }
- },
- prepareReader: function(data) {
- var type = utils.getTypeOf(data);
- if (type === "string" && !support.uint8array) {
- this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString);
- }
- else if (type === "nodebuffer") {
- this.reader = new NodeBufferReader(data);
- }
- else {
- this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data));
- }
- },
- /**
- * Read a zip file and create ZipEntries.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.
- */
- load: function(data) {
- this.prepareReader(data);
- this.readEndOfCentral();
- this.readCentralDir();
- this.readLocalFiles();
- }
-};
-// }}} end of ZipEntries
-module.exports = ZipEntries;
-
-},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){
-'use strict';
-var StringReader = _dereq_('./stringReader');
-var utils = _dereq_('./utils');
-var CompressedObject = _dereq_('./compressedObject');
-var jszipProto = _dereq_('./object');
-
-var MADE_BY_DOS = 0x00;
-var MADE_BY_UNIX = 0x03;
-
-// class ZipEntry {{{
-/**
- * An entry in the zip file.
- * @constructor
- * @param {Object} options Options of the current file.
- * @param {Object} loadOptions Options for loading the stream.
- */
-function ZipEntry(options, loadOptions) {
- this.options = options;
- this.loadOptions = loadOptions;
-}
-ZipEntry.prototype = {
- /**
- * say if the file is encrypted.
- * @return {boolean} true if the file is encrypted, false otherwise.
- */
- isEncrypted: function() {
- // bit 1 is set
- return (this.bitFlag & 0x0001) === 0x0001;
- },
- /**
- * say if the file has utf-8 filename/comment.
- * @return {boolean} true if the filename/comment is in utf-8, false otherwise.
- */
- useUTF8: function() {
- // bit 11 is set
- return (this.bitFlag & 0x0800) === 0x0800;
- },
- /**
- * Prepare the function used to generate the compressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @return {Function} the callback to get the compressed content (the type depends of the DataReader class).
- */
- prepareCompressedContent: function(reader, from, length) {
- return function() {
- var previousIndex = reader.index;
- reader.setIndex(from);
- var compressedFileData = reader.readData(length);
- reader.setIndex(previousIndex);
-
- return compressedFileData;
- };
- },
- /**
- * Prepare the function used to generate the uncompressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @param {JSZip.compression} compression the compression used on this file.
- * @param {number} uncompressedSize the uncompressed size to expect.
- * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class).
- */
- prepareContent: function(reader, from, length, compression, uncompressedSize) {
- return function() {
-
- var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
- var uncompressedFileData = compression.uncompress(compressedFileData);
-
- if (uncompressedFileData.length !== uncompressedSize) {
- throw new Error("Bug : uncompressed data size mismatch");
- }
-
- return uncompressedFileData;
- };
- },
- /**
- * Read the local part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readLocalPart: function(reader) {
- var compression, localExtraFieldsLength;
-
- // we already know everything from the central dir !
- // If the central dir data are false, we are doomed.
- // On the bright side, the local part is scary : zip64, data descriptors, both, etc.
- // The less data we get here, the more reliable this should be.
- // Let's skip the whole header and dash to the data !
- reader.skip(22);
- // in some zip created on windows, the filename stored in the central dir contains \ instead of /.
- // Strangely, the filename here is OK.
- // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes
- // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators...
- // Search "unzip mismatching "local" filename continuing with "central" filename version" on
- // the internet.
- //
- // I think I see the logic here : the central directory is used to display
- // content and the local directory is used to extract the files. Mixing / and \
- // may be used to display \ to windows users and use / when extracting the files.
- // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394
- this.fileNameLength = reader.readInt(2);
- localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir
- this.fileName = reader.readString(this.fileNameLength);
- reader.skip(localExtraFieldsLength);
-
- if (this.compressedSize == -1 || this.uncompressedSize == -1) {
- throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)");
- }
-
- compression = utils.findCompression(this.compressionMethod);
- if (compression === null) { // no compression found
- throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")");
- }
- this.decompressed = new CompressedObject();
- this.decompressed.compressedSize = this.compressedSize;
- this.decompressed.uncompressedSize = this.uncompressedSize;
- this.decompressed.crc32 = this.crc32;
- this.decompressed.compressionMethod = this.compressionMethod;
- this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);
- this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);
-
- // we need to compute the crc32...
- if (this.loadOptions.checkCRC32) {
- this.decompressed = utils.transformTo("string", this.decompressed.getContent());
- if (jszipProto.crc32(this.decompressed) !== this.crc32) {
- throw new Error("Corrupted zip : CRC32 mismatch");
- }
- }
- },
-
- /**
- * Read the central part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readCentralPart: function(reader) {
- this.versionMadeBy = reader.readInt(2);
- this.versionNeeded = reader.readInt(2);
- this.bitFlag = reader.readInt(2);
- this.compressionMethod = reader.readString(2);
- this.date = reader.readDate();
- this.crc32 = reader.readInt(4);
- this.compressedSize = reader.readInt(4);
- this.uncompressedSize = reader.readInt(4);
- this.fileNameLength = reader.readInt(2);
- this.extraFieldsLength = reader.readInt(2);
- this.fileCommentLength = reader.readInt(2);
- this.diskNumberStart = reader.readInt(2);
- this.internalFileAttributes = reader.readInt(2);
- this.externalFileAttributes = reader.readInt(4);
- this.localHeaderOffset = reader.readInt(4);
-
- if (this.isEncrypted()) {
- throw new Error("Encrypted zip are not supported");
- }
-
- this.fileName = reader.readString(this.fileNameLength);
- this.readExtraFields(reader);
- this.parseZIP64ExtraField(reader);
- this.fileComment = reader.readString(this.fileCommentLength);
- },
-
- /**
- * Parse the external file attributes and get the unix/dos permissions.
- */
- processAttributes: function () {
- this.unixPermissions = null;
- this.dosPermissions = null;
- var madeBy = this.versionMadeBy >> 8;
-
- // Check if we have the DOS directory flag set.
- // We look for it in the DOS and UNIX permissions
- // but some unknown platform could set it as a compatibility flag.
- this.dir = this.externalFileAttributes & 0x0010 ? true : false;
-
- if(madeBy === MADE_BY_DOS) {
- // first 6 bits (0 to 5)
- this.dosPermissions = this.externalFileAttributes & 0x3F;
- }
-
- if(madeBy === MADE_BY_UNIX) {
- this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF;
- // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8);
- }
-
- // fail safe : if the name ends with a / it probably means a folder
- if (!this.dir && this.fileName.slice(-1) === '/') {
- this.dir = true;
- }
- },
-
- /**
- * Parse the ZIP64 extra field and merge the info in the current ZipEntry.
- * @param {DataReader} reader the reader to use.
- */
- parseZIP64ExtraField: function(reader) {
-
- if (!this.extraFields[0x0001]) {
- return;
- }
-
- // should be something, preparing the extra reader
- var extraReader = new StringReader(this.extraFields[0x0001].value);
-
- // I really hope that these 64bits integer can fit in 32 bits integer, because js
- // won't let us have more.
- if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {
- this.uncompressedSize = extraReader.readInt(8);
- }
- if (this.compressedSize === utils.MAX_VALUE_32BITS) {
- this.compressedSize = extraReader.readInt(8);
- }
- if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {
- this.localHeaderOffset = extraReader.readInt(8);
- }
- if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {
- this.diskNumberStart = extraReader.readInt(4);
- }
- },
- /**
- * Read the central part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readExtraFields: function(reader) {
- var start = reader.index,
- extraFieldId,
- extraFieldLength,
- extraFieldValue;
-
- this.extraFields = this.extraFields || {};
-
- while (reader.index < start + this.extraFieldsLength) {
- extraFieldId = reader.readInt(2);
- extraFieldLength = reader.readInt(2);
- extraFieldValue = reader.readString(extraFieldLength);
-
- this.extraFields[extraFieldId] = {
- id: extraFieldId,
- length: extraFieldLength,
- value: extraFieldValue
- };
- }
- },
- /**
- * Apply an UTF8 transformation if needed.
- */
- handleUTF8: function() {
- if (this.useUTF8()) {
- this.fileName = jszipProto.utf8decode(this.fileName);
- this.fileComment = jszipProto.utf8decode(this.fileComment);
- } else {
- var upath = this.findExtraFieldUnicodePath();
- if (upath !== null) {
- this.fileName = upath;
- }
- var ucomment = this.findExtraFieldUnicodeComment();
- if (ucomment !== null) {
- this.fileComment = ucomment;
- }
- }
- },
-
- /**
- * Find the unicode path declared in the extra field, if any.
- * @return {String} the unicode path, null otherwise.
- */
- findExtraFieldUnicodePath: function() {
- var upathField = this.extraFields[0x7075];
- if (upathField) {
- var extraReader = new StringReader(upathField.value);
-
- // wrong version
- if (extraReader.readInt(1) !== 1) {
- return null;
- }
-
- // the crc of the filename changed, this field is out of date.
- if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) {
- return null;
- }
-
- return jszipProto.utf8decode(extraReader.readString(upathField.length - 5));
- }
- return null;
- },
-
- /**
- * Find the unicode comment declared in the extra field, if any.
- * @return {String} the unicode comment, null otherwise.
- */
- findExtraFieldUnicodeComment: function() {
- var ucommentField = this.extraFields[0x6375];
- if (ucommentField) {
- var extraReader = new StringReader(ucommentField.value);
-
- // wrong version
- if (extraReader.readInt(1) !== 1) {
- return null;
- }
-
- // the crc of the comment changed, this field is out of date.
- if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) {
- return null;
- }
-
- return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5));
- }
- return null;
- }
-};
-module.exports = ZipEntry;
-
-},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(_dereq_,module,exports){
-// Top level file is just a mixin of submodules & constants
-'use strict';
-
-var assign = _dereq_('./lib/utils/common').assign;
-
-var deflate = _dereq_('./lib/deflate');
-var inflate = _dereq_('./lib/inflate');
-var constants = _dereq_('./lib/zlib/constants');
-
-var pako = {};
-
-assign(pako, deflate, inflate, constants);
-
-module.exports = pako;
-},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(_dereq_,module,exports){
-'use strict';
-
-
-var zlib_deflate = _dereq_('./zlib/deflate.js');
-var utils = _dereq_('./utils/common');
-var strings = _dereq_('./utils/strings');
-var msg = _dereq_('./zlib/messages');
-var zstream = _dereq_('./zlib/zstream');
-
-
-/* Public constants ==========================================================*/
-/* ===========================================================================*/
-
-var Z_NO_FLUSH = 0;
-var Z_FINISH = 4;
-
-var Z_OK = 0;
-var Z_STREAM_END = 1;
-
-var Z_DEFAULT_COMPRESSION = -1;
-
-var Z_DEFAULT_STRATEGY = 0;
-
-var Z_DEFLATED = 8;
-
-/* ===========================================================================*/
-
-
-/**
- * class Deflate
- *
- * Generic JS-style wrapper for zlib calls. If you don't need
- * streaming behaviour - use more simple functions: [[deflate]],
- * [[deflateRaw]] and [[gzip]].
- **/
-
-/* internal
- * Deflate.chunks -> Array
- *
- * Chunks of output data, if [[Deflate#onData]] not overriden.
- **/
-
-/**
- * Deflate.result -> Uint8Array|Array
- *
- * Compressed result, generated by default [[Deflate#onData]]
- * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
- * (call [[Deflate#push]] with `Z_FINISH` / `true` param).
- **/
-
-/**
- * Deflate.err -> Number
- *
- * Error code after deflate finished. 0 (Z_OK) on success.
- * You will not need it in real life, because deflate errors
- * are possible only on wrong options or bad `onData` / `onEnd`
- * custom handlers.
- **/
-
-/**
- * Deflate.msg -> String
- *
- * Error message, if [[Deflate.err]] != 0
- **/
-
-
-/**
- * new Deflate(options)
- * - options (Object): zlib deflate options.
- *
- * Creates new deflator instance with specified params. Throws exception
- * on bad params. Supported options:
- *
- * - `level`
- * - `windowBits`
- * - `memLevel`
- * - `strategy`
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Additional options, for internal needs:
- *
- * - `chunkSize` - size of generated data chunks (16K by default)
- * - `raw` (Boolean) - do raw deflate
- * - `gzip` (Boolean) - create gzip wrapper
- * - `to` (String) - if equal to 'string', then result will be "binary string"
- * (each char code [0..255])
- * - `header` (Object) - custom header for gzip
- * - `text` (Boolean) - true if compressed data believed to be text
- * - `time` (Number) - modification time, unix timestamp
- * - `os` (Number) - operation system code
- * - `extra` (Array) - array of bytes with extra data (max 65536)
- * - `name` (String) - file name (binary string)
- * - `comment` (String) - comment (binary string)
- * - `hcrc` (Boolean) - true if header crc should be added
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
- * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
- *
- * var deflate = new pako.Deflate({ level: 3});
- *
- * deflate.push(chunk1, false);
- * deflate.push(chunk2, true); // true -> last chunk
- *
- * if (deflate.err) { throw new Error(deflate.err); }
- *
- * console.log(deflate.result);
- * ```
- **/
-var Deflate = function(options) {
-
- this.options = utils.assign({
- level: Z_DEFAULT_COMPRESSION,
- method: Z_DEFLATED,
- chunkSize: 16384,
- windowBits: 15,
- memLevel: 8,
- strategy: Z_DEFAULT_STRATEGY,
- to: ''
- }, options || {});
-
- var opt = this.options;
-
- if (opt.raw && (opt.windowBits > 0)) {
- opt.windowBits = -opt.windowBits;
- }
-
- else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
- opt.windowBits += 16;
- }
-
- this.err = 0; // error code, if happens (0 = Z_OK)
- this.msg = ''; // error message
- this.ended = false; // used to avoid multiple onEnd() calls
- this.chunks = []; // chunks of compressed data
-
- this.strm = new zstream();
- this.strm.avail_out = 0;
-
- var status = zlib_deflate.deflateInit2(
- this.strm,
- opt.level,
- opt.method,
- opt.windowBits,
- opt.memLevel,
- opt.strategy
- );
-
- if (status !== Z_OK) {
- throw new Error(msg[status]);
- }
-
- if (opt.header) {
- zlib_deflate.deflateSetHeader(this.strm, opt.header);
- }
-};
-
-/**
- * Deflate#push(data[, mode]) -> Boolean
- * - data (Uint8Array|Array|String): input data. Strings will be converted to
- * utf8 byte sequence.
- * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
- *
- * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
- * new compressed chunks. Returns `true` on success. The last data block must have
- * mode Z_FINISH (or `true`). That flush internal pending buffers and call
- * [[Deflate#onEnd]].
- *
- * On fail call [[Deflate#onEnd]] with error code and return false.
- *
- * We strongly recommend to use `Uint8Array` on input for best speed (output
- * array format is detected automatically). Also, don't skip last param and always
- * use the same type in your code (boolean or number). That will improve JS speed.
- *
- * For regular `Array`-s make sure all elements are [0..255].
- *
- * ##### Example
- *
- * ```javascript
- * push(chunk, false); // push one of data chunks
- * ...
- * push(chunk, true); // push last chunk
- * ```
- **/
-Deflate.prototype.push = function(data, mode) {
- var strm = this.strm;
- var chunkSize = this.options.chunkSize;
- var status, _mode;
-
- if (this.ended) { return false; }
-
- _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
-
- // Convert data if needed
- if (typeof data === 'string') {
- // If we need to compress text, change encoding to utf8.
- strm.input = strings.string2buf(data);
- } else {
- strm.input = data;
- }
-
- strm.next_in = 0;
- strm.avail_in = strm.input.length;
-
- do {
- if (strm.avail_out === 0) {
- strm.output = new utils.Buf8(chunkSize);
- strm.next_out = 0;
- strm.avail_out = chunkSize;
- }
- status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
-
- if (status !== Z_STREAM_END && status !== Z_OK) {
- this.onEnd(status);
- this.ended = true;
- return false;
- }
- if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) {
- if (this.options.to === 'string') {
- this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
- } else {
- this.onData(utils.shrinkBuf(strm.output, strm.next_out));
- }
- }
- } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
-
- // Finalize on the last chunk.
- if (_mode === Z_FINISH) {
- status = zlib_deflate.deflateEnd(this.strm);
- this.onEnd(status);
- this.ended = true;
- return status === Z_OK;
- }
-
- return true;
-};
-
-
-/**
- * Deflate#onData(chunk) -> Void
- * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
- * on js engine support. When string output requested, each chunk
- * will be string.
- *
- * By default, stores data blocks in `chunks[]` property and glue
- * those in `onEnd`. Override this handler, if you need another behaviour.
- **/
-Deflate.prototype.onData = function(chunk) {
- this.chunks.push(chunk);
-};
-
-
-/**
- * Deflate#onEnd(status) -> Void
- * - status (Number): deflate status. 0 (Z_OK) on success,
- * other if not.
- *
- * Called once after you tell deflate that input stream complete
- * or error happenned. By default - join collected chunks,
- * free memory and fill `results` / `err` properties.
- **/
-Deflate.prototype.onEnd = function(status) {
- // On success - join
- if (status === Z_OK) {
- if (this.options.to === 'string') {
- this.result = this.chunks.join('');
- } else {
- this.result = utils.flattenChunks(this.chunks);
- }
- }
- this.chunks = [];
- this.err = status;
- this.msg = this.strm.msg;
-};
-
-
-/**
- * deflate(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * Compress `data` with deflate alrorythm and `options`.
- *
- * Supported options are:
- *
- * - level
- * - windowBits
- * - memLevel
- * - strategy
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Sugar (options):
- *
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
- * negative windowBits implicitly.
- * - `to` (String) - if equal to 'string', then result will be "binary string"
- * (each char code [0..255])
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
- *
- * console.log(pako.deflate(data));
- * ```
- **/
-function deflate(input, options) {
- var deflator = new Deflate(options);
-
- deflator.push(input, true);
-
- // That will never happens, if you don't cheat with options :)
- if (deflator.err) { throw deflator.msg; }
-
- return deflator.result;
-}
-
-
-/**
- * deflateRaw(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * The same as [[deflate]], but creates raw data, without wrapper
- * (header and adler32 crc).
- **/
-function deflateRaw(input, options) {
- options = options || {};
- options.raw = true;
- return deflate(input, options);
-}
-
-
-/**
- * gzip(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * The same as [[deflate]], but create gzip wrapper instead of
- * deflate one.
- **/
-function gzip(input, options) {
- options = options || {};
- options.gzip = true;
- return deflate(input, options);
-}
-
-
-exports.Deflate = Deflate;
-exports.deflate = deflate;
-exports.deflateRaw = deflateRaw;
-exports.gzip = gzip;
-},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){
-'use strict';
-
-
-var zlib_inflate = _dereq_('./zlib/inflate.js');
-var utils = _dereq_('./utils/common');
-var strings = _dereq_('./utils/strings');
-var c = _dereq_('./zlib/constants');
-var msg = _dereq_('./zlib/messages');
-var zstream = _dereq_('./zlib/zstream');
-var gzheader = _dereq_('./zlib/gzheader');
-
-
-/**
- * class Inflate
- *
- * Generic JS-style wrapper for zlib calls. If you don't need
- * streaming behaviour - use more simple functions: [[inflate]]
- * and [[inflateRaw]].
- **/
-
-/* internal
- * inflate.chunks -> Array
- *
- * Chunks of output data, if [[Inflate#onData]] not overriden.
- **/
-
-/**
- * Inflate.result -> Uint8Array|Array|String
- *
- * Uncompressed result, generated by default [[Inflate#onData]]
- * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
- * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
- **/
-
-/**
- * Inflate.err -> Number
- *
- * Error code after inflate finished. 0 (Z_OK) on success.
- * Should be checked if broken data possible.
- **/
-
-/**
- * Inflate.msg -> String
- *
- * Error message, if [[Inflate.err]] != 0
- **/
-
-
-/**
- * new Inflate(options)
- * - options (Object): zlib inflate options.
- *
- * Creates new inflator instance with specified params. Throws exception
- * on bad params. Supported options:
- *
- * - `windowBits`
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Additional options, for internal needs:
- *
- * - `chunkSize` - size of generated data chunks (16K by default)
- * - `raw` (Boolean) - do raw inflate
- * - `to` (String) - if equal to 'string', then result will be converted
- * from utf8 to utf16 (javascript) string. When string output requested,
- * chunk length can differ from `chunkSize`, depending on content.
- *
- * By default, when no options set, autodetect deflate/gzip data format via
- * wrapper header.
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
- * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
- *
- * var inflate = new pako.Inflate({ level: 3});
- *
- * inflate.push(chunk1, false);
- * inflate.push(chunk2, true); // true -> last chunk
- *
- * if (inflate.err) { throw new Error(inflate.err); }
- *
- * console.log(inflate.result);
- * ```
- **/
-var Inflate = function(options) {
-
- this.options = utils.assign({
- chunkSize: 16384,
- windowBits: 0,
- to: ''
- }, options || {});
-
- var opt = this.options;
-
- // Force window size for `raw` data, if not set directly,
- // because we have no header for autodetect.
- if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
- opt.windowBits = -opt.windowBits;
- if (opt.windowBits === 0) { opt.windowBits = -15; }
- }
-
- // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
- if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
- !(options && options.windowBits)) {
- opt.windowBits += 32;
- }
-
- // Gzip header has no info about windows size, we can do autodetect only
- // for deflate. So, if window size not set, force it to max when gzip possible
- if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
- // bit 3 (16) -> gzipped data
- // bit 4 (32) -> autodetect gzip/deflate
- if ((opt.windowBits & 15) === 0) {
- opt.windowBits |= 15;
- }
- }
-
- this.err = 0; // error code, if happens (0 = Z_OK)
- this.msg = ''; // error message
- this.ended = false; // used to avoid multiple onEnd() calls
- this.chunks = []; // chunks of compressed data
-
- this.strm = new zstream();
- this.strm.avail_out = 0;
-
- var status = zlib_inflate.inflateInit2(
- this.strm,
- opt.windowBits
- );
-
- if (status !== c.Z_OK) {
- throw new Error(msg[status]);
- }
-
- this.header = new gzheader();
-
- zlib_inflate.inflateGetHeader(this.strm, this.header);
-};
-
-/**
- * Inflate#push(data[, mode]) -> Boolean
- * - data (Uint8Array|Array|String): input data
- * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
- *
- * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
- * new output chunks. Returns `true` on success. The last data block must have
- * mode Z_FINISH (or `true`). That flush internal pending buffers and call
- * [[Inflate#onEnd]].
- *
- * On fail call [[Inflate#onEnd]] with error code and return false.
- *
- * We strongly recommend to use `Uint8Array` on input for best speed (output
- * format is detected automatically). Also, don't skip last param and always
- * use the same type in your code (boolean or number). That will improve JS speed.
- *
- * For regular `Array`-s make sure all elements are [0..255].
- *
- * ##### Example
- *
- * ```javascript
- * push(chunk, false); // push one of data chunks
- * ...
- * push(chunk, true); // push last chunk
- * ```
- **/
-Inflate.prototype.push = function(data, mode) {
- var strm = this.strm;
- var chunkSize = this.options.chunkSize;
- var status, _mode;
- var next_out_utf8, tail, utf8str;
-
- if (this.ended) { return false; }
- _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
-
- // Convert data if needed
- if (typeof data === 'string') {
- // Only binary strings can be decompressed on practice
- strm.input = strings.binstring2buf(data);
- } else {
- strm.input = data;
- }
-
- strm.next_in = 0;
- strm.avail_in = strm.input.length;
-
- do {
- if (strm.avail_out === 0) {
- strm.output = new utils.Buf8(chunkSize);
- strm.next_out = 0;
- strm.avail_out = chunkSize;
- }
-
- status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
-
- if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
- this.onEnd(status);
- this.ended = true;
- return false;
- }
-
- if (strm.next_out) {
- if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) {
-
- if (this.options.to === 'string') {
-
- next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
-
- tail = strm.next_out - next_out_utf8;
- utf8str = strings.buf2string(strm.output, next_out_utf8);
-
- // move tail
- strm.next_out = tail;
- strm.avail_out = chunkSize - tail;
- if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
-
- this.onData(utf8str);
-
- } else {
- this.onData(utils.shrinkBuf(strm.output, strm.next_out));
- }
- }
- }
- } while ((strm.avail_in > 0) && status !== c.Z_STREAM_END);
-
- if (status === c.Z_STREAM_END) {
- _mode = c.Z_FINISH;
- }
- // Finalize on the last chunk.
- if (_mode === c.Z_FINISH) {
- status = zlib_inflate.inflateEnd(this.strm);
- this.onEnd(status);
- this.ended = true;
- return status === c.Z_OK;
- }
-
- return true;
-};
-
-
-/**
- * Inflate#onData(chunk) -> Void
- * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
- * on js engine support. When string output requested, each chunk
- * will be string.
- *
- * By default, stores data blocks in `chunks[]` property and glue
- * those in `onEnd`. Override this handler, if you need another behaviour.
- **/
-Inflate.prototype.onData = function(chunk) {
- this.chunks.push(chunk);
-};
-
-
-/**
- * Inflate#onEnd(status) -> Void
- * - status (Number): inflate status. 0 (Z_OK) on success,
- * other if not.
- *
- * Called once after you tell inflate that input stream complete
- * or error happenned. By default - join collected chunks,
- * free memory and fill `results` / `err` properties.
- **/
-Inflate.prototype.onEnd = function(status) {
- // On success - join
- if (status === c.Z_OK) {
- if (this.options.to === 'string') {
- // Glue & convert here, until we teach pako to send
- // utf8 alligned strings to onData
- this.result = this.chunks.join('');
- } else {
- this.result = utils.flattenChunks(this.chunks);
- }
- }
- this.chunks = [];
- this.err = status;
- this.msg = this.strm.msg;
-};
-
-
-/**
- * inflate(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * Decompress `data` with inflate/ungzip and `options`. Autodetect
- * format via wrapper header by default. That's why we don't provide
- * separate `ungzip` method.
- *
- * Supported options are:
- *
- * - windowBits
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information.
- *
- * Sugar (options):
- *
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
- * negative windowBits implicitly.
- * - `to` (String) - if equal to 'string', then result will be converted
- * from utf8 to utf16 (javascript) string. When string output requested,
- * chunk length can differ from `chunkSize`, depending on content.
- *
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , input = pako.deflate([1,2,3,4,5,6,7,8,9])
- * , output;
- *
- * try {
- * output = pako.inflate(input);
- * } catch (err)
- * console.log(err);
- * }
- * ```
- **/
-function inflate(input, options) {
- var inflator = new Inflate(options);
-
- inflator.push(input, true);
-
- // That will never happens, if you don't cheat with options :)
- if (inflator.err) { throw inflator.msg; }
-
- return inflator.result;
-}
-
-
-/**
- * inflateRaw(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * The same as [[inflate]], but creates raw data, without wrapper
- * (header and adler32 crc).
- **/
-function inflateRaw(input, options) {
- options = options || {};
- options.raw = true;
- return inflate(input, options);
-}
-
-
-/**
- * ungzip(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * Just shortcut to [[inflate]], because it autodetects format
- * by header.content. Done for convenience.
- **/
-
-
-exports.Inflate = Inflate;
-exports.inflate = inflate;
-exports.inflateRaw = inflateRaw;
-exports.ungzip = inflate;
-
-},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){
-'use strict';
-
-
-var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
- (typeof Uint16Array !== 'undefined') &&
- (typeof Int32Array !== 'undefined');
-
-
-exports.assign = function (obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
- while (sources.length) {
- var source = sources.shift();
- if (!source) { continue; }
-
- if (typeof(source) !== 'object') {
- throw new TypeError(source + 'must be non-object');
- }
-
- for (var p in source) {
- if (source.hasOwnProperty(p)) {
- obj[p] = source[p];
- }
- }
- }
-
- return obj;
-};
-
-
-// reduce buffer size, avoiding mem copy
-exports.shrinkBuf = function (buf, size) {
- if (buf.length === size) { return buf; }
- if (buf.subarray) { return buf.subarray(0, size); }
- buf.length = size;
- return buf;
-};
-
-
-var fnTyped = {
- arraySet: function (dest, src, src_offs, len, dest_offs) {
- if (src.subarray && dest.subarray) {
- dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
- return;
- }
- // Fallback to ordinary array
- for(var i=0; i= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
-}
-_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
-
-
-// convert string to array (typed, when possible)
-exports.string2buf = function (str) {
- var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
-
- // count binary size
- for (m_pos = 0; m_pos < str_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
- }
-
- // allocate buffer
- buf = new utils.Buf8(buf_len);
-
- // convert
- for (i=0, m_pos = 0; i < buf_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- if (c < 0x80) {
- /* one byte */
- buf[i++] = c;
- } else if (c < 0x800) {
- /* two bytes */
- buf[i++] = 0xC0 | (c >>> 6);
- buf[i++] = 0x80 | (c & 0x3f);
- } else if (c < 0x10000) {
- /* three bytes */
- buf[i++] = 0xE0 | (c >>> 12);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- } else {
- /* four bytes */
- buf[i++] = 0xf0 | (c >>> 18);
- buf[i++] = 0x80 | (c >>> 12 & 0x3f);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- }
- }
-
- return buf;
-};
-
-// Helper (used in 2 places)
-function buf2binstring(buf, len) {
- // use fallback for big arrays to avoid stack overflow
- if (len < 65537) {
- if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
- return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
- }
- }
-
- var result = '';
- for(var i=0; i < len; i++) {
- result += String.fromCharCode(buf[i]);
- }
- return result;
-}
-
-
-// Convert byte array to binary string
-exports.buf2binstring = function(buf) {
- return buf2binstring(buf, buf.length);
-};
-
-
-// Convert binary string (typed, when possible)
-exports.binstring2buf = function(str) {
- var buf = new utils.Buf8(str.length);
- for(var i=0, len=buf.length; i < len; i++) {
- buf[i] = str.charCodeAt(i);
- }
- return buf;
-};
-
-
-// convert array to string
-exports.buf2string = function (buf, max) {
- var i, out, c, c_len;
- var len = max || buf.length;
-
- // Reserve max possible length (2 words per char)
- // NB: by unknown reasons, Array is significantly faster for
- // String.fromCharCode.apply than Uint16Array.
- var utf16buf = new Array(len*2);
-
- for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
-
- // apply mask on first byte
- c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
- // join the rest
- while (c_len > 1 && i < len) {
- c = (c << 6) | (buf[i++] & 0x3f);
- c_len--;
- }
-
- // terminated by end of string?
- if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
-
- if (c < 0x10000) {
- utf16buf[out++] = c;
- } else {
- c -= 0x10000;
- utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
- utf16buf[out++] = 0xdc00 | (c & 0x3ff);
- }
- }
-
- return buf2binstring(utf16buf, out);
-};
-
-
-// Calculate max possible position in utf8 buffer,
-// that will not break sequence. If that's not possible
-// - (very small limits) return max size as is.
-//
-// buf[] - utf8 bytes array
-// max - length limit (mandatory);
-exports.utf8border = function(buf, max) {
- var pos;
-
- max = max || buf.length;
- if (max > buf.length) { max = buf.length; }
-
- // go back from last position, until start of sequence found
- pos = max-1;
- while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
-
- // Fuckup - very small and broken sequence,
- // return max, because we should return something anyway.
- if (pos < 0) { return max; }
-
- // If we came to start of buffer - that means vuffer is too small,
- // return max too.
- if (pos === 0) { return max; }
-
- return (pos + _utf8len[buf[pos]] > max) ? pos : max;
-};
-
-},{"./common":27}],29:[function(_dereq_,module,exports){
-'use strict';
-
-// Note: adler32 takes 12% for level 0 and 2% for level 6.
-// It doesn't worth to make additional optimizationa as in original.
-// Small size is preferable.
-
-function adler32(adler, buf, len, pos) {
- var s1 = (adler & 0xffff) |0
- , s2 = ((adler >>> 16) & 0xffff) |0
- , n = 0;
-
- while (len !== 0) {
- // Set limit ~ twice less than 5552, to keep
- // s2 in 31-bits, because we force signed ints.
- // in other case %= will fail.
- n = len > 2000 ? 2000 : len;
- len -= n;
-
- do {
- s1 = (s1 + buf[pos++]) |0;
- s2 = (s2 + s1) |0;
- } while (--n);
-
- s1 %= 65521;
- s2 %= 65521;
- }
-
- return (s1 | (s2 << 16)) |0;
-}
-
-
-module.exports = adler32;
-},{}],30:[function(_dereq_,module,exports){
-module.exports = {
-
- /* Allowed flush values; see deflate() and inflate() below for details */
- Z_NO_FLUSH: 0,
- Z_PARTIAL_FLUSH: 1,
- Z_SYNC_FLUSH: 2,
- Z_FULL_FLUSH: 3,
- Z_FINISH: 4,
- Z_BLOCK: 5,
- Z_TREES: 6,
-
- /* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
- Z_OK: 0,
- Z_STREAM_END: 1,
- Z_NEED_DICT: 2,
- Z_ERRNO: -1,
- Z_STREAM_ERROR: -2,
- Z_DATA_ERROR: -3,
- //Z_MEM_ERROR: -4,
- Z_BUF_ERROR: -5,
- //Z_VERSION_ERROR: -6,
-
- /* compression levels */
- Z_NO_COMPRESSION: 0,
- Z_BEST_SPEED: 1,
- Z_BEST_COMPRESSION: 9,
- Z_DEFAULT_COMPRESSION: -1,
-
-
- Z_FILTERED: 1,
- Z_HUFFMAN_ONLY: 2,
- Z_RLE: 3,
- Z_FIXED: 4,
- Z_DEFAULT_STRATEGY: 0,
-
- /* Possible values of the data_type field (though see inflate()) */
- Z_BINARY: 0,
- Z_TEXT: 1,
- //Z_ASCII: 1, // = Z_TEXT (deprecated)
- Z_UNKNOWN: 2,
-
- /* The deflate compression method */
- Z_DEFLATED: 8
- //Z_NULL: null // Use -1 or null inline, depending on var type
-};
-},{}],31:[function(_dereq_,module,exports){
-'use strict';
-
-// Note: we can't get significant speed boost here.
-// So write code to minimize size - no pregenerated tables
-// and array tools dependencies.
-
-
-// Use ordinary array, since untyped makes no boost here
-function makeTable() {
- var c, table = [];
-
- for(var n =0; n < 256; n++){
- c = n;
- for(var k =0; k < 8; k++){
- c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
- }
- table[n] = c;
- }
-
- return table;
-}
-
-// Create table on load. Just 255 signed longs. Not a problem.
-var crcTable = makeTable();
-
-
-function crc32(crc, buf, len, pos) {
- var t = crcTable
- , end = pos + len;
-
- crc = crc ^ (-1);
-
- for (var i = pos; i < end; i++ ) {
- crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
- }
-
- return (crc ^ (-1)); // >>> 0;
-}
-
-
-module.exports = crc32;
-},{}],32:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('../utils/common');
-var trees = _dereq_('./trees');
-var adler32 = _dereq_('./adler32');
-var crc32 = _dereq_('./crc32');
-var msg = _dereq_('./messages');
-
-/* Public constants ==========================================================*/
-/* ===========================================================================*/
-
-
-/* Allowed flush values; see deflate() and inflate() below for details */
-var Z_NO_FLUSH = 0;
-var Z_PARTIAL_FLUSH = 1;
-//var Z_SYNC_FLUSH = 2;
-var Z_FULL_FLUSH = 3;
-var Z_FINISH = 4;
-var Z_BLOCK = 5;
-//var Z_TREES = 6;
-
-
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-var Z_OK = 0;
-var Z_STREAM_END = 1;
-//var Z_NEED_DICT = 2;
-//var Z_ERRNO = -1;
-var Z_STREAM_ERROR = -2;
-var Z_DATA_ERROR = -3;
-//var Z_MEM_ERROR = -4;
-var Z_BUF_ERROR = -5;
-//var Z_VERSION_ERROR = -6;
-
-
-/* compression levels */
-//var Z_NO_COMPRESSION = 0;
-//var Z_BEST_SPEED = 1;
-//var Z_BEST_COMPRESSION = 9;
-var Z_DEFAULT_COMPRESSION = -1;
-
-
-var Z_FILTERED = 1;
-var Z_HUFFMAN_ONLY = 2;
-var Z_RLE = 3;
-var Z_FIXED = 4;
-var Z_DEFAULT_STRATEGY = 0;
-
-/* Possible values of the data_type field (though see inflate()) */
-//var Z_BINARY = 0;
-//var Z_TEXT = 1;
-//var Z_ASCII = 1; // = Z_TEXT
-var Z_UNKNOWN = 2;
-
-
-/* The deflate compression method */
-var Z_DEFLATED = 8;
-
-/*============================================================================*/
-
-
-var MAX_MEM_LEVEL = 9;
-/* Maximum value for memLevel in deflateInit2 */
-var MAX_WBITS = 15;
-/* 32K LZ77 window */
-var DEF_MEM_LEVEL = 8;
-
-
-var LENGTH_CODES = 29;
-/* number of length codes, not counting the special END_BLOCK code */
-var LITERALS = 256;
-/* number of literal bytes 0..255 */
-var L_CODES = LITERALS + 1 + LENGTH_CODES;
-/* number of Literal or Length codes, including the END_BLOCK code */
-var D_CODES = 30;
-/* number of distance codes */
-var BL_CODES = 19;
-/* number of codes used to transfer the bit lengths */
-var HEAP_SIZE = 2*L_CODES + 1;
-/* maximum heap size */
-var MAX_BITS = 15;
-/* All codes must not exceed MAX_BITS bits */
-
-var MIN_MATCH = 3;
-var MAX_MATCH = 258;
-var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
-
-var PRESET_DICT = 0x20;
-
-var INIT_STATE = 42;
-var EXTRA_STATE = 69;
-var NAME_STATE = 73;
-var COMMENT_STATE = 91;
-var HCRC_STATE = 103;
-var BUSY_STATE = 113;
-var FINISH_STATE = 666;
-
-var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
-var BS_BLOCK_DONE = 2; /* block flush performed */
-var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
-var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
-
-var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
-
-function err(strm, errorCode) {
- strm.msg = msg[errorCode];
- return errorCode;
-}
-
-function rank(f) {
- return ((f) << 1) - ((f) > 4 ? 9 : 0);
-}
-
-function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
-
-
-/* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->output buffer and copying into it.
- * (See also read_buf()).
- */
-function flush_pending(strm) {
- var s = strm.state;
-
- //_tr_flush_bits(s);
- var len = s.pending;
- if (len > strm.avail_out) {
- len = strm.avail_out;
- }
- if (len === 0) { return; }
-
- utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
- strm.next_out += len;
- s.pending_out += len;
- strm.total_out += len;
- strm.avail_out -= len;
- s.pending -= len;
- if (s.pending === 0) {
- s.pending_out = 0;
- }
-}
-
-
-function flush_block_only (s, last) {
- trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
- s.block_start = s.strstart;
- flush_pending(s.strm);
-}
-
-
-function put_byte(s, b) {
- s.pending_buf[s.pending++] = b;
-}
-
-
-/* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
-function putShortMSB(s, b) {
-// put_byte(s, (Byte)(b >> 8));
-// put_byte(s, (Byte)(b & 0xff));
- s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
- s.pending_buf[s.pending++] = b & 0xff;
-}
-
-
-/* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read. All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->input buffer and copying from it.
- * (See also flush_pending()).
- */
-function read_buf(strm, buf, start, size) {
- var len = strm.avail_in;
-
- if (len > size) { len = size; }
- if (len === 0) { return 0; }
-
- strm.avail_in -= len;
-
- utils.arraySet(buf, strm.input, strm.next_in, len, start);
- if (strm.state.wrap === 1) {
- strm.adler = adler32(strm.adler, buf, len, start);
- }
-
- else if (strm.state.wrap === 2) {
- strm.adler = crc32(strm.adler, buf, len, start);
- }
-
- strm.next_in += len;
- strm.total_in += len;
-
- return len;
-}
-
-
-/* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
-function longest_match(s, cur_match) {
- var chain_length = s.max_chain_length; /* max hash chain length */
- var scan = s.strstart; /* current string */
- var match; /* matched string */
- var len; /* length of current match */
- var best_len = s.prev_length; /* best match length so far */
- var nice_match = s.nice_match; /* stop if match long enough */
- var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
- s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
-
- var _win = s.window; // shortcut
-
- var wmask = s.w_mask;
- var prev = s.prev;
-
- /* Stop when cur_match becomes <= limit. To simplify the code,
- * we prevent matches with the string of window index 0.
- */
-
- var strend = s.strstart + MAX_MATCH;
- var scan_end1 = _win[scan + best_len - 1];
- var scan_end = _win[scan + best_len];
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- /* Do not waste too much time if we already have a good match: */
- if (s.prev_length >= s.good_match) {
- chain_length >>= 2;
- }
- /* Do not look for matches beyond the end of the input. This is necessary
- * to make deflate deterministic.
- */
- if (nice_match > s.lookahead) { nice_match = s.lookahead; }
-
- // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- do {
- // Assert(cur_match < s->strstart, "no future");
- match = cur_match;
-
- /* Skip to next match if the match length cannot increase
- * or if the match length is less than 2. Note that the checks below
- * for insufficient lookahead only occur occasionally for performance
- * reasons. Therefore uninitialized memory will be accessed, and
- * conditional jumps will be made that depend on those values.
- * However the length of the match is limited to the lookahead, so
- * the output of deflate is not affected by the uninitialized values.
- */
-
- if (_win[match + best_len] !== scan_end ||
- _win[match + best_len - 1] !== scan_end1 ||
- _win[match] !== _win[scan] ||
- _win[++match] !== _win[scan + 1]) {
- continue;
- }
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2;
- match++;
- // Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- /*jshint noempty:false*/
- } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- scan < strend);
-
- // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (strend - scan);
- scan = strend - MAX_MATCH;
-
- if (len > best_len) {
- s.match_start = cur_match;
- best_len = len;
- if (len >= nice_match) {
- break;
- }
- scan_end1 = _win[scan + best_len - 1];
- scan_end = _win[scan + best_len];
- }
- } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
-
- if (best_len <= s.lookahead) {
- return best_len;
- }
- return s.lookahead;
-}
-
-
-/* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- * At least one byte has been read, or avail_in == 0; reads are
- * performed for at least two bytes (required for the zip translate_eol
- * option -- not supported here).
- */
-function fill_window(s) {
- var _w_size = s.w_size;
- var p, n, m, more, str;
-
- //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
-
- do {
- more = s.window_size - s.lookahead - s.strstart;
-
- // JS ints have 32 bit, block below not needed
- /* Deal with !@#$% 64K limit: */
- //if (sizeof(int) <= 2) {
- // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
- // more = wsize;
- //
- // } else if (more == (unsigned)(-1)) {
- // /* Very unlikely, but possible on 16 bit machine if
- // * strstart == 0 && lookahead == 1 (input done a byte at time)
- // */
- // more--;
- // }
- //}
-
-
- /* If the window is almost full and there is insufficient lookahead,
- * move the upper half to the lower one to make room in the upper half.
- */
- if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
-
- utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
- s.match_start -= _w_size;
- s.strstart -= _w_size;
- /* we now have strstart >= MAX_DIST */
- s.block_start -= _w_size;
-
- /* Slide the hash table (could be avoided with 32 bit values
- at the expense of memory usage). We slide even when level == 0
- to keep the hash table consistent if we switch back to level > 0
- later. (Using level 0 permanently is not an optimal usage of
- zlib, so we don't care about this pathological case.)
- */
-
- n = s.hash_size;
- p = n;
- do {
- m = s.head[--p];
- s.head[p] = (m >= _w_size ? m - _w_size : 0);
- } while (--n);
-
- n = _w_size;
- p = n;
- do {
- m = s.prev[--p];
- s.prev[p] = (m >= _w_size ? m - _w_size : 0);
- /* If n is not on any hash chain, prev[n] is garbage but
- * its value will never be used.
- */
- } while (--n);
-
- more += _w_size;
- }
- if (s.strm.avail_in === 0) {
- break;
- }
-
- /* If there was no sliding:
- * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
- * more == window_size - lookahead - strstart
- * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
- * => more >= window_size - 2*WSIZE + 2
- * In the BIG_MEM or MMAP case (not yet supported),
- * window_size == input_size + MIN_LOOKAHEAD &&
- * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
- * Otherwise, window_size == 2*WSIZE so more >= 2.
- * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
- */
- //Assert(more >= 2, "more < 2");
- n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
- s.lookahead += n;
-
- /* Initialize the hash value now that we have some input: */
- if (s.lookahead + s.insert >= MIN_MATCH) {
- str = s.strstart - s.insert;
- s.ins_h = s.window[str];
-
- /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
-//#if MIN_MATCH != 3
-// Call update_hash() MIN_MATCH-3 more times
-//#endif
- while (s.insert) {
- /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask;
-
- s.prev[str & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = str;
- str++;
- s.insert--;
- if (s.lookahead + s.insert < MIN_MATCH) {
- break;
- }
- }
- }
- /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
- * but this is not important since only literal bytes will be emitted.
- */
-
- } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
-
- /* If the WIN_INIT bytes after the end of the current data have never been
- * written, then zero those bytes in order to avoid memory check reports of
- * the use of uninitialized (or uninitialised as Julian writes) bytes by
- * the longest match routines. Update the high water mark for the next
- * time through here. WIN_INIT is set to MAX_MATCH since the longest match
- * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
- */
-// if (s.high_water < s.window_size) {
-// var curr = s.strstart + s.lookahead;
-// var init = 0;
-//
-// if (s.high_water < curr) {
-// /* Previous high water mark below current data -- zero WIN_INIT
-// * bytes or up to end of window, whichever is less.
-// */
-// init = s.window_size - curr;
-// if (init > WIN_INIT)
-// init = WIN_INIT;
-// zmemzero(s->window + curr, (unsigned)init);
-// s->high_water = curr + init;
-// }
-// else if (s->high_water < (ulg)curr + WIN_INIT) {
-// /* High water mark at or above current data, but below current data
-// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
-// * to end of window, whichever is less.
-// */
-// init = (ulg)curr + WIN_INIT - s->high_water;
-// if (init > s->window_size - s->high_water)
-// init = s->window_size - s->high_water;
-// zmemzero(s->window + s->high_water, (unsigned)init);
-// s->high_water += init;
-// }
-// }
-//
-// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
-// "not enough room for search");
-}
-
-/* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
-function deflate_stored(s, flush) {
- /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
- * to pending_buf_size, and each stored block has a 5 byte header:
- */
- var max_block_size = 0xffff;
-
- if (max_block_size > s.pending_buf_size - 5) {
- max_block_size = s.pending_buf_size - 5;
- }
-
- /* Copy as much as possible from input to output: */
- for (;;) {
- /* Fill the window as much as possible: */
- if (s.lookahead <= 1) {
-
- //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
- // s->block_start >= (long)s->w_size, "slide too late");
-// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
-// s.block_start >= s.w_size)) {
-// throw new Error("slide too late");
-// }
-
- fill_window(s);
- if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
-
- if (s.lookahead === 0) {
- break;
- }
- /* flush the current block */
- }
- //Assert(s->block_start >= 0L, "block gone");
-// if (s.block_start < 0) throw new Error("block gone");
-
- s.strstart += s.lookahead;
- s.lookahead = 0;
-
- /* Emit a stored block if pending_buf will be full: */
- var max_start = s.block_start + max_block_size;
-
- if (s.strstart === 0 || s.strstart >= max_start) {
- /* strstart == 0 is possible when wraparound on 16-bit machine */
- s.lookahead = s.strstart - max_start;
- s.strstart = max_start;
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
-
-
- }
- /* Flush if we may have to slide, otherwise block_start may become
- * negative and the data will be gone:
- */
- if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
-
- s.insert = 0;
-
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
-
- if (s.strstart > s.block_start) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- return BS_NEED_MORE;
-}
-
-/* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-function deflate_fast(s, flush) {
- var hash_head; /* head of the hash chain */
- var bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s.lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) {
- break; /* flush the current block */
- }
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = 0/*NIL*/;
- if (s.lookahead >= MIN_MATCH) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
-
- /* Find the longest match, discarding those <= prev_length.
- * At this point we have always match_length < MIN_MATCH
- */
- if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s.match_length = longest_match(s, hash_head);
- /* longest_match() sets match_start */
- }
- if (s.match_length >= MIN_MATCH) {
- // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
-
- /*** _tr_tally_dist(s, s.strstart - s.match_start,
- s.match_length - MIN_MATCH, bflush); ***/
- bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
-
- s.lookahead -= s.match_length;
-
- /* Insert new strings in the hash table only if the match length
- * is not too large. This saves time but degrades compression.
- */
- if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
- s.match_length--; /* string at strstart already in table */
- do {
- s.strstart++;
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- /* strstart never exceeds WSIZE-MAX_MATCH, so there are
- * always MIN_MATCH bytes ahead.
- */
- } while (--s.match_length !== 0);
- s.strstart++;
- } else
- {
- s.strstart += s.match_length;
- s.match_length = 0;
- s.ins_h = s.window[s.strstart];
- /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
-
-//#if MIN_MATCH != 3
-// Call UPDATE_HASH() MIN_MATCH-3 more times
-//#endif
- /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
- * matter since it will be recomputed at next deflate call.
- */
- }
- } else {
- /* No match, output a literal byte */
- //Tracevv((stderr,"%c", s.window[s.strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
-
- s.lookahead--;
- s.strstart++;
- }
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
-}
-
-/* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-function deflate_slow(s, flush) {
- var hash_head; /* head of hash chain */
- var bflush; /* set if current block must be flushed */
-
- var max_insert;
-
- /* Process the input block. */
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s.lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) { break; } /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = 0/*NIL*/;
- if (s.lookahead >= MIN_MATCH) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
-
- /* Find the longest match, discarding those <= prev_length.
- */
- s.prev_length = s.match_length;
- s.prev_match = s.match_start;
- s.match_length = MIN_MATCH-1;
-
- if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
- s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s.match_length = longest_match(s, hash_head);
- /* longest_match() sets match_start */
-
- if (s.match_length <= 5 &&
- (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
-
- /* If prev_match is also MIN_MATCH, match_start is garbage
- * but we will ignore the current match anyway.
- */
- s.match_length = MIN_MATCH-1;
- }
- }
- /* If there was a match at the previous step and the current
- * match is not better, output the previous match:
- */
- if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
- max_insert = s.strstart + s.lookahead - MIN_MATCH;
- /* Do not insert strings in hash table beyond this. */
-
- //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
-
- /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
- s.prev_length - MIN_MATCH, bflush);***/
- bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);
- /* Insert in hash table all strings up to the end of the match.
- * strstart-1 and strstart are already inserted. If there is not
- * enough lookahead, the last two strings are not inserted in
- * the hash table.
- */
- s.lookahead -= s.prev_length-1;
- s.prev_length -= 2;
- do {
- if (++s.strstart <= max_insert) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
- } while (--s.prev_length !== 0);
- s.match_available = 0;
- s.match_length = MIN_MATCH-1;
- s.strstart++;
-
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- } else if (s.match_available) {
- /* If there was no match at the previous position, output a
- * single literal. If there was a match but the current match
- * is longer, truncate the previous match to a single literal.
- */
- //Tracevv((stderr,"%c", s->window[s->strstart-1]));
- /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
-
- if (bflush) {
- /*** FLUSH_BLOCK_ONLY(s, 0) ***/
- flush_block_only(s, false);
- /***/
- }
- s.strstart++;
- s.lookahead--;
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- } else {
- /* There is no previous match to compare with, wait for
- * the next step to decide.
- */
- s.match_available = 1;
- s.strstart++;
- s.lookahead--;
- }
- }
- //Assert (flush != Z_NO_FLUSH, "no flush?");
- if (s.match_available) {
- //Tracevv((stderr,"%c", s->window[s->strstart-1]));
- /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
-
- s.match_available = 0;
- }
- s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- return BS_BLOCK_DONE;
-}
-
-
-/* ===========================================================================
- * For Z_RLE, simply look for runs of bytes, generate matches only of distance
- * one. Do not maintain a hash table. (It will be regenerated if this run of
- * deflate switches away from Z_RLE.)
- */
-function deflate_rle(s, flush) {
- var bflush; /* set if current block must be flushed */
- var prev; /* byte at distance one to match */
- var scan, strend; /* scan goes up to strend for length of run */
-
- var _win = s.window;
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the longest run, plus one for the unrolled loop.
- */
- if (s.lookahead <= MAX_MATCH) {
- fill_window(s);
- if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) { break; } /* flush the current block */
- }
-
- /* See how many times the previous byte repeats */
- s.match_length = 0;
- if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
- scan = s.strstart - 1;
- prev = _win[scan];
- if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
- strend = s.strstart + MAX_MATCH;
- do {
- /*jshint noempty:false*/
- } while (prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- scan < strend);
- s.match_length = MAX_MATCH - (strend - scan);
- if (s.match_length > s.lookahead) {
- s.match_length = s.lookahead;
- }
- }
- //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
- }
-
- /* Emit match if have run of MIN_MATCH or longer, else emit literal */
- if (s.match_length >= MIN_MATCH) {
- //check_match(s, s.strstart, s.strstart - 1, s.match_length);
-
- /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
- bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
-
- s.lookahead -= s.match_length;
- s.strstart += s.match_length;
- s.match_length = 0;
- } else {
- /* No match, output a literal byte */
- //Tracevv((stderr,"%c", s->window[s->strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
-
- s.lookahead--;
- s.strstart++;
- }
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = 0;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
-}
-
-/* ===========================================================================
- * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
- * (It will be regenerated if this run of deflate switches away from Huffman.)
- */
-function deflate_huff(s, flush) {
- var bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we have a literal to write. */
- if (s.lookahead === 0) {
- fill_window(s);
- if (s.lookahead === 0) {
- if (flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- break; /* flush the current block */
- }
- }
-
- /* Output a literal byte */
- s.match_length = 0;
- //Tracevv((stderr,"%c", s->window[s->strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
- s.lookahead--;
- s.strstart++;
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = 0;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
-}
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-var Config = function (good_length, max_lazy, nice_length, max_chain, func) {
- this.good_length = good_length;
- this.max_lazy = max_lazy;
- this.nice_length = nice_length;
- this.max_chain = max_chain;
- this.func = func;
-};
-
-var configuration_table;
-
-configuration_table = [
- /* good lazy nice chain */
- new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
- new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
- new Config(4, 5, 16, 8, deflate_fast), /* 2 */
- new Config(4, 6, 32, 32, deflate_fast), /* 3 */
-
- new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
- new Config(8, 16, 32, 32, deflate_slow), /* 5 */
- new Config(8, 16, 128, 128, deflate_slow), /* 6 */
- new Config(8, 32, 128, 256, deflate_slow), /* 7 */
- new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
- new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
-];
-
-
-/* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
-function lm_init(s) {
- s.window_size = 2 * s.w_size;
-
- /*** CLEAR_HASH(s); ***/
- zero(s.head); // Fill with NIL (= 0);
-
- /* Set the default configuration parameters:
- */
- s.max_lazy_match = configuration_table[s.level].max_lazy;
- s.good_match = configuration_table[s.level].good_length;
- s.nice_match = configuration_table[s.level].nice_length;
- s.max_chain_length = configuration_table[s.level].max_chain;
-
- s.strstart = 0;
- s.block_start = 0;
- s.lookahead = 0;
- s.insert = 0;
- s.match_length = s.prev_length = MIN_MATCH - 1;
- s.match_available = 0;
- s.ins_h = 0;
-}
-
-
-function DeflateState() {
- this.strm = null; /* pointer back to this zlib stream */
- this.status = 0; /* as the name implies */
- this.pending_buf = null; /* output still pending */
- this.pending_buf_size = 0; /* size of pending_buf */
- this.pending_out = 0; /* next pending byte to output to the stream */
- this.pending = 0; /* nb of bytes in the pending buffer */
- this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
- this.gzhead = null; /* gzip header information to write */
- this.gzindex = 0; /* where in extra, name, or comment */
- this.method = Z_DEFLATED; /* can only be DEFLATED */
- this.last_flush = -1; /* value of flush param for previous deflate call */
-
- this.w_size = 0; /* LZ77 window size (32K by default) */
- this.w_bits = 0; /* log2(w_size) (8..16) */
- this.w_mask = 0; /* w_size - 1 */
-
- this.window = null;
- /* Sliding window. Input bytes are read into the second half of the window,
- * and move to the first half later to keep a dictionary of at least wSize
- * bytes. With this organization, matches are limited to a distance of
- * wSize-MAX_MATCH bytes, but this ensures that IO is always
- * performed with a length multiple of the block size.
- */
-
- this.window_size = 0;
- /* Actual size of window: 2*wSize, except when the user input buffer
- * is directly used as sliding window.
- */
-
- this.prev = null;
- /* Link to older string with same hash index. To limit the size of this
- * array to 64K, this link is maintained only for the last 32K strings.
- * An index in this array is thus a window index modulo 32K.
- */
-
- this.head = null; /* Heads of the hash chains or NIL. */
-
- this.ins_h = 0; /* hash index of string to be inserted */
- this.hash_size = 0; /* number of elements in hash table */
- this.hash_bits = 0; /* log2(hash_size) */
- this.hash_mask = 0; /* hash_size-1 */
-
- this.hash_shift = 0;
- /* Number of bits by which ins_h must be shifted at each input
- * step. It must be such that after MIN_MATCH steps, the oldest
- * byte no longer takes part in the hash key, that is:
- * hash_shift * MIN_MATCH >= hash_bits
- */
-
- this.block_start = 0;
- /* Window position at the beginning of the current output block. Gets
- * negative when the window is moved backwards.
- */
-
- this.match_length = 0; /* length of best match */
- this.prev_match = 0; /* previous match */
- this.match_available = 0; /* set if previous match exists */
- this.strstart = 0; /* start of string to insert */
- this.match_start = 0; /* start of matching string */
- this.lookahead = 0; /* number of valid bytes ahead in window */
-
- this.prev_length = 0;
- /* Length of the best match at previous step. Matches not greater than this
- * are discarded. This is used in the lazy match evaluation.
- */
-
- this.max_chain_length = 0;
- /* To speed up deflation, hash chains are never searched beyond this
- * length. A higher limit improves compression ratio but degrades the
- * speed.
- */
-
- this.max_lazy_match = 0;
- /* Attempt to find a better match only when the current match is strictly
- * smaller than this value. This mechanism is used only for compression
- * levels >= 4.
- */
- // That's alias to max_lazy_match, don't use directly
- //this.max_insert_length = 0;
- /* Insert new strings in the hash table only if the match length is not
- * greater than this length. This saves time but degrades compression.
- * max_insert_length is used only for compression levels <= 3.
- */
-
- this.level = 0; /* compression level (1..9) */
- this.strategy = 0; /* favor or force Huffman coding*/
-
- this.good_match = 0;
- /* Use a faster search when the previous match is longer than this */
-
- this.nice_match = 0; /* Stop searching when current match exceeds this */
-
- /* used by trees.c: */
-
- /* Didn't use ct_data typedef below to suppress compiler warning */
-
- // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
- // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
- // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
-
- // Use flat array of DOUBLE size, with interleaved fata,
- // because JS does not support effective
- this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
- this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2);
- this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2);
- zero(this.dyn_ltree);
- zero(this.dyn_dtree);
- zero(this.bl_tree);
-
- this.l_desc = null; /* desc. for literal tree */
- this.d_desc = null; /* desc. for distance tree */
- this.bl_desc = null; /* desc. for bit length tree */
-
- //ush bl_count[MAX_BITS+1];
- this.bl_count = new utils.Buf16(MAX_BITS+1);
- /* number of codes at each bit length for an optimal tree */
-
- //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
- this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */
- zero(this.heap);
-
- this.heap_len = 0; /* number of elements in the heap */
- this.heap_max = 0; /* element of largest frequency */
- /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
- * The same heap array is used to build all trees.
- */
-
- this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1];
- zero(this.depth);
- /* Depth of each subtree used as tie breaker for trees of equal frequency
- */
-
- this.l_buf = 0; /* buffer index for literals or lengths */
-
- this.lit_bufsize = 0;
- /* Size of match buffer for literals/lengths. There are 4 reasons for
- * limiting lit_bufsize to 64K:
- * - frequencies can be kept in 16 bit counters
- * - if compression is not successful for the first block, all input
- * data is still in the window so we can still emit a stored block even
- * when input comes from standard input. (This can also be done for
- * all blocks if lit_bufsize is not greater than 32K.)
- * - if compression is not successful for a file smaller than 64K, we can
- * even emit a stored file instead of a stored block (saving 5 bytes).
- * This is applicable only for zip (not gzip or zlib).
- * - creating new Huffman trees less frequently may not provide fast
- * adaptation to changes in the input data statistics. (Take for
- * example a binary file with poorly compressible code followed by
- * a highly compressible string table.) Smaller buffer sizes give
- * fast adaptation but have of course the overhead of transmitting
- * trees more frequently.
- * - I can't count above 4
- */
-
- this.last_lit = 0; /* running index in l_buf */
-
- this.d_buf = 0;
- /* Buffer index for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
-
- this.opt_len = 0; /* bit length of current block with optimal trees */
- this.static_len = 0; /* bit length of current block with static trees */
- this.matches = 0; /* number of string matches in current block */
- this.insert = 0; /* bytes at end of window left to insert */
-
-
- this.bi_buf = 0;
- /* Output buffer. bits are inserted starting at the bottom (least
- * significant bits).
- */
- this.bi_valid = 0;
- /* Number of valid bits in bi_buf. All bits above the last valid bit
- * are always zero.
- */
-
- // Used for window memory init. We safely ignore it for JS. That makes
- // sense only for pointers and memory check tools.
- //this.high_water = 0;
- /* High water mark offset in window for initialized bytes -- bytes above
- * this are set to zero in order to avoid memory check warnings when
- * longest match routines access bytes past the input. This is then
- * updated to the new high water mark.
- */
-}
-
-
-function deflateResetKeep(strm) {
- var s;
-
- if (!strm || !strm.state) {
- return err(strm, Z_STREAM_ERROR);
- }
-
- strm.total_in = strm.total_out = 0;
- strm.data_type = Z_UNKNOWN;
-
- s = strm.state;
- s.pending = 0;
- s.pending_out = 0;
-
- if (s.wrap < 0) {
- s.wrap = -s.wrap;
- /* was made negative by deflate(..., Z_FINISH); */
- }
- s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
- strm.adler = (s.wrap === 2) ?
- 0 // crc32(0, Z_NULL, 0)
- :
- 1; // adler32(0, Z_NULL, 0)
- s.last_flush = Z_NO_FLUSH;
- trees._tr_init(s);
- return Z_OK;
-}
-
-
-function deflateReset(strm) {
- var ret = deflateResetKeep(strm);
- if (ret === Z_OK) {
- lm_init(strm.state);
- }
- return ret;
-}
-
-
-function deflateSetHeader(strm, head) {
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
- strm.state.gzhead = head;
- return Z_OK;
-}
-
-
-function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
- if (!strm) { // === Z_NULL
- return Z_STREAM_ERROR;
- }
- var wrap = 1;
-
- if (level === Z_DEFAULT_COMPRESSION) {
- level = 6;
- }
-
- if (windowBits < 0) { /* suppress zlib wrapper */
- wrap = 0;
- windowBits = -windowBits;
- }
-
- else if (windowBits > 15) {
- wrap = 2; /* write gzip wrapper instead */
- windowBits -= 16;
- }
-
-
- if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
- windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
- strategy < 0 || strategy > Z_FIXED) {
- return err(strm, Z_STREAM_ERROR);
- }
-
-
- if (windowBits === 8) {
- windowBits = 9;
- }
- /* until 256-byte window bug fixed */
-
- var s = new DeflateState();
-
- strm.state = s;
- s.strm = strm;
-
- s.wrap = wrap;
- s.gzhead = null;
- s.w_bits = windowBits;
- s.w_size = 1 << s.w_bits;
- s.w_mask = s.w_size - 1;
-
- s.hash_bits = memLevel + 7;
- s.hash_size = 1 << s.hash_bits;
- s.hash_mask = s.hash_size - 1;
- s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
-
- s.window = new utils.Buf8(s.w_size * 2);
- s.head = new utils.Buf16(s.hash_size);
- s.prev = new utils.Buf16(s.w_size);
-
- // Don't need mem init magic for JS.
- //s.high_water = 0; /* nothing written to s->window yet */
-
- s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
- s.pending_buf_size = s.lit_bufsize * 4;
- s.pending_buf = new utils.Buf8(s.pending_buf_size);
-
- s.d_buf = s.lit_bufsize >> 1;
- s.l_buf = (1 + 2) * s.lit_bufsize;
-
- s.level = level;
- s.strategy = strategy;
- s.method = method;
-
- return deflateReset(strm);
-}
-
-function deflateInit(strm, level) {
- return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
-}
-
-
-function deflate(strm, flush) {
- var old_flush, s;
- var beg, val; // for gzip header write only
-
- if (!strm || !strm.state ||
- flush > Z_BLOCK || flush < 0) {
- return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
- }
-
- s = strm.state;
-
- if (!strm.output ||
- (!strm.input && strm.avail_in !== 0) ||
- (s.status === FINISH_STATE && flush !== Z_FINISH)) {
- return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
- }
-
- s.strm = strm; /* just in case */
- old_flush = s.last_flush;
- s.last_flush = flush;
-
- /* Write the header */
- if (s.status === INIT_STATE) {
-
- if (s.wrap === 2) { // GZIP header
- strm.adler = 0; //crc32(0L, Z_NULL, 0);
- put_byte(s, 31);
- put_byte(s, 139);
- put_byte(s, 8);
- if (!s.gzhead) { // s->gzhead == Z_NULL
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, s.level === 9 ? 2 :
- (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
- 4 : 0));
- put_byte(s, OS_CODE);
- s.status = BUSY_STATE;
- }
- else {
- put_byte(s, (s.gzhead.text ? 1 : 0) +
- (s.gzhead.hcrc ? 2 : 0) +
- (!s.gzhead.extra ? 0 : 4) +
- (!s.gzhead.name ? 0 : 8) +
- (!s.gzhead.comment ? 0 : 16)
- );
- put_byte(s, s.gzhead.time & 0xff);
- put_byte(s, (s.gzhead.time >> 8) & 0xff);
- put_byte(s, (s.gzhead.time >> 16) & 0xff);
- put_byte(s, (s.gzhead.time >> 24) & 0xff);
- put_byte(s, s.level === 9 ? 2 :
- (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
- 4 : 0));
- put_byte(s, s.gzhead.os & 0xff);
- if (s.gzhead.extra && s.gzhead.extra.length) {
- put_byte(s, s.gzhead.extra.length & 0xff);
- put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
- }
- if (s.gzhead.hcrc) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
- }
- s.gzindex = 0;
- s.status = EXTRA_STATE;
- }
- }
- else // DEFLATE header
- {
- var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
- var level_flags = -1;
-
- if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
- level_flags = 0;
- } else if (s.level < 6) {
- level_flags = 1;
- } else if (s.level === 6) {
- level_flags = 2;
- } else {
- level_flags = 3;
- }
- header |= (level_flags << 6);
- if (s.strstart !== 0) { header |= PRESET_DICT; }
- header += 31 - (header % 31);
-
- s.status = BUSY_STATE;
- putShortMSB(s, header);
-
- /* Save the adler32 of the preset dictionary: */
- if (s.strstart !== 0) {
- putShortMSB(s, strm.adler >>> 16);
- putShortMSB(s, strm.adler & 0xffff);
- }
- strm.adler = 1; // adler32(0L, Z_NULL, 0);
- }
- }
-
-//#ifdef GZIP
- if (s.status === EXTRA_STATE) {
- if (s.gzhead.extra/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
-
- while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- break;
- }
- }
- put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
- s.gzindex++;
- }
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (s.gzindex === s.gzhead.extra.length) {
- s.gzindex = 0;
- s.status = NAME_STATE;
- }
- }
- else {
- s.status = NAME_STATE;
- }
- }
- if (s.status === NAME_STATE) {
- if (s.gzhead.name/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
- //int val;
-
- do {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- val = 1;
- break;
- }
- }
- // JS specific: little magic to add zero terminator to end of string
- if (s.gzindex < s.gzhead.name.length) {
- val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
- } else {
- val = 0;
- }
- put_byte(s, val);
- } while (val !== 0);
-
- if (s.gzhead.hcrc && s.pending > beg){
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (val === 0) {
- s.gzindex = 0;
- s.status = COMMENT_STATE;
- }
- }
- else {
- s.status = COMMENT_STATE;
- }
- }
- if (s.status === COMMENT_STATE) {
- if (s.gzhead.comment/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
- //int val;
-
- do {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- val = 1;
- break;
- }
- }
- // JS specific: little magic to add zero terminator to end of string
- if (s.gzindex < s.gzhead.comment.length) {
- val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
- } else {
- val = 0;
- }
- put_byte(s, val);
- } while (val !== 0);
-
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (val === 0) {
- s.status = HCRC_STATE;
- }
- }
- else {
- s.status = HCRC_STATE;
- }
- }
- if (s.status === HCRC_STATE) {
- if (s.gzhead.hcrc) {
- if (s.pending + 2 > s.pending_buf_size) {
- flush_pending(strm);
- }
- if (s.pending + 2 <= s.pending_buf_size) {
- put_byte(s, strm.adler & 0xff);
- put_byte(s, (strm.adler >> 8) & 0xff);
- strm.adler = 0; //crc32(0L, Z_NULL, 0);
- s.status = BUSY_STATE;
- }
- }
- else {
- s.status = BUSY_STATE;
- }
- }
-//#endif
-
- /* Flush as much pending output as possible */
- if (s.pending !== 0) {
- flush_pending(strm);
- if (strm.avail_out === 0) {
- /* Since avail_out is 0, deflate will be called again with
- * more output space, but possibly with both pending and
- * avail_in equal to zero. There won't be anything to do,
- * but this is not an error situation so make sure we
- * return OK instead of BUF_ERROR at next call of deflate:
- */
- s.last_flush = -1;
- return Z_OK;
- }
-
- /* Make sure there is something to do and avoid duplicate consecutive
- * flushes. For repeated and useless calls with Z_FINISH, we keep
- * returning Z_STREAM_END instead of Z_BUF_ERROR.
- */
- } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
- flush !== Z_FINISH) {
- return err(strm, Z_BUF_ERROR);
- }
-
- /* User must not provide more input after the first FINISH: */
- if (s.status === FINISH_STATE && strm.avail_in !== 0) {
- return err(strm, Z_BUF_ERROR);
- }
-
- /* Start a new block or continue the current one.
- */
- if (strm.avail_in !== 0 || s.lookahead !== 0 ||
- (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
- var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
- (s.strategy === Z_RLE ? deflate_rle(s, flush) :
- configuration_table[s.level].func(s, flush));
-
- if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
- s.status = FINISH_STATE;
- }
- if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
- if (strm.avail_out === 0) {
- s.last_flush = -1;
- /* avoid BUF_ERROR next call, see above */
- }
- return Z_OK;
- /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
- * of deflate should use the same flush parameter to make sure
- * that the flush is complete. So we don't have to output an
- * empty block here, this will be done at next call. This also
- * ensures that for a very small output buffer, we emit at most
- * one empty block.
- */
- }
- if (bstate === BS_BLOCK_DONE) {
- if (flush === Z_PARTIAL_FLUSH) {
- trees._tr_align(s);
- }
- else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
-
- trees._tr_stored_block(s, 0, 0, false);
- /* For a full flush, this empty block will be recognized
- * as a special marker by inflate_sync().
- */
- if (flush === Z_FULL_FLUSH) {
- /*** CLEAR_HASH(s); ***/ /* forget history */
- zero(s.head); // Fill with NIL (= 0);
-
- if (s.lookahead === 0) {
- s.strstart = 0;
- s.block_start = 0;
- s.insert = 0;
- }
- }
- }
- flush_pending(strm);
- if (strm.avail_out === 0) {
- s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
- return Z_OK;
- }
- }
- }
- //Assert(strm->avail_out > 0, "bug2");
- //if (strm.avail_out <= 0) { throw new Error("bug2");}
-
- if (flush !== Z_FINISH) { return Z_OK; }
- if (s.wrap <= 0) { return Z_STREAM_END; }
-
- /* Write the trailer */
- if (s.wrap === 2) {
- put_byte(s, strm.adler & 0xff);
- put_byte(s, (strm.adler >> 8) & 0xff);
- put_byte(s, (strm.adler >> 16) & 0xff);
- put_byte(s, (strm.adler >> 24) & 0xff);
- put_byte(s, strm.total_in & 0xff);
- put_byte(s, (strm.total_in >> 8) & 0xff);
- put_byte(s, (strm.total_in >> 16) & 0xff);
- put_byte(s, (strm.total_in >> 24) & 0xff);
- }
- else
- {
- putShortMSB(s, strm.adler >>> 16);
- putShortMSB(s, strm.adler & 0xffff);
- }
-
- flush_pending(strm);
- /* If avail_out is zero, the application will call deflate again
- * to flush the rest.
- */
- if (s.wrap > 0) { s.wrap = -s.wrap; }
- /* write the trailer only once! */
- return s.pending !== 0 ? Z_OK : Z_STREAM_END;
-}
-
-function deflateEnd(strm) {
- var status;
-
- if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
- return Z_STREAM_ERROR;
- }
-
- status = strm.state.status;
- if (status !== INIT_STATE &&
- status !== EXTRA_STATE &&
- status !== NAME_STATE &&
- status !== COMMENT_STATE &&
- status !== HCRC_STATE &&
- status !== BUSY_STATE &&
- status !== FINISH_STATE
- ) {
- return err(strm, Z_STREAM_ERROR);
- }
-
- strm.state = null;
-
- return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
-}
-
-/* =========================================================================
- * Copy the source state to the destination state
- */
-//function deflateCopy(dest, source) {
-//
-//}
-
-exports.deflateInit = deflateInit;
-exports.deflateInit2 = deflateInit2;
-exports.deflateReset = deflateReset;
-exports.deflateResetKeep = deflateResetKeep;
-exports.deflateSetHeader = deflateSetHeader;
-exports.deflate = deflate;
-exports.deflateEnd = deflateEnd;
-exports.deflateInfo = 'pako deflate (from Nodeca project)';
-
-/* Not implemented
-exports.deflateBound = deflateBound;
-exports.deflateCopy = deflateCopy;
-exports.deflateSetDictionary = deflateSetDictionary;
-exports.deflateParams = deflateParams;
-exports.deflatePending = deflatePending;
-exports.deflatePrime = deflatePrime;
-exports.deflateTune = deflateTune;
-*/
-},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){
-'use strict';
-
-
-function GZheader() {
- /* true if compressed data believed to be text */
- this.text = 0;
- /* modification time */
- this.time = 0;
- /* extra flags (not used when writing a gzip file) */
- this.xflags = 0;
- /* operating system */
- this.os = 0;
- /* pointer to extra field or Z_NULL if none */
- this.extra = null;
- /* extra field length (valid if extra != Z_NULL) */
- this.extra_len = 0; // Actually, we don't need it in JS,
- // but leave for few code modifications
-
- //
- // Setup limits is not necessary because in js we should not preallocate memory
- // for inflate use constant limit in 65536 bytes
- //
-
- /* space at extra (only when reading header) */
- // this.extra_max = 0;
- /* pointer to zero-terminated file name or Z_NULL */
- this.name = '';
- /* space at name (only when reading header) */
- // this.name_max = 0;
- /* pointer to zero-terminated comment or Z_NULL */
- this.comment = '';
- /* space at comment (only when reading header) */
- // this.comm_max = 0;
- /* true if there was or will be a header crc */
- this.hcrc = 0;
- /* true when done reading gzip header (not used when writing a gzip file) */
- this.done = false;
-}
-
-module.exports = GZheader;
-},{}],34:[function(_dereq_,module,exports){
-'use strict';
-
-// See state defs from inflate.js
-var BAD = 30; /* got a data error -- remain here until reset */
-var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
-
-/*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state.mode === LEN
- strm.avail_in >= 6
- strm.avail_out >= 258
- start >= strm.avail_out
- state.bits < 8
-
- On return, state.mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm.avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm.avail_out >= 258 for each loop to avoid checking for
- output space.
- */
-module.exports = function inflate_fast(strm, start) {
- var state;
- var _in; /* local strm.input */
- var last; /* have enough input while in < last */
- var _out; /* local strm.output */
- var beg; /* inflate()'s initial strm.output */
- var end; /* while out < end, enough space available */
-//#ifdef INFLATE_STRICT
- var dmax; /* maximum distance from zlib header */
-//#endif
- var wsize; /* window size or zero if not using window */
- var whave; /* valid bytes in the window */
- var wnext; /* window write index */
- var window; /* allocated sliding window, if wsize != 0 */
- var hold; /* local strm.hold */
- var bits; /* local strm.bits */
- var lcode; /* local strm.lencode */
- var dcode; /* local strm.distcode */
- var lmask; /* mask for first level of length codes */
- var dmask; /* mask for first level of distance codes */
- var here; /* retrieved table entry */
- var op; /* code bits, operation, extra bits, or */
- /* window position, window bytes to copy */
- var len; /* match length, unused bytes */
- var dist; /* match distance */
- var from; /* where to copy match from */
- var from_source;
-
-
- var input, output; // JS specific, because we have no pointers
-
- /* copy state to local variables */
- state = strm.state;
- //here = state.here;
- _in = strm.next_in;
- input = strm.input;
- last = _in + (strm.avail_in - 5);
- _out = strm.next_out;
- output = strm.output;
- beg = _out - (start - strm.avail_out);
- end = _out + (strm.avail_out - 257);
-//#ifdef INFLATE_STRICT
- dmax = state.dmax;
-//#endif
- wsize = state.wsize;
- whave = state.whave;
- wnext = state.wnext;
- window = state.window;
- hold = state.hold;
- bits = state.bits;
- lcode = state.lencode;
- dcode = state.distcode;
- lmask = (1 << state.lenbits) - 1;
- dmask = (1 << state.distbits) - 1;
-
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
-
- top:
- do {
- if (bits < 15) {
- hold += input[_in++] << bits;
- bits += 8;
- hold += input[_in++] << bits;
- bits += 8;
- }
-
- here = lcode[hold & lmask];
-
- dolen:
- for (;;) { // Goto emulation
- op = here >>> 24/*here.bits*/;
- hold >>>= op;
- bits -= op;
- op = (here >>> 16) & 0xff/*here.op*/;
- if (op === 0) { /* literal */
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- // "inflate: literal '%c'\n" :
- // "inflate: literal 0x%02x\n", here.val));
- output[_out++] = here & 0xffff/*here.val*/;
- }
- else if (op & 16) { /* length base */
- len = here & 0xffff/*here.val*/;
- op &= 15; /* number of extra bits */
- if (op) {
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- }
- len += hold & ((1 << op) - 1);
- hold >>>= op;
- bits -= op;
- }
- //Tracevv((stderr, "inflate: length %u\n", len));
- if (bits < 15) {
- hold += input[_in++] << bits;
- bits += 8;
- hold += input[_in++] << bits;
- bits += 8;
- }
- here = dcode[hold & dmask];
-
- dodist:
- for (;;) { // goto emulation
- op = here >>> 24/*here.bits*/;
- hold >>>= op;
- bits -= op;
- op = (here >>> 16) & 0xff/*here.op*/;
-
- if (op & 16) { /* distance base */
- dist = here & 0xffff/*here.val*/;
- op &= 15; /* number of extra bits */
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- }
- }
- dist += hold & ((1 << op) - 1);
-//#ifdef INFLATE_STRICT
- if (dist > dmax) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break top;
- }
-//#endif
- hold >>>= op;
- bits -= op;
- //Tracevv((stderr, "inflate: distance %u\n", dist));
- op = _out - beg; /* max distance in output */
- if (dist > op) { /* see if copy from window */
- op = dist - op; /* distance back in window */
- if (op > whave) {
- if (state.sane) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break top;
- }
-
-// (!) This block is disabled in zlib defailts,
-// don't enable it for binary compatibility
-//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
-// if (len <= op - whave) {
-// do {
-// output[_out++] = 0;
-// } while (--len);
-// continue top;
-// }
-// len -= op - whave;
-// do {
-// output[_out++] = 0;
-// } while (--op > whave);
-// if (op === 0) {
-// from = _out - dist;
-// do {
-// output[_out++] = output[from++];
-// } while (--len);
-// continue top;
-// }
-//#endif
- }
- from = 0; // window index
- from_source = window;
- if (wnext === 0) { /* very common case */
- from += wsize - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- else if (wnext < op) { /* wrap around window */
- from += wsize + wnext - op;
- op -= wnext;
- if (op < len) { /* some from end of window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = 0;
- if (wnext < len) { /* some from start of window */
- op = wnext;
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- }
- else { /* contiguous in window */
- from += wnext - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- while (len > 2) {
- output[_out++] = from_source[from++];
- output[_out++] = from_source[from++];
- output[_out++] = from_source[from++];
- len -= 3;
- }
- if (len) {
- output[_out++] = from_source[from++];
- if (len > 1) {
- output[_out++] = from_source[from++];
- }
- }
- }
- else {
- from = _out - dist; /* copy direct from output */
- do { /* minimum length is three */
- output[_out++] = output[from++];
- output[_out++] = output[from++];
- output[_out++] = output[from++];
- len -= 3;
- } while (len > 2);
- if (len) {
- output[_out++] = output[from++];
- if (len > 1) {
- output[_out++] = output[from++];
- }
- }
- }
- }
- else if ((op & 64) === 0) { /* 2nd level distance code */
- here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
- continue dodist;
- }
- else {
- strm.msg = 'invalid distance code';
- state.mode = BAD;
- break top;
- }
-
- break; // need to emulate goto via "continue"
- }
- }
- else if ((op & 64) === 0) { /* 2nd level length code */
- here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
- continue dolen;
- }
- else if (op & 32) { /* end-of-block */
- //Tracevv((stderr, "inflate: end of block\n"));
- state.mode = TYPE;
- break top;
- }
- else {
- strm.msg = 'invalid literal/length code';
- state.mode = BAD;
- break top;
- }
-
- break; // need to emulate goto via "continue"
- }
- } while (_in < last && _out < end);
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- len = bits >> 3;
- _in -= len;
- bits -= len << 3;
- hold &= (1 << bits) - 1;
-
- /* update state and return */
- strm.next_in = _in;
- strm.next_out = _out;
- strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
- strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
- state.hold = hold;
- state.bits = bits;
- return;
-};
-
-},{}],35:[function(_dereq_,module,exports){
-'use strict';
-
-
-var utils = _dereq_('../utils/common');
-var adler32 = _dereq_('./adler32');
-var crc32 = _dereq_('./crc32');
-var inflate_fast = _dereq_('./inffast');
-var inflate_table = _dereq_('./inftrees');
-
-var CODES = 0;
-var LENS = 1;
-var DISTS = 2;
-
-/* Public constants ==========================================================*/
-/* ===========================================================================*/
-
-
-/* Allowed flush values; see deflate() and inflate() below for details */
-//var Z_NO_FLUSH = 0;
-//var Z_PARTIAL_FLUSH = 1;
-//var Z_SYNC_FLUSH = 2;
-//var Z_FULL_FLUSH = 3;
-var Z_FINISH = 4;
-var Z_BLOCK = 5;
-var Z_TREES = 6;
-
-
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-var Z_OK = 0;
-var Z_STREAM_END = 1;
-var Z_NEED_DICT = 2;
-//var Z_ERRNO = -1;
-var Z_STREAM_ERROR = -2;
-var Z_DATA_ERROR = -3;
-var Z_MEM_ERROR = -4;
-var Z_BUF_ERROR = -5;
-//var Z_VERSION_ERROR = -6;
-
-/* The deflate compression method */
-var Z_DEFLATED = 8;
-
-
-/* STATES ====================================================================*/
-/* ===========================================================================*/
-
-
-var HEAD = 1; /* i: waiting for magic header */
-var FLAGS = 2; /* i: waiting for method and flags (gzip) */
-var TIME = 3; /* i: waiting for modification time (gzip) */
-var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
-var EXLEN = 5; /* i: waiting for extra length (gzip) */
-var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
-var NAME = 7; /* i: waiting for end of file name (gzip) */
-var COMMENT = 8; /* i: waiting for end of comment (gzip) */
-var HCRC = 9; /* i: waiting for header crc (gzip) */
-var DICTID = 10; /* i: waiting for dictionary check value */
-var DICT = 11; /* waiting for inflateSetDictionary() call */
-var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
-var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
-var STORED = 14; /* i: waiting for stored size (length and complement) */
-var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
-var COPY = 16; /* i/o: waiting for input or output to copy stored block */
-var TABLE = 17; /* i: waiting for dynamic block table lengths */
-var LENLENS = 18; /* i: waiting for code length code lengths */
-var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
-var LEN_ = 20; /* i: same as LEN below, but only first time in */
-var LEN = 21; /* i: waiting for length/lit/eob code */
-var LENEXT = 22; /* i: waiting for length extra bits */
-var DIST = 23; /* i: waiting for distance code */
-var DISTEXT = 24; /* i: waiting for distance extra bits */
-var MATCH = 25; /* o: waiting for output space to copy string */
-var LIT = 26; /* o: waiting for output space to write literal */
-var CHECK = 27; /* i: waiting for 32-bit check value */
-var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
-var DONE = 29; /* finished check, done -- remain here until reset */
-var BAD = 30; /* got a data error -- remain here until reset */
-var MEM = 31; /* got an inflate() memory error -- remain here until reset */
-var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
-
-/* ===========================================================================*/
-
-
-
-var ENOUGH_LENS = 852;
-var ENOUGH_DISTS = 592;
-//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
-
-var MAX_WBITS = 15;
-/* 32K LZ77 window */
-var DEF_WBITS = MAX_WBITS;
-
-
-function ZSWAP32(q) {
- return (((q >>> 24) & 0xff) +
- ((q >>> 8) & 0xff00) +
- ((q & 0xff00) << 8) +
- ((q & 0xff) << 24));
-}
-
-
-function InflateState() {
- this.mode = 0; /* current inflate mode */
- this.last = false; /* true if processing last block */
- this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
- this.havedict = false; /* true if dictionary provided */
- this.flags = 0; /* gzip header method and flags (0 if zlib) */
- this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
- this.check = 0; /* protected copy of check value */
- this.total = 0; /* protected copy of output count */
- // TODO: may be {}
- this.head = null; /* where to save gzip header information */
-
- /* sliding window */
- this.wbits = 0; /* log base 2 of requested window size */
- this.wsize = 0; /* window size or zero if not using window */
- this.whave = 0; /* valid bytes in the window */
- this.wnext = 0; /* window write index */
- this.window = null; /* allocated sliding window, if needed */
-
- /* bit accumulator */
- this.hold = 0; /* input bit accumulator */
- this.bits = 0; /* number of bits in "in" */
-
- /* for string and stored block copying */
- this.length = 0; /* literal or length of data to copy */
- this.offset = 0; /* distance back to copy string from */
-
- /* for table and code decoding */
- this.extra = 0; /* extra bits needed */
-
- /* fixed and dynamic code tables */
- this.lencode = null; /* starting table for length/literal codes */
- this.distcode = null; /* starting table for distance codes */
- this.lenbits = 0; /* index bits for lencode */
- this.distbits = 0; /* index bits for distcode */
-
- /* dynamic table building */
- this.ncode = 0; /* number of code length code lengths */
- this.nlen = 0; /* number of length code lengths */
- this.ndist = 0; /* number of distance code lengths */
- this.have = 0; /* number of code lengths in lens[] */
- this.next = null; /* next available space in codes[] */
-
- this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
- this.work = new utils.Buf16(288); /* work area for code table building */
-
- /*
- because we don't have pointers in js, we use lencode and distcode directly
- as buffers so we don't need codes
- */
- //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
- this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
- this.distdyn = null; /* dynamic table for distance codes (JS specific) */
- this.sane = 0; /* if false, allow invalid distance too far */
- this.back = 0; /* bits back of last unprocessed length/lit */
- this.was = 0; /* initial length of match */
-}
-
-function inflateResetKeep(strm) {
- var state;
-
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- strm.total_in = strm.total_out = state.total = 0;
- strm.msg = ''; /*Z_NULL*/
- if (state.wrap) { /* to support ill-conceived Java test suite */
- strm.adler = state.wrap & 1;
- }
- state.mode = HEAD;
- state.last = 0;
- state.havedict = 0;
- state.dmax = 32768;
- state.head = null/*Z_NULL*/;
- state.hold = 0;
- state.bits = 0;
- //state.lencode = state.distcode = state.next = state.codes;
- state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
- state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
-
- state.sane = 1;
- state.back = -1;
- //Tracev((stderr, "inflate: reset\n"));
- return Z_OK;
-}
-
-function inflateReset(strm) {
- var state;
-
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- state.wsize = 0;
- state.whave = 0;
- state.wnext = 0;
- return inflateResetKeep(strm);
-
-}
-
-function inflateReset2(strm, windowBits) {
- var wrap;
- var state;
-
- /* get the state */
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
-
- /* extract wrap request from windowBits parameter */
- if (windowBits < 0) {
- wrap = 0;
- windowBits = -windowBits;
- }
- else {
- wrap = (windowBits >> 4) + 1;
- if (windowBits < 48) {
- windowBits &= 15;
- }
- }
-
- /* set number of window bits, free window if different */
- if (windowBits && (windowBits < 8 || windowBits > 15)) {
- return Z_STREAM_ERROR;
- }
- if (state.window !== null && state.wbits !== windowBits) {
- state.window = null;
- }
-
- /* update state and reset the rest of it */
- state.wrap = wrap;
- state.wbits = windowBits;
- return inflateReset(strm);
-}
-
-function inflateInit2(strm, windowBits) {
- var ret;
- var state;
-
- if (!strm) { return Z_STREAM_ERROR; }
- //strm.msg = Z_NULL; /* in case we return an error */
-
- state = new InflateState();
-
- //if (state === Z_NULL) return Z_MEM_ERROR;
- //Tracev((stderr, "inflate: allocated\n"));
- strm.state = state;
- state.window = null/*Z_NULL*/;
- ret = inflateReset2(strm, windowBits);
- if (ret !== Z_OK) {
- strm.state = null/*Z_NULL*/;
- }
- return ret;
-}
-
-function inflateInit(strm) {
- return inflateInit2(strm, DEF_WBITS);
-}
-
-
-/*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
- If BUILDFIXED is defined, then instead this routine builds the tables the
- first time it's called, and returns those tables the first time and
- thereafter. This reduces the size of the code by about 2K bytes, in
- exchange for a little execution time. However, BUILDFIXED should not be
- used for threaded applications, since the rewriting of the tables and virgin
- may not be thread-safe.
- */
-var virgin = true;
-
-var lenfix, distfix; // We have no pointers in JS, so keep tables separate
-
-function fixedtables(state) {
- /* build fixed huffman tables if first call (may not be thread safe) */
- if (virgin) {
- var sym;
-
- lenfix = new utils.Buf32(512);
- distfix = new utils.Buf32(32);
-
- /* literal/length table */
- sym = 0;
- while (sym < 144) { state.lens[sym++] = 8; }
- while (sym < 256) { state.lens[sym++] = 9; }
- while (sym < 280) { state.lens[sym++] = 7; }
- while (sym < 288) { state.lens[sym++] = 8; }
-
- inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9});
-
- /* distance table */
- sym = 0;
- while (sym < 32) { state.lens[sym++] = 5; }
-
- inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5});
-
- /* do this just once */
- virgin = false;
- }
-
- state.lencode = lenfix;
- state.lenbits = 9;
- state.distcode = distfix;
- state.distbits = 5;
-}
-
-
-/*
- Update the window with the last wsize (normally 32K) bytes written before
- returning. If window does not exist yet, create it. This is only called
- when a window is already in use, or when output has been written during this
- inflate call, but the end of the deflate stream has not been reached yet.
- It is also called to create a window for dictionary data when a dictionary
- is loaded.
-
- Providing output buffers larger than 32K to inflate() should provide a speed
- advantage, since only the last 32K of output is copied to the sliding window
- upon return from inflate(), and since all distances after the first 32K of
- output will fall in the output data, making match copies simpler and faster.
- The advantage may be dependent on the size of the processor's data caches.
- */
-function updatewindow(strm, src, end, copy) {
- var dist;
- var state = strm.state;
-
- /* if it hasn't been done already, allocate space for the window */
- if (state.window === null) {
- state.wsize = 1 << state.wbits;
- state.wnext = 0;
- state.whave = 0;
-
- state.window = new utils.Buf8(state.wsize);
- }
-
- /* copy state->wsize or less output bytes into the circular window */
- if (copy >= state.wsize) {
- utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);
- state.wnext = 0;
- state.whave = state.wsize;
- }
- else {
- dist = state.wsize - state.wnext;
- if (dist > copy) {
- dist = copy;
- }
- //zmemcpy(state->window + state->wnext, end - copy, dist);
- utils.arraySet(state.window,src, end - copy, dist, state.wnext);
- copy -= dist;
- if (copy) {
- //zmemcpy(state->window, end - copy, copy);
- utils.arraySet(state.window,src, end - copy, copy, 0);
- state.wnext = copy;
- state.whave = state.wsize;
- }
- else {
- state.wnext += dist;
- if (state.wnext === state.wsize) { state.wnext = 0; }
- if (state.whave < state.wsize) { state.whave += dist; }
- }
- }
- return 0;
-}
-
-function inflate(strm, flush) {
- var state;
- var input, output; // input/output buffers
- var next; /* next input INDEX */
- var put; /* next output INDEX */
- var have, left; /* available input and output */
- var hold; /* bit buffer */
- var bits; /* bits in bit buffer */
- var _in, _out; /* save starting available input and output */
- var copy; /* number of stored or match bytes to copy */
- var from; /* where to copy match bytes from */
- var from_source;
- var here = 0; /* current decoding table entry */
- var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
- //var last; /* parent table entry */
- var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
- var len; /* length to copy for repeats, bits to drop */
- var ret; /* return code */
- var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
- var opts;
-
- var n; // temporary var for NEED_BITS
-
- var order = /* permutation of code lengths */
- [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
-
-
- if (!strm || !strm.state || !strm.output ||
- (!strm.input && strm.avail_in !== 0)) {
- return Z_STREAM_ERROR;
- }
-
- state = strm.state;
- if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
-
-
- //--- LOAD() ---
- put = strm.next_out;
- output = strm.output;
- left = strm.avail_out;
- next = strm.next_in;
- input = strm.input;
- have = strm.avail_in;
- hold = state.hold;
- bits = state.bits;
- //---
-
- _in = have;
- _out = left;
- ret = Z_OK;
-
- inf_leave: // goto emulation
- for (;;) {
- switch (state.mode) {
- case HEAD:
- if (state.wrap === 0) {
- state.mode = TYPEDO;
- break;
- }
- //=== NEEDBITS(16);
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
- state.check = 0/*crc32(0L, Z_NULL, 0)*/;
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
-
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = FLAGS;
- break;
- }
- state.flags = 0; /* expect zlib header */
- if (state.head) {
- state.head.done = false;
- }
- if (!(state.wrap & 1) || /* check if zlib header allowed */
- (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
- strm.msg = 'incorrect header check';
- state.mode = BAD;
- break;
- }
- if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
- strm.msg = 'unknown compression method';
- state.mode = BAD;
- break;
- }
- //--- DROPBITS(4) ---//
- hold >>>= 4;
- bits -= 4;
- //---//
- len = (hold & 0x0f)/*BITS(4)*/ + 8;
- if (state.wbits === 0) {
- state.wbits = len;
- }
- else if (len > state.wbits) {
- strm.msg = 'invalid window size';
- state.mode = BAD;
- break;
- }
- state.dmax = 1 << len;
- //Tracev((stderr, "inflate: zlib header ok\n"));
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
- state.mode = hold & 0x200 ? DICTID : TYPE;
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- break;
- case FLAGS:
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.flags = hold;
- if ((state.flags & 0xff) !== Z_DEFLATED) {
- strm.msg = 'unknown compression method';
- state.mode = BAD;
- break;
- }
- if (state.flags & 0xe000) {
- strm.msg = 'unknown header flags set';
- state.mode = BAD;
- break;
- }
- if (state.head) {
- state.head.text = ((hold >> 8) & 1);
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = TIME;
- /* falls through */
- case TIME:
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (state.head) {
- state.head.time = hold;
- }
- if (state.flags & 0x0200) {
- //=== CRC4(state.check, hold)
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- hbuf[2] = (hold >>> 16) & 0xff;
- hbuf[3] = (hold >>> 24) & 0xff;
- state.check = crc32(state.check, hbuf, 4, 0);
- //===
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = OS;
- /* falls through */
- case OS:
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (state.head) {
- state.head.xflags = (hold & 0xff);
- state.head.os = (hold >> 8);
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = EXLEN;
- /* falls through */
- case EXLEN:
- if (state.flags & 0x0400) {
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.length = hold;
- if (state.head) {
- state.head.extra_len = hold;
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- }
- else if (state.head) {
- state.head.extra = null/*Z_NULL*/;
- }
- state.mode = EXTRA;
- /* falls through */
- case EXTRA:
- if (state.flags & 0x0400) {
- copy = state.length;
- if (copy > have) { copy = have; }
- if (copy) {
- if (state.head) {
- len = state.head.extra_len - state.length;
- if (!state.head.extra) {
- // Use untyped array for more conveniend processing later
- state.head.extra = new Array(state.head.extra_len);
- }
- utils.arraySet(
- state.head.extra,
- input,
- next,
- // extra field is limited to 65536 bytes
- // - no need for additional size check
- copy,
- /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
- len
- );
- //zmemcpy(state.head.extra + len, next,
- // len + copy > state.head.extra_max ?
- // state.head.extra_max - len : copy);
- }
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- state.length -= copy;
- }
- if (state.length) { break inf_leave; }
- }
- state.length = 0;
- state.mode = NAME;
- /* falls through */
- case NAME:
- if (state.flags & 0x0800) {
- if (have === 0) { break inf_leave; }
- copy = 0;
- do {
- // TODO: 2 or 1 bytes?
- len = input[next + copy++];
- /* use constant limit because in js we should not preallocate memory */
- if (state.head && len &&
- (state.length < 65536 /*state.head.name_max*/)) {
- state.head.name += String.fromCharCode(len);
- }
- } while (len && copy < have);
-
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- if (len) { break inf_leave; }
- }
- else if (state.head) {
- state.head.name = null;
- }
- state.length = 0;
- state.mode = COMMENT;
- /* falls through */
- case COMMENT:
- if (state.flags & 0x1000) {
- if (have === 0) { break inf_leave; }
- copy = 0;
- do {
- len = input[next + copy++];
- /* use constant limit because in js we should not preallocate memory */
- if (state.head && len &&
- (state.length < 65536 /*state.head.comm_max*/)) {
- state.head.comment += String.fromCharCode(len);
- }
- } while (len && copy < have);
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- if (len) { break inf_leave; }
- }
- else if (state.head) {
- state.head.comment = null;
- }
- state.mode = HCRC;
- /* falls through */
- case HCRC:
- if (state.flags & 0x0200) {
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (hold !== (state.check & 0xffff)) {
- strm.msg = 'header crc mismatch';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- }
- if (state.head) {
- state.head.hcrc = ((state.flags >> 9) & 1);
- state.head.done = true;
- }
- strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/;
- state.mode = TYPE;
- break;
- case DICTID:
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- strm.adler = state.check = ZSWAP32(hold);
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = DICT;
- /* falls through */
- case DICT:
- if (state.havedict === 0) {
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
- return Z_NEED_DICT;
- }
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
- state.mode = TYPE;
- /* falls through */
- case TYPE:
- if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case TYPEDO:
- if (state.last) {
- //--- BYTEBITS() ---//
- hold >>>= bits & 7;
- bits -= bits & 7;
- //---//
- state.mode = CHECK;
- break;
- }
- //=== NEEDBITS(3); */
- while (bits < 3) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.last = (hold & 0x01)/*BITS(1)*/;
- //--- DROPBITS(1) ---//
- hold >>>= 1;
- bits -= 1;
- //---//
-
- switch ((hold & 0x03)/*BITS(2)*/) {
- case 0: /* stored block */
- //Tracev((stderr, "inflate: stored block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = STORED;
- break;
- case 1: /* fixed block */
- fixedtables(state);
- //Tracev((stderr, "inflate: fixed codes block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = LEN_; /* decode codes */
- if (flush === Z_TREES) {
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- break inf_leave;
- }
- break;
- case 2: /* dynamic block */
- //Tracev((stderr, "inflate: dynamic codes block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = TABLE;
- break;
- case 3:
- strm.msg = 'invalid block type';
- state.mode = BAD;
- }
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- break;
- case STORED:
- //--- BYTEBITS() ---// /* go to byte boundary */
- hold >>>= bits & 7;
- bits -= bits & 7;
- //---//
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
- strm.msg = 'invalid stored block lengths';
- state.mode = BAD;
- break;
- }
- state.length = hold & 0xffff;
- //Tracev((stderr, "inflate: stored length %u\n",
- // state.length));
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = COPY_;
- if (flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case COPY_:
- state.mode = COPY;
- /* falls through */
- case COPY:
- copy = state.length;
- if (copy) {
- if (copy > have) { copy = have; }
- if (copy > left) { copy = left; }
- if (copy === 0) { break inf_leave; }
- //--- zmemcpy(put, next, copy); ---
- utils.arraySet(output, input, next, copy, put);
- //---//
- have -= copy;
- next += copy;
- left -= copy;
- put += copy;
- state.length -= copy;
- break;
- }
- //Tracev((stderr, "inflate: stored end\n"));
- state.mode = TYPE;
- break;
- case TABLE:
- //=== NEEDBITS(14); */
- while (bits < 14) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
- //--- DROPBITS(5) ---//
- hold >>>= 5;
- bits -= 5;
- //---//
- state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
- //--- DROPBITS(5) ---//
- hold >>>= 5;
- bits -= 5;
- //---//
- state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
- //--- DROPBITS(4) ---//
- hold >>>= 4;
- bits -= 4;
- //---//
-//#ifndef PKZIP_BUG_WORKAROUND
- if (state.nlen > 286 || state.ndist > 30) {
- strm.msg = 'too many length or distance symbols';
- state.mode = BAD;
- break;
- }
-//#endif
- //Tracev((stderr, "inflate: table sizes ok\n"));
- state.have = 0;
- state.mode = LENLENS;
- /* falls through */
- case LENLENS:
- while (state.have < state.ncode) {
- //=== NEEDBITS(3);
- while (bits < 3) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
- //--- DROPBITS(3) ---//
- hold >>>= 3;
- bits -= 3;
- //---//
- }
- while (state.have < 19) {
- state.lens[order[state.have++]] = 0;
- }
- // We have separate tables & no pointers. 2 commented lines below not needed.
- //state.next = state.codes;
- //state.lencode = state.next;
- // Switch to use dynamic table
- state.lencode = state.lendyn;
- state.lenbits = 7;
-
- opts = {bits: state.lenbits};
- ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
- state.lenbits = opts.bits;
-
- if (ret) {
- strm.msg = 'invalid code lengths set';
- state.mode = BAD;
- break;
- }
- //Tracev((stderr, "inflate: code lengths ok\n"));
- state.have = 0;
- state.mode = CODELENS;
- /* falls through */
- case CODELENS:
- while (state.have < state.nlen + state.ndist) {
- for (;;) {
- here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if (here_val < 16) {
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.lens[state.have++] = here_val;
- }
- else {
- if (here_val === 16) {
- //=== NEEDBITS(here.bits + 2);
- n = here_bits + 2;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- if (state.have === 0) {
- strm.msg = 'invalid bit length repeat';
- state.mode = BAD;
- break;
- }
- len = state.lens[state.have - 1];
- copy = 3 + (hold & 0x03);//BITS(2);
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- }
- else if (here_val === 17) {
- //=== NEEDBITS(here.bits + 3);
- n = here_bits + 3;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- len = 0;
- copy = 3 + (hold & 0x07);//BITS(3);
- //--- DROPBITS(3) ---//
- hold >>>= 3;
- bits -= 3;
- //---//
- }
- else {
- //=== NEEDBITS(here.bits + 7);
- n = here_bits + 7;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- len = 0;
- copy = 11 + (hold & 0x7f);//BITS(7);
- //--- DROPBITS(7) ---//
- hold >>>= 7;
- bits -= 7;
- //---//
- }
- if (state.have + copy > state.nlen + state.ndist) {
- strm.msg = 'invalid bit length repeat';
- state.mode = BAD;
- break;
- }
- while (copy--) {
- state.lens[state.have++] = len;
- }
- }
- }
-
- /* handle error breaks in while */
- if (state.mode === BAD) { break; }
-
- /* check for end-of-block code (better have one) */
- if (state.lens[256] === 0) {
- strm.msg = 'invalid code -- missing end-of-block';
- state.mode = BAD;
- break;
- }
-
- /* build code tables -- note: do not change the lenbits or distbits
- values here (9 and 6) without reading the comments in inftrees.h
- concerning the ENOUGH constants, which depend on those values */
- state.lenbits = 9;
-
- opts = {bits: state.lenbits};
- ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
- // We have separate tables & no pointers. 2 commented lines below not needed.
- // state.next_index = opts.table_index;
- state.lenbits = opts.bits;
- // state.lencode = state.next;
-
- if (ret) {
- strm.msg = 'invalid literal/lengths set';
- state.mode = BAD;
- break;
- }
-
- state.distbits = 6;
- //state.distcode.copy(state.codes);
- // Switch to use dynamic table
- state.distcode = state.distdyn;
- opts = {bits: state.distbits};
- ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
- // We have separate tables & no pointers. 2 commented lines below not needed.
- // state.next_index = opts.table_index;
- state.distbits = opts.bits;
- // state.distcode = state.next;
-
- if (ret) {
- strm.msg = 'invalid distances set';
- state.mode = BAD;
- break;
- }
- //Tracev((stderr, 'inflate: codes ok\n'));
- state.mode = LEN_;
- if (flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case LEN_:
- state.mode = LEN;
- /* falls through */
- case LEN:
- if (have >= 6 && left >= 258) {
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
- inflate_fast(strm, _out);
- //--- LOAD() ---
- put = strm.next_out;
- output = strm.output;
- left = strm.avail_out;
- next = strm.next_in;
- input = strm.input;
- have = strm.avail_in;
- hold = state.hold;
- bits = state.bits;
- //---
-
- if (state.mode === TYPE) {
- state.back = -1;
- }
- break;
- }
- state.back = 0;
- for (;;) {
- here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if (here_bits <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if (here_op && (here_op & 0xf0) === 0) {
- last_bits = here_bits;
- last_op = here_op;
- last_val = here_val;
- for (;;) {
- here = state.lencode[last_val +
- ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((last_bits + here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- //--- DROPBITS(last.bits) ---//
- hold >>>= last_bits;
- bits -= last_bits;
- //---//
- state.back += last_bits;
- }
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.back += here_bits;
- state.length = here_val;
- if (here_op === 0) {
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- // "inflate: literal '%c'\n" :
- // "inflate: literal 0x%02x\n", here.val));
- state.mode = LIT;
- break;
- }
- if (here_op & 32) {
- //Tracevv((stderr, "inflate: end of block\n"));
- state.back = -1;
- state.mode = TYPE;
- break;
- }
- if (here_op & 64) {
- strm.msg = 'invalid literal/length code';
- state.mode = BAD;
- break;
- }
- state.extra = here_op & 15;
- state.mode = LENEXT;
- /* falls through */
- case LENEXT:
- if (state.extra) {
- //=== NEEDBITS(state.extra);
- n = state.extra;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
- //--- DROPBITS(state.extra) ---//
- hold >>>= state.extra;
- bits -= state.extra;
- //---//
- state.back += state.extra;
- }
- //Tracevv((stderr, "inflate: length %u\n", state.length));
- state.was = state.length;
- state.mode = DIST;
- /* falls through */
- case DIST:
- for (;;) {
- here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if ((here_op & 0xf0) === 0) {
- last_bits = here_bits;
- last_op = here_op;
- last_val = here_val;
- for (;;) {
- here = state.distcode[last_val +
- ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((last_bits + here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- //--- DROPBITS(last.bits) ---//
- hold >>>= last_bits;
- bits -= last_bits;
- //---//
- state.back += last_bits;
- }
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.back += here_bits;
- if (here_op & 64) {
- strm.msg = 'invalid distance code';
- state.mode = BAD;
- break;
- }
- state.offset = here_val;
- state.extra = (here_op) & 15;
- state.mode = DISTEXT;
- /* falls through */
- case DISTEXT:
- if (state.extra) {
- //=== NEEDBITS(state.extra);
- n = state.extra;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
- //--- DROPBITS(state.extra) ---//
- hold >>>= state.extra;
- bits -= state.extra;
- //---//
- state.back += state.extra;
- }
-//#ifdef INFLATE_STRICT
- if (state.offset > state.dmax) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break;
- }
-//#endif
- //Tracevv((stderr, "inflate: distance %u\n", state.offset));
- state.mode = MATCH;
- /* falls through */
- case MATCH:
- if (left === 0) { break inf_leave; }
- copy = _out - left;
- if (state.offset > copy) { /* copy from window */
- copy = state.offset - copy;
- if (copy > state.whave) {
- if (state.sane) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break;
- }
-// (!) This block is disabled in zlib defailts,
-// don't enable it for binary compatibility
-//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
-// Trace((stderr, "inflate.c too far\n"));
-// copy -= state.whave;
-// if (copy > state.length) { copy = state.length; }
-// if (copy > left) { copy = left; }
-// left -= copy;
-// state.length -= copy;
-// do {
-// output[put++] = 0;
-// } while (--copy);
-// if (state.length === 0) { state.mode = LEN; }
-// break;
-//#endif
- }
- if (copy > state.wnext) {
- copy -= state.wnext;
- from = state.wsize - copy;
- }
- else {
- from = state.wnext - copy;
- }
- if (copy > state.length) { copy = state.length; }
- from_source = state.window;
- }
- else { /* copy from output */
- from_source = output;
- from = put - state.offset;
- copy = state.length;
- }
- if (copy > left) { copy = left; }
- left -= copy;
- state.length -= copy;
- do {
- output[put++] = from_source[from++];
- } while (--copy);
- if (state.length === 0) { state.mode = LEN; }
- break;
- case LIT:
- if (left === 0) { break inf_leave; }
- output[put++] = state.length;
- left--;
- state.mode = LEN;
- break;
- case CHECK:
- if (state.wrap) {
- //=== NEEDBITS(32);
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- // Use '|' insdead of '+' to make sure that result is signed
- hold |= input[next++] << bits;
- bits += 8;
- }
- //===//
- _out -= left;
- strm.total_out += _out;
- state.total += _out;
- if (_out) {
- strm.adler = state.check =
- /*UPDATE(state.check, put - _out, _out);*/
- (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
-
- }
- _out = left;
- // NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too
- if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) {
- strm.msg = 'incorrect data check';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- //Tracev((stderr, "inflate: check matches trailer\n"));
- }
- state.mode = LENGTH;
- /* falls through */
- case LENGTH:
- if (state.wrap && state.flags) {
- //=== NEEDBITS(32);
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (hold !== (state.total & 0xffffffff)) {
- strm.msg = 'incorrect length check';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- //Tracev((stderr, "inflate: length matches trailer\n"));
- }
- state.mode = DONE;
- /* falls through */
- case DONE:
- ret = Z_STREAM_END;
- break inf_leave;
- case BAD:
- ret = Z_DATA_ERROR;
- break inf_leave;
- case MEM:
- return Z_MEM_ERROR;
- case SYNC:
- /* falls through */
- default:
- return Z_STREAM_ERROR;
- }
- }
-
- // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
-
- /*
- Return from inflate(), updating the total counts and the check value.
- If there was no progress during the inflate() call, return a buffer
- error. Call updatewindow() to create and/or update the window state.
- Note: a memory error from inflate() is non-recoverable.
- */
-
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
-
- if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
- (state.mode < CHECK || flush !== Z_FINISH))) {
- if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
- state.mode = MEM;
- return Z_MEM_ERROR;
- }
- }
- _in -= strm.avail_in;
- _out -= strm.avail_out;
- strm.total_in += _in;
- strm.total_out += _out;
- state.total += _out;
- if (state.wrap && _out) {
- strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
- (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
- }
- strm.data_type = state.bits + (state.last ? 64 : 0) +
- (state.mode === TYPE ? 128 : 0) +
- (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
- if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
- ret = Z_BUF_ERROR;
- }
- return ret;
-}
-
-function inflateEnd(strm) {
-
- if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
- return Z_STREAM_ERROR;
- }
-
- var state = strm.state;
- if (state.window) {
- state.window = null;
- }
- strm.state = null;
- return Z_OK;
-}
-
-function inflateGetHeader(strm, head) {
- var state;
-
- /* check state */
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
-
- /* save header structure */
- state.head = head;
- head.done = false;
- return Z_OK;
-}
-
-
-exports.inflateReset = inflateReset;
-exports.inflateReset2 = inflateReset2;
-exports.inflateResetKeep = inflateResetKeep;
-exports.inflateInit = inflateInit;
-exports.inflateInit2 = inflateInit2;
-exports.inflate = inflate;
-exports.inflateEnd = inflateEnd;
-exports.inflateGetHeader = inflateGetHeader;
-exports.inflateInfo = 'pako inflate (from Nodeca project)';
-
-/* Not implemented
-exports.inflateCopy = inflateCopy;
-exports.inflateGetDictionary = inflateGetDictionary;
-exports.inflateMark = inflateMark;
-exports.inflatePrime = inflatePrime;
-exports.inflateSetDictionary = inflateSetDictionary;
-exports.inflateSync = inflateSync;
-exports.inflateSyncPoint = inflateSyncPoint;
-exports.inflateUndermine = inflateUndermine;
-*/
-},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(_dereq_,module,exports){
-'use strict';
-
-
-var utils = _dereq_('../utils/common');
-
-var MAXBITS = 15;
-var ENOUGH_LENS = 852;
-var ENOUGH_DISTS = 592;
-//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
-
-var CODES = 0;
-var LENS = 1;
-var DISTS = 2;
-
-var lbase = [ /* Length codes 257..285 base */
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
-];
-
-var lext = [ /* Length codes 257..285 extra */
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
-];
-
-var dbase = [ /* Distance codes 0..29 base */
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577, 0, 0
-];
-
-var dext = [ /* Distance codes 0..29 extra */
- 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
- 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
- 28, 28, 29, 29, 64, 64
-];
-
-module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
-{
- var bits = opts.bits;
- //here = opts.here; /* table entry for duplication */
-
- var len = 0; /* a code's length in bits */
- var sym = 0; /* index of code symbols */
- var min = 0, max = 0; /* minimum and maximum code lengths */
- var root = 0; /* number of index bits for root table */
- var curr = 0; /* number of index bits for current table */
- var drop = 0; /* code bits to drop for sub-table */
- var left = 0; /* number of prefix codes available */
- var used = 0; /* code entries in table used */
- var huff = 0; /* Huffman code */
- var incr; /* for incrementing code, index */
- var fill; /* index for replicating entries */
- var low; /* low bits for current root entry */
- var mask; /* mask for low root bits */
- var next; /* next available space in table */
- var base = null; /* base value table to use */
- var base_index = 0;
-// var shoextra; /* extra bits table to use */
- var end; /* use base and extra for symbol > end */
- var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */
- var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */
- var extra = null;
- var extra_index = 0;
-
- var here_bits, here_op, here_val;
-
- /*
- Process a set of code lengths to create a canonical Huffman code. The
- code lengths are lens[0..codes-1]. Each length corresponds to the
- symbols 0..codes-1. The Huffman code is generated by first sorting the
- symbols by length from short to long, and retaining the symbol order
- for codes with equal lengths. Then the code starts with all zero bits
- for the first code of the shortest length, and the codes are integer
- increments for the same length, and zeros are appended as the length
- increases. For the deflate format, these bits are stored backwards
- from their more natural integer increment ordering, and so when the
- decoding tables are built in the large loop below, the integer codes
- are incremented backwards.
-
- This routine assumes, but does not check, that all of the entries in
- lens[] are in the range 0..MAXBITS. The caller must assure this.
- 1..MAXBITS is interpreted as that code length. zero means that that
- symbol does not occur in this code.
-
- The codes are sorted by computing a count of codes for each length,
- creating from that a table of starting indices for each length in the
- sorted table, and then entering the symbols in order in the sorted
- table. The sorted table is work[], with that space being provided by
- the caller.
-
- The length counts are used for other purposes as well, i.e. finding
- the minimum and maximum length codes, determining if there are any
- codes at all, checking for a valid set of lengths, and looking ahead
- at length counts to determine sub-table sizes when building the
- decoding tables.
- */
-
- /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
- for (len = 0; len <= MAXBITS; len++) {
- count[len] = 0;
- }
- for (sym = 0; sym < codes; sym++) {
- count[lens[lens_index + sym]]++;
- }
-
- /* bound code lengths, force root to be within code lengths */
- root = bits;
- for (max = MAXBITS; max >= 1; max--) {
- if (count[max] !== 0) { break; }
- }
- if (root > max) {
- root = max;
- }
- if (max === 0) { /* no symbols to code at all */
- //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
- //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
- //table.val[opts.table_index++] = 0; //here.val = (var short)0;
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
-
-
- //table.op[opts.table_index] = 64;
- //table.bits[opts.table_index] = 1;
- //table.val[opts.table_index++] = 0;
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
-
- opts.bits = 1;
- return 0; /* no symbols, but wait for decoding to report error */
- }
- for (min = 1; min < max; min++) {
- if (count[min] !== 0) { break; }
- }
- if (root < min) {
- root = min;
- }
-
- /* check for an over-subscribed or incomplete set of lengths */
- left = 1;
- for (len = 1; len <= MAXBITS; len++) {
- left <<= 1;
- left -= count[len];
- if (left < 0) {
- return -1;
- } /* over-subscribed */
- }
- if (left > 0 && (type === CODES || max !== 1)) {
- return -1; /* incomplete set */
- }
-
- /* generate offsets into symbol table for each length for sorting */
- offs[1] = 0;
- for (len = 1; len < MAXBITS; len++) {
- offs[len + 1] = offs[len] + count[len];
- }
-
- /* sort symbols by length, by symbol order within each length */
- for (sym = 0; sym < codes; sym++) {
- if (lens[lens_index + sym] !== 0) {
- work[offs[lens[lens_index + sym]]++] = sym;
- }
- }
-
- /*
- Create and fill in decoding tables. In this loop, the table being
- filled is at next and has curr index bits. The code being used is huff
- with length len. That code is converted to an index by dropping drop
- bits off of the bottom. For codes where len is less than drop + curr,
- those top drop + curr - len bits are incremented through all values to
- fill the table with replicated entries.
-
- root is the number of index bits for the root table. When len exceeds
- root, sub-tables are created pointed to by the root entry with an index
- of the low root bits of huff. This is saved in low to check for when a
- new sub-table should be started. drop is zero when the root table is
- being filled, and drop is root when sub-tables are being filled.
-
- When a new sub-table is needed, it is necessary to look ahead in the
- code lengths to determine what size sub-table is needed. The length
- counts are used for this, and so count[] is decremented as codes are
- entered in the tables.
-
- used keeps track of how many table entries have been allocated from the
- provided *table space. It is checked for LENS and DIST tables against
- the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
- the initial root table size constants. See the comments in inftrees.h
- for more information.
-
- sym increments through all symbols, and the loop terminates when
- all codes of length max, i.e. all codes, have been processed. This
- routine permits incomplete codes, so another loop after this one fills
- in the rest of the decoding tables with invalid code markers.
- */
-
- /* set up for code type */
- // poor man optimization - use if-else instead of switch,
- // to avoid deopts in old v8
- if (type === CODES) {
- base = extra = work; /* dummy value--not used */
- end = 19;
- } else if (type === LENS) {
- base = lbase;
- base_index -= 257;
- extra = lext;
- extra_index -= 257;
- end = 256;
- } else { /* DISTS */
- base = dbase;
- extra = dext;
- end = -1;
- }
-
- /* initialize opts for loop */
- huff = 0; /* starting code */
- sym = 0; /* starting code symbol */
- len = min; /* starting code length */
- next = table_index; /* current table to fill in */
- curr = root; /* current table index bits */
- drop = 0; /* current bits to drop from code for index */
- low = -1; /* trigger new sub-table when len > root */
- used = 1 << root; /* use root table entries */
- mask = used - 1; /* mask for comparing low */
-
- /* check available table space */
- if ((type === LENS && used > ENOUGH_LENS) ||
- (type === DISTS && used > ENOUGH_DISTS)) {
- return 1;
- }
-
- var i=0;
- /* process all codes and make table entries */
- for (;;) {
- i++;
- /* create table entry */
- here_bits = len - drop;
- if (work[sym] < end) {
- here_op = 0;
- here_val = work[sym];
- }
- else if (work[sym] > end) {
- here_op = extra[extra_index + work[sym]];
- here_val = base[base_index + work[sym]];
- }
- else {
- here_op = 32 + 64; /* end of block */
- here_val = 0;
- }
-
- /* replicate for those indices with low len bits equal to huff */
- incr = 1 << (len - drop);
- fill = 1 << curr;
- min = fill; /* save offset to next table */
- do {
- fill -= incr;
- table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
- } while (fill !== 0);
-
- /* backwards increment the len-bit code huff */
- incr = 1 << (len - 1);
- while (huff & incr) {
- incr >>= 1;
- }
- if (incr !== 0) {
- huff &= incr - 1;
- huff += incr;
- } else {
- huff = 0;
- }
-
- /* go to next symbol, update count, len */
- sym++;
- if (--count[len] === 0) {
- if (len === max) { break; }
- len = lens[lens_index + work[sym]];
- }
-
- /* create new sub-table if needed */
- if (len > root && (huff & mask) !== low) {
- /* if first time, transition to sub-tables */
- if (drop === 0) {
- drop = root;
- }
-
- /* increment past last table */
- next += min; /* here min is 1 << curr */
-
- /* determine length of next table */
- curr = len - drop;
- left = 1 << curr;
- while (curr + drop < max) {
- left -= count[curr + drop];
- if (left <= 0) { break; }
- curr++;
- left <<= 1;
- }
-
- /* check for enough space */
- used += 1 << curr;
- if ((type === LENS && used > ENOUGH_LENS) ||
- (type === DISTS && used > ENOUGH_DISTS)) {
- return 1;
- }
-
- /* point entry in root table to sub-table */
- low = huff & mask;
- /*table.op[low] = curr;
- table.bits[low] = root;
- table.val[low] = next - opts.table_index;*/
- table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
- }
- }
-
- /* fill in remaining table entry if code is incomplete (guaranteed to have
- at most one remaining entry, since if the code is incomplete, the
- maximum code length that was allowed to get this far is one bit) */
- if (huff !== 0) {
- //table.op[next + huff] = 64; /* invalid code marker */
- //table.bits[next + huff] = len - drop;
- //table.val[next + huff] = 0;
- table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
- }
-
- /* set return parameters */
- //opts.table_index += used;
- opts.bits = root;
- return 0;
-};
-
-},{"../utils/common":27}],37:[function(_dereq_,module,exports){
-'use strict';
-
-module.exports = {
- '2': 'need dictionary', /* Z_NEED_DICT 2 */
- '1': 'stream end', /* Z_STREAM_END 1 */
- '0': '', /* Z_OK 0 */
- '-1': 'file error', /* Z_ERRNO (-1) */
- '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
- '-3': 'data error', /* Z_DATA_ERROR (-3) */
- '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
- '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
- '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
-};
-},{}],38:[function(_dereq_,module,exports){
-'use strict';
-
-
-var utils = _dereq_('../utils/common');
-
-/* Public constants ==========================================================*/
-/* ===========================================================================*/
-
-
-//var Z_FILTERED = 1;
-//var Z_HUFFMAN_ONLY = 2;
-//var Z_RLE = 3;
-var Z_FIXED = 4;
-//var Z_DEFAULT_STRATEGY = 0;
-
-/* Possible values of the data_type field (though see inflate()) */
-var Z_BINARY = 0;
-var Z_TEXT = 1;
-//var Z_ASCII = 1; // = Z_TEXT
-var Z_UNKNOWN = 2;
-
-/*============================================================================*/
-
-
-function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
-
-// From zutil.h
-
-var STORED_BLOCK = 0;
-var STATIC_TREES = 1;
-var DYN_TREES = 2;
-/* The three kinds of block type */
-
-var MIN_MATCH = 3;
-var MAX_MATCH = 258;
-/* The minimum and maximum match lengths */
-
-// From deflate.h
-/* ===========================================================================
- * Internal compression state.
- */
-
-var LENGTH_CODES = 29;
-/* number of length codes, not counting the special END_BLOCK code */
-
-var LITERALS = 256;
-/* number of literal bytes 0..255 */
-
-var L_CODES = LITERALS + 1 + LENGTH_CODES;
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-var D_CODES = 30;
-/* number of distance codes */
-
-var BL_CODES = 19;
-/* number of codes used to transfer the bit lengths */
-
-var HEAP_SIZE = 2*L_CODES + 1;
-/* maximum heap size */
-
-var MAX_BITS = 15;
-/* All codes must not exceed MAX_BITS bits */
-
-var Buf_size = 16;
-/* size of bit buffer in bi_buf */
-
-
-/* ===========================================================================
- * Constants
- */
-
-var MAX_BL_BITS = 7;
-/* Bit length codes must not exceed MAX_BL_BITS bits */
-
-var END_BLOCK = 256;
-/* end of block literal code */
-
-var REP_3_6 = 16;
-/* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
-var REPZ_3_10 = 17;
-/* repeat a zero length 3-10 times (3 bits of repeat count) */
-
-var REPZ_11_138 = 18;
-/* repeat a zero length 11-138 times (7 bits of repeat count) */
-
-var extra_lbits = /* extra bits for each length code */
- [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
-
-var extra_dbits = /* extra bits for each distance code */
- [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
-
-var extra_blbits = /* extra bits for each bit length code */
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
-
-var bl_order =
- [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
-/* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
-/* ===========================================================================
- * Local data. These are initialized only once.
- */
-
-// We pre-fill arrays with 0 to avoid uninitialized gaps
-
-var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
-
-// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
-var static_ltree = new Array((L_CODES+2) * 2);
-zero(static_ltree);
-/* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
-var static_dtree = new Array(D_CODES * 2);
-zero(static_dtree);
-/* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
-var _dist_code = new Array(DIST_CODE_LEN);
-zero(_dist_code);
-/* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
-var _length_code = new Array(MAX_MATCH-MIN_MATCH+1);
-zero(_length_code);
-/* length code for each normalized match length (0 == MIN_MATCH) */
-
-var base_length = new Array(LENGTH_CODES);
-zero(base_length);
-/* First normalized length for each code (0 = MIN_MATCH) */
-
-var base_dist = new Array(D_CODES);
-zero(base_dist);
-/* First normalized distance for each code (0 = distance of 1) */
-
-
-var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) {
-
- this.static_tree = static_tree; /* static tree or NULL */
- this.extra_bits = extra_bits; /* extra bits for each code or NULL */
- this.extra_base = extra_base; /* base index for extra_bits */
- this.elems = elems; /* max number of elements in the tree */
- this.max_length = max_length; /* max bit length for the codes */
-
- // show if `static_tree` has data or dummy - needed for monomorphic objects
- this.has_stree = static_tree && static_tree.length;
-};
-
-
-var static_l_desc;
-var static_d_desc;
-var static_bl_desc;
-
-
-var TreeDesc = function(dyn_tree, stat_desc) {
- this.dyn_tree = dyn_tree; /* the dynamic tree */
- this.max_code = 0; /* largest code with non zero frequency */
- this.stat_desc = stat_desc; /* the corresponding static tree */
-};
-
-
-
-function d_code(dist) {
- return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
-}
-
-
-/* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
-function put_short (s, w) {
-// put_byte(s, (uch)((w) & 0xff));
-// put_byte(s, (uch)((ush)(w) >> 8));
- s.pending_buf[s.pending++] = (w) & 0xff;
- s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
-}
-
-
-/* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-function send_bits(s, value, length) {
- if (s.bi_valid > (Buf_size - length)) {
- s.bi_buf |= (value << s.bi_valid) & 0xffff;
- put_short(s, s.bi_buf);
- s.bi_buf = value >> (Buf_size - s.bi_valid);
- s.bi_valid += length - Buf_size;
- } else {
- s.bi_buf |= (value << s.bi_valid) & 0xffff;
- s.bi_valid += length;
- }
-}
-
-
-function send_code(s, c, tree) {
- send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/);
-}
-
-
-/* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-function bi_reverse(code, len) {
- var res = 0;
- do {
- res |= code & 1;
- code >>>= 1;
- res <<= 1;
- } while (--len > 0);
- return res >>> 1;
-}
-
-
-/* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
-function bi_flush(s) {
- if (s.bi_valid === 16) {
- put_short(s, s.bi_buf);
- s.bi_buf = 0;
- s.bi_valid = 0;
-
- } else if (s.bi_valid >= 8) {
- s.pending_buf[s.pending++] = s.bi_buf & 0xff;
- s.bi_buf >>= 8;
- s.bi_valid -= 8;
- }
-}
-
-
-/* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- * above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- * array bl_count contains the frequencies for each bit length.
- * The length opt_len is updated; static_len is also updated if stree is
- * not null.
- */
-function gen_bitlen(s, desc)
-// deflate_state *s;
-// tree_desc *desc; /* the tree descriptor */
-{
- var tree = desc.dyn_tree;
- var max_code = desc.max_code;
- var stree = desc.stat_desc.static_tree;
- var has_stree = desc.stat_desc.has_stree;
- var extra = desc.stat_desc.extra_bits;
- var base = desc.stat_desc.extra_base;
- var max_length = desc.stat_desc.max_length;
- var h; /* heap index */
- var n, m; /* iterate over the tree elements */
- var bits; /* bit length */
- var xbits; /* extra bits */
- var f; /* frequency */
- var overflow = 0; /* number of elements with bit length too large */
-
- for (bits = 0; bits <= MAX_BITS; bits++) {
- s.bl_count[bits] = 0;
- }
-
- /* In a first pass, compute the optimal bit lengths (which may
- * overflow in the case of the bit length tree).
- */
- tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */
-
- for (h = s.heap_max+1; h < HEAP_SIZE; h++) {
- n = s.heap[h];
- bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
- if (bits > max_length) {
- bits = max_length;
- overflow++;
- }
- tree[n*2 + 1]/*.Len*/ = bits;
- /* We overwrite tree[n].Dad which is no longer needed */
-
- if (n > max_code) { continue; } /* not a leaf node */
-
- s.bl_count[bits]++;
- xbits = 0;
- if (n >= base) {
- xbits = extra[n-base];
- }
- f = tree[n * 2]/*.Freq*/;
- s.opt_len += f * (bits + xbits);
- if (has_stree) {
- s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);
- }
- }
- if (overflow === 0) { return; }
-
- // Trace((stderr,"\nbit length overflow\n"));
- /* This happens for example on obj2 and pic of the Calgary corpus */
-
- /* Find the first bit length which could increase: */
- do {
- bits = max_length-1;
- while (s.bl_count[bits] === 0) { bits--; }
- s.bl_count[bits]--; /* move one leaf down the tree */
- s.bl_count[bits+1] += 2; /* move one overflow item as its brother */
- s.bl_count[max_length]--;
- /* The brother of the overflow item also moves one step up,
- * but this does not affect bl_count[max_length]
- */
- overflow -= 2;
- } while (overflow > 0);
-
- /* Now recompute all bit lengths, scanning in increasing frequency.
- * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
- * lengths instead of fixing only the wrong ones. This idea is taken
- * from 'ar' written by Haruhiko Okumura.)
- */
- for (bits = max_length; bits !== 0; bits--) {
- n = s.bl_count[bits];
- while (n !== 0) {
- m = s.heap[--h];
- if (m > max_code) { continue; }
- if (tree[m*2 + 1]/*.Len*/ !== bits) {
- // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
- s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;
- tree[m*2 + 1]/*.Len*/ = bits;
- }
- n--;
- }
- }
-}
-
-
-/* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- * zero code length.
- */
-function gen_codes(tree, max_code, bl_count)
-// ct_data *tree; /* the tree to decorate */
-// int max_code; /* largest code with non zero frequency */
-// ushf *bl_count; /* number of codes at each bit length */
-{
- var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */
- var code = 0; /* running code value */
- var bits; /* bit index */
- var n; /* code index */
-
- /* The distribution counts are first used to generate the code values
- * without bit reversal.
- */
- for (bits = 1; bits <= MAX_BITS; bits++) {
- next_code[bits] = code = (code + bl_count[bits-1]) << 1;
- }
- /* Check that the bit counts in bl_count are consistent. The last code
- * must be all ones.
- */
- //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */
- length = 0;
- for (code = 0; code < LENGTH_CODES-1; code++) {
- base_length[code] = length;
- for (n = 0; n < (1< dist code (0..29) */
- dist = 0;
- for (code = 0 ; code < 16; code++) {
- base_dist[code] = dist;
- for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */
- for ( ; code < D_CODES; code++) {
- base_dist[code] = dist << 7;
- for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
- _dist_code[256 + dist++] = code;
- }
- }
- //Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
- /* Construct the codes of the static literal tree */
- for (bits = 0; bits <= MAX_BITS; bits++) {
- bl_count[bits] = 0;
- }
-
- n = 0;
- while (n <= 143) {
- static_ltree[n*2 + 1]/*.Len*/ = 8;
- n++;
- bl_count[8]++;
- }
- while (n <= 255) {
- static_ltree[n*2 + 1]/*.Len*/ = 9;
- n++;
- bl_count[9]++;
- }
- while (n <= 279) {
- static_ltree[n*2 + 1]/*.Len*/ = 7;
- n++;
- bl_count[7]++;
- }
- while (n <= 287) {
- static_ltree[n*2 + 1]/*.Len*/ = 8;
- n++;
- bl_count[8]++;
- }
- /* Codes 286 and 287 do not exist, but we must include them in the
- * tree construction to get a canonical Huffman tree (longest code
- * all ones)
- */
- gen_codes(static_ltree, L_CODES+1, bl_count);
-
- /* The static distance tree is trivial: */
- for (n = 0; n < D_CODES; n++) {
- static_dtree[n*2 + 1]/*.Len*/ = 5;
- static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);
- }
-
- // Now data ready and we can init static trees
- static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);
- static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
- static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
-
- //static_init_done = true;
-}
-
-
-/* ===========================================================================
- * Initialize a new block.
- */
-function init_block(s) {
- var n; /* iterates over tree elements */
-
- /* Initialize the trees. */
- for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }
- for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }
- for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }
-
- s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;
- s.opt_len = s.static_len = 0;
- s.last_lit = s.matches = 0;
-}
-
-
-/* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
-function bi_windup(s)
-{
- if (s.bi_valid > 8) {
- put_short(s, s.bi_buf);
- } else if (s.bi_valid > 0) {
- //put_byte(s, (Byte)s->bi_buf);
- s.pending_buf[s.pending++] = s.bi_buf;
- }
- s.bi_buf = 0;
- s.bi_valid = 0;
-}
-
-/* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
-function copy_block(s, buf, len, header)
-//DeflateState *s;
-//charf *buf; /* the input data */
-//unsigned len; /* its length */
-//int header; /* true if block header must be written */
-{
- bi_windup(s); /* align on byte boundary */
-
- if (header) {
- put_short(s, len);
- put_short(s, ~len);
- }
-// while (len--) {
-// put_byte(s, *buf++);
-// }
- utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
- s.pending += len;
-}
-
-/* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-function smaller(tree, n, m, depth) {
- var _n2 = n*2;
- var _m2 = m*2;
- return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
- (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
-}
-
-/* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-function pqdownheap(s, tree, k)
-// deflate_state *s;
-// ct_data *tree; /* the tree to restore */
-// int k; /* node to move down */
-{
- var v = s.heap[k];
- var j = k << 1; /* left son of k */
- while (j <= s.heap_len) {
- /* Set j to the smallest of the two sons: */
- if (j < s.heap_len &&
- smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {
- j++;
- }
- /* Exit if v is smaller than both sons */
- if (smaller(tree, v, s.heap[j], s.depth)) { break; }
-
- /* Exchange v with the smallest son */
- s.heap[k] = s.heap[j];
- k = j;
-
- /* And continue down the tree, setting j to the left son of k */
- j <<= 1;
- }
- s.heap[k] = v;
-}
-
-
-// inlined manually
-// var SMALLEST = 1;
-
-/* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
-function compress_block(s, ltree, dtree)
-// deflate_state *s;
-// const ct_data *ltree; /* literal tree */
-// const ct_data *dtree; /* distance tree */
-{
- var dist; /* distance of matched string */
- var lc; /* match length or unmatched char (if dist == 0) */
- var lx = 0; /* running index in l_buf */
- var code; /* the code to send */
- var extra; /* number of extra bits to send */
-
- if (s.last_lit !== 0) {
- do {
- dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]);
- lc = s.pending_buf[s.l_buf + lx];
- lx++;
-
- if (dist === 0) {
- send_code(s, lc, ltree); /* send a literal byte */
- //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
- } else {
- /* Here, lc is the match length - MIN_MATCH */
- code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
- extra = extra_lbits[code];
- if (extra !== 0) {
- lc -= base_length[code];
- send_bits(s, lc, extra); /* send the extra length bits */
- }
- dist--; /* dist is now the match distance - 1 */
- code = d_code(dist);
- //Assert (code < D_CODES, "bad d_code");
-
- send_code(s, code, dtree); /* send the distance code */
- extra = extra_dbits[code];
- if (extra !== 0) {
- dist -= base_dist[code];
- send_bits(s, dist, extra); /* send the extra distance bits */
- }
- } /* literal or match pair ? */
-
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- // "pendingBuf overflow");
-
- } while (lx < s.last_lit);
- }
-
- send_code(s, END_BLOCK, ltree);
-}
-
-
-/* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- * and corresponding code. The length opt_len is updated; static_len is
- * also updated if stree is not null. The field max_code is set.
- */
-function build_tree(s, desc)
-// deflate_state *s;
-// tree_desc *desc; /* the tree descriptor */
-{
- var tree = desc.dyn_tree;
- var stree = desc.stat_desc.static_tree;
- var has_stree = desc.stat_desc.has_stree;
- var elems = desc.stat_desc.elems;
- var n, m; /* iterate over heap elements */
- var max_code = -1; /* largest code with non zero frequency */
- var node; /* new node being created */
-
- /* Construct the initial heap, with least frequent element in
- * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
- * heap[0] is not used.
- */
- s.heap_len = 0;
- s.heap_max = HEAP_SIZE;
-
- for (n = 0; n < elems; n++) {
- if (tree[n * 2]/*.Freq*/ !== 0) {
- s.heap[++s.heap_len] = max_code = n;
- s.depth[n] = 0;
-
- } else {
- tree[n*2 + 1]/*.Len*/ = 0;
- }
- }
-
- /* The pkzip format requires that at least one distance code exists,
- * and that at least one bit should be sent even if there is only one
- * possible code. So to avoid special checks later on we force at least
- * two codes of non zero frequency.
- */
- while (s.heap_len < 2) {
- node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
- tree[node * 2]/*.Freq*/ = 1;
- s.depth[node] = 0;
- s.opt_len--;
-
- if (has_stree) {
- s.static_len -= stree[node*2 + 1]/*.Len*/;
- }
- /* node is 0 or 1 so it does not have extra bits */
- }
- desc.max_code = max_code;
-
- /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
- * establish sub-heaps of increasing lengths:
- */
- for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
-
- /* Construct the Huffman tree by repeatedly combining the least two
- * frequent nodes.
- */
- node = elems; /* next internal node of the tree */
- do {
- //pqremove(s, tree, n); /* n = node of least frequency */
- /*** pqremove ***/
- n = s.heap[1/*SMALLEST*/];
- s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
- pqdownheap(s, tree, 1/*SMALLEST*/);
- /***/
-
- m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
-
- s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
- s.heap[--s.heap_max] = m;
-
- /* Create a new node father of n and m */
- tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
- s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
- tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node;
-
- /* and insert the new node in the heap */
- s.heap[1/*SMALLEST*/] = node++;
- pqdownheap(s, tree, 1/*SMALLEST*/);
-
- } while (s.heap_len >= 2);
-
- s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
-
- /* At this point, the fields freq and dad are set. We can now
- * generate the bit lengths.
- */
- gen_bitlen(s, desc);
-
- /* The field len is now set, we can generate the bit codes */
- gen_codes(tree, max_code, s.bl_count);
-}
-
-
-/* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
-function scan_tree(s, tree, max_code)
-// deflate_state *s;
-// ct_data *tree; /* the tree to be scanned */
-// int max_code; /* and its largest code of non zero frequency */
-{
- var n; /* iterates over all tree elements */
- var prevlen = -1; /* last emitted length */
- var curlen; /* length of current code */
-
- var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
-
- var count = 0; /* repeat count of the current code */
- var max_count = 7; /* max repeat count */
- var min_count = 4; /* min repeat count */
-
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
- }
- tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen;
- nextlen = tree[(n+1)*2 + 1]/*.Len*/;
-
- if (++count < max_count && curlen === nextlen) {
- continue;
-
- } else if (count < min_count) {
- s.bl_tree[curlen * 2]/*.Freq*/ += count;
-
- } else if (curlen !== 0) {
-
- if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
- s.bl_tree[REP_3_6*2]/*.Freq*/++;
-
- } else if (count <= 10) {
- s.bl_tree[REPZ_3_10*2]/*.Freq*/++;
-
- } else {
- s.bl_tree[REPZ_11_138*2]/*.Freq*/++;
- }
-
- count = 0;
- prevlen = curlen;
-
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
-
- } else if (curlen === nextlen) {
- max_count = 6;
- min_count = 3;
-
- } else {
- max_count = 7;
- min_count = 4;
- }
- }
-}
-
-
-/* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
-function send_tree(s, tree, max_code)
-// deflate_state *s;
-// ct_data *tree; /* the tree to be scanned */
-// int max_code; /* and its largest code of non zero frequency */
-{
- var n; /* iterates over all tree elements */
- var prevlen = -1; /* last emitted length */
- var curlen; /* length of current code */
-
- var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
-
- var count = 0; /* repeat count of the current code */
- var max_count = 7; /* max repeat count */
- var min_count = 4; /* min repeat count */
-
- /* tree[max_code+1].Len = -1; */ /* guard already set */
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
- }
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen;
- nextlen = tree[(n+1)*2 + 1]/*.Len*/;
-
- if (++count < max_count && curlen === nextlen) {
- continue;
-
- } else if (count < min_count) {
- do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
-
- } else if (curlen !== 0) {
- if (curlen !== prevlen) {
- send_code(s, curlen, s.bl_tree);
- count--;
- }
- //Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s.bl_tree);
- send_bits(s, count-3, 2);
-
- } else if (count <= 10) {
- send_code(s, REPZ_3_10, s.bl_tree);
- send_bits(s, count-3, 3);
-
- } else {
- send_code(s, REPZ_11_138, s.bl_tree);
- send_bits(s, count-11, 7);
- }
-
- count = 0;
- prevlen = curlen;
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
-
- } else if (curlen === nextlen) {
- max_count = 6;
- min_count = 3;
-
- } else {
- max_count = 7;
- min_count = 4;
- }
- }
-}
-
-
-/* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-function build_bl_tree(s) {
- var max_blindex; /* index of last bit length code of non zero freq */
-
- /* Determine the bit length frequencies for literal and distance trees */
- scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
- scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
-
- /* Build the bit length tree: */
- build_tree(s, s.bl_desc);
- /* opt_len now includes the length of the tree representations, except
- * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
- */
-
- /* Determine the number of bit length codes to send. The pkzip format
- * requires that at least 4 bit length codes be sent. (appnote.txt says
- * 3 but the actual value used is 4.)
- */
- for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
- if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {
- break;
- }
- }
- /* Update opt_len to include the bit length tree and counts */
- s.opt_len += 3*(max_blindex+1) + 5+5+4;
- //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
- // s->opt_len, s->static_len));
-
- return max_blindex;
-}
-
-
-/* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-function send_all_trees(s, lcodes, dcodes, blcodes)
-// deflate_state *s;
-// int lcodes, dcodes, blcodes; /* number of codes for each tree */
-{
- var rank; /* index in bl_order */
-
- //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
- //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
- // "too many codes");
- //Tracev((stderr, "\nbl counts: "));
- send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
- send_bits(s, dcodes-1, 5);
- send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
- for (rank = 0; rank < blcodes; rank++) {
- //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
- send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);
- }
- //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
- send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */
- //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
- send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */
- //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
-}
-
-
-/* ===========================================================================
- * Check if the data type is TEXT or BINARY, using the following algorithm:
- * - TEXT if the two conditions below are satisfied:
- * a) There are no non-portable control characters belonging to the
- * "black list" (0..6, 14..25, 28..31).
- * b) There is at least one printable character belonging to the
- * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
- * - BINARY otherwise.
- * - The following partially-portable control characters form a
- * "gray list" that is ignored in this detection algorithm:
- * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
- * IN assertion: the fields Freq of dyn_ltree are set.
- */
-function detect_data_type(s) {
- /* black_mask is the bit mask of black-listed bytes
- * set bits 0..6, 14..25, and 28..31
- * 0xf3ffc07f = binary 11110011111111111100000001111111
- */
- var black_mask = 0xf3ffc07f;
- var n;
-
- /* Check for non-textual ("black-listed") bytes. */
- for (n = 0; n <= 31; n++, black_mask >>>= 1) {
- if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) {
- return Z_BINARY;
- }
- }
-
- /* Check for textual ("white-listed") bytes. */
- if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
- s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
- return Z_TEXT;
- }
- for (n = 32; n < LITERALS; n++) {
- if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
- return Z_TEXT;
- }
- }
-
- /* There are no "black-listed" or "white-listed" bytes:
- * this stream either is empty or has tolerated ("gray-listed") bytes only.
- */
- return Z_BINARY;
-}
-
-
-var static_init_done = false;
-
-/* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
-function _tr_init(s)
-{
-
- if (!static_init_done) {
- tr_static_init();
- static_init_done = true;
- }
-
- s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
- s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
- s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
-
- s.bi_buf = 0;
- s.bi_valid = 0;
-
- /* Initialize the first block of the first file: */
- init_block(s);
-}
-
-
-/* ===========================================================================
- * Send a stored block
- */
-function _tr_stored_block(s, buf, stored_len, last)
-//DeflateState *s;
-//charf *buf; /* input block */
-//ulg stored_len; /* length of input block */
-//int last; /* one if this is the last block for a file */
-{
- send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */
- copy_block(s, buf, stored_len, true); /* with header */
-}
-
-
-/* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- */
-function _tr_align(s) {
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
- bi_flush(s);
-}
-
-
-/* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-function _tr_flush_block(s, buf, stored_len, last)
-//DeflateState *s;
-//charf *buf; /* input block, or NULL if too old */
-//ulg stored_len; /* length of input block */
-//int last; /* one if this is the last block for a file */
-{
- var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
- var max_blindex = 0; /* index of last bit length code of non zero freq */
-
- /* Build the Huffman trees unless a stored block is forced */
- if (s.level > 0) {
-
- /* Check if the file is binary or text */
- if (s.strm.data_type === Z_UNKNOWN) {
- s.strm.data_type = detect_data_type(s);
- }
-
- /* Construct the literal and distance trees */
- build_tree(s, s.l_desc);
- // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
- // s->static_len));
-
- build_tree(s, s.d_desc);
- // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
- // s->static_len));
- /* At this point, opt_len and static_len are the total bit lengths of
- * the compressed block data, excluding the tree representations.
- */
-
- /* Build the bit length tree for the above two trees, and get the index
- * in bl_order of the last bit length code to send.
- */
- max_blindex = build_bl_tree(s);
-
- /* Determine the best encoding. Compute the block lengths in bytes. */
- opt_lenb = (s.opt_len+3+7) >>> 3;
- static_lenb = (s.static_len+3+7) >>> 3;
-
- // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
- // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
- // s->last_lit));
-
- if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
-
- } else {
- // Assert(buf != (char*)0, "lost buf");
- opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
- }
-
- if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {
- /* 4: two words for the lengths */
-
- /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
- * Otherwise we can't have processed more than WSIZE input bytes since
- * the last block flush, because compression would have been
- * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
- * transform a block into a stored block.
- */
- _tr_stored_block(s, buf, stored_len, last);
-
- } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
-
- send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);
- compress_block(s, static_ltree, static_dtree);
-
- } else {
- send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);
- send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);
- compress_block(s, s.dyn_ltree, s.dyn_dtree);
- }
- // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
- /* The above check is made mod 2^32, for files larger than 512 MB
- * and uLong implemented on 32 bits.
- */
- init_block(s);
-
- if (last) {
- bi_windup(s);
- }
- // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- // s->compressed_len-7*last));
-}
-
-/* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-function _tr_tally(s, dist, lc)
-// deflate_state *s;
-// unsigned dist; /* distance of matched string */
-// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
-{
- //var out_length, in_length, dcode;
-
- s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
- s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
-
- s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
- s.last_lit++;
-
- if (dist === 0) {
- /* lc is the unmatched char */
- s.dyn_ltree[lc*2]/*.Freq*/++;
- } else {
- s.matches++;
- /* Here, lc is the match length - MIN_MATCH */
- dist--; /* dist = match distance - 1 */
- //Assert((ush)dist < (ush)MAX_DIST(s) &&
- // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
- // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
-
- s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;
- s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
- }
-
-// (!) This block is disabled in zlib defailts,
-// don't enable it for binary compatibility
-
-//#ifdef TRUNCATE_BLOCK
-// /* Try to guess if it is profitable to stop the current block here */
-// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
-// /* Compute an upper bound for the compressed length */
-// out_length = s.last_lit*8;
-// in_length = s.strstart - s.block_start;
-//
-// for (dcode = 0; dcode < D_CODES; dcode++) {
-// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
-// }
-// out_length >>>= 3;
-// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
-// // s->last_lit, in_length, out_length,
-// // 100L - out_length*100L/in_length));
-// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
-// return true;
-// }
-// }
-//#endif
-
- return (s.last_lit === s.lit_bufsize-1);
- /* We avoid equality with lit_bufsize because of wraparound at 64K
- * on 16 bit machines and because stored blocks are restricted to
- * 64K-1 bytes.
- */
-}
-
-exports._tr_init = _tr_init;
-exports._tr_stored_block = _tr_stored_block;
-exports._tr_flush_block = _tr_flush_block;
-exports._tr_tally = _tr_tally;
-exports._tr_align = _tr_align;
-},{"../utils/common":27}],39:[function(_dereq_,module,exports){
-'use strict';
-
-
-function ZStream() {
- /* next input byte */
- this.input = null; // JS specific, because we have no pointers
- this.next_in = 0;
- /* number of bytes available at input */
- this.avail_in = 0;
- /* total number of input bytes read so far */
- this.total_in = 0;
- /* next output byte should be put there */
- this.output = null; // JS specific, because we have no pointers
- this.next_out = 0;
- /* remaining free space at output */
- this.avail_out = 0;
- /* total number of bytes output so far */
- this.total_out = 0;
- /* last error message, NULL if no error */
- this.msg = ''/*Z_NULL*/;
- /* not visible by applications */
- this.state = null;
- /* best guess about the data type: binary or text */
- this.data_type = 2/*Z_UNKNOWN*/;
- /* adler32 value of the uncompressed data */
- this.adler = 0;
-}
-
-module.exports = ZStream;
-},{}]},{},[9])
-(9)
-});
\ No newline at end of file
diff --git a/web/DataTables/JSZip-2.5.0/jszip.min.js b/web/DataTables/JSZip-2.5.0/jszip.min.js
deleted file mode 100644
index a09f35b..0000000
--- a/web/DataTables/JSZip-2.5.0/jszip.min.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/*!
-
-JSZip - A Javascript class for generating and reading zip files
-
-
-(c) 2009-2014 Stuart Knightley
-Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
-
-JSZip uses the library pako released under the MIT license :
-https://github.com/nodeca/pako/blob/master/LICENSE
-*/
-!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isNaN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);return j},c.decode=function(a){var b,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k>4,c=(15&g)<<4|h>>2,e=(3&h)<<6|i,j+=String.fromCharCode(b),64!=h&&(j+=String.fromCharCode(c)),64!=i&&(j+=String.fromCharCode(e));return j}},{}],2:[function(a,b){"use strict";function c(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}c.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},b.exports=c},{}],3:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a){return a},uncompress:function(a){return a},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":8}],4:[function(a,b){"use strict";var c=a("./utils"),d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var e="string"!==c.getTypeOf(a);"undefined"==typeof b&&(b=0);var f=0,g=0,h=0;b=-1^b;for(var i=0,j=a.length;j>i;i++)h=e?a[i]:a.charCodeAt(i),g=255&(b^h),f=d[g],b=b>>>8^f;return-1^b}},{"./utils":21}],5:[function(a,b){"use strict";function c(){this.data=null,this.length=0,this.index=0}var d=a("./utils");c.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.lengtha)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var b,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return d.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=c},{"./utils":21}],6:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!1,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],7:[function(a,b,c){"use strict";var d=a("./utils");c.string2binary=function(a){return d.string2binary(a)},c.string2Uint8Array=function(a){return d.transformTo("uint8array",a)},c.uint8Array2String=function(a){return d.transformTo("string",a)},c.string2Blob=function(a){var b=d.transformTo("arraybuffer",a);return d.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){return d.arrayBuffer2Blob(a)},c.transformTo=function(a,b){return d.transformTo(a,b)},c.getTypeOf=function(a){return d.getTypeOf(a)},c.checkSupport=function(a){return d.checkSupport(a)},c.MAX_VALUE_16BITS=d.MAX_VALUE_16BITS,c.MAX_VALUE_32BITS=d.MAX_VALUE_32BITS,c.pretty=function(a){return d.pretty(a)},c.findCompression=function(a){return d.findCompression(a)},c.isRegExp=function(a){return d.isRegExp(a)}},{"./utils":21}],8:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,e=a("pako");c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a,b){return e.deflateRaw(a,{level:b.level||-1})},c.uncompress=function(a){return e.inflateRaw(a)}},{pako:24}],9:[function(a,b){"use strict";function c(a,b){return this instanceof c?(this.files={},this.comment=null,this.root="",a&&this.load(a,b),void(this.clone=function(){var a=new c;for(var b in this)"function"!=typeof this[b]&&(a[b]=this[b]);return a})):new c(a,b)}var d=a("./base64");c.prototype=a("./object"),c.prototype.load=a("./load"),c.support=a("./support"),c.defaults=a("./defaults"),c.utils=a("./deprecatedPublicUtils"),c.base64={encode:function(a){return d.encode(a)},decode:function(a){return d.decode(a)}},c.compressions=a("./compressions"),b.exports=c},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(a,b){"use strict";var c=a("./base64"),d=a("./zipEntries");b.exports=function(a,b){var e,f,g,h;for(b=b||{},b.base64&&(a=c.decode(a)),f=new d(a,b),e=f.files,g=0;gc;c++)d+=String.fromCharCode(255&a),a>>>=8;return d},t=function(){var a,b,c={};for(a=0;a0?a.substring(0,b):""},x=function(a){return"/"!=a.slice(-1)&&(a+="/"),a},y=function(a,b){return b="undefined"!=typeof b?b:!1,a=x(a),this.files[a]||v.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},z=function(a,b,c){var f,g=new j;return a._data instanceof j?(g.uncompressedSize=a._data.uncompressedSize,g.crc32=a._data.crc32,0===g.uncompressedSize||a.dir?(b=i.STORE,g.compressedContent="",g.crc32=0):a._data.compressionMethod===b.magic?g.compressedContent=a._data.getCompressedContent():(f=a._data.getContent(),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c))):(f=p(a),(!f||0===f.length||a.dir)&&(b=i.STORE,f=""),g.uncompressedSize=f.length,g.crc32=e(f),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c)),g.compressedSize=g.compressedContent.length,g.compressionMethod=b.magic,g},A=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},B=function(a){return 63&(a||0)},C=function(a,b,c,g,h){var i,j,k,m,n=(c.compressedContent,d.transformTo("string",l.utf8encode(b.name))),o=b.comment||"",p=d.transformTo("string",l.utf8encode(o)),q=n.length!==b.name.length,r=p.length!==o.length,t=b.options,u="",v="",w="";k=b._initialMetadata.dir!==b.dir?b.dir:t.dir,m=b._initialMetadata.date!==b.date?b.date:t.date;var x=0,y=0;k&&(x|=16),"UNIX"===h?(y=798,x|=A(b.unixPermissions,k)):(y=20,x|=B(b.dosPermissions,k)),i=m.getHours(),i<<=6,i|=m.getMinutes(),i<<=5,i|=m.getSeconds()/2,j=m.getFullYear()-1980,j<<=4,j|=m.getMonth()+1,j<<=5,j|=m.getDate(),q&&(v=s(1,1)+s(e(n),4)+n,u+="up"+s(v.length,2)+v),r&&(w=s(1,1)+s(this.crc32(p),4)+p,u+="uc"+s(w.length,2)+w);var z="";z+="\n\x00",z+=q||r?"\x00\b":"\x00\x00",z+=c.compressionMethod,z+=s(i,2),z+=s(j,2),z+=s(c.crc32,4),z+=s(c.compressedSize,4),z+=s(c.uncompressedSize,4),z+=s(n.length,2),z+=s(u.length,2);var C=f.LOCAL_FILE_HEADER+z+n+u,D=f.CENTRAL_FILE_HEADER+s(y,2)+z+s(p.length,2)+"\x00\x00\x00\x00"+s(x,4)+s(g,4)+n+u+p;return{fileRecord:C,dirRecord:D,compressedObject:c}},D={load:function(){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){var b,c,d,e,f=[];for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],e=new r(d.name,d._data,t(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,e)&&f.push(e));return f},file:function(a,b,c){if(1===arguments.length){if(d.isRegExp(a)){var e=a;return this.filter(function(a,b){return!b.dir&&e.test(a)})}return this.filter(function(b,c){return!c.dir&&b===a})[0]||null}return a=this.root+a,v.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(d.isRegExp(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=y.call(this,b),e=this.clone();return e.root=c.name,e},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f;return-1},c.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.index,this.index+a);return this.index+=a,b},b.exports=c},{"./dataReader":5}],19:[function(a,b){"use strict";var c=a("./utils"),d=function(a){this.data=new Uint8Array(a),this.index=0};d.prototype={append:function(a){0!==a.length&&(a=c.transformTo("uint8array",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){return this.data}},b.exports=d},{"./utils":21}],20:[function(a,b,c){"use strict";for(var d=a("./utils"),e=a("./support"),f=a("./nodeBuffer"),g=new Array(256),h=0;256>h;h++)g[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;g[254]=g[254]=1;var i=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=e.uint8array?new Uint8Array(i):new Array(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},j=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+g[a[c]]>b?c:b},k=function(a){var b,c,e,f,h=a.length,i=new Array(2*h);for(c=0,b=0;h>b;)if(e=a[b++],128>e)i[c++]=e;else if(f=g[e],f>4)i[c++]=65533,b+=f-1;else{for(e&=2===f?31:3===f?15:7;f>1&&h>b;)e=e<<6|63&a[b++],f--;f>1?i[c++]=65533:65536>e?i[c++]=e:(e-=65536,i[c++]=55296|e>>10&1023,i[c++]=56320|1023&e)}return i.length!==c&&(i.subarray?i=i.subarray(0,c):i.length=c),d.applyFromCharCode(i)};c.utf8encode=function(a){return e.nodebuffer?f(a,"utf-8"):i(a)},c.utf8decode=function(a){if(e.nodebuffer)return d.transformTo("nodebuffer",a).toString("utf-8");a=d.transformTo(e.uint8array?"uint8array":"array",a);for(var b=[],c=0,f=a.length,g=65536;f>c;){var h=j(a,Math.min(c+g,f));b.push(e.uint8array?k(a.subarray(c,h)):k(a.slice(c,h))),c=h}return b.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(a,b,c){"use strict";function d(a){return a}function e(a,b){for(var c=0;cg&&b>1;)try{d.push("array"===f||"nodebuffer"===f?String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e))):String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}return d.join("")}function g(a,b){for(var c=0;cb?"0":"")+b.toString(16).toUpperCase();return d},c.findCompression=function(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b].magic===a)return i[b];return null},c.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(a,b){"use strict";function c(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}var d=a("./stringReader"),e=a("./nodeBufferReader"),f=a("./uint8ArrayReader"),g=a("./utils"),h=a("./signature"),i=a("./zipEntry"),j=a("./support"),k=a("./object");c.prototype={checkSignature:function(a){var b=this.reader.readString(4);if(b!==a)throw new Error("Corrupted zip or bug : unexpected signature ("+g.pretty(b)+", expected "+g.pretty(a)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=k.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var a,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var a,b;for(a=0;a>8;this.dir=16&this.externalFileAttributes?!0:!1,a===h&&(this.dosPermissions=63&this.externalFileAttributes),a===i&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileName.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var a=new d(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==n)throw new Error(j[c]);b.header&&g.deflateSetHeader(this.strm,b.header)};s.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?m:l,e.input="string"==typeof a?i.string2buf(a):a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new h.Buf8(f),e.next_out=0,e.avail_out=f),c=g.deflate(e,d),c!==o&&c!==n)return this.onEnd(c),this.ended=!0,!1;(0===e.avail_out||0===e.avail_in&&d===m)&&this.onData("string"===this.options.to?i.buf2binstring(h.shrinkBuf(e.output,e.next_out)):h.shrinkBuf(e.output,e.next_out))}while((e.avail_in>0||0===e.avail_out)&&c!==o);return d===m?(c=g.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===n):!0},s.prototype.onData=function(a){this.chunks.push(a)},s.prototype.onEnd=function(a){a===n&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=s,c.deflate=d,c.deflateRaw=e,c.gzip=f},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(a,b,c){"use strict";function d(a,b){var c=new m(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}var f=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),i=a("./zlib/constants"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=a("./zlib/gzheader"),m=function(a){this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=f.inflateInit2(this.strm,b.windowBits);if(c!==i.Z_OK)throw new Error(j[c]);this.header=new l,f.inflateGetHeader(this.strm,this.header)};m.prototype.push=function(a,b){var c,d,e,j,k,l=this.strm,m=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?i.Z_FINISH:i.Z_NO_FLUSH,l.input="string"==typeof a?h.binstring2buf(a):a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new g.Buf8(m),l.next_out=0,l.avail_out=m),c=f.inflate(l,i.Z_NO_FLUSH),c!==i.Z_STREAM_END&&c!==i.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0===l.avail_out||c===i.Z_STREAM_END||0===l.avail_in&&d===i.Z_FINISH)&&("string"===this.options.to?(e=h.utf8border(l.output,l.next_out),j=l.next_out-e,k=h.buf2string(l.output,e),l.next_out=j,l.avail_out=m-j,j&&g.arraySet(l.output,l.output,e,j,0),this.onData(k)):this.onData(g.shrinkBuf(l.output,l.next_out)))}while(l.avail_in>0&&c!==i.Z_STREAM_END);return c===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(c=f.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===i.Z_OK):!0},m.prototype.onData=function(a){this.chunks.push(a)},m.prototype.onEnd=function(a){a===i.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=m,c.inflate=d,c.inflateRaw=e,c.ungzip=d},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],28:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":27}],29:[function(a,b){"use strict";function c(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=c},{}],30:[function(a,b){b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(a,b){"use strict";function c(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function d(a,b,c,d){var f=e,g=d+c;a=-1^a;for(var h=d;g>h;h++)a=a>>>8^f[255&(a^b[h])];return-1^a}var e=c();b.exports=d},{}],32:[function(a,b,c){"use strict";function d(a,b){return a.msg=G[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(C.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){D._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,C.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=E(a.adler,b,e,c):2===a.state.wrap&&(a.adler=F(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-jb?a.strstart-(a.w_size-jb):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ib,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ib-(m-f),f=m-ib,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-jb)){C.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=hb)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===H)return sb;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return sb;if(a.strstart-a.block_start>=a.w_size-jb&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?sb:sb}function o(a,b){for(var c,d;;){if(a.lookahead=hb&&(a.ins_h=(a.ins_h<=hb)if(d=D._tr_tally(a,a.strstart-a.match_start,a.match_length-hb),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=hb){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<=hb&&(a.ins_h=(a.ins_h<4096)&&(a.match_length=hb-1)),a.prev_length>=hb&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-hb,d=D._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-hb),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<=hb&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ib;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ib-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=hb?(c=D._tr_tally(a,1,a.match_length-hb),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===H)return sb;break}if(a.match_length=0,c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function s(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=B[a.level].max_lazy,a.good_match=B[a.level].good_length,a.nice_match=B[a.level].nice_length,a.max_chain_length=B[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=hb-1,a.match_available=0,a.ins_h=0}function t(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new C.Buf16(2*fb),this.dyn_dtree=new C.Buf16(2*(2*db+1)),this.bl_tree=new C.Buf16(2*(2*eb+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new C.Buf16(gb+1),this.heap=new C.Buf16(2*cb+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new C.Buf16(2*cb+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function u(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=X,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?lb:qb,a.adler=2===b.wrap?0:1,b.last_flush=H,D._tr_init(b),M):d(a,O)}function v(a){var b=u(a);return b===M&&s(a.state),b}function w(a,b){return a&&a.state?2!==a.state.wrap?O:(a.state.gzhead=b,M):O}function x(a,b,c,e,f,g){if(!a)return O;var h=1;if(b===R&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>Z||c!==Y||8>e||e>15||0>b||b>9||0>g||g>V)return d(a,O);8===e&&(e=9);var i=new t;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,v(a)}function y(a,b){return x(a,b,Y,$,_,W)}function z(a,b){var c,h,k,l;if(!a||!a.state||b>L||0>b)return a?d(a,O):O;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===rb&&b!==K)return d(a,0===a.avail_out?Q:O);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===lb)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=F(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=mb):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,wb),h.status=qb);else{var m=Y+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=T||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=kb),m+=31-m%31,h.status=qb,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===mb)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=nb)}else h.status=nb;if(h.status===nb)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=ob)}else h.status=ob;if(h.status===ob)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=pb)}else h.status=pb;if(h.status===pb&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=qb)):h.status=qb),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,M}else if(0===a.avail_in&&e(b)<=e(c)&&b!==K)return d(a,Q);if(h.status===rb&&0!==a.avail_in)return d(a,Q);if(0!==a.avail_in||0!==h.lookahead||b!==H&&h.status!==rb){var o=h.strategy===T?r(h,b):h.strategy===U?q(h,b):B[h.level].func(h,b);if((o===ub||o===vb)&&(h.status=rb),o===sb||o===ub)return 0===a.avail_out&&(h.last_flush=-1),M;if(o===tb&&(b===I?D._tr_align(h):b!==L&&(D._tr_stored_block(h,0,0,!1),b===J&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,M}return b!==K?M:h.wrap<=0?N:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?M:N)}function A(a){var b;return a&&a.state?(b=a.state.status,b!==lb&&b!==mb&&b!==nb&&b!==ob&&b!==pb&&b!==qb&&b!==rb?d(a,O):(a.state=null,b===qb?d(a,P):M)):O}var B,C=a("../utils/common"),D=a("./trees"),E=a("./adler32"),F=a("./crc32"),G=a("./messages"),H=0,I=1,J=3,K=4,L=5,M=0,N=1,O=-2,P=-3,Q=-5,R=-1,S=1,T=2,U=3,V=4,W=0,X=2,Y=8,Z=9,$=15,_=8,ab=29,bb=256,cb=bb+1+ab,db=30,eb=19,fb=2*cb+1,gb=15,hb=3,ib=258,jb=ib+hb+1,kb=32,lb=42,mb=69,nb=73,ob=91,pb=103,qb=113,rb=666,sb=1,tb=2,ub=3,vb=4,wb=3,xb=function(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e};B=[new xb(0,0,0,0,n),new xb(4,4,8,4,o),new xb(4,5,16,8,o),new xb(4,6,32,32,o),new xb(4,4,16,16,p),new xb(8,16,32,32,p),new xb(8,16,128,128,p),new xb(8,32,128,256,p),new xb(32,128,258,1024,p),new xb(32,258,258,4096,p)],c.deflateInit=y,c.deflateInit2=x,c.deflateReset=v,c.deflateResetKeep=u,c.deflateSetHeader=w,c.deflate=z,c.deflateEnd=A,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(a,b){"use strict";function c(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=c},{}],34:[function(a,b){"use strict";var c=30,d=12;b.exports=function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;e=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=e.dmax,l=e.wsize,m=e.whave,n=e.wnext,o=e.window,p=e.hold,q=e.bits,r=e.lencode,s=e.distcode,t=(1<q&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<q&&(p+=B[f++]<>>=w,q-=w),15>q&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<q&&(p+=B[f++]<q&&(p+=B[f++]<k){a.msg="invalid distance too far back",e.mode=c;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&e.sane){a.msg="invalid distance too far back",e.mode=c;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),e.hold=p,e.bits=q}},{}],35:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new r.Buf32(ob),b.distcode=b.distdyn=new r.Buf32(pb),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,rb)}function k(a){if(sb){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sb=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<=f.wsize?(r.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whaven;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=t(c.check,Bb,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=lb;break}if((15&m)!==J){a.msg="unknown compression method",c.mode=lb;break}if(m>>>=4,n-=4,wb=(15&m)+8,0===c.wbits)c.wbits=wb;else if(wb>c.wbits){a.msg="invalid window size",c.mode=lb;break}c.dmax=1<n;){if(0===i)break a;i--,m+=e[g++]<>8&1),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<>>8&255,Bb[2]=m>>>16&255,Bb[3]=m>>>24&255,c.check=t(c.check,Bb,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>8),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wb=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wb)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.name+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.comment+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:if(512&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<>>=7&n,n-=7&n,c.mode=ib;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=bb,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=lb}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<>>16^65535)){a.msg="invalid stored block lengths",c.mode=lb;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=lb;break}c.have=0,c.mode=_;case _:for(;c.haven;){if(0===i)break a;i--,m+=e[g++]<>>=3,n-=3}for(;c.have<19;)c.lens[Cb[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,yb={bits:c.lenbits},xb=v(w,c.lens,0,19,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid code lengths set",c.mode=lb;break}c.have=0,c.mode=ab;case ab:for(;c.have>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<sb)m>>>=qb,n-=qb,c.lens[c.have++]=sb;else{if(16===sb){for(zb=qb+2;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,0===c.have){a.msg="invalid bit length repeat",c.mode=lb;break}wb=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sb){for(zb=qb+3;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,wb=0,q=3+(7&m),m>>>=3,n-=3}else{for(zb=qb+7;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,wb=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=lb;break}for(;q--;)c.lens[c.have++]=wb}}if(c.mode===lb)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=lb;break}if(c.lenbits=9,yb={bits:c.lenbits},xb=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid literal/lengths set",c.mode=lb;break}if(c.distbits=6,c.distcode=c.distdyn,yb={bits:c.distbits},xb=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,yb),c.distbits=yb.bits,xb){a.msg="invalid distances set",c.mode=lb;break}if(c.mode=bb,b===B)break a;case bb:c.mode=cb;case cb:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1);
-break}for(c.back=0;Ab=c.lencode[m&(1<>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g++]<>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,c.length=sb,0===rb){c.mode=hb;break}if(32&rb){c.back=-1,c.mode=V;break}if(64&rb){a.msg="invalid literal/length code",c.mode=lb;break}c.extra=15&rb,c.mode=db;case db:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=eb;case eb:for(;Ab=c.distcode[m&(1<>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g++]<>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,64&rb){a.msg="invalid distance code",c.mode=lb;break}c.offset=sb,c.extra=15&rb,c.mode=fb;case fb:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=lb;break}c.mode=gb;case gb:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=lb;break}q>c.wnext?(q-=c.wnext,ob=c.wsize-q):ob=c.wnext-q,q>c.length&&(q=c.length),pb=c.window}else pb=f,ob=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pb[ob++];while(--q);0===c.length&&(c.mode=cb);break;case hb:if(0===j)break a;f[h++]=c.length,j--,c.mode=cb;break;case ib:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<n;){if(0===i)break a;i--,m+=e[g++]<=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[n+E]]++;for(H=C,G=d;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;d>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===g||1!==G))return-1;for(Q[1]=0,D=1;d>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[n+E]&&(r[Q[b[n+E]]++]=E);if(a===g?(N=R=r,y=19):a===h?(N=j,O-=257,R=k,S-=257,y=256):(N=l,R=m,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<e||a===i&&L>f)return 1;for(var T=0;;){T++,z=D-J,r[E]y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[n+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<e||a===i&&L>f)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":27}],37:[function(a,b){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a){return 256>a?gb[a]:gb[256+(a>>>7)]}function f(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,c){a.bi_valid>V-c?(a.bi_buf|=b<>V-a.bi_valid,a.bi_valid+=c-V):(a.bi_buf|=b<>>=1,c<<=1;while(--b>0);return c>>>1}function j(a){16===a.bi_valid?(f(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function k(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;U>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;T>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function l(a,b,c){var d,e,f=new Array(U+1),g=0;for(d=1;U>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=i(f[h]++,h))}}function m(){var a,b,c,d,e,f=new Array(U+1);for(c=0,d=0;O-1>d;d++)for(ib[d]=c,a=0;a<1<<_[d];a++)hb[c++]=d;for(hb[c-1]=d,e=0,d=0;16>d;d++)for(jb[d]=e,a=0;a<1<>=7;R>d;d++)for(jb[d]=e<<7,a=0;a<1<=b;b++)f[b]=0;for(a=0;143>=a;)eb[2*a+1]=8,a++,f[8]++;for(;255>=a;)eb[2*a+1]=9,a++,f[9]++;for(;279>=a;)eb[2*a+1]=7,a++,f[7]++;for(;287>=a;)eb[2*a+1]=8,a++,f[8]++;for(l(eb,Q+1,f),a=0;R>a;a++)fb[2*a+1]=5,fb[2*a]=i(a,5);kb=new nb(eb,_,P+1,Q,U),lb=new nb(fb,ab,0,R,U),mb=new nb(new Array(0),bb,0,S,W)}function n(a){var b;for(b=0;Q>b;b++)a.dyn_ltree[2*b]=0;for(b=0;R>b;b++)a.dyn_dtree[2*b]=0;for(b=0;S>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*X]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function o(a){a.bi_valid>8?f(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function p(a,b,c,d){o(a),d&&(f(a,c),f(a,~c)),E.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function q(a,b,c,d){var e=2*b,f=2*c;return a[e]c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)r(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],r(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,r(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],k(a,b),l(f,j,a.bl_count)}function u(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++hh?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*Y]++):10>=h?a.bl_tree[2*Z]++:a.bl_tree[2*$]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function v(a,b,c){var d,e,f=-1,i=b[1],j=0,k=7,l=4;for(0===i&&(k=138,l=3),d=0;c>=d;d++)if(e=i,i=b[2*(d+1)+1],!(++jj){do h(a,e,a.bl_tree);while(0!==--j)}else 0!==e?(e!==f&&(h(a,e,a.bl_tree),j--),h(a,Y,a.bl_tree),g(a,j-3,2)):10>=j?(h(a,Z,a.bl_tree),g(a,j-3,3)):(h(a,$,a.bl_tree),g(a,j-11,7));j=0,f=e,0===i?(k=138,l=3):e===i?(k=6,l=3):(k=7,l=4)}}function w(a){var b;for(u(a,a.dyn_ltree,a.l_desc.max_code),u(a,a.dyn_dtree,a.d_desc.max_code),t(a,a.bl_desc),b=S-1;b>=3&&0===a.bl_tree[2*cb[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function x(a,b,c,d){var e;for(g(a,b-257,5),g(a,c-1,5),g(a,d-4,4),e=0;d>e;e++)g(a,a.bl_tree[2*cb[e]+1],3);v(a,a.dyn_ltree,b-1),v(a,a.dyn_dtree,c-1)}function y(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return G;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return H;for(b=32;P>b;b++)if(0!==a.dyn_ltree[2*b])return H;return G}function z(a){pb||(m(),pb=!0),a.l_desc=new ob(a.dyn_ltree,kb),a.d_desc=new ob(a.dyn_dtree,lb),a.bl_desc=new ob(a.bl_tree,mb),a.bi_buf=0,a.bi_valid=0,n(a)}function A(a,b,c,d){g(a,(J<<1)+(d?1:0),3),p(a,b,c,!0)}function B(a){g(a,K<<1,3),h(a,X,eb),j(a)}function C(a,b,c,d){var e,f,h=0;a.level>0?(a.strm.data_type===I&&(a.strm.data_type=y(a)),t(a,a.l_desc),t(a,a.d_desc),h=w(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?A(a,b,c,d):a.strategy===F||f===e?(g(a,(K<<1)+(d?1:0),3),s(a,eb,fb)):(g(a,(L<<1)+(d?1:0),3),x(a,a.l_desc.max_code+1,a.d_desc.max_code+1,h+1),s(a,a.dyn_ltree,a.dyn_dtree)),n(a),d&&o(a)}function D(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(hb[c]+P+1)]++,a.dyn_dtree[2*e(b)]++),a.last_lit===a.lit_bufsize-1}var E=a("../utils/common"),F=4,G=0,H=1,I=2,J=0,K=1,L=2,M=3,N=258,O=29,P=256,Q=P+1+O,R=30,S=19,T=2*Q+1,U=15,V=16,W=7,X=256,Y=16,Z=17,$=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ab=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],bb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],cb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],db=512,eb=new Array(2*(Q+2));d(eb);var fb=new Array(2*R);d(fb);var gb=new Array(db);d(gb);var hb=new Array(N-M+1);d(hb);var ib=new Array(O);d(ib);var jb=new Array(R);d(jb);var kb,lb,mb,nb=function(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length},ob=function(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b},pb=!1;c._tr_init=z,c._tr_stored_block=A,c._tr_flush_block=C,c._tr_tally=D,c._tr_align=B},{"../utils/common":27}],39:[function(a,b){"use strict";function c(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=c},{}]},{},[9])(9)});
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap4.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.css
deleted file mode 100644
index f77babc..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.css
+++ /dev/null
@@ -1,59 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
-
-table.dataTable.table-striped tr.dtrg-level-0 {
- background-color: #e0e0e0;
-}
-table.dataTable.table-striped tr.dtrg-level-1 {
- background-color: #f0f0f0;
-}
-table.dataTable.table-striped tr.dtrg-level-2,
-table.dataTable.table-striped tr.dtrg-level-3,
-table.dataTable.table-striped tr.dtrg-level-4,
-table.dataTable.table-striped tr.dtrg-level-5 {
- background-color: #f3f3f3;
-}
-table.dataTable.table-striped tr.dtrg-level-1 tr.dtrg-level-2 th,
-table.dataTable.table-striped tr.dtrg-level-3 th,
-table.dataTable.table-striped tr.dtrg-level-4 th,
-table.dataTable.table-striped tr.dtrg-level-5 th {
- background-color: transparent;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.min.css
deleted file mode 100644
index d39c9de..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bootstrap5.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}table.dataTable.table-striped tr.dtrg-level-0{background-color:#e0e0e0}table.dataTable.table-striped tr.dtrg-level-1{background-color:#f0f0f0}table.dataTable.table-striped tr.dtrg-level-2,table.dataTable.table-striped tr.dtrg-level-3,table.dataTable.table-striped tr.dtrg-level-4,table.dataTable.table-striped tr.dtrg-level-5{background-color:#f3f3f3}table.dataTable.table-striped tr.dtrg-level-1 tr.dtrg-level-2 th,table.dataTable.table-striped tr.dtrg-level-3 th,table.dataTable.table-striped tr.dtrg-level-4 th,table.dataTable.table-striped tr.dtrg-level-5 th{background-color:transparent}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.bulma.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.dataTables.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.foundation.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.css
deleted file mode 100644
index d075ff4..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.min.css
deleted file mode 100644
index a44a33e..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.jqueryui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#e0e0e0;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.css
deleted file mode 100644
index 50fd687..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.css
+++ /dev/null
@@ -1,40 +0,0 @@
-table.dataTable tr.dtrg-group th {
- background-color: #F9FAFB;
- text-align: left;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-0 th {
- font-weight: bold;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-1 th,
-table.dataTable tr.dtrg-group.dtrg-level-2 th,
-table.dataTable tr.dtrg-group.dtrg-level-3 th,
-table.dataTable tr.dtrg-group.dtrg-level-4 th,
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- padding-left: 2em;
- font-size: 0.9em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
- padding-left: 2.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
- padding-left: 3em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
- padding-left: 3.5em;
-}
-
-table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
- padding-left: 4em;
-}
diff --git a/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.min.css b/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.min.css
deleted file mode 100644
index 1d45a0d..0000000
--- a/web/DataTables/RowGroup-1.2.0/css/rowGroup.semanticui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-table.dataTable tr.dtrg-group th{background-color:#f9fafb;text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:#f3f3f3;padding-left:4em}
diff --git a/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.js b/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.js
deleted file mode 100644
index 07315fc..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.js
+++ /dev/null
@@ -1,486 +0,0 @@
-/*! RowGroup 1.2.0
- * ©2017-2022 SpryMedia Ltd - datatables.net/license
- */
-
-/**
- * @summary RowGroup
- * @description RowGrouping for DataTables
- * @version 1.2.0
- * @author SpryMedia Ltd (www.sprymedia.co.uk)
- * @contact datatables.net
- * @copyright SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license/mit
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net')(root, $).$;
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-'use strict';
-var DataTable = $.fn.dataTable;
-
-
-var RowGroup = function ( dt, opts ) {
- // Sanity check that we are using DataTables 1.10 or newer
- if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.8' ) ) {
- throw 'RowGroup requires DataTables 1.10.8 or newer';
- }
-
- // User and defaults configuration object
- this.c = $.extend( true, {},
- DataTable.defaults.rowGroup,
- RowGroup.defaults,
- opts
- );
-
- // Internal settings
- this.s = {
- dt: new DataTable.Api( dt )
- };
-
- // DOM items
- this.dom = {
-
- };
-
- // Check if row grouping has already been initialised on this table
- var settings = this.s.dt.settings()[0];
- var existing = settings.rowGroup;
- if ( existing ) {
- return existing;
- }
-
- settings.rowGroup = this;
- this._constructor();
-};
-
-
-$.extend( RowGroup.prototype, {
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * API methods for DataTables API interface
- */
-
- /**
- * Get/set the grouping data source - need to call draw after this is
- * executed as a setter
- * @returns string~RowGroup
- */
- dataSrc: function ( val )
- {
- if ( val === undefined ) {
- return this.c.dataSrc;
- }
-
- var dt = this.s.dt;
-
- this.c.dataSrc = val;
-
- $(dt.table().node()).triggerHandler( 'rowgroup-datasrc.dt', [ dt, val ] );
-
- return this;
- },
-
- /**
- * Disable - need to call draw after this is executed
- * @returns RowGroup
- */
- disable: function ()
- {
- this.c.enable = false;
- return this;
- },
-
- /**
- * Enable - need to call draw after this is executed
- * @returns RowGroup
- */
- enable: function ( flag )
- {
- if ( flag === false ) {
- return this.disable();
- }
-
- this.c.enable = true;
- return this;
- },
-
- /**
- * Get enabled flag
- * @returns boolean
- */
- enabled: function ()
- {
- return this.c.enable;
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constructor
- */
- _constructor: function ()
- {
- var that = this;
- var dt = this.s.dt;
- var hostSettings = dt.settings()[0];
-
- dt.on( 'draw.dtrg', function (e, s) {
- if ( that.c.enable && hostSettings === s ) {
- that._draw();
- }
- } );
-
- dt.on( 'column-visibility.dt.dtrg responsive-resize.dt.dtrg', function () {
- that._adjustColspan();
- } );
-
- dt.on( 'destroy', function () {
- dt.off( '.dtrg' );
- } );
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods
- */
-
- /**
- * Adjust column span when column visibility changes
- * @private
- */
- _adjustColspan: function ()
- {
- $( 'tr.'+this.c.className, this.s.dt.table().body() ).find('td:visible')
- .attr( 'colspan', this._colspan() );
- },
-
- /**
- * Get the number of columns that a grouping row should span
- * @private
- */
- _colspan: function ()
- {
- return this.s.dt.columns().visible().reduce( function (a, b) {
- return a + b;
- }, 0 );
- },
-
-
- /**
- * Update function that is called whenever we need to draw the grouping rows.
- * This is basically a bootstrap for the self iterative _group and _groupDisplay
- * methods
- * @private
- */
- _draw: function ()
- {
- var dt = this.s.dt;
- var groupedRows = this._group( 0, dt.rows( { page: 'current' } ).indexes() );
-
- this._groupDisplay( 0, groupedRows );
- },
-
- /**
- * Get the grouping information from a data set (index) of rows
- * @param {number} level Nesting level
- * @param {DataTables.Api} rows API of the rows to consider for this group
- * @returns {object[]} Nested grouping information - it is structured like this:
- * {
- * dataPoint: 'Edinburgh',
- * rows: [ 1,2,3,4,5,6,7 ],
- * children: [ {
- * dataPoint: 'developer'
- * rows: [ 1, 2, 3 ]
- * },
- * {
- * dataPoint: 'support',
- * rows: [ 4, 5, 6, 7 ]
- * } ]
- * }
- * @private
- */
- _group: function ( level, rows ) {
- var fns = Array.isArray( this.c.dataSrc ) ? this.c.dataSrc : [ this.c.dataSrc ];
- var fn = DataTable.ext.oApi._fnGetObjectDataFn( fns[ level ] );
- var dt = this.s.dt;
- var group, last;
- var data = [];
- var that = this;
-
- for ( var i=0, ien=rows.length ; i')
- .append(
- $(' | ')
- .attr( 'colspan', this._colspan() )
- .attr( 'scope', 'row' )
- .append( display )
- );
- }
-
- return row
- .addClass( this.c.className )
- .addClass( className )
- .addClass( 'dtrg-level-'+level );
- }
-} );
-
-
-/**
- * RowGroup default settings for initialisation
- *
- * @namespace
- * @name RowGroup.defaults
- * @static
- */
-RowGroup.defaults = {
- /**
- * Class to apply to grouping rows - applied to both the start and
- * end grouping rows.
- * @type string
- */
- className: 'dtrg-group',
-
- /**
- * Data property from which to read the grouping information
- * @type string|integer|array
- */
- dataSrc: 0,
-
- /**
- * Text to show if no data is found for a group
- * @type string
- */
- emptyDataGroup: 'No group',
-
- /**
- * Initial enablement state
- * @boolean
- */
- enable: true,
-
- /**
- * Class name to give to the end grouping row
- * @type string
- */
- endClassName: 'dtrg-end',
-
- /**
- * End grouping label function
- * @function
- */
- endRender: null,
-
- /**
- * Class name to give to the start grouping row
- * @type string
- */
- startClassName: 'dtrg-start',
-
- /**
- * Start grouping label function
- * @function
- */
- startRender: function ( rows, group ) {
- return group;
- }
-};
-
-
-RowGroup.version = "1.2.0";
-
-
-$.fn.dataTable.RowGroup = RowGroup;
-$.fn.DataTable.RowGroup = RowGroup;
-
-
-DataTable.Api.register( 'rowGroup()', function () {
- return this;
-} );
-
-DataTable.Api.register( 'rowGroup().disable()', function () {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.rowGroup ) {
- ctx.rowGroup.enable( false );
- }
- } );
-} );
-
-DataTable.Api.register( 'rowGroup().enable()', function ( opts ) {
- return this.iterator( 'table', function (ctx) {
- if ( ctx.rowGroup ) {
- ctx.rowGroup.enable( opts === undefined ? true : opts );
- }
- } );
-} );
-
-DataTable.Api.register( 'rowGroup().enabled()', function () {
- var ctx = this.context;
-
- return ctx.length && ctx[0].rowGroup ?
- ctx[0].rowGroup.enabled() :
- false;
-} );
-
-DataTable.Api.register( 'rowGroup().dataSrc()', function ( val ) {
- if ( val === undefined ) {
- return this.context[0].rowGroup.dataSrc();
- }
-
- return this.iterator( 'table', function (ctx) {
- if ( ctx.rowGroup ) {
- ctx.rowGroup.dataSrc( val );
- }
- } );
-} );
-
-
-// Attach a listener to the document which listens for DataTables initialisation
-// events so we can automatically initialise
-$(document).on( 'preInit.dt.dtrg', function (e, settings, json) {
- if ( e.namespace !== 'dt' ) {
- return;
- }
-
- var init = settings.oInit.rowGroup;
- var defaults = DataTable.defaults.rowGroup;
-
- if ( init || defaults ) {
- var opts = $.extend( {}, defaults, init );
-
- if ( init !== false ) {
- new RowGroup( settings, opts );
- }
- }
-} );
-
-
-return RowGroup;
-
-}));
diff --git a/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.min.js b/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.min.js
deleted file mode 100644
index d854113..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/dataTables.rowGroup.min.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*!
- SpryMedia Ltd.
-
- This source file is free software, available under the following license:
- MIT license - http://datatables.net/license/mit
-
- This source file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
-
- For details please refer to: http://www.datatables.net
- RowGroup 1.2.0
- ©2017-2022 SpryMedia Ltd - datatables.net/license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,c,d){b instanceof String&&(b=String(b));for(var g=b.length,e=0;e").append(b(" | ").attr("colspan",this._colspan()).attr("scope","row").append(a))).addClass(this.c.className).addClass(f).addClass("dtrg-level-"+h)}});k.defaults={className:"dtrg-group",dataSrc:0,emptyDataGroup:"No group",enable:!0,endClassName:"dtrg-end",endRender:null,startClassName:"dtrg-start",startRender:function(a,f){return f}};k.version="1.2.0";b.fn.dataTable.RowGroup=
-k;b.fn.DataTable.RowGroup=k;e.Api.register("rowGroup()",function(){return this});e.Api.register("rowGroup().disable()",function(){return this.iterator("table",function(a){a.rowGroup&&a.rowGroup.enable(!1)})});e.Api.register("rowGroup().enable()",function(a){return this.iterator("table",function(f){f.rowGroup&&f.rowGroup.enable(a===g?!0:a)})});e.Api.register("rowGroup().enabled()",function(){var a=this.context;return a.length&&a[0].rowGroup?a[0].rowGroup.enabled():!1});e.Api.register("rowGroup().dataSrc()",
-function(a){return a===g?this.context[0].rowGroup.dataSrc():this.iterator("table",function(f){f.rowGroup&&f.rowGroup.dataSrc(a)})});b(d).on("preInit.dt.dtrg",function(a,f,h){"dt"===a.namespace&&(a=f.oInit.rowGroup,h=e.defaults.rowGroup,a||h)&&(h=b.extend({},h,a),!1!==a&&new k(f,h))});return k});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.js
deleted file mode 100644
index 17dadc4..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 3 styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.min.js
deleted file mode 100644
index de3bf05..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 3 styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.js
deleted file mode 100644
index 97d0243..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 4 styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs4', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs4')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.min.js
deleted file mode 100644
index f8c42c0..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap4.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 4 styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs4")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.js
deleted file mode 100644
index c8b2601..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 5 styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs5', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs5')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.min.js
deleted file mode 100644
index 61f9780..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bootstrap5.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 5 styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs5")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.js
deleted file mode 100644
index 8c4d0f0..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bulma styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bm', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bm')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.min.js
deleted file mode 100644
index 754d042..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.bulma.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bulma styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bm")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.js
deleted file mode 100644
index 65e38a0..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! DataTables styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-dt', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-dt')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.min.js
deleted file mode 100644
index db85833..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.dataTables.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- DataTables styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-dt")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.js
deleted file mode 100644
index d9c2dd6..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Foundation styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-zf', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-zf')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.min.js
deleted file mode 100644
index 64c542c..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.foundation.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Foundation styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-zf")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.js
deleted file mode 100644
index 758a67a..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! jQuery UI styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-jqui', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-jqui')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.min.js
deleted file mode 100644
index dda5f3d..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.jqueryui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- jQuery UI styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-jqui")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.js
deleted file mode 100644
index d6282c4..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Semanic UI styling wrapper for RowGroup
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-se', 'datatables.net-rowgroup'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-se')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.RowGroup ) {
- require('datatables.net-rowgroup')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.min.js b/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.min.js
deleted file mode 100644
index d04c0d2..0000000
--- a/web/DataTables/RowGroup-1.2.0/js/rowGroup.semanticui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Semanic UI styling wrapper for RowGroup
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-se","datatables.net-rowgroup"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-se")(a,b).$);b.fn.dataTable.RowGroup||require("datatables.net-rowgroup")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.css
deleted file mode 100644
index 849a26c..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.css
+++ /dev/null
@@ -1,37 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
-
-div.DTS tbody tr {
- background-color: white;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.min.css
deleted file mode 100644
index 8f7eae8..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}div.DTS tbody tr{background-color:white}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.css
deleted file mode 100644
index ff5791a..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.css
+++ /dev/null
@@ -1,37 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
-
-div.DTS div.dataTables_scrollBody table {
- background-color: white;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.min.css
deleted file mode 100644
index a22cb2f..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap4.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}div.DTS div.dataTables_scrollBody table{background-color:white}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.css
deleted file mode 100644
index ff5791a..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.css
+++ /dev/null
@@ -1,37 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
-
-div.DTS div.dataTables_scrollBody table {
- background-color: white;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.min.css
deleted file mode 100644
index a22cb2f..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bootstrap5.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}div.DTS div.dataTables_scrollBody table{background-color:white}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bulma.css b/web/DataTables/Scroller-2.0.7/css/scroller.bulma.css
deleted file mode 100644
index ce5959d..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bulma.css
+++ /dev/null
@@ -1,33 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.bulma.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.bulma.min.css
deleted file mode 100644
index 08fb958..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.bulma.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.css b/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.css
deleted file mode 100644
index ce5959d..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.css
+++ /dev/null
@@ -1,33 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.min.css
deleted file mode 100644
index 08fb958..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.dataTables.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.foundation.css b/web/DataTables/Scroller-2.0.7/css/scroller.foundation.css
deleted file mode 100644
index 29d3a46..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.foundation.css
+++ /dev/null
@@ -1,17 +0,0 @@
-div.DTS tbody th,
-div.DTS tbody td {
- white-space: nowrap;
-}
-div.DTS div.DTS_Loading {
- z-index: 1;
-}
-div.DTS div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.DTS div.dataTables_scrollBody table {
- z-index: 2;
-}
-div.DTS div.dataTables_paginate,
-div.DTS div.dataTables_length {
- display: none;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.foundation.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.foundation.min.css
deleted file mode 100644
index 0c83fee..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.foundation.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.css b/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.css
deleted file mode 100644
index ce5959d..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.css
+++ /dev/null
@@ -1,33 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.min.css
deleted file mode 100644
index 08fb958..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.jqueryui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.css b/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.css
deleted file mode 100644
index ce5959d..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.css
+++ /dev/null
@@ -1,33 +0,0 @@
-div.dts {
- display: block !important;
-}
-div.dts tbody th,
-div.dts tbody td {
- white-space: nowrap;
-}
-div.dts div.dts_loading {
- z-index: 1;
-}
-div.dts div.dts_label {
- position: absolute;
- right: 10px;
- background: rgba(0, 0, 0, 0.8);
- color: white;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
- text-align: right;
- border-radius: 3px;
- padding: 0.4em;
- z-index: 2;
- display: none;
-}
-div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
-}
-div.dts div.dataTables_scrollBody table {
- background-color: white;
- z-index: 2;
-}
-div.dts div.dataTables_paginate,
-div.dts div.dataTables_length {
- display: none;
-}
diff --git a/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.min.css b/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.min.css
deleted file mode 100644
index 08fb958..0000000
--- a/web/DataTables/Scroller-2.0.7/css/scroller.semanticui.min.css
+++ /dev/null
@@ -1 +0,0 @@
-div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{background-color:white;z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}
diff --git a/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.js b/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.js
deleted file mode 100644
index 49de620..0000000
--- a/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.js
+++ /dev/null
@@ -1,1322 +0,0 @@
-/*! Scroller 2.0.7
- * ©2011-2022 SpryMedia Ltd - datatables.net/license
- */
-
-/**
- * @summary Scroller
- * @description Virtual rendering for DataTables
- * @version 2.0.7
- * @author SpryMedia Ltd (www.sprymedia.co.uk)
- * @contact www.sprymedia.co.uk/contact
- * @copyright SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license/mit
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net')(root, $).$;
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-'use strict';
-var DataTable = $.fn.dataTable;
-
-
-/**
- * Scroller is a virtual rendering plug-in for DataTables which allows large
- * datasets to be drawn on screen every quickly. What the virtual rendering means
- * is that only the visible portion of the table (and a bit to either side to make
- * the scrolling smooth) is drawn, while the scrolling container gives the
- * visual impression that the whole table is visible. This is done by making use
- * of the pagination abilities of DataTables and moving the table around in the
- * scrolling container DataTables adds to the page. The scrolling container is
- * forced to the height it would be for the full table display using an extra
- * element.
- *
- * Note that rows in the table MUST all be the same height. Information in a cell
- * which expands on to multiple lines will cause some odd behaviour in the scrolling.
- *
- * Scroller is initialised by simply including the letter 'S' in the sDom for the
- * table you want to have this feature enabled on. Note that the 'S' must come
- * AFTER the 't' parameter in `dom`.
- *
- * Key features include:
- *
- * - Speed! The aim of Scroller for DataTables is to make rendering large data sets fast
- * - Full compatibility with deferred rendering in DataTables for maximum speed
- * - Display millions of rows
- * - Integration with state saving in DataTables (scrolling position is saved)
- * - Easy to use
- *
- *
- * @class
- * @constructor
- * @global
- * @param {object} dt DataTables settings object or API instance
- * @param {object} [opts={}] Configuration object for Scroller. Options
- * are defined by {@link Scroller.defaults}
- *
- * @requires jQuery 1.7+
- * @requires DataTables 1.10.0+
- *
- * @example
- * $(document).ready(function() {
- * $('#example').DataTable( {
- * "scrollY": "200px",
- * "ajax": "media/dataset/large.txt",
- * "scroller": true,
- * "deferRender": true
- * } );
- * } );
- */
-var Scroller = function ( dt, opts ) {
- /* Sanity check - you just know it will happen */
- if ( ! (this instanceof Scroller) ) {
- alert( "Scroller warning: Scroller must be initialised with the 'new' keyword." );
- return;
- }
-
- if ( opts === undefined ) {
- opts = {};
- }
-
- var dtApi = $.fn.dataTable.Api( dt );
-
- /**
- * Settings object which contains customisable information for the Scroller instance
- * @namespace
- * @private
- * @extends Scroller.defaults
- */
- this.s = {
- /**
- * DataTables settings object
- * @type object
- * @default Passed in as first parameter to constructor
- */
- dt: dtApi.settings()[0],
-
- /**
- * DataTables API instance
- * @type DataTable.Api
- */
- dtApi: dtApi,
-
- /**
- * Pixel location of the top of the drawn table in the viewport
- * @type int
- * @default 0
- */
- tableTop: 0,
-
- /**
- * Pixel location of the bottom of the drawn table in the viewport
- * @type int
- * @default 0
- */
- tableBottom: 0,
-
- /**
- * Pixel location of the boundary for when the next data set should be loaded and drawn
- * when scrolling up the way.
- * @type int
- * @default 0
- * @private
- */
- redrawTop: 0,
-
- /**
- * Pixel location of the boundary for when the next data set should be loaded and drawn
- * when scrolling down the way. Note that this is actually calculated as the offset from
- * the top.
- * @type int
- * @default 0
- * @private
- */
- redrawBottom: 0,
-
- /**
- * Auto row height or not indicator
- * @type bool
- * @default 0
- */
- autoHeight: true,
-
- /**
- * Number of rows calculated as visible in the visible viewport
- * @type int
- * @default 0
- */
- viewportRows: 0,
-
- /**
- * setTimeout reference for state saving, used when state saving is enabled in the DataTable
- * and when the user scrolls the viewport in order to stop the cookie set taking too much
- * CPU!
- * @type int
- * @default 0
- */
- stateTO: null,
-
- stateSaveThrottle: function () {},
-
- /**
- * setTimeout reference for the redraw, used when server-side processing is enabled in the
- * DataTables in order to prevent DoSing the server
- * @type int
- * @default null
- */
- drawTO: null,
-
- heights: {
- jump: null,
- page: null,
- virtual: null,
- scroll: null,
-
- /**
- * Height of rows in the table
- * @type int
- * @default 0
- */
- row: null,
-
- /**
- * Pixel height of the viewport
- * @type int
- * @default 0
- */
- viewport: null,
- labelHeight: 0,
- xbar: 0
- },
-
- topRowFloat: 0,
- scrollDrawDiff: null,
- loaderVisible: false,
- forceReposition: false,
- baseRowTop: 0,
- baseScrollTop: 0,
- mousedown: false,
- lastScrollTop: 0
- };
-
- // @todo The defaults should extend a `c` property and the internal settings
- // only held in the `s` property. At the moment they are mixed
- this.s = $.extend( this.s, Scroller.oDefaults, opts );
-
- // Workaround for row height being read from height object (see above comment)
- this.s.heights.row = this.s.rowHeight;
-
- /**
- * DOM elements used by the class instance
- * @private
- * @namespace
- *
- */
- this.dom = {
- "force": document.createElement('div'),
- "label": $('0
'),
- "scroller": null,
- "table": null,
- "loader": null
- };
-
- // Attach the instance to the DataTables instance so it can be accessed in
- // future. Don't initialise Scroller twice on the same table
- if ( this.s.dt.oScroller ) {
- return;
- }
-
- this.s.dt.oScroller = this;
-
- /* Let's do it */
- this.construct();
-};
-
-
-
-$.extend( Scroller.prototype, {
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public methods - to be exposed via the DataTables API
- */
-
- /**
- * Calculate and store information about how many rows are to be displayed
- * in the scrolling viewport, based on current dimensions in the browser's
- * rendering. This can be particularly useful if the table is initially
- * drawn in a hidden element - for example in a tab.
- * @param {bool} [redraw=true] Redraw the table automatically after the recalculation, with
- * the new dimensions forming the basis for the draw.
- * @returns {void}
- */
- measure: function ( redraw )
- {
- if ( this.s.autoHeight )
- {
- this._calcRowHeight();
- }
-
- var heights = this.s.heights;
-
- if ( heights.row ) {
- heights.viewport = this._parseHeight($(this.dom.scroller).css('max-height'));
-
- this.s.viewportRows = parseInt( heights.viewport / heights.row, 10 )+1;
- this.s.dt._iDisplayLength = this.s.viewportRows * this.s.displayBuffer;
- }
-
- var label = this.dom.label.outerHeight();
-
- heights.xbar = this.dom.scroller.offsetHeight - this.dom.scroller.clientHeight;
- heights.labelHeight = label;
-
- if ( redraw === undefined || redraw )
- {
- this.s.dt.oInstance.fnDraw( false );
- }
- },
-
- /**
- * Get information about current displayed record range. This corresponds to
- * the information usually displayed in the "Info" block of the table.
- *
- * @returns {object} info as an object:
- * {
- * start: {int}, // the 0-indexed record at the top of the viewport
- * end: {int}, // the 0-indexed record at the bottom of the viewport
- * }
- */
- pageInfo: function()
- {
- var
- dt = this.s.dt,
- iScrollTop = this.dom.scroller.scrollTop,
- iTotal = dt.fnRecordsDisplay(),
- iPossibleEnd = Math.ceil(this.pixelsToRow(iScrollTop + this.s.heights.viewport, false, this.s.ani));
-
- return {
- start: Math.floor(this.pixelsToRow(iScrollTop, false, this.s.ani)),
- end: iTotal < iPossibleEnd ? iTotal-1 : iPossibleEnd-1
- };
- },
-
- /**
- * Calculate the row number that will be found at the given pixel position
- * (y-scroll).
- *
- * Please note that when the height of the full table exceeds 1 million
- * pixels, Scroller switches into a non-linear mode for the scrollbar to fit
- * all of the records into a finite area, but this function returns a linear
- * value (relative to the last non-linear positioning).
- * @param {int} pixels Offset from top to calculate the row number of
- * @param {int} [intParse=true] If an integer value should be returned
- * @param {int} [virtual=false] Perform the calculations in the virtual domain
- * @returns {int} Row index
- */
- pixelsToRow: function ( pixels, intParse, virtual )
- {
- var diff = pixels - this.s.baseScrollTop;
- var row = virtual ?
- (this._domain( 'physicalToVirtual', this.s.baseScrollTop ) + diff) / this.s.heights.row :
- ( diff / this.s.heights.row ) + this.s.baseRowTop;
-
- return intParse || intParse === undefined ?
- parseInt( row, 10 ) :
- row;
- },
-
- /**
- * Calculate the pixel position from the top of the scrolling container for
- * a given row
- * @param {int} iRow Row number to calculate the position of
- * @returns {int} Pixels
- */
- rowToPixels: function ( rowIdx, intParse, virtual )
- {
- var pixels;
- var diff = rowIdx - this.s.baseRowTop;
-
- if ( virtual ) {
- pixels = this._domain( 'virtualToPhysical', this.s.baseScrollTop );
- pixels += diff * this.s.heights.row;
- }
- else {
- pixels = this.s.baseScrollTop;
- pixels += diff * this.s.heights.row;
- }
-
- return intParse || intParse === undefined ?
- parseInt( pixels, 10 ) :
- pixels;
- },
-
-
- /**
- * Calculate the row number that will be found at the given pixel position (y-scroll)
- * @param {int} row Row index to scroll to
- * @param {bool} [animate=true] Animate the transition or not
- * @returns {void}
- */
- scrollToRow: function ( row, animate )
- {
- var that = this;
- var ani = false;
- var px = this.rowToPixels( row );
-
- // We need to know if the table will redraw or not before doing the
- // scroll. If it will not redraw, then we need to use the currently
- // displayed table, and scroll with the physical pixels. Otherwise, we
- // need to calculate the table's new position from the virtual
- // transform.
- var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows;
- var drawRow = row - preRows;
- if ( drawRow < 0 ) {
- drawRow = 0;
- }
-
- if ( (px > this.s.redrawBottom || px < this.s.redrawTop) && this.s.dt._iDisplayStart !== drawRow ) {
- ani = true;
- px = this._domain( 'virtualToPhysical', row * this.s.heights.row );
-
- // If we need records outside the current draw region, but the new
- // scrolling position is inside that (due to the non-linear nature
- // for larger numbers of records), we need to force position update.
- if ( this.s.redrawTop < px && px < this.s.redrawBottom ) {
- this.s.forceReposition = true;
- animate = false;
- }
- }
-
- if ( animate === undefined || animate )
- {
- this.s.ani = ani;
- $(this.dom.scroller).animate( {
- "scrollTop": px
- }, function () {
- // This needs to happen after the animation has completed and
- // the final scroll event fired
- setTimeout( function () {
- that.s.ani = false;
- }, 250 );
- } );
- }
- else
- {
- $(this.dom.scroller).scrollTop( px );
- }
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constructor
- */
-
- /**
- * Initialisation for Scroller
- * @returns {void}
- * @private
- */
- construct: function ()
- {
- var that = this;
- var dt = this.s.dtApi;
-
- /* Sanity check */
- if ( !this.s.dt.oFeatures.bPaginate ) {
- this.s.dt.oApi._fnLog( this.s.dt, 0, 'Pagination must be enabled for Scroller' );
- return;
- }
-
- /* Insert a div element that we can use to force the DT scrolling container to
- * the height that would be required if the whole table was being displayed
- */
- this.dom.force.style.position = "relative";
- this.dom.force.style.top = "0px";
- this.dom.force.style.left = "0px";
- this.dom.force.style.width = "1px";
-
- this.dom.scroller = $('div.'+this.s.dt.oClasses.sScrollBody, this.s.dt.nTableWrapper)[0];
- this.dom.scroller.appendChild( this.dom.force );
- this.dom.scroller.style.position = "relative";
-
- this.dom.table = $('>table', this.dom.scroller)[0];
- this.dom.table.style.position = "absolute";
- this.dom.table.style.top = "0px";
- this.dom.table.style.left = "0px";
-
- // Add class to 'announce' that we are a Scroller table
- $(dt.table().container()).addClass('dts DTS');
-
- // Add a 'loading' indicator
- if ( this.s.loadingIndicator )
- {
- this.dom.loader = $(''+this.s.dt.oLanguage.sLoadingRecords+'
')
- .css('display', 'none');
-
- $(this.dom.scroller.parentNode)
- .css('position', 'relative')
- .append( this.dom.loader );
- }
-
- this.dom.label.appendTo(this.dom.scroller);
-
- /* Initial size calculations */
- if ( this.s.heights.row && this.s.heights.row != 'auto' )
- {
- this.s.autoHeight = false;
- }
-
- // Scrolling callback to see if a page change is needed
- this.s.ingnoreScroll = true;
- $(this.dom.scroller).on( 'scroll.dt-scroller', function (e) {
- that._scroll.call( that );
- } );
-
- // In iOS we catch the touchstart event in case the user tries to scroll
- // while the display is already scrolling
- $(this.dom.scroller).on('touchstart.dt-scroller', function () {
- that._scroll.call( that );
- } );
-
- $(this.dom.scroller)
- .on('mousedown.dt-scroller', function () {
- that.s.mousedown = true;
- })
- .on('mouseup.dt-scroller', function () {
- that.s.labelVisible = false;
- that.s.mousedown = false;
- that.dom.label.css('display', 'none');
- });
-
- // On resize, update the information element, since the number of rows shown might change
- $(window).on( 'resize.dt-scroller', function () {
- that.measure( false );
- that._info();
- } );
-
- // Add a state saving parameter to the DT state saving so we can restore the exact
- // position of the scrolling.
- var initialStateSave = true;
- var loadedState = dt.state.loaded();
-
- dt.on( 'stateSaveParams.scroller', function ( e, settings, data ) {
- if ( initialStateSave && loadedState ) {
- data.scroller = loadedState.scroller;
- initialStateSave = false;
-
- if (data.scroller) {
- that.s.lastScrollTop = data.scroller.scrollTop;
- }
- }
- else {
- // Need to used the saved position on init
- data.scroller = {
- topRow: that.s.topRowFloat,
- baseScrollTop: that.s.baseScrollTop,
- baseRowTop: that.s.baseRowTop,
- scrollTop: that.s.lastScrollTop
- };
- }
- } );
-
- dt.on( 'stateLoadParams.scroller', function( e, settings, data ) {
- if (data.scroller !== undefined) {
- that.scrollToRow(data.scroller.topRow);
- }
- });
-
- if ( loadedState && loadedState.scroller ) {
- this.s.topRowFloat = loadedState.scroller.topRow;
- this.s.baseScrollTop = loadedState.scroller.baseScrollTop;
- this.s.baseRowTop = loadedState.scroller.baseRowTop;
- }
-
- this.measure( false );
-
- that.s.stateSaveThrottle = that.s.dt.oApi._fnThrottle( function () {
- that.s.dtApi.state.save();
- }, 500 );
-
- dt.on( 'init.scroller', function () {
- that.measure( false );
-
- // Setting to `jump` will instruct _draw to calculate the scroll top
- // position
- that.s.scrollType = 'jump';
- that._draw();
-
- // Update the scroller when the DataTable is redrawn
- dt.on( 'draw.scroller', function () {
- that._draw();
- });
- } );
-
- // Set height before the draw happens, allowing everything else to update
- // on draw complete without worry for roder.
- dt.on( 'preDraw.dt.scroller', function () {
- that._scrollForce();
- } );
-
- // Destructor
- dt.on( 'destroy.scroller', function () {
- $(window).off( 'resize.dt-scroller' );
- $(that.dom.scroller).off('.dt-scroller');
- $(that.s.dt.nTable).off( '.scroller' );
-
- $(that.s.dt.nTableWrapper).removeClass('DTS');
- $('div.DTS_Loading', that.dom.scroller.parentNode).remove();
-
- that.dom.table.style.position = "";
- that.dom.table.style.top = "";
- that.dom.table.style.left = "";
- } );
- },
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods
- */
-
- /**
- * Automatic calculation of table row height. This is just a little tricky here as using
- * initialisation DataTables has tale the table out of the document, so we need to create
- * a new table and insert it into the document, calculate the row height and then whip the
- * table out.
- * @returns {void}
- * @private
- */
- _calcRowHeight: function ()
- {
- var dt = this.s.dt;
- var origTable = dt.nTable;
- var nTable = origTable.cloneNode( false );
- var tbody = $('').appendTo( nTable );
- var container = $(
- ''
- );
-
- // Want 3 rows in the sizing table so :first-child and :last-child
- // CSS styles don't come into play - take the size of the middle row
- $('tbody tr:lt(4)', origTable).clone().appendTo( tbody );
- var rowsCount = $('tr', tbody).length;
-
- if ( rowsCount === 1 ) {
- tbody.prepend('| |
');
- tbody.append('| |
');
- }
- else {
- for (; rowsCount < 3; rowsCount++) {
- tbody.append('| |
');
- }
- }
-
- $('div.'+dt.oClasses.sScrollBody, container).append( nTable );
-
- // If initialised using `dom`, use the holding element as the insert point
- var insertEl = this.s.dt.nHolding || origTable.parentNode;
-
- if ( ! $(insertEl).is(':visible') ) {
- insertEl = 'body';
- }
-
- // Remove form element links as they might select over others (particularly radio and checkboxes)
- container.find("input").removeAttr("name");
-
- container.appendTo( insertEl );
- this.s.heights.row = $('tr', tbody).eq(1).outerHeight();
-
- container.remove();
- },
-
- /**
- * Draw callback function which is fired when the DataTable is redrawn. The main function of
- * this method is to position the drawn table correctly the scrolling container for the rows
- * that is displays as a result of the scrolling position.
- * @returns {void}
- * @private
- */
- _draw: function ()
- {
- var
- that = this,
- heights = this.s.heights,
- iScrollTop = this.dom.scroller.scrollTop,
- iTableHeight = $(this.s.dt.nTable).height(),
- displayStart = this.s.dt._iDisplayStart,
- displayLen = this.s.dt._iDisplayLength,
- displayEnd = this.s.dt.fnRecordsDisplay();
-
- // Disable the scroll event listener while we are updating the DOM
- this.s.skip = true;
-
- // If paging is reset
- if ( (this.s.dt.bSorted || this.s.dt.bFiltered) && displayStart === 0 && !this.s.dt._drawHold ) {
- this.s.topRowFloat = 0;
- }
-
- iScrollTop = this.s.scrollType === 'jump' ?
- this._domain( 'virtualToPhysical', this.s.topRowFloat * heights.row ) :
- iScrollTop;
-
- // Store positional information so positional calculations can be based
- // upon the current table draw position
- this.s.baseScrollTop = iScrollTop;
- this.s.baseRowTop = this.s.topRowFloat;
-
- // Position the table in the virtual scroller
- var tableTop = iScrollTop - ((this.s.topRowFloat - displayStart) * heights.row);
- if ( displayStart === 0 ) {
- tableTop = 0;
- }
- else if ( displayStart + displayLen >= displayEnd ) {
- tableTop = heights.scroll - iTableHeight;
- }
-
- this.dom.table.style.top = tableTop+'px';
-
- /* Cache some information for the scroller */
- this.s.tableTop = tableTop;
- this.s.tableBottom = iTableHeight + this.s.tableTop;
-
- // Calculate the boundaries for where a redraw will be triggered by the
- // scroll event listener
- var boundaryPx = (iScrollTop - this.s.tableTop) * this.s.boundaryScale;
- this.s.redrawTop = iScrollTop - boundaryPx;
- this.s.redrawBottom = iScrollTop + boundaryPx > heights.scroll - heights.viewport - heights.row ?
- heights.scroll - heights.viewport - heights.row :
- iScrollTop + boundaryPx;
-
- this.s.skip = false;
-
- if(that.s.ingnoreScroll) {
- // Restore the scrolling position that was saved by DataTable's state
- // saving Note that this is done on the second draw when data is Ajax
- // sourced, and the first draw when DOM soured
- if ( this.s.dt.oFeatures.bStateSave && this.s.dt.oLoadedState !== null &&
- typeof this.s.dt.oLoadedState.scroller != 'undefined' )
- {
- // A quirk of DataTables is that the draw callback will occur on an
- // empty set if Ajax sourced, but not if server-side processing.
- var ajaxSourced = (this.s.dt.sAjaxSource || that.s.dt.ajax) && ! this.s.dt.oFeatures.bServerSide ?
- true :
- false;
-
- if ( ( ajaxSourced && this.s.dt.iDraw >= 2) ||
- (!ajaxSourced && this.s.dt.iDraw >= 1) )
- {
- setTimeout( function () {
- $(that.dom.scroller).scrollTop( that.s.dt.oLoadedState.scroller.scrollTop );
-
- // In order to prevent layout thrashing we need another
- // small delay
- setTimeout( function () {
- that.s.ingnoreScroll = false;
- }, 0 );
- }, 0 );
- }
- }
- else {
- that.s.ingnoreScroll = false;
- }
- }
-
-
- // Because of the order of the DT callbacks, the info update will
- // take precedence over the one we want here. So a 'thread' break is
- // needed. Only add the thread break if bInfo is set
- if ( this.s.dt.oFeatures.bInfo ) {
- setTimeout( function () {
- that._info.call( that );
- }, 0 );
- }
-
- $(this.s.dt.nTable).triggerHandler('position.dts.dt', tableTop);
-
- // Hide the loading indicator
- if ( this.dom.loader && this.s.loaderVisible ) {
- this.dom.loader.css( 'display', 'none' );
- this.s.loaderVisible = false;
- }
- },
-
- /**
- * Convert from one domain to another. The physical domain is the actual
- * pixel count on the screen, while the virtual is if we had browsers which
- * had scrolling containers of infinite height (i.e. the absolute value)
- *
- * @param {string} dir Domain transform direction, `virtualToPhysical` or
- * `physicalToVirtual`
- * @returns {number} Calculated transform
- * @private
- */
- _domain: function ( dir, val )
- {
- var heights = this.s.heights;
- var diff;
- var magic = 10000; // the point at which the non-linear calculations start to happen
-
- // If the virtual and physical height match, then we use a linear
- // transform between the two, allowing the scrollbar to be linear
- if ( heights.virtual === heights.scroll ) {
- return val;
- }
-
- // In the first 10k pixels and the last 10k pixels, we want the scrolling
- // to be linear. After that it can be non-linear. It would be unusual for
- // anyone to mouse wheel through that much.
- if ( val < magic ) {
- return val;
- }
- else if ( dir === 'virtualToPhysical' && val >= heights.virtual - magic ) {
- diff = heights.virtual - val;
- return heights.scroll - diff;
- }
- else if ( dir === 'physicalToVirtual' && val >= heights.scroll - magic ) {
- diff = heights.scroll - val;
- return heights.virtual - diff;
- }
-
- // Otherwise, we want a non-linear scrollbar to take account of the
- // redrawing regions at the start and end of the table, otherwise these
- // can stutter badly - on large tables 30px (for example) scroll might
- // be hundreds of rows, so the table would be redrawing every few px at
- // the start and end. Use a simple linear eq. to stop this, effectively
- // causing a kink in the scrolling ratio. It does mean the scrollbar is
- // non-linear, but with such massive data sets, the scrollbar is going
- // to be a best guess anyway
- var m = (heights.virtual - magic - magic) / (heights.scroll - magic - magic);
- var c = magic - (m*magic);
-
- return dir === 'virtualToPhysical' ?
- (val-c) / m :
- (m*val) + c;
- },
-
- /**
- * Update any information elements that are controlled by the DataTable based on the scrolling
- * viewport and what rows are visible in it. This function basically acts in the same way as
- * _fnUpdateInfo in DataTables, and effectively replaces that function.
- * @returns {void}
- * @private
- */
- _info: function ()
- {
- if ( !this.s.dt.oFeatures.bInfo )
- {
- return;
- }
-
- var
- dt = this.s.dt,
- language = dt.oLanguage,
- iScrollTop = this.dom.scroller.scrollTop,
- iStart = Math.floor( this.pixelsToRow(iScrollTop, false, this.s.ani)+1 ),
- iMax = dt.fnRecordsTotal(),
- iTotal = dt.fnRecordsDisplay(),
- iPossibleEnd = Math.ceil( this.pixelsToRow(iScrollTop+this.s.heights.viewport, false, this.s.ani) ),
- iEnd = iTotal < iPossibleEnd ? iTotal : iPossibleEnd,
- sStart = dt.fnFormatNumber( iStart ),
- sEnd = dt.fnFormatNumber( iEnd ),
- sMax = dt.fnFormatNumber( iMax ),
- sTotal = dt.fnFormatNumber( iTotal ),
- sOut;
-
- if ( dt.fnRecordsDisplay() === 0 &&
- dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
- {
- /* Empty record set */
- sOut = language.sInfoEmpty+ language.sInfoPostFix;
- }
- else if ( dt.fnRecordsDisplay() === 0 )
- {
- /* Empty record set after filtering */
- sOut = language.sInfoEmpty +' '+
- language.sInfoFiltered.replace('_MAX_', sMax)+
- language.sInfoPostFix;
- }
- else if ( dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
- {
- /* Normal record set */
- sOut = language.sInfo.
- replace('_START_', sStart).
- replace('_END_', sEnd).
- replace('_MAX_', sMax).
- replace('_TOTAL_', sTotal)+
- language.sInfoPostFix;
- }
- else
- {
- /* Record set after filtering */
- sOut = language.sInfo.
- replace('_START_', sStart).
- replace('_END_', sEnd).
- replace('_MAX_', sMax).
- replace('_TOTAL_', sTotal) +' '+
- language.sInfoFiltered.replace(
- '_MAX_',
- dt.fnFormatNumber(dt.fnRecordsTotal())
- )+
- language.sInfoPostFix;
- }
-
- var callback = language.fnInfoCallback;
- if ( callback ) {
- sOut = callback.call( dt.oInstance,
- dt, iStart, iEnd, iMax, iTotal, sOut
- );
- }
-
- var n = dt.aanFeatures.i;
- if ( typeof n != 'undefined' )
- {
- for ( var i=0, iLen=n.length ; i heights.viewport ?
- 'jump' :
- 'cont';
-
- this.s.topRowFloat = this.s.scrollType === 'cont' ?
- this.pixelsToRow( iScrollTop, false, false ) :
- this._domain( 'physicalToVirtual', iScrollTop ) / heights.row;
-
- if ( this.s.topRowFloat < 0 ) {
- this.s.topRowFloat = 0;
- }
-
- /* Check if the scroll point is outside the trigger boundary which would required
- * a DataTables redraw
- */
- if ( this.s.forceReposition || iScrollTop < this.s.redrawTop || iScrollTop > this.s.redrawBottom ) {
- var preRows = Math.ceil( ((this.s.displayBuffer-1)/2) * this.s.viewportRows );
-
- iTopRow = parseInt(this.s.topRowFloat, 10) - preRows;
- this.s.forceReposition = false;
-
- if ( iTopRow <= 0 ) {
- /* At the start of the table */
- iTopRow = 0;
- }
- else if ( iTopRow + this.s.dt._iDisplayLength > this.s.dt.fnRecordsDisplay() ) {
- /* At the end of the table */
- iTopRow = this.s.dt.fnRecordsDisplay() - this.s.dt._iDisplayLength;
- if ( iTopRow < 0 ) {
- iTopRow = 0;
- }
- }
- else if ( iTopRow % 2 !== 0 ) {
- // For the row-striping classes (odd/even) we want only to start
- // on evens otherwise the stripes will change between draws and
- // look rubbish
- iTopRow++;
- }
-
- // Store calcuated value, in case the following condition is not met, but so
- // that the draw function will still use it.
- this.s.targetTop = iTopRow;
-
- if ( iTopRow != this.s.dt._iDisplayStart ) {
- /* Cache the new table position for quick lookups */
- this.s.tableTop = $(this.s.dt.nTable).offset().top;
- this.s.tableBottom = $(this.s.dt.nTable).height() + this.s.tableTop;
-
- var draw = function () {
- that.s.dt._iDisplayStart = that.s.targetTop;
- that.s.dt.oApi._fnDraw( that.s.dt );
- };
-
- /* Do the DataTables redraw based on the calculated start point - note that when
- * using server-side processing we introduce a small delay to not DoS the server...
- */
- if ( this.s.dt.oFeatures.bServerSide ) {
- this.s.forceReposition = true;
-
- clearTimeout( this.s.drawTO );
- this.s.drawTO = setTimeout( draw, this.s.serverWait );
- }
- else {
- draw();
- }
-
- if ( this.dom.loader && ! this.s.loaderVisible ) {
- this.dom.loader.css( 'display', 'block' );
- this.s.loaderVisible = true;
- }
- }
- }
- else {
- this.s.topRowFloat = this.pixelsToRow( iScrollTop, false, true );
- }
-
- this.s.lastScrollTop = iScrollTop;
- this.s.stateSaveThrottle();
-
- if ( this.s.scrollType === 'jump' && this.s.mousedown ) {
- this.s.labelVisible = true;
- }
- if (this.s.labelVisible) {
- var labelFactor = (heights.viewport-heights.labelHeight - heights.xbar) / heights.scroll;
-
- this.dom.label
- .html( this.s.dt.fnFormatNumber( parseInt( this.s.topRowFloat, 10 )+1 ) )
- .css( 'top', iScrollTop + (iScrollTop * labelFactor) )
- .css( 'right', 10 - this.dom.scroller.scrollLeft)
- .css( 'display', 'block' );
- }
- },
-
- /**
- * Force the scrolling container to have height beyond that of just the
- * table that has been drawn so the user can scroll the whole data set.
- *
- * Note that if the calculated required scrolling height exceeds a maximum
- * value (1 million pixels - hard-coded) the forcing element will be set
- * only to that maximum value and virtual / physical domain transforms will
- * be used to allow Scroller to display tables of any number of records.
- * @returns {void}
- * @private
- */
- _scrollForce: function ()
- {
- var heights = this.s.heights;
- var max = 1000000;
-
- heights.virtual = heights.row * this.s.dt.fnRecordsDisplay();
- heights.scroll = heights.virtual;
-
- if ( heights.scroll > max ) {
- heights.scroll = max;
- }
-
- // Minimum height so there is always a row visible (the 'no rows found'
- // if reduced to zero filtering)
- this.dom.force.style.height = heights.scroll > this.s.heights.row ?
- heights.scroll+'px' :
- this.s.heights.row+'px';
- }
-} );
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Statics
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-
-/**
- * Scroller default settings for initialisation
- * @namespace
- * @name Scroller.defaults
- * @static
- */
-Scroller.defaults = {
- /**
- * Scroller uses the boundary scaling factor to decide when to redraw the table - which it
- * typically does before you reach the end of the currently loaded data set (in order to
- * allow the data to look continuous to a user scrolling through the data). If given as 0
- * then the table will be redrawn whenever the viewport is scrolled, while 1 would not
- * redraw the table until the currently loaded data has all been shown. You will want
- * something in the middle - the default factor of 0.5 is usually suitable.
- * @type float
- * @default 0.5
- * @static
- */
- boundaryScale: 0.5,
-
- /**
- * The display buffer is what Scroller uses to calculate how many rows it should pre-fetch
- * for scrolling. Scroller automatically adjusts DataTables' display length to pre-fetch
- * rows that will be shown in "near scrolling" (i.e. just beyond the current display area).
- * The value is based upon the number of rows that can be displayed in the viewport (i.e.
- * a value of 1), and will apply the display range to records before before and after the
- * current viewport - i.e. a factor of 3 will allow Scroller to pre-fetch 1 viewport's worth
- * of rows before the current viewport, the current viewport's rows and 1 viewport's worth
- * of rows after the current viewport. Adjusting this value can be useful for ensuring
- * smooth scrolling based on your data set.
- * @type int
- * @default 7
- * @static
- */
- displayBuffer: 9,
-
- /**
- * Show (or not) the loading element in the background of the table. Note that you should
- * include the dataTables.scroller.css file for this to be displayed correctly.
- * @type boolean
- * @default false
- * @static
- */
- loadingIndicator: false,
-
- /**
- * Scroller will attempt to automatically calculate the height of rows for it's internal
- * calculations. However the height that is used can be overridden using this parameter.
- * @type int|string
- * @default auto
- * @static
- */
- rowHeight: "auto",
-
- /**
- * When using server-side processing, Scroller will wait a small amount of time to allow
- * the scrolling to finish before requesting more data from the server. This prevents
- * you from DoSing your own server! The wait time can be configured by this parameter.
- * @type int
- * @default 200
- * @static
- */
- serverWait: 200
-};
-
-Scroller.oDefaults = Scroller.defaults;
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constants
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/**
- * Scroller version
- * @type String
- * @default See code
- * @name Scroller.version
- * @static
- */
-Scroller.version = "2.0.7";
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Initialisation
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-// Attach a listener to the document which listens for DataTables initialisation
-// events so we can automatically initialise
-$(document).on( 'preInit.dt.dtscroller', function (e, settings) {
- if ( e.namespace !== 'dt' ) {
- return;
- }
-
- var init = settings.oInit.scroller;
- var defaults = DataTable.defaults.scroller;
-
- if ( init || defaults ) {
- var opts = $.extend( {}, init, defaults );
-
- if ( init !== false ) {
- new Scroller( settings, opts );
- }
- }
-} );
-
-
-// Attach Scroller to DataTables so it can be accessed as an 'extra'
-$.fn.dataTable.Scroller = Scroller;
-$.fn.DataTable.Scroller = Scroller;
-
-
-// DataTables 1.10 API method aliases
-var Api = $.fn.dataTable.Api;
-
-Api.register( 'scroller()', function () {
- return this;
-} );
-
-// Undocumented and deprecated - is it actually useful at all?
-Api.register( 'scroller().rowToPixels()', function ( rowIdx, intParse, virtual ) {
- var ctx = this.context;
-
- if ( ctx.length && ctx[0].oScroller ) {
- return ctx[0].oScroller.rowToPixels( rowIdx, intParse, virtual );
- }
- // undefined
-} );
-
-// Undocumented and deprecated - is it actually useful at all?
-Api.register( 'scroller().pixelsToRow()', function ( pixels, intParse, virtual ) {
- var ctx = this.context;
-
- if ( ctx.length && ctx[0].oScroller ) {
- return ctx[0].oScroller.pixelsToRow( pixels, intParse, virtual );
- }
- // undefined
-} );
-
-// `scroller().scrollToRow()` is undocumented and deprecated. Use `scroller.toPosition()
-Api.register( ['scroller().scrollToRow()', 'scroller.toPosition()'], function ( idx, ani ) {
- this.iterator( 'table', function ( ctx ) {
- if ( ctx.oScroller ) {
- ctx.oScroller.scrollToRow( idx, ani );
- }
- } );
-
- return this;
-} );
-
-Api.register( 'row().scrollTo()', function ( ani ) {
- var that = this;
-
- this.iterator( 'row', function ( ctx, rowIdx ) {
- if ( ctx.oScroller ) {
- var displayIdx = that
- .rows( { order: 'applied', search: 'applied' } )
- .indexes()
- .indexOf( rowIdx );
-
- ctx.oScroller.scrollToRow( displayIdx, ani );
- }
- } );
-
- return this;
-} );
-
-Api.register( 'scroller.measure()', function ( redraw ) {
- this.iterator( 'table', function ( ctx ) {
- if ( ctx.oScroller ) {
- ctx.oScroller.measure( redraw );
- }
- } );
-
- return this;
-} );
-
-Api.register( 'scroller.page()', function() {
- var ctx = this.context;
-
- if ( ctx.length && ctx[0].oScroller ) {
- return ctx[0].oScroller.pageInfo();
- }
- // undefined
-} );
-
-return Scroller;
-}));
diff --git a/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.min.js b/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.min.js
deleted file mode 100644
index d304ba9..0000000
--- a/web/DataTables/Scroller-2.0.7/js/dataTables.scroller.min.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*!
- SpryMedia Ltd.
-
- This source file is free software, available under the following license:
- MIT license - http://datatables.net/license/mit
-
- This source file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
-
- For details please refer to: http://www.datatables.net
- Scroller 2.0.7
- ©2011-2022 SpryMedia Ltd - datatables.net/license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,f,g){c instanceof String&&(c=String(c));for(var h=c.length,l=0;l0
'),scroller:null,table:null,loader:null},
-this.s.dt.oScroller||(this.s.dt.oScroller=this,this.construct())):alert("Scroller warning: Scroller must be initialised with the 'new' keyword.")};c.extend(m.prototype,{measure:function(a){this.s.autoHeight&&this._calcRowHeight();var b=this.s.heights;b.row&&(b.viewport=this._parseHeight(c(this.dom.scroller).css("max-height")),this.s.viewportRows=parseInt(b.viewport/b.row,10)+1,this.s.dt._iDisplayLength=this.s.viewportRows*this.s.displayBuffer);var d=this.dom.label.outerHeight();b.xbar=this.dom.scroller.offsetHeight-
-this.dom.scroller.clientHeight;b.labelHeight=d;(a===h||a)&&this.s.dt.oInstance.fnDraw(!1)},pageInfo:function(){var a=this.dom.scroller.scrollTop,b=this.s.dt.fnRecordsDisplay(),d=Math.ceil(this.pixelsToRow(a+this.s.heights.viewport,!1,this.s.ani));return{start:Math.floor(this.pixelsToRow(a,!1,this.s.ani)),end:bn&&(n=0);(k>this.s.redrawBottom||ktable",this.dom.scroller)[0];this.dom.table.style.position="absolute";this.dom.table.style.top="0px";this.dom.table.style.left="0px";c(b.table().container()).addClass("dts DTS");this.s.loadingIndicator&&(this.dom.loader=c(''+this.s.dt.oLanguage.sLoadingRecords+"
").css("display","none"),c(this.dom.scroller.parentNode).css("position","relative").append(this.dom.loader));this.dom.label.appendTo(this.dom.scroller);
-this.s.heights.row&&"auto"!=this.s.heights.row&&(this.s.autoHeight=!1);this.s.ingnoreScroll=!0;c(this.dom.scroller).on("scroll.dt-scroller",function(k){a._scroll.call(a)});c(this.dom.scroller).on("touchstart.dt-scroller",function(){a._scroll.call(a)});c(this.dom.scroller).on("mousedown.dt-scroller",function(){a.s.mousedown=!0}).on("mouseup.dt-scroller",function(){a.s.labelVisible=!1;a.s.mousedown=!1;a.dom.label.css("display","none")});c(f).on("resize.dt-scroller",function(){a.measure(!1);a._info()});
-var d=!0,e=b.state.loaded();b.on("stateSaveParams.scroller",function(k,n,p){d&&e?(p.scroller=e.scroller,d=!1,p.scroller&&(a.s.lastScrollTop=p.scroller.scrollTop)):p.scroller={topRow:a.s.topRowFloat,baseScrollTop:a.s.baseScrollTop,baseRowTop:a.s.baseRowTop,scrollTop:a.s.lastScrollTop}});b.on("stateLoadParams.scroller",function(k,n,p){p.scroller!==h&&a.scrollToRow(p.scroller.topRow)});e&&e.scroller&&(this.s.topRowFloat=e.scroller.topRow,this.s.baseScrollTop=e.scroller.baseScrollTop,this.s.baseRowTop=
-e.scroller.baseRowTop);this.measure(!1);a.s.stateSaveThrottle=a.s.dt.oApi._fnThrottle(function(){a.s.dtApi.state.save()},500);b.on("init.scroller",function(){a.measure(!1);a.s.scrollType="jump";a._draw();b.on("draw.scroller",function(){a._draw()})});b.on("preDraw.dt.scroller",function(){a._scrollForce()});b.on("destroy.scroller",function(){c(f).off("resize.dt-scroller");c(a.dom.scroller).off(".dt-scroller");c(a.s.dt.nTable).off(".scroller");c(a.s.dt.nTableWrapper).removeClass("DTS");c("div.DTS_Loading",
-a.dom.scroller.parentNode).remove();a.dom.table.style.position="";a.dom.table.style.top="";a.dom.table.style.left=""})}else this.s.dt.oApi._fnLog(this.s.dt,0,"Pagination must be enabled for Scroller")},_calcRowHeight:function(){var a=this.s.dt,b=a.nTable,d=b.cloneNode(!1),e=c("").appendTo(d),k=c('');c("tbody tr:lt(4)",b).clone().appendTo(e);var n=c("tr",
-e).length;if(1===n)e.prepend("| |
"),e.append("| |
");else for(;3>n;n++)e.append("| |
");c("div."+a.oClasses.sScrollBody,k).append(d);a=this.s.dt.nHolding||b.parentNode;c(a).is(":visible")||(a="body");k.find("input").removeAttr("name");k.appendTo(a);this.s.heights.row=c("tr",e).eq(1).outerHeight();k.remove()},_draw:function(){var a=this,b=this.s.heights,d=this.dom.scroller.scrollTop,e=c(this.s.dt.nTable).height(),k=this.s.dt._iDisplayStart,
-n=this.s.dt._iDisplayLength,p=this.s.dt.fnRecordsDisplay();this.s.skip=!0;!this.s.dt.bSorted&&!this.s.dt.bFiltered||0!==k||this.s.dt._drawHold||(this.s.topRowFloat=0);d="jump"===this.s.scrollType?this._domain("virtualToPhysical",this.s.topRowFloat*b.row):d;this.s.baseScrollTop=d;this.s.baseRowTop=this.s.topRowFloat;var r=d-(this.s.topRowFloat-k)*b.row;0===k?r=0:k+n>=p&&(r=b.scroll-e);this.dom.table.style.top=r+"px";this.s.tableTop=r;this.s.tableBottom=e+this.s.tableTop;e=(d-this.s.tableTop)*this.s.boundaryScale;
-this.s.redrawTop=d-e;this.s.redrawBottom=d+e>b.scroll-b.viewport-b.row?b.scroll-b.viewport-b.row:d+e;this.s.skip=!1;a.s.ingnoreScroll&&(this.s.dt.oFeatures.bStateSave&&null!==this.s.dt.oLoadedState&&"undefined"!=typeof this.s.dt.oLoadedState.scroller?((b=!this.s.dt.sAjaxSource&&!a.s.dt.ajax||this.s.dt.oFeatures.bServerSide?!1:!0)&&2<=this.s.dt.iDraw||!b&&1<=this.s.dt.iDraw)&&setTimeout(function(){c(a.dom.scroller).scrollTop(a.s.dt.oLoadedState.scroller.scrollTop);setTimeout(function(){a.s.ingnoreScroll=
-!1},0)},0):a.s.ingnoreScroll=!1);this.s.dt.oFeatures.bInfo&&setTimeout(function(){a._info.call(a)},0);c(this.s.dt.nTable).triggerHandler("position.dts.dt",r);this.dom.loader&&this.s.loaderVisible&&(this.dom.loader.css("display","none"),this.s.loaderVisible=!1)},_domain:function(a,b){var d=this.s.heights;if(d.virtual===d.scroll||1E4>b)return b;if("virtualToPhysical"===a&&b>=d.virtual-1E4)return a=d.virtual-b,d.scroll-a;if("physicalToVirtual"===a&&b>=d.scroll-1E4)return a=d.scroll-b,d.virtual-a;d=(d.virtual-
-1E4-1E4)/(d.scroll-1E4-1E4);var e=1E4-1E4*d;return"virtualToPhysical"===a?(b-e)/d:d*b+e},_info:function(){if(this.s.dt.oFeatures.bInfo){var a=this.s.dt,b=a.oLanguage,d=this.dom.scroller.scrollTop,e=Math.floor(this.pixelsToRow(d,!1,this.s.ani)+1),k=a.fnRecordsTotal(),n=a.fnRecordsDisplay();d=Math.ceil(this.pixelsToRow(d+this.s.heights.viewport,!1,this.s.ani));d=nb.viewport?"jump":"cont";this.s.topRowFloat="cont"===this.s.scrollType?this.pixelsToRow(d,!1,!1):this._domain("physicalToVirtual",d)/b.row;0>this.s.topRowFloat&&(this.s.topRowFloat=0);if(this.s.forceReposition||
-dthis.s.redrawBottom){var e=Math.ceil((this.s.displayBuffer-1)/2*this.s.viewportRows);e=parseInt(this.s.topRowFloat,10)-e;this.s.forceReposition=!1;0>=e?e=0:e+this.s.dt._iDisplayLength>this.s.dt.fnRecordsDisplay()?(e=this.s.dt.fnRecordsDisplay()-this.s.dt._iDisplayLength,0>e&&(e=0)):0!==e%2&&e++;this.s.targetTop=e;e!=this.s.dt._iDisplayStart&&(this.s.tableTop=c(this.s.dt.nTable).offset().top,this.s.tableBottom=c(this.s.dt.nTable).height()+this.s.tableTop,e=function(){a.s.dt._iDisplayStart=
-a.s.targetTop;a.s.dt.oApi._fnDraw(a.s.dt)},this.s.dt.oFeatures.bServerSide?(this.s.forceReposition=!0,clearTimeout(this.s.drawTO),this.s.drawTO=setTimeout(e,this.s.serverWait)):e(),this.dom.loader&&!this.s.loaderVisible&&(this.dom.loader.css("display","block"),this.s.loaderVisible=!0))}else this.s.topRowFloat=this.pixelsToRow(d,!1,!0);this.s.lastScrollTop=d;this.s.stateSaveThrottle();"jump"===this.s.scrollType&&this.s.mousedown&&(this.s.labelVisible=!0);this.s.labelVisible&&(b=(b.viewport-b.labelHeight-
-b.xbar)/b.scroll,this.dom.label.html(this.s.dt.fnFormatNumber(parseInt(this.s.topRowFloat,10)+1)).css("top",d+d*b).css("right",10-this.dom.scroller.scrollLeft).css("display","block"))}},_scrollForce:function(){var a=this.s.heights;a.virtual=a.row*this.s.dt.fnRecordsDisplay();a.scroll=a.virtual;1E6this.s.heights.row?a.scroll+"px":this.s.heights.row+"px"}});m.defaults={boundaryScale:.5,displayBuffer:9,loadingIndicator:!1,rowHeight:"auto",
-serverWait:200};m.oDefaults=m.defaults;m.version="2.0.7";c(g).on("preInit.dt.dtscroller",function(a,b){if("dt"===a.namespace){a=b.oInit.scroller;var d=l.defaults.scroller;if(a||d)d=c.extend({},a,d),!1!==a&&new m(b,d)}});c.fn.dataTable.Scroller=m;c.fn.DataTable.Scroller=m;var q=c.fn.dataTable.Api;q.register("scroller()",function(){return this});q.register("scroller().rowToPixels()",function(a,b,d){var e=this.context;if(e.length&&e[0].oScroller)return e[0].oScroller.rowToPixels(a,b,d)});q.register("scroller().pixelsToRow()",
-function(a,b,d){var e=this.context;if(e.length&&e[0].oScroller)return e[0].oScroller.pixelsToRow(a,b,d)});q.register(["scroller().scrollToRow()","scroller.toPosition()"],function(a,b){this.iterator("table",function(d){d.oScroller&&d.oScroller.scrollToRow(a,b)});return this});q.register("row().scrollTo()",function(a){var b=this;this.iterator("row",function(d,e){d.oScroller&&(e=b.rows({order:"applied",search:"applied"}).indexes().indexOf(e),d.oScroller.scrollToRow(e,a))});return this});q.register("scroller.measure()",
-function(a){this.iterator("table",function(b){b.oScroller&&b.oScroller.measure(a)});return this});q.register("scroller.page()",function(){var a=this.context;if(a.length&&a[0].oScroller)return a[0].oScroller.pageInfo()});return m});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.js
deleted file mode 100644
index fad1f75..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 3 styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.min.js
deleted file mode 100644
index 8894b9e..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 3 styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.js
deleted file mode 100644
index 3a48901..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 4 styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs4', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs4')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.min.js
deleted file mode 100644
index 312d333..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap4.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 4 styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs4")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.js
deleted file mode 100644
index fffec63..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bootstrap 5 styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bs5', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bs5')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.min.js
deleted file mode 100644
index 948c69a..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bootstrap5.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bootstrap 5 styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bs5")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bulma.js b/web/DataTables/Scroller-2.0.7/js/scroller.bulma.js
deleted file mode 100644
index 6a68093..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bulma.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Bulma styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-bulma', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-bulma')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.bulma.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.bulma.min.js
deleted file mode 100644
index 93699da..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.bulma.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Bulma styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bulma","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-bulma")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.js b/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.js
deleted file mode 100644
index fd64afe..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! DataTables styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-dt', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-dt')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.min.js
deleted file mode 100644
index ff6089d..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.dataTables.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- DataTables styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-dt")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.foundation.js b/web/DataTables/Scroller-2.0.7/js/scroller.foundation.js
deleted file mode 100644
index 7c7aa9b..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.foundation.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Foundation styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-zf', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-zf')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.foundation.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.foundation.min.js
deleted file mode 100644
index 235b698..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.foundation.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Foundation styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-zf")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.js b/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.js
deleted file mode 100644
index 421a611..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! jQuery UI styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-jqui', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-jqui')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.min.js
deleted file mode 100644
index bec403e..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.jqueryui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- jQuery UI styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-jqui")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.js b/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.js
deleted file mode 100644
index d4ad315..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*! Semanic UI styling wrapper for Scroller
- * ©2018 SpryMedia Ltd - datatables.net/license
- */
-
-(function( factory ){
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery', 'datatables.net-se', 'datatables.net-scroller'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- root = window;
- }
-
- if ( ! $ || ! $.fn.dataTable ) {
- $ = require('datatables.net-se')(root, $).$;
- }
-
- if ( ! $.fn.dataTable.Scroller ) {
- require('datatables.net-scroller')(root, $);
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}(function( $, window, document, undefined ) {
-
-return $.fn.dataTable;
-
-}));
\ No newline at end of file
diff --git a/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.min.js b/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.min.js
deleted file mode 100644
index d0486b7..0000000
--- a/web/DataTables/Scroller-2.0.7/js/scroller.semanticui.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- Semanic UI styling wrapper for Scroller
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-se","datatables.net-scroller"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-se")(a,b).$);b.fn.dataTable.Scroller||require("datatables.net-scroller")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
diff --git a/web/DataTables/datatables.css b/web/DataTables/datatables.css
index ac1c04c..69aafc9 100644
--- a/web/DataTables/datatables.css
+++ b/web/DataTables/datatables.css
@@ -4,93 +4,158 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
- * https://datatables.net/download/#dt/jq-3.6.0/jszip-2.5.0/pdfmake-0.1.36/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/fc-4.1.0/fh-3.2.4/rg-1.2.0/sc-2.0.7
+ * https://datatables.net/download/#dt/jq-3.7.0/jszip-3.10.1/pdfmake-0.2.7/dt-2.2.2/b-3.2.2/b-html5-3.2.2/b-print-3.2.2/fc-5.0.4/fh-4.0.1/rg-1.5.1/sc-2.4.3
*
* Included libraries:
- * jQuery 3 3.6.0, JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.12.1, Buttons 2.2.3, HTML5 export 2.2.3, Print view 2.2.3, FixedColumns 4.1.0, FixedHeader 3.2.4, RowGroup 1.2.0, Scroller 2.0.7
+ * jQuery 3.7.0, JSZip 3.10.1, pdfmake 0.2.7, DataTables 2.2.2, Buttons 3.2.2, HTML5 export 3.2.2, Print view 3.2.2, FixedColumns 5.0.4, FixedHeader 4.0.1, RowGroup 1.5.1, Scroller 2.4.3
*/
-@charset "UTF-8";
+:root {
+ --dt-row-selected: 13, 110, 253;
+ --dt-row-selected-text: 255, 255, 255;
+ --dt-row-selected-link: 9, 10, 11;
+ --dt-row-stripe: 0, 0, 0;
+ --dt-row-hover: 0, 0, 0;
+ --dt-column-ordering: 0, 0, 0;
+ --dt-html-background: white;
+}
+:root.dark {
+ --dt-html-background: rgb(33, 37, 41);
+}
+
table.dataTable td.dt-control {
text-align: center;
cursor: pointer;
}
table.dataTable td.dt-control:before {
- height: 1em;
- width: 1em;
- margin-top: -9px;
display: inline-block;
- color: white;
- border: 0.15em solid white;
- border-radius: 1em;
- box-shadow: 0 0 0.2em #444;
- box-sizing: content-box;
- text-align: center;
- text-indent: 0 !important;
- font-family: "Courier New", Courier, monospace;
- line-height: 1em;
- content: "+";
- background-color: #31b131;
+ box-sizing: border-box;
+ content: "";
+ border-top: 5px solid transparent;
+ border-left: 10px solid rgba(0, 0, 0, 0.5);
+ border-bottom: 5px solid transparent;
+ border-right: 0px solid transparent;
}
table.dataTable tr.dt-hasChild td.dt-control:before {
- content: "-";
- background-color: #d33333;
+ border-top: 10px solid rgba(0, 0, 0, 0.5);
+ border-left: 5px solid transparent;
+ border-bottom: 0px solid transparent;
+ border-right: 5px solid transparent;
+}
+table.dataTable tfoot:empty {
+ display: none;
}
-table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
-table.dataTable thead > tr > td.sorting,
-table.dataTable thead > tr > td.sorting_asc,
-table.dataTable thead > tr > td.sorting_desc,
-table.dataTable thead > tr > td.sorting_asc_disabled,
-table.dataTable thead > tr > td.sorting_desc_disabled {
- cursor: pointer;
- position: relative;
- padding-right: 26px;
-}
-table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after,
-table.dataTable thead > tr > td.sorting:before,
-table.dataTable thead > tr > td.sorting:after,
-table.dataTable thead > tr > td.sorting_asc:before,
-table.dataTable thead > tr > td.sorting_asc:after,
-table.dataTable thead > tr > td.sorting_desc:before,
-table.dataTable thead > tr > td.sorting_desc:after,
-table.dataTable thead > tr > td.sorting_asc_disabled:before,
-table.dataTable thead > tr > td.sorting_asc_disabled:after,
-table.dataTable thead > tr > td.sorting_desc_disabled:before,
-table.dataTable thead > tr > td.sorting_desc_disabled:after {
+html.dark table.dataTable td.dt-control:before,
+:root[data-bs-theme=dark] table.dataTable td.dt-control:before,
+:root[data-theme=dark] table.dataTable td.dt-control:before {
+ border-left-color: rgba(255, 255, 255, 0.5);
+}
+html.dark table.dataTable tr.dt-hasChild td.dt-control:before,
+:root[data-bs-theme=dark] table.dataTable tr.dt-hasChild td.dt-control:before,
+:root[data-theme=dark] table.dataTable tr.dt-hasChild td.dt-control:before {
+ border-top-color: rgba(255, 255, 255, 0.5);
+ border-left-color: transparent;
+}
+
+div.dt-scroll {
+ width: 100%;
+}
+
+div.dt-scroll-body thead tr,
+div.dt-scroll-body tfoot tr {
+ height: 0;
+}
+div.dt-scroll-body thead tr th, div.dt-scroll-body thead tr td,
+div.dt-scroll-body tfoot tr th,
+div.dt-scroll-body tfoot tr td {
+ height: 0 !important;
+ padding-top: 0px !important;
+ padding-bottom: 0px !important;
+ border-top-width: 0px !important;
+ border-bottom-width: 0px !important;
+}
+div.dt-scroll-body thead tr th div.dt-scroll-sizing, div.dt-scroll-body thead tr td div.dt-scroll-sizing,
+div.dt-scroll-body tfoot tr th div.dt-scroll-sizing,
+div.dt-scroll-body tfoot tr td div.dt-scroll-sizing {
+ height: 0 !important;
+ overflow: hidden !important;
+}
+
+table.dataTable thead > tr > th:active,
+table.dataTable thead > tr > td:active {
+ outline: none;
+}
+table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before {
position: absolute;
display: block;
+ bottom: 50%;
+ content: "\25B2";
+ content: "\25B2"/"";
+}
+table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
+ position: absolute;
+ display: block;
+ top: 50%;
+ content: "\25BC";
+ content: "\25BC"/"";
+}
+table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc,
+table.dataTable thead > tr > td.dt-orderable-asc,
+table.dataTable thead > tr > td.dt-orderable-desc,
+table.dataTable thead > tr > td.dt-ordering-asc,
+table.dataTable thead > tr > td.dt-ordering-desc {
+ position: relative;
+ padding-right: 30px;
+}
+table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order,
+table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order,
+table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order,
+table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order,
+table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order {
+ position: absolute;
+ right: 12px;
+ top: 0;
+ bottom: 0;
+ width: 12px;
+}
+table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:after, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:before, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
+ left: 0;
opacity: 0.125;
- right: 10px;
line-height: 9px;
- font-size: 0.9em;
+ font-size: 0.8em;
}
-table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before,
-table.dataTable thead > tr > td.sorting:before,
-table.dataTable thead > tr > td.sorting_asc:before,
-table.dataTable thead > tr > td.sorting_desc:before,
-table.dataTable thead > tr > td.sorting_asc_disabled:before,
-table.dataTable thead > tr > td.sorting_desc_disabled:before {
- bottom: 50%;
- content: "▴";
-}
-table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
-table.dataTable thead > tr > td.sorting:after,
-table.dataTable thead > tr > td.sorting_asc:after,
-table.dataTable thead > tr > td.sorting_desc:after,
-table.dataTable thead > tr > td.sorting_asc_disabled:after,
-table.dataTable thead > tr > td.sorting_desc_disabled:after {
- top: 50%;
- content: "▾";
+table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc,
+table.dataTable thead > tr > td.dt-orderable-asc,
+table.dataTable thead > tr > td.dt-orderable-desc {
+ cursor: pointer;
}
-table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
-table.dataTable thead > tr > td.sorting_asc:before,
-table.dataTable thead > tr > td.sorting_desc:after {
+table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover,
+table.dataTable thead > tr > td.dt-orderable-asc:hover,
+table.dataTable thead > tr > td.dt-orderable-desc:hover {
+ outline: 2px solid rgba(0, 0, 0, 0.05);
+ outline-offset: -2px;
+}
+table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
+table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before,
+table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
opacity: 0.6;
}
-table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before,
-table.dataTable thead > tr > td.sorting_desc_disabled:after,
-table.dataTable thead > tr > td.sorting_asc_disabled:before {
+table.dataTable thead > tr > th.sorting_desc_disabled span.dt-column-order:after, table.dataTable thead > tr > th.sorting_asc_disabled span.dt-column-order:before,
+table.dataTable thead > tr > td.sorting_desc_disabled span.dt-column-order:after,
+table.dataTable thead > tr > td.sorting_asc_disabled span.dt-column-order:before {
display: none;
}
table.dataTable thead > tr > th:active,
@@ -98,50 +163,61 @@ table.dataTable thead > tr > td:active {
outline: none;
}
-div.dataTables_scrollBody table.dataTable thead > tr > th:before, div.dataTables_scrollBody table.dataTable thead > tr > th:after,
-div.dataTables_scrollBody table.dataTable thead > tr > td:before,
-div.dataTables_scrollBody table.dataTable thead > tr > td:after {
- display: none;
+div.dt-scroll-body > table.dataTable > thead > tr > th,
+div.dt-scroll-body > table.dataTable > thead > tr > td {
+ overflow: hidden;
+}
+
+:root.dark table.dataTable thead > tr > th.dt-orderable-asc:hover, :root.dark table.dataTable thead > tr > th.dt-orderable-desc:hover,
+:root.dark table.dataTable thead > tr > td.dt-orderable-asc:hover,
+:root.dark table.dataTable thead > tr > td.dt-orderable-desc:hover,
+:root[data-bs-theme=dark] table.dataTable thead > tr > th.dt-orderable-asc:hover,
+:root[data-bs-theme=dark] table.dataTable thead > tr > th.dt-orderable-desc:hover,
+:root[data-bs-theme=dark] table.dataTable thead > tr > td.dt-orderable-asc:hover,
+:root[data-bs-theme=dark] table.dataTable thead > tr > td.dt-orderable-desc:hover {
+ outline: 2px solid rgba(255, 255, 255, 0.05);
}
-div.dataTables_processing {
+div.dt-processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
- margin-top: -26px;
+ margin-top: -22px;
text-align: center;
padding: 2px;
+ z-index: 10;
}
-div.dataTables_processing > div:last-child {
+div.dt-processing > div:last-child {
position: relative;
width: 80px;
height: 15px;
margin: 1em auto;
}
-div.dataTables_processing > div:last-child > div {
+div.dt-processing > div:last-child > div {
position: absolute;
top: 0;
width: 13px;
height: 13px;
border-radius: 50%;
- background: rgba(13, 110, 253, 0.9);
+ background: rgb(13, 110, 253);
+ background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
-div.dataTables_processing > div:last-child > div:nth-child(1) {
+div.dt-processing > div:last-child > div:nth-child(1) {
left: 8px;
animation: datatables-loader-1 0.6s infinite;
}
-div.dataTables_processing > div:last-child > div:nth-child(2) {
+div.dt-processing > div:last-child > div:nth-child(2) {
left: 8px;
animation: datatables-loader-2 0.6s infinite;
}
-div.dataTables_processing > div:last-child > div:nth-child(3) {
+div.dt-processing > div:last-child > div:nth-child(3) {
left: 32px;
animation: datatables-loader-2 0.6s infinite;
}
-div.dataTables_processing > div:last-child > div:nth-child(4) {
+div.dt-processing > div:last-child > div:nth-child(4) {
left: 56px;
animation: datatables-loader-3 0.6s infinite;
}
@@ -173,13 +249,21 @@ div.dataTables_processing > div:last-child > div:nth-child(4) {
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: nowrap;
}
+table.dataTable th,
+table.dataTable td {
+ box-sizing: border-box;
+}
+table.dataTable th.dt-type-numeric, table.dataTable th.dt-type-date,
+table.dataTable td.dt-type-numeric,
+table.dataTable td.dt-type-date {
+ text-align: right;
+}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
}
table.dataTable th.dt-center,
-table.dataTable td.dt-center,
-table.dataTable td.dataTables_empty {
+table.dataTable td.dt-center {
text-align: center;
}
table.dataTable th.dt-right,
@@ -194,6 +278,11 @@ table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
white-space: nowrap;
}
+table.dataTable th.dt-empty,
+table.dataTable td.dt-empty {
+ text-align: center;
+ vertical-align: top;
+}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
@@ -251,14 +340,20 @@ table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
+:root {
+ --dt-row-hover-alpha: 0.035;
+ --dt-row-stripe-alpha: 0.023;
+ --dt-column-ordering-alpha: 0.019;
+ --dt-row-selected-stripe-alpha: 0.923;
+ --dt-row-selected-column-ordering-alpha: 0.919;
+}
+
/*
* Table styles
*/
table.dataTable {
width: 100%;
margin: 0 auto;
- clear: both;
- border-collapse: separate;
border-spacing: 0;
/*
* Header and footer styles
@@ -271,62 +366,78 @@ table.dataTable thead th,
table.dataTable tfoot th {
font-weight: bold;
}
-table.dataTable thead th,
-table.dataTable thead td {
+table.dataTable > thead > tr > th,
+table.dataTable > thead > tr > td {
padding: 10px;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
-table.dataTable thead th:active,
-table.dataTable thead td:active {
+table.dataTable > thead > tr > th:active,
+table.dataTable > thead > tr > td:active {
outline: none;
}
-table.dataTable tfoot th,
-table.dataTable tfoot td {
- padding: 10px 10px 6px 10px;
+table.dataTable > tfoot > tr > th,
+table.dataTable > tfoot > tr > td {
border-top: 1px solid rgba(0, 0, 0, 0.3);
+ padding: 10px 10px 6px 10px;
}
-table.dataTable tbody tr {
+table.dataTable > tbody > tr {
background-color: transparent;
}
-table.dataTable tbody tr.selected > * {
+table.dataTable > tbody > tr:first-child > * {
+ border-top: none;
+}
+table.dataTable > tbody > tr:last-child > * {
+ border-bottom: none;
+}
+table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.9);
- color: white;
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.9);
+ color: rgb(255, 255, 255);
+ color: rgb(var(--dt-row-selected-text));
}
-table.dataTable tbody th,
-table.dataTable tbody td {
+table.dataTable > tbody > tr.selected a {
+ color: rgb(9, 10, 11);
+ color: rgb(var(--dt-row-selected-link));
+}
+table.dataTable > tbody > tr > th,
+table.dataTable > tbody > tr > td {
padding: 8px 10px;
}
-table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
+table.dataTable.row-border > tbody > tr > *, table.dataTable.display > tbody > tr > * {
border-top: 1px solid rgba(0, 0, 0, 0.15);
}
-table.dataTable.row-border tbody tr:first-child th,
-table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th,
-table.dataTable.display tbody tr:first-child td {
+table.dataTable.row-border > tbody > tr:first-child > *, table.dataTable.display > tbody > tr:first-child > * {
border-top: none;
}
-table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {
+table.dataTable.row-border > tbody > tr.selected + tr.selected > td, table.dataTable.display > tbody > tr.selected + tr.selected > td {
+ border-top-color: rgba(13, 110, 253, 0.65);
+ border-top-color: rgba(var(--dt-row-selected), 0.65);
+}
+table.dataTable.cell-border > tbody > tr > * {
border-top: 1px solid rgba(0, 0, 0, 0.15);
border-right: 1px solid rgba(0, 0, 0, 0.15);
}
-table.dataTable.cell-border tbody tr th:first-child,
-table.dataTable.cell-border tbody tr td:first-child {
+table.dataTable.cell-border > tbody > tr > *:first-child {
border-left: 1px solid rgba(0, 0, 0, 0.15);
}
-table.dataTable.cell-border tbody tr:first-child th,
-table.dataTable.cell-border tbody tr:first-child td {
- border-top: none;
+table.dataTable.cell-border > tbody > tr:first-child > * {
+ border-top: 1px solid rgba(0, 0, 0, 0.3);
}
-table.dataTable.stripe > tbody > tr.odd > *, table.dataTable.display > tbody > tr.odd > * {
+table.dataTable.stripe > tbody > tr:nth-child(odd) > *, table.dataTable.display > tbody > tr:nth-child(odd) > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.023);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-stripe), var(--dt-row-stripe-alpha));
}
-table.dataTable.stripe > tbody > tr.odd.selected > *, table.dataTable.display > tbody > tr.odd.selected > * {
+table.dataTable.stripe > tbody > tr:nth-child(odd).selected > *, table.dataTable.display > tbody > tr:nth-child(odd).selected > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.923);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), var(--dt-row-selected-stripe-alpha));
}
table.dataTable.hover > tbody > tr:hover > *, table.dataTable.display > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.035);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-hover), var(--dt-row-hover-alpha));
}
table.dataTable.hover > tbody > tr.selected:hover > *, table.dataTable.display > tbody > tr.selected:hover > * {
- box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.935);
+ box-shadow: inset 0 0 0 9999px #0d6efd !important;
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 1) !important;
}
table.dataTable.order-column > tbody tr > .sorting_1,
table.dataTable.order-column > tbody tr > .sorting_2,
@@ -334,6 +445,7 @@ table.dataTable.order-column > tbody tr > .sorting_3, table.dataTable.display >
table.dataTable.display > tbody tr > .sorting_2,
table.dataTable.display > tbody tr > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.019);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-column-ordering), var(--dt-column-ordering-alpha));
}
table.dataTable.order-column > tbody tr.selected > .sorting_1,
table.dataTable.order-column > tbody tr.selected > .sorting_2,
@@ -341,121 +453,158 @@ table.dataTable.order-column > tbody tr.selected > .sorting_3, table.dataTable.d
table.dataTable.display > tbody tr.selected > .sorting_2,
table.dataTable.display > tbody tr.selected > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.919);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), var(--dt-row-selected-column-ordering-alpha));
}
-table.dataTable.display > tbody > tr.odd > .sorting_1, table.dataTable.order-column.stripe > tbody > tr.odd > .sorting_1 {
+table.dataTable.display > tbody > tr:nth-child(odd) > .sorting_1, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd) > .sorting_1 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.054);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-column-ordering), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha)));
}
-table.dataTable.display > tbody > tr.odd > .sorting_2, table.dataTable.order-column.stripe > tbody > tr.odd > .sorting_2 {
+table.dataTable.display > tbody > tr:nth-child(odd) > .sorting_2, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd) > .sorting_2 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.047);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-column-ordering), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha) - 0.007));
}
-table.dataTable.display > tbody > tr.odd > .sorting_3, table.dataTable.order-column.stripe > tbody > tr.odd > .sorting_3 {
+table.dataTable.display > tbody > tr:nth-child(odd) > .sorting_3, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd) > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.039);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-column-ordering), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha) - 0.015));
}
-table.dataTable.display > tbody > tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe > tbody > tr.odd.selected > .sorting_1 {
+table.dataTable.display > tbody > tr:nth-child(odd).selected > .sorting_1, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd).selected > .sorting_1 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.954);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha)));
}
-table.dataTable.display > tbody > tr.odd.selected > .sorting_2, table.dataTable.order-column.stripe > tbody > tr.odd.selected > .sorting_2 {
+table.dataTable.display > tbody > tr:nth-child(odd).selected > .sorting_2, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd).selected > .sorting_2 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.947);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha) - 0.007));
}
-table.dataTable.display > tbody > tr.odd.selected > .sorting_3, table.dataTable.order-column.stripe > tbody > tr.odd.selected > .sorting_3 {
+table.dataTable.display > tbody > tr:nth-child(odd).selected > .sorting_3, table.dataTable.order-column.stripe > tbody > tr:nth-child(odd).selected > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.939);
-}
-table.dataTable.display > tbody > tr.even > .sorting_1, table.dataTable.order-column.stripe > tbody > tr.even > .sorting_1 {
- box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.019);
-}
-table.dataTable.display > tbody > tr.even > .sorting_2, table.dataTable.order-column.stripe > tbody > tr.even > .sorting_2 {
- box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.011);
-}
-table.dataTable.display > tbody > tr.even > .sorting_3, table.dataTable.order-column.stripe > tbody > tr.even > .sorting_3 {
- box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.003);
-}
-table.dataTable.display > tbody > tr.even.selected > .sorting_1, table.dataTable.order-column.stripe > tbody > tr.even.selected > .sorting_1 {
- box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.919);
-}
-table.dataTable.display > tbody > tr.even.selected > .sorting_2, table.dataTable.order-column.stripe > tbody > tr.even.selected > .sorting_2 {
- box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.911);
-}
-table.dataTable.display > tbody > tr.even.selected > .sorting_3, table.dataTable.order-column.stripe > tbody > tr.even.selected > .sorting_3 {
- box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.903);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha) - 0.015));
}
table.dataTable.display tbody tr:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.082);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-hover), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha) + var(--dt-row-hover-alpha)));
}
table.dataTable.display tbody tr:hover > .sorting_2, table.dataTable.order-column.hover tbody tr:hover > .sorting_2 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.074);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-hover), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha) + var(--dt-row-hover-alpha) - 0.007));
}
table.dataTable.display tbody tr:hover > .sorting_3, table.dataTable.order-column.hover tbody tr:hover > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.062);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-hover), calc(var(--dt-row-stripe-alpha) + var(--dt-column-ordering-alpha) + var(--dt-row-hover-alpha) - 0.015));
}
table.dataTable.display tbody tr:hover.selected > .sorting_1, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.982);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha)));
}
table.dataTable.display tbody tr:hover.selected > .sorting_2, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.974);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha) + var(--dt-row-hover-alpha) - 0.007));
}
table.dataTable.display tbody tr:hover.selected > .sorting_3, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3 {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.962);
-}
-table.dataTable.no-footer {
- border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+ box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), calc(var(--dt-row-selected-stripe-alpha) + var(--dt-column-ordering-alpha) + var(--dt-row-hover-alpha) - 0.015));
}
table.dataTable.compact thead th,
-table.dataTable.compact thead td {
- padding: 4px 17px;
-}
+table.dataTable.compact thead td,
table.dataTable.compact tfoot th,
-table.dataTable.compact tfoot td {
- padding: 4px;
-}
+table.dataTable.compact tfoot td,
table.dataTable.compact tbody th,
table.dataTable.compact tbody td {
padding: 4px;
}
-table.dataTable th,
-table.dataTable td {
- box-sizing: content-box;
+div.dt-container div.dt-layout-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ margin: 0.75em 0;
+}
+div.dt-container div.dt-layout-row div.dt-layout-cell {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-start {
+ justify-content: flex-start;
+ margin-right: auto;
+}
+div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end {
+ justify-content: flex-end;
+ margin-left: auto;
+}
+div.dt-container div.dt-layout-row div.dt-layout-cell:empty {
+ display: none;
+}
+
+@media screen and (max-width: 767px) {
+ div.dt-container div.dt-layout-row:not(.dt-layout-table) {
+ display: block;
+ }
+ div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell {
+ display: block;
+ text-align: center;
+ }
+ div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell > * {
+ margin: 0.5em 0;
+ }
+ div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell.dt-layout-start {
+ margin-right: 0;
+ }
+ div.dt-container div.dt-layout-row:not(.dt-layout-table) div.dt-layout-cell.dt-layout-end {
+ margin-left: 0;
+ }
+}
+div.dt-container div.dt-layout-start > *:not(:last-child) {
+ margin-right: 1em;
+}
+div.dt-container div.dt-layout-end > *:not(:first-child) {
+ margin-left: 1em;
+}
+div.dt-container div.dt-layout-full {
+ width: 100%;
+}
+div.dt-container div.dt-layout-full > *:only-child {
+ margin-left: auto;
+ margin-right: auto;
+}
+div.dt-container div.dt-layout-table > div {
+ display: block !important;
}
+@media screen and (max-width: 767px) {
+ div.dt-container div.dt-layout-start > *:not(:last-child) {
+ margin-right: 0;
+ }
+ div.dt-container div.dt-layout-end > *:not(:first-child) {
+ margin-left: 0;
+ }
+}
/*
* Control feature layout
*/
-.dataTables_wrapper {
+div.dt-container {
position: relative;
clear: both;
}
-.dataTables_wrapper .dataTables_length {
- float: left;
-}
-.dataTables_wrapper .dataTables_length select {
+div.dt-container .dt-search input {
border: 1px solid #aaa;
border-radius: 3px;
padding: 5px;
background-color: transparent;
- padding: 4px;
-}
-.dataTables_wrapper .dataTables_filter {
- float: right;
- text-align: right;
+ color: inherit;
+ margin-left: 3px;
}
-.dataTables_wrapper .dataTables_filter input {
+div.dt-container .dt-input {
border: 1px solid #aaa;
border-radius: 3px;
padding: 5px;
background-color: transparent;
- margin-left: 3px;
+ color: inherit;
}
-.dataTables_wrapper .dataTables_info {
- clear: both;
- float: left;
- padding-top: 0.755em;
-}
-.dataTables_wrapper .dataTables_paginate {
- float: right;
- text-align: right;
- padding-top: 0.25em;
+div.dt-container select.dt-input {
+ padding: 4px;
}
-.dataTables_wrapper .dataTables_paginate .paginate_button {
+div.dt-container .dt-paging .dt-paging-button {
box-sizing: border-box;
display: inline-block;
min-width: 1.5em;
@@ -464,129 +613,169 @@ table.dataTable td {
text-align: center;
text-decoration: none !important;
cursor: pointer;
- color: #333 !important;
+ color: inherit !important;
border: 1px solid transparent;
border-radius: 2px;
+ background: transparent;
}
-.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
- color: #333 !important;
+div.dt-container .dt-paging .dt-paging-button.current, div.dt-container .dt-paging .dt-paging-button.current:hover {
+ color: inherit !important;
border: 1px solid rgba(0, 0, 0, 0.3);
- background-color: rgba(230, 230, 230, 0.1);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(230, 230, 230, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.1)));
- /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
- /* Chrome10+,Safari5.1+ */
- background: -moz-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
- /* FF3.6+ */
- background: -ms-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
- /* IE10+ */
- background: -o-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
- /* Opera 11.10+ */
- background: linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
- /* W3C */
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
+ background-color: rgba(0, 0, 0, 0.05);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(230, 230, 230, 0.05)), color-stop(100%, rgba(0, 0, 0, 0.05))); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%); /* Chrome10+,Safari5.1+ */
+ background: -moz-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%); /* FF3.6+ */
+ background: -ms-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%); /* IE10+ */
+ background: -o-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%); /* Opera 11.10+ */
+ background: linear-gradient(to bottom, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%); /* W3C */
+}
+div.dt-container .dt-paging .dt-paging-button.disabled, div.dt-container .dt-paging .dt-paging-button.disabled:hover, div.dt-container .dt-paging .dt-paging-button.disabled:active {
cursor: default;
- color: #666 !important;
+ color: rgba(0, 0, 0, 0.5) !important;
border: 1px solid transparent;
background: transparent;
box-shadow: none;
}
-.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
+div.dt-container .dt-paging .dt-paging-button:hover {
color: white !important;
border: 1px solid #111;
- background-color: #585858;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));
- /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, #585858 0%, #111 100%);
- /* Chrome10+,Safari5.1+ */
- background: -moz-linear-gradient(top, #585858 0%, #111 100%);
- /* FF3.6+ */
- background: -ms-linear-gradient(top, #585858 0%, #111 100%);
- /* IE10+ */
- background: -o-linear-gradient(top, #585858 0%, #111 100%);
- /* Opera 11.10+ */
- background: linear-gradient(to bottom, #585858 0%, #111 100%);
- /* W3C */
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button:active {
+ background-color: #111;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #585858 0%, #111 100%); /* Chrome10+,Safari5.1+ */
+ background: -moz-linear-gradient(top, #585858 0%, #111 100%); /* FF3.6+ */
+ background: -ms-linear-gradient(top, #585858 0%, #111 100%); /* IE10+ */
+ background: -o-linear-gradient(top, #585858 0%, #111 100%); /* Opera 11.10+ */
+ background: linear-gradient(to bottom, #585858 0%, #111 100%); /* W3C */
+}
+div.dt-container .dt-paging .dt-paging-button:active {
outline: none;
- background-color: #2b2b2b;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));
- /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- /* Chrome10+,Safari5.1+ */
- background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- /* FF3.6+ */
- background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- /* IE10+ */
- background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- /* Opera 11.10+ */
- background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);
- /* W3C */
+ background-color: #0c0c0c;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); /* Chrome10+,Safari5.1+ */
+ background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); /* FF3.6+ */
+ background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); /* IE10+ */
+ background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); /* Opera 11.10+ */
+ background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%); /* W3C */
box-shadow: inset 0 0 3px #111;
}
-.dataTables_wrapper .dataTables_paginate .ellipsis {
+div.dt-container .dt-paging .ellipsis {
padding: 0 1em;
}
-.dataTables_wrapper .dataTables_length,
-.dataTables_wrapper .dataTables_filter,
-.dataTables_wrapper .dataTables_info,
-.dataTables_wrapper .dataTables_processing,
-.dataTables_wrapper .dataTables_paginate {
- color: #333;
+div.dt-container .dt-length,
+div.dt-container .dt-search,
+div.dt-container .dt-info,
+div.dt-container .dt-processing,
+div.dt-container .dt-paging {
+ color: inherit;
}
-.dataTables_wrapper .dataTables_scroll {
+div.dt-container .dataTables_scroll {
clear: both;
}
-.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody {
+div.dt-container .dataTables_scroll div.dt-scroll-body {
-webkit-overflow-scrolling: touch;
}
-.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > thead > tr > th, .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > thead > tr > td, .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > tbody > tr > th, .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > tbody > tr > td {
+div.dt-container .dataTables_scroll div.dt-scroll-body > table > thead > tr > th, div.dt-container .dataTables_scroll div.dt-scroll-body > table > thead > tr > td, div.dt-container .dataTables_scroll div.dt-scroll-body > table > tbody > tr > th, div.dt-container .dataTables_scroll div.dt-scroll-body > table > tbody > tr > td {
vertical-align: middle;
}
-.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > thead > tr > th > div.dataTables_sizing,
-.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > thead > tr > td > div.dataTables_sizing, .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > tbody > tr > th > div.dataTables_sizing,
-.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody > table > tbody > tr > td > div.dataTables_sizing {
+div.dt-container .dataTables_scroll div.dt-scroll-body > table > thead > tr > th > div.dataTables_sizing,
+div.dt-container .dataTables_scroll div.dt-scroll-body > table > thead > tr > td > div.dataTables_sizing, div.dt-container .dataTables_scroll div.dt-scroll-body > table > tbody > tr > th > div.dataTables_sizing,
+div.dt-container .dataTables_scroll div.dt-scroll-body > table > tbody > tr > td > div.dataTables_sizing {
height: 0;
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
}
-.dataTables_wrapper.no-footer .dataTables_scrollBody {
+div.dt-container.dt-empty-footer tbody > tr:last-child > * {
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
-.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,
-.dataTables_wrapper.no-footer div.dataTables_scrollBody > table {
+div.dt-container.dt-empty-footer .dt-scroll-body {
+ border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+}
+div.dt-container.dt-empty-footer .dt-scroll-body tbody > tr:last-child > * {
border-bottom: none;
}
-.dataTables_wrapper:after {
- visibility: hidden;
- display: block;
- content: "";
- clear: both;
- height: 0;
+
+html.dark {
+ --dt-row-hover: 255, 255, 255;
+ --dt-row-stripe: 255, 255, 255;
+ --dt-column-ordering: 255, 255, 255;
+}
+html.dark table.dataTable > thead > tr > th,
+html.dark table.dataTable > thead > tr > td {
+ border-bottom: 1px solid rgb(89, 91, 94);
+}
+html.dark table.dataTable > thead > tr > th:active,
+html.dark table.dataTable > thead > tr > td:active {
+ outline: none;
+}
+html.dark table.dataTable > tfoot > tr > th,
+html.dark table.dataTable > tfoot > tr > td {
+ border-top: 1px solid rgb(89, 91, 94);
+}
+html.dark table.dataTable.row-border > tbody > tr > *, html.dark table.dataTable.display > tbody > tr > * {
+ border-top: 1px solid rgb(64, 67, 70);
+}
+html.dark table.dataTable.row-border > tbody > tr:first-child > *, html.dark table.dataTable.display > tbody > tr:first-child > * {
+ border-top: none;
+}
+html.dark table.dataTable.row-border > tbody > tr.selected + tr.selected > td, html.dark table.dataTable.display > tbody > tr.selected + tr.selected > td {
+ border-top-color: rgba(13, 110, 253, 0.65);
+ border-top-color: rgba(var(--dt-row-selected), 0.65);
+}
+html.dark table.dataTable.cell-border > tbody > tr > th,
+html.dark table.dataTable.cell-border > tbody > tr > td {
+ border-top: 1px solid rgb(64, 67, 70);
+ border-right: 1px solid rgb(64, 67, 70);
+}
+html.dark table.dataTable.cell-border > tbody > tr > th:first-child,
+html.dark table.dataTable.cell-border > tbody > tr > td:first-child {
+ border-left: 1px solid rgb(64, 67, 70);
+}
+html.dark .dt-container.dt-empty-footer table.dataTable {
+ border-bottom: 1px solid rgb(89, 91, 94);
+}
+html.dark .dt-container .dt-search input,
+html.dark .dt-container .dt-length select {
+ border: 1px solid rgba(255, 255, 255, 0.2);
+ background-color: var(--dt-html-background);
+}
+html.dark .dt-container .dt-paging .dt-paging-button.current, html.dark .dt-container .dt-paging .dt-paging-button.current:hover {
+ border: 1px solid rgb(89, 91, 94);
+ background: rgba(255, 255, 255, 0.15);
+}
+html.dark .dt-container .dt-paging .dt-paging-button.disabled, html.dark .dt-container .dt-paging .dt-paging-button.disabled:hover, html.dark .dt-container .dt-paging .dt-paging-button.disabled:active {
+ color: #666 !important;
+}
+html.dark .dt-container .dt-paging .dt-paging-button:hover {
+ border: 1px solid rgb(53, 53, 53);
+ background: rgb(53, 53, 53);
+}
+html.dark .dt-container .dt-paging .dt-paging-button:active {
+ background: #3a3a3a;
}
-@media screen and (max-width: 767px) {
- .dataTables_wrapper .dataTables_info,
-.dataTables_wrapper .dataTables_paginate {
- float: none;
- text-align: center;
- }
- .dataTables_wrapper .dataTables_paginate {
- margin-top: 0.5em;
- }
+/*
+ * Overrides for RTL support
+ */
+*[dir=rtl] table.dataTable thead th,
+*[dir=rtl] table.dataTable thead td,
+*[dir=rtl] table.dataTable tfoot th,
+*[dir=rtl] table.dataTable tfoot td {
+ text-align: right;
}
-@media screen and (max-width: 640px) {
- .dataTables_wrapper .dataTables_length,
-.dataTables_wrapper .dataTables_filter {
- float: none;
- text-align: center;
- }
- .dataTables_wrapper .dataTables_filter {
- margin-top: 0.5em;
- }
+*[dir=rtl] table.dataTable th.dt-type-numeric, *[dir=rtl] table.dataTable th.dt-type-date,
+*[dir=rtl] table.dataTable td.dt-type-numeric,
+*[dir=rtl] table.dataTable td.dt-type-date {
+ text-align: left;
+}
+*[dir=rtl] div.dt-container div.dt-layout-cell.dt-start {
+ text-align: right;
+}
+*[dir=rtl] div.dt-container div.dt-layout-cell.dt-end {
+ text-align: left;
+}
+*[dir=rtl] div.dt-container div.dt-search input {
+ margin: 0 3px 0 0;
}
@@ -626,6 +815,11 @@ div.dataTables_wrapper {
div.dt-buttons {
position: initial;
}
+div.dt-buttons .dt-button {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
div.dt-button-info {
position: fixed;
@@ -635,31 +829,27 @@ div.dt-button-info {
margin-top: -100px;
margin-left: -200px;
background-color: white;
- border: 2px solid #111;
- box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.3);
- border-radius: 3px;
+ border-radius: 0.75em;
+ box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
text-align: center;
- z-index: 21;
+ z-index: 2003;
+ overflow: hidden;
}
div.dt-button-info h2 {
- padding: 0.5em;
+ padding: 2rem 2rem 1rem 2rem;
margin: 0;
font-weight: normal;
- border-bottom: 1px solid #ddd;
- background-color: #f3f3f3;
}
div.dt-button-info > div {
- padding: 1em;
+ padding: 1em 2em 2em 2em;
}
div.dtb-popover-close {
position: absolute;
- top: 10px;
- right: 10px;
+ top: 6px;
+ right: 6px;
width: 22px;
height: 22px;
- border: 1px solid #eaeaea;
- background-color: #f9f9f9;
text-align: center;
border-radius: 3px;
cursor: pointer;
@@ -672,10 +862,13 @@ button.dtb-hide-drop {
div.dt-button-collection-title {
text-align: center;
- padding: 0.3em 0 0.5em;
+ padding: 0.3em 0.5em 0.5em;
margin-left: 0.5em;
margin-right: 0.5em;
font-size: 0.9em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
div.dt-button-collection-title:empty {
@@ -698,6 +891,46 @@ span.dt-button-spacer.bar:empty {
padding-left: 0;
}
+div.dt-button-collection .dt-button-active {
+ padding-right: 3em;
+}
+div.dt-button-collection .dt-button-active:after {
+ position: absolute;
+ top: 50%;
+ margin-top: -10px;
+ right: 1em;
+ display: inline-block;
+ content: "✓";
+ color: inherit;
+}
+div.dt-button-collection .dt-button-active.dt-button-split {
+ padding-right: 0;
+}
+div.dt-button-collection .dt-button-active.dt-button-split:after {
+ display: none;
+}
+div.dt-button-collection .dt-button-active.dt-button-split > *:first-child {
+ padding-right: 3em;
+}
+div.dt-button-collection .dt-button-active.dt-button-split > *:first-child:after {
+ position: absolute;
+ top: 50%;
+ margin-top: -10px;
+ right: 1em;
+ display: inline-block;
+ content: "✓";
+ color: inherit;
+}
+div.dt-button-collection .dt-button-active-a a {
+ padding-right: 3em;
+}
+div.dt-button-collection .dt-button-active-a a:after {
+ position: absolute;
+ right: 1em;
+ display: inline-block;
+ content: "✓";
+ color: inherit;
+}
div.dt-button-collection span.dt-button-spacer {
width: 100%;
font-size: 0.9em;
@@ -710,14 +943,17 @@ div.dt-button-collection span.dt-button-spacer:empty {
}
div.dt-button-collection span.dt-button-spacer.bar {
border-left: none;
- border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding-left: 0;
}
-button.dt-button,
-div.dt-button,
-a.dt-button,
-input.dt-button {
+@media print {
+ table.dataTable tr > * {
+ box-shadow: none !important;
+ }
+}
+div.dt-buttons > .dt-button,
+div.dt-buttons > div.dt-button-split .dt-button {
position: relative;
display: inline-block;
box-sizing: border-box;
@@ -730,11 +966,10 @@ input.dt-button {
cursor: pointer;
font-size: 0.88em;
line-height: 1.6em;
- color: black;
+ color: inherit;
white-space: nowrap;
overflow: hidden;
- background-color: rgba(0, 0, 0, 0.1);
- /* Fallback */
+ background-color: rgba(0, 0, 0, 0.1); /* Fallback */
background: linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(230, 230, 230, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");
-webkit-user-select: none;
@@ -745,105 +980,86 @@ input.dt-button {
outline: none;
text-overflow: ellipsis;
}
-button.dt-button:first-child,
-div.dt-button:first-child,
-a.dt-button:first-child,
-input.dt-button:first-child {
+div.dt-buttons > .dt-button:first-child,
+div.dt-buttons > div.dt-button-split .dt-button:first-child {
margin-left: 0;
}
-button.dt-button.disabled,
-div.dt-button.disabled,
-a.dt-button.disabled,
-input.dt-button.disabled {
+div.dt-buttons > .dt-button.disabled,
+div.dt-buttons > div.dt-button-split .dt-button.disabled {
cursor: default;
opacity: 0.4;
}
-button.dt-button:active:not(.disabled),
-div.dt-button:active:not(.disabled),
-a.dt-button:active:not(.disabled),
-input.dt-button:active:not(.disabled) {
- background-color: rgba(0, 0, 0, 0.1);
- /* Fallback */
+div.dt-buttons > .dt-button.dt-button-active:not(.disabled),
+div.dt-buttons > div.dt-button-split .dt-button.dt-button-active:not(.disabled) {
+ background-color: rgba(0, 0, 0, 0.1); /* Fallback */
background: linear-gradient(to bottom, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(179, 179, 179, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");
box-shadow: inset 1px 1px 3px #999999;
}
-button.dt-button:active:not(.disabled):hover:not(.disabled),
-div.dt-button:active:not(.disabled):hover:not(.disabled),
-a.dt-button:active:not(.disabled):hover:not(.disabled),
-input.dt-button:active:not(.disabled):hover:not(.disabled) {
+div.dt-buttons > .dt-button.dt-button-active:not(.disabled):hover:not(.disabled),
+div.dt-buttons > div.dt-button-split .dt-button.dt-button-active:not(.disabled):hover:not(.disabled) {
box-shadow: inset 1px 1px 3px #999999;
- background-color: rgba(0, 0, 0, 0.1);
- /* Fallback */
+ background-color: rgba(0, 0, 0, 0.1); /* Fallback */
background: linear-gradient(to bottom, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(128, 128, 128, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");
}
-button.dt-button:hover,
-div.dt-button:hover,
-a.dt-button:hover,
-input.dt-button:hover {
+div.dt-buttons > .dt-button:hover,
+div.dt-buttons > div.dt-button-split .dt-button:hover {
text-decoration: none;
}
-button.dt-button:hover:not(.disabled),
-div.dt-button:hover:not(.disabled),
-a.dt-button:hover:not(.disabled),
-input.dt-button:hover:not(.disabled) {
+div.dt-buttons > .dt-button:hover:not(.disabled),
+div.dt-buttons > div.dt-button-split .dt-button:hover:not(.disabled) {
border: 1px solid #666;
- background-color: rgba(0, 0, 0, 0.1);
- /* Fallback */
+ background-color: rgba(0, 0, 0, 0.1); /* Fallback */
background: linear-gradient(to bottom, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(153, 153, 153, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");
}
-button.dt-button:focus:not(.disabled),
-div.dt-button:focus:not(.disabled),
-a.dt-button:focus:not(.disabled),
-input.dt-button:focus:not(.disabled) {
- border: 1px solid #426c9e;
- text-shadow: 0 1px 0 #c4def1;
+div.dt-buttons > .dt-button:focus:not(.disabled),
+div.dt-buttons > div.dt-button-split .dt-button:focus:not(.disabled) {
+ outline: 2px solid rgb(53, 132, 228);
+}
+div.dt-buttons > .dt-button embed,
+div.dt-buttons > div.dt-button-split .dt-button embed {
outline: none;
- background-color: #79ace9;
- /* Fallback */
- background: linear-gradient(to bottom, #d1e2f7 0%, #79ace9 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#d1e2f7", EndColorStr="#79ace9");
-}
-button.dt-button.active:focus:not(.disabled),
-div.dt-button.active:focus:not(.disabled),
-a.dt-button.active:focus:not(.disabled),
-input.dt-button.active:focus:not(.disabled) {
- background: linear-gradient(to bottom, #d1e2f7 0%, #79ace9 100%) !important;
-}
-button.dt-button span.dt-down-arrow,
-div.dt-button span.dt-down-arrow,
-a.dt-button span.dt-down-arrow,
-input.dt-button span.dt-down-arrow {
+}
+div.dt-buttons > div.dt-button-split .dt-button:first-child {
+ border-right: 1px solid rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+div.dt-buttons > div.dt-button-split .dt-button:first-child:hover {
+ border-right: 1px solid #666;
+}
+div.dt-buttons > div.dt-button-split .dt-button:last-child {
+ border-left: 1px solid transparent;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+div.dt-buttons > div.dt-button-split .dt-button:last-child:hover {
+ border-left: 1px solid #666;
+}
+div.dt-buttons span.dt-button-down-arrow {
position: relative;
top: -2px;
- color: rgba(70, 70, 70, 0.75);
- font-size: 8px;
+ font-size: 10px;
padding-left: 10px;
line-height: 1em;
+ opacity: 0.6;
}
-
-.dt-button embed {
- outline: none;
-}
-
-div.dt-buttons {
- float: left;
-}
-div.dt-buttons.buttons-right {
- float: right;
+div.dt-buttons div.dt-button-split {
+ display: inline-block;
}
-
-div.dataTables_layout_cell div.dt-buttons {
- float: none;
+div.dt-buttons div.dt-button-split .dt-button:first-child {
+ margin-right: 0;
}
-div.dataTables_layout_cell div.dt-buttons.buttons-right {
- float: none;
+div.dt-buttons div.dt-button-split .dt-button:last-child {
+ margin-left: -1px;
+ padding-left: 0.75em;
+ padding-right: 0.75em;
+ z-index: 2;
}
-
-div.dt-btn-split-wrapper {
- display: inline-block;
+div.dt-buttons div.dt-button-split .dt-button:last-child span {
+ padding-left: 0;
}
div.dt-button-collection {
@@ -853,8 +1069,7 @@ div.dt-button-collection {
width: 200px;
margin-top: 3px;
margin-bottom: 3px;
- padding: 4px 4px 2px 4px;
- border: 1px solid #ccc;
+ padding: 0.75em 0;
border: 1px solid rgba(0, 0, 0, 0.4);
background-color: white;
overflow: hidden;
@@ -863,98 +1078,59 @@ div.dt-button-collection {
box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
}
-div.dt-button-collection button.dt-button,
-div.dt-button-collection div.dt-button,
-div.dt-button-collection a.dt-button {
+div.dt-button-collection .dt-button {
position: relative;
left: 0;
right: 0;
width: 100%;
- display: block;
+ display: flex;
float: none;
- margin: 4px 0 2px 0;
-}
-div.dt-button-collection button.dt-button:active:not(.disabled), div.dt-button-collection button.dt-button.active:not(.disabled),
-div.dt-button-collection div.dt-button:active:not(.disabled),
-div.dt-button-collection div.dt-button.active:not(.disabled),
-div.dt-button-collection a.dt-button:active:not(.disabled),
-div.dt-button-collection a.dt-button.active:not(.disabled) {
- background-color: #dadada;
- /* Fallback */
- background: linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#f0f0f0", EndColorStr="#dadada");
- box-shadow: inset 1px 1px 3px #666;
-}
-div.dt-button-collection button.dt-button:first-child,
-div.dt-button-collection div.dt-button:first-child,
-div.dt-button-collection a.dt-button:first-child {
- margin-top: 0;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-div.dt-button-collection button.dt-button:last-child,
-div.dt-button-collection div.dt-button:last-child,
-div.dt-button-collection a.dt-button:last-child {
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-div.dt-button-collection div.dt-btn-split-wrapper {
+ justify-content: space-between;
+ align-items: center;
+ background: none;
+ margin: 0;
+ padding: 0.5em 1em;
+ border: none;
+ text-align: left;
+ cursor: pointer;
+ color: inherit;
+}
+div.dt-button-collection .dt-button.dt-button-active {
+ background: none;
+ box-shadow: none;
+}
+div.dt-button-collection .dt-button.disabled {
+ cursor: default;
+ opacity: 0.4;
+}
+div.dt-button-collection .dt-button:hover:not(.disabled) {
+ border: none;
+ background: rgba(153, 153, 153, 0.1);
+ box-shadow: none;
+}
+div.dt-button-collection div.dt-button-split {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: stretch;
- margin: 4px 0 2px 0;
}
-div.dt-button-collection div.dt-btn-split-wrapper button.dt-button {
+div.dt-button-collection div.dt-button-split button.dt-button {
margin: 0;
display: inline-block;
width: 0;
flex-grow: 1;
flex-shrink: 0;
flex-basis: 50px;
- border-radius: 0;
-}
-div.dt-button-collection div.dt-btn-split-wrapper button.dt-btn-split-drop {
- min-width: 20px;
- flex-grow: 0;
- flex-shrink: 0;
- flex-basis: 0;
-}
-div.dt-button-collection div.dt-btn-split-wrapper:first-child {
- margin-top: 0;
-}
-div.dt-button-collection div.dt-btn-split-wrapper:first-child button.dt-button {
- border-top-left-radius: 3px;
}
-div.dt-button-collection div.dt-btn-split-wrapper:first-child button.dt-btn-split-drop {
- border-top-right-radius: 3px;
+div.dt-button-collection div.dt-button-split button.dt-button-split-drop {
+ min-width: 33px;
+ flex: 0;
}
-div.dt-button-collection div.dt-btn-split-wrapper:last-child button.dt-button {
- border-bottom-left-radius: 3px;
-}
-div.dt-button-collection div.dt-btn-split-wrapper:last-child button.dt-btn-split-drop {
- border-bottom-right-radius: 3px;
-}
-div.dt-button-collection div.dt-btn-split-wrapper:active:not(.disabled) button.dt-button, div.dt-button-collection div.dt-btn-split-wrapper.active:not(.disabled) button.dt-button {
- background-color: #dadada;
- /* Fallback */
- background: linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#f0f0f0", EndColorStr="#dadada");
- box-shadow: inset 0px 0px 4px #666;
-}
-div.dt-button-collection div.dt-btn-split-wrapper:active:not(.disabled) button.dt-btn-split-drop, div.dt-button-collection div.dt-btn-split-wrapper.active:not(.disabled) button.dt-btn-split-drop {
- box-shadow: none;
-}
-div.dt-button-collection.fixed .dt-button:first-child {
- margin-top: 0;
- border-top-left-radius: 0;
- border-top-right-radius: 0;
-}
-div.dt-button-collection.fixed .dt-button:last-child {
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
+div.dt-button-collection.fixed .dt-button {
+ border-radius: 0.25em;
+ background: rgba(255, 255, 255, 0.1);
}
div.dt-button-collection.fixed {
position: fixed;
@@ -964,6 +1140,7 @@ div.dt-button-collection.fixed {
margin-left: -75px;
border-radius: 5px;
background-color: white;
+ padding: 0.5em;
}
div.dt-button-collection.fixed.two-column {
margin-left: -200px;
@@ -998,10 +1175,6 @@ div.dt-button-collection.fixed > :last-child {
}
div.dt-button-collection.two-column > :last-child, div.dt-button-collection.three-column > :last-child, div.dt-button-collection.four-column > :last-child {
display: block !important;
- -webkit-column-gap: 8px;
- -moz-column-gap: 8px;
- -ms-column-gap: 8px;
- -o-column-gap: 8px;
column-gap: 8px;
}
div.dt-button-collection.two-column > :last-child > *, div.dt-button-collection.three-column > :last-child > *, div.dt-button-collection.four-column > :last-child > * {
@@ -1086,27 +1259,15 @@ div.dt-button-background {
left: 0;
width: 100%;
height: 100%;
- background: rgba(0, 0, 0, 0.7);
- /* Fallback */
- background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
- /* W3C Markup, IE10 Release Preview */
+ background: rgba(0, 0, 0, 0.7); /* Fallback */
+ background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%); /* W3C Markup, IE10 Release Preview */
z-index: 2001;
}
-@media screen and (max-width: 640px) {
- div.dt-buttons {
- float: none !important;
- text-align: center;
- }
-}
-button.dt-button.processing,
-div.dt-button.processing,
-a.dt-button.processing {
+.dt-button.processing {
color: rgba(0, 0, 0, 0.2);
}
-button.dt-button.processing:after,
-div.dt-button.processing:after,
-a.dt-button.processing:after {
+.dt-button.processing:after {
position: absolute;
top: 50%;
left: 50%;
@@ -1116,7 +1277,7 @@ a.dt-button.processing:after {
box-sizing: border-box;
display: block;
content: " ";
- border: 2px solid #282828;
+ border: 2px solid rgb(40, 40, 40);
border-radius: 50%;
border-left-color: transparent;
border-right-color: transparent;
@@ -1127,64 +1288,139 @@ a.dt-button.processing:after {
-moz-animation: dtb-spinner 1500ms infinite linear;
}
-button.dt-btn-split-drop {
- margin-left: calc(-1px - 0.333em);
- padding-bottom: calc(0.5em - 1px);
- border-radius: 0px 1px 1px 0px;
- color: rgba(70, 70, 70, 0.9);
- border-left: none;
+@media screen and (max-width: 640px) {
+ div.dt-buttons {
+ float: none !important;
+ text-align: center;
+ }
}
-button.dt-btn-split-drop span.dt-btn-split-drop-arrow {
- position: relative;
- top: -1px;
- left: -2px;
- font-size: 8px;
+html.dark div.dt-buttons > .dt-button,
+html.dark div.dt-buttons > div.dt-button-split .dt-button {
+ border: 1px solid rgb(89, 91, 94);
+ background: rgba(255, 255, 255, 0.15);
}
-button.dt-btn-split-drop:hover {
- z-index: 2;
+html.dark div.dt-buttons > .dt-button.dt-button-active:not(.disabled),
+html.dark div.dt-buttons > div.dt-button-split .dt-button.dt-button-active:not(.disabled) {
+ background: rgba(179, 179, 179, 0.15);
+ box-shadow: inset 1px 1px 2px black;
}
-
-button.buttons-split {
- border-right: 1px solid rgba(70, 70, 70, 0);
- border-radius: 1px 0px 0px 1px;
+html.dark div.dt-buttons > .dt-button.dt-button-active:not(.disabled):hover:not(.disabled),
+html.dark div.dt-buttons > div.dt-button-split .dt-button.dt-button-active:not(.disabled):hover:not(.disabled) {
+ background: rgba(128, 128, 128, 0.15);
+ box-shadow: inset 1px 1px 3px black;
}
-
-button.dt-btn-split-drop-button {
- background-color: white;
+html.dark div.dt-buttons > .dt-button:hover:not(.disabled),
+html.dark div.dt-buttons > div.dt-button-split .dt-button:hover:not(.disabled) {
+ background: rgba(179, 179, 179, 0.15);
}
-button.dt-btn-split-drop-button:hover {
- background-color: white;
+html.dark div.dt-buttons > .dt-button:focus:not(.disabled),
+html.dark div.dt-buttons > div.dt-button-split .dt-button:focus:not(.disabled) {
+ outline: 2px solid rgb(110, 168, 254);
+}
+html.dark div.dt-buttons > div.dt-button-split .dt-button:first-child {
+ border-right: 1px solid rgba(255, 255, 255, 0.1);
+}
+html.dark div.dt-buttons > div.dt-button-split .dt-button:first-child:hover {
+ border-right: 1px solid rgb(89, 91, 94);
+}
+html.dark div.dt-buttons > div.dt-button-split .dt-button:last-child:hover {
+ border-left: 1px solid rgb(89, 91, 94);
+}
+html.dark div.dt-button-collection {
+ border: 1px solid rgba(255, 255, 255, 0.15);
+ background-color: rgb(33, 37, 41);
+ box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
+}
+html.dark div.dt-button-info {
+ background-color: var(--dt-html-background);
+ border: 1px solid rgba(255, 255, 255, 0.15);
}
-table.dataTable thead tr > .dtfc-fixed-left,
-table.dataTable thead tr > .dtfc-fixed-right {
- z-index: 1;
+table.dataTable thead tr > .dtfc-fixed-start,
+table.dataTable thead tr > .dtfc-fixed-end,
+table.dataTable tfoot tr > .dtfc-fixed-start,
+table.dataTable tfoot tr > .dtfc-fixed-end {
+ top: 0;
+ bottom: 0;
+ z-index: 3;
background-color: white;
}
-table.dataTable tbody tr > .dtfc-fixed-left,
-table.dataTable tbody tr > .dtfc-fixed-right {
+table.dataTable tbody tr > .dtfc-fixed-start,
+table.dataTable tbody tr > .dtfc-fixed-end {
z-index: 1;
background-color: white;
}
-
-div.dtfc-left-top-blocker,
-div.dtfc-right-top-blocker {
- background-color: white;
+table.dataTable tr > .dtfc-fixed-left::after,
+table.dataTable tr > .dtfc-fixed-right::after {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 10px;
+ transition: box-shadow 0.3s;
+ content: "";
+ pointer-events: none;
+}
+table.dataTable tr > .dtfc-fixed-left::after {
+ right: 0;
+ transform: translateX(100%);
+}
+table.dataTable tr > .dtfc-fixed-right::after {
+ left: 0;
+ transform: translateX(-80%);
+}
+table.dataTable.dtfc-scrolling-left tr > .dtfc-fixed-left::after {
+ box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.2);
+}
+table.dataTable.dtfc-scrolling-right tr > .dtfc-fixed-right::after {
+ box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.2);
+}
+table.dataTable.dtfc-scrolling-right tr > .dtfc-fixed-right + .dtfc-fixed-right::after {
+ box-shadow: none;
}
-
-table.fixedHeader-floating {
+div.dt-scroll,
+div.dtfh-floatingparent {
+ position: relative;
+}
+div.dt-scroll div.dtfc-top-blocker,
+div.dt-scroll div.dtfc-bottom-blocker,
+div.dtfh-floatingparent div.dtfc-top-blocker,
+div.dtfh-floatingparent div.dtfc-bottom-blocker {
+ position: absolute;
background-color: white;
}
-table.fixedHeader-floating.no-footer {
- border-bottom-width: 0;
+html.dark table.dataTable thead tr > .dtfc-fixed-start,
+html.dark table.dataTable thead tr > .dtfc-fixed-end,
+html.dark table.dataTable tfoot tr > .dtfc-fixed-start,
+html.dark table.dataTable tfoot tr > .dtfc-fixed-end {
+ background-color: var(--dt-html-background);
+}
+html.dark table.dataTable tbody tr > .dtfc-fixed-start,
+html.dark table.dataTable tbody tr > .dtfc-fixed-end {
+ background-color: var(--dt-html-background);
+}
+html.dark table.dataTable.dtfc-scrolling-left tbody > tr > .dtfc-fixed-left::after {
+ box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.3);
+}
+html.dark table.dataTable.dtfc-scrolling-right tbody > tr > .dtfc-fixed-right::after {
+ box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.3);
+}
+html.dark table.dataTable.dtfc-scrolling-right tbody > tr > .dtfc-fixed-right + .dtfc-fixed-right::after {
+ box-shadow: none;
+}
+html.dark div.dtfc-top-blocker,
+html.dark div.dtfc-bottom-blocker {
+ background-color: var(--dt-html-background);
}
+
+table.fixedHeader-floating,
table.fixedHeader-locked {
- position: absolute !important;
- background-color: white;
+ position: relative !important;
+ background-color: var(--dt-html-background);
+ background-color: var(--dt-html-background);
}
@media print {
@@ -1195,7 +1431,7 @@ table.fixedHeader-locked {
table.dataTable tr.dtrg-group th {
- background-color: #e0e0e0;
+ background-color: rgba(0, 0, 0, 0.1);
text-align: left;
}
@@ -1208,7 +1444,7 @@ table.dataTable tr.dtrg-group.dtrg-level-2 th,
table.dataTable tr.dtrg-group.dtrg-level-3 th,
table.dataTable tr.dtrg-group.dtrg-level-4 th,
table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f0f0f0;
+ background-color: rgba(0, 0, 0, 0.05);
padding-top: 0.25em;
padding-bottom: 0.25em;
padding-left: 2em;
@@ -1216,25 +1452,38 @@ table.dataTable tr.dtrg-group.dtrg-level-5 th {
}
table.dataTable tr.dtrg-group.dtrg-level-2 th {
- background-color: #f3f3f3;
+ background-color: rgba(0, 0, 0, 0.01);
padding-left: 2.5em;
}
table.dataTable tr.dtrg-group.dtrg-level-3 th {
- background-color: #f3f3f3;
+ background-color: rgba(0, 0, 0, 0.01);
padding-left: 3em;
}
table.dataTable tr.dtrg-group.dtrg-level-4 th {
- background-color: #f3f3f3;
+ background-color: rgba(0, 0, 0, 0.01);
padding-left: 3.5em;
}
table.dataTable tr.dtrg-group.dtrg-level-5 th {
- background-color: #f3f3f3;
+ background-color: rgba(0, 0, 0, 0.01);
padding-left: 4em;
}
+html.dark table.dataTable tr.dtrg-group th {
+ background-color: rgba(255, 255, 255, 0.1);
+}
+html.dark table.dataTable tr.dtrg-group.dtrg-level-1 th {
+ background-color: rgba(255, 255, 255, 0.05);
+}
+html.dark table.dataTable tr.dtrg-group.dtrg-level-2 th,
+html.dark table.dataTable tr.dtrg-group.dtrg-level-3 th,
+html.dark table.dataTable tr.dtrg-group.dtrg-level-4 th,
+html.dark table.dataTable tr.dtrg-group.dtrg-level-5 th {
+ background-color: rgba(255, 255, 255, 0.01);
+}
+
div.dts {
display: block !important;
@@ -1248,7 +1497,7 @@ div.dts div.dts_loading {
}
div.dts div.dts_label {
position: absolute;
- right: 10px;
+ right: 20px;
background: rgba(0, 0, 0, 0.8);
color: white;
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
@@ -1258,16 +1507,34 @@ div.dts div.dts_label {
z-index: 2;
display: none;
}
+div.dts div.dt-scroll-body,
div.dts div.dataTables_scrollBody {
- background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px);
+ background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.025), rgba(0, 0, 0, 0.025) 10px, rgba(0, 0, 0, 0) 10px, rgba(0, 0, 0, 0) 20px);
}
+div.dts div.dt-scroll-body table,
div.dts div.dataTables_scrollBody table {
background-color: white;
z-index: 2;
}
+div.dts div.dt-length,
+div.dts div.dt-paging,
div.dts div.dataTables_paginate,
div.dts div.dataTables_length {
display: none;
}
+html.dark div.dts div.dts_label {
+ background: rgba(255, 255, 255, 0.8);
+ color: black;
+}
+html.dark div.dts div.dt-scroll-body,
+html.dark div.dts div.dataTables_scrollBody {
+ background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025) 10px, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0) 20px);
+}
+html.dark div.dts div.dt-scroll-body table,
+html.dark div.dts div.dataTables_scrollBody table {
+ background-color: var(--dt-html-background);
+ z-index: 2;
+}
+
diff --git a/web/DataTables/datatables.js b/web/DataTables/datatables.js
index 4f3d129..54d94e6 100644
--- a/web/DataTables/datatables.js
+++ b/web/DataTables/datatables.js
@@ -4,24 +4,21 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
- * https://datatables.net/download/#dt/jq-3.6.0/jszip-2.5.0/pdfmake-0.1.36/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/fc-4.1.0/fh-3.2.4/rg-1.2.0/sc-2.0.7
+ * https://datatables.net/download/#dt/jq-3.7.0/jszip-3.10.1/pdfmake-0.2.7/dt-2.2.2/b-3.2.2/b-html5-3.2.2/b-print-3.2.2/fc-5.0.4/fh-4.0.1/rg-1.5.1/sc-2.4.3
*
* Included libraries:
- * jQuery 3 3.6.0, JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.12.1, Buttons 2.2.3, HTML5 export 2.2.3, Print view 2.2.3, FixedColumns 4.1.0, FixedHeader 3.2.4, RowGroup 1.2.0, Scroller 2.0.7
+ * jQuery 3.7.0, JSZip 3.10.1, pdfmake 0.2.7, DataTables 2.2.2, Buttons 3.2.2, HTML5 export 3.2.2, Print view 3.2.2, FixedColumns 5.0.4, FixedHeader 4.0.1, RowGroup 1.5.1, Scroller 2.4.3
*/
/*!
- * jQuery JavaScript Library v3.6.0
+ * jQuery JavaScript Library v3.7.0
* https://jquery.com/
*
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
- * Date: 2021-03-02T17:08Z
+ * Date: 2023-05-11T18:29Z
*/
( function( global, factory ) {
@@ -35,7 +32,7 @@
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
+ // See ticket trac-14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
@@ -162,8 +159,9 @@ function toType( obj ) {
-var
- version = "3.6.0",
+var version = "3.7.0",
+
+ rhtmlSuffix = /HTML$/i,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -409,6 +407,33 @@ jQuery.extend( {
return obj;
},
+
+ // Retrieve the text value of an array of DOM nodes
+ text: function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+
+ // If no nodeType, this is expected to be an array
+ while ( ( node = elem[ i++ ] ) ) {
+
+ // Do not traverse comment nodes
+ ret += jQuery.text( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ return elem.textContent;
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+ },
+
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
@@ -431,6 +456,15 @@ jQuery.extend( {
return arr == null ? -1 : indexOf.call( arr, elem, i );
},
+ isXMLDoc: function( elem ) {
+ var namespace = elem && elem.namespaceURI,
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;
+
+ // Assume HTML when documentElement doesn't yet exist, such as inside
+ // document fragments.
+ return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
+ },
+
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
merge: function( first, second ) {
@@ -532,43 +566,98 @@ function isArrayLike( obj ) {
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.3.6
- * https://sizzlejs.com/
- *
- * Copyright JS Foundation and other contributors
- * Released under the MIT license
- * https://js.foundation/
- *
- * Date: 2021-02-16
- */
-( function( window ) {
+
+
+function nodeName( elem, name ) {
+
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+
+}
+var pop = arr.pop;
+
+
+var sort = arr.sort;
+
+
+var splice = arr.splice;
+
+
+var whitespace = "[\\x20\\t\\r\\n\\f]";
+
+
+var rtrimCSS = new RegExp(
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
+ "g"
+);
+
+
+
+
+// Note: an element does not contain itself
+jQuery.contains = function( a, b ) {
+ var bup = b && b.parentNode;
+
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+
+ // Support: IE 9 - 11+
+ // IE doesn't have `contains` on SVG.
+ a.contains ?
+ a.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ) );
+};
+
+
+
+
+// CSS string/identifier serialization
+// https://drafts.csswg.org/cssom/#common-serializing-idioms
+var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
+
+function fcssescape( ch, asCodePoint ) {
+ if ( asCodePoint ) {
+
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
+ if ( ch === "\0" ) {
+ return "\uFFFD";
+ }
+
+ // Control characters and (dependent upon position) numbers get escaped as code points
+ return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+ }
+
+ // Other potentially-special ASCII characters get backslash-escaped
+ return "\\" + ch;
+}
+
+jQuery.escapeSelector = function( sel ) {
+ return ( sel + "" ).replace( rcssescape, fcssescape );
+};
+
+
+
+
+var preferredDoc = document,
+ pushNative = push;
+
+( function() {
+
var i,
- support,
Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
outermostContext,
sortInput,
hasDuplicate,
+ push = pushNative,
// Local document vars
- setDocument,
document,
- docElem,
+ documentElement,
documentIsHTML,
rbuggyQSA,
- rbuggyMatches,
matches,
- contains,
// Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
+ expando = jQuery.expando,
dirruns = 0,
done = 0,
classCache = createCache(),
@@ -582,47 +671,22 @@ var i,
return 0;
},
- // Instance methods
- hasOwn = ( {} ).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- pushNative = arr.push,
- push = arr.push,
- slice = arr.slice,
-
- // Use a stripped-down indexOf as it's faster than native
- // https://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[ i ] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
- "ismap|loop|multiple|open|readonly|required|scoped",
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
+ "loop|multiple|open|readonly|required|scoped",
// Regular expressions
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
// Operator (capture 2)
"*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5]
- // or strings [capture 3 or capture 4]"
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
whitespace + "*\\]",
@@ -641,101 +705,88 @@ var i,
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
- whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
- "*" ),
+ rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
+ whitespace + "*" ),
rdescend = new RegExp( whitespace + "|>" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
- whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
- whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ ID: new RegExp( "^#(" + identifier + ")" ),
+ CLASS: new RegExp( "^\\.(" + identifier + ")" ),
+ TAG: new RegExp( "^(" + identifier + "|[*])" ),
+ ATTR: new RegExp( "^" + attributes ),
+ PSEUDO: new RegExp( "^" + pseudos ),
+ CHILD: new RegExp(
+ "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
+ whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
+ whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace +
+ needsContext: new RegExp( "^" + whitespace +
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
- rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
- rnative = /^[^{]+\{\s*\[native \w/,
-
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rsibling = /[+~]/,
// CSS escapes
- // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
+ // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
+ "?|\\\\([^\\r\\n\\f])", "g" ),
funescape = function( escape, nonHex ) {
var high = "0x" + escape.slice( 1 ) - 0x10000;
- return nonHex ?
+ if ( nonHex ) {
// Strip the backslash prefix from a non-hex escape sequence
- nonHex :
-
- // Replace a hexadecimal escape sequence with the encoded Unicode code point
- // Support: IE <=11+
- // For values outside the Basic Multilingual Plane (BMP), manually construct a
- // surrogate pair
- high < 0 ?
- String.fromCharCode( high + 0x10000 ) :
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // CSS string/identifier serialization
- // https://drafts.csswg.org/cssom/#common-serializing-idioms
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
- fcssescape = function( ch, asCodePoint ) {
- if ( asCodePoint ) {
-
- // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
- if ( ch === "\0" ) {
- return "\uFFFD";
- }
-
- // Control characters and (dependent upon position) numbers get escaped as code points
- return ch.slice( 0, -1 ) + "\\" +
- ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+ return nonHex;
}
- // Other potentially-special ASCII characters get backslash-escaped
- return "\\" + ch;
+ // Replace a hexadecimal escape sequence with the encoded Unicode code point
+ // Support: IE <=11+
+ // For values outside the Basic Multilingual Plane (BMP), manually construct a
+ // surrogate pair
+ return high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
},
- // Used for iframes
- // See setDocument()
+ // Used for iframes; see `setDocument`.
+ // Support: IE 9 - 11+, Edge 12 - 18+
// Removing the function wrapper causes a "Permission Denied"
- // error in IE
+ // error in IE/Edge.
unloadHandler = function() {
setDocument();
},
inDisabledFieldset = addCombinator(
function( elem ) {
- return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
+ return elem.disabled === true && nodeName( elem, "fieldset" );
},
{ dir: "parentNode", next: "legend" }
);
+// Support: IE <=9 only
+// Accessing document.activeElement can throw unexpectedly
+// https://bugs.jquery.com/ticket/13393
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
// Optimize for push.apply( _, NodeList )
try {
push.apply(
@@ -743,32 +794,22 @@ try {
preferredDoc.childNodes
);
- // Support: Android<4.0
+ // Support: Android <=4.0
// Detect silently failing push.apply
// eslint-disable-next-line no-unused-expressions
arr[ preferredDoc.childNodes.length ].nodeType;
} catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
+ push = {
+ apply: function( target, els ) {
pushNative.apply( target, slice.call( els ) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
-
- // Can't trust NodeList.length
- while ( ( target[ j++ ] = els[ i++ ] ) ) {}
- target.length = j - 1;
+ },
+ call: function( target ) {
+ pushNative.apply( target, slice.call( arguments, 1 ) );
}
};
}
-function Sizzle( selector, context, results, seed ) {
+function find( selector, context, results, seed ) {
var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument,
@@ -802,11 +843,10 @@ function Sizzle( selector, context, results, seed ) {
if ( nodeType === 9 ) {
if ( ( elem = context.getElementById( m ) ) ) {
- // Support: IE, Opera, Webkit
- // TODO: identify versions
+ // Support: IE 9 only
// getElementById can match elements by name instead of ID
if ( elem.id === m ) {
- results.push( elem );
+ push.call( results, elem );
return results;
}
} else {
@@ -816,14 +856,13 @@ function Sizzle( selector, context, results, seed ) {
// Element context
} else {
- // Support: IE, Opera, Webkit
- // TODO: identify versions
+ // Support: IE 9 only
// getElementById can match elements by name instead of ID
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
- contains( context, elem ) &&
+ find.contains( context, elem ) &&
elem.id === m ) {
- results.push( elem );
+ push.call( results, elem );
return results;
}
}
@@ -834,22 +873,15 @@ function Sizzle( selector, context, results, seed ) {
return results;
// Class selector
- } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
+ } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
push.apply( results, context.getElementsByClassName( m ) );
return results;
}
}
// Take advantage of querySelectorAll
- if ( support.qsa &&
- !nonnativeSelectorCache[ selector + " " ] &&
- ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
-
- // Support: IE 8 only
- // Exclude object elements
- ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
+ if ( !nonnativeSelectorCache[ selector + " " ] &&
+ ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
newSelector = selector;
newContext = context;
@@ -862,7 +894,7 @@ function Sizzle( selector, context, results, seed ) {
// as such selectors are not recognized by querySelectorAll.
// Thanks to Andrew Dupont for this technique.
if ( nodeType === 1 &&
- ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
+ ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
// Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
@@ -870,11 +902,15 @@ function Sizzle( selector, context, results, seed ) {
// We can use :scope instead of the ID hack if the browser
// supports it & if we're not changing the context.
- if ( newContext !== context || !support.scope ) {
+ // Support: IE 11+, Edge 17 - 18+
+ // IE/Edge sometimes throw a "Permission denied" error when
+ // strict-comparing two documents; shallow comparisons work.
+ // eslint-disable-next-line eqeqeq
+ if ( newContext != context || !support.scope ) {
// Capture the context ID, setting it first if necessary
if ( ( nid = context.getAttribute( "id" ) ) ) {
- nid = nid.replace( rcssescape, fcssescape );
+ nid = jQuery.escapeSelector( nid );
} else {
context.setAttribute( "id", ( nid = expando ) );
}
@@ -907,7 +943,7 @@ function Sizzle( selector, context, results, seed ) {
}
// All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
+ return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
}
/**
@@ -921,7 +957,8 @@ function createCache() {
function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ // Use (key + " ") to avoid collision with native prototype properties
+ // (see https://github.com/jquery/sizzle/issues/157)
if ( keys.push( key + " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
@@ -933,7 +970,7 @@ function createCache() {
}
/**
- * Mark a function for special use by Sizzle
+ * Mark a function for special use by jQuery selector module
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
@@ -964,56 +1001,13 @@ function assert( fn ) {
}
}
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
- var arr = attrs.split( "|" ),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[ i ] ] = handler;
- }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- a.sourceIndex - b.sourceIndex;
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( ( cur = cur.nextSibling ) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
-}
-
/**
* Returns a function to use in pseudos for input types
* @param {String} type
*/
function createInputPseudo( type ) {
return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
+ return nodeName( elem, "input" ) && elem.type === type;
};
}
@@ -1023,8 +1017,8 @@ function createInputPseudo( type ) {
*/
function createButtonPseudo( type ) {
return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return ( name === "input" || name === "button" ) && elem.type === type;
+ return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
+ elem.type === type;
};
}
@@ -1060,14 +1054,13 @@ function createDisabledPseudo( disabled ) {
}
}
- // Support: IE 6 - 11
+ // Support: IE 6 - 11+
// Use the isDisabled shortcut property to check for disabled fieldset ancestors
return elem.isDisabled === disabled ||
// Where there is no isDisabled, check manually
- /* jshint -W018 */
elem.isDisabled !== !disabled &&
- inDisabledFieldset( elem ) === disabled;
+ inDisabledFieldset( elem ) === disabled;
}
return elem.disabled === disabled;
@@ -1107,7 +1100,7 @@ function createPositionalPseudo( fn ) {
}
/**
- * Checks a node for validity as a Sizzle context
+ * Checks a node for validity as a jQuery selector context
* @param {Element|Object=} context
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
@@ -1115,31 +1108,13 @@ function testContext( context ) {
return context && typeof context.getElementsByTagName !== "undefined" && context;
}
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
- var namespace = elem && elem.namespaceURI,
- docElem = elem && ( elem.ownerDocument || elem ).documentElement;
-
- // Support: IE <=8
- // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
- // https://bugs.jquery.com/ticket/4833
- return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
-};
-
/**
* Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @param {Element|Object} [node] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
-setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, subWindow,
+function setDocument( node ) {
+ var subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
@@ -1153,11 +1128,17 @@ setDocument = Sizzle.setDocument = function( node ) {
// Update global variables
document = doc;
- docElem = document.documentElement;
- documentIsHTML = !isXML( document );
+ documentElement = document.documentElement;
+ documentIsHTML = !jQuery.isXMLDoc( document );
+
+ // Support: iOS 7 only, IE 9 - 11+
+ // Older browsers didn't support unprefixed `matches`.
+ matches = documentElement.matches ||
+ documentElement.webkitMatchesSelector ||
+ documentElement.msMatchesSelector;
// Support: IE 9 - 11+, Edge 12 - 18+
- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
@@ -1165,75 +1146,67 @@ setDocument = Sizzle.setDocument = function( node ) {
if ( preferredDoc != document &&
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
- // Support: IE 11, Edge
- if ( subWindow.addEventListener ) {
- subWindow.addEventListener( "unload", unloadHandler, false );
-
- // Support: IE 9 - 10 only
- } else if ( subWindow.attachEvent ) {
- subWindow.attachEvent( "onunload", unloadHandler );
- }
+ // Support: IE 9 - 11+, Edge 12 - 18+
+ subWindow.addEventListener( "unload", unloadHandler );
}
- // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
- // Safari 4 - 5 only, Opera <=11.6 - 12.x only
- // IE/Edge & older browsers don't support the :scope pseudo-class.
- // Support: Safari 6.0 only
- // Safari 6.0 supports :scope but it's an alias of :root there.
- support.scope = assert( function( el ) {
- docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
- return typeof el.querySelectorAll !== "undefined" &&
- !el.querySelectorAll( ":scope fieldset div" ).length;
+ // Support: IE <10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programmatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert( function( el ) {
+ documentElement.appendChild( el ).id = jQuery.expando;
+ return !document.getElementsByName ||
+ !document.getElementsByName( jQuery.expando ).length;
} );
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert( function( el ) {
- el.className = "i";
- return !el.getAttribute( "className" );
+ // Support: IE 9 only
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node.
+ support.disconnectedMatch = assert( function( el ) {
+ return matches.call( el, "*" );
} );
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert( function( el ) {
- el.appendChild( document.createComment( "" ) );
- return !el.getElementsByTagName( "*" ).length;
+ // Support: IE 9 - 11+, Edge 12 - 18+
+ // IE/Edge don't support the :scope pseudo-class.
+ support.scope = assert( function() {
+ return document.querySelectorAll( ":scope" );
} );
- // Support: IE<9
- support.getElementsByClassName = rnative.test( document.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programmatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert( function( el ) {
- docElem.appendChild( el ).id = expando;
- return !document.getElementsByName || !document.getElementsByName( expando ).length;
+ // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
+ // Make sure the `:has()` argument is parsed unforgivingly.
+ // We include `*` in the test to detect buggy implementations that are
+ // _selectively_ forgiving (specifically when the list includes at least
+ // one valid selector).
+ // Note that we treat complete lack of support for `:has()` as if it were
+ // spec-compliant support, which is fine because use of `:has()` in such
+ // environments will fail in the qSA path and fall back to jQuery traversal
+ // anyway.
+ support.cssHas = assert( function() {
+ try {
+ document.querySelector( ":has(*,:jqfake)" );
+ return false;
+ } catch ( e ) {
+ return true;
+ }
} );
// ID filter and find
if ( support.getById ) {
- Expr.filter[ "ID" ] = function( id ) {
+ Expr.filter.ID = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute( "id" ) === attrId;
};
};
- Expr.find[ "ID" ] = function( id, context ) {
+ Expr.find.ID = function( id, context ) {
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var elem = context.getElementById( id );
return elem ? [ elem ] : [];
}
};
} else {
- Expr.filter[ "ID" ] = function( id ) {
+ Expr.filter.ID = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== "undefined" &&
@@ -1244,7 +1217,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Support: IE 6 - 7 only
// getElementById is not reliable as a find shortcut
- Expr.find[ "ID" ] = function( id, context ) {
+ Expr.find.ID = function( id, context ) {
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var node, i, elems,
elem = context.getElementById( id );
@@ -1274,40 +1247,18 @@ setDocument = Sizzle.setDocument = function( node ) {
}
// Tag
- Expr.find[ "TAG" ] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
+ Expr.find.TAG = function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
-
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( ( elem = results[ i++ ] ) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
+ // DocumentFragment nodes don't have gEBTN
+ } else {
+ return context.querySelectorAll( tag );
+ }
+ };
// Class
- Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
+ Expr.find.CLASS = function( className, context ) {
if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
return context.getElementsByClassName( className );
}
@@ -1318,177 +1269,94 @@ setDocument = Sizzle.setDocument = function( node ) {
// QSA and matchesSelector support
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See https://bugs.jquery.com/ticket/13378
rbuggyQSA = [];
- if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert( function( el ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert( function( el ) {
+ var input;
- var input;
+ documentElement.appendChild( el ).innerHTML =
+ "" +
+ "";
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // https://bugs.jquery.com/ticket/12359
- docElem.appendChild( el ).innerHTML = "" +
- "";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !el.querySelectorAll( "[selected]" ).length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
- if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push( "~=" );
- }
-
- // Support: IE 11+, Edge 15 - 18+
- // IE 11/Edge don't find elements on a `[name='']` query in some cases.
- // Adding a temporary attribute to the document before the selection works
- // around the issue.
- // Interestingly, IE 10 & older don't seem to have the issue.
- input = document.createElement( "input" );
- input.setAttribute( "name", "" );
- el.appendChild( input );
- if ( !el.querySelectorAll( "[name='']" ).length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
- whitespace + "*(?:''|\"\")" );
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !el.querySelectorAll( ":checked" ).length ) {
- rbuggyQSA.push( ":checked" );
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibling-combinator selector` fails
- if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push( ".#.+[+~]" );
- }
-
- // Support: Firefox <=3.6 - 5 only
- // Old Firefox doesn't throw on a badly-escaped identifier.
- el.querySelectorAll( "\\\f" );
- rbuggyQSA.push( "[\\r\\n\\f]" );
- } );
-
- assert( function( el ) {
- el.innerHTML = "" +
- "";
-
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = document.createElement( "input" );
- input.setAttribute( "type", "hidden" );
- el.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( el.querySelectorAll( "[name=d]" ).length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
+ // Support: iOS <=7 - 8 only
+ // Boolean attributes and "value" are not treated correctly in some XML documents
+ if ( !el.querySelectorAll( "[selected]" ).length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
- // Support: IE9-11+
- // IE's :disabled selector does not pick up the children of disabled fieldsets
- docElem.appendChild( el ).disabled = true;
- if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
+ // Support: iOS <=7 - 8 only
+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push( "~=" );
+ }
- // Support: Opera 10 - 11 only
- // Opera 10-11 does not throw on post-comma invalid pseudos
- el.querySelectorAll( "*,:x" );
- rbuggyQSA.push( ",.*:" );
- } );
- }
+ // Support: iOS 8 only
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibling-combinator selector` fails
+ if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push( ".#.+[+~]" );
+ }
- if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector ) ) ) ) {
+ // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
+ // In some of the document kinds, these selectors wouldn't work natively.
+ // This is probably OK but for backwards compatibility we want to maintain
+ // handling them through jQuery traversal in jQuery 3.x.
+ if ( !el.querySelectorAll( ":checked" ).length ) {
+ rbuggyQSA.push( ":checked" );
+ }
- assert( function( el ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ input = document.createElement( "input" );
+ input.setAttribute( "type", "hidden" );
+ el.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE 9 - 11+
+ // IE's :disabled selector does not pick up the children of disabled fieldsets
+ // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
+ // In some of the document kinds, these selectors wouldn't work natively.
+ // This is probably OK but for backwards compatibility we want to maintain
+ // handling them through jQuery traversal in jQuery 3.x.
+ documentElement.appendChild( el ).disabled = true;
+ if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Support: IE 11+, Edge 15 - 18+
+ // IE 11/Edge don't find elements on a `[name='']` query in some cases.
+ // Adding a temporary attribute to the document before the selection works
+ // around the issue.
+ // Interestingly, IE 10 & older don't seem to have the issue.
+ input = document.createElement( "input" );
+ input.setAttribute( "name", "" );
+ el.appendChild( input );
+ if ( !el.querySelectorAll( "[name='']" ).length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
+ whitespace + "*(?:''|\"\")" );
+ }
+ } );
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( el, "*" );
+ if ( !support.cssHas ) {
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( el, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- } );
+ // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
+ // Our regular `try-catch` mechanism fails to detect natively-unsupported
+ // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
+ // in browsers that parse the `:has()` argument as a forgiving selector list.
+ // https://drafts.csswg.org/selectors/#relational now requires the argument
+ // to be parsed unforgivingly, but browsers have not yet fully adjusted.
+ rbuggyQSA.push( ":has" );
}
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully self-exclusive
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ) );
- } :
- function( a, b ) {
- if ( b ) {
- while ( ( b = b.parentNode ) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
/* Sorting
---------------------------------------------------------------------- */
// Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
+ sortOrder = function( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
@@ -1522,8 +1390,8 @@ setDocument = Sizzle.setDocument = function( node ) {
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
- if ( a == document || a.ownerDocument == preferredDoc &&
- contains( preferredDoc, a ) ) {
+ if ( a === document || a.ownerDocument == preferredDoc &&
+ find.contains( preferredDoc, a ) ) {
return -1;
}
@@ -1531,100 +1399,33 @@ setDocument = Sizzle.setDocument = function( node ) {
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
- if ( b == document || b.ownerDocument == preferredDoc &&
- contains( preferredDoc, b ) ) {
+ if ( b === document || b.ownerDocument == preferredDoc &&
+ find.contains( preferredDoc, b ) ) {
return 1;
}
// Maintain original order
return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
0;
}
return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
-
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
-
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- /* eslint-disable eqeqeq */
- return a == document ? -1 :
- b == document ? 1 :
- /* eslint-enable eqeqeq */
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( ( cur = cur.parentNode ) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( ( cur = cur.parentNode ) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[ i ] === bp[ i ] ) {
- i++;
- }
-
- return i ?
-
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[ i ], bp[ i ] ) :
-
- // Otherwise nodes in our document sort first
- // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- /* eslint-disable eqeqeq */
- ap[ i ] == preferredDoc ? -1 :
- bp[ i ] == preferredDoc ? 1 :
- /* eslint-enable eqeqeq */
- 0;
};
return document;
-};
+}
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
+find.matches = function( expr, elements ) {
+ return find( expr, null, null, elements );
};
-Sizzle.matchesSelector = function( elem, expr ) {
+find.matchesSelector = function( elem, expr ) {
setDocument( elem );
- if ( support.matchesSelector && documentIsHTML &&
+ if ( documentIsHTML &&
!nonnativeSelectorCache[ expr + " " ] &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
try {
var ret = matches.call( elem, expr );
@@ -1632,9 +1433,9 @@ Sizzle.matchesSelector = function( elem, expr ) {
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch ( e ) {
@@ -1642,10 +1443,10 @@ Sizzle.matchesSelector = function( elem, expr ) {
}
}
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
+ return find( expr, document, null, [ elem ] ).length > 0;
};
-Sizzle.contains = function( context, elem ) {
+find.contains = function( context, elem ) {
// Set document vars if needed
// Support: IE 11+, Edge 17 - 18+
@@ -1655,10 +1456,11 @@ Sizzle.contains = function( context, elem ) {
if ( ( context.ownerDocument || context ) != document ) {
setDocument( context );
}
- return contains( context, elem );
+ return jQuery.contains( context, elem );
};
-Sizzle.attr = function( elem, name ) {
+
+find.attr = function( elem, name ) {
// Set document vars if needed
// Support: IE 11+, Edge 17 - 18+
@@ -1671,25 +1473,19 @@ Sizzle.attr = function( elem, name ) {
var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
+ // Don't get fooled by Object.prototype properties (see trac-13807)
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
fn( elem, name, !documentIsHTML ) :
undefined;
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- ( val = elem.getAttributeNode( name ) ) && val.specified ?
- val.value :
- null;
-};
+ if ( val !== undefined ) {
+ return val;
+ }
-Sizzle.escape = function( sel ) {
- return ( sel + "" ).replace( rcssescape, fcssescape );
+ return elem.getAttribute( name );
};
-Sizzle.error = function( msg ) {
+find.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
@@ -1697,16 +1493,20 @@ Sizzle.error = function( msg ) {
* Document sorting and removing duplicates
* @param {ArrayLike} results
*/
-Sizzle.uniqueSort = function( results ) {
+jQuery.uniqueSort = function( results ) {
var elem,
duplicates = [],
j = 0,
i = 0;
// Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
+ //
+ // Support: Android <=4.0+
+ // Testing for detecting duplicates is unpredictable so instead assume we can't
+ // depend on duplicate detection in all browsers without a stable sort.
+ hasDuplicate = !support.sortStable;
+ sortInput = !support.sortStable && slice.call( results, 0 );
+ sort.call( results, sortOrder );
if ( hasDuplicate ) {
while ( ( elem = results[ i++ ] ) ) {
@@ -1715,7 +1515,7 @@ Sizzle.uniqueSort = function( results ) {
}
}
while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
+ splice.call( results, duplicates[ j ], 1 );
}
}
@@ -1726,47 +1526,11 @@ Sizzle.uniqueSort = function( results ) {
return results;
};
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
-
- // If no nodeType, this is expected to be an array
- while ( ( node = elem[ i++ ] ) ) {
-
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
-
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
-
- // Do not include comment or processing instruction nodes
-
- return ret;
+jQuery.fn.uniqueSort = function() {
+ return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
};
-Expr = Sizzle.selectors = {
+Expr = jQuery.expr = {
// Can be adjusted by the user
cacheLength: 50,
@@ -1787,12 +1551,12 @@ Expr = Sizzle.selectors = {
},
preFilter: {
- "ATTR": function( match ) {
+ ATTR: function( match ) {
match[ 1 ] = match[ 1 ].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
- match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
- match[ 5 ] || "" ).replace( runescape, funescape );
+ match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
+ .replace( runescape, funescape );
if ( match[ 2 ] === "~=" ) {
match[ 3 ] = " " + match[ 3 ] + " ";
@@ -1801,7 +1565,7 @@ Expr = Sizzle.selectors = {
return match.slice( 0, 4 );
},
- "CHILD": function( match ) {
+ CHILD: function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
@@ -1819,29 +1583,30 @@ Expr = Sizzle.selectors = {
// nth-* requires argument
if ( !match[ 3 ] ) {
- Sizzle.error( match[ 0 ] );
+ find.error( match[ 0 ] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[ 4 ] = +( match[ 4 ] ?
match[ 5 ] + ( match[ 6 ] || 1 ) :
- 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
+ 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
+ );
match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
- // other types prohibit arguments
+ // other types prohibit arguments
} else if ( match[ 3 ] ) {
- Sizzle.error( match[ 0 ] );
+ find.error( match[ 0 ] );
}
return match;
},
- "PSEUDO": function( match ) {
+ PSEUDO: function( match ) {
var excess,
unquoted = !match[ 6 ] && match[ 2 ];
- if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
+ if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
return null;
}
@@ -1870,36 +1635,36 @@ Expr = Sizzle.selectors = {
filter: {
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ TAG: function( nodeNameSelector ) {
+ var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
return nodeNameSelector === "*" ?
function() {
return true;
} :
function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ return nodeName( elem, expectedNodeName );
};
},
- "CLASS": function( className ) {
+ CLASS: function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
- ( pattern = new RegExp( "(^|" + whitespace +
- ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
- className, function( elem ) {
- return pattern.test(
- typeof elem.className === "string" && elem.className ||
- typeof elem.getAttribute !== "undefined" &&
- elem.getAttribute( "class" ) ||
- ""
- );
+ ( pattern = new RegExp( "(^|" + whitespace + ")" + className +
+ "(" + whitespace + "|$)" ) ) &&
+ classCache( className, function( elem ) {
+ return pattern.test(
+ typeof elem.className === "string" && elem.className ||
+ typeof elem.getAttribute !== "undefined" &&
+ elem.getAttribute( "class" ) ||
+ ""
+ );
} );
},
- "ATTR": function( name, operator, check ) {
+ ATTR: function( name, operator, check ) {
return function( elem ) {
- var result = Sizzle.attr( elem, name );
+ var result = find.attr( elem, name );
if ( result == null ) {
return operator === "!=";
@@ -1910,22 +1675,34 @@ Expr = Sizzle.selectors = {
result += "";
- /* eslint-disable max-len */
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- /* eslint-enable max-len */
+ if ( operator === "=" ) {
+ return result === check;
+ }
+ if ( operator === "!=" ) {
+ return result !== check;
+ }
+ if ( operator === "^=" ) {
+ return check && result.indexOf( check ) === 0;
+ }
+ if ( operator === "*=" ) {
+ return check && result.indexOf( check ) > -1;
+ }
+ if ( operator === "$=" ) {
+ return check && result.slice( -check.length ) === check;
+ }
+ if ( operator === "~=" ) {
+ return ( " " + result.replace( rwhitespace, " " ) + " " )
+ .indexOf( check ) > -1;
+ }
+ if ( operator === "|=" ) {
+ return result === check || result.slice( 0, check.length + 1 ) === check + "-";
+ }
+ return false;
};
},
- "CHILD": function( type, what, _argument, first, last ) {
+ CHILD: function( type, what, _argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
@@ -1938,7 +1715,7 @@ Expr = Sizzle.selectors = {
} :
function( elem, _context, xml ) {
- var cache, uniqueCache, outerCache, node, nodeIndex, start,
+ var cache, outerCache, node, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
@@ -1953,7 +1730,7 @@ Expr = Sizzle.selectors = {
node = elem;
while ( ( node = node[ dir ] ) ) {
if ( ofType ?
- node.nodeName.toLowerCase() === name :
+ nodeName( node, name ) :
node.nodeType === 1 ) {
return false;
@@ -1972,17 +1749,8 @@ Expr = Sizzle.selectors = {
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
-
- // ...in a gzip-friendly way
- node = parent;
- outerCache = node[ expando ] || ( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- cache = uniqueCache[ type ] || [];
+ outerCache = parent[ expando ] || ( parent[ expando ] = {} );
+ cache = outerCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex && cache[ 2 ];
node = nodeIndex && parent.childNodes[ nodeIndex ];
@@ -1994,7 +1762,7 @@ Expr = Sizzle.selectors = {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
- uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
@@ -2003,17 +1771,8 @@ Expr = Sizzle.selectors = {
// Use previously-cached element index if available
if ( useCache ) {
-
- // ...in a gzip-friendly way
- node = elem;
- outerCache = node[ expando ] || ( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- cache = uniqueCache[ type ] || [];
+ outerCache = elem[ expando ] || ( elem[ expando ] = {} );
+ cache = outerCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex;
}
@@ -2027,7 +1786,7 @@ Expr = Sizzle.selectors = {
( diff = nodeIndex = 0 ) || start.pop() ) ) {
if ( ( ofType ?
- node.nodeName.toLowerCase() === name :
+ nodeName( node, name ) :
node.nodeType === 1 ) &&
++diff ) {
@@ -2035,13 +1794,7 @@ Expr = Sizzle.selectors = {
if ( useCache ) {
outerCache = node[ expando ] ||
( node[ expando ] = {} );
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- ( outerCache[ node.uniqueID ] = {} );
-
- uniqueCache[ type ] = [ dirruns, diff ];
+ outerCache[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
@@ -2059,19 +1812,19 @@ Expr = Sizzle.selectors = {
};
},
- "PSEUDO": function( pseudo, argument ) {
+ PSEUDO: function( pseudo, argument ) {
// pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
+ // https://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
+ find.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
- // just as Sizzle does
+ // just as jQuery does
if ( fn[ expando ] ) {
return fn( argument );
}
@@ -2085,7 +1838,7 @@ Expr = Sizzle.selectors = {
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
- idx = indexOf( seed, matched[ i ] );
+ idx = indexOf.call( seed, matched[ i ] );
seed[ idx ] = !( matches[ idx ] = matched[ i ] );
}
} ) :
@@ -2101,14 +1854,14 @@ Expr = Sizzle.selectors = {
pseudos: {
// Potentially complex pseudos
- "not": markFunction( function( selector ) {
+ not: markFunction( function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
+ matcher = compile( selector.replace( rtrimCSS, "$1" ) );
return matcher[ expando ] ?
markFunction( function( seed, matches, _context, xml ) {
@@ -2127,22 +1880,23 @@ Expr = Sizzle.selectors = {
input[ 0 ] = elem;
matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
+ // Don't keep the element
+ // (see https://github.com/jquery/sizzle/issues/299)
input[ 0 ] = null;
return !results.pop();
};
} ),
- "has": markFunction( function( selector ) {
+ has: markFunction( function( selector ) {
return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
+ return find( selector, elem ).length > 0;
};
} ),
- "contains": markFunction( function( text ) {
+ contains: markFunction( function( text ) {
text = text.replace( runescape, funescape );
return function( elem ) {
- return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
+ return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
};
} ),
@@ -2152,12 +1906,12 @@ Expr = Sizzle.selectors = {
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
+ // https://www.w3.org/TR/selectors/#lang-pseudo
+ lang: markFunction( function( lang ) {
// lang value must be a valid identifier
if ( !ridentifier.test( lang || "" ) ) {
- Sizzle.error( "unsupported lang: " + lang );
+ find.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
@@ -2176,38 +1930,39 @@ Expr = Sizzle.selectors = {
} ),
// Miscellaneous
- "target": function( elem ) {
+ target: function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
- "root": function( elem ) {
- return elem === docElem;
+ root: function( elem ) {
+ return elem === documentElement;
},
- "focus": function( elem ) {
- return elem === document.activeElement &&
- ( !document.hasFocus || document.hasFocus() ) &&
+ focus: function( elem ) {
+ return elem === safeActiveElement() &&
+ document.hasFocus() &&
!!( elem.type || elem.href || ~elem.tabIndex );
},
// Boolean properties
- "enabled": createDisabledPseudo( false ),
- "disabled": createDisabledPseudo( true ),
+ enabled: createDisabledPseudo( false ),
+ disabled: createDisabledPseudo( true ),
- "checked": function( elem ) {
+ checked: function( elem ) {
// In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return ( nodeName === "input" && !!elem.checked ) ||
- ( nodeName === "option" && !!elem.selected );
+ // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ return ( nodeName( elem, "input" ) && !!elem.checked ) ||
+ ( nodeName( elem, "option" ) && !!elem.selected );
},
- "selected": function( elem ) {
+ selected: function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
+ // Support: IE <=11+
+ // Accessing the selectedIndex property
+ // forces the browser to treat the default option as
+ // selected when in an optgroup.
if ( elem.parentNode ) {
// eslint-disable-next-line no-unused-expressions
elem.parentNode.selectedIndex;
@@ -2217,9 +1972,9 @@ Expr = Sizzle.selectors = {
},
// Contents
- "empty": function( elem ) {
+ empty: function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
+ // https://www.w3.org/TR/selectors/#empty-pseudo
// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
// but not by others (comment: 8; processing instruction: 7; etc.)
// nodeType < 6 works because attributes (2) do not appear as children
@@ -2231,49 +1986,49 @@ Expr = Sizzle.selectors = {
return true;
},
- "parent": function( elem ) {
- return !Expr.pseudos[ "empty" ]( elem );
+ parent: function( elem ) {
+ return !Expr.pseudos.empty( elem );
},
// Element/input types
- "header": function( elem ) {
+ header: function( elem ) {
return rheader.test( elem.nodeName );
},
- "input": function( elem ) {
+ input: function( elem ) {
return rinputs.test( elem.nodeName );
},
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
+ button: function( elem ) {
+ return nodeName( elem, "input" ) && elem.type === "button" ||
+ nodeName( elem, "button" );
},
- "text": function( elem ) {
+ text: function( elem ) {
var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
+ return nodeName( elem, "input" ) && elem.type === "text" &&
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ // Support: IE <10 only
+ // New HTML5 attribute values (e.g., "search") appear
+ // with elem.type === "text"
( ( attr = elem.getAttribute( "type" ) ) == null ||
attr.toLowerCase() === "text" );
},
// Position-in-collection
- "first": createPositionalPseudo( function() {
+ first: createPositionalPseudo( function() {
return [ 0 ];
} ),
- "last": createPositionalPseudo( function( _matchIndexes, length ) {
+ last: createPositionalPseudo( function( _matchIndexes, length ) {
return [ length - 1 ];
} ),
- "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
+ eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
} ),
- "even": createPositionalPseudo( function( matchIndexes, length ) {
+ even: createPositionalPseudo( function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
@@ -2281,7 +2036,7 @@ Expr = Sizzle.selectors = {
return matchIndexes;
} ),
- "odd": createPositionalPseudo( function( matchIndexes, length ) {
+ odd: createPositionalPseudo( function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
@@ -2289,19 +2044,24 @@ Expr = Sizzle.selectors = {
return matchIndexes;
} ),
- "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
- var i = argument < 0 ?
- argument + length :
- argument > length ?
- length :
- argument;
+ lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
+ var i;
+
+ if ( argument < 0 ) {
+ i = argument + length;
+ } else if ( argument > length ) {
+ i = length;
+ } else {
+ i = argument;
+ }
+
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
} ),
- "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
+ gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
@@ -2311,7 +2071,7 @@ Expr = Sizzle.selectors = {
}
};
-Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
+Expr.pseudos.nth = Expr.pseudos.eq;
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
@@ -2326,7 +2086,7 @@ function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
@@ -2354,13 +2114,13 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
matched = false;
// Combinators
- if ( ( match = rcombinators.exec( soFar ) ) ) {
+ if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
matched = match.shift();
tokens.push( {
value: matched,
// Cast descendant combinators to space
- type: match[ 0 ].replace( rtrim, " " )
+ type: match[ 0 ].replace( rtrimCSS, " " )
} );
soFar = soFar.slice( matched.length );
}
@@ -2387,14 +2147,16 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
+ if ( parseOnly ) {
+ return soFar.length;
+ }
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-};
+ return soFar ?
+ find.error( selector ) :
+
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
function toSelector( tokens ) {
var i = 0,
@@ -2427,7 +2189,7 @@ function addCombinator( matcher, combinator, base ) {
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
- var oldCache, uniqueCache, outerCache,
+ var oldCache, outerCache,
newCache = [ dirruns, doneName ];
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
@@ -2444,14 +2206,9 @@ function addCombinator( matcher, combinator, base ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ elem.uniqueID ] ||
- ( outerCache[ elem.uniqueID ] = {} );
-
- if ( skip && skip === elem.nodeName.toLowerCase() ) {
+ if ( skip && nodeName( elem, skip ) ) {
elem = elem[ dir ] || elem;
- } else if ( ( oldCache = uniqueCache[ key ] ) &&
+ } else if ( ( oldCache = outerCache[ key ] ) &&
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
// Assign to newCache so results back-propagate to previous elements
@@ -2459,7 +2216,7 @@ function addCombinator( matcher, combinator, base ) {
} else {
// Reuse newcache so results back-propagate to previous elements
- uniqueCache[ key ] = newCache;
+ outerCache[ key ] = newCache;
// A match means we're done; a fail means we have to keep checking
if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
@@ -2491,7 +2248,7 @@ function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[ i ], results );
+ find( selector, contexts[ i ], results );
}
return results;
}
@@ -2525,38 +2282,37 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction( function( seed, results, context, xml ) {
- var temp, i, elem,
+ var temp, i, elem, matcherOut,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
- elems = seed || multipleContexts(
- selector || "*",
- context.nodeType ? [ context ] : context,
- []
- ),
+ elems = seed ||
+ multipleContexts( selector || "*",
+ context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
- elems,
+ elems;
- matcherOut = matcher ?
+ if ( matcher ) {
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter
+ // or preexisting results,
+ matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
- // ...intermediate processing is necessary
- [] :
+ // ...intermediate processing is necessary
+ [] :
- // ...otherwise use results directly
- results :
- matcherIn;
+ // ...otherwise use results directly
+ results;
- // Find primary matches
- if ( matcher ) {
+ // Find primary matches
matcher( matcherIn, matcherOut, context, xml );
+ } else {
+ matcherOut = matcherIn;
}
// Apply postFilter
@@ -2594,7 +2350,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
i = matcherOut.length;
while ( i-- ) {
if ( ( elem = matcherOut[ i ] ) &&
- ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
+ ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
seed[ temp ] = !( results[ temp ] = elem );
}
@@ -2629,15 +2385,21 @@ function matcherFromTokens( tokens ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
+ return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+
+ // Support: IE 11+, Edge 17 - 18+
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+ // two documents; shallow comparisons work.
+ // eslint-disable-next-line eqeqeq
+ var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
( checkContext = context ).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
+ // Avoid hanging onto element
+ // (see https://github.com/jquery/sizzle/issues/299)
checkContext = null;
return ret;
} ];
@@ -2662,11 +2424,10 @@ function matcherFromTokens( tokens ) {
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens
- .slice( 0, i - 1 )
- .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
- ).replace( rtrim, "$1" ),
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 )
+ .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
+ ).replace( rtrimCSS, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
@@ -2692,7 +2453,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
contextBackup = outermostContext,
// We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
+ elems = seed || byElement && Expr.find.TAG( "*", outermost ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
@@ -2708,8 +2469,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
}
// Add elements passing elementMatchers directly to results
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
+ // Support: iOS <=7 - 9 only
+ // Tolerate NodeList properties (IE: "length"; Safari: ) matching
+ // elements by id. (see trac-14142)
for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
if ( byElement && elem ) {
j = 0;
@@ -2724,7 +2486,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
}
while ( ( matcher = elementMatchers[ j++ ] ) ) {
if ( matcher( elem, context || document, xml ) ) {
- results.push( elem );
+ push.call( results, elem );
break;
}
}
@@ -2787,7 +2549,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
- Sizzle.uniqueSort( results );
+ jQuery.uniqueSort( results );
}
}
@@ -2805,7 +2567,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
superMatcher;
}
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+function compile( selector, match /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
@@ -2828,27 +2590,25 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
}
// Cache the compiled function
- cached = compilerCache(
- selector,
- matcherFromGroupMatchers( elementMatchers, setMatchers )
- );
+ cached = compilerCache( selector,
+ matcherFromGroupMatchers( elementMatchers, setMatchers ) );
// Save selector and tokenization
cached.selector = selector;
}
return cached;
-};
+}
/**
- * A low-level selection function that works with Sizzle's compiled
+ * A low-level selection function that works with jQuery's compiled
* selector functions
* @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
+ * selector function built with jQuery selector compile
* @param {Element} context
* @param {Array} [results]
* @param {Array} [seed] A set of elements to match against
*/
-select = Sizzle.select = function( selector, context, results, seed ) {
+function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( ( selector = compiled.selector || selector ) );
@@ -2862,10 +2622,12 @@ select = Sizzle.select = function( selector, context, results, seed ) {
// Reduce context if the leading compound selector is an ID
tokens = match[ 0 ] = match[ 0 ].slice( 0 );
if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
- context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
- context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
- .replace( runescape, funescape ), context ) || [] )[ 0 ];
+ context = ( Expr.find.ID(
+ token.matches[ 0 ].replace( runescape, funescape ),
+ context
+ ) || [] )[ 0 ];
if ( !context ) {
return results;
@@ -2878,7 +2640,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
}
// Fetch a seed set for right-to-left matching
- i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
+ i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[ i ];
@@ -2891,8 +2653,8 @@ select = Sizzle.select = function( selector, context, results, seed ) {
// Search, expanding context for leading sibling combinators
if ( ( seed = find(
token.matches[ 0 ].replace( runescape, funescape ),
- rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
- context
+ rsibling.test( tokens[ 0 ].type ) &&
+ testContext( context.parentNode ) || context
) ) ) {
// If seed is empty or no tokens remain, we can return early
@@ -2919,21 +2681,18 @@ select = Sizzle.select = function( selector, context, results, seed ) {
!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
);
return results;
-};
+}
// One-time assignments
+// Support: Android <=4.0 - 4.1+
// Sort stability
support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
// Initialize against the default document
setDocument();
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Support: Android <=4.0 - 4.1+
// Detached nodes confoundingly follow *each other*
support.sortDetached = assert( function( el ) {
@@ -2941,68 +2700,29 @@ support.sortDetached = assert( function( el ) {
return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
} );
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert( function( el ) {
- el.innerHTML = "";
- return el.firstChild.getAttribute( "href" ) === "#";
-} ) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- } );
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert( function( el ) {
- el.innerHTML = "";
- el.firstChild.setAttribute( "value", "" );
- return el.firstChild.getAttribute( "value" ) === "";
-} ) ) {
- addHandle( "value", function( elem, _name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- } );
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert( function( el ) {
- return el.getAttribute( "disabled" ) == null;
-} ) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- ( val = elem.getAttributeNode( name ) ) && val.specified ?
- val.value :
- null;
- }
- } );
-}
-
-return Sizzle;
-
-} )( window );
-
-
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
+jQuery.find = find;
// Deprecated
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
-jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-jQuery.escapeSelector = Sizzle.escape;
+jQuery.unique = jQuery.uniqueSort;
+
+// These have always been private, but they used to be documented
+// as part of Sizzle so let's maintain them in the 3.x line
+// for backwards compatibility purposes.
+find.compile = compile;
+find.select = select;
+find.setDocument = setDocument;
+find.escape = jQuery.escapeSelector;
+find.getText = jQuery.text;
+find.isXML = jQuery.isXMLDoc;
+find.selectors = jQuery.expr;
+find.support = jQuery.support;
+find.uniqueSort = jQuery.uniqueSort;
+ /* eslint-enable */
+
+} )();
var dir = function( elem, dir, until ) {
@@ -3036,13 +2756,6 @@ var siblings = function( n, elem ) {
var rneedsContext = jQuery.expr.match.needsContext;
-
-
-function nodeName( elem, name ) {
-
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-
-}
var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
@@ -3141,8 +2854,8 @@ jQuery.fn.extend( {
var rootjQuery,
// A simple way to check for HTML strings
- // Prioritize #id over to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
+ // Prioritize #id over to avoid XSS via location.hash (trac-9521)
+ // Strict HTML recognition (trac-11290: must start with <)
// Shortcut simple #id case for speed
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
@@ -3293,7 +3006,7 @@ jQuery.fn.extend( {
if ( cur.nodeType < 11 && ( targets ?
targets.index( cur ) > -1 :
- // Don't pass non-elements to Sizzle
+ // Don't pass non-elements to jQuery#find
cur.nodeType === 1 &&
jQuery.find.matchesSelector( cur, selectors ) ) ) {
@@ -3848,7 +3561,7 @@ jQuery.extend( {
if ( jQuery.Deferred.exceptionHook ) {
jQuery.Deferred.exceptionHook( e,
- process.stackTrace );
+ process.error );
}
// Support: Promises/A+ section 2.3.3.3.4.1
@@ -3876,10 +3589,17 @@ jQuery.extend( {
process();
} else {
- // Call an optional hook to record the stack, in case of exception
+ // Call an optional hook to record the error, in case of exception
// since it's otherwise lost when execution goes async
- if ( jQuery.Deferred.getStackHook ) {
- process.stackTrace = jQuery.Deferred.getStackHook();
+ if ( jQuery.Deferred.getErrorHook ) {
+ process.error = jQuery.Deferred.getErrorHook();
+
+ // The deprecated alias of the above. While the name suggests
+ // returning the stack, not an error instance, jQuery just passes
+ // it directly to `console.warn` so both will work; an instance
+ // just better cooperates with source maps.
+ } else if ( jQuery.Deferred.getStackHook ) {
+ process.error = jQuery.Deferred.getStackHook();
}
window.setTimeout( process );
}
@@ -4054,12 +3774,16 @@ jQuery.extend( {
// warn about them ASAP rather than swallowing them by default.
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
-jQuery.Deferred.exceptionHook = function( error, stack ) {
+// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
+// captured before the async barrier to get the original error cause
+// which may otherwise be hidden.
+jQuery.Deferred.exceptionHook = function( error, asyncError ) {
// Support: IE 8 - 9 only
// Console exists when dev tools are open, which can happen at any time
if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
- window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
+ window.console.warn( "jQuery.Deferred exception: " + error.message,
+ error.stack, asyncError );
}
};
@@ -4099,7 +3823,7 @@ jQuery.extend( {
isReady: false,
// A counter to track how many items to wait for before
- // the ready event fires. See #6781
+ // the ready event fires. See trac-6781
readyWait: 1,
// Handle when the DOM is ready
@@ -4227,7 +3951,7 @@ function fcamelCase( _all, letter ) {
// Convert dashed to camelCase; used by the css and data modules
// Support: IE <=9 - 11, Edge 12 - 15
-// Microsoft forgot to hump their vendor prefix (#9572)
+// Microsoft forgot to hump their vendor prefix (trac-9572)
function camelCase( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
}
@@ -4263,7 +3987,7 @@ Data.prototype = {
value = {};
// We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
+ // but we should not, see trac-8335.
// Always return an empty object.
if ( acceptData( owner ) ) {
@@ -4502,7 +4226,7 @@ jQuery.fn.extend( {
while ( i-- ) {
// Support: IE 11 only
- // The attrs elements can be null (#14894)
+ // The attrs elements can be null (trac-14894)
if ( attrs[ i ] ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
@@ -4925,9 +4649,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
input = document.createElement( "input" );
// Support: Android 4.0 - 4.3 only
- // Check state lost if the name is set (#11217)
+ // Check state lost if the name is set (trac-11217)
// Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
input.setAttribute( "type", "radio" );
input.setAttribute( "checked", "checked" );
input.setAttribute( "name", "t" );
@@ -4951,7 +4675,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
} )();
-// We have to close these tags to support XHTML (#13200)
+// We have to close these tags to support XHTML (trac-13200)
var wrapMap = {
// XHTML parsers do not magically insert elements in the
@@ -4977,7 +4701,7 @@ if ( !support.option ) {
function getAll( context, tag ) {
// Support: IE <=9 - 11 only
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
var ret;
if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -5060,7 +4784,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
// Remember the top-level container
tmp = fragment.firstChild;
- // Ensure the created nodes are orphaned (#12392)
+ // Ensure the created nodes are orphaned (trac-12392)
tmp.textContent = "";
}
}
@@ -5115,25 +4839,6 @@ function returnFalse() {
return false;
}
-// Support: IE <=9 - 11+
-// focus() and blur() are asynchronous, except when they are no-op.
-// So expect focus to be synchronous when the element is already active,
-// and blur to be synchronous when the element is not already active.
-// (focus and blur are always synchronous in other supported browsers,
-// this just defines when we can count on it).
-function expectSync( elem, type ) {
- return ( elem === safeActiveElement() ) === ( type === "focus" );
-}
-
-// Support: IE <=9 only
-// Accessing document.activeElement can throw unexpectedly
-// https://bugs.jquery.com/ticket/13393
-function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
-}
-
function on( elem, types, selector, data, fn, one ) {
var origFn, type;
@@ -5481,15 +5186,15 @@ jQuery.event = {
for ( ; cur !== this; cur = cur.parentNode || this ) {
- // Don't check non-elements (#13208)
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ // Don't check non-elements (trac-13208)
+ // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
matchedHandlers = [];
matchedSelectors = {};
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
- // Don't conflict with Object.prototype properties (#13203)
+ // Don't conflict with Object.prototype properties (trac-13203)
sel = handleObj.selector + " ";
if ( matchedSelectors[ sel ] === undefined ) {
@@ -5571,7 +5276,7 @@ jQuery.event = {
el.click && nodeName( el, "input" ) ) {
// dataPriv.set( el, "click", ... )
- leverageNative( el, "click", returnTrue );
+ leverageNative( el, "click", true );
}
// Return false to allow normal processing in the caller
@@ -5622,10 +5327,10 @@ jQuery.event = {
// synthetic events by interrupting progress until reinvoked in response to
// *native* events that it fires directly, ensuring that state changes have
// already occurred before other listeners are invoked.
-function leverageNative( el, type, expectSync ) {
+function leverageNative( el, type, isSetup ) {
- // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
- if ( !expectSync ) {
+ // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
+ if ( !isSetup ) {
if ( dataPriv.get( el, type ) === undefined ) {
jQuery.event.add( el, type, returnTrue );
}
@@ -5637,15 +5342,13 @@ function leverageNative( el, type, expectSync ) {
jQuery.event.add( el, type, {
namespace: false,
handler: function( event ) {
- var notAsync, result,
+ var result,
saved = dataPriv.get( this, type );
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
// Interrupt processing of the outer synthetic .trigger()ed event
- // Saved data should be false in such cases, but might be a leftover capture object
- // from an async native handler (gh-4350)
- if ( !saved.length ) {
+ if ( !saved ) {
// Store arguments for use when handling the inner native event
// There will always be at least one argument (an event object), so this array
@@ -5654,33 +5357,22 @@ function leverageNative( el, type, expectSync ) {
dataPriv.set( this, type, saved );
// Trigger the native event and capture its result
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous
- notAsync = expectSync( this, type );
this[ type ]();
result = dataPriv.get( this, type );
- if ( saved !== result || notAsync ) {
- dataPriv.set( this, type, false );
- } else {
- result = {};
- }
+ dataPriv.set( this, type, false );
+
if ( saved !== result ) {
// Cancel the outer synthetic event
event.stopImmediatePropagation();
event.preventDefault();
- // Support: Chrome 86+
- // In Chrome, if an element having a focusout handler is blurred by
- // clicking outside of it, it invokes the handler synchronously. If
- // that handler calls `.remove()` on the element, the data is cleared,
- // leaving `result` undefined. We need to guard against this.
- return result && result.value;
+ return result;
}
// If this is an inner synthetic event for an event with a bubbling surrogate
- // (focus or blur), assume that the surrogate already propagated from triggering the
- // native event and prevent that from happening again here.
+ // (focus or blur), assume that the surrogate already propagated from triggering
+ // the native event and prevent that from happening again here.
// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
// bubbling surrogate propagates *after* the non-bubbling base), but that seems
// less bad than duplication.
@@ -5690,22 +5382,25 @@ function leverageNative( el, type, expectSync ) {
// If this is a native event triggered above, everything is now in order
// Fire an inner synthetic event with the original arguments
- } else if ( saved.length ) {
+ } else if ( saved ) {
// ...and capture the result
- dataPriv.set( this, type, {
- value: jQuery.event.trigger(
-
- // Support: IE <=9 - 11+
- // Extend with the prototype to reset the above stopImmediatePropagation()
- jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
- saved.slice( 1 ),
- this
- )
- } );
-
- // Abort handling of the native event
- event.stopImmediatePropagation();
+ dataPriv.set( this, type, jQuery.event.trigger(
+ saved[ 0 ],
+ saved.slice( 1 ),
+ this
+ ) );
+
+ // Abort handling of the native event by all jQuery handlers while allowing
+ // native handlers on the same element to run. On target, this is achieved
+ // by stopping immediate propagation just on the jQuery event. However,
+ // the native event is re-wrapped by a jQuery one on each level of the
+ // propagation so the only way to stop it for jQuery is to stop it for
+ // everyone via native `stopPropagation()`. This is not a problem for
+ // focus/blur which don't bubble, but it does also stop click on checkboxes
+ // and radios. We accept this limitation.
+ event.stopPropagation();
+ event.isImmediatePropagationStopped = returnTrue;
}
}
} );
@@ -5743,7 +5438,7 @@ jQuery.Event = function( src, props ) {
// Create target properties
// Support: Safari <=6 - 7 only
- // Target should not be a text node (#504, #13143)
+ // Target should not be a text node (trac-504, trac-13143)
this.target = ( src.target && src.target.nodeType === 3 ) ?
src.target.parentNode :
src.target;
@@ -5844,18 +5539,73 @@ jQuery.each( {
}, jQuery.event.addProp );
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
+
+ function focusMappedHandler( nativeEvent ) {
+ if ( document.documentMode ) {
+
+ // Support: IE 11+
+ // Attach a single focusin/focusout handler on the document while someone wants
+ // focus/blur. This is because the former are synchronous in IE while the latter
+ // are async. In other browsers, all those handlers are invoked synchronously.
+
+ // `handle` from private data would already wrap the event, but we need
+ // to change the `type` here.
+ var handle = dataPriv.get( this, "handle" ),
+ event = jQuery.event.fix( nativeEvent );
+ event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
+ event.isSimulated = true;
+
+ // First, handle focusin/focusout
+ handle( nativeEvent );
+
+ // ...then, handle focus/blur
+ //
+ // focus/blur don't bubble while focusin/focusout do; simulate the former by only
+ // invoking the handler at the lower level.
+ if ( event.target === event.currentTarget ) {
+
+ // The setup part calls `leverageNative`, which, in turn, calls
+ // `jQuery.event.add`, so event handle will already have been set
+ // by this point.
+ handle( event );
+ }
+ } else {
+
+ // For non-IE browsers, attach a single capturing handler on the document
+ // while someone wants focusin/focusout.
+ jQuery.event.simulate( delegateType, nativeEvent.target,
+ jQuery.event.fix( nativeEvent ) );
+ }
+ }
+
jQuery.event.special[ type ] = {
// Utilize native event if possible so blur/focus sequence is correct
setup: function() {
+ var attaches;
+
// Claim the first handler
// dataPriv.set( this, "focus", ... )
// dataPriv.set( this, "blur", ... )
- leverageNative( this, type, expectSync );
+ leverageNative( this, type, true );
- // Return false to allow normal processing in the caller
- return false;
+ if ( document.documentMode ) {
+
+ // Support: IE 9 - 11+
+ // We use the same native handler for focusin & focus (and focusout & blur)
+ // so we need to coordinate setup & teardown parts between those events.
+ // Use `delegateType` as the key as `type` is already used by `leverageNative`.
+ attaches = dataPriv.get( this, delegateType );
+ if ( !attaches ) {
+ this.addEventListener( delegateType, focusMappedHandler );
+ }
+ dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
+ } else {
+
+ // Return false to allow normal processing in the caller
+ return false;
+ }
},
trigger: function() {
@@ -5866,14 +5616,84 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
return true;
},
- // Suppress native focus or blur as it's already being fired
- // in leverageNative.
- _default: function() {
- return true;
+ teardown: function() {
+ var attaches;
+
+ if ( document.documentMode ) {
+ attaches = dataPriv.get( this, delegateType ) - 1;
+ if ( !attaches ) {
+ this.removeEventListener( delegateType, focusMappedHandler );
+ dataPriv.remove( this, delegateType );
+ } else {
+ dataPriv.set( this, delegateType, attaches );
+ }
+ } else {
+
+ // Return false to indicate standard teardown should be applied
+ return false;
+ }
+ },
+
+ // Suppress native focus or blur if we're currently inside
+ // a leveraged native-event stack
+ _default: function( event ) {
+ return dataPriv.get( event.target, type );
},
delegateType: delegateType
};
+
+ // Support: Firefox <=44
+ // Firefox doesn't have focus(in | out) events
+ // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+ //
+ // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
+ // focus(in | out) events fire after focus & blur events,
+ // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
+ // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
+ //
+ // Support: IE 9 - 11+
+ // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
+ // attach a single handler for both events in IE.
+ jQuery.event.special[ delegateType ] = {
+ setup: function() {
+
+ // Handle: regular nodes (via `this.ownerDocument`), window
+ // (via `this.document`) & document (via `this`).
+ var doc = this.ownerDocument || this.document || this,
+ dataHolder = document.documentMode ? this : doc,
+ attaches = dataPriv.get( dataHolder, delegateType );
+
+ // Support: IE 9 - 11+
+ // We use the same native handler for focusin & focus (and focusout & blur)
+ // so we need to coordinate setup & teardown parts between those events.
+ // Use `delegateType` as the key as `type` is already used by `leverageNative`.
+ if ( !attaches ) {
+ if ( document.documentMode ) {
+ this.addEventListener( delegateType, focusMappedHandler );
+ } else {
+ doc.addEventListener( type, focusMappedHandler, true );
+ }
+ }
+ dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this.document || this,
+ dataHolder = document.documentMode ? this : doc,
+ attaches = dataPriv.get( dataHolder, delegateType ) - 1;
+
+ if ( !attaches ) {
+ if ( document.documentMode ) {
+ this.removeEventListener( delegateType, focusMappedHandler );
+ } else {
+ doc.removeEventListener( type, focusMappedHandler, true );
+ }
+ dataPriv.remove( dataHolder, delegateType );
+ } else {
+ dataPriv.set( dataHolder, delegateType, attaches );
+ }
+ }
+ };
} );
// Create mouseenter/leave events using mouseover/out and event-time checks
@@ -5968,7 +5788,8 @@ var
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rcleanScript = /^\s*\s*$/g;
+
+ rcleanScript = /^\s*\s*$/g;
// Prefer a tbody over its parent table for containing new rows
function manipulationTarget( elem, content ) {
@@ -6082,7 +5903,7 @@ function domManip( collection, args, callback, ignored ) {
// Use the original fragment for the last item
// instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
+ // being emptied incorrectly in certain situations (trac-8070).
for ( ; i < l; i++ ) {
node = fragment;
@@ -6123,6 +5944,12 @@ function domManip( collection, args, callback, ignored ) {
}, doc );
}
} else {
+
+ // Unwrap a CDATA section containing script contents. This shouldn't be
+ // needed as in XML documents they're already not visible when
+ // inspecting element contents and in HTML documents they have no
+ // meaning but we're preserving that logic for backwards compatibility.
+ // This will be removed completely in 4.0. See gh-4904.
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
}
}
@@ -6169,7 +5996,8 @@ jQuery.extend( {
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
!jQuery.isXMLDoc( elem ) ) {
- // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
+ // We eschew jQuery#find here for performance reasons:
+ // https://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
@@ -6405,9 +6233,12 @@ jQuery.each( {
} );
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+var rcustomProp = /^--/;
+
+
var getStyles = function( elem ) {
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView;
@@ -6507,7 +6338,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
}
// Support: IE <=9 - 11 only
- // Style of cloned element affects source element cloned (#8908)
+ // Style of cloned element affects source element cloned (trac-8908)
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6587,6 +6418,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
+ isCustomProp = rcustomProp.test( name ),
// Support: Firefox 51+
// Retrieving style before computed somehow
@@ -6597,11 +6429,42 @@ function curCSS( elem, name, computed ) {
computed = computed || getStyles( elem );
// getPropertyValue is needed for:
- // .css('filter') (IE 9 only, #12537)
- // .css('--customProperty) (#3144)
+ // .css('filter') (IE 9 only, trac-12537)
+ // .css('--customProperty) (gh-3144)
if ( computed ) {
+
+ // Support: IE <=9 - 11+
+ // IE only supports `"float"` in `getPropertyValue`; in computed styles
+ // it's only available as `"cssFloat"`. We no longer modify properties
+ // sent to `.css()` apart from camelCasing, so we need to check both.
+ // Normally, this would create difference in behavior: if
+ // `getPropertyValue` returns an empty string, the value returned
+ // by `.css()` would be `undefined`. This is usually the case for
+ // disconnected elements. However, in IE even disconnected elements
+ // with no styles return `"none"` for `getPropertyValue( "float" )`
ret = computed.getPropertyValue( name ) || computed[ name ];
+ if ( isCustomProp && ret ) {
+
+ // Support: Firefox 105+, Chrome <=105+
+ // Spec requires trimming whitespace for custom properties (gh-4926).
+ // Firefox only trims leading whitespace. Chrome just collapses
+ // both leading & trailing whitespace to a single space.
+ //
+ // Fall back to `undefined` if empty string returned.
+ // This collapses a missing definition with property defined
+ // and set to an empty string but there's no standard API
+ // allowing us to differentiate them without a performance penalty
+ // and returning `undefined` aligns with older jQuery.
+ //
+ // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
+ // as whitespace while CSS does not, but this is not a problem
+ // because CSS preprocessing replaces them with U+000A LINE FEED
+ // (which *is* CSS whitespace)
+ // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
+ ret = ret.replace( rtrimCSS, "$1" ) || undefined;
+ }
+
if ( ret === "" && !isAttached( elem ) ) {
ret = jQuery.style( elem, name );
}
@@ -6697,7 +6560,6 @@ var
// except "table", "table-cell", or "table-caption"
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rcustomProp = /^--/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: "0",
@@ -6719,7 +6581,8 @@ function setPositiveNumber( _elem, value, subtract ) {
function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
var i = dimension === "width" ? 1 : 0,
extra = 0,
- delta = 0;
+ delta = 0,
+ marginDelta = 0;
// Adjustment may not be necessary
if ( box === ( isBorderBox ? "border" : "content" ) ) {
@@ -6729,8 +6592,10 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
for ( ; i < 4; i += 2 ) {
// Both box models exclude margin
+ // Count margin delta separately to only add it after scroll gutter adjustment.
+ // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
if ( box === "margin" ) {
- delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
+ marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
}
// If we get here with a content-box, we're seeking "padding" or "border" or "margin"
@@ -6781,7 +6646,7 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
) ) || 0;
}
- return delta;
+ return delta + marginDelta;
}
function getWidthOrHeight( elem, dimension, extra ) {
@@ -6879,26 +6744,35 @@ jQuery.extend( {
// Don't automatically add "px" to these possibly-unitless properties
cssNumber: {
- "animationIterationCount": true,
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "gridArea": true,
- "gridColumn": true,
- "gridColumnEnd": true,
- "gridColumnStart": true,
- "gridRow": true,
- "gridRowEnd": true,
- "gridRowStart": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
+ animationIterationCount: true,
+ aspectRatio: true,
+ borderImageSlice: true,
+ columnCount: true,
+ flexGrow: true,
+ flexShrink: true,
+ fontWeight: true,
+ gridArea: true,
+ gridColumn: true,
+ gridColumnEnd: true,
+ gridColumnStart: true,
+ gridRow: true,
+ gridRowEnd: true,
+ gridRowStart: true,
+ lineHeight: true,
+ opacity: true,
+ order: true,
+ orphans: true,
+ scale: true,
+ widows: true,
+ zIndex: true,
+ zoom: true,
+
+ // SVG-related
+ fillOpacity: true,
+ floodOpacity: true,
+ stopOpacity: true,
+ strokeMiterlimit: true,
+ strokeOpacity: true
},
// Add in properties whose names you wish to fix before
@@ -6933,15 +6807,15 @@ jQuery.extend( {
if ( value !== undefined ) {
type = typeof value;
- // Convert "+=" or "-=" to relative numbers (#7345)
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
value = adjustCSS( elem, name, ret );
- // Fixes bug #9237
+ // Fixes bug trac-9237
type = "number";
}
- // Make sure that null and NaN values aren't set (#7116)
+ // Make sure that null and NaN values aren't set (trac-7116)
if ( value == null || value !== value ) {
return;
}
@@ -7565,7 +7439,7 @@ function Animation( elem, properties, options ) {
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// Support: Android 2.3 only
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
@@ -7955,7 +7829,6 @@ jQuery.fx.speeds = {
// Based off of the plugin by Clint Helfers, with permission.
-// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
jQuery.fn.delay = function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
@@ -8180,8 +8053,7 @@ jQuery.extend( {
// Support: IE <=9 - 11 only
// elem.tabIndex doesn't always return the
// correct value when it hasn't been explicitly set
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- // Use proper attribute retrieval(#12072)
+ // Use proper attribute retrieval (trac-12072)
var tabindex = jQuery.find.attr( elem, "tabindex" );
if ( tabindex ) {
@@ -8285,8 +8157,7 @@ function classesToArray( value ) {
jQuery.fn.extend( {
addClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
+ var classNames, cur, curValue, className, i, finalValue;
if ( isFunction( value ) ) {
return this.each( function( j ) {
@@ -8294,36 +8165,35 @@ jQuery.fn.extend( {
} );
}
- classes = classesToArray( value );
+ classNames = classesToArray( value );
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
+ if ( classNames.length ) {
+ return this.each( function() {
+ curValue = getClass( this );
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
+ for ( i = 0; i < classNames.length; i++ ) {
+ className = classNames[ i ];
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
+ cur += className + " ";
}
}
// Only assign if different to avoid unneeded rendering.
finalValue = stripAndCollapse( cur );
if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
+ this.setAttribute( "class", finalValue );
}
}
- }
+ } );
}
return this;
},
removeClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
+ var classNames, cur, curValue, className, i, finalValue;
if ( isFunction( value ) ) {
return this.each( function( j ) {
@@ -8335,45 +8205,42 @@ jQuery.fn.extend( {
return this.attr( "class", "" );
}
- classes = classesToArray( value );
+ classNames = classesToArray( value );
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
+ if ( classNames.length ) {
+ return this.each( function() {
+ curValue = getClass( this );
// This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
+ for ( i = 0; i < classNames.length; i++ ) {
+ className = classNames[ i ];
// Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
- cur = cur.replace( " " + clazz + " ", " " );
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
+ cur = cur.replace( " " + className + " ", " " );
}
}
// Only assign if different to avoid unneeded rendering.
finalValue = stripAndCollapse( cur );
if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
+ this.setAttribute( "class", finalValue );
}
}
- }
+ } );
}
return this;
},
toggleClass: function( value, stateVal ) {
- var type = typeof value,
+ var classNames, className, i, self,
+ type = typeof value,
isValidValue = type === "string" || Array.isArray( value );
- if ( typeof stateVal === "boolean" && isValidValue ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
if ( isFunction( value ) ) {
return this.each( function( i ) {
jQuery( this ).toggleClass(
@@ -8383,17 +8250,20 @@ jQuery.fn.extend( {
} );
}
- return this.each( function() {
- var className, i, self, classNames;
+ if ( typeof stateVal === "boolean" && isValidValue ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+ classNames = classesToArray( value );
+
+ return this.each( function() {
if ( isValidValue ) {
// Toggle individual class names
- i = 0;
self = jQuery( this );
- classNames = classesToArray( value );
- while ( ( className = classNames[ i++ ] ) ) {
+ for ( i = 0; i < classNames.length; i++ ) {
+ className = classNames[ i ];
// Check each className given, space separated list
if ( self.hasClass( className ) ) {
@@ -8527,7 +8397,7 @@ jQuery.extend( {
val :
// Support: IE <=10 - 11 only
- // option.text throws exceptions (#14686, #14858)
+ // option.text throws exceptions (trac-14686, trac-14858)
// Strip and collapse whitespace
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
stripAndCollapse( jQuery.text( elem ) );
@@ -8554,7 +8424,7 @@ jQuery.extend( {
option = options[ i ];
// Support: IE <=9 only
- // IE8-9 doesn't update selected after form reset (#2551)
+ // IE8-9 doesn't update selected after form reset (trac-2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
@@ -8628,9 +8498,39 @@ jQuery.each( [ "radio", "checkbox" ], function() {
// Return jQuery for attributes-only inclusion
+var location = window.location;
+
+var nonce = { guid: Date.now() };
+var rquery = ( /\?/ );
+
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, parserErrorElem;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE 9 - 11 only
+ // IE throws on parseFromString with invalid input.
+ try {
+ xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
+ } catch ( e ) {}
-support.focusin = "onfocusin" in window;
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
+ if ( !xml || parserErrorElem ) {
+ jQuery.error( "Invalid XML: " + (
+ parserErrorElem ?
+ jQuery.map( parserErrorElem.childNodes, function( el ) {
+ return el.textContent;
+ } ).join( "\n" ) :
+ data
+ ) );
+ }
+ return xml;
+};
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
@@ -8697,8 +8597,8 @@ jQuery.extend( jQuery.event, {
return;
}
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ // Determine event propagation path in advance, per W3C events spec (trac-9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
bubbleType = special.delegateType || type;
@@ -8750,7 +8650,7 @@ jQuery.extend( jQuery.event, {
acceptData( elem ) ) {
// Call a native DOM method on the target with the same name as the event.
- // Don't do default actions on window, that's where global variables be (#6170)
+ // Don't do default actions on window, that's where global variables be (trac-6170)
if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
@@ -8818,85 +8718,6 @@ jQuery.fn.extend( {
} );
-// Support: Firefox <=44
-// Firefox doesn't have focus(in | out) events
-// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
-//
-// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
-// focus(in | out) events fire after focus & blur events,
-// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
-// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
-if ( !support.focusin ) {
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
-
- // Handle: regular nodes (via `this.ownerDocument`), window
- // (via `this.document`) & document (via `this`).
- var doc = this.ownerDocument || this.document || this,
- attaches = dataPriv.access( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this.document || this,
- attaches = dataPriv.access( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- dataPriv.remove( doc, fix );
-
- } else {
- dataPriv.access( doc, fix, attaches );
- }
- }
- };
- } );
-}
-var location = window.location;
-
-var nonce = { guid: Date.now() };
-
-var rquery = ( /\?/ );
-
-
-
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
- var xml, parserErrorElem;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
-
- // Support: IE 9 - 11 only
- // IE throws on parseFromString with invalid input.
- try {
- xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
- } catch ( e ) {}
-
- parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
- if ( !xml || parserErrorElem ) {
- jQuery.error( "Invalid XML: " + (
- parserErrorElem ?
- jQuery.map( parserErrorElem.childNodes, function( el ) {
- return el.textContent;
- } ).join( "\n" ) :
- data
- ) );
- }
- return xml;
-};
-
-
var
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
@@ -9024,7 +8845,7 @@ var
rantiCache = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
- // #7653, #8125, #8152: local protocol detection
+ // trac-7653, trac-8125, trac-8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
@@ -9047,7 +8868,7 @@ var
*/
transports = {},
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
allTypes = "*/".concat( "*" ),
// Anchor tag for parsing the document origin
@@ -9118,7 +8939,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
-// Fixes #9887
+// Fixes trac-9887
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9529,12 +9350,12 @@ jQuery.extend( {
deferred.promise( jqXHR );
// Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // Handle falsy url in the settings object (trac-10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || location.href ) + "" )
.replace( rprotocol, location.protocol + "//" );
- // Alias method option to type as per ticket #12004
+ // Alias method option to type as per ticket trac-12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
@@ -9577,7 +9398,7 @@ jQuery.extend( {
}
// We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
fireGlobals = jQuery.event && s.global;
// Watch for a new set of requests
@@ -9606,7 +9427,7 @@ jQuery.extend( {
if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
- // #9682: remove data so that it's not used in an eventual retry
+ // trac-9682: remove data so that it's not used in an eventual retry
delete s.data;
}
@@ -9879,7 +9700,7 @@ jQuery._evalUrl = function( url, options, doc ) {
return jQuery.ajax( {
url: url,
- // Make this explicit, since user can override this through ajaxSetup (#11264)
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
type: "GET",
dataType: "script",
cache: true,
@@ -9988,7 +9809,7 @@ var xhrSuccessStatus = {
0: 200,
// Support: IE <=9 only
- // #1450: sometimes IE returns 1223 when it should be 204
+ // trac-1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
xhrSupported = jQuery.ajaxSettings.xhr();
@@ -10060,7 +9881,7 @@ jQuery.ajaxTransport( function( options ) {
} else {
complete(
- // File: protocol always yields status 0; see #8605, #14207
+ // File: protocol always yields status 0; see trac-8605, trac-14207
xhr.status,
xhr.statusText
);
@@ -10121,7 +9942,7 @@ jQuery.ajaxTransport( function( options ) {
xhr.send( options.hasContent && options.data || null );
} catch ( e ) {
- // #14683: Only rethrow if this hasn't been notified as an error yet
+ // trac-14683: Only rethrow if this hasn't been notified as an error yet
if ( callback ) {
throw e;
}
@@ -10765,7 +10586,9 @@ jQuery.each(
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
-var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
+// Require that the "whitespace run" starts from a non-whitespace
+// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
+var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
// Bind a function to a context, optionally partially applying any
// arguments.
@@ -10832,7 +10655,7 @@ jQuery.isNumeric = function( obj ) {
jQuery.trim = function( text ) {
return text == null ?
"" :
- ( text + "" ).replace( rtrim, "" );
+ ( text + "" ).replace( rtrim, "$1" );
};
@@ -10880,8 +10703,8 @@ jQuery.noConflict = function( deep ) {
};
// Expose jQuery and $ identifiers, even in AMD
-// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
-// and CommonJS for browser emulators (#13566)
+// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (trac-13566)
if ( typeof noGlobal === "undefined" ) {
window.jQuery = window.$ = jQuery;
}
@@ -10895,60 +10718,98 @@ return jQuery;
/*!
-JSZip - A Javascript class for generating and reading zip files
+JSZip v3.10.1 - A JavaScript class for generating and reading zip files
-(c) 2009-2014 Stuart Knightley
-Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
+(c) 2009-2016 Stuart Knightley
+Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
-https://github.com/nodeca/pako/blob/master/LICENSE
+https://github.com/nodeca/pako/blob/main/LICENSE
*/
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSZip=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- }
- else if (isNaN(chr3)) {
- enc4 = 64;
- }
+ enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64;
+ enc4 = remainingBytes > 2 ? (chr3 & 63) : 64;
- output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
+ output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));
}
- return output;
+ return output.join("");
};
// public method for decoding
-exports.decode = function(input, utf8) {
- var output = "";
+exports.decode = function(input) {
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
- var i = 0;
+ var i = 0, resultIndex = 0;
+
+ var dataUrlPrefix = "data:";
+
+ if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) {
+ // This is a common error: people give a data url
+ // (data:image/png;base64,iVBOR...) with a {base64: true} and
+ // wonders why things don't work.
+ // We can detect that the string input looks like a data url but we
+ // *can't* be sure it is one: removing everything up to the comma would
+ // be too dangerous.
+ throw new Error("Invalid base64 input, it looks like a data url.");
+ }
+
+ input = input.replace(/[^A-Za-z0-9+/=]/g, "");
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+ var totalLength = input.length * 3 / 4;
+ if(input.charAt(input.length - 1) === _keyStr.charAt(64)) {
+ totalLength--;
+ }
+ if(input.charAt(input.length - 2) === _keyStr.charAt(64)) {
+ totalLength--;
+ }
+ if (totalLength % 1 !== 0) {
+ // totalLength is not an integer, the length does not match a valid
+ // base64 content. That can happen if:
+ // - the input is not a base64 content
+ // - the input is *almost* a base64 content, with a extra chars at the
+ // beginning or at the end
+ // - the input uses a base64 variant (base64url for example)
+ throw new Error("Invalid base64 input, bad content length.");
+ }
+ var output;
+ if (support.uint8array) {
+ output = new Uint8Array(totalLength|0);
+ } else {
+ output = new Array(totalLength|0);
+ }
while (i < input.length) {
@@ -10961,722 +10822,319 @@ exports.decode = function(input, utf8) {
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
- output = output + String.fromCharCode(chr1);
+ output[resultIndex++] = chr1;
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
+ if (enc3 !== 64) {
+ output[resultIndex++] = chr2;
}
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
+ if (enc4 !== 64) {
+ output[resultIndex++] = chr3;
}
}
return output;
-
};
-},{}],2:[function(_dereq_,module,exports){
-'use strict';
-function CompressedObject() {
- this.compressedSize = 0;
- this.uncompressedSize = 0;
- this.crc32 = 0;
- this.compressionMethod = null;
- this.compressedContent = null;
+},{"./support":30,"./utils":32}],2:[function(require,module,exports){
+"use strict";
+
+var external = require("./external");
+var DataWorker = require("./stream/DataWorker");
+var Crc32Probe = require("./stream/Crc32Probe");
+var DataLengthProbe = require("./stream/DataLengthProbe");
+
+/**
+ * Represent a compressed object, with everything needed to decompress it.
+ * @constructor
+ * @param {number} compressedSize the size of the data compressed.
+ * @param {number} uncompressedSize the size of the data after decompression.
+ * @param {number} crc32 the crc32 of the decompressed file.
+ * @param {object} compression the type of compression, see lib/compressions.js.
+ * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data.
+ */
+function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {
+ this.compressedSize = compressedSize;
+ this.uncompressedSize = uncompressedSize;
+ this.crc32 = crc32;
+ this.compression = compression;
+ this.compressedContent = data;
}
CompressedObject.prototype = {
/**
- * Return the decompressed content in an unspecified format.
- * The format will depend on the decompressor.
- * @return {Object} the decompressed content.
+ * Create a worker to get the uncompressed content.
+ * @return {GenericWorker} the worker.
*/
- getContent: function() {
- return null; // see implementation
+ getContentWorker: function () {
+ var worker = new DataWorker(external.Promise.resolve(this.compressedContent))
+ .pipe(this.compression.uncompressWorker())
+ .pipe(new DataLengthProbe("data_length"));
+
+ var that = this;
+ worker.on("end", function () {
+ if (this.streamInfo["data_length"] !== that.uncompressedSize) {
+ throw new Error("Bug : uncompressed data size mismatch");
+ }
+ });
+ return worker;
},
/**
- * Return the compressed content in an unspecified format.
- * The format will depend on the compressed conten source.
- * @return {Object} the compressed content.
+ * Create a worker to get the compressed content.
+ * @return {GenericWorker} the worker.
*/
- getCompressedContent: function() {
- return null; // see implementation
+ getCompressedWorker: function () {
+ return new DataWorker(external.Promise.resolve(this.compressedContent))
+ .withStreamInfo("compressedSize", this.compressedSize)
+ .withStreamInfo("uncompressedSize", this.uncompressedSize)
+ .withStreamInfo("crc32", this.crc32)
+ .withStreamInfo("compression", this.compression)
+ ;
}
};
-module.exports = CompressedObject;
-
-},{}],3:[function(_dereq_,module,exports){
-'use strict';
-exports.STORE = {
- magic: "\x00\x00",
- compress: function(content, compressionOptions) {
- return content; // no compression
- },
- uncompress: function(content) {
- return content; // no compression
- },
- compressInputType: null,
- uncompressInputType: null
-};
-exports.DEFLATE = _dereq_('./flate');
-
-},{"./flate":8}],4:[function(_dereq_,module,exports){
-'use strict';
-
-var utils = _dereq_('./utils');
-
-var table = [
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
- 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
- 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
- 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
- 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
- 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
- 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
- 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
- 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
- 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
- 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
- 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
- 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
- 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
- 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
- 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
- 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
- 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
- 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
- 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
- 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
- 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
- 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
- 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
- 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
- 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
- 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
- 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
- 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
- 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
- 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
- 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
- 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
- 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
- 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
- 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
- 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
- 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
- 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
- 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
- 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
- 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
- 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
- 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
- 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
- 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
- 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
- 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
- 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
- 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
- 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
- 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
-];
/**
- *
- * Javascript crc32
- * http://www.webtoolkit.info/
- *
+ * Chain the given worker with other workers to compress the content with the
+ * given compression.
+ * @param {GenericWorker} uncompressedWorker the worker to pipe.
+ * @param {Object} compression the compression object.
+ * @param {Object} compressionOptions the options to use when compressing.
+ * @return {GenericWorker} the new worker compressing the content.
*/
-module.exports = function crc32(input, crc) {
- if (typeof input === "undefined" || !input.length) {
- return 0;
- }
-
- var isArray = utils.getTypeOf(input) !== "string";
-
- if (typeof(crc) == "undefined") {
- crc = 0;
- }
- var x = 0;
- var y = 0;
- var b = 0;
+CompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) {
+ return uncompressedWorker
+ .pipe(new Crc32Probe())
+ .pipe(new DataLengthProbe("uncompressedSize"))
+ .pipe(compression.compressWorker(compressionOptions))
+ .pipe(new DataLengthProbe("compressedSize"))
+ .withStreamInfo("compression", compression);
+};
- crc = crc ^ (-1);
- for (var i = 0, iTop = input.length; i < iTop; i++) {
- b = isArray ? input[i] : input.charCodeAt(i);
- y = (crc ^ b) & 0xFF;
- x = table[y];
- crc = (crc >>> 8) ^ x;
- }
+module.exports = CompressedObject;
- return crc ^ (-1);
-};
-// vim: set shiftwidth=4 softtabstop=4:
+},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(require,module,exports){
+"use strict";
-},{"./utils":21}],5:[function(_dereq_,module,exports){
-'use strict';
-var utils = _dereq_('./utils');
+var GenericWorker = require("./stream/GenericWorker");
-function DataReader(data) {
- this.data = null; // type : see implementation
- this.length = 0;
- this.index = 0;
-}
-DataReader.prototype = {
- /**
- * Check that the offset will not go too far.
- * @param {string} offset the additional offset to check.
- * @throws {Error} an Error if the offset is out of bounds.
- */
- checkOffset: function(offset) {
- this.checkIndex(this.index + offset);
- },
- /**
- * Check that the specifed index will not be too far.
- * @param {string} newIndex the index to check.
- * @throws {Error} an Error if the index is out of bounds.
- */
- checkIndex: function(newIndex) {
- if (this.length < newIndex || newIndex < 0) {
- throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
- }
- },
- /**
- * Change the index.
- * @param {number} newIndex The new index.
- * @throws {Error} if the new index is out of the data.
- */
- setIndex: function(newIndex) {
- this.checkIndex(newIndex);
- this.index = newIndex;
- },
- /**
- * Skip the next n bytes.
- * @param {number} n the number of bytes to skip.
- * @throws {Error} if the new index is out of the data.
- */
- skip: function(n) {
- this.setIndex(this.index + n);
- },
- /**
- * Get the byte at the specified index.
- * @param {number} i the index to use.
- * @return {number} a byte.
- */
- byteAt: function(i) {
- // see implementations
- },
- /**
- * Get the next number with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {number} the corresponding number.
- */
- readInt: function(size) {
- var result = 0,
- i;
- this.checkOffset(size);
- for (i = this.index + size - 1; i >= this.index; i--) {
- result = (result << 8) + this.byteAt(i);
- }
- this.index += size;
- return result;
- },
- /**
- * Get the next string with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {string} the corresponding string.
- */
- readString: function(size) {
- return utils.transformTo("string", this.readData(size));
- },
- /**
- * Get raw data without conversion, bytes.
- * @param {number} size the number of bytes to read.
- * @return {Object} the raw data, implementation specific.
- */
- readData: function(size) {
- // see implementations
- },
- /**
- * Find the last occurence of a zip signature (4 bytes).
- * @param {string} sig the signature to find.
- * @return {number} the index of the last occurence, -1 if not found.
- */
- lastIndexOfSignature: function(sig) {
- // see implementations
+exports.STORE = {
+ magic: "\x00\x00",
+ compressWorker : function () {
+ return new GenericWorker("STORE compression");
},
- /**
- * Get the next date.
- * @return {Date} the date.
- */
- readDate: function() {
- var dostime = this.readInt(4);
- return new Date(
- ((dostime >> 25) & 0x7f) + 1980, // year
- ((dostime >> 21) & 0x0f) - 1, // month
- (dostime >> 16) & 0x1f, // day
- (dostime >> 11) & 0x1f, // hour
- (dostime >> 5) & 0x3f, // minute
- (dostime & 0x1f) << 1); // second
+ uncompressWorker : function () {
+ return new GenericWorker("STORE decompression");
}
};
-module.exports = DataReader;
+exports.DEFLATE = require("./flate");
-},{"./utils":21}],6:[function(_dereq_,module,exports){
-'use strict';
-exports.base64 = false;
-exports.binary = false;
-exports.dir = false;
-exports.createFolders = false;
-exports.date = null;
-exports.compression = null;
-exports.compressionOptions = null;
-exports.comment = null;
-exports.unixPermissions = null;
-exports.dosPermissions = null;
+},{"./flate":7,"./stream/GenericWorker":28}],4:[function(require,module,exports){
+"use strict";
-},{}],7:[function(_dereq_,module,exports){
-'use strict';
-var utils = _dereq_('./utils');
+var utils = require("./utils");
/**
- * @deprecated
- * This function will be removed in a future version without replacement.
+ * The following functions come from pako, from pako/lib/zlib/crc32.js
+ * released under the MIT license, see pako https://github.com/nodeca/pako/
*/
-exports.string2binary = function(str) {
- return utils.string2binary(str);
-};
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.string2Uint8Array = function(str) {
- return utils.transformTo("uint8array", str);
-};
+// Use ordinary array, since untyped makes no boost here
+function makeTable() {
+ var c, table = [];
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.uint8Array2String = function(array) {
- return utils.transformTo("string", array);
-};
+ for(var n =0; n < 256; n++){
+ c = n;
+ for(var k =0; k < 8; k++){
+ c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
+ }
+ table[n] = c;
+ }
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.string2Blob = function(str) {
- var buffer = utils.transformTo("arraybuffer", str);
- return utils.arrayBuffer2Blob(buffer);
-};
+ return table;
+}
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.arrayBuffer2Blob = function(buffer) {
- return utils.arrayBuffer2Blob(buffer);
-};
+// Create table on load. Just 255 signed longs. Not a problem.
+var crcTable = makeTable();
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.transformTo = function(outputType, input) {
- return utils.transformTo(outputType, input);
-};
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.getTypeOf = function(input) {
- return utils.getTypeOf(input);
-};
+function crc32(crc, buf, len, pos) {
+ var t = crcTable, end = pos + len;
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.checkSupport = function(type) {
- return utils.checkSupport(type);
-};
+ crc = crc ^ (-1);
-/**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
-exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS;
+ for (var i = pos; i < end; i++ ) {
+ crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
+ }
-/**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
-exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS;
+ return (crc ^ (-1)); // >>> 0;
+}
+// That's all for the pako functions.
/**
- * @deprecated
- * This function will be removed in a future version without replacement.
+ * Compute the crc32 of a string.
+ * This is almost the same as the function crc32, but for strings. Using the
+ * same function for the two use cases leads to horrible performances.
+ * @param {Number} crc the starting value of the crc.
+ * @param {String} str the string to use.
+ * @param {Number} len the length of the string.
+ * @param {Number} pos the starting position for the crc32 computation.
+ * @return {Number} the computed crc32.
*/
-exports.pretty = function(str) {
- return utils.pretty(str);
-};
+function crc32str(crc, str, len, pos) {
+ var t = crcTable, end = pos + len;
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.findCompression = function(compressionMethod) {
- return utils.findCompression(compressionMethod);
-};
+ crc = crc ^ (-1);
-/**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
-exports.isRegExp = function (object) {
- return utils.isRegExp(object);
-};
+ for (var i = pos; i < end; i++ ) {
+ crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF];
+ }
+ return (crc ^ (-1)); // >>> 0;
+}
-},{"./utils":21}],8:[function(_dereq_,module,exports){
-'use strict';
-var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
+module.exports = function crc32wrapper(input, crc) {
+ if (typeof input === "undefined" || !input.length) {
+ return 0;
+ }
-var pako = _dereq_("pako");
-exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
-exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
+ var isArray = utils.getTypeOf(input) !== "string";
-exports.magic = "\x08\x00";
-exports.compress = function(input, compressionOptions) {
- return pako.deflateRaw(input, {
- level : compressionOptions.level || -1 // default compression
- });
-};
-exports.uncompress = function(input) {
- return pako.inflateRaw(input);
+ if(isArray) {
+ return crc32(crc|0, input, input.length, 0);
+ } else {
+ return crc32str(crc|0, input, input.length, 0);
+ }
};
-},{"pako":24}],9:[function(_dereq_,module,exports){
-'use strict';
-
-var base64 = _dereq_('./base64');
-
-/**
-Usage:
- zip = new JSZip();
- zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
- zip.folder("images").file("smile.gif", base64Data, {base64: true});
- zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
- zip.remove("tempfile");
-
- base64zip = zip.generate();
-
-**/
-
-/**
- * Representation a of zip file in js
- * @constructor
- * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional).
- * @param {Object=} options the options for creating this objects (optional).
- */
-function JSZip(data, options) {
- // if this constructor is used without `new`, it adds `new` before itself:
- if(!(this instanceof JSZip)) return new JSZip(data, options);
-
- // object containing the files :
- // {
- // "folder/" : {...},
- // "folder/data.txt" : {...}
- // }
- this.files = {};
+},{"./utils":32}],5:[function(require,module,exports){
+"use strict";
+exports.base64 = false;
+exports.binary = false;
+exports.dir = false;
+exports.createFolders = true;
+exports.date = null;
+exports.compression = null;
+exports.compressionOptions = null;
+exports.comment = null;
+exports.unixPermissions = null;
+exports.dosPermissions = null;
- this.comment = null;
+},{}],6:[function(require,module,exports){
+"use strict";
- // Where we are in the hierarchy
- this.root = "";
- if (data) {
- this.load(data, options);
- }
- this.clone = function() {
- var newObj = new JSZip();
- for (var i in this) {
- if (typeof this[i] !== "function") {
- newObj[i] = this[i];
- }
- }
- return newObj;
- };
+// load the global object first:
+// - it should be better integrated in the system (unhandledRejection in node)
+// - the environment may have a custom Promise implementation (see zone.js)
+var ES6Promise = null;
+if (typeof Promise !== "undefined") {
+ ES6Promise = Promise;
+} else {
+ ES6Promise = require("lie");
}
-JSZip.prototype = _dereq_('./object');
-JSZip.prototype.load = _dereq_('./load');
-JSZip.support = _dereq_('./support');
-JSZip.defaults = _dereq_('./defaults');
/**
- * @deprecated
- * This namespace will be removed in a future version without replacement.
+ * Let the user use/change some implementations.
*/
-JSZip.utils = _dereq_('./deprecatedPublicUtils');
-
-JSZip.base64 = {
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- encode : function(input) {
- return base64.encode(input);
- },
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- decode : function(input) {
- return base64.decode(input);
- }
+module.exports = {
+ Promise: ES6Promise
};
-JSZip.compressions = _dereq_('./compressions');
-module.exports = JSZip;
-
-},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){
-'use strict';
-var base64 = _dereq_('./base64');
-var ZipEntries = _dereq_('./zipEntries');
-module.exports = function(data, options) {
- var files, zipEntries, i, input;
- options = options || {};
- if (options.base64) {
- data = base64.decode(data);
- }
-
- zipEntries = new ZipEntries(data, options);
- files = zipEntries.files;
- for (i = 0; i < files.length; i++) {
- input = files[i];
- this.file(input.fileName, input.decompressed, {
- binary: true,
- optimizedBinaryString: true,
- date: input.date,
- dir: input.dir,
- comment : input.fileComment.length ? input.fileComment : null,
- unixPermissions : input.unixPermissions,
- dosPermissions : input.dosPermissions,
- createFolders: options.createFolders
- });
- }
- if (zipEntries.zipComment.length) {
- this.comment = zipEntries.zipComment;
- }
- return this;
-};
+},{"lie":37}],7:[function(require,module,exports){
+"use strict";
+var USE_TYPEDARRAY = (typeof Uint8Array !== "undefined") && (typeof Uint16Array !== "undefined") && (typeof Uint32Array !== "undefined");
-},{"./base64":1,"./zipEntries":22}],11:[function(_dereq_,module,exports){
-(function (Buffer){
-'use strict';
-module.exports = function(data, encoding){
- return new Buffer(data, encoding);
-};
-module.exports.test = function(b){
- return Buffer.isBuffer(b);
-};
+var pako = require("pako");
+var utils = require("./utils");
+var GenericWorker = require("./stream/GenericWorker");
-}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
-},{}],12:[function(_dereq_,module,exports){
-'use strict';
-var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
+var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array";
-function NodeBufferReader(data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
-}
-NodeBufferReader.prototype = new Uint8ArrayReader();
+exports.magic = "\x08\x00";
/**
- * @see DataReader.readData
+ * Create a worker that uses pako to inflate/deflate.
+ * @constructor
+ * @param {String} action the name of the pako function to call : either "Deflate" or "Inflate".
+ * @param {Object} options the options to use when (de)compressing.
*/
-NodeBufferReader.prototype.readData = function(size) {
- this.checkOffset(size);
- var result = this.data.slice(this.index, this.index + size);
- this.index += size;
- return result;
-};
-module.exports = NodeBufferReader;
+function FlateWorker(action, options) {
+ GenericWorker.call(this, "FlateWorker/" + action);
-},{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){
-'use strict';
-var support = _dereq_('./support');
-var utils = _dereq_('./utils');
-var crc32 = _dereq_('./crc32');
-var signature = _dereq_('./signature');
-var defaults = _dereq_('./defaults');
-var base64 = _dereq_('./base64');
-var compressions = _dereq_('./compressions');
-var CompressedObject = _dereq_('./compressedObject');
-var nodeBuffer = _dereq_('./nodeBuffer');
-var utf8 = _dereq_('./utf8');
-var StringWriter = _dereq_('./stringWriter');
-var Uint8ArrayWriter = _dereq_('./uint8ArrayWriter');
+ this._pako = null;
+ this._pakoAction = action;
+ this._pakoOptions = options;
+ // the `meta` object from the last chunk received
+ // this allow this worker to pass around metadata
+ this.meta = {};
+}
+
+utils.inherits(FlateWorker, GenericWorker);
/**
- * Returns the raw data of a ZipObject, decompress the content if necessary.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
+ * @see GenericWorker.processChunk
*/
-var getRawData = function(file) {
- if (file._data instanceof CompressedObject) {
- file._data = file._data.getContent();
- file.options.binary = true;
- file.options.base64 = false;
-
- if (utils.getTypeOf(file._data) === "uint8array") {
- var copy = file._data;
- // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array.
- // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file).
- file._data = new Uint8Array(copy.length);
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- if (copy.length !== 0) {
- file._data.set(copy, 0);
- }
- }
+FlateWorker.prototype.processChunk = function (chunk) {
+ this.meta = chunk.meta;
+ if (this._pako === null) {
+ this._createPako();
}
- return file._data;
+ this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false);
};
/**
- * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
+ * @see GenericWorker.flush
*/
-var getBinaryData = function(file) {
- var result = getRawData(file),
- type = utils.getTypeOf(result);
- if (type === "string") {
- if (!file.options.binary) {
- // unicode text !
- // unicode string => binary string is a painful process, check if we can avoid it.
- if (support.nodebuffer) {
- return nodeBuffer(result, "utf-8");
- }
- }
- return file.asBinary();
+FlateWorker.prototype.flush = function () {
+ GenericWorker.prototype.flush.call(this);
+ if (this._pako === null) {
+ this._createPako();
}
- return result;
+ this._pako.push([], true);
};
-
/**
- * Transform this._data into a string.
- * @param {function} filter a function String -> String, applied if not null on the result.
- * @return {String} the string representing this._data.
+ * @see GenericWorker.cleanUp
*/
-var dataToString = function(asUTF8) {
- var result = getRawData(this);
- if (result === null || typeof result === "undefined") {
- return "";
- }
- // if the data is a base64 string, we decode it before checking the encoding !
- if (this.options.base64) {
- result = base64.decode(result);
- }
- if (asUTF8 && this.options.binary) {
- // JSZip.prototype.utf8decode supports arrays as input
- // skip to array => string step, utf8decode will do it.
- result = out.utf8decode(result);
- }
- else {
- // no utf8 transformation, do the array => string step.
- result = utils.transformTo("string", result);
- }
-
- if (!asUTF8 && !this.options.binary) {
- result = utils.transformTo("string", out.utf8encode(result));
- }
- return result;
+FlateWorker.prototype.cleanUp = function () {
+ GenericWorker.prototype.cleanUp.call(this);
+ this._pako = null;
};
+
/**
- * A simple object representing a file in the zip file.
- * @constructor
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
- * @param {Object} options the options of the file
+ * Create the _pako object.
+ * TODO: lazy-loading this object isn't the best solution but it's the
+ * quickest. The best solution is to lazy-load the worker list. See also the
+ * issue #446.
*/
-var ZipObject = function(name, data, options) {
- this.name = name;
- this.dir = options.dir;
- this.date = options.date;
- this.comment = options.comment;
- this.unixPermissions = options.unixPermissions;
- this.dosPermissions = options.dosPermissions;
-
- this._data = data;
- this.options = options;
-
- /*
- * This object contains initial values for dir and date.
- * With them, we can check if the user changed the deprecated metadata in
- * `ZipObject#options` or not.
- */
- this._initialMetadata = {
- dir : options.dir,
- date : options.date
+FlateWorker.prototype._createPako = function () {
+ this._pako = new pako[this._pakoAction]({
+ raw: true,
+ level: this._pakoOptions.level || -1 // default compression
+ });
+ var self = this;
+ this._pako.onData = function(data) {
+ self.push({
+ data : data,
+ meta : self.meta
+ });
};
};
-ZipObject.prototype = {
- /**
- * Return the content as UTF8 string.
- * @return {string} the UTF8 string.
- */
- asText: function() {
- return dataToString.call(this, true);
- },
- /**
- * Returns the binary content.
- * @return {string} the content as binary.
- */
- asBinary: function() {
- return dataToString.call(this, false);
- },
- /**
- * Returns the content as a nodejs Buffer.
- * @return {Buffer} the content as a Buffer.
- */
- asNodeBuffer: function() {
- var result = getBinaryData(this);
- return utils.transformTo("nodebuffer", result);
- },
- /**
- * Returns the content as an Uint8Array.
- * @return {Uint8Array} the content as an Uint8Array.
- */
- asUint8Array: function() {
- var result = getBinaryData(this);
- return utils.transformTo("uint8array", result);
- },
- /**
- * Returns the content as an ArrayBuffer.
- * @return {ArrayBuffer} the content as an ArrayBufer.
- */
- asArrayBuffer: function() {
- return this.asUint8Array().buffer;
- }
+exports.compressWorker = function (compressionOptions) {
+ return new FlateWorker("Deflate", compressionOptions);
};
+exports.uncompressWorker = function () {
+ return new FlateWorker("Inflate", {});
+};
+
+},{"./stream/GenericWorker":28,"./utils":32,"pako":38}],8:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var GenericWorker = require("../stream/GenericWorker");
+var utf8 = require("../utf8");
+var crc32 = require("../crc32");
+var signature = require("../signature");
/**
* Transform an integer into a string in hexadecimal.
@@ -11686,8 +11144,7 @@ ZipObject.prototype = {
* @returns {string} the result.
*/
var decToHex = function(dec, bytes) {
- var hex = "",
- i;
+ var hex = "", i;
for (i = 0; i < bytes; i++) {
hex += String.fromCharCode(dec & 0xff);
dec = dec >>> 8;
@@ -11695,216 +11152,6 @@ var decToHex = function(dec, bytes) {
return hex;
};
-/**
- * Merge the objects passed as parameters into a new one.
- * @private
- * @param {...Object} var_args All objects to merge.
- * @return {Object} a new object with the data of the others.
- */
-var extend = function() {
- var result = {}, i, attr;
- for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
- for (attr in arguments[i]) {
- if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") {
- result[attr] = arguments[i][attr];
- }
- }
- }
- return result;
-};
-
-/**
- * Transforms the (incomplete) options from the user into the complete
- * set of options to create a file.
- * @private
- * @param {Object} o the options from the user.
- * @return {Object} the complete set of options.
- */
-var prepareFileAttrs = function(o) {
- o = o || {};
- if (o.base64 === true && (o.binary === null || o.binary === undefined)) {
- o.binary = true;
- }
- o = extend(o, defaults);
- o.date = o.date || new Date();
- if (o.compression !== null) o.compression = o.compression.toUpperCase();
-
- return o;
-};
-
-/**
- * Add a file in the current folder.
- * @private
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
- * @param {Object} o the options of the file
- * @return {Object} the new file.
- */
-var fileAdd = function(name, data, o) {
- // be sure sub folders exist
- var dataType = utils.getTypeOf(data),
- parent;
-
- o = prepareFileAttrs(o);
-
- if (typeof o.unixPermissions === "string") {
- o.unixPermissions = parseInt(o.unixPermissions, 8);
- }
-
- // UNX_IFDIR 0040000 see zipinfo.c
- if (o.unixPermissions && (o.unixPermissions & 0x4000)) {
- o.dir = true;
- }
- // Bit 4 Directory
- if (o.dosPermissions && (o.dosPermissions & 0x0010)) {
- o.dir = true;
- }
-
- if (o.dir) {
- name = forceTrailingSlash(name);
- }
-
- if (o.createFolders && (parent = parentFolder(name))) {
- folderAdd.call(this, parent, true);
- }
-
- if (o.dir || data === null || typeof data === "undefined") {
- o.base64 = false;
- o.binary = false;
- data = null;
- dataType = null;
- }
- else if (dataType === "string") {
- if (o.binary && !o.base64) {
- // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask
- if (o.optimizedBinaryString !== true) {
- // this is a string, not in a base64 format.
- // Be sure that this is a correct "binary string"
- data = utils.string2binary(data);
- }
- }
- }
- else { // arraybuffer, uint8array, ...
- o.base64 = false;
- o.binary = true;
-
- if (!dataType && !(data instanceof CompressedObject)) {
- throw new Error("The data of '" + name + "' is in an unsupported format !");
- }
-
- // special case : it's way easier to work with Uint8Array than with ArrayBuffer
- if (dataType === "arraybuffer") {
- data = utils.transformTo("uint8array", data);
- }
- }
-
- var object = new ZipObject(name, data, o);
- this.files[name] = object;
- return object;
-};
-
-/**
- * Find the parent folder of the path.
- * @private
- * @param {string} path the path to use
- * @return {string} the parent folder, or ""
- */
-var parentFolder = function (path) {
- if (path.slice(-1) == '/') {
- path = path.substring(0, path.length - 1);
- }
- var lastSlash = path.lastIndexOf('/');
- return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
-};
-
-
-/**
- * Returns the path with a slash at the end.
- * @private
- * @param {String} path the path to check.
- * @return {String} the path with a trailing slash.
- */
-var forceTrailingSlash = function(path) {
- // Check the name ends with a /
- if (path.slice(-1) != "/") {
- path += "/"; // IE doesn't like substr(-1)
- }
- return path;
-};
-/**
- * Add a (sub) folder in the current folder.
- * @private
- * @param {string} name the folder's name
- * @param {boolean=} [createFolders] If true, automatically create sub
- * folders. Defaults to false.
- * @return {Object} the new folder.
- */
-var folderAdd = function(name, createFolders) {
- createFolders = (typeof createFolders !== 'undefined') ? createFolders : false;
-
- name = forceTrailingSlash(name);
-
- // Does this folder already exist?
- if (!this.files[name]) {
- fileAdd.call(this, name, null, {
- dir: true,
- createFolders: createFolders
- });
- }
- return this.files[name];
-};
-
-/**
- * Generate a JSZip.CompressedObject for a given zipOject.
- * @param {ZipObject} file the object to read.
- * @param {JSZip.compression} compression the compression to use.
- * @param {Object} compressionOptions the options to use when compressing.
- * @return {JSZip.CompressedObject} the compressed result.
- */
-var generateCompressedObjectFrom = function(file, compression, compressionOptions) {
- var result = new CompressedObject(),
- content;
-
- // the data has not been decompressed, we might reuse things !
- if (file._data instanceof CompressedObject) {
- result.uncompressedSize = file._data.uncompressedSize;
- result.crc32 = file._data.crc32;
-
- if (result.uncompressedSize === 0 || file.dir) {
- compression = compressions['STORE'];
- result.compressedContent = "";
- result.crc32 = 0;
- }
- else if (file._data.compressionMethod === compression.magic) {
- result.compressedContent = file._data.getCompressedContent();
- }
- else {
- content = file._data.getContent();
- // need to decompress / recompress
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);
- }
- }
- else {
- // have uncompressed data
- content = getBinaryData(file);
- if (!content || content.length === 0 || file.dir) {
- compression = compressions['STORE'];
- content = "";
- }
- result.uncompressedSize = content.length;
- result.crc32 = crc32(content);
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);
- }
-
- result.compressedSize = result.compressedContent.length;
- result.compressionMethod = compression.magic;
-
- return result;
-};
-
-
-
-
/**
* Generate the UNIX part of the external file attributes.
* @param {Object} unixPermissions the unix permissions or null.
@@ -11929,7 +11176,6 @@ var generateUnixExternalFileAttr = function (unixPermissions, isDir) {
// 0100664 => 0x81b4
result = isDir ? 0x41fd : 0x81b4;
}
-
return (result & 0xFFFF) << 16;
};
@@ -11946,52 +11192,68 @@ var generateUnixExternalFileAttr = function (unixPermissions, isDir) {
* Bit 4 Directory
* Bit 5 Archive
*/
-var generateDosExternalFileAttr = function (dosPermissions, isDir) {
-
+var generateDosExternalFileAttr = function (dosPermissions) {
// the dir flag is already set for compatibility
-
return (dosPermissions || 0) & 0x3F;
};
/**
* Generate the various parts used in the construction of the final zip file.
- * @param {string} name the file name.
- * @param {ZipObject} file the file content.
- * @param {JSZip.CompressedObject} compressedObject the compressed object.
+ * @param {Object} streamInfo the hash with information about the compressed file.
+ * @param {Boolean} streamedContent is the content streamed ?
+ * @param {Boolean} streamingEnded is the stream finished ?
* @param {number} offset the current offset from the start of the zip file.
* @param {String} platform let's pretend we are this platform (change platform dependents fields)
- * @return {object} the zip parts.
+ * @param {Function} encodeFileName the function to encode the file name / comment.
+ * @return {Object} the zip parts.
*/
-var generateZipParts = function(name, file, compressedObject, offset, platform) {
- var data = compressedObject.compressedContent,
+var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {
+ var file = streamInfo["file"],
+ compression = streamInfo["compression"],
+ useCustomEncoding = encodeFileName !== utf8.utf8encode,
+ encodedFileName = utils.transformTo("string", encodeFileName(file.name)),
utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
- comment = file.comment || "",
+ comment = file.comment,
+ encodedComment = utils.transformTo("string", encodeFileName(comment)),
utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,
useUTF8ForComment = utfEncodedComment.length !== comment.length,
- o = file.options,
dosTime,
dosDate,
extraFields = "",
unicodePathExtraField = "",
unicodeCommentExtraField = "",
- dir, date;
+ dir = file.dir,
+ date = file.date;
- // handle the deprecated options.dir
- if (file._initialMetadata.dir !== file.dir) {
- dir = file.dir;
- } else {
- dir = o.dir;
- }
+ var dataInfo = {
+ crc32 : 0,
+ compressedSize : 0,
+ uncompressedSize : 0
+ };
- // handle the deprecated options.date
- if(file._initialMetadata.date !== file.date) {
- date = file.date;
- } else {
- date = o.date;
+ // if the content is streamed, the sizes/crc32 are only available AFTER
+ // the end of the stream.
+ if (!streamedContent || streamingEnded) {
+ dataInfo.crc32 = streamInfo["crc32"];
+ dataInfo.compressedSize = streamInfo["compressedSize"];
+ dataInfo.uncompressedSize = streamInfo["uncompressedSize"];
+ }
+
+ var bitflag = 0;
+ if (streamedContent) {
+ // Bit 3: the sizes/crc32 are set to zero in the local header.
+ // The correct values are put in the data descriptor immediately
+ // following the compressed data.
+ bitflag |= 0x0008;
+ }
+ if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) {
+ // Bit 11: Language encoding flag (EFS).
+ bitflag |= 0x0800;
}
+
var extFileAttr = 0;
var versionMadeBy = 0;
if (dir) {
@@ -12011,17 +11273,17 @@ var generateZipParts = function(name, file, compressedObject, offset, platform)
// @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html
// @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html
- dosTime = date.getHours();
+ dosTime = date.getUTCHours();
dosTime = dosTime << 6;
- dosTime = dosTime | date.getMinutes();
+ dosTime = dosTime | date.getUTCMinutes();
dosTime = dosTime << 5;
- dosTime = dosTime | date.getSeconds() / 2;
+ dosTime = dosTime | date.getUTCSeconds() / 2;
- dosDate = date.getFullYear() - 1980;
+ dosDate = date.getUTCFullYear() - 1980;
dosDate = dosDate << 4;
- dosDate = dosDate | (date.getMonth() + 1);
+ dosDate = dosDate | (date.getUTCMonth() + 1);
dosDate = dosDate << 5;
- dosDate = dosDate | date.getDate();
+ dosDate = dosDate | date.getUTCDate();
if (useUTF8ForFileName) {
// set the unicode path extra field. unzip needs at least one extra
@@ -12037,7 +11299,7 @@ var generateZipParts = function(name, file, compressedObject, offset, platform)
// Version
decToHex(1, 1) +
// NameCRC32
- decToHex(crc32(utfEncodedFileName), 4) +
+ decToHex(crc32(encodedFileName), 4) +
// UnicodeName
utfEncodedFileName;
@@ -12056,7 +11318,7 @@ var generateZipParts = function(name, file, compressedObject, offset, platform)
// Version
decToHex(1, 1) +
// CommentCRC32
- decToHex(this.crc32(utfEncodedComment), 4) +
+ decToHex(crc32(encodedComment), 4) +
// UnicodeName
utfEncodedComment;
@@ -12074,95 +11336,931 @@ var generateZipParts = function(name, file, compressedObject, offset, platform)
// version needed to extract
header += "\x0A\x00";
// general purpose bit flag
- // set bit 11 if utf8
- header += (useUTF8ForFileName || useUTF8ForComment) ? "\x00\x08" : "\x00\x00";
+ header += decToHex(bitflag, 2);
// compression method
- header += compressedObject.compressionMethod;
+ header += compression.magic;
// last mod file time
header += decToHex(dosTime, 2);
// last mod file date
header += decToHex(dosDate, 2);
// crc-32
- header += decToHex(compressedObject.crc32, 4);
+ header += decToHex(dataInfo.crc32, 4);
// compressed size
- header += decToHex(compressedObject.compressedSize, 4);
+ header += decToHex(dataInfo.compressedSize, 4);
// uncompressed size
- header += decToHex(compressedObject.uncompressedSize, 4);
+ header += decToHex(dataInfo.uncompressedSize, 4);
// file name length
- header += decToHex(utfEncodedFileName.length, 2);
+ header += decToHex(encodedFileName.length, 2);
// extra field length
header += decToHex(extraFields.length, 2);
- var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields;
+ var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields;
var dirRecord = signature.CENTRAL_FILE_HEADER +
- // version made by (00: DOS)
- decToHex(versionMadeBy, 2) +
- // file header (common to file and central directory)
- header +
- // file comment length
- decToHex(utfEncodedComment.length, 2) +
- // disk number start
- "\x00\x00" +
- // internal file attributes TODO
- "\x00\x00" +
- // external file attributes
- decToHex(extFileAttr, 4) +
- // relative offset of local header
- decToHex(offset, 4) +
- // file name
- utfEncodedFileName +
- // extra field
- extraFields +
- // file comment
- utfEncodedComment;
+ // version made by (00: DOS)
+ decToHex(versionMadeBy, 2) +
+ // file header (common to file and central directory)
+ header +
+ // file comment length
+ decToHex(encodedComment.length, 2) +
+ // disk number start
+ "\x00\x00" +
+ // internal file attributes TODO
+ "\x00\x00" +
+ // external file attributes
+ decToHex(extFileAttr, 4) +
+ // relative offset of local header
+ decToHex(offset, 4) +
+ // file name
+ encodedFileName +
+ // extra field
+ extraFields +
+ // file comment
+ encodedComment;
return {
fileRecord: fileRecord,
- dirRecord: dirRecord,
- compressedObject: compressedObject
+ dirRecord: dirRecord
+ };
+};
+
+/**
+ * Generate the EOCD record.
+ * @param {Number} entriesCount the number of entries in the zip file.
+ * @param {Number} centralDirLength the length (in bytes) of the central dir.
+ * @param {Number} localDirLength the length (in bytes) of the local dir.
+ * @param {String} comment the zip file comment as a binary string.
+ * @param {Function} encodeFileName the function to encode the comment.
+ * @return {String} the EOCD record.
+ */
+var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) {
+ var dirEnd = "";
+ var encodedComment = utils.transformTo("string", encodeFileName(comment));
+
+ // end of central dir signature
+ dirEnd = signature.CENTRAL_DIRECTORY_END +
+ // number of this disk
+ "\x00\x00" +
+ // number of the disk with the start of the central directory
+ "\x00\x00" +
+ // total number of entries in the central directory on this disk
+ decToHex(entriesCount, 2) +
+ // total number of entries in the central directory
+ decToHex(entriesCount, 2) +
+ // size of the central directory 4 bytes
+ decToHex(centralDirLength, 4) +
+ // offset of start of central directory with respect to the starting disk number
+ decToHex(localDirLength, 4) +
+ // .ZIP file comment length
+ decToHex(encodedComment.length, 2) +
+ // .ZIP file comment
+ encodedComment;
+
+ return dirEnd;
+};
+
+/**
+ * Generate data descriptors for a file entry.
+ * @param {Object} streamInfo the hash generated by a worker, containing information
+ * on the file entry.
+ * @return {String} the data descriptors.
+ */
+var generateDataDescriptors = function (streamInfo) {
+ var descriptor = "";
+ descriptor = signature.DATA_DESCRIPTOR +
+ // crc-32 4 bytes
+ decToHex(streamInfo["crc32"], 4) +
+ // compressed size 4 bytes
+ decToHex(streamInfo["compressedSize"], 4) +
+ // uncompressed size 4 bytes
+ decToHex(streamInfo["uncompressedSize"], 4);
+
+ return descriptor;
+};
+
+
+/**
+ * A worker to concatenate other workers to create a zip file.
+ * @param {Boolean} streamFiles `true` to stream the content of the files,
+ * `false` to accumulate it.
+ * @param {String} comment the comment to use.
+ * @param {String} platform the platform to use, "UNIX" or "DOS".
+ * @param {Function} encodeFileName the function to encode file names and comments.
+ */
+function ZipFileWorker(streamFiles, comment, platform, encodeFileName) {
+ GenericWorker.call(this, "ZipFileWorker");
+ // The number of bytes written so far. This doesn't count accumulated chunks.
+ this.bytesWritten = 0;
+ // The comment of the zip file
+ this.zipComment = comment;
+ // The platform "generating" the zip file.
+ this.zipPlatform = platform;
+ // the function to encode file names and comments.
+ this.encodeFileName = encodeFileName;
+ // Should we stream the content of the files ?
+ this.streamFiles = streamFiles;
+ // If `streamFiles` is false, we will need to accumulate the content of the
+ // files to calculate sizes / crc32 (and write them *before* the content).
+ // This boolean indicates if we are accumulating chunks (it will change a lot
+ // during the lifetime of this worker).
+ this.accumulate = false;
+ // The buffer receiving chunks when accumulating content.
+ this.contentBuffer = [];
+ // The list of generated directory records.
+ this.dirRecords = [];
+ // The offset (in bytes) from the beginning of the zip file for the current source.
+ this.currentSourceOffset = 0;
+ // The total number of entries in this zip file.
+ this.entriesCount = 0;
+ // the name of the file currently being added, null when handling the end of the zip file.
+ // Used for the emitted metadata.
+ this.currentFile = null;
+
+
+
+ this._sources = [];
+}
+utils.inherits(ZipFileWorker, GenericWorker);
+
+/**
+ * @see GenericWorker.push
+ */
+ZipFileWorker.prototype.push = function (chunk) {
+
+ var currentFilePercent = chunk.meta.percent || 0;
+ var entriesCount = this.entriesCount;
+ var remainingFiles = this._sources.length;
+
+ if(this.accumulate) {
+ this.contentBuffer.push(chunk);
+ } else {
+ this.bytesWritten += chunk.data.length;
+
+ GenericWorker.prototype.push.call(this, {
+ data : chunk.data,
+ meta : {
+ currentFile : this.currentFile,
+ percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100
+ }
+ });
+ }
+};
+
+/**
+ * The worker started a new source (an other worker).
+ * @param {Object} streamInfo the streamInfo object from the new source.
+ */
+ZipFileWorker.prototype.openedSource = function (streamInfo) {
+ this.currentSourceOffset = this.bytesWritten;
+ this.currentFile = streamInfo["file"].name;
+
+ var streamedContent = this.streamFiles && !streamInfo["file"].dir;
+
+ // don't stream folders (because they don't have any content)
+ if(streamedContent) {
+ var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
+ this.push({
+ data : record.fileRecord,
+ meta : {percent:0}
+ });
+ } else {
+ // we need to wait for the whole file before pushing anything
+ this.accumulate = true;
+ }
+};
+
+/**
+ * The worker finished a source (an other worker).
+ * @param {Object} streamInfo the streamInfo object from the finished source.
+ */
+ZipFileWorker.prototype.closedSource = function (streamInfo) {
+ this.accumulate = false;
+ var streamedContent = this.streamFiles && !streamInfo["file"].dir;
+ var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
+
+ this.dirRecords.push(record.dirRecord);
+ if(streamedContent) {
+ // after the streamed file, we put data descriptors
+ this.push({
+ data : generateDataDescriptors(streamInfo),
+ meta : {percent:100}
+ });
+ } else {
+ // the content wasn't streamed, we need to push everything now
+ // first the file record, then the content
+ this.push({
+ data : record.fileRecord,
+ meta : {percent:0}
+ });
+ while(this.contentBuffer.length) {
+ this.push(this.contentBuffer.shift());
+ }
+ }
+ this.currentFile = null;
+};
+
+/**
+ * @see GenericWorker.flush
+ */
+ZipFileWorker.prototype.flush = function () {
+
+ var localDirLength = this.bytesWritten;
+ for(var i = 0; i < this.dirRecords.length; i++) {
+ this.push({
+ data : this.dirRecords[i],
+ meta : {percent:100}
+ });
+ }
+ var centralDirLength = this.bytesWritten - localDirLength;
+
+ var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName);
+
+ this.push({
+ data : dirEnd,
+ meta : {percent:100}
+ });
+};
+
+/**
+ * Prepare the next source to be read.
+ */
+ZipFileWorker.prototype.prepareNextSource = function () {
+ this.previous = this._sources.shift();
+ this.openedSource(this.previous.streamInfo);
+ if (this.isPaused) {
+ this.previous.pause();
+ } else {
+ this.previous.resume();
+ }
+};
+
+/**
+ * @see GenericWorker.registerPrevious
+ */
+ZipFileWorker.prototype.registerPrevious = function (previous) {
+ this._sources.push(previous);
+ var self = this;
+
+ previous.on("data", function (chunk) {
+ self.processChunk(chunk);
+ });
+ previous.on("end", function () {
+ self.closedSource(self.previous.streamInfo);
+ if(self._sources.length) {
+ self.prepareNextSource();
+ } else {
+ self.end();
+ }
+ });
+ previous.on("error", function (e) {
+ self.error(e);
+ });
+ return this;
+};
+
+/**
+ * @see GenericWorker.resume
+ */
+ZipFileWorker.prototype.resume = function () {
+ if(!GenericWorker.prototype.resume.call(this)) {
+ return false;
+ }
+
+ if (!this.previous && this._sources.length) {
+ this.prepareNextSource();
+ return true;
+ }
+ if (!this.previous && !this._sources.length && !this.generatedError) {
+ this.end();
+ return true;
+ }
+};
+
+/**
+ * @see GenericWorker.error
+ */
+ZipFileWorker.prototype.error = function (e) {
+ var sources = this._sources;
+ if(!GenericWorker.prototype.error.call(this, e)) {
+ return false;
+ }
+ for(var i = 0; i < sources.length; i++) {
+ try {
+ sources[i].error(e);
+ } catch(e) {
+ // the `error` exploded, nothing to do
+ }
+ }
+ return true;
+};
+
+/**
+ * @see GenericWorker.lock
+ */
+ZipFileWorker.prototype.lock = function () {
+ GenericWorker.prototype.lock.call(this);
+ var sources = this._sources;
+ for(var i = 0; i < sources.length; i++) {
+ sources[i].lock();
+ }
+};
+
+module.exports = ZipFileWorker;
+
+},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(require,module,exports){
+"use strict";
+
+var compressions = require("../compressions");
+var ZipFileWorker = require("./ZipFileWorker");
+
+/**
+ * Find the compression to use.
+ * @param {String} fileCompression the compression defined at the file level, if any.
+ * @param {String} zipCompression the compression defined at the load() level.
+ * @return {Object} the compression object to use.
+ */
+var getCompression = function (fileCompression, zipCompression) {
+
+ var compressionName = fileCompression || zipCompression;
+ var compression = compressions[compressionName];
+ if (!compression) {
+ throw new Error(compressionName + " is not a valid compression method !");
+ }
+ return compression;
+};
+
+/**
+ * Create a worker to generate a zip file.
+ * @param {JSZip} zip the JSZip instance at the right root level.
+ * @param {Object} options to generate the zip file.
+ * @param {String} comment the comment to use.
+ */
+exports.generateWorker = function (zip, options, comment) {
+
+ var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName);
+ var entriesCount = 0;
+ try {
+
+ zip.forEach(function (relativePath, file) {
+ entriesCount++;
+ var compression = getCompression(file.options.compression, options.compression);
+ var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};
+ var dir = file.dir, date = file.date;
+
+ file._compressWorker(compression, compressionOptions)
+ .withStreamInfo("file", {
+ name : relativePath,
+ dir : dir,
+ date : date,
+ comment : file.comment || "",
+ unixPermissions : file.unixPermissions,
+ dosPermissions : file.dosPermissions
+ })
+ .pipe(zipFileWorker);
+ });
+ zipFileWorker.entriesCount = entriesCount;
+ } catch (e) {
+ zipFileWorker.error(e);
+ }
+
+ return zipFileWorker;
+};
+
+},{"../compressions":3,"./ZipFileWorker":8}],10:[function(require,module,exports){
+"use strict";
+
+/**
+ * Representation a of zip file in js
+ * @constructor
+ */
+function JSZip() {
+ // if this constructor is used without `new`, it adds `new` before itself:
+ if(!(this instanceof JSZip)) {
+ return new JSZip();
+ }
+
+ if(arguments.length) {
+ throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
+ }
+
+ // object containing the files :
+ // {
+ // "folder/" : {...},
+ // "folder/data.txt" : {...}
+ // }
+ // NOTE: we use a null prototype because we do not
+ // want filenames like "toString" coming from a zip file
+ // to overwrite methods and attributes in a normal Object.
+ this.files = Object.create(null);
+
+ this.comment = null;
+
+ // Where we are in the hierarchy
+ this.root = "";
+ this.clone = function() {
+ var newObj = new JSZip();
+ for (var i in this) {
+ if (typeof this[i] !== "function") {
+ newObj[i] = this[i];
+ }
+ }
+ return newObj;
};
+}
+JSZip.prototype = require("./object");
+JSZip.prototype.loadAsync = require("./load");
+JSZip.support = require("./support");
+JSZip.defaults = require("./defaults");
+
+// TODO find a better way to handle this version,
+// a require('package.json').version doesn't work with webpack, see #327
+JSZip.version = "3.10.1";
+
+JSZip.loadAsync = function (content, options) {
+ return new JSZip().loadAsync(content, options);
+};
+
+JSZip.external = require("./external");
+module.exports = JSZip;
+
+},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(require,module,exports){
+"use strict";
+var utils = require("./utils");
+var external = require("./external");
+var utf8 = require("./utf8");
+var ZipEntries = require("./zipEntries");
+var Crc32Probe = require("./stream/Crc32Probe");
+var nodejsUtils = require("./nodejsUtils");
+
+/**
+ * Check the CRC32 of an entry.
+ * @param {ZipEntry} zipEntry the zip entry to check.
+ * @return {Promise} the result.
+ */
+function checkEntryCRC32(zipEntry) {
+ return new external.Promise(function (resolve, reject) {
+ var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe());
+ worker.on("error", function (e) {
+ reject(e);
+ })
+ .on("end", function () {
+ if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
+ reject(new Error("Corrupted zip : CRC32 mismatch"));
+ } else {
+ resolve();
+ }
+ })
+ .resume();
+ });
+}
+
+module.exports = function (data, options) {
+ var zip = this;
+ options = utils.extend(options || {}, {
+ base64: false,
+ checkCRC32: false,
+ optimizedBinaryString: false,
+ createFolders: false,
+ decodeFileName: utf8.utf8decode
+ });
+
+ if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
+ return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file."));
+ }
+
+ return utils.prepareContent("the loaded zip file", data, true, options.optimizedBinaryString, options.base64)
+ .then(function (data) {
+ var zipEntries = new ZipEntries(options);
+ zipEntries.load(data);
+ return zipEntries;
+ }).then(function checkCRC32(zipEntries) {
+ var promises = [external.Promise.resolve(zipEntries)];
+ var files = zipEntries.files;
+ if (options.checkCRC32) {
+ for (var i = 0; i < files.length; i++) {
+ promises.push(checkEntryCRC32(files[i]));
+ }
+ }
+ return external.Promise.all(promises);
+ }).then(function addFiles(results) {
+ var zipEntries = results.shift();
+ var files = zipEntries.files;
+ for (var i = 0; i < files.length; i++) {
+ var input = files[i];
+
+ var unsafeName = input.fileNameStr;
+ var safeName = utils.resolve(input.fileNameStr);
+
+ zip.file(safeName, input.decompressed, {
+ binary: true,
+ optimizedBinaryString: true,
+ date: input.date,
+ dir: input.dir,
+ comment: input.fileCommentStr.length ? input.fileCommentStr : null,
+ unixPermissions: input.unixPermissions,
+ dosPermissions: input.dosPermissions,
+ createFolders: options.createFolders
+ });
+ if (!input.dir) {
+ zip.file(safeName).unsafeOriginalName = unsafeName;
+ }
+ }
+ if (zipEntries.zipComment.length) {
+ zip.comment = zipEntries.zipComment;
+ }
+
+ return zip;
+ });
+};
+
+},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var GenericWorker = require("../stream/GenericWorker");
+
+/**
+ * A worker that use a nodejs stream as source.
+ * @constructor
+ * @param {String} filename the name of the file entry for this stream.
+ * @param {Readable} stream the nodejs stream.
+ */
+function NodejsStreamInputAdapter(filename, stream) {
+ GenericWorker.call(this, "Nodejs stream input adapter for " + filename);
+ this._upstreamEnded = false;
+ this._bindStream(stream);
+}
+
+utils.inherits(NodejsStreamInputAdapter, GenericWorker);
+
+/**
+ * Prepare the stream and bind the callbacks on it.
+ * Do this ASAP on node 0.10 ! A lazy binding doesn't always work.
+ * @param {Stream} stream the nodejs stream to use.
+ */
+NodejsStreamInputAdapter.prototype._bindStream = function (stream) {
+ var self = this;
+ this._stream = stream;
+ stream.pause();
+ stream
+ .on("data", function (chunk) {
+ self.push({
+ data: chunk,
+ meta : {
+ percent : 0
+ }
+ });
+ })
+ .on("error", function (e) {
+ if(self.isPaused) {
+ this.generatedError = e;
+ } else {
+ self.error(e);
+ }
+ })
+ .on("end", function () {
+ if(self.isPaused) {
+ self._upstreamEnded = true;
+ } else {
+ self.end();
+ }
+ });
+};
+NodejsStreamInputAdapter.prototype.pause = function () {
+ if(!GenericWorker.prototype.pause.call(this)) {
+ return false;
+ }
+ this._stream.pause();
+ return true;
+};
+NodejsStreamInputAdapter.prototype.resume = function () {
+ if(!GenericWorker.prototype.resume.call(this)) {
+ return false;
+ }
+
+ if(this._upstreamEnded) {
+ this.end();
+ } else {
+ this._stream.resume();
+ }
+
+ return true;
+};
+
+module.exports = NodejsStreamInputAdapter;
+
+},{"../stream/GenericWorker":28,"../utils":32}],13:[function(require,module,exports){
+"use strict";
+
+var Readable = require("readable-stream").Readable;
+
+var utils = require("../utils");
+utils.inherits(NodejsStreamOutputAdapter, Readable);
+
+/**
+* A nodejs stream using a worker as source.
+* @see the SourceWrapper in http://nodejs.org/api/stream.html
+* @constructor
+* @param {StreamHelper} helper the helper wrapping the worker
+* @param {Object} options the nodejs stream options
+* @param {Function} updateCb the update callback.
+*/
+function NodejsStreamOutputAdapter(helper, options, updateCb) {
+ Readable.call(this, options);
+ this._helper = helper;
+
+ var self = this;
+ helper.on("data", function (data, meta) {
+ if (!self.push(data)) {
+ self._helper.pause();
+ }
+ if(updateCb) {
+ updateCb(meta);
+ }
+ })
+ .on("error", function(e) {
+ self.emit("error", e);
+ })
+ .on("end", function () {
+ self.push(null);
+ });
+}
+
+
+NodejsStreamOutputAdapter.prototype._read = function() {
+ this._helper.resume();
+};
+
+module.exports = NodejsStreamOutputAdapter;
+
+},{"../utils":32,"readable-stream":16}],14:[function(require,module,exports){
+"use strict";
+
+module.exports = {
+ /**
+ * True if this is running in Nodejs, will be undefined in a browser.
+ * In a browser, browserify won't include this file and the whole module
+ * will be resolved an empty object.
+ */
+ isNode : typeof Buffer !== "undefined",
+ /**
+ * Create a new nodejs Buffer from an existing content.
+ * @param {Object} data the data to pass to the constructor.
+ * @param {String} encoding the encoding to use.
+ * @return {Buffer} a new Buffer.
+ */
+ newBufferFrom: function(data, encoding) {
+ if (Buffer.from && Buffer.from !== Uint8Array.from) {
+ return Buffer.from(data, encoding);
+ } else {
+ if (typeof data === "number") {
+ // Safeguard for old Node.js versions. On newer versions,
+ // Buffer.from(number) / Buffer(number, encoding) already throw.
+ throw new Error("The \"data\" argument must not be a number");
+ }
+ return new Buffer(data, encoding);
+ }
+ },
+ /**
+ * Create a new nodejs Buffer with the specified size.
+ * @param {Integer} size the size of the buffer.
+ * @return {Buffer} a new Buffer.
+ */
+ allocBuffer: function (size) {
+ if (Buffer.alloc) {
+ return Buffer.alloc(size);
+ } else {
+ var buf = new Buffer(size);
+ buf.fill(0);
+ return buf;
+ }
+ },
+ /**
+ * Find out if an object is a Buffer.
+ * @param {Object} b the object to test.
+ * @return {Boolean} true if the object is a Buffer, false otherwise.
+ */
+ isBuffer : function(b){
+ return Buffer.isBuffer(b);
+ },
+
+ isStream : function (obj) {
+ return obj &&
+ typeof obj.on === "function" &&
+ typeof obj.pause === "function" &&
+ typeof obj.resume === "function";
+ }
+};
+
+},{}],15:[function(require,module,exports){
+"use strict";
+var utf8 = require("./utf8");
+var utils = require("./utils");
+var GenericWorker = require("./stream/GenericWorker");
+var StreamHelper = require("./stream/StreamHelper");
+var defaults = require("./defaults");
+var CompressedObject = require("./compressedObject");
+var ZipObject = require("./zipObject");
+var generate = require("./generate");
+var nodejsUtils = require("./nodejsUtils");
+var NodejsStreamInputAdapter = require("./nodejs/NodejsStreamInputAdapter");
+
+
+/**
+ * Add a file in the current folder.
+ * @private
+ * @param {string} name the name of the file
+ * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
+ * @param {Object} originalOptions the options of the file
+ * @return {Object} the new file.
+ */
+var fileAdd = function(name, data, originalOptions) {
+ // be sure sub folders exist
+ var dataType = utils.getTypeOf(data),
+ parent;
+
+
+ /*
+ * Correct options.
+ */
+
+ var o = utils.extend(originalOptions || {}, defaults);
+ o.date = o.date || new Date();
+ if (o.compression !== null) {
+ o.compression = o.compression.toUpperCase();
+ }
+
+ if (typeof o.unixPermissions === "string") {
+ o.unixPermissions = parseInt(o.unixPermissions, 8);
+ }
+
+ // UNX_IFDIR 0040000 see zipinfo.c
+ if (o.unixPermissions && (o.unixPermissions & 0x4000)) {
+ o.dir = true;
+ }
+ // Bit 4 Directory
+ if (o.dosPermissions && (o.dosPermissions & 0x0010)) {
+ o.dir = true;
+ }
+
+ if (o.dir) {
+ name = forceTrailingSlash(name);
+ }
+ if (o.createFolders && (parent = parentFolder(name))) {
+ folderAdd.call(this, parent, true);
+ }
+
+ var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
+ if (!originalOptions || typeof originalOptions.binary === "undefined") {
+ o.binary = !isUnicodeString;
+ }
+
+
+ var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0;
+
+ if (isCompressedEmpty || o.dir || !data || data.length === 0) {
+ o.base64 = false;
+ o.binary = true;
+ data = "";
+ o.compression = "STORE";
+ dataType = "string";
+ }
+
+ /*
+ * Convert content to fit.
+ */
+
+ var zipObjectContent = null;
+ if (data instanceof CompressedObject || data instanceof GenericWorker) {
+ zipObjectContent = data;
+ } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
+ zipObjectContent = new NodejsStreamInputAdapter(name, data);
+ } else {
+ zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64);
+ }
+
+ var object = new ZipObject(name, zipObjectContent, o);
+ this.files[name] = object;
+ /*
+ TODO: we can't throw an exception because we have async promises
+ (we can have a promise of a Date() for example) but returning a
+ promise is useless because file(name, data) returns the JSZip
+ object for chaining. Should we break that to allow the user
+ to catch the error ?
+
+ return external.Promise.resolve(zipObjectContent)
+ .then(function () {
+ return object;
+ });
+ */
+};
+
+/**
+ * Find the parent folder of the path.
+ * @private
+ * @param {string} path the path to use
+ * @return {string} the parent folder, or ""
+ */
+var parentFolder = function (path) {
+ if (path.slice(-1) === "/") {
+ path = path.substring(0, path.length - 1);
+ }
+ var lastSlash = path.lastIndexOf("/");
+ return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
+};
+
+/**
+ * Returns the path with a slash at the end.
+ * @private
+ * @param {String} path the path to check.
+ * @return {String} the path with a trailing slash.
+ */
+var forceTrailingSlash = function(path) {
+ // Check the name ends with a /
+ if (path.slice(-1) !== "/") {
+ path += "/"; // IE doesn't like substr(-1)
+ }
+ return path;
+};
+
+/**
+ * Add a (sub) folder in the current folder.
+ * @private
+ * @param {string} name the folder's name
+ * @param {boolean=} [createFolders] If true, automatically create sub
+ * folders. Defaults to false.
+ * @return {Object} the new folder.
+ */
+var folderAdd = function(name, createFolders) {
+ createFolders = (typeof createFolders !== "undefined") ? createFolders : defaults.createFolders;
+
+ name = forceTrailingSlash(name);
+
+ // Does this folder already exist?
+ if (!this.files[name]) {
+ fileAdd.call(this, name, null, {
+ dir: true,
+ createFolders: createFolders
+ });
+ }
+ return this.files[name];
};
+/**
+* Cross-window, cross-Node-context regular expression detection
+* @param {Object} object Anything
+* @return {Boolean} true if the object is a regular expression,
+* false otherwise
+*/
+function isRegExp(object) {
+ return Object.prototype.toString.call(object) === "[object RegExp]";
+}
// return the actual prototype of JSZip
var out = {
/**
- * Read an existing zip and merge the data in the current JSZip object.
- * The implementation is in jszip-load.js, don't forget to include it.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} stream The stream to load
- * @param {Object} options Options for loading the stream.
- * options.base64 : is the stream in base64 ? default : false
- * @return {JSZip} the current JSZip object
+ * @see loadAsync
*/
- load: function(stream, options) {
- throw new Error("Load method is not defined. Is the file jszip-load.js included ?");
+ load: function() {
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
},
+
/**
- * Filter nested files/folders with the specified function.
- * @param {Function} search the predicate to use :
+ * Call a callback function for each entry at this folder level.
+ * @param {Function} cb the callback function:
* function (relativePath, file) {...}
* It takes 2 arguments : the relative path and the file.
- * @return {Array} An array of matching elements.
*/
- filter: function(search) {
- var result = [],
- filename, relativePath, file, fileClone;
+ forEach: function(cb) {
+ var filename, relativePath, file;
+ // ignore warning about unwanted properties because this.files is a null prototype object
+ /* eslint-disable-next-line guard-for-in */
for (filename in this.files) {
- if (!this.files.hasOwnProperty(filename)) {
- continue;
- }
file = this.files[filename];
- // return a new object, don't let the user mess with our internal objects :)
- fileClone = new ZipObject(file.name, file._data, extend(file.options));
relativePath = filename.slice(this.root.length, filename.length);
- if (filename.slice(0, this.root.length) === this.root && // the file is in the current root
- search(relativePath, fileClone)) { // and the file matches the function
- result.push(fileClone);
+ if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root
+ cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn...
}
}
+ },
+
+ /**
+ * Filter nested files/folders with the specified function.
+ * @param {Function} search the predicate to use :
+ * function (relativePath, file) {...}
+ * It takes 2 arguments : the relative path and the file.
+ * @return {Array} An array of matching elements.
+ */
+ filter: function(search) {
+ var result = [];
+ this.forEach(function (relativePath, entry) {
+ if (search(relativePath, entry)) { // the file matches the function
+ result.push(entry);
+ }
+
+ });
return result;
},
@@ -12177,16 +12275,19 @@ var out = {
*/
file: function(name, data, o) {
if (arguments.length === 1) {
- if (utils.isRegExp(name)) {
+ if (isRegExp(name)) {
var regexp = name;
return this.filter(function(relativePath, file) {
return !file.dir && regexp.test(relativePath);
});
}
else { // text
- return this.filter(function(relativePath, file) {
- return !file.dir && relativePath === name;
- })[0] || null;
+ var obj = this.files[this.root + name];
+ if (obj && !obj.dir) {
+ return obj;
+ } else {
+ return null;
+ }
}
}
else { // more than one argument : we have data !
@@ -12206,7 +12307,7 @@ var out = {
return this;
}
- if (utils.isRegExp(arg)) {
+ if (isRegExp(arg)) {
return this.filter(function(relativePath, file) {
return file.dir && arg.test(relativePath);
});
@@ -12232,7 +12333,7 @@ var out = {
var file = this.files[name];
if (!file) {
// Look for any folders
- if (name.slice(-1) != "/") {
+ if (name.slice(-1) !== "/") {
name += "/";
}
file = this.files[name];
@@ -12255,306 +12356,348 @@ var out = {
},
/**
- * Generate the complete zip file
+ * @deprecated This method has been removed in JSZip 3.0, please check the upgrade guide.
+ */
+ generate: function() {
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
+ },
+
+ /**
+ * Generate the complete zip file as an internal stream.
* @param {Object} options the options to generate the zip file :
- * - base64, (deprecated, use type instead) true to generate base64.
* - compression, "STORE" by default.
* - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
- * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file
+ * @return {StreamHelper} the streamed zip file.
*/
- generate: function(options) {
- options = extend(options || {}, {
- base64: true,
- compression: "STORE",
- compressionOptions : null,
- type: "base64",
- platform: "DOS",
- comment: null,
- mimeType: 'application/zip'
- });
-
- utils.checkSupport(options.type);
-
- // accept nodejs `process.platform`
- if(
- options.platform === 'darwin' ||
- options.platform === 'freebsd' ||
- options.platform === 'linux' ||
- options.platform === 'sunos'
- ) {
- options.platform = "UNIX";
- }
- if (options.platform === 'win32') {
- options.platform = "DOS";
- }
+ generateInternalStream: function(options) {
+ var worker, opts = {};
+ try {
+ opts = utils.extend(options || {}, {
+ streamFiles: false,
+ compression: "STORE",
+ compressionOptions : null,
+ type: "",
+ platform: "DOS",
+ comment: null,
+ mimeType: "application/zip",
+ encodeFileName: utf8.utf8encode
+ });
- var zipData = [],
- localDirLength = 0,
- centralDirLength = 0,
- writer, i,
- utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || ""));
+ opts.type = opts.type.toLowerCase();
+ opts.compression = opts.compression.toUpperCase();
- // first, generate all the zip parts.
- for (var name in this.files) {
- if (!this.files.hasOwnProperty(name)) {
- continue;
+ // "binarystring" is preferred but the internals use "string".
+ if(opts.type === "binarystring") {
+ opts.type = "string";
}
- var file = this.files[name];
- var compressionName = file.options.compression || options.compression.toUpperCase();
- var compression = compressions[compressionName];
- if (!compression) {
- throw new Error(compressionName + " is not a valid compression method !");
+ if (!opts.type) {
+ throw new Error("No output type specified.");
}
- var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};
-
- var compressedObject = generateCompressedObjectFrom.call(this, file, compression, compressionOptions);
-
- var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength, options.platform);
- localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize;
- centralDirLength += zipPart.dirRecord.length;
- zipData.push(zipPart);
- }
-
- var dirEnd = "";
- // end of central dir signature
- dirEnd = signature.CENTRAL_DIRECTORY_END +
- // number of this disk
- "\x00\x00" +
- // number of the disk with the start of the central directory
- "\x00\x00" +
- // total number of entries in the central directory on this disk
- decToHex(zipData.length, 2) +
- // total number of entries in the central directory
- decToHex(zipData.length, 2) +
- // size of the central directory 4 bytes
- decToHex(centralDirLength, 4) +
- // offset of start of central directory with respect to the starting disk number
- decToHex(localDirLength, 4) +
- // .ZIP file comment length
- decToHex(utfEncodedComment.length, 2) +
- // .ZIP file comment
- utfEncodedComment;
+ utils.checkSupport(opts.type);
+ // accept nodejs `process.platform`
+ if(
+ opts.platform === "darwin" ||
+ opts.platform === "freebsd" ||
+ opts.platform === "linux" ||
+ opts.platform === "sunos"
+ ) {
+ opts.platform = "UNIX";
+ }
+ if (opts.platform === "win32") {
+ opts.platform = "DOS";
+ }
- // we have all the parts (and the total length)
- // time to create a writer !
- var typeName = options.type.toLowerCase();
- if(typeName==="uint8array"||typeName==="arraybuffer"||typeName==="blob"||typeName==="nodebuffer") {
- writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length);
- }else{
- writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length);
- }
-
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].fileRecord);
- writer.append(zipData[i].compressedObject.compressedContent);
+ var comment = opts.comment || this.comment || "";
+ worker = generate.generateWorker(this, opts, comment);
+ } catch (e) {
+ worker = new GenericWorker("error");
+ worker.error(e);
}
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].dirRecord);
- }
-
- writer.append(dirEnd);
-
- var zip = writer.finalize();
-
-
-
- switch(options.type.toLowerCase()) {
- // case "zip is an Uint8Array"
- case "uint8array" :
- case "arraybuffer" :
- case "nodebuffer" :
- return utils.transformTo(options.type.toLowerCase(), zip);
- case "blob" :
- return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip), options.mimeType);
- // case "zip is a string"
- case "base64" :
- return (options.base64) ? base64.encode(zip) : zip;
- default : // case "string" :
- return zip;
- }
-
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- crc32: function (input, crc) {
- return crc32(input, crc);
+ return new StreamHelper(worker, opts.type || "string", opts.mimeType);
},
-
/**
- * @deprecated
- * This method will be removed in a future version without replacement.
+ * Generate the complete zip file asynchronously.
+ * @see generateInternalStream
*/
- utf8encode: function (string) {
- return utils.transformTo("string", utf8.utf8encode(string));
+ generateAsync: function(options, onUpdate) {
+ return this.generateInternalStream(options).accumulate(onUpdate);
},
-
/**
- * @deprecated
- * This method will be removed in a future version without replacement.
+ * Generate the complete zip file asynchronously.
+ * @see generateInternalStream
*/
- utf8decode: function (input) {
- return utf8.utf8decode(input);
+ generateNodeStream: function(options, onUpdate) {
+ options = options || {};
+ if (!options.type) {
+ options.type = "nodebuffer";
+ }
+ return this.generateInternalStream(options).toNodejsStream(onUpdate);
}
};
module.exports = out;
-},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(_dereq_,module,exports){
-'use strict';
-exports.LOCAL_FILE_HEADER = "PK\x03\x04";
-exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
-exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
-exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
-exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
-exports.DATA_DESCRIPTOR = "PK\x07\x08";
+},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(require,module,exports){
+"use strict";
+/*
+ * This file is used by module bundlers (browserify/webpack/etc) when
+ * including a stream implementation. We use "readable-stream" to get a
+ * consistent behavior between nodejs versions but bundlers often have a shim
+ * for "stream". Using this shim greatly improve the compatibility and greatly
+ * reduce the final size of the bundle (only one stream implementation, not
+ * two).
+ */
+module.exports = require("stream");
-},{}],15:[function(_dereq_,module,exports){
-'use strict';
-var DataReader = _dereq_('./dataReader');
-var utils = _dereq_('./utils');
+},{"stream":undefined}],17:[function(require,module,exports){
+"use strict";
+var DataReader = require("./DataReader");
+var utils = require("../utils");
-function StringReader(data, optimizedBinaryString) {
- this.data = data;
- if (!optimizedBinaryString) {
- this.data = utils.string2binary(this.data);
+function ArrayReader(data) {
+ DataReader.call(this, data);
+ for(var i = 0; i < this.data.length; i++) {
+ data[i] = data[i] & 0xFF;
}
- this.length = this.data.length;
- this.index = 0;
}
-StringReader.prototype = new DataReader();
+utils.inherits(ArrayReader, DataReader);
/**
* @see DataReader.byteAt
*/
-StringReader.prototype.byteAt = function(i) {
- return this.data.charCodeAt(i);
+ArrayReader.prototype.byteAt = function(i) {
+ return this.data[this.zero + i];
};
/**
* @see DataReader.lastIndexOfSignature
*/
-StringReader.prototype.lastIndexOfSignature = function(sig) {
- return this.data.lastIndexOf(sig);
+ArrayReader.prototype.lastIndexOfSignature = function(sig) {
+ var sig0 = sig.charCodeAt(0),
+ sig1 = sig.charCodeAt(1),
+ sig2 = sig.charCodeAt(2),
+ sig3 = sig.charCodeAt(3);
+ for (var i = this.length - 4; i >= 0; --i) {
+ if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
+ return i - this.zero;
+ }
+ }
+
+ return -1;
+};
+/**
+ * @see DataReader.readAndCheckSignature
+ */
+ArrayReader.prototype.readAndCheckSignature = function (sig) {
+ var sig0 = sig.charCodeAt(0),
+ sig1 = sig.charCodeAt(1),
+ sig2 = sig.charCodeAt(2),
+ sig3 = sig.charCodeAt(3),
+ data = this.readData(4);
+ return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3];
};
/**
* @see DataReader.readData
*/
-StringReader.prototype.readData = function(size) {
+ArrayReader.prototype.readData = function(size) {
this.checkOffset(size);
- // this will work because the constructor applied the "& 0xff" mask.
- var result = this.data.slice(this.index, this.index + size);
+ if(size === 0) {
+ return [];
+ }
+ var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
this.index += size;
return result;
};
-module.exports = StringReader;
-
-},{"./dataReader":5,"./utils":21}],16:[function(_dereq_,module,exports){
-'use strict';
+module.exports = ArrayReader;
-var utils = _dereq_('./utils');
+},{"../utils":32,"./DataReader":18}],18:[function(require,module,exports){
+"use strict";
+var utils = require("../utils");
-/**
- * An object to write any content to a string.
- * @constructor
- */
-var StringWriter = function() {
- this.data = [];
-};
-StringWriter.prototype = {
+function DataReader(data) {
+ this.data = data; // type : see implementation
+ this.length = data.length;
+ this.index = 0;
+ this.zero = 0;
+}
+DataReader.prototype = {
/**
- * Append any content to the current string.
- * @param {Object} input the content to add.
- */
- append: function(input) {
- input = utils.transformTo("string", input);
- this.data.push(input);
- },
+ * Check that the offset will not go too far.
+ * @param {string} offset the additional offset to check.
+ * @throws {Error} an Error if the offset is out of bounds.
+ */
+ checkOffset: function(offset) {
+ this.checkIndex(this.index + offset);
+ },
+ /**
+ * Check that the specified index will not be too far.
+ * @param {string} newIndex the index to check.
+ * @throws {Error} an Error if the index is out of bounds.
+ */
+ checkIndex: function(newIndex) {
+ if (this.length < this.zero + newIndex || newIndex < 0) {
+ throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
+ }
+ },
+ /**
+ * Change the index.
+ * @param {number} newIndex The new index.
+ * @throws {Error} if the new index is out of the data.
+ */
+ setIndex: function(newIndex) {
+ this.checkIndex(newIndex);
+ this.index = newIndex;
+ },
+ /**
+ * Skip the next n bytes.
+ * @param {number} n the number of bytes to skip.
+ * @throws {Error} if the new index is out of the data.
+ */
+ skip: function(n) {
+ this.setIndex(this.index + n);
+ },
+ /**
+ * Get the byte at the specified index.
+ * @param {number} i the index to use.
+ * @return {number} a byte.
+ */
+ byteAt: function() {
+ // see implementations
+ },
+ /**
+ * Get the next number with a given byte size.
+ * @param {number} size the number of bytes to read.
+ * @return {number} the corresponding number.
+ */
+ readInt: function(size) {
+ var result = 0,
+ i;
+ this.checkOffset(size);
+ for (i = this.index + size - 1; i >= this.index; i--) {
+ result = (result << 8) + this.byteAt(i);
+ }
+ this.index += size;
+ return result;
+ },
+ /**
+ * Get the next string with a given byte size.
+ * @param {number} size the number of bytes to read.
+ * @return {string} the corresponding string.
+ */
+ readString: function(size) {
+ return utils.transformTo("string", this.readData(size));
+ },
+ /**
+ * Get raw data without conversion, bytes.
+ * @param {number} size the number of bytes to read.
+ * @return {Object} the raw data, implementation specific.
+ */
+ readData: function() {
+ // see implementations
+ },
+ /**
+ * Find the last occurrence of a zip signature (4 bytes).
+ * @param {string} sig the signature to find.
+ * @return {number} the index of the last occurrence, -1 if not found.
+ */
+ lastIndexOfSignature: function() {
+ // see implementations
+ },
+ /**
+ * Read the signature (4 bytes) at the current position and compare it with sig.
+ * @param {string} sig the expected signature
+ * @return {boolean} true if the signature matches, false otherwise.
+ */
+ readAndCheckSignature: function() {
+ // see implementations
+ },
/**
- * Finalize the construction an return the result.
- * @return {string} the generated string.
+ * Get the next date.
+ * @return {Date} the date.
*/
- finalize: function() {
- return this.data.join("");
+ readDate: function() {
+ var dostime = this.readInt(4);
+ return new Date(Date.UTC(
+ ((dostime >> 25) & 0x7f) + 1980, // year
+ ((dostime >> 21) & 0x0f) - 1, // month
+ (dostime >> 16) & 0x1f, // day
+ (dostime >> 11) & 0x1f, // hour
+ (dostime >> 5) & 0x3f, // minute
+ (dostime & 0x1f) << 1)); // second
}
};
+module.exports = DataReader;
-module.exports = StringWriter;
-
-},{"./utils":21}],17:[function(_dereq_,module,exports){
-(function (Buffer){
-'use strict';
-exports.base64 = true;
-exports.array = true;
-exports.string = true;
-exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
-// contains true if JSZip can read/generate nodejs Buffer, false otherwise.
-// Browserify will provide a Buffer implementation for browsers, which is
-// an augmented Uint8Array (i.e., can be used as either Buffer or U8).
-exports.nodebuffer = typeof Buffer !== "undefined";
-// contains true if JSZip can read/generate Uint8Array, false otherwise.
-exports.uint8array = typeof Uint8Array !== "undefined";
+},{"../utils":32}],19:[function(require,module,exports){
+"use strict";
+var Uint8ArrayReader = require("./Uint8ArrayReader");
+var utils = require("../utils");
-if (typeof ArrayBuffer === "undefined") {
- exports.blob = false;
-}
-else {
- var buffer = new ArrayBuffer(0);
- try {
- exports.blob = new Blob([buffer], {
- type: "application/zip"
- }).size === 0;
- }
- catch (e) {
- try {
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
- var builder = new Builder();
- builder.append(buffer);
- exports.blob = builder.getBlob('application/zip').size === 0;
- }
- catch (e) {
- exports.blob = false;
- }
- }
+function NodeBufferReader(data) {
+ Uint8ArrayReader.call(this, data);
}
+utils.inherits(NodeBufferReader, Uint8ArrayReader);
-}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
-},{}],18:[function(_dereq_,module,exports){
-'use strict';
-var DataReader = _dereq_('./dataReader');
+/**
+ * @see DataReader.readData
+ */
+NodeBufferReader.prototype.readData = function(size) {
+ this.checkOffset(size);
+ var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
+ this.index += size;
+ return result;
+};
+module.exports = NodeBufferReader;
-function Uint8ArrayReader(data) {
- if (data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
- }
+},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(require,module,exports){
+"use strict";
+var DataReader = require("./DataReader");
+var utils = require("../utils");
+
+function StringReader(data) {
+ DataReader.call(this, data);
}
-Uint8ArrayReader.prototype = new DataReader();
+utils.inherits(StringReader, DataReader);
/**
* @see DataReader.byteAt
*/
-Uint8ArrayReader.prototype.byteAt = function(i) {
- return this.data[i];
+StringReader.prototype.byteAt = function(i) {
+ return this.data.charCodeAt(this.zero + i);
};
/**
* @see DataReader.lastIndexOfSignature
*/
-Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) {
- var sig0 = sig.charCodeAt(0),
- sig1 = sig.charCodeAt(1),
- sig2 = sig.charCodeAt(2),
- sig3 = sig.charCodeAt(3);
- for (var i = this.length - 4; i >= 0; --i) {
- if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
- return i;
- }
- }
-
- return -1;
+StringReader.prototype.lastIndexOfSignature = function(sig) {
+ return this.data.lastIndexOf(sig) - this.zero;
+};
+/**
+ * @see DataReader.readAndCheckSignature
+ */
+StringReader.prototype.readAndCheckSignature = function (sig) {
+ var data = this.readData(4);
+ return sig === data;
+};
+/**
+ * @see DataReader.readData
+ */
+StringReader.prototype.readData = function(size) {
+ this.checkOffset(size);
+ // this will work because the constructor applied the "& 0xff" mask.
+ var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
+ this.index += size;
+ return result;
};
+module.exports = StringReader;
+
+},{"../utils":32,"./DataReader":18}],21:[function(require,module,exports){
+"use strict";
+var ArrayReader = require("./ArrayReader");
+var utils = require("../utils");
+
+function Uint8ArrayReader(data) {
+ ArrayReader.call(this, data);
+}
+utils.inherits(Uint8ArrayReader, ArrayReader);
/**
* @see DataReader.readData
*/
@@ -12564,56 +12707,782 @@ Uint8ArrayReader.prototype.readData = function(size) {
// in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
return new Uint8Array(0);
}
- var result = this.data.subarray(this.index, this.index + size);
+ var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);
this.index += size;
return result;
};
module.exports = Uint8ArrayReader;
-},{"./dataReader":5}],19:[function(_dereq_,module,exports){
-'use strict';
+},{"../utils":32,"./ArrayReader":17}],22:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var support = require("../support");
+var ArrayReader = require("./ArrayReader");
+var StringReader = require("./StringReader");
+var NodeBufferReader = require("./NodeBufferReader");
+var Uint8ArrayReader = require("./Uint8ArrayReader");
+
+/**
+ * Create a reader adapted to the data.
+ * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read.
+ * @return {DataReader} the data reader.
+ */
+module.exports = function (data) {
+ var type = utils.getTypeOf(data);
+ utils.checkSupport(type);
+ if (type === "string" && !support.uint8array) {
+ return new StringReader(data);
+ }
+ if (type === "nodebuffer") {
+ return new NodeBufferReader(data);
+ }
+ if (support.uint8array) {
+ return new Uint8ArrayReader(utils.transformTo("uint8array", data));
+ }
+ return new ArrayReader(utils.transformTo("array", data));
+};
+
+},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(require,module,exports){
+"use strict";
+exports.LOCAL_FILE_HEADER = "PK\x03\x04";
+exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
+exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
+exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
+exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
+exports.DATA_DESCRIPTOR = "PK\x07\x08";
+
+},{}],24:[function(require,module,exports){
+"use strict";
+
+var GenericWorker = require("./GenericWorker");
+var utils = require("../utils");
+
+/**
+ * A worker which convert chunks to a specified type.
+ * @constructor
+ * @param {String} destType the destination type.
+ */
+function ConvertWorker(destType) {
+ GenericWorker.call(this, "ConvertWorker to " + destType);
+ this.destType = destType;
+}
+utils.inherits(ConvertWorker, GenericWorker);
+
+/**
+ * @see GenericWorker.processChunk
+ */
+ConvertWorker.prototype.processChunk = function (chunk) {
+ this.push({
+ data : utils.transformTo(this.destType, chunk.data),
+ meta : chunk.meta
+ });
+};
+module.exports = ConvertWorker;
+
+},{"../utils":32,"./GenericWorker":28}],25:[function(require,module,exports){
+"use strict";
+
+var GenericWorker = require("./GenericWorker");
+var crc32 = require("../crc32");
+var utils = require("../utils");
-var utils = _dereq_('./utils');
+/**
+ * A worker which calculate the crc32 of the data flowing through.
+ * @constructor
+ */
+function Crc32Probe() {
+ GenericWorker.call(this, "Crc32Probe");
+ this.withStreamInfo("crc32", 0);
+}
+utils.inherits(Crc32Probe, GenericWorker);
+
+/**
+ * @see GenericWorker.processChunk
+ */
+Crc32Probe.prototype.processChunk = function (chunk) {
+ this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);
+ this.push(chunk);
+};
+module.exports = Crc32Probe;
+
+},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var GenericWorker = require("./GenericWorker");
+
+/**
+ * A worker which calculate the total length of the data flowing through.
+ * @constructor
+ * @param {String} propName the name used to expose the length
+ */
+function DataLengthProbe(propName) {
+ GenericWorker.call(this, "DataLengthProbe for " + propName);
+ this.propName = propName;
+ this.withStreamInfo(propName, 0);
+}
+utils.inherits(DataLengthProbe, GenericWorker);
/**
- * An object to write any content to an Uint8Array.
+ * @see GenericWorker.processChunk
+ */
+DataLengthProbe.prototype.processChunk = function (chunk) {
+ if(chunk) {
+ var length = this.streamInfo[this.propName] || 0;
+ this.streamInfo[this.propName] = length + chunk.data.length;
+ }
+ GenericWorker.prototype.processChunk.call(this, chunk);
+};
+module.exports = DataLengthProbe;
+
+
+},{"../utils":32,"./GenericWorker":28}],27:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var GenericWorker = require("./GenericWorker");
+
+// the size of the generated chunks
+// TODO expose this as a public variable
+var DEFAULT_BLOCK_SIZE = 16 * 1024;
+
+/**
+ * A worker that reads a content and emits chunks.
* @constructor
- * @param {number} length The length of the array.
+ * @param {Promise} dataP the promise of the data to split
*/
-var Uint8ArrayWriter = function(length) {
- this.data = new Uint8Array(length);
+function DataWorker(dataP) {
+ GenericWorker.call(this, "DataWorker");
+ var self = this;
+ this.dataIsReady = false;
this.index = 0;
+ this.max = 0;
+ this.data = null;
+ this.type = "";
+
+ this._tickScheduled = false;
+
+ dataP.then(function (data) {
+ self.dataIsReady = true;
+ self.data = data;
+ self.max = data && data.length || 0;
+ self.type = utils.getTypeOf(data);
+ if(!self.isPaused) {
+ self._tickAndRepeat();
+ }
+ }, function (e) {
+ self.error(e);
+ });
+}
+
+utils.inherits(DataWorker, GenericWorker);
+
+/**
+ * @see GenericWorker.cleanUp
+ */
+DataWorker.prototype.cleanUp = function () {
+ GenericWorker.prototype.cleanUp.call(this);
+ this.data = null;
+};
+
+/**
+ * @see GenericWorker.resume
+ */
+DataWorker.prototype.resume = function () {
+ if(!GenericWorker.prototype.resume.call(this)) {
+ return false;
+ }
+
+ if (!this._tickScheduled && this.dataIsReady) {
+ this._tickScheduled = true;
+ utils.delay(this._tickAndRepeat, [], this);
+ }
+ return true;
+};
+
+/**
+ * Trigger a tick a schedule an other call to this function.
+ */
+DataWorker.prototype._tickAndRepeat = function() {
+ this._tickScheduled = false;
+ if(this.isPaused || this.isFinished) {
+ return;
+ }
+ this._tick();
+ if(!this.isFinished) {
+ utils.delay(this._tickAndRepeat, [], this);
+ this._tickScheduled = true;
+ }
+};
+
+/**
+ * Read and push a chunk.
+ */
+DataWorker.prototype._tick = function() {
+
+ if(this.isPaused || this.isFinished) {
+ return false;
+ }
+
+ var size = DEFAULT_BLOCK_SIZE;
+ var data = null, nextIndex = Math.min(this.max, this.index + size);
+ if (this.index >= this.max) {
+ // EOF
+ return this.end();
+ } else {
+ switch(this.type) {
+ case "string":
+ data = this.data.substring(this.index, nextIndex);
+ break;
+ case "uint8array":
+ data = this.data.subarray(this.index, nextIndex);
+ break;
+ case "array":
+ case "nodebuffer":
+ data = this.data.slice(this.index, nextIndex);
+ break;
+ }
+ this.index = nextIndex;
+ return this.push({
+ data : data,
+ meta : {
+ percent : this.max ? this.index / this.max * 100 : 0
+ }
+ });
+ }
};
-Uint8ArrayWriter.prototype = {
+
+module.exports = DataWorker;
+
+},{"../utils":32,"./GenericWorker":28}],28:[function(require,module,exports){
+"use strict";
+
+/**
+ * A worker that does nothing but passing chunks to the next one. This is like
+ * a nodejs stream but with some differences. On the good side :
+ * - it works on IE 6-9 without any issue / polyfill
+ * - it weights less than the full dependencies bundled with browserify
+ * - it forwards errors (no need to declare an error handler EVERYWHERE)
+ *
+ * A chunk is an object with 2 attributes : `meta` and `data`. The former is an
+ * object containing anything (`percent` for example), see each worker for more
+ * details. The latter is the real data (String, Uint8Array, etc).
+ *
+ * @constructor
+ * @param {String} name the name of the stream (mainly used for debugging purposes)
+ */
+function GenericWorker(name) {
+ // the name of the worker
+ this.name = name || "default";
+ // an object containing metadata about the workers chain
+ this.streamInfo = {};
+ // an error which happened when the worker was paused
+ this.generatedError = null;
+ // an object containing metadata to be merged by this worker into the general metadata
+ this.extraStreamInfo = {};
+ // true if the stream is paused (and should not do anything), false otherwise
+ this.isPaused = true;
+ // true if the stream is finished (and should not do anything), false otherwise
+ this.isFinished = false;
+ // true if the stream is locked to prevent further structure updates (pipe), false otherwise
+ this.isLocked = false;
+ // the event listeners
+ this._listeners = {
+ "data":[],
+ "end":[],
+ "error":[]
+ };
+ // the previous worker, if any
+ this.previous = null;
+}
+
+GenericWorker.prototype = {
+ /**
+ * Push a chunk to the next workers.
+ * @param {Object} chunk the chunk to push
+ */
+ push : function (chunk) {
+ this.emit("data", chunk);
+ },
+ /**
+ * End the stream.
+ * @return {Boolean} true if this call ended the worker, false otherwise.
+ */
+ end : function () {
+ if (this.isFinished) {
+ return false;
+ }
+
+ this.flush();
+ try {
+ this.emit("end");
+ this.cleanUp();
+ this.isFinished = true;
+ } catch (e) {
+ this.emit("error", e);
+ }
+ return true;
+ },
+ /**
+ * End the stream with an error.
+ * @param {Error} e the error which caused the premature end.
+ * @return {Boolean} true if this call ended the worker with an error, false otherwise.
+ */
+ error : function (e) {
+ if (this.isFinished) {
+ return false;
+ }
+
+ if(this.isPaused) {
+ this.generatedError = e;
+ } else {
+ this.isFinished = true;
+
+ this.emit("error", e);
+
+ // in the workers chain exploded in the middle of the chain,
+ // the error event will go downward but we also need to notify
+ // workers upward that there has been an error.
+ if(this.previous) {
+ this.previous.error(e);
+ }
+
+ this.cleanUp();
+ }
+ return true;
+ },
+ /**
+ * Add a callback on an event.
+ * @param {String} name the name of the event (data, end, error)
+ * @param {Function} listener the function to call when the event is triggered
+ * @return {GenericWorker} the current object for chainability
+ */
+ on : function (name, listener) {
+ this._listeners[name].push(listener);
+ return this;
+ },
+ /**
+ * Clean any references when a worker is ending.
+ */
+ cleanUp : function () {
+ this.streamInfo = this.generatedError = this.extraStreamInfo = null;
+ this._listeners = [];
+ },
+ /**
+ * Trigger an event. This will call registered callback with the provided arg.
+ * @param {String} name the name of the event (data, end, error)
+ * @param {Object} arg the argument to call the callback with.
+ */
+ emit : function (name, arg) {
+ if (this._listeners[name]) {
+ for(var i = 0; i < this._listeners[name].length; i++) {
+ this._listeners[name][i].call(this, arg);
+ }
+ }
+ },
+ /**
+ * Chain a worker with an other.
+ * @param {Worker} next the worker receiving events from the current one.
+ * @return {worker} the next worker for chainability
+ */
+ pipe : function (next) {
+ return next.registerPrevious(this);
+ },
+ /**
+ * Same as `pipe` in the other direction.
+ * Using an API with `pipe(next)` is very easy.
+ * Implementing the API with the point of view of the next one registering
+ * a source is easier, see the ZipFileWorker.
+ * @param {Worker} previous the previous worker, sending events to this one
+ * @return {Worker} the current worker for chainability
+ */
+ registerPrevious : function (previous) {
+ if (this.isLocked) {
+ throw new Error("The stream '" + this + "' has already been used.");
+ }
+
+ // sharing the streamInfo...
+ this.streamInfo = previous.streamInfo;
+ // ... and adding our own bits
+ this.mergeStreamInfo();
+ this.previous = previous;
+ var self = this;
+ previous.on("data", function (chunk) {
+ self.processChunk(chunk);
+ });
+ previous.on("end", function () {
+ self.end();
+ });
+ previous.on("error", function (e) {
+ self.error(e);
+ });
+ return this;
+ },
+ /**
+ * Pause the stream so it doesn't send events anymore.
+ * @return {Boolean} true if this call paused the worker, false otherwise.
+ */
+ pause : function () {
+ if(this.isPaused || this.isFinished) {
+ return false;
+ }
+ this.isPaused = true;
+
+ if(this.previous) {
+ this.previous.pause();
+ }
+ return true;
+ },
+ /**
+ * Resume a paused stream.
+ * @return {Boolean} true if this call resumed the worker, false otherwise.
+ */
+ resume : function () {
+ if(!this.isPaused || this.isFinished) {
+ return false;
+ }
+ this.isPaused = false;
+
+ // if true, the worker tried to resume but failed
+ var withError = false;
+ if(this.generatedError) {
+ this.error(this.generatedError);
+ withError = true;
+ }
+ if(this.previous) {
+ this.previous.resume();
+ }
+
+ return !withError;
+ },
+ /**
+ * Flush any remaining bytes as the stream is ending.
+ */
+ flush : function () {},
+ /**
+ * Process a chunk. This is usually the method overridden.
+ * @param {Object} chunk the chunk to process.
+ */
+ processChunk : function(chunk) {
+ this.push(chunk);
+ },
+ /**
+ * Add a key/value to be added in the workers chain streamInfo once activated.
+ * @param {String} key the key to use
+ * @param {Object} value the associated value
+ * @return {Worker} the current worker for chainability
+ */
+ withStreamInfo : function (key, value) {
+ this.extraStreamInfo[key] = value;
+ this.mergeStreamInfo();
+ return this;
+ },
+ /**
+ * Merge this worker's streamInfo into the chain's streamInfo.
+ */
+ mergeStreamInfo : function () {
+ for(var key in this.extraStreamInfo) {
+ if (!Object.prototype.hasOwnProperty.call(this.extraStreamInfo, key)) {
+ continue;
+ }
+ this.streamInfo[key] = this.extraStreamInfo[key];
+ }
+ },
+
/**
- * Append any content to the current array.
- * @param {Object} input the content to add.
+ * Lock the stream to prevent further updates on the workers chain.
+ * After calling this method, all calls to pipe will fail.
*/
- append: function(input) {
- if (input.length !== 0) {
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- input = utils.transformTo("uint8array", input);
- this.data.set(input, this.index);
- this.index += input.length;
+ lock: function () {
+ if (this.isLocked) {
+ throw new Error("The stream '" + this + "' has already been used.");
+ }
+ this.isLocked = true;
+ if (this.previous) {
+ this.previous.lock();
}
},
+
/**
- * Finalize the construction an return the result.
- * @return {Uint8Array} the generated array.
+ *
+ * Pretty print the workers chain.
*/
- finalize: function() {
- return this.data;
+ toString : function () {
+ var me = "Worker " + this.name;
+ if (this.previous) {
+ return this.previous + " -> " + me;
+ } else {
+ return me;
+ }
}
};
-module.exports = Uint8ArrayWriter;
+module.exports = GenericWorker;
-},{"./utils":21}],20:[function(_dereq_,module,exports){
-'use strict';
+},{}],29:[function(require,module,exports){
+"use strict";
+
+var utils = require("../utils");
+var ConvertWorker = require("./ConvertWorker");
+var GenericWorker = require("./GenericWorker");
+var base64 = require("../base64");
+var support = require("../support");
+var external = require("../external");
+
+var NodejsStreamOutputAdapter = null;
+if (support.nodestream) {
+ try {
+ NodejsStreamOutputAdapter = require("../nodejs/NodejsStreamOutputAdapter");
+ } catch(e) {
+ // ignore
+ }
+}
+
+/**
+ * Apply the final transformation of the data. If the user wants a Blob for
+ * example, it's easier to work with an U8intArray and finally do the
+ * ArrayBuffer/Blob conversion.
+ * @param {String} type the name of the final type
+ * @param {String|Uint8Array|Buffer} content the content to transform
+ * @param {String} mimeType the mime type of the content, if applicable.
+ * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format.
+ */
+function transformZipOutput(type, content, mimeType) {
+ switch(type) {
+ case "blob" :
+ return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType);
+ case "base64" :
+ return base64.encode(content);
+ default :
+ return utils.transformTo(type, content);
+ }
+}
+
+/**
+ * Concatenate an array of data of the given type.
+ * @param {String} type the type of the data in the given array.
+ * @param {Array} dataArray the array containing the data chunks to concatenate
+ * @return {String|Uint8Array|Buffer} the concatenated data
+ * @throws Error if the asked type is unsupported
+ */
+function concat (type, dataArray) {
+ var i, index = 0, res = null, totalLength = 0;
+ for(i = 0; i < dataArray.length; i++) {
+ totalLength += dataArray[i].length;
+ }
+ switch(type) {
+ case "string":
+ return dataArray.join("");
+ case "array":
+ return Array.prototype.concat.apply([], dataArray);
+ case "uint8array":
+ res = new Uint8Array(totalLength);
+ for(i = 0; i < dataArray.length; i++) {
+ res.set(dataArray[i], index);
+ index += dataArray[i].length;
+ }
+ return res;
+ case "nodebuffer":
+ return Buffer.concat(dataArray);
+ default:
+ throw new Error("concat : unsupported type '" + type + "'");
+ }
+}
+
+/**
+ * Listen a StreamHelper, accumulate its content and concatenate it into a
+ * complete block.
+ * @param {StreamHelper} helper the helper to use.
+ * @param {Function} updateCallback a callback called on each update. Called
+ * with one arg :
+ * - the metadata linked to the update received.
+ * @return Promise the promise for the accumulation.
+ */
+function accumulate(helper, updateCallback) {
+ return new external.Promise(function (resolve, reject){
+ var dataArray = [];
+ var chunkType = helper._internalType,
+ resultType = helper._outputType,
+ mimeType = helper._mimeType;
+ helper
+ .on("data", function (data, meta) {
+ dataArray.push(data);
+ if(updateCallback) {
+ updateCallback(meta);
+ }
+ })
+ .on("error", function(err) {
+ dataArray = [];
+ reject(err);
+ })
+ .on("end", function (){
+ try {
+ var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
+ resolve(result);
+ } catch (e) {
+ reject(e);
+ }
+ dataArray = [];
+ })
+ .resume();
+ });
+}
+
+/**
+ * An helper to easily use workers outside of JSZip.
+ * @constructor
+ * @param {Worker} worker the worker to wrap
+ * @param {String} outputType the type of data expected by the use
+ * @param {String} mimeType the mime type of the content, if applicable.
+ */
+function StreamHelper(worker, outputType, mimeType) {
+ var internalType = outputType;
+ switch(outputType) {
+ case "blob":
+ case "arraybuffer":
+ internalType = "uint8array";
+ break;
+ case "base64":
+ internalType = "string";
+ break;
+ }
+
+ try {
+ // the type used internally
+ this._internalType = internalType;
+ // the type used to output results
+ this._outputType = outputType;
+ // the mime type
+ this._mimeType = mimeType;
+ utils.checkSupport(internalType);
+ this._worker = worker.pipe(new ConvertWorker(internalType));
+ // the last workers can be rewired without issues but we need to
+ // prevent any updates on previous workers.
+ worker.lock();
+ } catch(e) {
+ this._worker = new GenericWorker("error");
+ this._worker.error(e);
+ }
+}
+
+StreamHelper.prototype = {
+ /**
+ * Listen a StreamHelper, accumulate its content and concatenate it into a
+ * complete block.
+ * @param {Function} updateCb the update callback.
+ * @return Promise the promise for the accumulation.
+ */
+ accumulate : function (updateCb) {
+ return accumulate(this, updateCb);
+ },
+ /**
+ * Add a listener on an event triggered on a stream.
+ * @param {String} evt the name of the event
+ * @param {Function} fn the listener
+ * @return {StreamHelper} the current helper.
+ */
+ on : function (evt, fn) {
+ var self = this;
+
+ if(evt === "data") {
+ this._worker.on(evt, function (chunk) {
+ fn.call(self, chunk.data, chunk.meta);
+ });
+ } else {
+ this._worker.on(evt, function () {
+ utils.delay(fn, arguments, self);
+ });
+ }
+ return this;
+ },
+ /**
+ * Resume the flow of chunks.
+ * @return {StreamHelper} the current helper.
+ */
+ resume : function () {
+ utils.delay(this._worker.resume, [], this._worker);
+ return this;
+ },
+ /**
+ * Pause the flow of chunks.
+ * @return {StreamHelper} the current helper.
+ */
+ pause : function () {
+ this._worker.pause();
+ return this;
+ },
+ /**
+ * Return a nodejs stream for this helper.
+ * @param {Function} updateCb the update callback.
+ * @return {NodejsStreamOutputAdapter} the nodejs stream.
+ */
+ toNodejsStream : function (updateCb) {
+ utils.checkSupport("nodestream");
+ if (this._outputType !== "nodebuffer") {
+ // an object stream containing blob/arraybuffer/uint8array/string
+ // is strange and I don't know if it would be useful.
+ // I you find this comment and have a good usecase, please open a
+ // bug report !
+ throw new Error(this._outputType + " is not supported by this method");
+ }
+
+ return new NodejsStreamOutputAdapter(this, {
+ objectMode : this._outputType !== "nodebuffer"
+ }, updateCb);
+ }
+};
+
+
+module.exports = StreamHelper;
+
+},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(require,module,exports){
+"use strict";
+
+exports.base64 = true;
+exports.array = true;
+exports.string = true;
+exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
+exports.nodebuffer = typeof Buffer !== "undefined";
+// contains true if JSZip can read/generate Uint8Array, false otherwise.
+exports.uint8array = typeof Uint8Array !== "undefined";
+
+if (typeof ArrayBuffer === "undefined") {
+ exports.blob = false;
+}
+else {
+ var buffer = new ArrayBuffer(0);
+ try {
+ exports.blob = new Blob([buffer], {
+ type: "application/zip"
+ }).size === 0;
+ }
+ catch (e) {
+ try {
+ var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
+ var builder = new Builder();
+ builder.append(buffer);
+ exports.blob = builder.getBlob("application/zip").size === 0;
+ }
+ catch (e) {
+ exports.blob = false;
+ }
+ }
+}
+
+try {
+ exports.nodestream = !!require("readable-stream").Readable;
+} catch(e) {
+ exports.nodestream = false;
+}
+
+},{"readable-stream":16}],31:[function(require,module,exports){
+"use strict";
-var utils = _dereq_('./utils');
-var support = _dereq_('./support');
-var nodeBuffer = _dereq_('./nodeBuffer');
+var utils = require("./utils");
+var support = require("./support");
+var nodejsUtils = require("./nodejsUtils");
+var GenericWorker = require("./stream/GenericWorker");
/**
* The following functions come from pako, from pako/lib/utils/strings
@@ -12625,7 +13494,7 @@ var nodeBuffer = _dereq_('./nodeBuffer');
// because max possible codepoint is 0x10ffff
var _utf8len = new Array(256);
for (var i=0; i<256; i++) {
- _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
+ _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
}
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
@@ -12716,7 +13585,7 @@ var utf8border = function(buf, max) {
// convert array to string
var buf2string = function (buf) {
- var str, i, out, c, c_len;
+ var i, out, c, c_len;
var len = buf.length;
// Reserve max possible length (2 words per char)
@@ -12778,7 +13647,7 @@ var buf2string = function (buf) {
*/
exports.utf8encode = function utf8encode(str) {
if (support.nodebuffer) {
- return nodeBuffer(str, "utf-8");
+ return nodejsUtils.newBufferFrom(str, "utf-8");
}
return string2buf(str);
@@ -12798,60 +13667,149 @@ exports.utf8decode = function utf8decode(buf) {
buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);
- // return buf2string(buf);
- // Chrome prefers to work with "small" chunks of data
- // for the method buf2string.
- // Firefox and Chrome has their own shortcut, IE doesn't seem to really care.
- var result = [], k = 0, len = buf.length, chunk = 65536;
- while (k < len) {
- var nextBoundary = utf8border(buf, Math.min(k + chunk, len));
+ return buf2string(buf);
+};
+
+/**
+ * A worker to decode utf8 encoded binary chunks into string chunks.
+ * @constructor
+ */
+function Utf8DecodeWorker() {
+ GenericWorker.call(this, "utf-8 decode");
+ // the last bytes if a chunk didn't end with a complete codepoint.
+ this.leftOver = null;
+}
+utils.inherits(Utf8DecodeWorker, GenericWorker);
+
+/**
+ * @see GenericWorker.processChunk
+ */
+Utf8DecodeWorker.prototype.processChunk = function (chunk) {
+
+ var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data);
+
+ // 1st step, re-use what's left of the previous chunk
+ if (this.leftOver && this.leftOver.length) {
+ if(support.uint8array) {
+ var previousData = data;
+ data = new Uint8Array(previousData.length + this.leftOver.length);
+ data.set(this.leftOver, 0);
+ data.set(previousData, this.leftOver.length);
+ } else {
+ data = this.leftOver.concat(data);
+ }
+ this.leftOver = null;
+ }
+
+ var nextBoundary = utf8border(data);
+ var usableData = data;
+ if (nextBoundary !== data.length) {
if (support.uint8array) {
- result.push(buf2string(buf.subarray(k, nextBoundary)));
+ usableData = data.subarray(0, nextBoundary);
+ this.leftOver = data.subarray(nextBoundary, data.length);
} else {
- result.push(buf2string(buf.slice(k, nextBoundary)));
+ usableData = data.slice(0, nextBoundary);
+ this.leftOver = data.slice(nextBoundary, data.length);
}
- k = nextBoundary;
}
- return result.join("");
+ this.push({
+ data : exports.utf8decode(usableData),
+ meta : chunk.meta
+ });
};
-// vim: set shiftwidth=4 softtabstop=4:
-},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){
-'use strict';
-var support = _dereq_('./support');
-var compressions = _dereq_('./compressions');
-var nodeBuffer = _dereq_('./nodeBuffer');
/**
- * Convert a string to a "binary string" : a string containing only char codes between 0 and 255.
- * @param {string} str the string to transform.
- * @return {String} the binary string.
+ * @see GenericWorker.flush
*/
-exports.string2binary = function(str) {
- var result = "";
- for (var i = 0; i < str.length; i++) {
- result += String.fromCharCode(str.charCodeAt(i) & 0xff);
+Utf8DecodeWorker.prototype.flush = function () {
+ if(this.leftOver && this.leftOver.length) {
+ this.push({
+ data : exports.utf8decode(this.leftOver),
+ meta : {}
+ });
+ this.leftOver = null;
}
- return result;
};
-exports.arrayBuffer2Blob = function(buffer, mimeType) {
+exports.Utf8DecodeWorker = Utf8DecodeWorker;
+
+/**
+ * A worker to endcode string chunks into utf8 encoded binary chunks.
+ * @constructor
+ */
+function Utf8EncodeWorker() {
+ GenericWorker.call(this, "utf-8 encode");
+}
+utils.inherits(Utf8EncodeWorker, GenericWorker);
+
+/**
+ * @see GenericWorker.processChunk
+ */
+Utf8EncodeWorker.prototype.processChunk = function (chunk) {
+ this.push({
+ data : exports.utf8encode(chunk.data),
+ meta : chunk.meta
+ });
+};
+exports.Utf8EncodeWorker = Utf8EncodeWorker;
+
+},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(require,module,exports){
+"use strict";
+
+var support = require("./support");
+var base64 = require("./base64");
+var nodejsUtils = require("./nodejsUtils");
+var external = require("./external");
+require("setimmediate");
+
+
+/**
+ * Convert a string that pass as a "binary string": it should represent a byte
+ * array but may have > 255 char codes. Be sure to take only the first byte
+ * and returns the byte array.
+ * @param {String} str the string to transform.
+ * @return {Array|Uint8Array} the string in a binary format.
+ */
+function string2binary(str) {
+ var result = null;
+ if (support.uint8array) {
+ result = new Uint8Array(str.length);
+ } else {
+ result = new Array(str.length);
+ }
+ return stringToArrayLike(str, result);
+}
+
+/**
+ * Create a new blob with the given content and the given type.
+ * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use
+ * an Uint8Array because the stock browser of android 4 won't accept it (it
+ * will be silently converted to a string, "[object Uint8Array]").
+ *
+ * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge:
+ * when a large amount of Array is used to create the Blob, the amount of
+ * memory consumed is nearly 100 times the original data amount.
+ *
+ * @param {String} type the mime type of the blob.
+ * @return {Blob} the created blob.
+ */
+exports.newBlob = function(part, type) {
exports.checkSupport("blob");
- mimeType = mimeType || 'application/zip';
try {
// Blob constructor
- return new Blob([buffer], {
- type: mimeType
+ return new Blob([part], {
+ type: type
});
}
catch (e) {
try {
// deprecated, browser only, old way
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
var builder = new Builder();
- builder.append(buffer);
- return builder.getBlob(mimeType);
+ builder.append(part);
+ return builder.getBlob(type);
}
catch (e) {
@@ -12885,50 +13843,27 @@ function stringToArrayLike(str, array) {
}
/**
- * Transform an array-like object to a string.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
- * @return {String} the result.
+ * An helper for the function arrayLikeToString.
+ * This contains static information and functions that
+ * can be optimized by the browser JIT compiler.
*/
-function arrayLikeToString(array) {
- // Performances notes :
- // --------------------
- // String.fromCharCode.apply(null, array) is the fastest, see
- // see http://jsperf.com/converting-a-uint8array-to-a-string/2
- // but the stack is limited (and we can get huge arrays !).
- //
- // result += String.fromCharCode(array[i]); generate too many strings !
- //
- // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
- var chunk = 65536;
- var result = [],
- len = array.length,
- type = exports.getTypeOf(array),
- k = 0,
- canUseApply = true;
- try {
- switch(type) {
- case "uint8array":
- String.fromCharCode.apply(null, new Uint8Array(0));
- break;
- case "nodebuffer":
- String.fromCharCode.apply(null, nodeBuffer(0));
- break;
- }
- } catch(e) {
- canUseApply = false;
- }
-
- // no apply : slow and painful algorithm
- // default browser on android 4.*
- if (!canUseApply) {
- var resultStr = "";
- for(var i = 0; i < array.length;i++) {
- resultStr += String.fromCharCode(array[i]);
- }
- return resultStr;
- }
- while (k < len && chunk > 1) {
- try {
+var arrayToStringHelper = {
+ /**
+ * Transform an array of int into a string, chunk by chunk.
+ * See the performances notes on arrayLikeToString.
+ * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
+ * @param {String} type the type of the array.
+ * @param {Integer} chunk the chunk size.
+ * @return {String} the resulting string.
+ * @throws Error if the chunk is too big for the stack.
+ */
+ stringifyByChunk: function(array, type, chunk) {
+ var result = [], k = 0, len = array.length;
+ // shortcut
+ if (len <= chunk) {
+ return String.fromCharCode.apply(null, array);
+ }
+ while (k < len) {
if (type === "array" || type === "nodebuffer") {
result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
}
@@ -12937,11 +13872,84 @@ function arrayLikeToString(array) {
}
k += chunk;
}
- catch (e) {
- chunk = Math.floor(chunk / 2);
+ return result.join("");
+ },
+ /**
+ * Call String.fromCharCode on every item in the array.
+ * This is the naive implementation, which generate A LOT of intermediate string.
+ * This should be used when everything else fail.
+ * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
+ * @return {String} the result.
+ */
+ stringifyByChar: function(array){
+ var resultStr = "";
+ for(var i = 0; i < array.length; i++) {
+ resultStr += String.fromCharCode(array[i]);
+ }
+ return resultStr;
+ },
+ applyCanBeUsed : {
+ /**
+ * true if the browser accepts to use String.fromCharCode on Uint8Array
+ */
+ uint8array : (function () {
+ try {
+ return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
+ } catch (e) {
+ return false;
+ }
+ })(),
+ /**
+ * true if the browser accepts to use String.fromCharCode on nodejs Buffer.
+ */
+ nodebuffer : (function () {
+ try {
+ return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1;
+ } catch (e) {
+ return false;
+ }
+ })()
+ }
+};
+
+/**
+ * Transform an array-like object to a string.
+ * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
+ * @return {String} the result.
+ */
+function arrayLikeToString(array) {
+ // Performances notes :
+ // --------------------
+ // String.fromCharCode.apply(null, array) is the fastest, see
+ // see http://jsperf.com/converting-a-uint8array-to-a-string/2
+ // but the stack is limited (and we can get huge arrays !).
+ //
+ // result += String.fromCharCode(array[i]); generate too many strings !
+ //
+ // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
+ // TODO : we now have workers that split the work. Do we still need that ?
+ var chunk = 65536,
+ type = exports.getTypeOf(array),
+ canUseApply = true;
+ if (type === "uint8array") {
+ canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array;
+ } else if (type === "nodebuffer") {
+ canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer;
+ }
+
+ if (canUseApply) {
+ while (chunk > 1) {
+ try {
+ return arrayToStringHelper.stringifyByChunk(array, type, chunk);
+ } catch (e) {
+ chunk = Math.floor(chunk / 2);
+ }
}
}
- return result.join("");
+
+ // no apply or chunk error : slow and painful algorithm
+ // default browser on android 4.*
+ return arrayToStringHelper.stringifyByChar(array);
}
exports.applyFromCharCode = arrayLikeToString;
@@ -12976,7 +13984,7 @@ transform["string"] = {
return stringToArrayLike(input, new Uint8Array(input.length));
},
"nodebuffer": function(input) {
- return stringToArrayLike(input, nodeBuffer(input.length));
+ return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length));
}
};
@@ -12991,7 +13999,7 @@ transform["array"] = {
return new Uint8Array(input);
},
"nodebuffer": function(input) {
- return nodeBuffer(input);
+ return nodejsUtils.newBufferFrom(input);
}
};
@@ -13008,7 +14016,7 @@ transform["arraybuffer"] = {
return new Uint8Array(input);
},
"nodebuffer": function(input) {
- return nodeBuffer(new Uint8Array(input));
+ return nodejsUtils.newBufferFrom(new Uint8Array(input));
}
};
@@ -13023,7 +14031,7 @@ transform["uint8array"] = {
},
"uint8array": identity,
"nodebuffer": function(input) {
- return nodeBuffer(input);
+ return nodejsUtils.newBufferFrom(input);
}
};
@@ -13065,6 +14073,31 @@ exports.transformTo = function(outputType, input) {
return result;
};
+/**
+ * Resolve all relative path components, "." and "..", in a path. If these relative components
+ * traverse above the root then the resulting path will only contain the final path component.
+ *
+ * All empty components, e.g. "//", are removed.
+ * @param {string} path A path with / or \ separators
+ * @returns {string} The path with all relative path components resolved.
+ */
+exports.resolve = function(path) {
+ var parts = path.split("/");
+ var result = [];
+ for (var index = 0; index < parts.length; index++) {
+ var part = parts[index];
+ // Allow the first and last component to be empty for trailing slashes.
+ if (part === "." || (part === "" && index !== 0 && index !== parts.length - 1)) {
+ continue;
+ } else if (part === "..") {
+ result.pop();
+ } else {
+ result.push(part);
+ }
+ }
+ return result.join("/");
+};
+
/**
* Return the type of the input.
* The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.
@@ -13078,7 +14111,7 @@ exports.getTypeOf = function(input) {
if (Object.prototype.toString.call(input) === "[object Array]") {
return "array";
}
- if (support.nodebuffer && nodeBuffer.test(input)) {
+ if (support.nodebuffer && nodejsUtils.isBuffer(input)) {
return "nodebuffer";
}
if (support.uint8array && input instanceof Uint8Array) {
@@ -13097,9 +14130,10 @@ exports.getTypeOf = function(input) {
exports.checkSupport = function(type) {
var supported = support[type.toLowerCase()];
if (!supported) {
- throw new Error(type + " is not supported by this browser");
+ throw new Error(type + " is not supported by this platform");
}
};
+
exports.MAX_VALUE_16BITS = 65535;
exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1
@@ -13109,78 +14143,163 @@ exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is pa
* @return {string} a pretty string.
*/
exports.pretty = function(str) {
- var res = '',
+ var res = "",
code, i;
for (i = 0; i < (str || "").length; i++) {
code = str.charCodeAt(i);
- res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
+ res += "\\x" + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
}
return res;
};
/**
- * Find a compression registered in JSZip.
- * @param {string} compressionMethod the method magic to find.
- * @return {Object|null} the JSZip compression object, null if none found.
+ * Defer the call of a function.
+ * @param {Function} callback the function to call asynchronously.
+ * @param {Array} args the arguments to give to the callback.
*/
-exports.findCompression = function(compressionMethod) {
- for (var method in compressions) {
- if (!compressions.hasOwnProperty(method)) {
- continue;
- }
- if (compressions[method].magic === compressionMethod) {
- return compressions[method];
+exports.delay = function(callback, args, self) {
+ setImmediate(function () {
+ callback.apply(self || null, args || []);
+ });
+};
+
+/**
+ * Extends a prototype with an other, without calling a constructor with
+ * side effects. Inspired by nodejs' `utils.inherits`
+ * @param {Function} ctor the constructor to augment
+ * @param {Function} superCtor the parent constructor to use
+ */
+exports.inherits = function (ctor, superCtor) {
+ var Obj = function() {};
+ Obj.prototype = superCtor.prototype;
+ ctor.prototype = new Obj();
+};
+
+/**
+ * Merge the objects passed as parameters into a new one.
+ * @private
+ * @param {...Object} var_args All objects to merge.
+ * @return {Object} a new object with the data of the others.
+ */
+exports.extend = function() {
+ var result = {}, i, attr;
+ for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
+ for (attr in arguments[i]) {
+ if (Object.prototype.hasOwnProperty.call(arguments[i], attr) && typeof result[attr] === "undefined") {
+ result[attr] = arguments[i][attr];
+ }
}
}
- return null;
+ return result;
};
+
/**
-* Cross-window, cross-Node-context regular expression detection
-* @param {Object} object Anything
-* @return {Boolean} true if the object is a regular expression,
-* false otherwise
-*/
-exports.isRegExp = function (object) {
- return Object.prototype.toString.call(object) === "[object RegExp]";
-};
+ * Transform arbitrary content into a Promise.
+ * @param {String} name a name for the content being processed.
+ * @param {Object} inputData the content to process.
+ * @param {Boolean} isBinary true if the content is not an unicode string
+ * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character.
+ * @param {Boolean} isBase64 true if the string content is encoded with base64.
+ * @return {Promise} a promise in a format usable by JSZip.
+ */
+exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {
+ // if inputData is already a promise, this flatten it.
+ var promise = external.Promise.resolve(inputData).then(function(data) {
-},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){
-'use strict';
-var StringReader = _dereq_('./stringReader');
-var NodeBufferReader = _dereq_('./nodeBufferReader');
-var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
-var utils = _dereq_('./utils');
-var sig = _dereq_('./signature');
-var ZipEntry = _dereq_('./zipEntry');
-var support = _dereq_('./support');
-var jszipProto = _dereq_('./object');
+
+ var isBlob = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
+
+ if (isBlob && typeof FileReader !== "undefined") {
+ return new external.Promise(function (resolve, reject) {
+ var reader = new FileReader();
+
+ reader.onload = function(e) {
+ resolve(e.target.result);
+ };
+ reader.onerror = function(e) {
+ reject(e.target.error);
+ };
+ reader.readAsArrayBuffer(data);
+ });
+ } else {
+ return data;
+ }
+ });
+
+ return promise.then(function(data) {
+ var dataType = exports.getTypeOf(data);
+
+ if (!dataType) {
+ return external.Promise.reject(
+ new Error("Can't read the data of '" + name + "'. Is it " +
+ "in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")
+ );
+ }
+ // special case : it's way easier to work with Uint8Array than with ArrayBuffer
+ if (dataType === "arraybuffer") {
+ data = exports.transformTo("uint8array", data);
+ } else if (dataType === "string") {
+ if (isBase64) {
+ data = base64.decode(data);
+ }
+ else if (isBinary) {
+ // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask
+ if (isOptimizedBinaryString !== true) {
+ // this is a string, not in a base64 format.
+ // Be sure that this is a correct "binary string"
+ data = string2binary(data);
+ }
+ }
+ }
+ return data;
+ });
+};
+
+},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"setimmediate":54}],33:[function(require,module,exports){
+"use strict";
+var readerFor = require("./reader/readerFor");
+var utils = require("./utils");
+var sig = require("./signature");
+var ZipEntry = require("./zipEntry");
+var support = require("./support");
// class ZipEntries {{{
/**
* All the entries in the zip file.
* @constructor
- * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load.
* @param {Object} loadOptions Options for loading the stream.
*/
-function ZipEntries(data, loadOptions) {
+function ZipEntries(loadOptions) {
this.files = [];
this.loadOptions = loadOptions;
- if (data) {
- this.load(data);
- }
}
ZipEntries.prototype = {
/**
- * Check that the reader is on the speficied signature.
+ * Check that the reader is on the specified signature.
* @param {string} expectedSignature the expected signature.
* @throws {Error} if it is an other signature.
*/
checkSignature: function(expectedSignature) {
- var signature = this.reader.readString(4);
- if (signature !== expectedSignature) {
- throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
+ if (!this.reader.readAndCheckSignature(expectedSignature)) {
+ this.reader.index -= 4;
+ var signature = this.reader.readString(4);
+ throw new Error("Corrupted zip or bug: unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
}
},
+ /**
+ * Check if the given signature is at the given index.
+ * @param {number} askedIndex the index to check.
+ * @param {string} expectedSignature the signature to expect.
+ * @return {boolean} true if the signature is here, false otherwise.
+ */
+ isSignature: function(askedIndex, expectedSignature) {
+ var currentIndex = this.reader.index;
+ this.reader.setIndex(askedIndex);
+ var signature = this.reader.readString(4);
+ var result = signature === expectedSignature;
+ this.reader.setIndex(currentIndex);
+ return result;
+ },
/**
* Read the end of the central directory.
*/
@@ -13196,10 +14315,12 @@ ZipEntries.prototype = {
// warning : the encoding depends of the system locale
// On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.
// On a windows machine, this field is encoded with the localized windows code page.
- this.zipComment = this.reader.readString(this.zipCommentLength);
+ var zipComment = this.reader.readData(this.zipCommentLength);
+ var decodeParamType = support.uint8array ? "uint8array" : "array";
// To get consistent behavior with the generation part, we will assume that
- // this is utf8 encoded.
- this.zipComment = jszipProto.utf8decode(this.zipComment);
+ // this is utf8 encoded unless specified otherwise.
+ var decodeContent = utils.transformTo(decodeParamType, zipComment);
+ this.zipComment = this.loadOptions.decodeFileName(decodeContent);
},
/**
* Read the end of the Zip 64 central directory.
@@ -13209,8 +14330,9 @@ ZipEntries.prototype = {
*/
readBlockZip64EndOfCentral: function() {
this.zip64EndOfCentralSize = this.reader.readInt(8);
- this.versionMadeBy = this.reader.readString(2);
- this.versionNeeded = this.reader.readInt(2);
+ this.reader.skip(4);
+ // this.versionMadeBy = this.reader.readString(2);
+ // this.versionNeeded = this.reader.readInt(2);
this.diskNumber = this.reader.readInt(4);
this.diskWithCentralDirStart = this.reader.readInt(4);
this.centralDirRecordsOnThisDisk = this.reader.readInt(8);
@@ -13227,7 +14349,7 @@ ZipEntries.prototype = {
while (index < extraDataSize) {
extraFieldId = this.reader.readInt(2);
extraFieldLength = this.reader.readInt(4);
- extraFieldValue = this.reader.readString(extraFieldLength);
+ extraFieldValue = this.reader.readData(extraFieldLength);
this.zip64ExtensibleData[extraFieldId] = {
id: extraFieldId,
length: extraFieldLength,
@@ -13267,40 +14389,49 @@ ZipEntries.prototype = {
var file;
this.reader.setIndex(this.centralDirOffset);
- while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) {
+ while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) {
file = new ZipEntry({
zip64: this.zip64
}, this.loadOptions);
file.readCentralPart(this.reader);
this.files.push(file);
}
+
+ if (this.centralDirRecords !== this.files.length) {
+ if (this.centralDirRecords !== 0 && this.files.length === 0) {
+ // We expected some records but couldn't find ANY.
+ // This is really suspicious, as if something went wrong.
+ throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
+ } else {
+ // We found some records but not all.
+ // Something is wrong but we got something for the user: no error here.
+ // console.warn("expected", this.centralDirRecords, "records in central dir, got", this.files.length);
+ }
+ }
},
/**
* Read the end of central directory.
*/
readEndOfCentral: function() {
var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
- if (offset === -1) {
+ if (offset < 0) {
// Check if the content is a truncated zip or complete garbage.
// A "LOCAL_FILE_HEADER" is not required at the beginning (auto
// extractible zip for example) but it can give a good hint.
// If an ajax request was used without responseType, we will also
// get unreadable data.
- var isGarbage = true;
- try {
- this.reader.setIndex(0);
- this.checkSignature(sig.LOCAL_FILE_HEADER);
- isGarbage = false;
- } catch (e) {}
+ var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER);
if (isGarbage) {
throw new Error("Can't find end of central directory : is this a zip file ? " +
- "If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html");
+ "If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");
} else {
- throw new Error("Corrupted zip : can't find end of central directory");
+ throw new Error("Corrupted zip: can't find end of central directory");
}
+
}
this.reader.setIndex(offset);
+ var endOfCentralDirOffset = offset;
this.checkSignature(sig.CENTRAL_DIRECTORY_END);
this.readBlockEndOfCentral();
@@ -13320,7 +14451,7 @@ ZipEntries.prototype = {
/*
Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
- the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents
+ the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents
all numbers as 64-bit double precision IEEE 754 floating point numbers.
So, we have 53bits for integers and bitwise operations treat everything as 32bits.
see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators
@@ -13329,31 +14460,51 @@ ZipEntries.prototype = {
// should look for a zip64 EOCD locator
offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
- if (offset === -1) {
- throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
+ if (offset < 0) {
+ throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
}
this.reader.setIndex(offset);
this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
this.readBlockZip64EndOfCentralLocator();
// now the zip64 EOCD record
+ if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) {
+ // console.warn("ZIP64 end of central directory not where expected.");
+ this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
+ if (this.relativeOffsetEndOfZip64CentralDir < 0) {
+ throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
+ }
+ }
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);
this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
this.readBlockZip64EndOfCentral();
}
- },
- prepareReader: function(data) {
- var type = utils.getTypeOf(data);
- if (type === "string" && !support.uint8array) {
- this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString);
- }
- else if (type === "nodebuffer") {
- this.reader = new NodeBufferReader(data);
+
+ var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize;
+ if (this.zip64) {
+ expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator
+ expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize;
}
- else {
- this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data));
+
+ var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset;
+
+ if (extraBytes > 0) {
+ // console.warn(extraBytes, "extra bytes at beginning or within zipfile");
+ if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) {
+ // The offsets seem wrong, but we have something at the specified offset.
+ // So… we keep it.
+ } else {
+ // the offset is wrong, update the "zero" of the reader
+ // this happens if data has been prepended (crx files for example)
+ this.reader.zero = extraBytes;
+ }
+ } else if (extraBytes < 0) {
+ throw new Error("Corrupted zip: missing " + Math.abs(extraBytes) + " bytes.");
}
},
+ prepareReader: function(data) {
+ this.reader = readerFor(data);
+ },
/**
* Read a zip file and create ZipEntries.
* @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.
@@ -13368,16 +14519,36 @@ ZipEntries.prototype = {
// }}} end of ZipEntries
module.exports = ZipEntries;
-},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){
-'use strict';
-var StringReader = _dereq_('./stringReader');
-var utils = _dereq_('./utils');
-var CompressedObject = _dereq_('./compressedObject');
-var jszipProto = _dereq_('./object');
+},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(require,module,exports){
+"use strict";
+var readerFor = require("./reader/readerFor");
+var utils = require("./utils");
+var CompressedObject = require("./compressedObject");
+var crc32fn = require("./crc32");
+var utf8 = require("./utf8");
+var compressions = require("./compressions");
+var support = require("./support");
var MADE_BY_DOS = 0x00;
var MADE_BY_UNIX = 0x03;
+/**
+ * Find a compression registered in JSZip.
+ * @param {string} compressionMethod the method magic to find.
+ * @return {Object|null} the JSZip compression object, null if none found.
+ */
+var findCompression = function(compressionMethod) {
+ for (var method in compressions) {
+ if (!Object.prototype.hasOwnProperty.call(compressions, method)) {
+ continue;
+ }
+ if (compressions[method].magic === compressionMethod) {
+ return compressions[method];
+ }
+ }
+ return null;
+};
+
// class ZipEntry {{{
/**
* An entry in the zip file.
@@ -13406,45 +14577,6 @@ ZipEntry.prototype = {
// bit 11 is set
return (this.bitFlag & 0x0800) === 0x0800;
},
- /**
- * Prepare the function used to generate the compressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @return {Function} the callback to get the compressed content (the type depends of the DataReader class).
- */
- prepareCompressedContent: function(reader, from, length) {
- return function() {
- var previousIndex = reader.index;
- reader.setIndex(from);
- var compressedFileData = reader.readData(length);
- reader.setIndex(previousIndex);
-
- return compressedFileData;
- };
- },
- /**
- * Prepare the function used to generate the uncompressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @param {JSZip.compression} compression the compression used on this file.
- * @param {number} uncompressedSize the uncompressed size to expect.
- * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class).
- */
- prepareContent: function(reader, from, length, compression, uncompressedSize) {
- return function() {
-
- var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
- var uncompressedFileData = compression.uncompress(compressedFileData);
-
- if (uncompressedFileData.length !== uncompressedSize) {
- throw new Error("Bug : uncompressed data size mismatch");
- }
-
- return uncompressedFileData;
- };
- },
/**
* Read the local part of a zip file and add the info in this object.
* @param {DataReader} reader the reader to use.
@@ -13471,32 +14603,19 @@ ZipEntry.prototype = {
// Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394
this.fileNameLength = reader.readInt(2);
localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir
- this.fileName = reader.readString(this.fileNameLength);
+ // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.
+ this.fileName = reader.readData(this.fileNameLength);
reader.skip(localExtraFieldsLength);
- if (this.compressedSize == -1 || this.uncompressedSize == -1) {
- throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)");
+ if (this.compressedSize === -1 || this.uncompressedSize === -1) {
+ throw new Error("Bug or corrupted zip : didn't get enough information from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)");
}
- compression = utils.findCompression(this.compressionMethod);
+ compression = findCompression(this.compressionMethod);
if (compression === null) { // no compression found
- throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")");
- }
- this.decompressed = new CompressedObject();
- this.decompressed.compressedSize = this.compressedSize;
- this.decompressed.uncompressedSize = this.uncompressedSize;
- this.decompressed.crc32 = this.crc32;
- this.decompressed.compressionMethod = this.compressionMethod;
- this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);
- this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);
-
- // we need to compute the crc32...
- if (this.loadOptions.checkCRC32) {
- this.decompressed = utils.transformTo("string", this.decompressed.getContent());
- if (jszipProto.crc32(this.decompressed) !== this.crc32) {
- throw new Error("Corrupted zip : CRC32 mismatch");
- }
+ throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")");
}
+ this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize));
},
/**
@@ -13505,14 +14624,15 @@ ZipEntry.prototype = {
*/
readCentralPart: function(reader) {
this.versionMadeBy = reader.readInt(2);
- this.versionNeeded = reader.readInt(2);
+ reader.skip(2);
+ // this.versionNeeded = reader.readInt(2);
this.bitFlag = reader.readInt(2);
this.compressionMethod = reader.readString(2);
this.date = reader.readDate();
this.crc32 = reader.readInt(4);
this.compressedSize = reader.readInt(4);
this.uncompressedSize = reader.readInt(4);
- this.fileNameLength = reader.readInt(2);
+ var fileNameLength = reader.readInt(2);
this.extraFieldsLength = reader.readInt(2);
this.fileCommentLength = reader.readInt(2);
this.diskNumberStart = reader.readInt(2);
@@ -13524,10 +14644,11 @@ ZipEntry.prototype = {
throw new Error("Encrypted zip are not supported");
}
- this.fileName = reader.readString(this.fileNameLength);
+ // will be read in the local part, see the comments there
+ reader.skip(fileNameLength);
this.readExtraFields(reader);
this.parseZIP64ExtraField(reader);
- this.fileComment = reader.readString(this.fileCommentLength);
+ this.fileComment = reader.readData(this.fileCommentLength);
},
/**
@@ -13554,7 +14675,7 @@ ZipEntry.prototype = {
}
// fail safe : if the name ends with a / it probably means a folder
- if (!this.dir && this.fileName.slice(-1) === '/') {
+ if (!this.dir && this.fileNameStr.slice(-1) === "/") {
this.dir = true;
}
},
@@ -13563,14 +14684,13 @@ ZipEntry.prototype = {
* Parse the ZIP64 extra field and merge the info in the current ZipEntry.
* @param {DataReader} reader the reader to use.
*/
- parseZIP64ExtraField: function(reader) {
-
+ parseZIP64ExtraField: function() {
if (!this.extraFields[0x0001]) {
return;
}
// should be something, preparing the extra reader
- var extraReader = new StringReader(this.extraFields[0x0001].value);
+ var extraReader = readerFor(this.extraFields[0x0001].value);
// I really hope that these 64bits integer can fit in 32 bits integer, because js
// won't let us have more.
@@ -13592,17 +14712,19 @@ ZipEntry.prototype = {
* @param {DataReader} reader the reader to use.
*/
readExtraFields: function(reader) {
- var start = reader.index,
+ var end = reader.index + this.extraFieldsLength,
extraFieldId,
extraFieldLength,
extraFieldValue;
- this.extraFields = this.extraFields || {};
+ if (!this.extraFields) {
+ this.extraFields = {};
+ }
- while (reader.index < start + this.extraFieldsLength) {
+ while (reader.index + 4 < end) {
extraFieldId = reader.readInt(2);
extraFieldLength = reader.readInt(2);
- extraFieldValue = reader.readString(extraFieldLength);
+ extraFieldValue = reader.readData(extraFieldLength);
this.extraFields[extraFieldId] = {
id: extraFieldId,
@@ -13610,22 +14732,34 @@ ZipEntry.prototype = {
value: extraFieldValue
};
}
+
+ reader.setIndex(end);
},
/**
* Apply an UTF8 transformation if needed.
*/
handleUTF8: function() {
+ var decodeParamType = support.uint8array ? "uint8array" : "array";
if (this.useUTF8()) {
- this.fileName = jszipProto.utf8decode(this.fileName);
- this.fileComment = jszipProto.utf8decode(this.fileComment);
+ this.fileNameStr = utf8.utf8decode(this.fileName);
+ this.fileCommentStr = utf8.utf8decode(this.fileComment);
} else {
var upath = this.findExtraFieldUnicodePath();
if (upath !== null) {
- this.fileName = upath;
+ this.fileNameStr = upath;
+ } else {
+ // ASCII text or unsupported code page
+ var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName);
+ this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);
}
+
var ucomment = this.findExtraFieldUnicodeComment();
if (ucomment !== null) {
- this.fileComment = ucomment;
+ this.fileCommentStr = ucomment;
+ } else {
+ // ASCII text or unsupported code page
+ var commentByteArray = utils.transformTo(decodeParamType, this.fileComment);
+ this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);
}
}
},
@@ -13637,7 +14771,7 @@ ZipEntry.prototype = {
findExtraFieldUnicodePath: function() {
var upathField = this.extraFields[0x7075];
if (upathField) {
- var extraReader = new StringReader(upathField.value);
+ var extraReader = readerFor(upathField.value);
// wrong version
if (extraReader.readInt(1) !== 1) {
@@ -13645,11 +14779,11 @@ ZipEntry.prototype = {
}
// the crc of the filename changed, this field is out of date.
- if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) {
+ if (crc32fn(this.fileName) !== extraReader.readInt(4)) {
return null;
}
- return jszipProto.utf8decode(extraReader.readString(upathField.length - 5));
+ return utf8.utf8decode(extraReader.readData(upathField.length - 5));
}
return null;
},
@@ -13661,7 +14795,7 @@ ZipEntry.prototype = {
findExtraFieldUnicodeComment: function() {
var ucommentField = this.extraFields[0x6375];
if (ucommentField) {
- var extraReader = new StringReader(ucommentField.value);
+ var extraReader = readerFor(ucommentField.value);
// wrong version
if (extraReader.readInt(1) !== 1) {
@@ -13669,42 +14803,527 @@ ZipEntry.prototype = {
}
// the crc of the comment changed, this field is out of date.
- if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) {
+ if (crc32fn(this.fileComment) !== extraReader.readInt(4)) {
return null;
}
- return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5));
+ return utf8.utf8decode(extraReader.readData(ucommentField.length - 5));
}
return null;
}
};
module.exports = ZipEntry;
-},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(_dereq_,module,exports){
+},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(require,module,exports){
+"use strict";
+
+var StreamHelper = require("./stream/StreamHelper");
+var DataWorker = require("./stream/DataWorker");
+var utf8 = require("./utf8");
+var CompressedObject = require("./compressedObject");
+var GenericWorker = require("./stream/GenericWorker");
+
+/**
+ * A simple object representing a file in the zip file.
+ * @constructor
+ * @param {string} name the name of the file
+ * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
+ * @param {Object} options the options of the file
+ */
+var ZipObject = function(name, data, options) {
+ this.name = name;
+ this.dir = options.dir;
+ this.date = options.date;
+ this.comment = options.comment;
+ this.unixPermissions = options.unixPermissions;
+ this.dosPermissions = options.dosPermissions;
+
+ this._data = data;
+ this._dataBinary = options.binary;
+ // keep only the compression
+ this.options = {
+ compression : options.compression,
+ compressionOptions : options.compressionOptions
+ };
+};
+
+ZipObject.prototype = {
+ /**
+ * Create an internal stream for the content of this object.
+ * @param {String} type the type of each chunk.
+ * @return StreamHelper the stream.
+ */
+ internalStream: function (type) {
+ var result = null, outputType = "string";
+ try {
+ if (!type) {
+ throw new Error("No output type specified.");
+ }
+ outputType = type.toLowerCase();
+ var askUnicodeString = outputType === "string" || outputType === "text";
+ if (outputType === "binarystring" || outputType === "text") {
+ outputType = "string";
+ }
+ result = this._decompressWorker();
+
+ var isUnicodeString = !this._dataBinary;
+
+ if (isUnicodeString && !askUnicodeString) {
+ result = result.pipe(new utf8.Utf8EncodeWorker());
+ }
+ if (!isUnicodeString && askUnicodeString) {
+ result = result.pipe(new utf8.Utf8DecodeWorker());
+ }
+ } catch (e) {
+ result = new GenericWorker("error");
+ result.error(e);
+ }
+
+ return new StreamHelper(result, outputType, "");
+ },
+
+ /**
+ * Prepare the content in the asked type.
+ * @param {String} type the type of the result.
+ * @param {Function} onUpdate a function to call on each internal update.
+ * @return Promise the promise of the result.
+ */
+ async: function (type, onUpdate) {
+ return this.internalStream(type).accumulate(onUpdate);
+ },
+
+ /**
+ * Prepare the content as a nodejs stream.
+ * @param {String} type the type of each chunk.
+ * @param {Function} onUpdate a function to call on each internal update.
+ * @return Stream the stream.
+ */
+ nodeStream: function (type, onUpdate) {
+ return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate);
+ },
+
+ /**
+ * Return a worker for the compressed content.
+ * @private
+ * @param {Object} compression the compression object to use.
+ * @param {Object} compressionOptions the options to use when compressing.
+ * @return Worker the worker.
+ */
+ _compressWorker: function (compression, compressionOptions) {
+ if (
+ this._data instanceof CompressedObject &&
+ this._data.compression.magic === compression.magic
+ ) {
+ return this._data.getCompressedWorker();
+ } else {
+ var result = this._decompressWorker();
+ if(!this._dataBinary) {
+ result = result.pipe(new utf8.Utf8EncodeWorker());
+ }
+ return CompressedObject.createWorkerFrom(result, compression, compressionOptions);
+ }
+ },
+ /**
+ * Return a worker for the decompressed content.
+ * @private
+ * @return Worker the worker.
+ */
+ _decompressWorker : function () {
+ if (this._data instanceof CompressedObject) {
+ return this._data.getContentWorker();
+ } else if (this._data instanceof GenericWorker) {
+ return this._data;
+ } else {
+ return new DataWorker(this._data);
+ }
+ }
+};
+
+var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"];
+var removedFn = function () {
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
+};
+
+for(var i = 0; i < removedMethods.length; i++) {
+ ZipObject.prototype[removedMethods[i]] = removedFn;
+}
+module.exports = ZipObject;
+
+},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(require,module,exports){
+(function (global){
+'use strict';
+var Mutation = global.MutationObserver || global.WebKitMutationObserver;
+
+var scheduleDrain;
+
+{
+ if (Mutation) {
+ var called = 0;
+ var observer = new Mutation(nextTick);
+ var element = global.document.createTextNode('');
+ observer.observe(element, {
+ characterData: true
+ });
+ scheduleDrain = function () {
+ element.data = (called = ++called % 2);
+ };
+ } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {
+ var channel = new global.MessageChannel();
+ channel.port1.onmessage = nextTick;
+ scheduleDrain = function () {
+ channel.port2.postMessage(0);
+ };
+ } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {
+ scheduleDrain = function () {
+
+ // Create a