From 28f9576a689c359f40fb066f74cb3dbf2d2c565a Mon Sep 17 00:00:00 2001 From: codarch Date: Wed, 22 Jan 2020 18:38:03 +0100 Subject: [PATCH] Use babel in the bundling process Transpile code with babel, thus fix the issue with Internet Explorer that cannot handle arrow functions. --- lib/legacy.js | 2 +- lib/module.js | 136 +++++++++++++++++++++++++++++++++++++++++++++- lib/standalone.js | 2 +- package.json | 1 + rollup.config.js | 14 +++++ yarn.lock | 9 ++- 6 files changed, 160 insertions(+), 4 deletions(-) diff --git a/lib/legacy.js b/lib/legacy.js index f2cc0d7..961df20 100644 --- a/lib/legacy.js +++ b/lib/legacy.js @@ -1 +1 @@ -"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var escape=_interopDefault(require("lodash.escape")),JSZip=_interopDefault(require("jszip")),FileSaver=_interopDefault(require("file-saver"));const CELL_TYPE_STRING="string",CELL_TYPE_NUMBER="number",validTypes=["string","number"],MISSING_KEY_FILENAME="Zipclex config missing property filename",INVALID_TYPE_FILENAME="Zipclex filename can only be of type string",INVALID_TYPE_SHEET="Zipcelx sheet data is not of type array",INVALID_TYPE_SHEET_DATA="Zipclex sheet data childs is not of type array",WARNING_INVALID_TYPE='Invalid type supplied in cell config, falling back to "string"',childValidator=e=>e.every(e=>Array.isArray(e));var validator=e=>e.filename?"string"!=typeof e.filename?(console.error(INVALID_TYPE_FILENAME),!1):Array.isArray(e.sheet.data)?!!childValidator(e.sheet.data)||(console.error(INVALID_TYPE_SHEET_DATA),!1):(console.error(INVALID_TYPE_SHEET),!1):(console.error(MISSING_KEY_FILENAME),!1);const generateColumnLetter=e=>{if("number"!=typeof e)return"";const t=Math.floor(e/26),o=String.fromCharCode(97+e%26).toUpperCase();return 0===t?o:generateColumnLetter(t-1)+o};var generatorCellNumber=(e,t)=>`${generateColumnLetter(e)}${t}`,generatorStringCell=(e,t,o)=>`${escape(t)}`,generatorNumberCell=(e,t,o)=>`${t}`,formatCell=(e,t,o)=>(-1===validTypes.indexOf(e.type)&&(console.warn(WARNING_INVALID_TYPE),e.type="string"),"string"===e.type?generatorStringCell(t,e.value,o):generatorNumberCell(t,e.value,o)),formatRow=(e,t)=>{const o=t+1,r=e.map((e,t)=>formatCell(e,t,o)).join("");return`${r}`},generatorRows=e=>e.map((e,t)=>formatRow(e,t)).join(""),workbookXML='\n',workbookXMLRels='\n\n\n',rels='\n',contentTypes='\n\n\n\n\n\n',templateSheet='\n{placeholder}';const generateXMLWorksheet=e=>{const t=generatorRows(e);return templateSheet.replace("{placeholder}",t)};var zipcelx=e=>{if(!validator(e))throw new Error("Validation failed.");const t=new JSZip,o=t.folder("xl");o.file("workbook.xml",workbookXML),o.file("_rels/workbook.xml.rels",workbookXMLRels),t.file("_rels/.rels",rels),t.file("[Content_Types].xml",contentTypes);const r=generateXMLWorksheet(e.sheet.data);return o.file("worksheets/sheet1.xml",r),t.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(t=>{FileSaver.saveAs(t,`${e.filename}.xlsx`)})};exports.generateXMLWorksheet=generateXMLWorksheet,exports.default=zipcelx; +"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var escape=_interopDefault(require("lodash.escape")),JSZip=_interopDefault(require("jszip")),FileSaver=_interopDefault(require("file-saver")),CELL_TYPE_STRING="string",CELL_TYPE_NUMBER="number",validTypes=[CELL_TYPE_STRING,CELL_TYPE_NUMBER],MISSING_KEY_FILENAME="Zipclex config missing property filename",INVALID_TYPE_FILENAME="Zipclex filename can only be of type string",INVALID_TYPE_SHEET="Zipcelx sheet data is not of type array",INVALID_TYPE_SHEET_DATA="Zipclex sheet data childs is not of type array",WARNING_INVALID_TYPE='Invalid type supplied in cell config, falling back to "string"',childValidator=function(e){return e.every(function(e){return Array.isArray(e)})},validator=function(e){return e.filename?"string"!=typeof e.filename?(console.error(INVALID_TYPE_FILENAME),!1):Array.isArray(e.sheet.data)?!!childValidator(e.sheet.data)||(console.error(INVALID_TYPE_SHEET_DATA),!1):(console.error(INVALID_TYPE_SHEET),!1):(console.error(MISSING_KEY_FILENAME),!1)},generateColumnLetter=function e(t){if("number"!=typeof t)return"";var o=Math.floor(t/26),r=String.fromCharCode(97+t%26).toUpperCase();return 0===o?r:e(o-1)+r},generatorCellNumber=function(e,t){return""+generateColumnLetter(e)+t},generatorStringCell=function(e,t,o){return''+escape(t)+""},generatorNumberCell=function(e,t,o){return''+t+""},formatCell=function(e,t,o){return-1===validTypes.indexOf(e.type)&&(console.warn(WARNING_INVALID_TYPE),e.type=CELL_TYPE_STRING),e.type===CELL_TYPE_STRING?generatorStringCell(t,e.value,o):generatorNumberCell(t,e.value,o)},formatRow=function(e,t){var o=t+1,r=e.map(function(e,t){return formatCell(e,t,o)}).join("");return''+r+""},generatorRows=function(e){return e.map(function(e,t){return formatRow(e,t)}).join("")},workbookXML='\n',workbookXMLRels='\n\n\n',rels='\n',contentTypes='\n\n\n\n\n\n',templateSheet='\n{placeholder}',generateXMLWorksheet=function(e){var t=generatorRows(e);return templateSheet.replace("{placeholder}",t)},zipcelx=function(e){if(!validator(e))throw new Error("Validation failed.");var t=new JSZip,o=t.folder("xl");o.file("workbook.xml",workbookXML),o.file("_rels/workbook.xml.rels",workbookXMLRels),t.file("_rels/.rels",rels),t.file("[Content_Types].xml",contentTypes);var r=generateXMLWorksheet(e.sheet.data);return o.file("worksheets/sheet1.xml",r),t.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(function(t){FileSaver.saveAs(t,e.filename+".xlsx")})};exports.generateXMLWorksheet=generateXMLWorksheet,exports.default=zipcelx; diff --git a/lib/module.js b/lib/module.js index a28298f..9ed4411 100644 --- a/lib/module.js +++ b/lib/module.js @@ -1 +1,135 @@ -import escape from"lodash.escape";import JSZip from"jszip";import FileSaver from"file-saver";const CELL_TYPE_STRING="string",CELL_TYPE_NUMBER="number",validTypes=["string","number"],MISSING_KEY_FILENAME="Zipclex config missing property filename",INVALID_TYPE_FILENAME="Zipclex filename can only be of type string",INVALID_TYPE_SHEET="Zipcelx sheet data is not of type array",INVALID_TYPE_SHEET_DATA="Zipclex sheet data childs is not of type array",WARNING_INVALID_TYPE='Invalid type supplied in cell config, falling back to "string"',childValidator=e=>e.every(e=>Array.isArray(e));var validator=e=>e.filename?"string"!=typeof e.filename?(console.error(INVALID_TYPE_FILENAME),!1):Array.isArray(e.sheet.data)?!!childValidator(e.sheet.data)||(console.error(INVALID_TYPE_SHEET_DATA),!1):(console.error(INVALID_TYPE_SHEET),!1):(console.error(MISSING_KEY_FILENAME),!1);const generateColumnLetter=e=>{if("number"!=typeof e)return"";const o=Math.floor(e/26),t=String.fromCharCode(97+e%26).toUpperCase();return 0===o?t:generateColumnLetter(o-1)+t};var generatorCellNumber=(e,o)=>`${generateColumnLetter(e)}${o}`,generatorStringCell=(e,o,t)=>`${escape(o)}`,generatorNumberCell=(e,o,t)=>`${o}`,formatCell=(e,o,t)=>(-1===validTypes.indexOf(e.type)&&(console.warn(WARNING_INVALID_TYPE),e.type="string"),"string"===e.type?generatorStringCell(o,e.value,t):generatorNumberCell(o,e.value,t)),formatRow=(e,o)=>{const t=o+1,s=e.map((e,o)=>formatCell(e,o,t)).join("");return`${s}`},generatorRows=e=>e.map((e,o)=>formatRow(e,o)).join(""),workbookXML='\n',workbookXMLRels='\n\n\n',rels='\n',contentTypes='\n\n\n\n\n\n',templateSheet='\n{placeholder}';const generateXMLWorksheet=e=>{const o=generatorRows(e);return templateSheet.replace("{placeholder}",o)};var zipcelx=e=>{if(!validator(e))throw new Error("Validation failed.");const o=new JSZip,t=o.folder("xl");t.file("workbook.xml",workbookXML),t.file("_rels/workbook.xml.rels",workbookXMLRels),o.file("_rels/.rels",rels),o.file("[Content_Types].xml",contentTypes);const s=generateXMLWorksheet(e.sheet.data);return t.file("worksheets/sheet1.xml",s),o.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(o=>{FileSaver.saveAs(o,`${e.filename}.xlsx`)})};export default zipcelx;export{generateXMLWorksheet}; +import escape from 'lodash.escape'; +import JSZip from 'jszip'; +import FileSaver from 'file-saver'; + +var CELL_TYPE_STRING = 'string'; +var CELL_TYPE_NUMBER = 'number'; +var validTypes = [CELL_TYPE_STRING, CELL_TYPE_NUMBER]; + +var MISSING_KEY_FILENAME = 'Zipclex config missing property filename'; +var INVALID_TYPE_FILENAME = 'Zipclex filename can only be of type string'; +var INVALID_TYPE_SHEET = 'Zipcelx sheet data is not of type array'; +var INVALID_TYPE_SHEET_DATA = 'Zipclex sheet data childs is not of type array'; + +var WARNING_INVALID_TYPE = 'Invalid type supplied in cell config, falling back to "string"'; + +var childValidator = function childValidator(array) { + return array.every(function (item) { + return Array.isArray(item); + }); +}; + +var validator = (function (config) { + if (!config.filename) { + console.error(MISSING_KEY_FILENAME); + return false; + } + + if (typeof config.filename !== 'string') { + console.error(INVALID_TYPE_FILENAME); + return false; + } + + if (!Array.isArray(config.sheet.data)) { + console.error(INVALID_TYPE_SHEET); + return false; + } + + if (!childValidator(config.sheet.data)) { + console.error(INVALID_TYPE_SHEET_DATA); + return false; + } + + return true; +}); + +var generateColumnLetter = function generateColumnLetter(colIndex) { + if (typeof colIndex !== 'number') { + return ''; + } + + var prefix = Math.floor(colIndex / 26); + var letter = String.fromCharCode(97 + colIndex % 26).toUpperCase(); + if (prefix === 0) { + return letter; + } + return generateColumnLetter(prefix - 1) + letter; +}; + +var generatorCellNumber = (function (index, rowNumber) { + return '' + generateColumnLetter(index) + rowNumber; +}); + +var generatorStringCell = (function (index, value, rowIndex) { + return '' + escape(value) + ''; +}); + +var generatorNumberCell = (function (index, value, rowIndex) { + return '' + value + ''; +}); + +var formatCell = (function (cell, index, rowIndex) { + if (validTypes.indexOf(cell.type) === -1) { + console.warn(WARNING_INVALID_TYPE); + cell.type = CELL_TYPE_STRING; + } + + return cell.type === CELL_TYPE_STRING ? generatorStringCell(index, cell.value, rowIndex) : generatorNumberCell(index, cell.value, rowIndex); +}); + +var formatRow = (function (row, index) { + // To ensure the row number starts as in excel. + var rowIndex = index + 1; + var rowCells = row.map(function (cell, cellIndex) { + return formatCell(cell, cellIndex, rowIndex); + }).join(''); + + return '' + rowCells + ''; +}); + +var generatorRows = (function (rows) { + return rows.map(function (row, index) { + return formatRow(row, index); + }).join(''); +}); + +var workbookXML = "\n"; + +var workbookXMLRels = "\n\n\n"; + +var rels = "\n"; + +var contentTypes = "\n\n\n\n\n\n"; + +var templateSheet = "\n{placeholder}"; + +var generateXMLWorksheet = function generateXMLWorksheet(rows) { + var XMLRows = generatorRows(rows); + return templateSheet.replace('{placeholder}', XMLRows); +}; + +var zipcelx = (function (config) { + if (!validator(config)) { + throw new Error('Validation failed.'); + } + + var zip = new JSZip(); + var xl = zip.folder('xl'); + xl.file('workbook.xml', workbookXML); + xl.file('_rels/workbook.xml.rels', workbookXMLRels); + zip.file('_rels/.rels', rels); + zip.file('[Content_Types].xml', contentTypes); + + var worksheet = generateXMLWorksheet(config.sheet.data); + xl.file('worksheets/sheet1.xml', worksheet); + + return zip.generateAsync({ + type: 'blob', + mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + }).then(function (blob) { + FileSaver.saveAs(blob, config.filename + '.xlsx'); + }); +}); + +export default zipcelx; +export { generateXMLWorksheet }; diff --git a/lib/standalone.js b/lib/standalone.js index 9f1d15e..6b40db5 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e,t){return e(t={exports:{}},t.exports),t.exports}var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o=!1;function s(){o=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}function u(e){var t;o||s();for(var r=e.length,i=r%3,a="",u=[],f=0,l=r-i;fl?l:f+16383));return 1===i?(t=e[r-1],a+=n[t>>2],a+=n[t<<4&63],a+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],a+=n[t>>10],a+=n[t>>4&63],a+=n[t<<2&63],a+="="),u.push(a),u.join("")}function f(e,t,r,n,i){var a,o,s=8*i-n-1,h=(1<>1,f=-7,l=r?i-1:0,c=r?-1:1,d=e[t+l];for(l+=c,a=d&(1<<-f)-1,d>>=-f,f+=s;f>0;a=256*a+e[t+l],l+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=256*o+e[t+l],l+=c,f-=8);if(0===a)a=1-u;else{if(a===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function l(e,t,r,n,i,a){var o,s,h,u=8*a-i-1,f=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),(t+=o+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(o++,h/=2),o+l>=f?(s=0,o=f):o+l>=1?(s=(t*h-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*m}var c={}.toString,d=Array.isArray||function(e){return"[object Array]"==c.call(e)};v.TYPED_ARRAY_SUPPORT=void 0===e.TYPED_ARRAY_SUPPORT||e.TYPED_ARRAY_SUPPORT;var p=m();function m(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(e,t){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|e}function x(e){return!(null==e||!e._isBuffer)}function S(e,t){if(x(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return $(e).length;t=(""+t).toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=v.from(t,n)),x(t))return 0===t.length?-1:C(e,t,r,n,i);if("number"==typeof t)return t&=255,v.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):C(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function C(e,t,r,n,i){var a,o=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,h/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=r;as&&(r=s-h),a=r;a>=0;a--){for(var l=!0,c=0;ci&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?u(e):u(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(h=(31&u)<<6|63&a)>127&&(f=h);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(h=(15&u)<<12|(63&a)<<6|63&o)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(h=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=U)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},v.prototype.equals=function(e){if(!x(e))throw new TypeError("Argument must be a Buffer");return this===e||0===v.compare(this,e)},v.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},v.prototype.compare=function(e,t,r,n,i){if(!x(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),h=this.slice(n,i),u=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return z(this,e,t,r);case"ascii":return T(this,e,t,r);case"latin1":case"binary":return B(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var U=4096;function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Z(e,t,r,n,i,a){if(!x(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function W(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Y(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return i||q(e,0,r,4),l(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||q(e,0,r,8),l(e,t,r,n,52,8),r+8}v.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},v.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},v.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},v.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},v.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),f(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),f(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),f(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),f(this,e,!1,52,8)},v.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},v.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,1,255,0),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},v.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):W(this,e,t,!0),t+2},v.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):W(this,e,t,!1),t+2},v.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Y(this,e,t,!0),t+4},v.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Y(this,e,t,!1),t+4},v.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},v.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},v.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,1,127,-128),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):W(this,e,t,!0),t+2},v.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):W(this,e,t,!1),t+2},v.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Y(this,e,t,!0),t+4},v.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Y(this,e,t,!1),t+4},v.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},v.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},v.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},v.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},v.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!v.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(e){return function(e){var t,r,n,h,u,f;o||s();var l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u="="===e[l-2]?2:"="===e[l-1]?1:0,f=new a(3*l/4-u),n=u>0?l-4:l;var c=0;for(t=0,r=0;t>16&255,f[c++]=h>>8&255,f[c++]=255&h;return 2===u?(h=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,f[c++]=255&h):1===u&&(h=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,f[c++]=h>>8&255,f[c++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e){return null!=e&&(!!e._isBuffer||ee(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ee(e.slice(0,0))}(e))}function ee(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var te=Object.freeze({INSPECT_MAX_BYTES:50,kMaxLength:p,Buffer:v,SlowBuffer:function(e){return+e!=e&&(e=0),v.alloc(+e)},isBuffer:Q});function re(){}function ne(){ne.init.call(this)}function ie(e){return void 0===e._maxListeners?ne.defaultMaxListeners:e._maxListeners}function ae(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]):(a=e._events=new re,e._eventsCount=0),o){if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),!o.warned&&(i=ie(e))&&i>0&&o.length>i){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=a[t]=r,++e._eventsCount;return e}function oe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function se(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function he(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function ue(){throw new Error("setTimeout has not been defined")}function fe(){throw new Error("clearTimeout has not been defined")}re.prototype=Object.create(null),ne.EventEmitter=ne,ne.usingDomains=!1,ne.prototype.domain=void 0,ne.prototype._events=void 0,ne.prototype._maxListeners=void 0,ne.defaultMaxListeners=10,ne.init=function(){this.domain=null,ne.usingDomains&&(!(void 0).active||this instanceof(void 0).Domain||(this.domain=(void 0).active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new re,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ne.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ne.prototype.getMaxListeners=function(){return ie(this)},ne.prototype.emit=function(e){var t,r,n,i,a,o,s,h="error"===e;if(o=this._events)h=h&&null==o.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=o[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=he(e,n),a=0;a0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new re,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var le=ue,ce=fe;function de(e){if(le===setTimeout)return setTimeout(e,0);if((le===ue||!le)&&setTimeout)return le=setTimeout,setTimeout(e,0);try{return le(e,0)}catch(t){try{return le.call(null,e,0)}catch(t){return le.call(this,e,0)}}}"function"==typeof e.setTimeout&&(le=setTimeout),"function"==typeof e.clearTimeout&&(ce=clearTimeout);var pe,me=[],ge=!1,ve=-1;function ye(){ge&&pe&&(ge=!1,pe.length?me=pe.concat(me):ve=-1,me.length&&we())}function we(){if(!ge){var e=de(ye);ge=!0;for(var t=me.length;t;){for(pe=me,me=[];++ve1)for(var r=1;r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Ye(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ve(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),Ke(r.showHidden)&&(r.showHidden=!1),Ke(r.depth)&&(r.depth=2),Ke(r.colors)&&(r.colors=!1),Ke(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=je),Ne(r,e,r.depth)}function je(e,t){var r=Me.styles[t];return r?"["+Me.colors[r][0]+"m"+e+"["+Me.colors[r][1]+"m":e}function Fe(e,t){return e}function Ne(e,t,r){if(e.customInspect&&t&&Je(t.inspect)&&t.inspect!==Me&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return He(n)||(n=Ne(e,n,r)),n}var i=function(e,t){if(Ke(t))return e.stylize("undefined","undefined");if(He(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Ye(t))return e.stylize(""+t,"boolean");if(qe(t))return e.stylize("null","null")}(e,t);if(i)return i;var a=Object.keys(t),o=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),Ge(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Ze(t);if(0===a.length){if(Je(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(Xe(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if($e(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Ge(t))return Ze(t)}var h,u,f="",l=!1,c=["{","}"];(h=t,Array.isArray(h)&&(l=!0,c=["[","]"]),Je(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return Xe(t)&&(f=" "+RegExp.prototype.toString.call(t)),$e(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Ge(t)&&(f=" "+Ze(t)),0!==a.length||l&&0!=t.length?r<0?Xe(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,f,c)):c[0]+f+c[1]}function Ze(e){return"["+Error.prototype.toString.call(e)+"]"}function We(e,t,r,n,i,a){var o,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),et(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=qe(r)?Ne(e,h.value,null):Ne(e,h.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),Ke(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function Ye(e){return"boolean"==typeof e}function qe(e){return null===e}function He(e){return"string"==typeof e}function Ke(e){return void 0===e}function Xe(e){return Ve(e)&&"[object RegExp]"===Qe(e)}function Ve(e){return"object"==typeof e&&null!==e}function $e(e){return Ve(e)&&"[object Date]"===Qe(e)}function Ge(e){return Ve(e)&&("[object Error]"===Qe(e)||e instanceof Error)}function Je(e){return"function"==typeof e}function Qe(e){return Object.prototype.toString.call(e)}function et(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tt(){this.head=null,this.tail=null,this.length=0}Me.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Me.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},tt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},tt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},tt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},tt.prototype.clear=function(){this.head=this.tail=null,this.length=0},tt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},tt.prototype.concat=function(e){if(0===this.length)return v.alloc(0);if(1===this.length)return this.head.data;for(var t=v.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var rt=r(function(e,t){var r=te.Buffer,n=r.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var i=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=a)}this.charBuffer=new r(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}i.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,n)}return t},i.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},i.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}}).StringDecoder;at.ReadableState=it;var nt=function(e){Ke(Ue)&&(Ue=Ie.env.NODE_DEBUG||""),e=e.toUpperCase(),De[e]||(new RegExp("\\b"+e+"\\b","i").test(Ue)?De[e]=function(){var t=function(e){if(!He(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&ut(e))),function(e,t){t.readingMore||(t.readingMore=!0,_e(lt,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function ut(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?_e(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function lt(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=v.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,_e(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function yt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):ut(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?mt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},at.prototype._read=function(e){this.emit("error",new Error("not implemented"))},at.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?o:u;function a(e){nt("onunpipe"),e===r&&u()}function o(){nt("onend"),e.end()}n.endEmitted?_e(i):r.once("end",i),e.on("unpipe",a);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function u(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",u),r.removeListener("data",l),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function l(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==yt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function c(t){var r;nt("onerror",t),m(),e.removeListener("error",c),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),m()}function p(){nt("onfinish"),e.removeListener("close",d),m()}function m(){nt("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},at.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},bt.prototype._write=function(e,t,r){r(new Error("not implemented"))},bt.prototype._writev=null,bt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Ct(e,t),r&&(t.finished?_e(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Le(Ot,at);for(var zt=Object.keys(bt.prototype),Tt=0;Tt>2,a=(3&t)<<4|r>>4,o=l>1?(15&r)<<2|n>>6:64,s=l>2?63&n:64,h.push(Wt.charAt(i)+Wt.charAt(a)+Wt.charAt(o)+Wt.charAt(s));return h.join("")},decode:function(e){var t,r,n,i,a,o,s=0,h=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var u,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===Wt.charAt(64)&&f--,e.charAt(e.length-2)===Wt.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=Zt.uint8array?new Uint8Array(0|f):new Array(0|f);s>4,r=(15&i)<<4|(a=Wt.indexOf(e.charAt(s++)))>>2,n=(3&a)<<6|(o=Wt.indexOf(e.charAt(s++))),u[h++]=t,64!==a&&(u[h++]=r),64!==o&&(u[h++]=n);return u}},qt=!0,Ht=function(e,t){return new v(e,t)},Kt=function(e){return v.alloc?v.alloc(e):new v(e)},Xt=function(e){return Q(e)},Vt=function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume},$t=r(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),Gt=r(function(e){var t=e.exports={version:"2.3.0"};"number"==typeof __e&&(__e=t)}),Jt=(Gt.version,function(e,t,r){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}),Qt=function(e){return"object"==typeof e?null!==e:"function"==typeof e},er=function(e){if(!Qt(e))throw TypeError(e+" is not an object!");return e},tr=function(e){try{return!!e()}catch(e){return!0}},rr=!tr(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),nr=$t.document,ir=Qt(nr)&&Qt(nr.createElement),ar=function(e){return ir?nr.createElement(e):{}},or=!rr&&!tr(function(){return 7!=Object.defineProperty(ar("div"),"a",{get:function(){return 7}}).a}),sr=Object.defineProperty,hr={f:rr?Object.defineProperty:function(e,t,r){if(er(e),t=function(e,t){if(!Qt(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!Qt(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!Qt(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!Qt(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}(t,!0),er(r),or)try{return sr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},ur=rr?function(e,t,r){return hr.f(e,t,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}(1,r))}:function(e,t,r){return e[t]=r,e},fr=function(e,t,r){var n,i,a,o=e&fr.F,s=e&fr.G,h=e&fr.S,u=e&fr.P,f=e&fr.B,l=e&fr.W,c=s?Gt:Gt[t]||(Gt[t]={}),d=c.prototype,p=s?$t:h?$t[t]:($t[t]||{}).prototype;for(n in s&&(r=t),r)(i=!o&&p&&void 0!==p[n])&&n in c||(a=i?p[n]:r[n],c[n]=s&&"function"!=typeof p[n]?r[n]:f&&i?Jt(a,$t):l&&p[n]==a?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(a):u&&"function"==typeof a?Jt(Function.call,a):a,u&&((c.virtual||(c.virtual={}))[n]=a,e&fr.R&&d&&!d[n]&&ur(d,n,a)))};fr.F=1,fr.G=2,fr.S=4,fr.P=8,fr.B=16,fr.W=32,fr.U=64,fr.R=128;var lr,cr,dr,pr,mr=fr,gr=$t.document&&document.documentElement,vr={}.toString,yr=$t.process,wr=$t.setImmediate,_r=$t.clearImmediate,br=$t.MessageChannel,kr=0,xr={},Sr=function(){var e=+this;if(xr.hasOwnProperty(e)){var t=xr[e];delete xr[e],t()}},Er=function(e){Sr.call(e.data)};wr&&_r||(wr=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return xr[++kr]=function(){!function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}e.apply(r,t)}("function"==typeof e?e:Function(e),t)},lr(kr),kr},_r=function(e){delete xr[e]},"process"==(pr=yr,vr.call(pr).slice(8,-1))?lr=function(e){yr.nextTick(Jt(Sr,e,1))}:br?(dr=(cr=new br).port2,cr.port1.onmessage=Er,lr=Jt(dr.postMessage,dr,1)):$t.addEventListener&&"function"==typeof postMessage&&!$t.importScripts?(lr=function(e){$t.postMessage(e+"","*")},$t.addEventListener("message",Er,!1)):lr="onreadystatechange"in ar("script")?function(e){gr.appendChild(ar("script")).onreadystatechange=function(){gr.removeChild(this),Sr.call(e)}}:function(e){setTimeout(Jt(Sr,e,1),0)});var Ar={set:wr,clear:_r};mr(mr.G+mr.B,{setImmediate:Ar.set,clearImmediate:Ar.clear});var Cr,Rr,zr=Gt.setImmediate,Tr=t.MutationObserver||t.WebKitMutationObserver;if(Tr){var Br=0,Or=new Tr(Ur),Ir=t.document.createTextNode("");Or.observe(Ir,{characterData:!0}),Cr=function(){Ir.data=Br=++Br%2}}else if(t.setImmediate||void 0===t.MessageChannel)Cr="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){Ur(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(Ur,0)};else{var Lr=new t.MessageChannel;Lr.port1.onmessage=Ur,Cr=function(){Lr.port2.postMessage(0)}}var Pr=[];function Ur(){var e,t;Rr=!0;for(var r=Pr.length;r;){for(t=Pr,Pr=[],e=-1;++e1;)try{return i.stringifyByChunk(e,n,r)}catch(e){r=Math.floor(r/2)}return i.stringifyByChar(e)}function o(e,t){for(var r=0;r "+e:e}};var Qr=Jr,en=r(function(e,t){for(var r=new Array(256),n=0;n<256;n++)r[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;r[254]=r[254]=1;function i(){Qr.call(this,"utf-8 decode"),this.leftOver=null}function a(){Qr.call(this,"utf-8 encode")}t.utf8encode=function(e){return Zt.nodebuffer?Ht(e,"utf-8"):function(e){var t,r,n,i,a,o=e.length,s=0;for(i=0;i>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t}(e)},t.utf8decode=function(e){return Zt.nodebuffer?Gr.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,a,o=e.length,s=new Array(2*o);for(n=0,t=0;t4)s[n++]=65533,t+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&t1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return s.length!==n&&(s.subarray?s=s.subarray(0,n):s.length=n),Gr.applyFromCharCode(s)}(e=Gr.transformTo(Zt.uint8array?"uint8array":"array",e))},Gr.inherits(i,Qr),i.prototype.processChunk=function(e){var n=Gr.transformTo(Zt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Zt.uint8array){var i=n;(n=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),n.set(i,this.leftOver.length)}else n=this.leftOver.concat(n);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+r[e[n]]>t?n:t}(n),o=n;a!==n.length&&(Zt.uint8array?(o=n.subarray(0,a),this.leftOver=n.subarray(a,n.length)):(o=n.slice(0,a),this.leftOver=n.slice(a,n.length))),this.push({data:t.utf8decode(o),meta:e.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=i,Gr.inherits(a,Qr),a.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=a});en.utf8encode,en.utf8decode,en.Utf8DecodeWorker,en.Utf8EncodeWorker;function tn(e){Qr.call(this,"ConvertWorker to "+e),this.destType=e}Gr.inherits(tn,Qr),tn.prototype.processChunk=function(e){this.push({data:Gr.transformTo(this.destType,e.data),meta:e.meta})};var rn=tn,nn=Nt.Readable;function an(e,t,r){nn.call(this,t),this._helper=e;var n=this;e.on("data",function(e,t){n.push(e)||n._helper.pause(),r&&r(t)}).on("error",function(e){n.emit("error",e)}).on("end",function(){n.push(null)})}Gr.inherits(an,nn),an.prototype._read=function(){this._helper.resume()};var on=an,sn=null;if(Zt.nodestream)try{sn=on}catch(e){}function hn(e,t){return new $r.Promise(function(r,n){var i=[],a=e._internalType,o=e._outputType,s=e._mimeType;e.on("data",function(e,r){i.push(e),t&&t(r)}).on("error",function(e){i=[],n(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return Gr.newBlob(Gr.transformTo("arraybuffer",t),r);case"base64":return Yt.encode(t);default:return Gr.transformTo(e,t)}}(o,function(e,t){var r,n=0,i=null,a=0;for(r=0;r=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var dn=cn;function pn(e){Qr.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Gr.inherits(pn,Qr),pn.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Qr.prototype.processChunk.call(this,e)};var mn=pn;var gn=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var vn=function(e,t){return void 0!==e&&e.length?"string"!==Gr.getTypeOf(e)?function(e,t,r,n){var i=gn,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=gn,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0};function yn(){Qr.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Gr.inherits(yn,Qr),yn.prototype.processChunk=function(e){this.streamInfo.crc32=vn(e.data,this.streamInfo.crc32||0),this.push(e)};var wn=yn;function _n(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}_n.prototype={getContentWorker:function(){var e=new dn($r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new mn("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new dn($r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_n.createWorkerFrom=function(e,t,r){return e.pipe(new wn).pipe(new mn("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new mn("compressedSize")).withStreamInfo("compression",t)};var bn=_n,kn=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};kn.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new en.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new en.Utf8DecodeWorker))}catch(e){(t=new Qr("error")).error(e)}return new fn(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof bn&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new en.Utf8EncodeWorker)),bn.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof bn?this._data.getContentWorker():this._data instanceof Qr?this._data:new dn(this._data)}};for(var xn=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Sn=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},En=0;En=0;)e[t]=0}var In=0,Ln=1,Pn=2,Un=29,Dn=256,Mn=Dn+1+Un,jn=30,Fn=19,Nn=2*Mn+1,Zn=15,Wn=16,Yn=7,qn=256,Hn=16,Kn=17,Xn=18,Vn=[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],$n=[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],Gn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Jn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Qn=new Array(2*(Mn+2));On(Qn);var ei=new Array(2*jn);On(ei);var ti=new Array(512);On(ti);var ri=new Array(256);On(ri);var ni=new Array(Un);On(ni);var ii,ai,oi,si=new Array(jn);function hi(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function ui(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function fi(e){return e<256?ti[e]:ti[256+(e>>>7)]}function li(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ci(e,t,r){e.bi_valid>Wn-r?(e.bi_buf|=t<>Wn-e.bi_valid,e.bi_valid+=r-Wn):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function mi(e,t,r){var n,i,a=new Array(Zn+1),o=0;for(n=1;n<=Zn;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=pi(a[s]++,s))}}function gi(e){var t;for(t=0;t8?li(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function yi(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)wi(e,a,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],wi(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,wi(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,h=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=Zn;a++)e.bl_count[a]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(a=p,m++),h[2*n+1]=a,n>u||(e.bl_count[a]++,o=0,n>=d&&(o=c[n-d]),s=h[2*n],e.opt_len+=s*(a+o),l&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>u||(h[2*i+1]!==a&&(e.opt_len+=(a-h[2*i+1])*h[2*i],h[2*i+1]=a),n--)}}(e,t),mi(a,u,e.bl_count)}function ki(e,t,r){var n,i,a=-1,o=t[1],s=0,h=7,u=4;for(0===o&&(h=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n0?(e.strm.data_type===Bn&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return zn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Tn;for(t=32;t=3&&0===e.bl_tree[2*Jn[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?Ei(e,t,r,n):e.strategy===Rn||a===i?(ci(e,(Ln<<1)+(n?1:0),3),_i(e,Qn,ei)):(ci(e,(Pn<<1)+(n?1:0),3),function(e,t,r,n){var i;for(ci(e,t-257,5),ci(e,r-1,5),ci(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(ri[r]+Dn+1)]++,e.dyn_dtree[2*fi(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){ci(e,Ln<<1,3),di(e,qn,Qn),function(e){16===e.bi_valid?(li(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}};var Ci=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0};var Ri=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var zi,Ti=function(e,t,r,n){var i=Ri,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e},Bi={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"},Oi=0,Ii=1,Li=3,Pi=4,Ui=5,Di=0,Mi=1,ji=-2,Fi=-3,Ni=-5,Zi=-1,Wi=1,Yi=2,qi=3,Hi=4,Ki=0,Xi=2,Vi=8,$i=9,Gi=15,Ji=8,Qi=286,ea=30,ta=19,ra=2*Qi+1,na=15,ia=3,aa=258,oa=aa+ia+1,sa=32,ha=42,ua=69,fa=73,la=91,ca=103,da=113,pa=666,ma=1,ga=2,va=3,ya=4,wa=3;function _a(e,t){return e.msg=Bi[t],t}function ba(e){return(e<<1)-(e>4?9:0)}function ka(e){for(var t=e.length;--t>=0;)e[t]=0}function xa(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Cn.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Sa(e,t){Ai._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,xa(e.strm)}function Ea(e,t){e.pending_buf[e.pending++]=t}function Aa(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ca(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-oa?e.strstart-(e.w_size-oa):0,u=e.window,f=e.w_mask,l=e.prev,c=e.strstart+aa,d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&f])>h&&0!=--i);return o<=e.lookahead?o:e.lookahead}function Ra(e){var t,r,n,i,a,o,s,h,u,f,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-oa)){Cn.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=l?n-l:0}while(--r);t=r=l;do{n=e.prev[--t],e.prev[t]=n>=l?n-l:0}while(--r);i+=l}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,h=e.strstart+e.lookahead,u=i,f=void 0,(f=o.avail_in)>u&&(f=u),r=0===f?0:(o.avail_in-=f,Cn.arraySet(s,o.input,o.next_in,f,h),1===o.state.wrap?o.adler=Ci(o.adler,s,f,h):2===o.state.wrap&&(o.adler=Ti(o.adler,s,f,h)),o.next_in+=f,o.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=ia)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=ia&&(e.ins_h=(e.ins_h<=ia)if(n=Ai._tr_tally(e,e.strstart-e.match_start,e.match_length-ia),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ia){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=ia&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=ia-1)),e.prev_length>=ia&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-ia,n=Ai._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-ia),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(o=2,n-=16),i<1||i>$i||r!==Vi||n<8||n>15||t<0||t>9||a<0||a>Hi)return _a(e,ji);8===n&&(n=9);var s=new function(){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=Vi,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 Cn.Buf16(2*ra),this.dyn_dtree=new Cn.Buf16(2*(2*ea+1)),this.bl_tree=new Cn.Buf16(2*(2*ta+1)),ka(this.dyn_ltree),ka(this.dyn_dtree),ka(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Cn.Buf16(na+1),this.heap=new Cn.Buf16(2*Qi+1),ka(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Cn.Buf16(2*Qi+1),ka(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};return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ra(e),0===e.lookahead&&t===Oi)return ma;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Sa(e,!1),0===e.strm.avail_out))return ma;if(e.strstart-e.block_start>=e.w_size-oa&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):(e.strstart>e.block_start&&(Sa(e,!1),e.strm.avail_out),ma)}),new Ba(4,4,8,4,za),new Ba(4,5,16,8,za),new Ba(4,6,32,32,za),new Ba(4,4,16,16,Ta),new Ba(8,16,32,32,Ta),new Ba(8,16,128,128,Ta),new Ba(8,32,128,256,Ta),new Ba(32,128,258,1024,Ta),new Ba(32,258,258,4096,Ta)];var Pa={deflateInit:function(e,t){return La(e,t,Vi,Gi,Ji,Ki)},deflateInit2:La,deflateReset:Ia,deflateResetKeep:Oa,deflateSetHeader:function(e,t){return e&&e.state?2!==e.state.wrap?ji:(e.state.gzhead=t,Di):ji},deflate:function(e,t){var r,n,i,a;if(!e||!e.state||t>Ui||t<0)return e?_a(e,ji):ji;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===pa&&t!==Pi)return _a(e,0===e.avail_out?Ni:ji);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ha)if(2===n.wrap)e.adler=0,Ea(n,31),Ea(n,139),Ea(n,8),n.gzhead?(Ea(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ea(n,255&n.gzhead.time),Ea(n,n.gzhead.time>>8&255),Ea(n,n.gzhead.time>>16&255),Ea(n,n.gzhead.time>>24&255),Ea(n,9===n.level?2:n.strategy>=Yi||n.level<2?4:0),Ea(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ea(n,255&n.gzhead.extra.length),Ea(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ti(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ua):(Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,9===n.level?2:n.strategy>=Yi||n.level<2?4:0),Ea(n,wa),n.status=da);else{var o=Vi+(n.w_bits-8<<4)<<8;o|=(n.strategy>=Yi||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=sa),o+=31-o%31,n.status=da,Aa(n,o),0!==n.strstart&&(Aa(n,e.adler>>>16),Aa(n,65535&e.adler)),e.adler=1}if(n.status===ua)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending!==n.pending_buf_size));)Ea(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=fa)}else n.status=fa;if(n.status===fa)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=la)}else n.status=la;if(n.status===la)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=ca)}else n.status=ca;if(n.status===ca&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&xa(e),n.pending+2<=n.pending_buf_size&&(Ea(n,255&e.adler),Ea(n,e.adler>>8&255),e.adler=0,n.status=da)):n.status=da),0!==n.pending){if(xa(e),0===e.avail_out)return n.last_flush=-1,Di}else if(0===e.avail_in&&ba(t)<=ba(r)&&t!==Pi)return _a(e,Ni);if(n.status===pa&&0!==e.avail_in)return _a(e,Ni);if(0!==e.avail_in||0!==n.lookahead||t!==Oi&&n.status!==pa){var s=n.strategy===Yi?function(e,t){for(var r;;){if(0===e.lookahead&&(Ra(e),0===e.lookahead)){if(t===Oi)return ma;break}if(e.match_length=0,r=Ai._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):e.last_lit&&(Sa(e,!1),0===e.strm.avail_out)?ma:ga}(n,t):n.strategy===qi?function(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=aa){if(Ra(e),e.lookahead<=aa&&t===Oi)return ma;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=ia&&e.strstart>0&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){a=e.strstart+aa;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ia?(r=Ai._tr_tally(e,1,e.match_length-ia),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ai._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):e.last_lit&&(Sa(e,!1),0===e.strm.avail_out)?ma:ga}(n,t):zi[n.level].func(n,t);if(s!==va&&s!==ya||(n.status=pa),s===ma||s===va)return 0===e.avail_out&&(n.last_flush=-1),Di;if(s===ga&&(t===Ii?Ai._tr_align(n):t!==Ui&&(Ai._tr_stored_block(n,0,0,!1),t===Li&&(ka(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),xa(e),0===e.avail_out))return n.last_flush=-1,Di}return t!==Pi?Di:n.wrap<=0?Mi:(2===n.wrap?(Ea(n,255&e.adler),Ea(n,e.adler>>8&255),Ea(n,e.adler>>16&255),Ea(n,e.adler>>24&255),Ea(n,255&e.total_in),Ea(n,e.total_in>>8&255),Ea(n,e.total_in>>16&255),Ea(n,e.total_in>>24&255)):(Aa(n,e.adler>>>16),Aa(n,65535&e.adler)),xa(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Di:Mi)},deflateEnd:function(e){var t;return e&&e.state?(t=e.state.status)!==ha&&t!==ua&&t!==fa&&t!==la&&t!==ca&&t!==da&&t!==pa?_a(e,ji):(e.state=null,t===da?_a(e,Fi):Di):ji},deflateSetDictionary:function(e,t){var r,n,i,a,o,s,h,u,f=t.length;if(!e||!e.state)return ji;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==ha||r.lookahead)return ji;for(1===a&&(e.adler=Ci(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===a&&(ka(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Cn.Buf8(r.w_size),Cn.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,Ra(r);r.lookahead>=ia;){n=r.strstart,i=r.lookahead-(ia-1);do{r.ins_h=(r.ins_h<=252?6:ja>=248?5:ja>=240?4:ja>=224?3:ja>=192?2:1;Ma[254]=Ma[254]=1;function Fa(e,t){if(t<65537&&(e.subarray&&Da||!e.subarray&&Ua))return String.fromCharCode.apply(null,Cn.shrinkBuf(e,t));for(var r="",n=0;n>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},buf2binstring:function(e){return Fa(e,e.length)},binstring2buf:function(e){for(var t=new Cn.Buf8(e.length),r=0,n=t.length;r4)s[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return Fa(s,n)},utf8border:function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+Ma[e[r]]>t?r:t}};var Za=function(){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},Wa=Object.prototype.toString,Ya=0,qa=-1,Ha=0,Ka=8;function Xa(e){if(!(this instanceof Xa))return new Xa(e);this.options=Cn.assign({level:qa,method:Ka,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ha,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Za,this.strm.avail_out=0;var r=Pa.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ya)throw new Error(Bi[r]);if(t.header&&Pa.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?Na.string2buf(t.dictionary):"[object ArrayBuffer]"===Wa.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=Pa.deflateSetDictionary(this.strm,n))!==Ya)throw new Error(Bi[r]);this._dict_set=!0}}function Va(e,t){var r=new Xa(t);if(r.push(e,!0),r.err)throw r.msg||Bi[r.err];return r.result}Xa.prototype.push=function(e,t){var r,n,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=Na.string2buf(e):"[object ArrayBuffer]"===Wa.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Cn.Buf8(a),i.next_out=0,i.avail_out=a),1!==(r=Pa.deflate(i,n))&&r!==Ya)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(Na.buf2binstring(Cn.shrinkBuf(i.output,i.next_out))):this.onData(Cn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=Pa.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ya):2!==n||(this.onEnd(Ya),i.avail_out=0,!0)},Xa.prototype.onData=function(e){this.chunks.push(e)},Xa.prototype.onEnd=function(e){e===Ya&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var $a={Deflate:Xa,deflate:Va,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Va(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Va(e,t)}},Ga=function(e,t){var r,n,i,a,o,s,h,u,f,l,c,d,p,m,g,v,y,w,_,b,k,x,S,E,A;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),a=e.next_out,A=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),h=r.dmax,u=r.wsize,f=r.whave,l=r.wnext,c=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,v=(1<>>=_=w>>>24,p-=_,0===(_=w>>>16&255))A[a++]=65535&w;else{if(!(16&_)){if(0==(64&_)){w=m[(65535&w)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=65535&w,(_&=15)&&(p<_&&(d+=E[n++]<>>=_,p-=_),p<15&&(d+=E[n++]<>>=_=w>>>24,p-=_,!(16&(_=w>>>16&255))){if(0==(64&_)){w=g[(65535&w)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&w,p<(_&=15)&&(d+=E[n++]<h){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=_,p-=_,k>(_=a-o)){if((_=k-_)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,S=c,0===l){if(x+=u-_,_2;)A[a++]=S[x++],A[a++]=S[x++],A[a++]=S[x++],b-=3;b&&(A[a++]=S[x++],b>1&&(A[a++]=S[x++]))}else{x=a-k;do{A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],b-=3}while(b>2);b&&(A[a++]=A[x++],b>1&&(A[a++]=A[x++]))}break}}break}}while(n>3,d&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n=1&&0===T[b];b--);if(k>b&&(k=b),0===b)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(_=1;_0&&(0===e||1!==b))return-1;for(B[1]=0,y=1;y<15;y++)B[y+1]=B[y]+T[y];for(w=0;w852||2===e&&A>592)return 1;for(;;){p=y-S,o[w]d?(m=O[I+o[w]],g=R[z+o[w]]):(m=96,g=0),h=1<>S)+(u-=h)]=p<<24|m<<16|g|0}while(0!==u);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,w++,0==--T[y]){if(y===b)break;y=t[r+o[w]]}if(y>k&&(C&l)!==f){for(0===S&&(S=k),c+=_,E=1<<(x=y-S);x+S852||2===e&&A>592)return 1;i[f=C&l]=k<<24|x<<16|c-a|0}}return 0!==C&&(i[c+C]=y-S<<24|64<<16|0),s.bits=k,0},no=0,io=1,ao=2,oo=4,so=5,ho=6,uo=0,fo=1,lo=2,co=-2,po=-3,mo=-4,go=-5,vo=8,yo=1,wo=2,_o=3,bo=4,ko=5,xo=6,So=7,Eo=8,Ao=9,Co=10,Ro=11,zo=12,To=13,Bo=14,Oo=15,Io=16,Lo=17,Po=18,Uo=19,Do=20,Mo=21,jo=22,Fo=23,No=24,Zo=25,Wo=26,Yo=27,qo=28,Ho=29,Ko=30,Xo=31,Vo=32,$o=852,Go=592,Jo=15;function Qo(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function es(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=yo,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Cn.Buf32($o),t.distcode=t.distdyn=new Cn.Buf32(Go),t.sane=1,t.back=-1,uo):co}function ts(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,es(e)):co}function rs(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?co:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ts(e))):co}function ns(e,t){var r,n;return e?(n=new function(){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 Cn.Buf16(320),this.work=new Cn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},e.state=n,n.window=null,(r=rs(e,t))!==uo&&(e.state=null),r):co}var is,as,os=!0;function ss(e){if(os){var t;for(is=new Cn.Buf32(512),as=new Cn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ro(io,e.lens,0,288,is,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ro(ao,e.lens,0,32,as,0,e.work,{bits:5}),os=!1}e.lencode=is,e.lenbits=9,e.distcode=as,e.distbits=5}function hs(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(Cn.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),Cn.arraySet(a.window,t,r-n,i,a.wnext),(n-=i)?(Cn.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=Ti(r.check,C,2,0),u=0,f=0,r.mode=wo;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=Ko;break}if((15&u)!==vo){e.msg="unknown compression method",r.mode=Ko;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=Ko;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=_o;case _o:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=Ti(r.check,C,4,0)),u=0,f=0,r.mode=bo;case bo:for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=ko;case ko:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=xo;case xo:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Cn.arraySet(r.head.extra,n,a,d,k)),512&r.flags&&(r.check=Ti(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=So;case So:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[a+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=zo;break;case Co:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>=7&f,f-=7&f,r.mode=Yo;break}for(;f<3;){if(0===s)break e;s--,u+=n[a++]<>>=1)){case 0:r.mode=Bo;break;case 1:if(ss(r),r.mode=Do,t===ho){u>>>=2,f-=2;break e}break;case 2:r.mode=Lo;break;case 3:e.msg="invalid block type",r.mode=Ko}u>>>=2,f-=2;break;case Bo:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=n[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ko;break}if(r.length=65535&u,u=0,f=0,r.mode=Oo,t===ho)break e;case Oo:r.mode=Io;case Io:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;Cn.arraySet(i,n,a,d,o),s-=d,a+=d,h-=d,o+=d,r.length-=d;break}r.mode=zo;break;case Lo:for(;f<14;){if(0===s)break e;s--,u+=n[a++]<>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ko;break}r.have=0,r.mode=Po;case Po:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=ro(no,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=Ko;break}r.have=0,r.mode=Uo;case Uo:for(;r.have>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=g,f-=g,r.lens[r.have++]=y;else{if(16===y){for(E=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Ko;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,f-=2}else if(17===y){for(E=g+3;f>>=g)),u>>>=3,f-=3}else{for(E=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ko;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===Ko)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Ko;break}if(r.lenbits=9,S={bits:r.lenbits},x=ro(io,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=Ko;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=ro(ao,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=Ko;break}if(r.mode=Do,t===ho)break e;case Do:r.mode=Mo;case Mo:if(s>=6&&h>=258){e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,Ga(e,c),o=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,u=r.hold,f=r.bits,r.mode===zo&&(r.back=-1);break}for(r.back=0;v=(A=r.lencode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,r.length=y,0===v){r.mode=Wo;break}if(32&v){r.back=-1,r.mode=zo;break}if(64&v){e.msg="invalid literal/length code",r.mode=Ko;break}r.extra=15&v,r.mode=jo;case jo:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Fo;case Fo:for(;v=(A=r.distcode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=Ko;break}r.offset=y,r.extra=15&v,r.mode=No;case No:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ko;break}r.mode=Zo;case Zo:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ko;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=Mo);break;case Wo:if(0===h)break e;i[o++]=r.length,h--,r.mode=Mo;break;case Yo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,u|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Za,this.strm.avail_out=0;var r=us.inflateInit2(this.strm,t.windowBits);if(r!==fs.Z_OK)throw new Error(Bi[r]);this.header=new ls,us.inflateGetHeader(this.strm,this.header)}function ps(e,t){var r=new ds(t);if(r.push(e,!0),r.err)throw r.msg||Bi[r.err];return r.result}ds.prototype.push=function(e,t){var r,n,i,a,o,s,h=this.strm,u=this.options.chunkSize,f=this.options.dictionary,l=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?fs.Z_FINISH:fs.Z_NO_FLUSH,"string"==typeof e?h.input=Na.binstring2buf(e):"[object ArrayBuffer]"===cs.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new Cn.Buf8(u),h.next_out=0,h.avail_out=u),(r=us.inflate(h,fs.Z_NO_FLUSH))===fs.Z_NEED_DICT&&f&&(s="string"==typeof f?Na.string2buf(f):"[object ArrayBuffer]"===cs.call(f)?new Uint8Array(f):f,r=us.inflateSetDictionary(this.strm,s)),r===fs.Z_BUF_ERROR&&!0===l&&(r=fs.Z_OK,l=!1),r!==fs.Z_STREAM_END&&r!==fs.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==fs.Z_STREAM_END&&(0!==h.avail_in||n!==fs.Z_FINISH&&n!==fs.Z_SYNC_FLUSH)||("string"===this.options.to?(i=Na.utf8border(h.output,h.next_out),a=h.next_out-i,o=Na.buf2string(h.output,i),h.next_out=a,h.avail_out=u-a,a&&Cn.arraySet(h.output,h.output,i,a,0),this.onData(o)):this.onData(Cn.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(l=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==fs.Z_STREAM_END);return r===fs.Z_STREAM_END&&(n=fs.Z_FINISH),n===fs.Z_FINISH?(r=us.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===fs.Z_OK):n!==fs.Z_SYNC_FLUSH||(this.onEnd(fs.Z_OK),h.avail_out=0,!0)},ds.prototype.onData=function(e){this.chunks.push(e)},ds.prototype.onEnd=function(e){e===fs.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ms={Inflate:ds,inflate:ps,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ps(e,t)},ungzip:ps},gs={};(0,Cn.assign)(gs,$a,ms,fs);var vs=gs,ys="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function ws(e,t){Qr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Gr.inherits(ws,Qr),ws.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Gr.transformTo(ys,e.data),!1)},ws.prototype.flush=function(){Qr.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},ws.prototype.cleanUp=function(){Qr.prototype.cleanUp.call(this),this._pako=null},ws.prototype._createPako=function(){this._pako=new vs[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var _s={STORE:{magic:"\0\0",compressWorker:function(e){return new Qr("STORE compression")},uncompressWorker:function(){return new Qr("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new ws("Deflate",e)},uncompressWorker:function(){return new ws("Inflate",{})}}},bs="PK",ks="PK",xs="PK",Ss="PK",Es="PK",As="PK\b",Cs=function(e,t){var r,n="";for(r=0;r>>=8;return n},Rs=function(e,t,r,n,i,a){var o,s,h=e.file,u=e.compression,f=a!==en.utf8encode,l=Gr.transformTo("string",a(h.name)),c=Gr.transformTo("string",en.utf8encode(h.name)),d=h.comment,p=Gr.transformTo("string",a(d)),m=Gr.transformTo("string",en.utf8encode(d)),g=c.length!==h.name.length,v=m.length!==d.length,y="",w="",_="",b=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),f||!g&&!v||(S|=2048);var E,A,C=0,R=0;b&&(C|=16),"UNIX"===i?(R=798,C|=(E=h.unixPermissions,A=E,E||(A=b?16893:33204),(65535&A)<<16)):(R=20,C|=63&(h.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,s=k.getUTCFullYear()-1980,s<<=4,s|=k.getUTCMonth()+1,s<<=5,s|=k.getUTCDate(),g&&(w=Cs(1,1)+Cs(vn(l),4)+c,y+="up"+Cs(w.length,2)+w),v&&(_=Cs(1,1)+Cs(vn(p),4)+m,y+="uc"+Cs(_.length,2)+_);var z="";return z+="\n\0",z+=Cs(S,2),z+=u.magic,z+=Cs(o,2),z+=Cs(s,2),z+=Cs(x.crc32,4),z+=Cs(x.compressedSize,4),z+=Cs(x.uncompressedSize,4),z+=Cs(l.length,2),z+=Cs(y.length,2),{fileRecord:bs+z+l+y,dirRecord:ks+Cs(R,2)+z+Cs(p.length,2)+"\0\0\0\0"+Cs(C,4)+Cs(n,4)+l+y+p}};function zs(e,t,r,n){Qr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Gr.inherits(zs,Qr),zs.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Qr.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},zs.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Rs(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zs.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Rs(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return As+Cs(e.crc32,4)+Cs(e.compressedSize,4)+Cs(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},zs.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},Us=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},Ds=function(e,t){return t=void 0!==t?t:ln.createFolders,e=Us(e),this.files[e]||Ls.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Ms(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var js={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n))},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1===arguments.length){if(Ms(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,Ls.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(Ms(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=Ds.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return Gr.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var Ns=Fs;function Zs(e){Ns.call(this,e);for(var t=0;t=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},Zs.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},Zs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ws=Zs;function Ys(e){Ns.call(this,e)}Gr.inherits(Ys,Ns),Ys.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Ys.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Ys.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Ys.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var qs=Ys;function Hs(e){Ws.call(this,e)}Gr.inherits(Hs,Ws),Hs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ks=Hs;function Xs(e){Ks.call(this,e)}Gr.inherits(Xs,Ks),Xs.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Vs=Xs,$s=function(e){var t=Gr.getTypeOf(e);return Gr.checkSupport(t),"string"!==t||Zt.uint8array?"nodebuffer"===t?new Vs(e):Zt.uint8array?new Ks(Gr.transformTo("uint8array",e)):new Ws(Gr.transformTo("array",e)):new qs(e)};function Gs(e,t){this.options=e,this.loadOptions=t}Gs.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in _s)if(_s.hasOwnProperty(t)&&_s[t].magic===e)return _s[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+Gr.pretty(this.compressionMethod)+" unknown (inner file : "+Gr.transformTo("string",this.fileName)+")");this.decompressed=new bn(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=$s(this.extraFields[1].value);this.uncompressedSize===Gr.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===Gr.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===Gr.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===Gr.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,ks)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=$s(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var eh=Qs;function th(e){return new $r.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new wn);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}function rh(){if(!(this instanceof rh))return new rh;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new rh;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}rh.prototype=js,rh.prototype.loadAsync=function(e,t){var r=this;return t=Gr.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:en.utf8decode}),qt&&Vt(e)?$r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Gr.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new eh(t);return r.load(e),r}).then(function(e){var r=[$r.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t&&t.global===t?t:void 0,o=a.saveAs||"object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,o){var s=a.URL||a.webkitURL,h=document.createElement("a");t=t||e.name||"download",h.download=t,h.rel="noopener","string"==typeof e?(h.href=e,h.origin===location.origin?i(h):n(h.href)?r(e,t,o):i(h,h.target="_blank")):(h.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(h.href)},4e4),setTimeout(function(){i(h)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,a){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Depricated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),t);else if(n(e))r(e,t,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){i(o)})}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var o="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||o&&s)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=h?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var f=a.URL||a.webkitURL,l=f.createObjectURL(e);i?i.location=l:location.href=l,i=null,setTimeout(function(){f.revokeObjectURL(l)},4e4)}};a.saveAs=o.saveAs=o,e.exports=o})()});const ah=["string","number"];var oh=e=>e.filename?"string"!=typeof e.filename?(console.error("Zipclex filename can only be of type string"),!1):Array.isArray(e.sheet.data)?!!(e=>e.every(e=>Array.isArray(e)))(e.sheet.data)||(console.error("Zipclex sheet data childs is not of type array"),!1):(console.error("Zipcelx sheet data is not of type array"),!1):(console.error("Zipclex config missing property filename"),!1),sh=1/0,hh="[object Symbol]",uh=/[&<>"'`]/g,fh=RegExp(uh.source),lh="object"==typeof t&&t&&t.Object===Object&&t,ch="object"==typeof self&&self&&self.Object===Object&&self,dh=lh||ch||Function("return this")();var ph=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),mh=Object.prototype.toString,gh=dh.Symbol,vh=gh?gh.prototype:void 0,yh=vh?vh.toString:void 0;function wh(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&mh.call(e)==hh}(e))return yh?yh.call(e):"";var t=e+"";return"0"==t&&1/e==-sh?"-0":t}var _h=function(e){var t;return(e=null==(t=e)?"":wh(t))&&fh.test(e)?e.replace(uh,ph):e};const bh=e=>{if("number"!=typeof e)return"";const t=Math.floor(e/26),r=String.fromCharCode(97+e%26).toUpperCase();return 0===t?r:bh(t-1)+r};var kh=(e,t)=>`${bh(e)}${t}`,xh=(e,t,r)=>(-1===ah.indexOf(e.type)&&(console.warn('Invalid type supplied in cell config, falling back to "string"'),e.type="string"),"string"===e.type?((e,t,r)=>`${_h(t)}`)(t,e.value,r):((e,t,r)=>`${t}`)(t,e.value,r)),Sh=e=>e.map((e,t)=>((e,t)=>{const r=t+1,n=e.map((e,t)=>xh(e,t,r)).join("");return`${n}`})(e,t)).join(""),Eh='\n{placeholder}';e.zipcelx=(e=>{if(!oh(e))throw new Error("Validation failed.");const t=new nh,r=t.folder("xl");r.file("workbook.xml",'\n'),r.file("_rels/workbook.xml.rels",'\n\n\n'),t.file("_rels/.rels",'\n'),t.file("[Content_Types].xml",'\n\n\n\n\n\n');const n=(e=>{const t=Sh(e);return Eh.replace("{placeholder}",t)})(e.sheet.data);return r.file("worksheets/sheet1.xml",n),t.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(t=>{ih.saveAs(t,`${e.filename}.xlsx`)})})}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e,t){return e(t={exports:{}},t.exports),t.exports}var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o=!1;function s(){o=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}function u(e){var t;o||s();for(var r=e.length,i=r%3,a="",u=[],f=0,l=r-i;fl?l:f+16383));return 1===i?(t=e[r-1],a+=n[t>>2],a+=n[t<<4&63],a+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],a+=n[t>>10],a+=n[t>>4&63],a+=n[t<<2&63],a+="="),u.push(a),u.join("")}function f(e,t,r,n,i){var a,o,s=8*i-n-1,h=(1<>1,f=-7,l=r?i-1:0,c=r?-1:1,d=e[t+l];for(l+=c,a=d&(1<<-f)-1,d>>=-f,f+=s;f>0;a=256*a+e[t+l],l+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=256*o+e[t+l],l+=c,f-=8);if(0===a)a=1-u;else{if(a===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)}function l(e,t,r,n,i,a){var o,s,h,u=8*a-i-1,f=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),(t+=o+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(o++,h/=2),o+l>=f?(s=0,o=f):o+l>=1?(s=(t*h-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*m}var c={}.toString,d=Array.isArray||function(e){return"[object Array]"==c.call(e)};v.TYPED_ARRAY_SUPPORT=void 0===e.TYPED_ARRAY_SUPPORT||e.TYPED_ARRAY_SUPPORT;var p=m();function m(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(e,t){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|e}function x(e){return!(null==e||!e._isBuffer)}function S(e,t){if(x(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=v.from(t,n)),x(t))return 0===t.length?-1:C(e,t,r,n,i);if("number"==typeof t)return t&=255,v.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):C(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function C(e,t,r,n,i){var a,o=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,h/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=r;as&&(r=s-h),a=r;a>=0;a--){for(var l=!0,c=0;ci&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?u(e):u(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(h=(31&u)<<6|63&a)>127&&(f=h);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(h=(15&u)<<12|(63&a)<<6|63&o)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(h=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=U)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},v.prototype.equals=function(e){if(!x(e))throw new TypeError("Argument must be a Buffer");return this===e||0===v.compare(this,e)},v.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},v.prototype.compare=function(e,t,r,n,i){if(!x(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),h=this.slice(n,i),u=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return z(this,e,t,r);case"ascii":return T(this,e,t,r);case"latin1":case"binary":return B(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var U=4096;function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function Z(e,t,r,n,i,a){if(!x(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function W(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Y(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return i||q(e,0,r,4),l(e,t,r,n,23,4),r+4}function K(e,t,r,n,i){return i||q(e,0,r,8),l(e,t,r,n,52,8),r+8}v.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},v.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},v.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},v.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},v.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},v.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),f(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),f(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),f(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),f(this,e,!1,52,8)},v.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Z(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},v.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,1,255,0),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},v.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):W(this,e,t,!0),t+2},v.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):W(this,e,t,!1),t+2},v.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Y(this,e,t,!0),t+4},v.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Y(this,e,t,!1),t+4},v.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},v.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Z(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},v.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,1,127,-128),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):W(this,e,t,!0),t+2},v.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):W(this,e,t,!1),t+2},v.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Y(this,e,t,!0),t+4},v.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),v.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Y(this,e,t,!1),t+4},v.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},v.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},v.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},v.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},v.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!v.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function J(e){return function(e){var t,r,n,h,u,f;o||s();var l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u="="===e[l-2]?2:"="===e[l-1]?1:0,f=new a(3*l/4-u),n=u>0?l-4:l;var c=0;for(t=0,r=0;t>16&255,f[c++]=h>>8&255,f[c++]=255&h;return 2===u?(h=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,f[c++]=255&h):1===u&&(h=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,f[c++]=h>>8&255,f[c++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e){return null!=e&&(!!e._isBuffer||ee(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ee(e.slice(0,0))}(e))}function ee(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var te=Object.freeze({INSPECT_MAX_BYTES:50,kMaxLength:p,Buffer:v,SlowBuffer:function(e){return+e!=e&&(e=0),v.alloc(+e)},isBuffer:Q});function re(){}function ne(){ne.init.call(this)}function ie(e){return void 0===e._maxListeners?ne.defaultMaxListeners:e._maxListeners}function ae(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]):(a=e._events=new re,e._eventsCount=0),o){if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),!o.warned&&(i=ie(e))&&i>0&&o.length>i){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=a[t]=r,++e._eventsCount;return e}function oe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function se(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function he(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function ue(){throw new Error("setTimeout has not been defined")}function fe(){throw new Error("clearTimeout has not been defined")}re.prototype=Object.create(null),ne.EventEmitter=ne,ne.usingDomains=!1,ne.prototype.domain=void 0,ne.prototype._events=void 0,ne.prototype._maxListeners=void 0,ne.defaultMaxListeners=10,ne.init=function(){this.domain=null,ne.usingDomains&&(!(void 0).active||this instanceof(void 0).Domain||(this.domain=(void 0).active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new re,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ne.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ne.prototype.getMaxListeners=function(){return ie(this)},ne.prototype.emit=function(e){var t,r,n,i,a,o,s,h="error"===e;if(o=this._events)h=h&&null==o.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=o[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=he(e,n),a=0;a0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new re,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var le=ue,ce=fe;function de(e){if(le===setTimeout)return setTimeout(e,0);if((le===ue||!le)&&setTimeout)return le=setTimeout,setTimeout(e,0);try{return le(e,0)}catch(t){try{return le.call(null,e,0)}catch(t){return le.call(this,e,0)}}}"function"==typeof e.setTimeout&&(le=setTimeout),"function"==typeof e.clearTimeout&&(ce=clearTimeout);var pe,me=[],ge=!1,ve=-1;function ye(){ge&&pe&&(ge=!1,pe.length?me=pe.concat(me):ve=-1,me.length&&we())}function we(){if(!ge){var e=de(ye);ge=!0;for(var t=me.length;t;){for(pe=me,me=[];++ve1)for(var r=1;r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Ye(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ve(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),Ke(r.showHidden)&&(r.showHidden=!1),Ke(r.depth)&&(r.depth=2),Ke(r.colors)&&(r.colors=!1),Ke(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=je),Ne(r,e,r.depth)}function je(e,t){var r=Me.styles[t];return r?"["+Me.colors[r][0]+"m"+e+"["+Me.colors[r][1]+"m":e}function Fe(e,t){return e}function Ne(e,t,r){if(e.customInspect&&t&&$e(t.inspect)&&t.inspect!==Me&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return He(n)||(n=Ne(e,n,r)),n}var i=function(e,t){if(Ke(t))return e.stylize("undefined","undefined");if(He(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Ye(t))return e.stylize(""+t,"boolean");if(qe(t))return e.stylize("null","null")}(e,t);if(i)return i;var a=Object.keys(t),o=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),Je(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Ze(t);if(0===a.length){if($e(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(Xe(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ge(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Je(t))return Ze(t)}var h,u,f="",l=!1,c=["{","}"];(h=t,Array.isArray(h)&&(l=!0,c=["[","]"]),$e(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return Xe(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ge(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Je(t)&&(f=" "+Ze(t)),0!==a.length||l&&0!=t.length?r<0?Xe(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,f,c)):c[0]+f+c[1]}function Ze(e){return"["+Error.prototype.toString.call(e)+"]"}function We(e,t,r,n,i,a){var o,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),et(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=qe(r)?Ne(e,h.value,null):Ne(e,h.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),Ke(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function Ye(e){return"boolean"==typeof e}function qe(e){return null===e}function He(e){return"string"==typeof e}function Ke(e){return void 0===e}function Xe(e){return Ve(e)&&"[object RegExp]"===Qe(e)}function Ve(e){return"object"==typeof e&&null!==e}function Ge(e){return Ve(e)&&"[object Date]"===Qe(e)}function Je(e){return Ve(e)&&("[object Error]"===Qe(e)||e instanceof Error)}function $e(e){return"function"==typeof e}function Qe(e){return Object.prototype.toString.call(e)}function et(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tt(){this.head=null,this.tail=null,this.length=0}Me.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Me.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},tt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},tt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},tt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},tt.prototype.clear=function(){this.head=this.tail=null,this.length=0},tt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},tt.prototype.concat=function(e){if(0===this.length)return v.alloc(0);if(1===this.length)return this.head.data;for(var t=v.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var rt=r(function(e,t){var r=te.Buffer,n=r.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var i=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=a)}this.charBuffer=new r(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}i.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,n)}return t},i.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},i.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}}).StringDecoder;at.ReadableState=it;var nt=function(e){Ke(Ue)&&(Ue=Ie.env.NODE_DEBUG||""),e=e.toUpperCase(),De[e]||(new RegExp("\\b"+e+"\\b","i").test(Ue)?De[e]=function(){var t=function(e){if(!He(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&ut(e))),function(e,t){t.readingMore||(t.readingMore=!0,_e(lt,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function ut(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?_e(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function lt(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=v.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,_e(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function yt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):ut(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?mt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},at.prototype._read=function(e){this.emit("error",new Error("not implemented"))},at.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?o:u;function a(e){nt("onunpipe"),e===r&&u()}function o(){nt("onend"),e.end()}n.endEmitted?_e(i):r.once("end",i),e.on("unpipe",a);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function u(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",u),r.removeListener("data",l),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function l(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==yt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function c(t){var r;nt("onerror",t),m(),e.removeListener("error",c),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),m()}function p(){nt("onfinish"),e.removeListener("close",d),m()}function m(){nt("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},at.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},bt.prototype._write=function(e,t,r){r(new Error("not implemented"))},bt.prototype._writev=null,bt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Ct(e,t),r&&(t.finished?_e(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Le(Ot,at);for(var zt=Object.keys(bt.prototype),Tt=0;Tt>2,a=(3&t)<<4|r>>4,o=l>1?(15&r)<<2|n>>6:64,s=l>2?63&n:64,h.push(Wt.charAt(i)+Wt.charAt(a)+Wt.charAt(o)+Wt.charAt(s));return h.join("")},decode:function(e){var t,r,n,i,a,o,s=0,h=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var u,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===Wt.charAt(64)&&f--,e.charAt(e.length-2)===Wt.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=Zt.uint8array?new Uint8Array(0|f):new Array(0|f);s>4,r=(15&i)<<4|(a=Wt.indexOf(e.charAt(s++)))>>2,n=(3&a)<<6|(o=Wt.indexOf(e.charAt(s++))),u[h++]=t,64!==a&&(u[h++]=r),64!==o&&(u[h++]=n);return u}},qt=!0,Ht=function(e,t){return new v(e,t)},Kt=function(e){return v.alloc?v.alloc(e):new v(e)},Xt=function(e){return Q(e)},Vt=function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume},Gt=r(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),Jt=r(function(e){var t=e.exports={version:"2.3.0"};"number"==typeof __e&&(__e=t)}),$t=(Jt.version,function(e,t,r){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}),Qt=function(e){return"object"==typeof e?null!==e:"function"==typeof e},er=function(e){if(!Qt(e))throw TypeError(e+" is not an object!");return e},tr=function(e){try{return!!e()}catch(e){return!0}},rr=!tr(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),nr=Gt.document,ir=Qt(nr)&&Qt(nr.createElement),ar=function(e){return ir?nr.createElement(e):{}},or=!rr&&!tr(function(){return 7!=Object.defineProperty(ar("div"),"a",{get:function(){return 7}}).a}),sr=Object.defineProperty,hr={f:rr?Object.defineProperty:function(e,t,r){if(er(e),t=function(e,t){if(!Qt(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!Qt(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!Qt(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!Qt(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}(t,!0),er(r),or)try{return sr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},ur=rr?function(e,t,r){return hr.f(e,t,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}(1,r))}:function(e,t,r){return e[t]=r,e},fr=function(e,t,r){var n,i,a,o=e&fr.F,s=e&fr.G,h=e&fr.S,u=e&fr.P,f=e&fr.B,l=e&fr.W,c=s?Jt:Jt[t]||(Jt[t]={}),d=c.prototype,p=s?Gt:h?Gt[t]:(Gt[t]||{}).prototype;for(n in s&&(r=t),r)(i=!o&&p&&void 0!==p[n])&&n in c||(a=i?p[n]:r[n],c[n]=s&&"function"!=typeof p[n]?r[n]:f&&i?$t(a,Gt):l&&p[n]==a?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(a):u&&"function"==typeof a?$t(Function.call,a):a,u&&((c.virtual||(c.virtual={}))[n]=a,e&fr.R&&d&&!d[n]&&ur(d,n,a)))};fr.F=1,fr.G=2,fr.S=4,fr.P=8,fr.B=16,fr.W=32,fr.U=64,fr.R=128;var lr,cr,dr,pr,mr=fr,gr=Gt.document&&document.documentElement,vr={}.toString,yr=Gt.process,wr=Gt.setImmediate,_r=Gt.clearImmediate,br=Gt.MessageChannel,kr=0,xr={},Sr=function(){var e=+this;if(xr.hasOwnProperty(e)){var t=xr[e];delete xr[e],t()}},Er=function(e){Sr.call(e.data)};wr&&_r||(wr=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return xr[++kr]=function(){!function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}e.apply(r,t)}("function"==typeof e?e:Function(e),t)},lr(kr),kr},_r=function(e){delete xr[e]},"process"==(pr=yr,vr.call(pr).slice(8,-1))?lr=function(e){yr.nextTick($t(Sr,e,1))}:br?(dr=(cr=new br).port2,cr.port1.onmessage=Er,lr=$t(dr.postMessage,dr,1)):Gt.addEventListener&&"function"==typeof postMessage&&!Gt.importScripts?(lr=function(e){Gt.postMessage(e+"","*")},Gt.addEventListener("message",Er,!1)):lr="onreadystatechange"in ar("script")?function(e){gr.appendChild(ar("script")).onreadystatechange=function(){gr.removeChild(this),Sr.call(e)}}:function(e){setTimeout($t(Sr,e,1),0)});var Ar={set:wr,clear:_r};mr(mr.G+mr.B,{setImmediate:Ar.set,clearImmediate:Ar.clear});var Cr,Rr,zr=Jt.setImmediate,Tr=t.MutationObserver||t.WebKitMutationObserver;if(Tr){var Br=0,Or=new Tr(Ur),Ir=t.document.createTextNode("");Or.observe(Ir,{characterData:!0}),Cr=function(){Ir.data=Br=++Br%2}}else if(t.setImmediate||void 0===t.MessageChannel)Cr="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){Ur(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(Ur,0)};else{var Lr=new t.MessageChannel;Lr.port1.onmessage=Ur,Cr=function(){Lr.port2.postMessage(0)}}var Pr=[];function Ur(){var e,t;Rr=!0;for(var r=Pr.length;r;){for(t=Pr,Pr=[],e=-1;++e1;)try{return i.stringifyByChunk(e,n,r)}catch(e){r=Math.floor(r/2)}return i.stringifyByChar(e)}function o(e,t){for(var r=0;r "+e:e}};var Qr=$r,en=r(function(e,t){for(var r=new Array(256),n=0;n<256;n++)r[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;r[254]=r[254]=1;function i(){Qr.call(this,"utf-8 decode"),this.leftOver=null}function a(){Qr.call(this,"utf-8 encode")}t.utf8encode=function(e){return Zt.nodebuffer?Ht(e,"utf-8"):function(e){var t,r,n,i,a,o=e.length,s=0;for(i=0;i>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t}(e)},t.utf8decode=function(e){return Zt.nodebuffer?Jr.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,a,o=e.length,s=new Array(2*o);for(n=0,t=0;t4)s[n++]=65533,t+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&t1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return s.length!==n&&(s.subarray?s=s.subarray(0,n):s.length=n),Jr.applyFromCharCode(s)}(e=Jr.transformTo(Zt.uint8array?"uint8array":"array",e))},Jr.inherits(i,Qr),i.prototype.processChunk=function(e){var n=Jr.transformTo(Zt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Zt.uint8array){var i=n;(n=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),n.set(i,this.leftOver.length)}else n=this.leftOver.concat(n);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+r[e[n]]>t?n:t}(n),o=n;a!==n.length&&(Zt.uint8array?(o=n.subarray(0,a),this.leftOver=n.subarray(a,n.length)):(o=n.slice(0,a),this.leftOver=n.slice(a,n.length))),this.push({data:t.utf8decode(o),meta:e.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=i,Jr.inherits(a,Qr),a.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=a});en.utf8encode,en.utf8decode,en.Utf8DecodeWorker,en.Utf8EncodeWorker;function tn(e){Qr.call(this,"ConvertWorker to "+e),this.destType=e}Jr.inherits(tn,Qr),tn.prototype.processChunk=function(e){this.push({data:Jr.transformTo(this.destType,e.data),meta:e.meta})};var rn=tn,nn=Nt.Readable;function an(e,t,r){nn.call(this,t),this._helper=e;var n=this;e.on("data",function(e,t){n.push(e)||n._helper.pause(),r&&r(t)}).on("error",function(e){n.emit("error",e)}).on("end",function(){n.push(null)})}Jr.inherits(an,nn),an.prototype._read=function(){this._helper.resume()};var on=an,sn=null;if(Zt.nodestream)try{sn=on}catch(e){}function hn(e,t){return new Gr.Promise(function(r,n){var i=[],a=e._internalType,o=e._outputType,s=e._mimeType;e.on("data",function(e,r){i.push(e),t&&t(r)}).on("error",function(e){i=[],n(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return Jr.newBlob(Jr.transformTo("arraybuffer",t),r);case"base64":return Yt.encode(t);default:return Jr.transformTo(e,t)}}(o,function(e,t){var r,n=0,i=null,a=0;for(r=0;r=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var dn=cn;function pn(e){Qr.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Jr.inherits(pn,Qr),pn.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Qr.prototype.processChunk.call(this,e)};var mn=pn;var gn=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var vn=function(e,t){return void 0!==e&&e.length?"string"!==Jr.getTypeOf(e)?function(e,t,r,n){var i=gn,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=gn,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0};function yn(){Qr.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Jr.inherits(yn,Qr),yn.prototype.processChunk=function(e){this.streamInfo.crc32=vn(e.data,this.streamInfo.crc32||0),this.push(e)};var wn=yn;function _n(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}_n.prototype={getContentWorker:function(){var e=new dn(Gr.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new mn("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new dn(Gr.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_n.createWorkerFrom=function(e,t,r){return e.pipe(new wn).pipe(new mn("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new mn("compressedSize")).withStreamInfo("compression",t)};var bn=_n,kn=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};kn.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new en.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new en.Utf8DecodeWorker))}catch(e){(t=new Qr("error")).error(e)}return new fn(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof bn&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new en.Utf8EncodeWorker)),bn.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof bn?this._data.getContentWorker():this._data instanceof Qr?this._data:new dn(this._data)}};for(var xn=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Sn=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},En=0;En=0;)e[t]=0}var In=0,Ln=1,Pn=2,Un=29,Dn=256,Mn=Dn+1+Un,jn=30,Fn=19,Nn=2*Mn+1,Zn=15,Wn=16,Yn=7,qn=256,Hn=16,Kn=17,Xn=18,Vn=[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],Gn=[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],Jn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],$n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Qn=new Array(2*(Mn+2));On(Qn);var ei=new Array(2*jn);On(ei);var ti=new Array(512);On(ti);var ri=new Array(256);On(ri);var ni=new Array(Un);On(ni);var ii,ai,oi,si=new Array(jn);function hi(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function ui(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function fi(e){return e<256?ti[e]:ti[256+(e>>>7)]}function li(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ci(e,t,r){e.bi_valid>Wn-r?(e.bi_buf|=t<>Wn-e.bi_valid,e.bi_valid+=r-Wn):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function mi(e,t,r){var n,i,a=new Array(Zn+1),o=0;for(n=1;n<=Zn;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=pi(a[s]++,s))}}function gi(e){var t;for(t=0;t8?li(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function yi(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)wi(e,a,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],wi(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,wi(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,h=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=Zn;a++)e.bl_count[a]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(a=p,m++),h[2*n+1]=a,n>u||(e.bl_count[a]++,o=0,n>=d&&(o=c[n-d]),s=h[2*n],e.opt_len+=s*(a+o),l&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>u||(h[2*i+1]!==a&&(e.opt_len+=(a-h[2*i+1])*h[2*i],h[2*i+1]=a),n--)}}(e,t),mi(a,u,e.bl_count)}function ki(e,t,r){var n,i,a=-1,o=t[1],s=0,h=7,u=4;for(0===o&&(h=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n0?(e.strm.data_type===Bn&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return zn;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Tn;for(t=32;t=3&&0===e.bl_tree[2*$n[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?Ei(e,t,r,n):e.strategy===Rn||a===i?(ci(e,(Ln<<1)+(n?1:0),3),_i(e,Qn,ei)):(ci(e,(Pn<<1)+(n?1:0),3),function(e,t,r,n){var i;for(ci(e,t-257,5),ci(e,r-1,5),ci(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(ri[r]+Dn+1)]++,e.dyn_dtree[2*fi(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){ci(e,Ln<<1,3),di(e,qn,Qn),function(e){16===e.bi_valid?(li(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}};var Ci=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0};var Ri=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var zi,Ti=function(e,t,r,n){var i=Ri,a=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e},Bi={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"},Oi=0,Ii=1,Li=3,Pi=4,Ui=5,Di=0,Mi=1,ji=-2,Fi=-3,Ni=-5,Zi=-1,Wi=1,Yi=2,qi=3,Hi=4,Ki=0,Xi=2,Vi=8,Gi=9,Ji=15,$i=8,Qi=286,ea=30,ta=19,ra=2*Qi+1,na=15,ia=3,aa=258,oa=aa+ia+1,sa=32,ha=42,ua=69,fa=73,la=91,ca=103,da=113,pa=666,ma=1,ga=2,va=3,ya=4,wa=3;function _a(e,t){return e.msg=Bi[t],t}function ba(e){return(e<<1)-(e>4?9:0)}function ka(e){for(var t=e.length;--t>=0;)e[t]=0}function xa(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Cn.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function Sa(e,t){Ai._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,xa(e.strm)}function Ea(e,t){e.pending_buf[e.pending++]=t}function Aa(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ca(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-oa?e.strstart-(e.w_size-oa):0,u=e.window,f=e.w_mask,l=e.prev,c=e.strstart+aa,d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=l[t&f])>h&&0!=--i);return o<=e.lookahead?o:e.lookahead}function Ra(e){var t,r,n,i,a,o,s,h,u,f,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-oa)){Cn.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=l?n-l:0}while(--r);t=r=l;do{n=e.prev[--t],e.prev[t]=n>=l?n-l:0}while(--r);i+=l}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,h=e.strstart+e.lookahead,u=i,f=void 0,(f=o.avail_in)>u&&(f=u),r=0===f?0:(o.avail_in-=f,Cn.arraySet(s,o.input,o.next_in,f,h),1===o.state.wrap?o.adler=Ci(o.adler,s,f,h):2===o.state.wrap&&(o.adler=Ti(o.adler,s,f,h)),o.next_in+=f,o.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=ia)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=ia&&(e.ins_h=(e.ins_h<=ia)if(n=Ai._tr_tally(e,e.strstart-e.match_start,e.match_length-ia),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ia){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=ia&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=ia-1)),e.prev_length>=ia&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-ia,n=Ai._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-ia),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(o=2,n-=16),i<1||i>Gi||r!==Vi||n<8||n>15||t<0||t>9||a<0||a>Hi)return _a(e,ji);8===n&&(n=9);var s=new function(){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=Vi,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 Cn.Buf16(2*ra),this.dyn_dtree=new Cn.Buf16(2*(2*ea+1)),this.bl_tree=new Cn.Buf16(2*(2*ta+1)),ka(this.dyn_ltree),ka(this.dyn_dtree),ka(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Cn.Buf16(na+1),this.heap=new Cn.Buf16(2*Qi+1),ka(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Cn.Buf16(2*Qi+1),ka(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};return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ra(e),0===e.lookahead&&t===Oi)return ma;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Sa(e,!1),0===e.strm.avail_out))return ma;if(e.strstart-e.block_start>=e.w_size-oa&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):(e.strstart>e.block_start&&(Sa(e,!1),e.strm.avail_out),ma)}),new Ba(4,4,8,4,za),new Ba(4,5,16,8,za),new Ba(4,6,32,32,za),new Ba(4,4,16,16,Ta),new Ba(8,16,32,32,Ta),new Ba(8,16,128,128,Ta),new Ba(8,32,128,256,Ta),new Ba(32,128,258,1024,Ta),new Ba(32,258,258,4096,Ta)];var Pa={deflateInit:function(e,t){return La(e,t,Vi,Ji,$i,Ki)},deflateInit2:La,deflateReset:Ia,deflateResetKeep:Oa,deflateSetHeader:function(e,t){return e&&e.state?2!==e.state.wrap?ji:(e.state.gzhead=t,Di):ji},deflate:function(e,t){var r,n,i,a;if(!e||!e.state||t>Ui||t<0)return e?_a(e,ji):ji;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===pa&&t!==Pi)return _a(e,0===e.avail_out?Ni:ji);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ha)if(2===n.wrap)e.adler=0,Ea(n,31),Ea(n,139),Ea(n,8),n.gzhead?(Ea(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ea(n,255&n.gzhead.time),Ea(n,n.gzhead.time>>8&255),Ea(n,n.gzhead.time>>16&255),Ea(n,n.gzhead.time>>24&255),Ea(n,9===n.level?2:n.strategy>=Yi||n.level<2?4:0),Ea(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ea(n,255&n.gzhead.extra.length),Ea(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ti(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ua):(Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,0),Ea(n,9===n.level?2:n.strategy>=Yi||n.level<2?4:0),Ea(n,wa),n.status=da);else{var o=Vi+(n.w_bits-8<<4)<<8;o|=(n.strategy>=Yi||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=sa),o+=31-o%31,n.status=da,Aa(n,o),0!==n.strstart&&(Aa(n,e.adler>>>16),Aa(n,65535&e.adler)),e.adler=1}if(n.status===ua)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending!==n.pending_buf_size));)Ea(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=fa)}else n.status=fa;if(n.status===fa)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=la)}else n.status=la;if(n.status===la)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),xa(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(e.adler=Ti(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=ca)}else n.status=ca;if(n.status===ca&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&xa(e),n.pending+2<=n.pending_buf_size&&(Ea(n,255&e.adler),Ea(n,e.adler>>8&255),e.adler=0,n.status=da)):n.status=da),0!==n.pending){if(xa(e),0===e.avail_out)return n.last_flush=-1,Di}else if(0===e.avail_in&&ba(t)<=ba(r)&&t!==Pi)return _a(e,Ni);if(n.status===pa&&0!==e.avail_in)return _a(e,Ni);if(0!==e.avail_in||0!==n.lookahead||t!==Oi&&n.status!==pa){var s=n.strategy===Yi?function(e,t){for(var r;;){if(0===e.lookahead&&(Ra(e),0===e.lookahead)){if(t===Oi)return ma;break}if(e.match_length=0,r=Ai._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):e.last_lit&&(Sa(e,!1),0===e.strm.avail_out)?ma:ga}(n,t):n.strategy===qi?function(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=aa){if(Ra(e),e.lookahead<=aa&&t===Oi)return ma;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=ia&&e.strstart>0&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){a=e.strstart+aa;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ia?(r=Ai._tr_tally(e,1,e.match_length-ia),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ai._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Sa(e,!1),0===e.strm.avail_out))return ma}return e.insert=0,t===Pi?(Sa(e,!0),0===e.strm.avail_out?va:ya):e.last_lit&&(Sa(e,!1),0===e.strm.avail_out)?ma:ga}(n,t):zi[n.level].func(n,t);if(s!==va&&s!==ya||(n.status=pa),s===ma||s===va)return 0===e.avail_out&&(n.last_flush=-1),Di;if(s===ga&&(t===Ii?Ai._tr_align(n):t!==Ui&&(Ai._tr_stored_block(n,0,0,!1),t===Li&&(ka(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),xa(e),0===e.avail_out))return n.last_flush=-1,Di}return t!==Pi?Di:n.wrap<=0?Mi:(2===n.wrap?(Ea(n,255&e.adler),Ea(n,e.adler>>8&255),Ea(n,e.adler>>16&255),Ea(n,e.adler>>24&255),Ea(n,255&e.total_in),Ea(n,e.total_in>>8&255),Ea(n,e.total_in>>16&255),Ea(n,e.total_in>>24&255)):(Aa(n,e.adler>>>16),Aa(n,65535&e.adler)),xa(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Di:Mi)},deflateEnd:function(e){var t;return e&&e.state?(t=e.state.status)!==ha&&t!==ua&&t!==fa&&t!==la&&t!==ca&&t!==da&&t!==pa?_a(e,ji):(e.state=null,t===da?_a(e,Fi):Di):ji},deflateSetDictionary:function(e,t){var r,n,i,a,o,s,h,u,f=t.length;if(!e||!e.state)return ji;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==ha||r.lookahead)return ji;for(1===a&&(e.adler=Ci(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===a&&(ka(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Cn.Buf8(r.w_size),Cn.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,Ra(r);r.lookahead>=ia;){n=r.strstart,i=r.lookahead-(ia-1);do{r.ins_h=(r.ins_h<=252?6:ja>=248?5:ja>=240?4:ja>=224?3:ja>=192?2:1;Ma[254]=Ma[254]=1;function Fa(e,t){if(t<65537&&(e.subarray&&Da||!e.subarray&&Ua))return String.fromCharCode.apply(null,Cn.shrinkBuf(e,t));for(var r="",n=0;n>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},buf2binstring:function(e){return Fa(e,e.length)},binstring2buf:function(e){for(var t=new Cn.Buf8(e.length),r=0,n=t.length;r4)s[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return Fa(s,n)},utf8border:function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+Ma[e[r]]>t?r:t}};var Za=function(){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},Wa=Object.prototype.toString,Ya=0,qa=-1,Ha=0,Ka=8;function Xa(e){if(!(this instanceof Xa))return new Xa(e);this.options=Cn.assign({level:qa,method:Ka,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ha,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Za,this.strm.avail_out=0;var r=Pa.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ya)throw new Error(Bi[r]);if(t.header&&Pa.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?Na.string2buf(t.dictionary):"[object ArrayBuffer]"===Wa.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=Pa.deflateSetDictionary(this.strm,n))!==Ya)throw new Error(Bi[r]);this._dict_set=!0}}function Va(e,t){var r=new Xa(t);if(r.push(e,!0),r.err)throw r.msg||Bi[r.err];return r.result}Xa.prototype.push=function(e,t){var r,n,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=Na.string2buf(e):"[object ArrayBuffer]"===Wa.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Cn.Buf8(a),i.next_out=0,i.avail_out=a),1!==(r=Pa.deflate(i,n))&&r!==Ya)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(Na.buf2binstring(Cn.shrinkBuf(i.output,i.next_out))):this.onData(Cn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=Pa.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ya):2!==n||(this.onEnd(Ya),i.avail_out=0,!0)},Xa.prototype.onData=function(e){this.chunks.push(e)},Xa.prototype.onEnd=function(e){e===Ya&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ga={Deflate:Xa,deflate:Va,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Va(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Va(e,t)}},Ja=function(e,t){var r,n,i,a,o,s,h,u,f,l,c,d,p,m,g,v,y,w,_,b,k,x,S,E,A;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),a=e.next_out,A=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),h=r.dmax,u=r.wsize,f=r.whave,l=r.wnext,c=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,v=(1<>>=_=w>>>24,p-=_,0===(_=w>>>16&255))A[a++]=65535&w;else{if(!(16&_)){if(0==(64&_)){w=m[(65535&w)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=65535&w,(_&=15)&&(p<_&&(d+=E[n++]<>>=_,p-=_),p<15&&(d+=E[n++]<>>=_=w>>>24,p-=_,!(16&(_=w>>>16&255))){if(0==(64&_)){w=g[(65535&w)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&w,p<(_&=15)&&(d+=E[n++]<h){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=_,p-=_,k>(_=a-o)){if((_=k-_)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,S=c,0===l){if(x+=u-_,_2;)A[a++]=S[x++],A[a++]=S[x++],A[a++]=S[x++],b-=3;b&&(A[a++]=S[x++],b>1&&(A[a++]=S[x++]))}else{x=a-k;do{A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],b-=3}while(b>2);b&&(A[a++]=A[x++],b>1&&(A[a++]=A[x++]))}break}}break}}while(n>3,d&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n=1&&0===T[b];b--);if(k>b&&(k=b),0===b)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(_=1;_0&&(0===e||1!==b))return-1;for(B[1]=0,y=1;y<15;y++)B[y+1]=B[y]+T[y];for(w=0;w852||2===e&&A>592)return 1;for(;;){p=y-S,o[w]d?(m=O[I+o[w]],g=R[z+o[w]]):(m=96,g=0),h=1<>S)+(u-=h)]=p<<24|m<<16|g|0}while(0!==u);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,w++,0==--T[y]){if(y===b)break;y=t[r+o[w]]}if(y>k&&(C&l)!==f){for(0===S&&(S=k),c+=_,E=1<<(x=y-S);x+S852||2===e&&A>592)return 1;i[f=C&l]=k<<24|x<<16|c-a|0}}return 0!==C&&(i[c+C]=y-S<<24|64<<16|0),s.bits=k,0},no=0,io=1,ao=2,oo=4,so=5,ho=6,uo=0,fo=1,lo=2,co=-2,po=-3,mo=-4,go=-5,vo=8,yo=1,wo=2,_o=3,bo=4,ko=5,xo=6,So=7,Eo=8,Ao=9,Co=10,Ro=11,zo=12,To=13,Bo=14,Oo=15,Io=16,Lo=17,Po=18,Uo=19,Do=20,Mo=21,jo=22,Fo=23,No=24,Zo=25,Wo=26,Yo=27,qo=28,Ho=29,Ko=30,Xo=31,Vo=32,Go=852,Jo=592,$o=15;function Qo(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function es(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=yo,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Cn.Buf32(Go),t.distcode=t.distdyn=new Cn.Buf32(Jo),t.sane=1,t.back=-1,uo):co}function ts(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,es(e)):co}function rs(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?co:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ts(e))):co}function ns(e,t){var r,n;return e?(n=new function(){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 Cn.Buf16(320),this.work=new Cn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},e.state=n,n.window=null,(r=rs(e,t))!==uo&&(e.state=null),r):co}var is,as,os=!0;function ss(e){if(os){var t;for(is=new Cn.Buf32(512),as=new Cn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ro(io,e.lens,0,288,is,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ro(ao,e.lens,0,32,as,0,e.work,{bits:5}),os=!1}e.lencode=is,e.lenbits=9,e.distcode=as,e.distbits=5}function hs(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(Cn.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),Cn.arraySet(a.window,t,r-n,i,a.wnext),(n-=i)?(Cn.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=Ti(r.check,C,2,0),u=0,f=0,r.mode=wo;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=Ko;break}if((15&u)!==vo){e.msg="unknown compression method",r.mode=Ko;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=Ko;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=_o;case _o:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=Ti(r.check,C,4,0)),u=0,f=0,r.mode=bo;case bo:for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=ko;case ko:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=xo;case xo:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Cn.arraySet(r.head.extra,n,a,d,k)),512&r.flags&&(r.check=Ti(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=So;case So:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[a+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=zo;break;case Co:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>=7&f,f-=7&f,r.mode=Yo;break}for(;f<3;){if(0===s)break e;s--,u+=n[a++]<>>=1)){case 0:r.mode=Bo;break;case 1:if(ss(r),r.mode=Do,t===ho){u>>>=2,f-=2;break e}break;case 2:r.mode=Lo;break;case 3:e.msg="invalid block type",r.mode=Ko}u>>>=2,f-=2;break;case Bo:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=n[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ko;break}if(r.length=65535&u,u=0,f=0,r.mode=Oo,t===ho)break e;case Oo:r.mode=Io;case Io:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;Cn.arraySet(i,n,a,d,o),s-=d,a+=d,h-=d,o+=d,r.length-=d;break}r.mode=zo;break;case Lo:for(;f<14;){if(0===s)break e;s--,u+=n[a++]<>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ko;break}r.have=0,r.mode=Po;case Po:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=ro(no,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=Ko;break}r.have=0,r.mode=Uo;case Uo:for(;r.have>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=g,f-=g,r.lens[r.have++]=y;else{if(16===y){for(E=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Ko;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,f-=2}else if(17===y){for(E=g+3;f>>=g)),u>>>=3,f-=3}else{for(E=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ko;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===Ko)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Ko;break}if(r.lenbits=9,S={bits:r.lenbits},x=ro(io,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=Ko;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=ro(ao,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=Ko;break}if(r.mode=Do,t===ho)break e;case Do:r.mode=Mo;case Mo:if(s>=6&&h>=258){e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,Ja(e,c),o=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,u=r.hold,f=r.bits,r.mode===zo&&(r.back=-1);break}for(r.back=0;v=(A=r.lencode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,r.length=y,0===v){r.mode=Wo;break}if(32&v){r.back=-1,r.mode=zo;break}if(64&v){e.msg="invalid literal/length code",r.mode=Ko;break}r.extra=15&v,r.mode=jo;case jo:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Fo;case Fo:for(;v=(A=r.distcode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=Ko;break}r.offset=y,r.extra=15&v,r.mode=No;case No:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ko;break}r.mode=Zo;case Zo:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ko;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=Mo);break;case Wo:if(0===h)break e;i[o++]=r.length,h--,r.mode=Mo;break;case Yo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,u|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Za,this.strm.avail_out=0;var r=us.inflateInit2(this.strm,t.windowBits);if(r!==fs.Z_OK)throw new Error(Bi[r]);this.header=new ls,us.inflateGetHeader(this.strm,this.header)}function ps(e,t){var r=new ds(t);if(r.push(e,!0),r.err)throw r.msg||Bi[r.err];return r.result}ds.prototype.push=function(e,t){var r,n,i,a,o,s,h=this.strm,u=this.options.chunkSize,f=this.options.dictionary,l=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?fs.Z_FINISH:fs.Z_NO_FLUSH,"string"==typeof e?h.input=Na.binstring2buf(e):"[object ArrayBuffer]"===cs.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new Cn.Buf8(u),h.next_out=0,h.avail_out=u),(r=us.inflate(h,fs.Z_NO_FLUSH))===fs.Z_NEED_DICT&&f&&(s="string"==typeof f?Na.string2buf(f):"[object ArrayBuffer]"===cs.call(f)?new Uint8Array(f):f,r=us.inflateSetDictionary(this.strm,s)),r===fs.Z_BUF_ERROR&&!0===l&&(r=fs.Z_OK,l=!1),r!==fs.Z_STREAM_END&&r!==fs.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==fs.Z_STREAM_END&&(0!==h.avail_in||n!==fs.Z_FINISH&&n!==fs.Z_SYNC_FLUSH)||("string"===this.options.to?(i=Na.utf8border(h.output,h.next_out),a=h.next_out-i,o=Na.buf2string(h.output,i),h.next_out=a,h.avail_out=u-a,a&&Cn.arraySet(h.output,h.output,i,a,0),this.onData(o)):this.onData(Cn.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(l=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==fs.Z_STREAM_END);return r===fs.Z_STREAM_END&&(n=fs.Z_FINISH),n===fs.Z_FINISH?(r=us.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===fs.Z_OK):n!==fs.Z_SYNC_FLUSH||(this.onEnd(fs.Z_OK),h.avail_out=0,!0)},ds.prototype.onData=function(e){this.chunks.push(e)},ds.prototype.onEnd=function(e){e===fs.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ms={Inflate:ds,inflate:ps,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ps(e,t)},ungzip:ps},gs={};(0,Cn.assign)(gs,Ga,ms,fs);var vs=gs,ys="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function ws(e,t){Qr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Jr.inherits(ws,Qr),ws.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Jr.transformTo(ys,e.data),!1)},ws.prototype.flush=function(){Qr.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},ws.prototype.cleanUp=function(){Qr.prototype.cleanUp.call(this),this._pako=null},ws.prototype._createPako=function(){this._pako=new vs[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var _s={STORE:{magic:"\0\0",compressWorker:function(e){return new Qr("STORE compression")},uncompressWorker:function(){return new Qr("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new ws("Deflate",e)},uncompressWorker:function(){return new ws("Inflate",{})}}},bs="PK",ks="PK",xs="PK",Ss="PK",Es="PK",As="PK\b",Cs=function(e,t){var r,n="";for(r=0;r>>=8;return n},Rs=function(e,t,r,n,i,a){var o,s,h=e.file,u=e.compression,f=a!==en.utf8encode,l=Jr.transformTo("string",a(h.name)),c=Jr.transformTo("string",en.utf8encode(h.name)),d=h.comment,p=Jr.transformTo("string",a(d)),m=Jr.transformTo("string",en.utf8encode(d)),g=c.length!==h.name.length,v=m.length!==d.length,y="",w="",_="",b=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),f||!g&&!v||(S|=2048);var E,A,C=0,R=0;b&&(C|=16),"UNIX"===i?(R=798,C|=(E=h.unixPermissions,A=E,E||(A=b?16893:33204),(65535&A)<<16)):(R=20,C|=63&(h.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,s=k.getUTCFullYear()-1980,s<<=4,s|=k.getUTCMonth()+1,s<<=5,s|=k.getUTCDate(),g&&(w=Cs(1,1)+Cs(vn(l),4)+c,y+="up"+Cs(w.length,2)+w),v&&(_=Cs(1,1)+Cs(vn(p),4)+m,y+="uc"+Cs(_.length,2)+_);var z="";return z+="\n\0",z+=Cs(S,2),z+=u.magic,z+=Cs(o,2),z+=Cs(s,2),z+=Cs(x.crc32,4),z+=Cs(x.compressedSize,4),z+=Cs(x.uncompressedSize,4),z+=Cs(l.length,2),z+=Cs(y.length,2),{fileRecord:bs+z+l+y,dirRecord:ks+Cs(R,2)+z+Cs(p.length,2)+"\0\0\0\0"+Cs(C,4)+Cs(n,4)+l+y+p}};function zs(e,t,r,n){Qr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Jr.inherits(zs,Qr),zs.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Qr.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},zs.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Rs(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zs.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Rs(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return As+Cs(e.crc32,4)+Cs(e.compressedSize,4)+Cs(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},zs.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},Us=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},Ds=function(e,t){return t=void 0!==t?t:ln.createFolders,e=Us(e),this.files[e]||Ls.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Ms(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var js={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n))},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1===arguments.length){if(Ms(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,Ls.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(Ms(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=Ds.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return Jr.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var Ns=Fs;function Zs(e){Ns.call(this,e);for(var t=0;t=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},Zs.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},Zs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ws=Zs;function Ys(e){Ns.call(this,e)}Jr.inherits(Ys,Ns),Ys.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Ys.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Ys.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Ys.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var qs=Ys;function Hs(e){Ws.call(this,e)}Jr.inherits(Hs,Ws),Hs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ks=Hs;function Xs(e){Ks.call(this,e)}Jr.inherits(Xs,Ks),Xs.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Vs=Xs,Gs=function(e){var t=Jr.getTypeOf(e);return Jr.checkSupport(t),"string"!==t||Zt.uint8array?"nodebuffer"===t?new Vs(e):Zt.uint8array?new Ks(Jr.transformTo("uint8array",e)):new Ws(Jr.transformTo("array",e)):new qs(e)};function Js(e,t){this.options=e,this.loadOptions=t}Js.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in _s)if(_s.hasOwnProperty(t)&&_s[t].magic===e)return _s[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+Jr.pretty(this.compressionMethod)+" unknown (inner file : "+Jr.transformTo("string",this.fileName)+")");this.decompressed=new bn(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=Gs(this.extraFields[1].value);this.uncompressedSize===Jr.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===Jr.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===Jr.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===Jr.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,ks)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=Gs(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var eh=Qs;function th(e){return new Gr.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new wn);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}function rh(){if(!(this instanceof rh))return new rh;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new rh;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}rh.prototype=js,rh.prototype.loadAsync=function(e,t){var r=this;return t=Jr.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:en.utf8decode}),qt&&Vt(e)?Gr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Jr.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new eh(t);return r.load(e),r}).then(function(e){var r=[Gr.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t&&t.global===t?t:void 0,o=a.saveAs||"object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,o){var s=a.URL||a.webkitURL,h=document.createElement("a");t=t||e.name||"download",h.download=t,h.rel="noopener","string"==typeof e?(h.href=e,h.origin===location.origin?i(h):n(h.href)?r(e,t,o):i(h,h.target="_blank")):(h.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(h.href)},4e4),setTimeout(function(){i(h)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,a){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Depricated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),t);else if(n(e))r(e,t,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){i(o)})}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var o="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||o&&s)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=h?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var f=a.URL||a.webkitURL,l=f.createObjectURL(e);i?i.location=l:location.href=l,i=null,setTimeout(function(){f.revokeObjectURL(l)},4e4)}};a.saveAs=o.saveAs=o,e.exports=o})()}),ah=["string","number"],oh=function(e){return e.filename?"string"!=typeof e.filename?(console.error("Zipclex filename can only be of type string"),!1):Array.isArray(e.sheet.data)?!!e.sheet.data.every(function(e){return Array.isArray(e)})||(console.error("Zipclex sheet data childs is not of type array"),!1):(console.error("Zipcelx sheet data is not of type array"),!1):(console.error("Zipclex config missing property filename"),!1)},sh=1/0,hh="[object Symbol]",uh=/[&<>"'`]/g,fh=RegExp(uh.source),lh="object"==typeof t&&t&&t.Object===Object&&t,ch="object"==typeof self&&self&&self.Object===Object&&self,dh=lh||ch||Function("return this")();var ph=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),mh=Object.prototype.toString,gh=dh.Symbol,vh=gh?gh.prototype:void 0,yh=vh?vh.toString:void 0;function wh(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&mh.call(e)==hh}(e))return yh?yh.call(e):"";var t=e+"";return"0"==t&&1/e==-sh?"-0":t}var _h=function(e){var t;return(e=null==(t=e)?"":wh(t))&&fh.test(e)?e.replace(uh,ph):e},bh=function(e,t){return""+function e(t){if("number"!=typeof t)return"";var r=Math.floor(t/26),n=String.fromCharCode(97+t%26).toUpperCase();return 0===r?n:e(r-1)+n}(e)+t},kh=function(e,t,r){return-1===ah.indexOf(e.type)&&(console.warn('Invalid type supplied in cell config, falling back to "string"'),e.type="string"),"string"===e.type?function(e,t,r){return''+_h(t)+""}(t,e.value,r):function(e,t,r){return''+t+""}(t,e.value,r)},xh=function(e){return e.map(function(e,t){return function(e,t){var r=t+1,n=e.map(function(e,t){return kh(e,t,r)}).join("");return''+n+""}(e,t)}).join("")};e.zipcelx=function(e){if(!oh(e))throw new Error("Validation failed.");var t=new nh,r=t.folder("xl");r.file("workbook.xml",'\n'),r.file("_rels/workbook.xml.rels",'\n\n\n'),t.file("_rels/.rels",'\n'),t.file("[Content_Types].xml",'\n\n\n\n\n\n');var n,i,a=(n=e.sheet.data,i=xh(n),'\n{placeholder}'.replace("{placeholder}",i));return r.file("worksheets/sheet1.xml",a),t.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(function(t){ih.saveAs(t,e.filename+".xlsx")})}}); diff --git a/package.json b/package.json index e48e74e..b61e36d 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "jest": "^22.4.2", "rimraf": "^2.6.2", "rollup": "^0.56.4", + "rollup-plugin-babel": "^3.0.7", "rollup-plugin-commonjs": "^8.4.0", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.1.0", diff --git a/rollup.config.js b/rollup.config.js index ae94168..4c7f959 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,3 +1,4 @@ +import babel from 'rollup-plugin-babel'; import commonjs from 'rollup-plugin-commonjs'; import builtins from 'rollup-plugin-node-builtins'; import globals from 'rollup-plugin-node-globals'; @@ -5,6 +6,14 @@ import resolve from 'rollup-plugin-node-resolve'; import uglify from 'rollup-plugin-uglify'; import pkg from './package.json'; +function instantiateBabelPlugin() { + return babel({ + babelrc: false, + exclude: 'node_modules/**', + presets: [['env', { modules: false }]] + }); +} + export default [ // browser-friendly UMD build { @@ -27,6 +36,7 @@ export default [ }), globals(), builtins(), + instantiateBabelPlugin(), uglify() ] }, @@ -44,6 +54,7 @@ export default [ { file: pkg.main, format: 'cjs' } ], plugins: [ + instantiateBabelPlugin(), uglify() ] }, @@ -52,6 +63,9 @@ export default [ external: Object.keys(pkg.dependencies), output: [ { file: pkg.module, format: 'es' } + ], + plugins: [ + instantiateBabelPlugin() ] } ]; diff --git a/yarn.lock b/yarn.lock index 500bfad..cd29d87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4126,6 +4126,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" +rollup-plugin-babel@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.7.tgz#5b13611f1ab8922497e9d15197ae5d8a23fe3b1e" + integrity sha512-bVe2y0z/V5Ax1qU8NX/0idmzIwJPdUGu8Xx3vXH73h0yGjxfv2gkFI82MBVg49SlsFlLTBadBHb67zy4TWM3hA== + dependencies: + rollup-pluginutils "^1.5.0" + rollup-plugin-commonjs@^8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.0.tgz#07c3b5a7555171a58cf3b376b812013de8a631e4" @@ -4169,7 +4176,7 @@ rollup-plugin-uglify@^3.0.0: dependencies: uglify-es "^3.3.7" -rollup-pluginutils@^1.5.2: +rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" dependencies: