UNPKG

sheet-api

Version:

Get google spreadSheet data as API

6 lines 454 kB
(function(){function s(l,e,r){function t(o,i){if(!e[o]){if(!l[o]){var d="function"==typeof require&&require;if(!i&&d)return d(o,!0);if(n)return n(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var a=e[o]={exports:{}};l[o][0].call(a.exports,function(e){var r=l[o][1][e];return t(r||e)},a,a.exports,s,l,e,r)}return e[o].exports}for(var n="function"==typeof require&&require,a=0;a<r.length;a++)t(r[a]);return t}return s})()({1:[function(e,t,r){"use strict";function n(e){if(!e)throw new Error("Provide valid url");return _.default.request({url:e,method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",Host:"docs.google.com"}}).then(function(e){return e.data})}function a(e){var t="";for(var r in e)""!=t&&(t+="&"),t+=r+"="+encodeURIComponent(e[r]);return t}function o(e,t,r,n){if(void 0===n&&(n=69),!e)throw new Error("Provide valid docId");var o="https://docs.google.com/spreadsheets/d/"+e+"/streamrows?id="+e+"&smv="+n,s={chunks:JSON.stringify(t),snapshotAt:r,firstChunkHighWatermark:0,cutoffBytesReturned:5242880,cutoffRowsReturned:-1};return _.default.request({url:o,method:"POST",data:a(s),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){return e.data})}function s(e){for(var t=u.load(e),r=t("script[type=\"text/javascript\"]"),n=[],a=0,o=!0;r&&o;){var s=r[a+""];s?(s.children&&0<s.children.length&&s.children[0].data&&n.push(s.children[0].data),a++):o=!1}return 0<n.length?n[n.length-1]:""}function i(e,t){var r=new RegExp("var "+t+" = ([^;]+);","gm"),n=r.exec(e);return n&&0<n.length?n[1]:null}var l=this&&this.__assign||function(){return l=Object.assign||function(e){for(var t=1,r=arguments.length,n;t<r;t++)for(var a in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},l.apply(this,arguments)},p=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(t){o(t)}}function i(e){try{l(n["throw"](e))}catch(t){o(t)}}function l(e){e.done?r(e.value):a(e.value).then(s,i)}l((n=n.apply(e,t||[])).next())})},d=this&&this.__generator||function(e,r){function n(e){return function(t){return a([e,t])}}function a(t){if(s)throw new TypeError("Generator is already executing.");for(;o;)try{if(s=1,i&&(l=2&t[0]?i["return"]:t[0]?i["throw"]||((l=i["return"])&&l.call(i),0):i.next)&&!(l=l.call(i,t[1])).done)return l;switch((i=0,l)&&(t=[2&t[0],l.value]),t[0]){case 0:case 1:l=t;break;case 4:return o.label++,{value:t[1],done:!1};case 5:o.label++,i=t[1],t=[0];continue;case 7:t=o.ops.pop(),o.trys.pop();continue;default:if((l=o.trys,!(l=0<l.length&&l[l.length-1]))&&(6===t[0]||2===t[0])){o=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3])){o.label=t[1];break}if(6===t[0]&&o.label<l[1]){o.label=l[1],l=t;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(t);break}l[2]&&o.ops.pop(),o.trys.pop();continue;}t=r.call(e,o)}catch(r){t=[6,r],i=0}finally{s=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}var o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},s,i,l,p;return p={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p},c=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var o=Array(e),r=0,t=0;t<n;t++)for(var l=arguments[t],a=0,p=l.length;a<p;a++,r++)o[r]=l[a];return o};Object.defineProperty(r,"__esModule",{value:!0});var _=e("axios"),u=e("cheerio"),m=function(){function e(e,t){this.data=this._parseSnapshot(e,t)}return e.prototype._parseSnapshot=function(e,t){for(var r=null,n=0,a=0,o=[],s=0,l=e,d;s<l.length;s++)if(d=l[s],d[0]&&d[1]&&d[1][d[1].length-1]){var c=d[1][d[1].length-1],_=[];if(c&&Array.isArray(c)){n=d[1][1][5],a=d[1][1][3];for(var u=0,m=0,T=[],E=0;E<c.length;E++){var g=c[E],h=void 0;if("object"==typeof g&&0<Object.keys(g).length&&o.push(g),!Array.isArray(g))g[25]&&(g=o[g[25]]),h=void 0!==g[3]&&Array.isArray(g[3])?g[3][2]:void 0===g[3]||Array.isArray(g[3])?t:1===g[3][4],T.push(h),u++,u>=n&&(m++,_.push(T),T=[],u=0);else{if(0===_.length)for(var f=0;f<a;f++)_.push(Array(n).fill(t));g[3][25]&&(g[3][3]=o[parseInt(g[3][25])][3][3]),h=void 0!==g[3][3]&&Array.isArray(g[3][3])?g[3][3][2]:void 0===g[3][3]||Array.isArray(g[3][3])?t:1===g[3][3][4],_[g[1]][g[2]]=h}}r=_}}return{range:{rows:a,cols:n},values:r}},e}(),T=function(){function e(e){this.baseUrl=e,this.metadata={},this.views=[]}return e.prototype.fetchData=function(){return p(this,void 0,void 0,function(){var t=this,r,a;return d(this,function(e){switch(e.label){case 0:return[4,n(this.baseUrl)];case 1:r=e.sent();try{this._parseSheetConfig(r)}catch(t){throw new Error("Not able to fetch data for provided link")}return a=[],this.views.forEach(function(r){a.push(t._fetchSheetDataOneByOne(t.metadata.cosmoId,t.metadata.revision,r))}),[4,Promise.all(a)];case 2:return e.sent(),[2,{docName:this.metadata.docName,version:this.metadata.revision,sheets:this.views.map(function(t){return l(l({},t.data),{name:t.name})})}];}})})},e.prototype._parseSheetConfig=function(e){var t=s(e),r=JSON.parse(i(t,"mergedConfig"));if(!r)throw new Error("Not able to config data");this.metadata.cosmoId=r.appConfig.cosmoId,this.metadata.docName=r.appConfig.docName,this.metadata.editable=r.appConfig.editable,this.metadata.pathPrefix=r.appConfig.pathPrefix;var n=JSON.parse(i(t,"bootstrapData"));this.metadata.revision=n.changes.revision,this.metadata.modelVersion=n.changes.modelVersion,this.metadata.firstchunklength=n.changes.firstchunklength,this.metadata.topsnapshotlength=n.changes.topsnapshotlength,this.views=this._extractSheetsInfo(n)},e.prototype._extractSheetsInfo=function(e){if(!e||!e.changes||!e.changes.topsnapshot)return[];for(var t=[],r={},n=0,a=e.changes.topsnapshot,o;n<a.length;n++)o=a[n],r[o[0]]||(r[o[0]]=[]),r[o[0]].push(JSON.parse(o[1]));for(var s=0,i=r[Object.keys(r)[0]];s<i.length;s++){var l=i[s],p={};p.order=l[0],p.gid=l[2],p.name=l[3][0][1][0][2],p.rows_limit=l[4],p.cols_limit=l[5],t.push(p)}return t},e.prototype._fetchSheetDataOneByOne=function(t,r,n){var e=this;return o(t,[n.gid],r).then(function(t){n.data=e._parseSheetDataRowWise(e._correctData(t))})},e.prototype._correctData=function(e){return e=e.replace(/}[0-9]+&{/gm,"},{"),e=e.replace(/\)]}'\n0&[0-9]+&/gm,"["),e+"]"},e.prototype._parseSheetDataRowWise=function(e,t){void 0===t&&(t=null);var r;try{r=JSON.parse(e)}catch(t){throw new Error("Not able to parse provided data")}for(var n={},a=0,o=r,s;a<o.length;a++)s=o[a],n[s.gridRange[1]]=c(n[s.gridRange[1]]||[],s.snapshot);return new m(n[Object.keys(n)[0]],t).data},e}();r.SheetAPI=T,"undefined"!=typeof window&&(window.SheetAPI=T)},{axios:2,cheerio:32}],2:[function(e,t){t.exports=e("./lib/axios")},{"./lib/axios":4}],3:[function(e,t){'use strict';var r=e("./../utils"),n=e("./../core/settle"),a=e("./../helpers/buildURL"),o=e("../core/buildFullPath"),s=e("./../helpers/parseHeaders"),i=e("./../helpers/isURLSameOrigin"),l=e("../core/createError");t.exports=function(t){return new Promise(function(p,d){var c=t.data,_=t.headers;r.isFormData(c)&&delete _["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var m=t.auth.username||"",T=t.auth.password||"";_.Authorization="Basic "+btoa(m+":"+T)}var E=o(t.baseURL,t.url);if(u.open(t.method.toUpperCase(),a(E,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,u.onreadystatechange=function(){if(u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))){var e="getAllResponseHeaders"in u?s(u.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?u.response:u.responseText,a={data:r,status:u.status,statusText:u.statusText,headers:e,config:t,request:u};n(p,d,a),u=null}},u.onabort=function(){u&&(d(l("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){d(l("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),d(l(e,t,"ECONNABORTED",u)),u=null},r.isStandardBrowserEnv()){var g=e("./../helpers/cookies"),h=(t.withCredentials||i(E))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;h&&(_[t.xsrfHeaderName]=h)}if("setRequestHeader"in u&&r.forEach(_,function(e,t){"undefined"==typeof c&&"content-type"===t.toLowerCase()?delete _[t]:u.setRequestHeader(t,e)}),r.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),t.responseType)try{u.responseType=t.responseType}catch(r){if("json"!==t.responseType)throw r}"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(e){u&&(u.abort(),d(e),u=null)}),void 0===c&&(c=null),u.send(c)})}},{"../core/buildFullPath":10,"../core/createError":11,"./../core/settle":15,"./../helpers/buildURL":19,"./../helpers/cookies":21,"./../helpers/isURLSameOrigin":23,"./../helpers/parseHeaders":25,"./../utils":27}],4:[function(e,t){'use strict';function r(e){var t=new o(e),r=a(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var n=e("./utils"),a=e("./helpers/bind"),o=e("./core/Axios"),s=e("./core/mergeConfig"),i=e("./defaults"),l=r(i);l.Axios=o,l.create=function(e){return r(s(l.defaults,e))},l.Cancel=e("./cancel/Cancel"),l.CancelToken=e("./cancel/CancelToken"),l.isCancel=e("./cancel/isCancel"),l.all=function(e){return Promise.all(e)},l.spread=e("./helpers/spread"),t.exports=l,t.exports.default=l},{"./cancel/Cancel":5,"./cancel/CancelToken":6,"./cancel/isCancel":7,"./core/Axios":8,"./core/mergeConfig":14,"./defaults":17,"./helpers/bind":18,"./helpers/spread":26,"./utils":27}],5:[function(e,t){'use strict';function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},{}],6:[function(e,t){'use strict';function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}var n=e("./Cancel");r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e=new r(function(e){t=e}),t;return{token:e,cancel:t}},t.exports=r},{"./Cancel":5}],7:[function(e,t){'use strict';t.exports=function(e){return!!(e&&e.__CANCEL__)}},{}],8:[function(e,t){'use strict';function r(e){this.defaults=e,this.interceptors={request:new o,response:new o}}var n=e("./../utils"),a=e("../helpers/buildURL"),o=e("./InterceptorManager"),s=e("./dispatchRequest"),i=e("./mergeConfig");r.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=i(this.defaults,e),e.method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},r.prototype.getUri=function(e){return e=i(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}}),n.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,r,a){return this.request(n.merge(a||{},{method:e,url:t,data:r}))}}),t.exports=r},{"../helpers/buildURL":19,"./../utils":27,"./InterceptorManager":9,"./dispatchRequest":12,"./mergeConfig":14}],9:[function(e,t){'use strict';function r(){this.handlers=[]}var n=e("./../utils");r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},t.exports=r},{"./../utils":27}],10:[function(e,t){'use strict';var r=e("../helpers/isAbsoluteURL"),n=e("../helpers/combineURLs");t.exports=function(e,t){return e&&!r(t)?n(e,t):t}},{"../helpers/combineURLs":20,"../helpers/isAbsoluteURL":22}],11:[function(e,t){'use strict';var r=e("./enhanceError");t.exports=function(e,t,n,a,o){var s=new Error(e);return r(s,t,n,a,o)}},{"./enhanceError":13}],12:[function(e,t){'use strict';function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var n=e("./../utils"),a=e("./transformData"),o=e("../cancel/isCancel"),s=e("../defaults");t.exports=function(e){r(e),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||s.adapter;return t(e).then(function(t){return r(e),t.data=a(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(r(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},{"../cancel/isCancel":7,"../defaults":17,"./../utils":27,"./transformData":16}],13:[function(e,t){'use strict';t.exports=function(e,t,r,n,a){return e.config=t,r&&(e.code=r),e.request=n,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},{}],14:[function(e,t){'use strict';var r=e("../utils");t.exports=function(e,t){t=t||{};var n={},a=["url","method","params","data"],o=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(a,function(e){"undefined"!=typeof t[e]&&(n[e]=t[e])}),r.forEach(o,function(a){r.isObject(t[a])?n[a]=r.deepMerge(e[a],t[a]):"undefined"==typeof t[a]?r.isObject(e[a])?n[a]=r.deepMerge(e[a]):"undefined"!=typeof e[a]&&(n[a]=e[a]):n[a]=t[a]}),r.forEach(s,function(r){"undefined"==typeof t[r]?"undefined"!=typeof e[r]&&(n[r]=e[r]):n[r]=t[r]});var i=a.concat(o).concat(s),l=Object.keys(t).filter(function(e){return-1===i.indexOf(e)});return r.forEach(l,function(r){"undefined"==typeof t[r]?"undefined"!=typeof e[r]&&(n[r]=e[r]):n[r]=t[r]}),n}},{"../utils":27}],15:[function(e,t){'use strict';var r=e("./createError");t.exports=function(e,t,n){var a=n.config.validateStatus;!a||a(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},{"./createError":11}],16:[function(e,t){'use strict';var r=e("./../utils");t.exports=function(e,t,n){return r.forEach(n,function(r){e=r(e,t)}),e}},{"./../utils":27}],17:[function(e,t){(function(r){'use strict';function n(e,t){!a.isUndefined(e)&&a.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a=e("./utils"),o=e("./helpers/normalizeHeaderName"),s={"Content-Type":"application/x-www-form-urlencoded"},i={adapter:function(){var t;return"undefined"==typeof XMLHttpRequest?"undefined"!=typeof r&&"[object process]"===Object.prototype.toString.call(r)&&(t=e("./adapters/http")):t=e("./adapters/xhr"),t}(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),a.isFormData(e)||a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)?e:a.isArrayBufferView(e)?e.buffer:a.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):a.isObject(e)?(n(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return 200<=e&&300>e}};i.headers={common:{Accept:"application/json, text/plain, */*"}},a.forEach(["delete","get","head"],function(e){i.headers[e]={}}),a.forEach(["post","put","patch"],function(e){i.headers[e]=a.merge(s)}),t.exports=i}).call(this,e("_process"))},{"./adapters/http":3,"./adapters/xhr":3,"./helpers/normalizeHeaderName":24,"./utils":27,_process:331}],18:[function(e,t){'use strict';t.exports=function(e,t){return function(){for(var r=Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},{}],19:[function(e,t){'use strict';function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var n=e("./../utils");t.exports=function(e,t,a){if(!t)return e;var o;if(a)o=a(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,function(e,t){null===e||"undefined"==typeof e||(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),o=s.join("&")}if(o){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},{"./../utils":27}],20:[function(e,t){'use strict';t.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},{}],21:[function(e,t){'use strict';var r=e("./../utils");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,a,o,s){var i=[];i.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),r.isString(a)&&i.push("path="+a),r.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},{"./../utils":27}],22:[function(e,t){'use strict';t.exports=function(e){return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},{}],23:[function(e,t){'use strict';var r=e("./../utils");t.exports=r.isStandardBrowserEnv()?function(){function e(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}var t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),a;return a=e(window.location.href),function(t){var n=r.isString(t)?e(t):t;return n.protocol===a.protocol&&n.host===a.host}}():function(){return function(){return!0}}()},{"./../utils":27}],24:[function(e,t){'use strict';var r=e("../utils");t.exports=function(e,t){r.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},{"../utils":27}],25:[function(e,t){'use strict';var r=e("./../utils"),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(e){var t={},a,o,s;return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),a=r.trim(e.substr(0,s)).toLowerCase(),o=r.trim(e.substr(s+1)),a){if(t[a]&&0<=n.indexOf(a))return;t[a]="set-cookie"===a?(t[a]?t[a]:[]).concat([o]):t[a]?t[a]+", "+o:o}}),t):t}},{"./../utils":27}],26:[function(e,t){'use strict';t.exports=function(e){return function(t){return e.apply(null,t)}}},{}],27:[function(e,t){'use strict';function r(e){return"[object Array]"===d.call(e)}function n(e){return"undefined"==typeof e}function a(e){return null!==e&&"object"==typeof e}function o(e){return"[object Function]"===d.call(e)}function s(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}function i(){function e(e,r){t[r]="object"==typeof t[r]&&"object"==typeof e?i(t[r],e):e}for(var t={},r=0,n=arguments.length;r<n;r++)s(arguments[r],e);return t}function l(){function e(e,r){t[r]="object"==typeof t[r]&&"object"==typeof e?l(t[r],e):"object"==typeof e?l({},e):e}for(var t={},r=0,n=arguments.length;r<n;r++)s(arguments[r],e);return t}var p=e("./helpers/bind"),d=Object.prototype.toString;t.exports={isArray:r,isArrayBuffer:function(e){return"[object ArrayBuffer]"===d.call(e)},isBuffer:function(e){return null!==e&&!n(e)&&null!==e.constructor&&!n(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:n,isDate:function(e){return"[object Date]"===d.call(e)},isFile:function(e){return"[object File]"===d.call(e)},isBlob:function(e){return"[object Blob]"===d.call(e)},isFunction:o,isStream:function(e){return a(e)&&o(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:s,merge:i,deepMerge:l,extend:function(e,t,r){return s(t,function(t,n){e[n]=r&&"function"==typeof t?p(t,r):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},{"./helpers/bind":18}],28:[function(e,t,r){'use strict';function n(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function a(e,t,r){return 3*(t+r)/4-r}function o(e){var t=n(e),r=t[0],o=t[1],s=new _(a(e,r,o)),l=0,p=0<o?r-4:r,d,u;for(u=0;u<p;u+=4)d=c[e.charCodeAt(u)]<<18|c[e.charCodeAt(u+1)]<<12|c[e.charCodeAt(u+2)]<<6|c[e.charCodeAt(u+3)],s[l++]=255&d>>16,s[l++]=255&d>>8,s[l++]=255&d;return 2===o&&(d=c[e.charCodeAt(u)]<<2|c[e.charCodeAt(u+1)]>>4,s[l++]=255&d),1===o&&(d=c[e.charCodeAt(u)]<<10|c[e.charCodeAt(u+1)]<<4|c[e.charCodeAt(u+2)]>>2,s[l++]=255&d>>8,s[l++]=255&d),s}function s(e){return d[63&e>>18]+d[63&e>>12]+d[63&e>>6]+d[63&e]}function l(e,t,r){for(var n=[],a=t,o;a<r;a+=3)o=(16711680&e[a]<<16)+(65280&e[a+1]<<8)+(255&e[a+2]),n.push(s(o));return n.join("")}function p(e){for(var t=e.length,r=t%3,n=[],a=16383,o=0,s=t-r,p;o<s;o+=a)n.push(l(e,o,o+a>s?s:o+a));return 1===r?(p=e[t-1],n.push(d[p>>2]+d[63&p<<4]+"==")):2===r&&(p=(e[t-2]<<8)+e[t-1],n.push(d[p>>10]+d[63&p>>4]+d[63&p<<2]+"=")),n.join("")}r.byteLength=function(e){var t=n(e),r=t[0],a=t[1];return 3*(r+a)/4-a},r.toByteArray=o,r.fromByteArray=p;for(var d=[],c=[],_="undefined"==typeof Uint8Array?Array:Uint8Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,T=u.length;m<T;++m)d[m]=u[m],c[u.charCodeAt(m)]=m;c[45]=62,c[95]=63},{}],29:[function(e,t){t.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},{}],30:[function(){},{}],31:[function(e,t,r){var n=Math.pow,a=String.fromCharCode,o=Math.min;(function(t){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */'use strict';function s(e){if(2147483647<e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"");var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,r,n){if("number"==typeof e){if("string"==typeof r)throw new TypeError("The \"string\" argument must be of type string. Received type number");return d(e)}return i(e,r,n)}function i(e,r,n){if("string"==typeof e)return c(e,r);if(ArrayBuffer.isView(e))return _(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return u(e,r,n);if("number"==typeof e)throw new TypeError("The \"value\" argument must not be of type number. Received type number");var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return t.from(a,r,n);var o=m(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError("\"size\" argument must be of type number");else if(0>e)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"")}function p(e,t,r){return l(e),0>=e?s(e):void 0===t?s(e):"string"==typeof r?s(e).fill(t,r):s(e).fill(t)}function d(e){return l(e),s(0>e?0:0|T(e))}function c(e,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|g(e,r),a=s(n),o=a.write(e,r);return o!==n&&(a=a.slice(0,o)),a}function _(e){for(var t=0>e.length?0:0|T(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e,r,n){if(0>r||e.byteLength<r)throw new RangeError("\"offset\" is outside of buffer bounds");if(e.byteLength<r+(n||0))throw new RangeError("\"length\" is outside of buffer bounds");var a;return a=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),a.__proto__=t.prototype,a}function m(e){if(t.isBuffer(e)){var r=0|T(e.length),n=s(r);return 0===n.length?n:(e.copy(n,0,0,r),n)}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?_(e.data):void 0:"number"!=typeof e.length||V(e.length)?s(0):_(e)}function T(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function E(e){return+e!=e&&(e=0),t.alloc(+e)}function g(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof e);var n=e.length,a=2<arguments.length&&!0===arguments[2];if(!a&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(o)return a?-1:j(e).length;r=(""+r).toLowerCase(),o=!0;}}function h(e,t,r){var n=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}function f(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,r,n,a,o){if(0===e.length)return-1;if("string"==typeof n?(a=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),n=+n,V(n)&&(n=o?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(0>n)if(o)n=0;else return-1;if("string"==typeof r&&(r=t.from(r,a)),t.isBuffer(r))return 0===r.length?-1:y(e,r,n,a,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):y(e,[r],n,a,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,a){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,l=e.length,p=t.length;if(void 0!==n&&(n=(n+"").toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>e.length||2>t.length)return-1;s=2,l/=2,p/=2,r/=2}var d;if(a){var c=-1;for(d=r;d<l;d++)if(o(e,d)!==o(t,-1===c?0:d-c))-1!==c&&(d-=d-c),c=-1;else if(-1===c&&(c=d),d-c+1===p)return c*s}else for(r+p>l&&(r=l-p),d=r;0<=d;d--){for(var _=!0,u=0;u<p;u++)if(o(e,d+u)!==o(t,u)){_=!1;break}if(_)return d}return-1}function N(e,t,r,n){r=+r||0;var a=e.length-r;n?(n=+n,n>a&&(n=a)):n=a;var o=t.length;n>o/2&&(n=o/2);for(var s=0,l;s<n;++s){if(l=parseInt(t.substr(2*s,2),16),V(l))return s;e[r+s]=l}return s}function b(e,t,r,n){return z(j(t,e.length-r),e,r,n)}function O(e,t,r,n){return z(K(t),e,r,n)}function S(e,t,r,n){return O(e,t,r,n)}function C(e,t,r,n){return z(Y(t),e,r,n)}function M(e,t,r,n){return z(q(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,r))}function I(e,t,r){r=o(e.length,r);for(var n=[],a=t;a<r;){var s=e[a],l=null,p=239<s?4:223<s?3:191<s?2:1;if(a+p<=r){var d,c,_,u;1===p?128>s&&(l=s):2===p?(d=e[a+1],128==(192&d)&&(u=(31&s)<<6|63&d,127<u&&(l=u))):3===p?(d=e[a+1],c=e[a+2],128==(192&d)&&128==(192&c)&&(u=(15&s)<<12|(63&d)<<6|63&c,2047<u&&(55296>u||57343<u)&&(l=u))):4===p?(d=e[a+1],c=e[a+2],_=e[a+3],128==(192&d)&&128==(192&c)&&128==(192&_)&&(u=(15&s)<<18|(63&d)<<12|(63&c)<<6|63&_,65535<u&&1114112>u&&(l=u))):void 0}null===l?(l=65533,p=1):65535<l&&(l-=65536,n.push(55296|1023&l>>>10),l=56320|1023&l),n.push(l),a+=p}return x(n)}function x(e){var t=e.length;if(t<=4096)return a.apply(String,e);for(var r="",n=0;n<t;)r+=a.apply(String,e.slice(n,n+=4096));return r}function R(e,t,r){var n="";r=o(e.length,r);for(var s=t;s<r;++s)n+=a(127&e[s]);return n}function D(e,t,r){var n="";r=o(e.length,r);for(var s=t;s<r;++s)n+=a(e[s]);return n}function k(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var a="",o=t;o<r;++o)a+=G(e[o]);return a}function P(e,t,r){for(var n=e.slice(t,r),o="",s=0;s<n.length;s+=2)o+=a(n[s]+256*n[s+1]);return o}function H(e,t,r){if(0!=e%1||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function v(e,r,n,a,o,s){if(!t.isBuffer(e))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(r>o||r<s)throw new RangeError("\"value\" argument is out of bounds");if(n+a>e.length)throw new RangeError("Index out of range")}function w(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function B(e,t,r,n,a){return t=+t,r>>>=0,a||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),Q.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),Q.write(e,t,r,n,52,8),r+8}function F(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function G(e){return 16>e?"0"+e.toString(16):e.toString(16)}function j(e,t){t=t||1/0;for(var r=e.length,n=null,a=[],o=0,s;o<r;++o){if(s=e.charCodeAt(o),55295<s&&57344>s){if(!n){if(56319<s){-1<(t-=3)&&a.push(239,191,189);continue}else if(o+1===r){-1<(t-=3)&&a.push(239,191,189);continue}n=s;continue}if(56320>s){-1<(t-=3)&&a.push(239,191,189),n=s;continue}s=(n-55296<<10|s-56320)+65536}else n&&-1<(t-=3)&&a.push(239,191,189);if(n=null,128>s){if(0>(t-=1))break;a.push(s)}else if(2048>s){if(0>(t-=2))break;a.push(192|s>>6,128|63&s)}else if(65536>s){if(0>(t-=3))break;a.push(224|s>>12,128|63&s>>6,128|63&s)}else if(1114112>s){if(0>(t-=4))break;a.push(240|s>>18,128|63&s>>12,128|63&s>>6,128|63&s)}else throw new Error("Invalid code point")}return a}function K(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function q(e,t){for(var r=[],n=0,a,o,s;n<e.length&&!(0>(t-=2));++n)a=e.charCodeAt(n),o=a>>8,s=a%256,r.push(s),r.push(o);return r}function Y(e){return X.toByteArray(F(e))}function z(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!==e}var X=e("base64-js"),Q=e("ieee754");r.Buffer=t,r.SlowBuffer=E,r.INSPECT_MAX_BYTES=50;r.kMaxLength=2147483647,t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),t.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){return t.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){return t.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,r){return i(e,t,r)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,r){return p(e,t,r)},t.allocUnsafe=function(e){return d(e)},t.allocUnsafeSlow=function(e){return d(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(W(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),W(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");if(e===r)return 0;for(var n=e.length,s=r.length,l=0,p=o(n,s);l<p;++l)if(e[l]!==r[l]){n=e[l],s=r[l];break}return n<s?-1:s<n?1:0},t.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1;}},t.concat=function(e,r){if(!Array.isArray(e))throw new TypeError("\"list\" argument must be an Array of Buffers");if(0===e.length)return t.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var a=t.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(W(s,Uint8Array)&&(s=t.from(s)),!t.isBuffer(s))throw new TypeError("\"list\" argument must be an Array of Buffers");s.copy(a,o),o+=s.length}return a},t.byteLength=g,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var e=this.length;if(0!=e%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},t.prototype.swap32=function(){var e=this.length;if(0!=e%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},t.prototype.swap64=function(){var e=this.length;if(0!=e%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):h.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},t.prototype.compare=function(e,r,n,a,s){if(W(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===a&&(a=0),void 0===s&&(s=this.length),0>r||n>e.length||0>a||s>this.length)throw new RangeError("out of range index");if(a>=s&&r>=n)return 0;if(a>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,s>>>=0,this===e)return 0;for(var l=s-a,p=n-r,d=o(l,p),c=this.slice(a,s),_=e.slice(r,n),u=0;u<d;++u)if(c[u]!==_[u]){l=c[u],p=_[u];break}return l<p?-1:p<l?1:0},t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},t.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},t.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},t.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((void 0===r||r>a)&&(r=a),0<e.length&&(0>r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return N(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return O(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0;}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),r<e&&(r=e);var a=this.subarray(e,r);return a.__proto__=t.prototype,a},t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e+--t],a=1;0<t&&(a*=256);)n+=this[e+--t]*a;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var a=this[e],o=1,s=0;++s<t&&(o*=256);)a+=this[e+s]*o;return o*=128,a>=o&&(a-=n(2,8*t)),a},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var a=t,o=1,s=this[e+--a];0<a&&(o*=256);)s+=this[e+--a]*o;return o*=128,s>=o&&(s-=n(2,8*t)),s},t.prototype.readInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||H(e,4,this.length),Q.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||H(e,4,this.length),Q.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||H(e,8,this.length),Q.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||H(e,8,this.length),Q.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var o=n(2,8*r)-1;v(this,e,t,r,o,0)}var s=1,l=0;for(this[t]=255&e;++l<r&&(s*=256);)this[t+l]=255&e/s;return t+r},t.prototype.writeUIntBE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var o=n(2,8*r)-1;v(this,e,t,r,o,0)}var s=r-1,l=1;for(this[t+s]=255&e;0<=--s&&(l*=256);)this[t+s]=255&e/l;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var o=n(2,8*r-1);v(this,e,t,r,o-1,-o)}var s=0,l=1,p=0;for(this[t]=255&e;++s<r&&(l*=256);)0>e&&0===p&&0!==this[t+s-1]&&(p=1),this[t+s]=255&(e/l>>0)-p;return t+r},t.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var o=n(2,8*r-1);v(this,e,t,r,o-1,-o)}var s=r-1,l=1,p=0;for(this[t+s]=255&e;0<=--s&&(l*=256);)0>e&&0===p&&0!==this[t+s+1]&&(p=1),this[t+s]=255&(e/l>>0)-p;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,a){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=e.length&&(r=e.length),r||(r=0),0<a&&a<n&&(a=n),a===n)return 0;if(0===e.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("Index out of range");if(0>a)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r<a-n&&(a=e.length-r+n);var o=a-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,a);else if(this===e&&n<r&&r<a)for(var s=o-1;0<=s;--s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,a),r);return o},t.prototype.fill=function(e,r,n,a){if("string"==typeof e){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!t.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var o=e.charCodeAt(0);("utf8"===a&&128>o||"latin1"===a)&&(e=o)}}else"number"==typeof e&&(e&=255);if(0>r||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=r;s<n;++s)this[s]=e;else{var l=t.isBuffer(e)?e:t.from(e,a),p=l.length;if(0===p)throw new TypeError("The value \""+e+"\" is invalid for argument \"value\"");for(s=0;s<n-r;++s)this[s+r]=l[s%p]}return this};var J=/[^+/0-9A-Za-z-_]/g}).call(this,e("buffer").Buffer)},{"base64-js":28,buffer:31,ieee754:82}],32:[function(e,t,r){r=t.exports=e("./lib/cheerio"),r.version=e("./package.json").version},{"./lib/cheerio":38,"./package.json":43}],33:[function(e,t,r){var n=e("../static"),a=e("../utils"),o=a.isTag,s=a.domEach,l=Object.prototype.hasOwnProperty,p=a.camelCase,d=a.cssCase,c=/\s+/,u={forEach:e("lodash/forEach"),extend:e("lodash/assignIn"),some:e("lodash/some")},i={null:null,true:!0,false:!1},_=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,m=function(e,t){if(e&&o(e))return e.attribs||(e.attribs={}),t?l.call(e.attribs,t)?_.test(t)?t:e.attribs[t]:"option"===e.name&&"value"===t?n.text(e.children):"input"===e.name&&("radio"===e.attribs.type||"checkbox"===e.attribs.type)&&"value"===t?"on":void 0:e.attribs},T=function(e,t,r){null===r?A(e,t):e.attribs[t]=r+""};r.attr=function(e,t){return"object"==typeof e||void 0!==t?"function"==typeof t?s(this,function(r,n){T(n,e,t.call(n,r,n.attribs[e]))}):s(this,function(r,n){o(n)&&("object"==typeof e?u.forEach(e,function(e,t){T(n,t,e)}):T(n,e,t))}):m(this[0],e)};var E=function(e,t){return e&&o(e)?l.call(e,t)?e[t]:_.test(t)?m(e,t)!==void 0:m(e,t):void 0},g=function(e,t,r){e[t]=_.test(t)?!!r:r};r.prop=function(e,t){var r=0,n;return"string"==typeof e&&void 0===t?("style"===e?(n=this.css(),u.forEach(n,function(e,t){n[r++]=t}),n.length=r):"tagName"===e||"nodeName"===e?n=this[0].name.toUpperCase():n=E(this[0],e),n):"object"==typeof e||void 0!==t?"function"==typeof t?s(this,function(r,n){g(n,e,t.call(n,r,E(n,e)))}):s(this,function(r,n){o(n)&&("object"==typeof e?u.forEach(e,function(e,t){g(n,t,e)}):g(n,e,t))}):void 0};var h=function(e,t,r){return e.data||(e.data={}),"object"==typeof t?u.extend(e.data,t):void("string"==typeof t&&void 0!==r&&(e.data[t]=r))},f=function(e,t){var r=1===arguments.length,n,a,o,s,c,_,u;for(r?(n=Object.keys(e.attribs).filter(function(e){return"data-"===e.slice(0,5)}),o=n.map(function(e){return p(e.slice(5))})):(n=["data-"+d(t)],o=[t]),_=0,u=n.length;_<u;++_)if(a=n[_],s=o[_],l.call(e.attribs,a)){if(c=e.attribs[a],l.call(i,c))c=i[c];else if(c===+c+"")c=+c;else if(/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/.test(c))try{c=JSON.parse(c)}catch(t){}e.data[s]=c}return r?e.data:c};r.data=function(e,t){var r=this[0];if(r&&o(r))return r.data||(r.data={}),e?"object"==typeof e||void 0!==t?(s(this,function(r,n){h(n,e,t)}),this):l.call(r.data,e)?r.data[e]:f(r,e):f(r)},r.val=function(e){var t=0===arguments.length,r=this[0];if(r)switch(r.name){case"textarea":return this.text(e);case"input":switch(this.attr("type")){case"radio":return t?this.attr("value"):(this.attr("value",e),this);break;default:return this.attr("value",e);}return;case"select":var n=this.find("option:selected"),a;if(void 0===n)return;if(!t){if(!l.call(this.attr(),"multiple")&&"object"==typeof e)return this;"object"!=typeof e&&(e=[e]),this.find("option").removeAttr("selected");for(var o=0;o<e.length;o++)this.find("option[value=\""+e[o]+"\"]").attr("selected","");return this}return a=n.attr("value"),l.call(this.attr(),"multiple")&&(a=[],s(n,function(e,t){a.push(m(t,"value"))})),a;case"option":return t?this.attr("value"):(this.attr("value",e),this);}};var A=function(e,t){e.attribs&&l.call(e.attribs,t)&&delete e.attribs[t]};r.removeAttr=function(e){return s(this,function(t,r){A(r,e)}),this},r.hasClass=function(e){return u.some(this,function(t){var r=t.attribs,n=r&&r["class"],a=-1,o;if(n&&e.length)for(;-1<(a=n.indexOf(e,a+1));)if(o=a+e.length,(0===a||c.test(n[a-1]))&&(o===n.length||c.test(n[o])))return!0})},r.addClass=function(e){if("function"==typeof e)return s(this,function(t,n){var a=n.attribs["class"]||"";r.addClass.call([n],e.call(n,t,a))});if(!e||"string"!=typeof e)return this;for(var t=e.split(c),n=this.length,a=0;a<n;a++)if(o(this[a])){var l=m(this[a],"class"),p,d;if(!l)T(this[a],"class",t.join(" ").trim());else{d=" "+l+" ",p=t.length;for(var _=0,u;_<p;_++)u=t[_]+" ",0>d.indexOf(" "+u)&&(d+=u);T(this[a],"class",d.trim())}}return this};var y=function(e){return e?e.trim().split(c):[]};r.removeClass=function(e){var t,n,a;return"function"==typeof e?s(this,function(t,n){r.removeClass.call([n],e.call(n,t,n.attribs["class"]||""))}):(t=y(e),n=t.length,a=0===arguments.length,s(this,function(e,r){if(o(r))if(a)r.attribs.class="";else{for(var s=y(r.attribs.class),i=0,l,p;i<n;i++)l=s.indexOf(t[i]),0<=l&&(s.splice(l,1),p=!0,i--);p&&(r.attribs.class=s.join(" "))}}))},r.toggleClass=function(e,t){if("function"==typeof e)return s(this,function(n,a){r.toggleClass.call([a],e.call(a,n,a.attribs["class"]||"",t),t)});if(!e||"string"!=typeof e)return this;for(var n=e.split(c),a=n.length,l="boolean"==typeof t?t?1:-1:0,p=this.length,d=0,_,u;d<p;d++)if(o(this[d])){_=y(this[d].attribs.class);for(var m=0;m<a;m++)u=_.indexOf(n[m]),0<=l&&0>u?_.push(n[m]):0>=l&&0<=u&&_.splice(u,1);this[d].attribs.class=_.join(" ")}return this},r.is=function(e){return!!e&&0<this.filter(e).length}},{"../static":41,"../utils":42,"lodash/assignIn":258,"lodash/forEach":265,"lodash/some":292}],34:[function(e,t,r){function n(e,t,r,s){if("string"==typeof t){var i=a(e);"function"==typeof r&&(r=r.call(e,s,i[t])),""===r?delete i[t]:null!=r&&(i[t]=r),e.attribs.style=o(i)}else"object"==typeof t&&Object.keys(t).forEach(function(r){n(e,r,t[r])})}function a(e,t){var r=s(e.attribs.style);return"string"==typeof t?r[t]:Array.isArray(t)?l.pick(r,t):r}function o(e){return Object.keys(e||{}).reduce(function(t,r){return t+=""+(t?" ":"")+r+": "+e[r]+";"},"")}function s(e){return e=(e||"").trim(),e?e.split(";").reduce(function(e,t){var r=t.indexOf(":");return 1>r||r===t.length-1?e:(e[t.slice(0,r).trim()]=t.slice(r+1).trim(),e)},{}):{}}var i=e("../utils").domEach,l={pick:e("lodash/pick")},p=Object.prototype.toString;r.css=function(e,t){return 2===arguments.length||"[object Object]"===p.call(e)?i(this,function(r,a){n(a,e,t,r)}):a(this[0],e)}},{"../utils":42,"lodash/pick":288}],35:[function(e,t,r){var n=/\r?\n/g,a={map:e("lodash/map")};r.serializ