Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created April 20, 2014 20:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save max-mapper/11123800 to your computer and use it in GitHub Desktop.
Save max-mapper/11123800 to your computer and use it in GitHub Desktop.
requirebin sketch
var term = require('hypernal')()
var tablify = require('tablify').tablify
var request = require('browser-request')
var url = require('url')
term.appendTo(document.body)
// style fake terminal
var termEl = term.term.element
termEl.style['font'] = '13px Monaco, mono'
termEl.style.height = '100%'
termEl.style.padding = '5px'
termEl.style.overflow = 'auto'
termEl.style['white-space'] = 'pre'
var query = 'http://npmsearch.com/query?fl=name,description,homepage&rows=200&sort=rating+desc&q=voxel'
request({json: true, url: query}, function(err, resp, data) {
var docs = data.results.map(function(doc) {
var isLong = doc.description.length > 60
doc.description = doc.description.substr(0, 60)
if (isLong) doc.description += '...'
return doc
})
term.write(tablify(docs, {keys: ['name', 'description', 'homepage']}))
})
require=function e(t,r,n){function s(o,a){if(!r[o]){if(!t[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return s(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)s(n[o]);return s}({1:[function(t,e,r){(function(t){(function(n){function s(t){throw RangeError(U[t])}function i(t,e){for(var r=t.length;r--;)t[r]=e(t[r]);return t}function o(t,e){return i(t.split(R),e).join(".")}function a(t){for(var e,r,n=[],s=0,i=t.length;i>s;)e=t.charCodeAt(s++),e>=55296&&56319>=e&&i>s?(r=t.charCodeAt(s++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),s--)):n.push(e);return n}function h(t){return i(t,function(t){var e="";return t>65535&&(t-=65536,e+=q(55296|1023&t>>>10),t=56320|1023&t),e+=q(t)}).join("")}function c(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:x}function u(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function l(t,e,r){var n=0;for(t=r?T(t/L):t>>1,t+=T(t/e);t>M*A>>1;n+=x)t=T(t/M);return T(n+(M+1)*t/(t+E))}function f(t){var e,r,n,i,o,a,u,f,p,d,g=[],b=t.length,y=0,v=C,m=S;for(r=t.lastIndexOf(j),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&s("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;b>i;){for(o=y,a=1,u=x;i>=b&&s("invalid-input"),f=c(t.charCodeAt(i++)),(f>=x||f>T((k-y)/a))&&s("overflow"),y+=f*a,p=m>=u?_:u>=m+A?A:u-m,!(p>f);u+=x)d=x-p,a>T(k/d)&&s("overflow"),a*=d;e=g.length+1,m=l(y-o,e,0==o),T(y/e)>k-v&&s("overflow"),v+=T(y/e),y%=e,g.splice(y++,0,v)}return h(g)}function p(t){var e,r,n,i,o,h,c,f,p,d,g,b,y,v,m,w=[];for(t=a(t),b=t.length,e=C,r=0,o=S,h=0;b>h;++h)g=t[h],128>g&&w.push(q(g));for(n=i=w.length,i&&w.push(j);b>n;){for(c=k,h=0;b>h;++h)g=t[h],g>=e&&c>g&&(c=g);for(y=n+1,c-e>T((k-r)/y)&&s("overflow"),r+=(c-e)*y,e=c,h=0;b>h;++h)if(g=t[h],e>g&&++r>k&&s("overflow"),g==e){for(f=r,p=x;d=o>=p?_:p>=o+A?A:p-o,!(d>f);p+=x)m=f-d,v=x-d,w.push(q(u(d+m%v,0))),f=T(m/v);w.push(q(u(f,0))),o=l(r,y,n==i),r=0,++n}++r,++e}return w.join("")}function d(t){return o(t,function(t){return I.test(t)?f(t.slice(4).toLowerCase()):t})}function g(t){return o(t,function(t){return B.test(t)?"xn--"+p(t):t})}var b="object"==typeof r&&r,y="object"==typeof e&&e&&e.exports==b&&e,v="object"==typeof t&&t;(v.global===v||v.window===v)&&(n=v);var m,w,k=2147483647,x=36,_=1,A=26,E=38,L=700,S=72,C=128,j="-",I=/^xn--/,B=/[^ -~]/,R=/\x2E|\u3002|\uFF0E|\uFF61/g,U={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=x-_,T=Math.floor,q=String.fromCharCode;if(m={version:"1.2.4",ucs2:{decode:a,encode:h},decode:f,encode:p,toASCII:g,toUnicode:d},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return m});else if(b&&!b.nodeType)if(y)y.exports=m;else for(w in m)m.hasOwnProperty(w)&&(b[w]=m[w]);else n.punycode=m})(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,s,i){e=e||"&",s=s||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var h=1e3;i&&"number"==typeof i.maxKeys&&(h=i.maxKeys);var c=t.length;h>0&&c>h&&(c=h);for(var u=0;c>u;++u){var l,f,p,d,g=t[u].replace(a,"%20"),b=g.indexOf(s);b>=0?(l=g.substr(0,b),f=g.substr(b+1)):(l=g,f=""),p=decodeURIComponent(l),d=decodeURIComponent(f),r(o,p)?n(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],3:[function(t,e){"use strict";function r(t,e){if(t.map)return t.map(e);for(var r=[],n=0;t.length>n;n++)r.push(e(t[n],n));return r}var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,o,a){return e=e||"&",o=o||"=",null===t&&(t=void 0),"object"==typeof t?r(i(t),function(r){var i=encodeURIComponent(n(r))+o;return s(t[r])?t[r].map(function(t){return i+encodeURIComponent(n(t))}).join(e):i+encodeURIComponent(n(t[r]))}).join(e):a?encodeURIComponent(n(a))+o+encodeURIComponent(n(t)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],4:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":2,"./encode":3}],Vhv19d:[function(t,e,r){(function(){"use strict";function e(t,e,r){if(t&&"object"==typeof t&&t.href)return t;if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s={},i=t;i=i.trim();var c=h.exec(i);if(c){c=c[0];var u=c.toLowerCase();s.protocol=u,i=i.substr(c.length)}if(r||c||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var l="//"===i.substr(0,2);!l||c&&m[c]||(i=i.substr(2),s.slashes=!0)}if(!m[c]&&(l||c&&!w[c])){var x=i.indexOf("@");if(-1!==x){for(var _=i.slice(0,x),A=!0,E=0,L=d.length;L>E;E++)if(-1!==_.indexOf(d[E])){A=!1;break}A&&(s.auth=decodeURIComponent(_),i=i.substr(x+1))}for(var S=-1,E=0,L=p.length;L>E;E++){var C=i.indexOf(p[E]);-1!==C&&(0>S||S>C)&&(S=C)}-1!==S?(s.host=i.substr(0,S),i=i.substr(S)):(s.host=i,i="");for(var j=o(s.host),I=Object.keys(j),E=0,L=I.length;L>E;E++){var B=I[E];s[B]=j[B]}s.hostname=s.hostname||"";var R="["===s.hostname[0]&&"]"===s.hostname[s.hostname.length-1];if(s.hostname.length>g)s.hostname="";else if(!R)for(var U=s.hostname.split(/\./),E=0,L=U.length;L>E;E++){var M=U[E];if(M&&!M.match(b)){for(var T="",q=0,D=M.length;D>q;q++)T+=M.charCodeAt(q)>127?"x":M[q];if(!T.match(b)){var O=U.slice(0,E),P=U.slice(E+1),N=M.match(y);N&&(O.push(N[1]),P.unshift(N[2])),P.length&&(i="/"+P.join(".")+i),s.hostname=O.join(".");break}}}if(s.hostname=s.hostname.toLowerCase(),!R){for(var F=s.hostname.split("."),W=[],E=0;F.length>E;++E){var H=F[E];W.push(H.match(/[^A-Za-z0-9_-]/)?"xn--"+a.encode(H):H)}s.hostname=W.join(".")}s.host=(s.hostname||"")+(s.port?":"+s.port:""),s.href+=s.host,R&&(s.hostname=s.hostname.substr(1,s.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!v[u])for(var E=0,L=f.length;L>E;E++){var z=f[E],J=encodeURIComponent(z);J===z&&(J=escape(z)),i=i.split(z).join(J)}var K=i.indexOf("#");-1!==K&&(s.hash=i.substr(K),i=i.slice(0,K));var X=i.indexOf("?");return-1!==X?(s.search=i.substr(X),s.query=i.substr(X+1),e&&(s.query=k.parse(s.query)),i=i.slice(0,X)):e&&(s.search="",s.query={}),i&&(s.pathname=i),w[c]&&s.hostname&&!s.pathname&&(s.pathname="/"),(s.pathname||s.search)&&(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.href=n(s),s}function n(t){"string"==typeof t&&(t=e(t));var r=t.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var n=t.protocol||"",s=t.pathname||"",i=t.hash||"",o=!1,a="";void 0!==t.host?o=r+t.host:void 0!==t.hostname&&(o=r+(-1===t.hostname.indexOf(":")?t.hostname:"["+t.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&"object"==typeof t.query&&Object.keys(t.query).length&&(a=k.stringify(t.query));var h=t.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),t.slashes||(!n||w[n])&&o!==!1?(o="//"+(o||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),h&&"?"!==h.charAt(0)&&(h="?"+h),n+o+s+h+i}function s(t,e){return n(i(t,e))}function i(t,r){if(!t)return r;if(t=e(n(t),!1,!0),r=e(n(r),!1,!0),t.hash=r.hash,""===r.href)return t.href=n(t),t;if(r.slashes&&!r.protocol)return r.protocol=t.protocol,w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=n(r),r;if(r.protocol&&r.protocol!==t.protocol){if(!w[r.protocol])return r.href=n(r),r;if(t.protocol=r.protocol,!r.host&&!m[r.protocol]){for(var s=(r.pathname||"").split("/");s.length&&!(r.host=s.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),""!==s[0]&&s.unshift(""),2>s.length&&s.unshift(""),r.pathname=s.join("/")}return t.pathname=r.pathname,t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,(void 0!==t.pathname||void 0!==t.search)&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.slashes=t.slashes||r.slashes,t.href=n(t),t}var i=t.pathname&&"/"===t.pathname.charAt(0),o=void 0!==r.host||r.pathname&&"/"===r.pathname.charAt(0),a=o||i||t.host&&r.pathname,h=a,c=t.pathname&&t.pathname.split("/")||[],s=r.pathname&&r.pathname.split("/")||[],u=t.protocol&&!w[t.protocol];if(u&&(delete t.hostname,delete t.port,t.host&&(""===c[0]?c[0]=t.host:c.unshift(t.host)),delete t.host,r.protocol&&(delete r.hostname,delete r.port,r.host&&(""===s[0]?s[0]=r.host:s.unshift(r.host)),delete r.host),a=a&&(""===s[0]||""===c[0])),o)t.host=r.host||""===r.host?r.host:t.host,t.hostname=r.hostname||""===r.hostname?r.hostname:t.hostname,t.search=r.search,t.query=r.query,c=s;else if(s.length)c||(c=[]),c.pop(),c=c.concat(s),t.search=r.search,t.query=r.query;else if("search"in r){if(u){t.hostname=t.host=c.shift();var l=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;l&&(t.auth=l.shift(),t.host=t.hostname=l.shift())}return t.search=r.search,t.query=r.query,(void 0!==t.pathname||void 0!==t.search)&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=n(t),t}if(!c.length)return delete t.pathname,t.search?delete t.path:t.path="/"+t.search,t.href=n(t),t;for(var f=c.slice(-1)[0],p=(t.host||r.host)&&("."===f||".."===f)||""===f,d=0,g=c.length;g>=0;g--)f=c[g],"."==f?c.splice(g,1):".."===f?(c.splice(g,1),d++):d&&(c.splice(g,1),d--);if(!a&&!h)for(;d--;d)c.unshift("..");!a||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift(""),p&&"/"!==c.join("/").substr(-1)&&c.push("");var b=""===c[0]||c[0]&&"/"===c[0].charAt(0);if(u){t.hostname=t.host=b?"":c.length?c.shift():"";var l=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;l&&(t.auth=l.shift(),t.host=t.hostname=l.shift())}return a=a||t.host&&c.length,a&&!b&&c.unshift(""),t.pathname=c.join("/"),(void 0!==t.pathname||void 0!==t.search)&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=n(t),t}function o(t){var e={},r=c.exec(t);return r&&(r=r[0],":"!==r&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t),e}var a=t("punycode");r.parse=e,r.resolve=s,r.resolveObject=i,r.format=n;var h=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,u=["<",">",'"',"`"," ","\r","\n"," "],l=["{","}","|","\\","^","~","`"].concat(u),f=["'"].concat(u),p=["%","/","?",";","#"].concat(l).concat(f),d=["/","@","?","#"].concat(u),g=255,b=/^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/,y=/^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=t("querystring")})()},{punycode:1,querystring:4}],url:[function(t,e){e.exports=t("Vhv19d")},{}]},{},[]),require=function e(t,r,n){function s(o,a){if(!r[o]){if(!t[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return s(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)s(n[o]);return s}({"8iH0Vg":[function(t,e){function r(t,e){if("function"!=typeof e)throw Error("Bad callback given: "+e);if(!t)throw Error("No options given");var o=t.onResponse;if(t="string"==typeof t?{uri:t}:JSON.parse(JSON.stringify(t)),t.onResponse=o,t.verbose&&(r.log=i()),t.url&&(t.uri=t.url,delete t.url),!t.uri&&""!==t.uri)throw Error("options.uri is a required argument");if("string"!=typeof t.uri)throw Error("options.uri must be a string");for(var a=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;a.length>c;c++)if(t[a[c]])throw Error("options."+a[c]+" is not supported");if(t.callback=e,t.method=t.method||"GET",t.headers=t.headers||{},t.body=t.body||null,t.timeout=t.timeout||r.DEFAULT_TIMEOUT,t.headers.host)throw Error("Options.headers.host is not supported");return t.json&&(t.headers.accept=t.headers.accept||"application/json","GET"!==t.method&&(t.headers["content-type"]="application/json"),"boolean"!=typeof t.json?t.body=JSON.stringify(t.json):"string"!=typeof t.body&&(t.body=JSON.stringify(t.body))),t.onResponse=t.onResponse||s,t.onResponse===!0&&(t.onResponse=e,t.callback=s),!t.headers.authorization&&t.auth&&(t.headers.authorization="Basic "+h(t.auth.username+":"+t.auth.password)),n(t)}function n(t){function e(){u=!0;var e=Error("ETIMEDOUT");return e.code="ETIMEDOUT",e.duration=t.timeout,r.log.error("Timeout",{id:h._id,milliseconds:t.timeout}),t.callback(e,h)}function n(){if(u)return r.log.debug("Ignoring timed out state change",{state:h.readyState,id:h.id});if(r.log.debug("State change",{state:h.readyState,id:h.id,timed_out:u}),h.readyState===c.OPENED){r.log.debug("Request started",{id:h.id});for(var e in t.headers)h.setRequestHeader(e,t.headers[e])}else h.readyState===c.HEADERS_RECEIVED?s():h.readyState===c.LOADING?(s(),i()):h.readyState===c.DONE&&(s(),i(),o())}function s(){if(!g.response){if(g.response=!0,r.log.debug("Got response",{id:h.id,status:h.status}),clearTimeout(h.timeoutTimer),h.statusCode=h.status,f&&0==h.statusCode){var e=Error("CORS request rejected: "+t.uri);return e.cors="rejected",g.loading=!0,g.end=!0,t.callback(e,h)}t.onResponse(null,h)}}function i(){g.loading||(g.loading=!0,r.log.debug("Response body loading",{id:h.id}))}function o(){if(!g.end){if(g.end=!0,r.log.debug("Request done",{id:h.id}),h.body=h.responseText,t.json)try{h.body=JSON.parse(h.responseText)}catch(e){return t.callback(e,h)}t.callback(null,h,h.body)}}var h=new c,u=!1,f=a(t.uri),p="withCredentials"in h;if(l+=1,h.seq_id=l,h.id=l+": "+t.method+" "+t.uri,h._id=h.id,f&&!p){var d=Error("Browser does not support cross-origin request: "+t.uri);return d.cors="unsupported",t.callback(d,h)}h.timeoutTimer=setTimeout(e,t.timeout);var g={response:!1,loading:!1,end:!1};return h.onreadystatechange=n,h.open(t.method,t.uri,!0),f&&(h.withCredentials=!!t.withCredentials),h.send(t.body),h}function s(){}function i(){var t,e,r={},n=["trace","debug","info","warn","error"];for(e=0;n.length>e;e++)t=n[e],r[t]=s,"undefined"!=typeof console&&console&&console[t]&&(r[t]=o(console,t));return r}function o(t,e){function r(r,n){return"object"==typeof n&&(r+=" "+JSON.stringify(n)),t[e].call(t,r)}return r}function a(t){var e,r=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{e=location.href}catch(n){e=document.createElement("a"),e.href="",e=e.href}var s=r.exec(e.toLowerCase())||[],i=r.exec(t.toLowerCase()),o=!(!i||i[1]==s[1]&&i[2]==s[2]&&(i[3]||("http:"===i[1]?80:443))==(s[3]||("http:"===s[1]?80:443)));return o}function h(t){var e,r,n,s,i,o,a,h,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=0,l=0,f="",p=[];if(!t)return t;do e=t.charCodeAt(u++),r=t.charCodeAt(u++),n=t.charCodeAt(u++),h=e<<16|r<<8|n,s=63&h>>18,i=63&h>>12,o=63&h>>6,a=63&h,p[l++]=c.charAt(s)+c.charAt(i)+c.charAt(o)+c.charAt(a);while(t.length>u);switch(f=p.join(""),t.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f}var c=XMLHttpRequest;if(!c)throw Error("missing XMLHttpRequest");e.exports=r,r.log={trace:s,debug:s,info:s,warn:s,error:s};var u=18e4,l=0;r.withCredentials=!1,r.DEFAULT_TIMEOUT=u,r.defaults=function(t){var e=function(e){var r=function(r,n){r="string"==typeof r?{uri:r}:JSON.parse(JSON.stringify(r));for(var s in t)void 0===r[s]&&(r[s]=t[s]);return e(r,n)};return r},n=e(r);return n.get=e(r.get),n.post=e(r.post),n.put=e(r.put),n.head=e(r.head),n};var f=["get","put","post","head"];f.forEach(function(t){var e=t.toUpperCase(),n=t.toLowerCase();r[n]=function(t){"string"==typeof t?t={method:e,uri:t}:(t=JSON.parse(JSON.stringify(t)),t.method=e);var n=[t].concat(Array.prototype.slice.apply(arguments,[1]));return r.apply(this,n)}}),r.couch=function(t,e){function n(t,r,n){if(t)return e(t,r,n);if((200>r.statusCode||r.statusCode>299)&&n.error){t=Error("CouchDB error: "+(n.error.reason||n.error.error));for(var s in n)t[s]=n[s];return e(t,r,n)}return e(t,r,n)}"string"==typeof t&&(t={uri:t}),t.json=!0,t.body&&(t.json=t.body),delete t.body,e=e||s;var i=r(t,n);return i}},{}],"browser-request":[function(t,e){e.exports=t("8iH0Vg")},{}]},{},[]),require=function e(t,r,n){function s(o,a){if(!r[o]){if(!t[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return s(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)s(n[o]);return s}({q1fZ45:[function(t,e){(function(){var t,r,n;t=e.exports=function(e,n){if("object"==typeof e)return Array.isArray(e)?r(e)?t.tablifyArrays(e,n):t.tablifyDicts(e,n):t.tablifySingleDict(e,n);throw Error("tablify cannot handle non-objects")},t.tablify=t,t.tablifySingleDict=function(e,r){var n,s,i;n=[];for(s in e)i=e[s],n.push([s,i]);return n.sort(function(t,e){return t[0].localeCompare(e[0])}),t.tablifyArrays(n,r)},t.tablifyArrays=function(t,e){var r,s,i,o;for(r=new n(e),i=0,o=t.length;o>i;i++)s=t[i],r.push(s);return r.stringify()},t.tablifyDicts=function(t,e){var r,s,i,o,a,h,c,u,l,f,p,d,g;if(e=e||{},null==e.has_header&&(e.has_header=!0),null==e.show_index&&(e.show_index=!0),!e.keys){for(a={},c=0,f=t.length;f>c;c++){s=t[c];for(o in s)a[o]=!0}e.keys=function(){var t;t=[];for(o in a)t.push(o);return t}(),e.keys.sort()}for(r=new n(e),e.has_header&&(h=function(){var t,r,n,s;for(n=e.keys,s=[],t=0,r=n.length;r>t;t++)o=n[t],s.push(o);return s}(),r.push(h)),i=u=0,p=t.length;p>u;i=++u){for(s=t[i],h=[],g=e.keys,l=0,d=g.length;d>l;l++)o=g[l],h.push(null!=s[o]?s[o]:null);r.push(h)}return r.stringify()},n=function(){function t(t){this.opts=t||{},this.opts.spacer=null!=this.opts.spacer?this.opts.spacer:" | ",this.opts.row_start=null!=this.opts.row_start?this.opts.row_start:"| ",this.opts.row_end=null!=this.opts.row_end?this.opts.row_end:" |",this.opts.row_sep_char=null!=this.opts.row_sep_char?this.opts.row_sep_char:"-",this.opts.has_header=null!=this.opts.has_header?this.opts.has_header:!1,this.opts.show_index=null!=this.opts.show_index?this.opts.show_index:!1,this.rows=[],this.col_widths=[],this.opts.border===!1&&(t.spacer=" ",this.opts.row_start=this.opts.row_end=this.opts.row_sep_char="")}return t.prototype.push=function(t){var e,r,n,s,i,o,a;for(n=function(){var r,n,s;for(s=[],r=0,n=t.length;n>r;r++)e=t[r],s.push(e);return s}(),this.opts.show_index&&(s=this.rows.length,this.opts.has_header&&s--,0>s?n.splice(0,0,"#"):n.splice(0,0,s)),this.rows.push(n),a=[],r=i=0,o=n.length;o>i;r=++i)e=n[r],null==this.col_widths[r]||this.col_widths[r]<this.len(e)?a.push(this.col_widths[r]=this.len(e)):a.push(void 0);return a},t.prototype.stringify=function(){var t,e,r,n,s,i,o,a,h,c,u,l,f,p,d,g;for(s=[],i=this.opts.row_start.length+this.opts.row_end.length,p=this.col_widths,a=0,u=p.length;u>a;a++)o=p[a],i+=o;for(i+=this.opts.spacer.length*(this.col_widths.length-1),this.opts.row_sep_char.length&&s.push(this.chars(this.opts.row_sep_char,i)),d=this.rows,e=h=0,l=d.length;l>h;e=++h){for(n=d[e],r=this.opts.row_start,g=this.col_widths,t=c=0,f=g.length;f>c;t=++c)o=g[t],r+=this.ljust(null!=n[t]?n[t]:"",o),this.col_widths.length-1>t&&(r+=this.opts.spacer);r+=this.opts.row_end,s.push(r),this.opts.row_sep_char&&0===e&&this.opts.has_header&&s.push(this.chars(this.opts.row_sep_char,i))}return this.opts.row_sep_char.length&&s.push(this.chars(this.opts.row_sep_char,i)),s.join("\n")},t.prototype.toStr=function(t){var e;if(null===t)return"null";if(t===void 0)return"";if("object"!=typeof t)return""+t;try{return JSON.stringify(t)}catch(r){return e=r,"["+e.message+"]"}},t.prototype.len=function(t){return this.toStr(t).length},t.prototype.chars=function(t,e){var r;return function(){var n,s;for(s=[],r=n=0;e>=0?e>n:n>e;r=e>=0?++n:--n)s.push(t);return s}().join("")},t.prototype.ljust=function(t,e){return""+this.toStr(t)+this.chars(" ",e-this.len(t))},t.prototype.rjust=function(t,e){return""+this.chars(" ",e-this.len(t))+this.toStr(t)},t}(),r=function(t){var e,r,n;for(r=0,n=t.length;n>r;r++)if(e=t[r],!Array.isArray(e))return!1;return!0}}).call(this)},{}],tablify:[function(t,e){e.exports=t("q1fZ45")},{}]},{},[]),require=function e(t,r,n){function s(o,a){if(!r[o]){if(!t[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return s(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)s(n[o]);return s}({1:[function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function s(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!s(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,s,a,h,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw e=arguments[1],e instanceof Error?e:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,a=Array(s-1),h=1;s>h;h++)a[h-1]=arguments[h];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=Array(s-1),h=1;s>h;h++)a[h-1]=arguments[h];for(c=r.slice(),s=c.length,h=0;s>h;h++)c[h].apply(this,a)}return!0},r.prototype.addListener=function(t,e){var s;if(!n(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned){var s;s=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),s||(s=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var s=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,s,o,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,s=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=o;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){s=a;break}if(0>s)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},{}],2:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],3:[function(t,e){var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var r=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],4:[function(t,e,r){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);var s=typeof t;if("base64"===e&&"string"===s)for(t=L(t);0!==t.length%4;)t+="=";var i;if("number"===s)i=j(t);else if("string"===s)i=n.byteLength(t,e);else{if("object"!==s)throw Error("First argument needs to be a number, array or string.");i=j(t.length)}var o;n._useTypedArrays?o=S(new Uint8Array(i)):(o=this,o.length=i,o._isBuffer=!0);var a;if(n._useTypedArrays&&"function"==typeof Uint8Array&&t instanceof Uint8Array)o._set(t);else if(B(t))for(a=0;i>a;a++)o[a]=n.isBuffer(t)?t.readUInt8(a):t[a];else if("string"===s)o.write(t,0,e);else if("number"===s&&!n._useTypedArrays&&!r)for(a=0;i>a;a++)o[a]=0;return o}function s(t,e,r,s){r=Number(r)||0;var i=t.length-r;s?(s=Number(s),s>i&&(s=i)):s=i;var o=e.length;F(0===o%2,"Invalid hex string"),s>o/2&&(s=o/2);for(var a=0;s>a;a++){var h=parseInt(e.substr(2*a,2),16);F(!isNaN(h),"Invalid hex string"),t[r+a]=h}return n._charsWritten=2*a,a}function i(t,e,r,s){var i=n._charsWritten=q(U(e),t,r,s);return i}function o(t,e,r,s){var i=n._charsWritten=q(M(e),t,r,s);return i}function a(t,e,r,n){return o(t,e,r,n)}function h(t,e,r,s){var i=n._charsWritten=q(T(e),t,r,s);return i}function c(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function u(t,e,r){var n="",s="";r=Math.min(t.length,r);for(var i=e;r>i;i++)127>=t[i]?(n+=D(s)+String.fromCharCode(t[i]),s=""):s+="%"+t[i].toString(16);return n+D(s)}function l(t,e,r){var n="";r=Math.min(t.length,r);for(var s=e;r>s;s++)n+=String.fromCharCode(t[s]);return n}function f(t,e,r){return l(t,e,r)}function p(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var s="",i=e;r>i;i++)s+=R(t[i]);return s}function d(t,e,r,n){n||(F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==e&&null!==e,"missing offset"),F(t.length>e+1,"Trying to read beyond buffer length"));var s=t.length;if(!(e>=s)){var i;return r?(i=t[e],s>e+1&&(i|=t[e+1]<<8)):(i=t[e]<<8,s>e+1&&(i|=t[e+1])),i}}function g(t,e,r,n){n||(F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==e&&null!==e,"missing offset"),F(t.length>e+3,"Trying to read beyond buffer length"));var s=t.length;if(!(e>=s)){var i;return r?(s>e+2&&(i=t[e+2]<<16),s>e+1&&(i|=t[e+1]<<8),i|=t[e],s>e+3&&(i+=t[e+3]<<24>>>0)):(s>e+1&&(i=t[e+1]<<16),s>e+2&&(i|=t[e+2]<<8),s>e+3&&(i|=t[e+3]),i+=t[e]<<24>>>0),i}}function b(t,e,r,n){n||(F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==e&&null!==e,"missing offset"),F(t.length>e+1,"Trying to read beyond buffer length"));var s=t.length;if(!(e>=s)){var i=d(t,e,r,!0),o=32768&i;return o?-1*(65535-i+1):i}}function y(t,e,r,n){n||(F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==e&&null!==e,"missing offset"),F(t.length>e+3,"Trying to read beyond buffer length"));var s=t.length;if(!(e>=s)){var i=g(t,e,r,!0),o=2147483648&i;return o?-1*(4294967295-i+1):i}}function v(t,e,r,n){return n||(F("boolean"==typeof r,"missing or invalid endian"),F(t.length>e+3,"Trying to read beyond buffer length")),H.read(t,e,r,23,4)}function m(t,e,r,n){return n||(F("boolean"==typeof r,"missing or invalid endian"),F(t.length>e+7,"Trying to read beyond buffer length")),H.read(t,e,r,52,8)}function w(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+1,"trying to write beyond buffer length"),O(e,65535));var i=t.length;if(!(r>=i))for(var o=0,a=Math.min(i-r,2);a>o;o++)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function k(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+3,"trying to write beyond buffer length"),O(e,4294967295));var i=t.length;if(!(r>=i))for(var o=0,a=Math.min(i-r,4);a>o;o++)t[r+o]=255&e>>>8*(n?o:3-o)}function x(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+1,"Trying to write beyond buffer length"),P(e,32767,-32768));var i=t.length;r>=i||(e>=0?w(t,e,r,n,s):w(t,65535+e+1,r,n,s))}function _(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+3,"Trying to write beyond buffer length"),P(e,2147483647,-2147483648));var i=t.length;r>=i||(e>=0?k(t,e,r,n,s):k(t,4294967295+e+1,r,n,s))}function A(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+3,"Trying to write beyond buffer length"),N(e,3.4028234663852886e38,-3.4028234663852886e38));var i=t.length;r>=i||H.write(t,e,r,n,23,4)}function E(t,e,r,n,s){s||(F(void 0!==e&&null!==e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==r&&null!==r,"missing offset"),F(t.length>r+7,"Trying to write beyond buffer length"),N(e,1.7976931348623157e308,-1.7976931348623157e308));var i=t.length;r>=i||H.write(t,e,r,n,52,8)}function L(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function S(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=z.get,t.set=z.set,t.write=z.write,t.toString=z.toString,t.toLocaleString=z.toString,t.toJSON=z.toJSON,t.copy=z.copy,t.slice=z.slice,t.readUInt8=z.readUInt8,t.readUInt16LE=z.readUInt16LE,t.readUInt16BE=z.readUInt16BE,t.readUInt32LE=z.readUInt32LE,t.readUInt32BE=z.readUInt32BE,t.readInt8=z.readInt8,t.readInt16LE=z.readInt16LE,t.readInt16BE=z.readInt16BE,t.readInt32LE=z.readInt32LE,t.readInt32BE=z.readInt32BE,t.readFloatLE=z.readFloatLE,t.readFloatBE=z.readFloatBE,t.readDoubleLE=z.readDoubleLE,t.readDoubleBE=z.readDoubleBE,t.writeUInt8=z.writeUInt8,t.writeUInt16LE=z.writeUInt16LE,t.writeUInt16BE=z.writeUInt16BE,t.writeUInt32LE=z.writeUInt32LE,t.writeUInt32BE=z.writeUInt32BE,t.writeInt8=z.writeInt8,t.writeInt16LE=z.writeInt16LE,t.writeInt16BE=z.writeInt16BE,t.writeInt32LE=z.writeInt32LE,t.writeInt32BE=z.writeInt32BE,t.writeFloatLE=z.writeFloatLE,t.writeFloatBE=z.writeFloatBE,t.writeDoubleLE=z.writeDoubleLE,t.writeDoubleBE=z.writeDoubleBE,t.fill=z.fill,t.inspect=z.inspect,t.toArrayBuffer=z.toArrayBuffer,t}function C(t,e,r){return"number"!=typeof t?r:(t=~~t,t>=e?e:t>=0?t:(t+=e,t>=0?t:0))}function j(t){return t=~~Math.ceil(+t),0>t?0:t}function I(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function B(t){return I(t)||n.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function R(t){return 16>t?"0"+t.toString(16):t.toString(16)}function U(t){for(var e=[],r=0;t.length>r;r++){var n=t.charCodeAt(r);
if(127>=n)e.push(t.charCodeAt(r));else{var s=r;n>=55296&&57343>=n&&r++;for(var i=encodeURIComponent(t.slice(s,r+1)).substr(1).split("%"),o=0;i.length>o;o++)e.push(parseInt(i[o],16))}}return e}function M(t){for(var e=[],r=0;t.length>r;r++)e.push(255&t.charCodeAt(r));return e}function T(t){return W.toByteArray(t)}function q(t,e,r,n){for(var s=0;n>s&&!(s+r>=e.length||s>=t.length);s++)e[s+r]=t[s];return s}function D(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function O(t,e){F("number"==typeof t,"cannot write a non-number as a number"),F(t>=0,"specified a negative value for writing an unsigned value"),F(e>=t,"value is larger than maximum value for type"),F(Math.floor(t)===t,"value has a fractional component")}function P(t,e,r){F("number"==typeof t,"cannot write a non-number as a number"),F(e>=t,"value larger than maximum allowed value"),F(t>=r,"value smaller than minimum allowed value"),F(Math.floor(t)===t,"value has a fractional component")}function N(t,e,r){F("number"==typeof t,"cannot write a non-number as a number"),F(e>=t,"value larger than maximum allowed value"),F(t>=r,"value smaller than minimum allowed value")}function F(t,e){if(!t)throw Error(e||"Failed assertion")}var W=t("base64-js"),H=t("ieee754");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192,n._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var t=new Uint8Array(0);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),n.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.isBuffer=function(t){return!(null===t||void 0===t||!t._isBuffer)},n.byteLength=function(t,e){var r;switch(t+="",e||"utf8"){case"hex":r=t.length/2;break;case"utf8":case"utf-8":r=U(t).length;break;case"ascii":case"binary":case"raw":r=t.length;break;case"base64":r=T(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*t.length;break;default:throw Error("Unknown encoding")}return r},n.concat=function(t,e){if(F(I(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new n(0);if(1===t.length)return t[0];var r;if("number"!=typeof e)for(e=0,r=0;t.length>r;r++)e+=t[r].length;var s=new n(e),i=0;for(r=0;t.length>r;r++){var o=t[r];o.copy(s,i),i+=o.length}return s},n.prototype.write=function(t,e,r,n){if(isFinite(e))isFinite(r)||(n=r,r=void 0);else{var c=n;n=e,e=r,r=c}e=Number(e)||0;var u=this.length-e;switch(r?(r=Number(r),r>u&&(r=u)):r=u,n=((n||"utf8")+"").toLowerCase()){case"hex":return s(this,t,e,r);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i(this,t,e,r);case"ascii":return o(this,t,e,r);case"binary":return a(this,t,e,r);case"base64":return h(this,t,e,r);default:throw Error("Unknown encoding")}},n.prototype.toString=function(t,e,r){var n=this;if(t=((t||"utf8")+"").toLowerCase(),e=Number(e)||0,r=void 0!==r?Number(r):r=n.length,r===e)return"";switch(t){case"hex":return p(n,e,r);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(n,e,r);case"ascii":return l(n,e,r);case"binary":return f(n,e,r);case"base64":return c(n,e,r);default:throw Error("Unknown encoding")}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.copy=function(t,e,r,n){var s=this;if(r||(r=0),n||0===n||(n=this.length),e||(e=0),n!==r&&0!==t.length&&0!==s.length){F(n>=r,"sourceEnd < sourceStart"),F(e>=0&&t.length>e,"targetStart out of bounds"),F(r>=0&&s.length>r,"sourceStart out of bounds"),F(n>=0&&s.length>=n,"sourceEnd out of bounds"),n>this.length&&(n=this.length),n-r>t.length-e&&(n=t.length-e+r);for(var i=0;n-r>i;i++)t[i+e]=this[i+r]}},n.prototype.slice=function(t,e){var r=this.length;if(t=C(t,r,0),e=C(e,r,r),n._useTypedArrays)return S(this.subarray(t,e));for(var s=e-t,i=new n(s,void 0,!0),o=0;s>o;o++)i[o]=this[o+t];return i},n.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},n.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},n.prototype.readUInt8=function(t,e){return e||(F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void 0:this[t]},n.prototype.readUInt16LE=function(t,e){return d(this,t,!0,e)},n.prototype.readUInt16BE=function(t,e){return d(this,t,!1,e)},n.prototype.readUInt32LE=function(t,e){return g(this,t,!0,e)},n.prototype.readUInt32BE=function(t,e){return g(this,t,!1,e)},n.prototype.readInt8=function(t,e){if(e||(F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){var r=128&this[t];return r?-1*(255-this[t]+1):this[t]}},n.prototype.readInt16LE=function(t,e){return b(this,t,!0,e)},n.prototype.readInt16BE=function(t,e){return b(this,t,!1,e)},n.prototype.readInt32LE=function(t,e){return y(this,t,!0,e)},n.prototype.readInt32BE=function(t,e){return y(this,t,!1,e)},n.prototype.readFloatLE=function(t,e){return v(this,t,!0,e)},n.prototype.readFloatBE=function(t,e){return v(this,t,!1,e)},n.prototype.readDoubleLE=function(t,e){return m(this,t,!0,e)},n.prototype.readDoubleBE=function(t,e){return m(this,t,!1,e)},n.prototype.writeUInt8=function(t,e,r){r||(F(void 0!==t&&null!==t,"missing value"),F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"trying to write beyond buffer length"),O(t,255)),e>=this.length||(this[e]=t)},n.prototype.writeUInt16LE=function(t,e,r){w(this,t,e,!0,r)},n.prototype.writeUInt16BE=function(t,e,r){w(this,t,e,!1,r)},n.prototype.writeUInt32LE=function(t,e,r){k(this,t,e,!0,r)},n.prototype.writeUInt32BE=function(t,e,r){k(this,t,e,!1,r)},n.prototype.writeInt8=function(t,e,r){r||(F(void 0!==t&&null!==t,"missing value"),F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"Trying to write beyond buffer length"),P(t,127,-128)),e>=this.length||(t>=0?this.writeUInt8(t,e,r):this.writeUInt8(255+t+1,e,r))},n.prototype.writeInt16LE=function(t,e,r){x(this,t,e,!0,r)},n.prototype.writeInt16BE=function(t,e,r){x(this,t,e,!1,r)},n.prototype.writeInt32LE=function(t,e,r){_(this,t,e,!0,r)},n.prototype.writeInt32BE=function(t,e,r){_(this,t,e,!1,r)},n.prototype.writeFloatLE=function(t,e,r){A(this,t,e,!0,r)},n.prototype.writeFloatBE=function(t,e,r){A(this,t,e,!1,r)},n.prototype.writeDoubleLE=function(t,e,r){E(this,t,e,!0,r)},n.prototype.writeDoubleBE=function(t,e,r){E(this,t,e,!1,r)},n.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),F("number"==typeof t&&!isNaN(t),"value is not a number"),F(r>=e,"end < start"),r!==e&&0!==this.length){F(e>=0&&this.length>e,"start out of bounds"),F(r>=0&&this.length>=r,"end out of bounds");for(var n=e;r>n;n++)this[n]=t}},n.prototype.inspect=function(){for(var t=[],e=this.length,n=0;e>n;n++)if(t[n]=R(this[n]),n===r.INSPECT_MAX_BYTES){t[n+1]="...";break}return"<Buffer "+t.join(" ")+">"},n.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(n._useTypedArrays)return new n(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var z=n.prototype},{"base64-js":5,ieee754:6}],5:[function(t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function t(t){var e=t.charCodeAt(0);return e===o?62:e===a?63:h>e?-1:h+10>e?e-h+26+26:u+26>e?e-u:c+26>e?e-c+26:void 0}function n(e){function r(t){c[l++]=t}var n,s,o,a,h,c;if(e.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var u=e.length;h="="===e.charAt(u-2)?2:"="===e.charAt(u-1)?1:0,c=new i(3*e.length/4-h),o=h>0?e.length-4:e.length;var l=0;for(n=0,s=0;o>n;n+=4,s+=3)a=t(e.charAt(n))<<18|t(e.charAt(n+1))<<12|t(e.charAt(n+2))<<6|t(e.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===h?(a=t(e.charAt(n))<<2|t(e.charAt(n+1))>>4,r(255&a)):1===h&&(a=t(e.charAt(n))<<10|t(e.charAt(n+1))<<4|t(e.charAt(n+2))>>2,r(255&a>>8),r(255&a)),c}function s(t){function e(t){return r.charAt(t)}function n(t){return e(63&t>>18)+e(63&t>>12)+e(63&t>>6)+e(63&t)}var s,i,o,a=t.length%3,h="";for(s=0,o=t.length-a;o>s;s+=3)i=(t[s]<<16)+(t[s+1]<<8)+t[s+2],h+=n(i);switch(a){case 1:i=t[t.length-1],h+=e(i>>2),h+=e(63&i<<4),h+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],h+=e(i>>10),h+=e(63&i>>4),h+=e(63&i<<2),h+="="}return h}var i="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var o="+".charCodeAt(0),a="/".charCodeAt(0),h="0".charCodeAt(0),c="a".charCodeAt(0),u="A".charCodeAt(0);e.exports.toByteArray=n,e.exports.fromByteArray=s})()},{}],6:[function(t,e,r){r.read=function(t,e,r,n,s){var i,o,a=8*s-n-1,h=(1<<a)-1,c=h>>1,u=-7,l=r?s-1:0,f=r?-1:1,p=t[e+l];for(l+=f,i=p&(1<<-u)-1,p>>=-u,u+=a;u>0;i=256*i+t[e+l],l+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+l],l+=f,u-=8);if(0===i)i=1-c;else{if(i===h)return o?0/0:1/0*(p?-1:1);o+=Math.pow(2,n),i-=c}return(p?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,s,i){var o,a,h,c=8*i-s-1,u=(1<<c)-1,l=u>>1,f=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),1>e*(h=Math.pow(2,-o))&&(o--,h*=2),e+=o+l>=1?f/h:f*Math.pow(2,1-l),e*h>=2&&(o++,h/=2),o+l>=u?(a=0,o=u):o+l>=1?(a=(e*h-1)*Math.pow(2,s),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,s),o=0));s>=8;t[r+p]=255&a,p+=d,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],7:[function(t,e){function r(t){return this instanceof r?(o.call(this,t),a.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",n),void 0):new r(t)}function n(){if(!this.allowHalfOpen&&!this._writableState.ended){var t=this;i(function(){t.end()})}}e.exports=r;var s=t("inherits"),i=t("process/browser.js").nextTick,o=t("./readable.js"),a=t("./writable.js");s(r,o),r.prototype.write=a.prototype.write,r.prototype.end=a.prototype.end,r.prototype._write=a.prototype._write},{"./readable.js":11,"./writable.js":13,inherits:2,"process/browser.js":9}],8:[function(t,e){function r(){n.call(this)}e.exports=r;var n=t("events").EventEmitter,s=t("inherits");s(r,n),r.Readable=t("./readable.js"),r.Writable=t("./writable.js"),r.Duplex=t("./duplex.js"),r.Transform=t("./transform.js"),r.PassThrough=t("./passthrough.js"),r.Stream=r,r.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&c.pause&&c.pause()}function s(){c.readable&&c.resume&&c.resume()}function i(){u||(u=!0,t.end())}function o(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(h(),0===n.listenerCount(this,"error"))throw t}function h(){c.removeListener("data",r),t.removeListener("drain",s),c.removeListener("end",i),c.removeListener("close",o),c.removeListener("error",a),t.removeListener("error",a),c.removeListener("end",h),c.removeListener("close",h),t.removeListener("close",h)}var c=this;c.on("data",r),t.on("drain",s),t._isStdio||e&&e.end===!1||(c.on("end",i),c.on("close",o));var u=!1;return c.on("error",a),t.on("error",a),c.on("end",h),c.on("close",h),t.on("close",h),t.emit("pipe",c),t}},{"./duplex.js":7,"./passthrough.js":10,"./readable.js":11,"./transform.js":12,"./writable.js":13,events:1,inherits:2}],9:[function(t,e){e.exports=t(3)},{}],10:[function(t,e){function r(t){return this instanceof r?(n.call(this,t),void 0):new r(t)}e.exports=r;var n=t("./transform.js"),s=t("inherits");s(r,n),r.prototype._transform=function(t,e,r){r(null,t)}},{"./transform.js":12,inherits:2}],11:[function(t,e){(function(r){function n(e){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_||(_=t("string_decoder").StringDecoder),this.decoder=new _(e.encoding),this.encoding=e.encoding)}function s(t){return this instanceof s?(this._readableState=new n(t,this),this.readable=!0,E.call(this),void 0):new s(t)}function i(t,e,r,n,s){var i=c(e,r);if(i)t.emit("error",i);else if(null===r||void 0===r)e.reading=!1,e.ended||u(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!s){var a=Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&s){var a=Error("stream.unshift() after end event");t.emit("error",a)}else!e.decoder||s||n||(r=e.decoder.write(r)),e.length+=e.objectMode?1:r.length,s?e.buffer.unshift(r):(e.reading=!1,e.buffer.push(r)),e.needReadable&&l(t),p(t,e);else s||(e.reading=!1);return o(e)}function o(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function a(t){if(t>=j)t=j;else{t--;for(var e=1;32>e;e<<=1)t|=t>>e;t++}return t}function h(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||null===t?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:0>=t?0:(t>e.highWaterMark&&(e.highWaterMark=a(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function c(t,e){var r=null;return L.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||r||(r=new TypeError("Invalid non-string/buffer chunk")),r}function u(t,e){if(e.decoder&&!e.ended){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.length>0?l(t):w(t)}function l(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?S(function(){f(t)}):f(t))}function f(t){t.emit("readable")}function p(t,e){e.readingMore||(e.readingMore=!0,S(function(){d(t,e)}))}function d(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function g(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&b(t)}}function b(t){function e(t){var e=t.write(r);!1===e&&n.awaitDrain++}var r,n=t._readableState;for(n.awaitDrain=0;n.pipesCount&&null!==(r=t.read());)if(1===n.pipesCount?e(n.pipes,0,null):k(n.pipes,e),t.emit("data",r),n.awaitDrain>0)return;return 0===n.pipesCount?(n.flowing=!1,A.listenerCount(t,"data")>0&&v(t),void 0):(n.ranOut=!0,void 0)}function y(){this._readableState.ranOut&&(this._readableState.ranOut=!1,b(this))}function v(t,e){var r=t._readableState;if(r.flowing)throw Error("Cannot switch to old mode now.");var n=e||!1,s=!1;t.readable=!0,t.pipe=E.prototype.pipe,t.on=t.addListener=E.prototype.on,t.on("readable",function(){s=!0;for(var e;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(s=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,s?S(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function m(t,e){var r,n=e.buffer,s=e.length,i=!!e.decoder,o=!!e.objectMode;if(0===n.length)return null;if(0===s)r=null;else if(o)r=n.shift();else if(!t||t>=s)r=i?n.join(""):L.concat(n,s),n.length=0;else if(n[0].length>t){var a=n[0];r=a.slice(0,t),n[0]=a.slice(t)}else if(t===n[0].length)r=n.shift();else{r=i?"":new L(t);for(var h=0,c=0,u=n.length;u>c&&t>h;c++){var a=n[0],l=Math.min(t-h,a.length);i?r+=a.slice(0,l):a.copy(r,h,0,l),a.length>l?n[0]=a.slice(l):n.shift(),h+=l}}return r}function w(t){var e=t._readableState;if(e.length>0)throw Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,S(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function k(t,e){for(var r=0,n=t.length;n>r;r++)e(t[r],r)}function x(t,e){for(var r=0,n=t.length;n>r;r++)if(t[r]===e)return r;return-1}e.exports=s,s.ReadableState=n;var _,A=t("events").EventEmitter,E=t("./index.js"),L=t("buffer").Buffer,S=t("process/browser.js").nextTick,C=t("inherits");C(s,E),s.prototype.push=function(t,e){var r=this._readableState;return"string"!=typeof t||r.objectMode||(e=e||r.defaultEncoding,e!==r.encoding&&(t=new L(t,e),e="")),i(this,r,t,e,!1)},s.prototype.unshift=function(t){var e=this._readableState;return i(this,e,t,"",!0)},s.prototype.setEncoding=function(e){_||(_=t("string_decoder").StringDecoder),this._readableState.decoder=new _(e),this._readableState.encoding=e};var j=8388608;s.prototype.read=function(t){var e=this._readableState;e.calledRead=!0;var r=t;if(("number"!=typeof t||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return l(this),null;if(t=h(t,e),0===t&&e.ended)return 0===e.length&&w(this),null;var n=e.needReadable;e.length-t<=e.highWaterMark&&(n=!0),(e.ended||e.reading)&&(n=!1),n&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),n&&!e.reading&&(t=h(r,e));var s;return s=t>0?m(t,e):null,null===s&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&w(this),s},s.prototype._read=function(){this.emit("error",Error("not implemented"))},s.prototype.pipe=function(t,e){function n(t){t===u&&i()}function s(){t.end()}function i(){t.removeListener("close",a),t.removeListener("finish",h),t.removeListener("drain",d),t.removeListener("error",o),t.removeListener("unpipe",n),u.removeListener("end",s),u.removeListener("end",i),(!t._writableState||t._writableState.needDrain)&&d()}function o(e){c(),0===v&&0===A.listenerCount(t,"error")&&t.emit("error",e)}function a(){t.removeListener("finish",h),c()}function h(){t.removeListener("close",a),c()}function c(){u.unpipe(t)}var u=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1;var f=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,p=f?s:i;l.endEmitted?S(p):u.once("end",p),t.on("unpipe",n);var d=g(u);t.on("drain",d);var v=A.listenerCount(t,"error");return t.once("error",o),t.once("close",a),t.once("finish",h),t.emit("pipe",u),l.flowing||(this.on("readable",y),l.flowing=!0,S(function(){b(u)})),t},s.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",y),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",y),e.flowing=!1;for(var s=0;n>s;s++)r[s].emit("unpipe",this);return this}var s=x(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},s.prototype.on=function(t,e){var r=E.prototype.on.call(this,t,e);if("data"!==t||this._readableState.flowing||v(this),"readable"===t&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&l(this,n):this.read(0))}return r},s.prototype.addListener=s.prototype.on,s.prototype.resume=function(){v(this),this.read(0),this.emit("resume")},s.prototype.pause=function(){v(this,!0),this.emit("pause")},s.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;t.on("end",function(){if(e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)}),t.on("data",function(s){if(e.decoder&&(s=e.decoder.write(s)),s&&(e.objectMode||s.length)){var i=n.push(s);i||(r=!0,t.pause())}});for(var s in t)"function"==typeof t[s]&&this[s]===void 0&&(this[s]=function(e){return function(){return t[e].apply(t,arguments)}}(s));var i=["error","close","destroy","pause","resume"];return k(i,function(e){t.on(e,function(t){return n.emit.apply(n,e,t)})}),n._read=function(){r&&(r=!1,t.resume())},n},s._fromList=m}).call(this,t("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":8,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,buffer:4,events:1,inherits:2,"process/browser.js":9,string_decoder:14}],12:[function(t,e){function r(t,e){this.afterTransform=function(t,r){return n(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function n(t,e,r){var n=t._transformState;n.transforming=!1;var s=n.writecb;if(!s)return t.emit("error",Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&t.push(r),s&&s(e);var i=t._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&t._read(i.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),this._transformState=new r(t,this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(t){i(e,t)}):i(e)})}function i(t,e){if(e)return t.emit("error",e);var r=t._writableState;t._readableState;var n=t._transformState;if(r.length)throw Error("calling transform done when ws.length != 0");if(n.transforming)throw Error("calling transform done when still transforming");return t.push(null)}e.exports=s;var o=t("./duplex.js"),a=t("inherits");a(s,o),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,o.prototype.push.call(this,t,e)},s.prototype._transform=function(){throw Error("not implemented")},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},s.prototype._read=function(){var t=this._transformState;t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./duplex.js":7,inherits:2}],13:[function(t,e){function r(t,e,r){this.chunk=t,this.encoding=e,this.callback=r}function n(t,e){t=t||{};var r=t.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!t.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){f(e,t)},this.writecb=null,this.writelen=0,this.buffer=[]}function s(t){return this instanceof s||this instanceof x.Duplex?(this._writableState=new n(t,this),this.writable=!0,x.call(this),void 0):new s(t)}function i(t,e,r){var n=Error("write after end");t.emit("error",n),_(function(){r(n)})}function o(t,e,r,n){var s=!0;if(!A.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!e.objectMode){var i=new TypeError("Invalid non-string/buffer chunk");t.emit("error",i),_(function(){n(i)}),s=!1}return s}function a(t,e,r){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=new A(e,r)),e}function h(t,e,n,s,i){n=a(e,n,s);var o=e.objectMode?1:n.length;e.length+=o;var h=e.length<e.highWaterMark;return e.needDrain=!h,e.writing?e.buffer.push(new r(n,s,i)):c(t,e,o,n,s,i),h}function c(t,e,r,n,s,i){e.writelen=r,e.writecb=i,e.writing=!0,e.sync=!0,t._write(n,s,e.onwrite),e.sync=!1}function u(t,e,r,n,s){r?_(function(){s(n)}):s(n),t.emit("error",n)}function l(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function f(t,e){var r=t._writableState,n=r.sync,s=r.writecb;if(l(r),e)u(t,r,n,e,s);else{var i=b(t,r);i||r.bufferProcessing||!r.buffer.length||g(t,r),n?_(function(){p(t,r,i,s)}):p(t,r,i,s)}}function p(t,e,r,n){r||d(t,e),n(),r&&y(t,e)}function d(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function g(t,e){e.bufferProcessing=!0;for(var r=0;e.buffer.length>r;r++){var n=e.buffer[r],s=n.chunk,i=n.encoding,o=n.callback,a=e.objectMode?1:s.length;if(c(t,e,a,s,i,o),e.writing){r++;break}}e.bufferProcessing=!1,e.buffer.length>r?e.buffer=e.buffer.slice(r):e.buffer.length=0}function b(t,e){return e.ending&&0===e.length&&!e.finished&&!e.writing}function y(t,e){var r=b(t,e);return r&&(e.finished=!0,t.emit("finish")),r}function v(t,e,r){e.ending=!0,y(t,e),r&&(e.finished?_(r):t.once("finish",r)),e.ended=!0}e.exports=s,s.WritableState=n;var m="undefined"!=typeof Uint8Array?function(t){return t instanceof Uint8Array}:function(t){return t&&t.constructor&&"Uint8Array"===t.constructor.name},w="undefined"!=typeof ArrayBuffer?function(t){return t instanceof ArrayBuffer}:function(t){return t&&t.constructor&&"ArrayBuffer"===t.constructor.name},k=t("inherits"),x=t("./index.js"),_=t("process/browser.js").nextTick,A=t("buffer").Buffer;k(s,x),s.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))},s.prototype.write=function(t,e,r){var n=this._writableState,s=!1;return"function"==typeof e&&(r=e,e=null),!A.isBuffer(t)&&m(t)&&(t=new A(t)),w(t)&&"undefined"!=typeof Uint8Array&&(t=new A(new Uint8Array(t))),A.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=function(){}),n.ended?i(this,n,r):o(this,n,t,r)&&(s=h(this,n,t,e,r)),s},s.prototype._write=function(t,e,r){r(Error("not implemented"))},s.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),t!==void 0&&null!==t&&this.write(t,e),n.ending||n.finished||v(this,n,r)}},{"./index.js":8,buffer:4,inherits:2,"process/browser.js":9}],14:[function(t,e,r){function n(t){if(t&&!a.isEncoding(t))throw Error("Unknown encoding: "+t)}function s(t){return t.toString(this.encoding)}function i(t){var e=this.charReceived=t.length%2;return this.charLength=e?2:0,e}function o(t){var e=this.charReceived=t.length%3;return this.charLength=e?3:0,e}var a=t("buffer").Buffer,h=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return this.write=s,void 0}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};h.prototype.write=function(t){for(var e="",r=0;this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,r,n),this.charReceived+=n-r,r=n,this.charReceived<this.charLength)return"";e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var s=e.charCodeAt(e.length-1);if(!(s>=55296&&56319>=s)){if(this.charReceived=this.charLength=0,n==t.length)return e;t=t.slice(n,t.length);break}this.charLength+=this.surrogateSize,e=""}var i=this.detectIncompleteChar(t),o=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-i,o),this.charReceived=i,o-=i),e+=t.toString(this.encoding,0,o);var o=e.length-1,s=e.charCodeAt(o);if(s>=55296&&56319>=s){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(e.charAt(e.length-1),this.encoding),e.substring(0,o)}return e},h.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&6==r>>5){this.charLength=2;break}if(2>=e&&14==r>>4){this.charLength=3;break}if(3>=e&&30==r>>3){this.charLength=4;break}}return e},h.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,s=this.encoding;e+=n.slice(0,r).toString(s)}return e}},{buffer:4}],hypernal:[function(t,e){e.exports=t("2HXSAl")},{}],"2HXSAl":[function(t,e){"use strict";function r(t){var e=t.getAttribute("style")||"";t.setAttribute("style",e+"overflow-y: auto; /* white-space: pre; */")}function n(t){t&&(t.scrollTop=t.scrollHeight)}var s=t("./term"),i=t("through");e.exports=function(t){var e=new s(t);e.open();var o=i(e.write.bind(e));return o.appendTo=function(t){"string"==typeof t&&(t=document.querySelector(t)),t.appendChild(e.element),r(t),o.container=t,e.element.style.position="relative"},o.writeln=function(t){e.writeln(t),o.tail&&n(o.container)},o.write=function(t){e.write(t),o.tail&&n(o.container)},o.reset=e.reset.bind(e),o.element=e.element,o.term=e,o}},{"./term":44,through:43}],17:[function(t,e){"use strict";e.exports=function(t){t.prototype.blankLine=function(t){for(var e=t?this.curAttr:this.defAttr,r=[e," "],n=[],s=0;this.cols>s;s++)n[s]=r;return n}}},{}],18:[function(t,e){"use strict";e.exports=function(t){t.charsets={},t.charsets.SCLD={"`":"◆",a:"▒",b:" ",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"␤",i:" ",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.charsets.UK=null,t.charsets.US=null,t.charsets.Dutch=null,t.charsets.Finnish=null,t.charsets.French=null,t.charsets.FrenchCanadian=null,t.charsets.German=null,t.charsets.Italian=null,t.charsets.NorwegianDanish=null,t.charsets.Spanish=null,t.charsets.Swedish=null,t.charsets.Swiss=null,t.charsets.ISOLatin=null}},{}],19:[function(t,e){"use strict";e.exports=function(t){t.colors=["#2e3436","#cc0000","#4e9a06","#c4a000","#3465a4","#75507b","#06989a","#d3d7cf","#555753","#ef2929","#8ae234","#fce94f","#729fcf","#ad7fa8","#34e2e2","#eeeeec"],t.colors=function(){function e(t,e,n){s.push("#"+r(t)+r(e)+r(n))}function r(t){return t=t.toString(16),2>t.length?"0"+t:t}var n,s=t.colors,i=[0,95,135,175,215,255];for(n=0;216>n;n++)e(i[0|n/36%6],i[0|n/6%6],i[n%6]);for(n=0;24>n;n++)i=8+10*n,e(i,i,i);return s}(),t.defaultColors={bg:"#000000",fg:"#f0f0f0"},t.colors[256]=t.defaultColors.bg,t.colors[257]=t.defaultColors.fg}},{}],20:[function(t,e){"use strict";e.exports=function(t){t.prototype.charAttributes=function(t){for(var e,r,n,s=t.length,i=0;s>i;i++)if(n=t[i],n>=30&&37>=n)this.curAttr=-261633&this.curAttr|n-30<<9;else if(n>=40&&47>=n)this.curAttr=-512&this.curAttr|n-40;else if(n>=90&&97>=n)n+=8,this.curAttr=-261633&this.curAttr|n-90<<9;else if(n>=100&&107>=n)n+=8,this.curAttr=-512&this.curAttr|n-100;else if(0===n)this.curAttr=this.defAttr;else if(1===n)this.curAttr=this.curAttr|1<<18;else if(4===n)this.curAttr=this.curAttr|2<<18;else if(7===n||27===n){if(7===n){if(4&this.curAttr>>18)continue;this.curAttr=this.curAttr|4<<18}else if(27===n){if(4&~(this.curAttr>>18))continue;this.curAttr=-1048577&this.curAttr}e=511&this.curAttr,r=511&this.curAttr>>9,this.curAttr=-262144&this.curAttr|(e<<9|r)}else if(22===n)this.curAttr=-262145&this.curAttr;else if(24===n)this.curAttr=-524289&this.curAttr;else if(39===n)this.curAttr=-261633&this.curAttr,this.curAttr=this.curAttr|(511&this.defAttr>>9)<<9;else if(49===n)this.curAttr=-512&this.curAttr,this.curAttr=this.curAttr|511&this.defAttr;else if(38===n){if(5!==t[i+1])continue;i+=2,n=255&t[i],this.curAttr=-261633&this.curAttr|n<<9}else if(48===n){if(5!==t[i+1])continue;i+=2,n=255&t[i],this.curAttr=-512&this.curAttr|n}}}},{}],21:[function(t,e){"use strict";e.exports=function(t){t.prototype.saveCursor=function(){this.savedX=this.x,this.savedY=this.y},t.prototype.restoreCursor=function(){this.x=this.savedX||0,this.y=this.savedY||0},t.prototype.cursorUp=function(t){var e=t[0];1>e&&(e=1),this.y-=e,0>this.y&&(this.y=0)},t.prototype.cursorDown=function(t){var e=t[0];1>e&&(e=1),this.y+=e,this.y>=this.rows&&(this.y=this.rows-1)},t.prototype.cursorForward=function(t){var e=t[0];1>e&&(e=1),this.x+=e,this.x>=this.cols&&(this.x=this.cols-1)},t.prototype.cursorBackward=function(t){var e=t[0];1>e&&(e=1),this.x-=e,0>this.x&&(this.x=0)},t.prototype.cursorPos=function(t){var e,r;e=t[0]-1,r=t.length>=2?t[1]-1:0,0>e?e=0:e>=this.rows&&(e=this.rows-1),0>r?r=0:r>=this.cols&&(r=this.cols-1),this.x=r,this.y=e
},t.prototype.cursorNextLine=function(t){var e=t[0];1>e&&(e=1),this.y+=e,this.y>=this.rows&&(this.y=this.rows-1),this.x=0},t.prototype.cursorPrecedingLine=function(t){var e=t[0];1>e&&(e=1),this.y-=e,0>this.y&&(this.y=0),this.x=0},t.prototype.cursorCharAbsolute=function(t){var e=t[0];1>e&&(e=1),this.x=e-1},t.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this.x=this.nextStop()},t.prototype.cursorBackwardTab=function(t){for(var e=t[0]||1;e--;)this.x=this.prevStop()}}},{}],22:[function(t,e){"use strict";e.exports=function(t){t.prototype.insertChars=function(t){var e,r,n,s;for(e=t[0],1>e&&(e=1),r=this.y+this.ybase,n=this.x,s=[this.curAttr," "];e--&&this.cols>n;)this.lines[r].splice(n++,0,s),this.lines[r].pop()},t.prototype.insertLines=function(t){var e,r,n;for(e=t[0],1>e&&(e=1),r=this.y+this.ybase,n=this.rows-1-this.scrollBottom,n=this.rows-1+this.ybase-n+1;e--;)this.lines.splice(r,0,this.blankLine(!0)),this.lines.splice(n,1);this.updateRange(this.y),this.updateRange(this.scrollBottom)},t.prototype.deleteLines=function(t){var e,r,n;for(e=t[0],1>e&&(e=1),r=this.y+this.ybase,n=this.rows-1-this.scrollBottom,n=this.rows-1+this.ybase-n;e--;)this.lines.splice(n+1,0,this.blankLine(!0)),this.lines.splice(r,1);this.updateRange(this.y),this.updateRange(this.scrollBottom)},t.prototype.deleteChars=function(t){var e,r,n;for(e=t[0],1>e&&(e=1),r=this.y+this.ybase,n=[this.curAttr," "];e--;)this.lines[r].splice(this.x,1),this.lines[r].push(n)},t.prototype.eraseChars=function(t){var e,r,n,s;for(e=t[0],1>e&&(e=1),r=this.y+this.ybase,n=this.x,s=[this.curAttr," "];e--&&this.cols>n;)this.lines[r][n++]=s}}},{}],23:[function(t,e){"use strict";e.exports=function(t){t.prototype.charPosAbsolute=function(t){var e=t[0];1>e&&(e=1),this.x=e-1,this.x>=this.cols&&(this.x=this.cols-1)},t.prototype.HPositionRelative=function(t){var e=t[0];1>e&&(e=1),this.x+=e,this.x>=this.cols&&(this.x=this.cols-1)},t.prototype.linePosAbsolute=function(t){var e=t[0];1>e&&(e=1),this.y=e-1,this.y>=this.rows&&(this.y=this.rows-1)},t.prototype.VPositionRelative=function(t){var e=t[0];1>e&&(e=1),this.y+=e,this.y>=this.rows&&(this.y=this.rows-1)},t.prototype.HVPosition=function(t){1>t[0]&&(t[0]=1),1>t[1]&&(t[1]=1),this.y=t[0]-1,this.y>=this.rows&&(this.y=this.rows-1),this.x=t[1]-1,this.x>=this.cols&&(this.x=this.cols-1)}}},{}],24:[function(t,e){"use strict";e.exports=function(t){t.prototype.repeatPrecedingCharacter=function(t){for(var e=t[0]||1,r=this.lines[this.ybase+this.y],n=r[this.x-1]||[this.defAttr," "];e--;)r[this.x++]=n}}},{}],25:[function(t,e){"use strict";e.exports=function(t){t.prototype.softReset=function(){this.cursorHidden=!1,this.insertMode=!1,this.originMode=!1,this.wraparoundMode=!1,this.applicationKeypad=!1,this.scrollTop=0,this.scrollBottom=this.rows-1,this.curAttr=this.defAttr,this.x=this.y=0,this.charset=null,this.glevel=0,this.charsets=[null]}}},{}],26:[function(t,e){"use strict";e.exports=function(t){t.prototype.tabClear=function(t){var e=t[0];0>=e?delete this.tabs[this.x]:3===e&&(this.tabs={})}}},{}],27:[function(t,e){"use strict";e.exports=function(t){t.prototype.log=function(){if(t.debug&&window.console&&window.console.log){var e=Array.prototype.slice.call(arguments);window.console.log.apply(window.console,e)}},t.prototype.error=function(){if(t.debug&&window.console&&window.console.error){var e=Array.prototype.slice.call(arguments);window.console.error.apply(window.console,e)}}}},{}],28:[function(t,e){"use strict";e.exports=function(t){t.prototype.destroy=function(){this.readable=!1,this.writable=!1,this._events={},this.handler=function(){},this.write=function(){}}}},{}],29:[function(t,e){"use strict";e.exports=function(t){t.prototype.eraseRight=function(t,e){for(var r=this.lines[this.ybase+e],n=[this.curAttr," "];this.cols>t;t++)r[t]=n;this.updateRange(e)},t.prototype.eraseLeft=function(t,e){var r=this.lines[this.ybase+e],n=[this.curAttr," "];for(t++;t--;)r[t]=n;this.updateRange(e)},t.prototype.eraseLine=function(t){this.eraseRight(0,t)},t.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(this.eraseRight(this.x,this.y),e=this.y+1;this.rows>e;e++)this.eraseLine(e);break;case 1:for(this.eraseLeft(this.x,this.y),e=this.y;e--;)this.eraseLine(e);break;case 2:for(e=this.rows;e--;)this.eraseLine(e);break;case 3:}},t.prototype.eraseInLine=function(t){switch(t[0]){case 0:this.eraseRight(this.x,this.y);break;case 1:this.eraseLeft(this.x,this.y);break;case 2:this.eraseLine(this.y)}}}},{}],30:[function(t,e){"use strict";var r=t("../states");e.exports=function(t){t.prototype.index=function(){this.y++,this.y>this.scrollBottom&&(this.y--,this.scroll()),this.state=r.normal},t.prototype.reverseIndex=function(){var t;this.y--,this.y<this.scrollTop&&(this.y++,this.lines.splice(this.y+this.ybase,0,this.blankLine(!0)),t=this.rows-1-this.scrollBottom,this.lines.splice(this.rows-1+this.ybase-t+1,1),this.updateRange(this.scrollTop),this.updateRange(this.scrollBottom)),this.state=r.normal}}},{"../states":39}],31:[function(t,e){"use strict";e.exports=function(t){t.prototype.reset=function(){t.call(this,this.cols,this.rows),this.refresh(0,this.rows-1)}}},{}],32:[function(t,e){"use strict";var r=t("../states");e.exports=function(t){t.prototype.tabSet=function(){this.tabs[this.x]=!0,this.state=r.normal}}},{"../states":39}],33:[function(t,e){"use strict";function r(){var t=document.createElement("span");t.innerHTML="hello world",document.body.appendChild(t);var e=t.scrollWidth;t.style.fontWeight="bold";var r=t.scrollWidth;return document.body.removeChild(t),e!==r}e.exports=function(t){t.prototype.open=function(){var e,n=0;for(this.element=document.createElement("div"),this.element.className="terminal",this.children=[];this.rows>n;n++)e=document.createElement("div"),this.element.appendChild(e),this.children.push(e);this.refresh(0,this.rows-1),null===t.brokenBold&&(t.brokenBold=r()),this.element.style.backgroundColor=t.defaultColors.bg,this.element.style.color=t.defaultColors.fg}}},{}],34:[function(t,e){"use strict";e.exports=function(t){t.termName="xterm",t.geometry=[80,24],t.cursorBlink=!0,t.visualBell=!1,t.popOnBell=!1,t.scrollback=1e3,t.screenKeys=!1,t.programFeatures=!1,t.debug=!1}},{}],35:[function(t,e){"use strict";function r(){for(;this.y>=this.rows;){this.lines.push(this.blankLine());var t=document.createElement("div");this.element.appendChild(t),this.children.push(t),this.rows++}}e.exports=function(t){t.prototype.updateRange=function(t){this.refreshStart>t&&(this.refreshStart=t),t>this.refreshEnd&&(this.refreshEnd=t),r.bind(this)()},t.prototype.maxRange=function(){this.refreshStart=0,this.refreshEnd=this.rows-1}}},{}],36:[function(t,e){"use strict";e.exports=function(t){t.prototype.refresh=function(e,r){var n,s,i,o,a,h,c,u,l,f,p,d,g,b;for(c=this.cols,s=e;r>=s;s++){if(g=s+this.ydisp,o=this.lines[g],!o)return this.reset();for(a="",n=s===this.y&&this.cursorState&&this.ydisp===this.ybase&&!this.cursorHidden?this.x:-1,l=this.defAttr,i=0;c>i;i++){switch(u=o[i][0],h=o[i][1],i===n&&(u=-1),u!==l&&(l!==this.defAttr&&(a+="</span>"),u!==this.defAttr&&(-1===u?a+='<span class="reverse-video">':(a+='<span style="',p=511&u,f=511&u>>9,d=u>>18,1&d&&(t.brokenBold||(a+="font-weight:bold;"),8>f&&(f+=8)),2&d&&(a+="text-decoration:underline;"),256!==p&&(a+="background-color:"+t.colors[p]+";"),257!==f&&(a+="color:"+t.colors[f]+";"),a+='">'))),h){case"&":a+="&";break;case"<":a+="<";break;case">":a+=">";break;default:a+=" ">=h?" ":h}l=u}l!==this.defAttr&&(a+="</span>"),this.children[s].innerHTML=a}b&&b.appendChild(this.element)}}},{}],37:[function(t,e){"use strict";e.exports=function(t){t.prototype.setgCharset=function(t,e){this.charsets[t]=e,this.glevel===t&&(this.charset=e)}}},{}],38:[function(t,e){"use strict";e.exports=function(t){t.prototype.setgLevel=function(t){this.glevel=t,this.charset=this.charsets[t]}}},{}],39:[function(t,e){"use strict";e.exports={normal:0,escaped:1,csi:2,osc:3,charset:4,dcs:5,ignore:6}},{}],40:[function(t,e){"use strict";e.exports=function(t){t.prototype.setupStops=function(t){for(null!=t?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);this.cols>t;t+=8)this.tabs[t]=!0},t.prototype.prevStop=function(t){for(null==t&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this.cols?this.cols-1:0>t?0:t},t.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&this.cols>t;);return t>=this.cols?this.cols-1:0>t?0:t}}},{}],41:[function(t,e){"use strict";e.exports=function(t){t.prototype.ch=function(t){return t?[this.curAttr," "]:[this.defAttr," "]},t.prototype.is=function(e){var r=this.termName||t.termName;return 0===(r+"").indexOf(e)}}},{}],42:[function(t,e){"use strict";function r(t){return t.replace(/([^\r])\n/g,"$1\r\n")}function n(t){return/(^|\n) /.test(t)?t.split("\n").map(function(t){for(var e=0;" "===t.charAt(0);)t=t.slice(1),e++;for(;e--;)t="&nbsp;"+t;return t}).join("\r\n"):t}var s=t("./states");e.exports=function(t){t.prototype.write=function(e){e=r(e),e=n(e);var i,o,a=e.length,h=0;for(this.refreshStart=this.y,this.refreshEnd=this.y,this.ybase!==this.ydisp&&(this.ydisp=this.ybase,this.maxRange());a>h;h++)switch(o=e[h],this.state){case s.normal:switch(o){case"":this.bell();break;case"\n":case" ":case"\f":this.convertEol&&(this.x=0),this.y++;break;case"\r":this.x=0;break;case"\b":this.x>0&&this.x--;break;case" ":this.x=this.nextStop();break;case"":this.setgLevel(1);break;case"":this.setgLevel(0);break;case"":this.state=s.escaped;break;default:o>=" "&&(this.charset&&this.charset[o]&&(o=this.charset[o]),this.x>=this.cols&&(this.x=0,this.y++),this.lines[this.y+this.ybase]&&(this.lines[this.y+this.ybase][this.x]=[this.curAttr,o]),this.x++,this.updateRange(this.y))}break;case s.escaped:switch(o){case"[":this.params=[],this.currentParam=0,this.state=s.csi;break;case"]":this.params=[],this.currentParam=0,this.state=s.osc;break;case"P":this.params=[],this.currentParam=0,this.state=s.dcs;break;case"_":this.stateType="apc",this.state=s.ignore;break;case"^":this.stateType="pm",this.state=s.ignore;break;case"c":this.reset();break;case"E":this.x=0;break;case"D":this.index();break;case"M":this.reverseIndex();break;case"%":this.setgLevel(0),this.setgCharset(0,t.charsets.US),this.state=s.normal,h++;break;case"(":case")":case"*":case"+":case"-":case".":switch(o){case"(":this.gcharset=0;break;case")":this.gcharset=1;break;case"*":this.gcharset=2;break;case"+":this.gcharset=3;break;case"-":this.gcharset=1;break;case".":this.gcharset=2}this.state=s.charset;break;case"/":this.gcharset=3,this.state=s.charset,h--;break;case"N":break;case"O":break;case"n":this.setgLevel(2);break;case"o":this.setgLevel(3);break;case"|":this.setgLevel(3);break;case"}":this.setgLevel(2);break;case"~":this.setgLevel(1);break;case"7":this.saveCursor(),this.state=s.normal;break;case"8":this.restoreCursor(),this.state=s.normal;break;case"#":this.state=s.normal,h++;break;case"H":this.tabSet();break;case"=":this.log("Serial port requested application keypad."),this.applicationKeypad=!0,this.state=s.normal;break;case">":this.log("Switching back to normal keypad."),this.applicationKeypad=!1,this.state=s.normal;break;default:this.state=s.normal,this.error("Unknown ESC control: %s.",o)}break;case s.charset:switch(o){case"0":i=t.charsets.SCLD;break;case"A":i=t.charsets.UK;break;case"B":i=t.charsets.US;break;case"4":i=t.charsets.Dutch;break;case"C":case"5":i=t.charsets.Finnish;break;case"R":i=t.charsets.French;break;case"Q":i=t.charsets.FrenchCanadian;break;case"K":i=t.charsets.German;break;case"Y":i=t.charsets.Italian;break;case"E":case"6":i=t.charsets.NorwegianDanish;break;case"Z":i=t.charsets.Spanish;break;case"H":case"7":i=t.charsets.Swedish;break;case"=":i=t.charsets.Swiss;break;case"/":i=t.charsets.ISOLatin,h++;break;default:i=t.charsets.US}this.setgCharset(this.gcharset,i),this.gcharset=null,this.state=s.normal;break;case s.osc:if(""===o||""===o){switch(""===o&&h++,this.params.push(this.currentParam),this.params[0]){case 0:case 1:case 2:this.params[1]&&(this.title=this.params[1],this.handleTitle(this.title));break;case 3:break;case 4:case 5:break;case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:break;case 46:break;case 50:break;case 51:break;case 52:break;case 104:case 105:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:}this.params=[],this.currentParam=0,this.state=s.normal}else this.params.length?this.currentParam+=o:o>="0"&&"9">=o?this.currentParam=10*this.currentParam+o.charCodeAt(0)-48:";"===o&&(this.params.push(this.currentParam),this.currentParam="");break;case s.csi:if("?"===o||">"===o||"!"===o){this.prefix=o;break}if(o>="0"&&"9">=o){this.currentParam=10*this.currentParam+o.charCodeAt(0)-48;break}if("$"===o||'"'===o||" "===o||"'"===o){this.postfix=o;break}if(this.params.push(this.currentParam),this.currentParam=0,";"===o)break;switch(this.state=s.normal,o){case"A":this.cursorUp(this.params);break;case"B":this.cursorDown(this.params);break;case"C":this.cursorForward(this.params);break;case"D":this.cursorBackward(this.params);break;case"H":this.cursorPos(this.params);break;case"J":this.eraseInDisplay(this.params);break;case"K":this.eraseInLine(this.params);break;case"m":this.charAttributes(this.params);break;case"n":this.deviceStatus(this.params);break;case"@":this.insertChars(this.params);break;case"E":this.cursorNextLine(this.params);break;case"F":this.cursorPrecedingLine(this.params);break;case"G":this.cursorCharAbsolute(this.params);break;case"L":this.insertLines(this.params);break;case"M":this.deleteLines(this.params);break;case"P":this.deleteChars(this.params);break;case"X":this.eraseChars(this.params);break;case"`":this.charPosAbsolute(this.params);break;case"a":this.HPositionRelative(this.params);break;case"c":break;case"d":this.linePosAbsolute(this.params);break;case"e":this.VPositionRelative(this.params);break;case"f":this.HVPosition(this.params);break;case"h":break;case"l":break;case"r":break;case"s":this.saveCursor(this.params);break;case"u":this.restoreCursor(this.params);break;case"I":this.cursorForwardTab(this.params);break;case"S":break;case"T":2>this.params.length&&!this.prefix;break;case"Z":this.cursorBackwardTab(this.params);break;case"b":this.repeatPrecedingCharacter(this.params);break;case"g":this.tabClear(this.params);break;case"p":switch(this.prefix){case"!":this.softReset(this.params)}break;default:this.error("Unknown CSI code: %s.",o)}this.prefix="",this.postfix="";break;case s.dcs:if(""===o||""===o){switch(""===o&&h++,this.prefix){case"":break;case"$q":var c=this.currentParam;switch(c){case'"q':c='0"q';break;case'"p':c='61"p';break;case"r":c=""+(this.scrollTop+1)+";"+(this.scrollBottom+1)+"r";break;case"m":c="0m";break;default:this.error("Unknown DCS Pt: %s.",c),c=""}break;case"+p":break;default:this.error("Unknown DCS prefix: %s.",this.prefix)}this.currentParam=0,this.prefix="",this.state=s.normal}else this.currentParam?this.currentParam+=o:this.prefix||"$"===o||"+"===o?2===this.prefix.length?this.currentParam=o:this.prefix+=o:this.currentParam=o;break;case s.ignore:""===o||""===o?(""===o&&h++,this.stateData="",this.state=s.normal):(this.stateData||(this.stateData=""),this.stateData+=o)}this.updateRange(this.y),this.refresh(this.refreshStart,this.refreshEnd)},t.prototype.writeln=function(t){t=t.replace(/ /g,"&nbsp;"),this.write(t+" \r\n")}}},{"./states":39}],43:[function(t,e,r){(function(n){function s(t,e,r){function s(){for(;c.length&&!l.paused;){var t=c.shift();if(null===t)return l.emit("end");l.emit("data",t)}}function o(){l.writable=!1,e.call(l),!l.readable&&l.autoDestroy&&l.destroy()}t=t||function(t){this.queue(t)},e=e||function(){this.queue(null)};var a=!1,h=!1,c=[],u=!1,l=new i;return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(r&&r.autoDestroy===!1),l.write=function(e){return t.call(this,e),!l.paused},l.queue=l.push=function(t){return u?l:(null==t&&(u=!0),c.push(t),s(),l)},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&n.nextTick(function(){l.destroy()})}),l.end=function(t){return a?void 0:(a=!0,arguments.length&&l.write(t),o(),l)},l.destroy=function(){return h?void 0:(h=!0,a=!0,c.length=0,l.writable=l.readable=!1,l.emit("close"),l)},l.pause=function(){return l.paused?void 0:(l.paused=!0,l)},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),s(),l.paused||l.emit("drain"),l},l}var i=t("stream");r=e.exports=s,s.through=s}).call(this,t("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,stream:8}],44:[function(t,e){"use strict";function r(t){if(t=t||{},!(this instanceof r))return new r(t);this.cols=t.cols||500,this.rows=t.rows||100,this.ybase=0,this.ydisp=0,this.x=0,this.y=0,this.cursorState=0,this.cursorHidden=!1,this.convertEol=!1,this.state=n.normal,this.queue="",this.scrollTop=0,this.scrollBottom=this.rows-1,this.applicationKeypad=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!1,this.normal=null,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.element,this.children,this.refreshStart,this.refreshEnd,this.savedX,this.savedY,this.savedCols,this.readable=!0,this.writable=!0,this.defAttr=131840,this.curAttr=this.defAttr,this.params=[],this.currentParam=0,this.prefix="",this.postfix="",this.lines=[];for(var e=this.rows;e--;)this.lines.push(this.blankLine());this.tabs,this.setupStops()}var n=t("./lib/states");e.exports=r,t("./lib/colors")(r),t("./lib/options")(r),t("./lib/open")(r),t("./lib/destroy")(r),t("./lib/refresh")(r),t("./lib/write")(r),t("./lib/setgLevel"),t("./lib/setgCharset"),t("./lib/debug")(r),t("./lib/stops")(r),t("./lib/erase")(r),t("./lib/blankLine")(r),t("./lib/range")(r),t("./lib/util")(r),t("./lib/esc/index.js")(r),t("./lib/esc/reset.js")(r),t("./lib/esc/tabSet.js")(r),t("./lib/csi/charAttributes")(r),t("./lib/csi/insert-delete")(r),t("./lib/csi/position")(r),t("./lib/csi/cursor")(r),t("./lib/csi/repeatPrecedingCharacter")(r),t("./lib/csi/tabClear")(r),t("./lib/csi/softReset")(r),t("./lib/charsets.js")(r)},{"./lib/blankLine":17,"./lib/charsets.js":18,"./lib/colors":19,"./lib/csi/charAttributes":20,"./lib/csi/cursor":21,"./lib/csi/insert-delete":22,"./lib/csi/position":23,"./lib/csi/repeatPrecedingCharacter":24,"./lib/csi/softReset":25,"./lib/csi/tabClear":26,"./lib/debug":27,"./lib/destroy":28,"./lib/erase":29,"./lib/esc/index.js":30,"./lib/esc/reset.js":31,"./lib/esc/tabSet.js":32,"./lib/open":33,"./lib/options":34,"./lib/range":35,"./lib/refresh":36,"./lib/setgCharset":37,"./lib/setgLevel":38,"./lib/states":39,"./lib/stops":40,"./lib/util":41,"./lib/write":42}]},{},[]);var term=require("hypernal")(),tablify=require("tablify").tablify,request=require("browser-request"),url=require("url");term.appendTo(document.body);var termEl=term.term.element;termEl.style.font="13px Monaco, mono",termEl.style.height="100%",termEl.style.padding="5px",termEl.style.overflow="auto",termEl.style["white-space"]="pre";var query="http://npmsearch.com/query?fl=name,description,homepage&rows=200&sort=rating+desc&q=voxel";request({json:!0,url:query},function(t,e,r){var n=r.results.map(function(t){var e=t.description.length>60;return t.description=t.description.substr(0,60),e&&(t.description+="..."),t});term.write(tablify(n,{keys:["name","description","homepage"]}))});
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"browser-request": "0.3.1",
"tablify": "0.1.5",
"hypernal": "0.2.7"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment