diff --git a/client-side/download.js b/client-side/download.js index 5031ab2..d787e3f 100644 --- a/client-side/download.js +++ b/client-side/download.js @@ -2,15 +2,15 @@ (() => { require('/client-side/common.js'); const assert = require('/lib/assert.js'); + const base64 = require('base64-js'); const r = require('/read.js'); - const BASE_64 = 'base64'; const typeCache = {}; function saveTypeCache() { const composedCache = {}; for (let type in typeCache) { composedCache[type] = { sig: typeCache[type].sig, - type: typeCache[type].type.toBuffer().toString(BASE_64) + type: base64.fromByteArray(new Uint8Array(typeCache[type].type.toBuffer())) }; } localStorage.typeCache = JSON.stringify(composedCache); @@ -21,7 +21,7 @@ for (let typeName in composedCache) { typeCache[typeName] = { sig: composedCache[typeName].sig, - type: r.type(Buffer.from(composedCache[typeName].type, BASE_64)) + type: r.type(new Uint8Array(base64.toByteArray(composedCache[typeName].type)).buffer) }; } } diff --git a/compiled/download.js b/compiled/download.js index b253b5f..97fa997 100644 --- a/compiled/download.js +++ b/compiled/download.js @@ -1,3 +1,2 @@ -require=function t(e,r,n){function i(o,u){if(!r[o]){if(!e[o]){var f="function"==typeof require&&require;if(!u&&f)return f(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[o]={exports:{}};e[o][0].call(l.exports,function(t){var r=e[o][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o=200&&e.status<300||304===e.status;r?t[o]=e.response:t.text=e.statusText,n(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(a,i,f),e.responseType=o;for(var s in r)r.hasOwnProperty(s)&&e.setRequestHeader(s,r[s]);e.send(u)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(t,e,r){"use strict";var n=t("/lib/assert.js");if(n.instanceOf(window.Map,Function),n.instanceOf(window.Set,Function),n.instanceOf(window.ArrayBuffer,Function),n.instanceOf(window.Uint8Array,Function),n.instanceOf(window.Symbol,Function),t("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=t("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(t,e,r){(function(r,n){"use strict";"/"===n&&(n="");var i=t(n+"/lib/assert.js"),a=7;i.between(0,a,65536);var o=2,u=r.allocUnsafe(o);u.writeUInt16BE(a,0);var f=u.toString("base64");e.exports={VERSION_STRING:f}}).call(this,t("buffer").Buffer,"/")},{buffer:3}],"/lib/assert.js":[function(t,e,r){"use strict";var n=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var r=!1,i=!0,a=!1,o=void 0;try{for(var u,f=e[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;if(t instanceof s||void 0!==t&&null!==t&&t.constructor===s){r=!0;break}}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}if(!r)throw new TypeError(n.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(n.inspect(t)+" is not an integer")},between:function(t,e,r,i){if(e=r){var a=n.inspect(e)+" is not in ["+n.inspect(t)+","+n.inspect(r)+")";throw void 0===i?new RangeError(a):new RangeError(i+" ("+a+")")}},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t,e){var r=!0;try{t(),r=!1}catch(t){void 0!==e&&i.message(t,e)}i.assert(r,"Should throw an error")},equal:function(t,e){var r=new RangeError("Expected "+n.inspect(e)+" but got "+n.inspect(t));if(e&&e.constructor===Object){for(var a in e)if(e.hasOwnProperty(a))try{i.equal(t[a],e[a])}catch(t){throw r}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw r;try{i.equal(t.length,e.length)}catch(t){throw r}for(var o=0;o>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-string.js":[function(t,e,r){(function(r){"use strict";var n=t(r+"/assert.js"),i=t(r+"/growable-buffer.js"),a=4096;e.exports={toString:function(t){t&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),n.instanceOf(t,Uint8Array);for(var e=[],r=0;r239?4:i>223?3:i>191?2:1;if(r+u<=t.length){var f=void 0,s=void 0,l=void 0,c=void 0;switch(u){case 1:i<128&&(o=i);break;case 2:f=t[r+1],128===(192&f)&&(c=(31&i)<<6|63&f,c>127&&(o=c));break;case 3:f=t[r+1],s=t[r+2],128===(192&f)&&128===(192&s)&&(c=(15&i)<<12|(63&f)<<6|63&s,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:f=t[r+1],s=t[r+2],l=t[r+3],128===(192&f)&&128===(192&s)&&128===(192&l)&&(c=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&l,c>65535&&c<1114112&&(o=c))}}void 0===o?(o=65533,u=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|1023&o),e.push(o),r+=u}for(var h="",y=0;y>6),e.add(128|63&l)):l<55296||l>=57344?(e.add(224|l>>12),e.add(128|l>>6&63),e.add(128|63&l)):(l=65536+((1023&l)<<10|1023&l),e.add(240|l>>18),e.add(128|l>>12&63),e.add(128|l>>6&63),e.add(128|63&l))}}catch(t){a=!0,o=t}finally{try{!r&&f.return&&f.return()}finally{if(a)throw o}}return e.toBuffer()},toBinaryString:function(t){n.instanceOf(t,ArrayBuffer);var e="",r=new Uint8Array(t),i=!0,a=!1,o=void 0;try{for(var u,f=r[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;e+=String.fromCharCode(s)}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return e},fromBinaryString:function(t){n.instanceOf(t,String);for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),i=0;ithis.buffer.byteLength){var e=new ArrayBuffer(t<<1);new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=e}return this}},{key:"set",value:function(t,e){a.integer(t),a.integer(e),a.between(0,t,this.size,"Index out of bounds: "+String(t)),a.between(0,e,256,"Not a byte: "+String(e));var r=new Uint8Array(this.buffer);return r[t]=e,this}},{key:"setAll",value:function(t,e){a.instanceOf(e,ArrayBuffer),a.integer(t),a.between(0,t,this.size-e.byteLength+1,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer).set(new Uint8Array(e),t)}},{key:"get",value:function(t){return a.integer(t),a.between(0,t,this.size,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer)[t]}},{key:"add",value:function(t){var e=this.size,r=e+1;this.grow(r),this.size=r;var n=new Uint8Array(this.buffer);return n[e]=t,this}},{key:"addAll",value:function(t){a.instanceOf(t,ArrayBuffer);var e=this.size,r=this.size+t.byteLength;return this.grow(r),this.size=r,new Uint8Array(this.buffer).set(new Uint8Array(t),e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}();e.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return S(t)===S(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function r(t){s(t,"string")}function a(t){r(t),f(t,S,"isPositive")}function o(t){s(t,"number")}function u(t){if(s(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function f(t,e,r){if(!e.call(null,t))throw new Error("Condition "+r+" failed for value "+t)}function s(t,e){if(("undefined"==typeof t?"undefined":n(t))!==e)throw new Error("Not a "+e+": "+t)}var l=i.subPositive=function(t,e){if(a(t),a(e),!A(t,e))throw new Error("x must be greater or equal to y");for(var r=Math.max(t.length,e.length),n="",i=0,o=0,u=0;u=10;)l-=10,i++;0===l?o++:(n=String(l)+j(n,o),o=0)}return i>0&&(n=String(i)+j(n,o)),n},h=i.add=function(t,e){if(r(t),r(e),S(t)&&S(e))return c(t,e);if(m(t)&&m(e))return _(c(B(t),B(e)));if(T(B(t),B(e))){var n=t;t=e,e=n}var i=l(B(t),B(e));return S(t)?i:_(i)},y=i.sub=function(t,e){return r(t),r(e),h(t,_(e))},g=i.timesDigit=function(t,e){a(t),o(e);for(var r="",n=x(t),i=0,u=0,f=0;f=10;)s-=10,i++;0===s?u++:(r=String(s)+j(r,u),u=0)}return i>0&&(r=String(i)+j(r,u)),0===r.length?"0":r},p=i.mulPositive=function(t,r){a(t),a(r);for(var n="0",i=x(r),o=0;o=x(t)?"0":t.charAt(t.length-e-1)},x=function(t){return m(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,r){"use strict";r.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",n=t.values(),i=n.next();!i.done;)e+=r.inspect(i.value),i=n.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var a="Map {",o=t.entries(),u=o.next();!u.done;)a+=r.inspect(u.value[0]),a+=" => ",a+=r.inspect(u.value[1]),u=o.next(),u.done||(a+=", ");return a+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],1:[function(t,e,r){(function(e){"use strict";!function(){function r(){var t={};for(var e in o)t[e]={sig:o[e].sig,type:o[e].type.toBuffer().toString(a)};localStorage.typeCache=JSON.stringify(t)}t("/client-side/common.js");var n=t("/lib/assert.js"),i=t("/read.js"),a="base64",o={};if(void 0===localStorage.typeCache)r();else{var u=JSON.parse(localStorage.typeCache);for(var f in u)o[f]={sig:u[f].sig,type:i.type(e.from(u[f].type,a))}}window.sb.download=function(t,e){function a(t,e,r){if(f){f instanceof Array||(f=[f]);var n=!0,i=!1,a=void 0;try{for(var o,u=f[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var s=o.value;s(t,e,r)}}catch(t){i=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw a}}}}n.instanceOf(t,String),n.instanceOf(e,Object),e.processData=!1,e.dataType="arraybuffer";var u=!1;o[t]&&(u=!0,e.headers||(e.headers={}),e.headers.sig=o[t].sig);var f=e.success;e.success=function(e,n,f){var s=f.getResponseHeader("sig");if(u&&o[t].sig===s){var l=o[t].type,c=i.value({buffer:e,type:l});a(c,n,f)}else{var h=i._consumeType(e,0),y=i.value({buffer:e,offset:h.length,type:h.value}),g=h.value;o[t]={sig:s,type:g},r(),a(y,n,f)}},$.ajax(e)}}()}).call(this,t("buffer").Buffer)},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js","/read.js":"/read.js",buffer:3}],2:[function(t,e,r){"use strict";function n(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===t[u-2]?2:"="===t[u-1]?1:0,o=new l(3*u/4-a),n=a>0?u-4:u;var f=0;for(e=0,r=0;e>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,o[f++]=255&i):1===a&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function a(t){return f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}function o(t,e,r){for(var n,i=[],o=e;ol?l:s+u));return 1===n?(e=t[r-1],i+=f[e>>2],i+=f[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=f[e>>10],i+=f[e>>4&63],i+=f[e<<2&63],i+="="),a.push(i),a.join("")}r.toByteArray=i,r.fromByteArray=u;var f=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),o.alloc(+t)}function d(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return P(this,e,r);case"binary":return j(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function T(t,e,r,n){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,o=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,o/=2,u/=2,r/=2}for(var f=-1,s=r;si&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+u<=r){var f,s,l,c;switch(u){case 1:a<128&&(o=a);break;case 2:f=t[i+1],128===(192&f)&&(c=(31&a)<<6|63&f,c>127&&(o=c));break;case 3:f=t[i+1],s=t[i+2],128===(192&f)&&128===(192&s)&&(c=(15&a)<<12|(63&f)<<6|63&s,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:f=t[i+1],s=t[i+2],l=t[i+3],128===(192&f)&&128===(192&s)&&128===(192&l)&&(c=(15&a)<<18|(63&f)<<12|(63&s)<<6|63&l,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=u}return U(n)}function U(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function V(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function N(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return i||N(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return i||N(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function J(t){return W.toByteArray(Y(t))}function X(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t){return t!==t}var W=t("base64-js"),Q=t("ieee754"),Z=t("isarray");r.Buffer=o,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,r){return u(null,t,e,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,r){return s(null,t,e,r)},o.allocUnsafe=function(t){return l(null,t)},o.allocUnsafeSlow=function(t){return l(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},o.prototype.compare=function(t,e,r,n,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,u=r-e,f=Math.min(a,u),s=this.slice(n,i),l=t.slice(e,r),c=0;c2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:T(this,t,e,r);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):T(this,[t],e,r);throw new TypeError("val must be string, number or Buffer")},o.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return m(this,t,e,r);case"binary":return S(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;o.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+a]=t/o&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=0,o=1,u=0;for(this[e]=255&t;++a>0)-u&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=r-1,o=1,u=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/o>>0)-u&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;ae?t:Array(e-t.length+1).join("0")+t}var i={bytesToHex:function(t){return r(t)},hexToBytes:function(t){if(t.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===t.indexOf("0x")&&(t=t.slice(2)),t.match(/../g).map(function(t){return parseInt(t,16)})}};"undefined"!=typeof e&&e.exports?e.exports=i:t.convertHex=i}(this)},{}],5:[function(t,e,r){!function(t){"use strict";var r={bytesToString:function(t){return t.map(function(t){return String.fromCharCode(t)}).join("")},stringToBytes:function(t){return t.split("").map(function(t){return t.charCodeAt(0)})}};r.UTF8={bytesToString:function(t){return decodeURIComponent(escape(r.bytesToString(t)))},stringToBytes:function(t){return r.stringToBytes(unescape(encodeURIComponent(t)))}},"undefined"!=typeof e&&e.exports?e.exports=r:t.convertString=r}(this)},{}],6:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,u=8*i-n-1,f=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,y=t[e+c];for(c+=h,a=y&(1<<-l)-1,y>>=-l,l+=u;l>0;a=256*a+t[e+c],c+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+t[e+c],c+=h,l-=8);if(0===a)a=1-s;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o+=Math.pow(2,n),a-=s}return(y?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,u,f,s=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,g=n?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),e+=o+c>=1?h/f:h*Math.pow(2,1-c),e*f>=2&&(o++,f/=2),o+c>=l?(u=0,o=l):o+c>=1?(u=(e*f-1)*Math.pow(2,i),o+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=255&u,y+=g,u/=256,i-=8);for(o=o<0;t[r+y]=255&o,y+=g,o/=256,s-=8);t[r+y-g]|=128*p}},{}],7:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],8:[function(t,e,r){!function(r){"use strict";function n(t,e){t.constructor===String&&(t=i.convertString.UTF8.stringToBytes(t));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=o(t),a=8*t.length;n[a>>5]|=128<<24-a%32,n[(a+64>>9<<4)+15]=a;for(var f=0;f>>5]|=t[r]<<24-n%32;return e},u=function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},f=[],s=function(t,e,r){for(var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],c=t[6],h=t[7],y=0;y<64;y++){if(y<16)f[y]=0|e[r+y];else{var g=f[y-15],p=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,v=f[y-2],d=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;f[y]=p+f[y-7]+d+f[y-16]}var w=s&l^~s&c,b=n&i^n&o^i&o,T=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),A=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),O=h+A+w+a[y]+f[y],m=T+b;h=c,c=l,l=s,s=u+O|0,u=o,o=i,i=n,n=O+m|0}t[0]=t[0]+n|0,t[1]=t[1]+i|0,t[2]=t[2]+o|0,t[3]=t[3]+u|0,t[4]=t[4]+s|0,t[5]=t[5]+l|0,t[6]=t[6]+c|0,t[7]=t[7]+h|0};n.x2=function(t,e){return n(n(t,{asBytes:!0}),e)}}(this)},{"convert-hex":4,"convert-string":5}],"/read.js":[function(t,e,r){(function(r){"use strict";function n(t,e){try{return{value:new DataView(t).getUint32(e),length:4}}catch(t){l.fail(v)}}function i(t,e){return t.length=0,"Offset is negative: "+String(e)),l.assert(t.byteLength>e,v);var r=void 0,o=1;switch(new Uint8Array(t)[e]){case g.ByteType._value:r=new g.ByteType;break;case g.ShortType._value:r=new g.ShortType;break;case g.IntType._value:r=new g.IntType;break;case g.LongType._value:r=new g.LongType;break;case g.UnsignedByteType._value:r=new g.UnsignedByteType;break;case g.UnsignedShortType._value:r=new g.UnsignedShortType;break;case g.UnsignedIntType._value:r=new g.UnsignedIntType;break;case g.UnsignedLongType._value:r=new g.UnsignedLongType;break;case g.DateType._value:r=new g.DateType;break;case g.FloatType._value:r=new g.FloatType;break;case g.DoubleType._value:r=new g.DoubleType;break;case g.BooleanType._value:r=new g.BooleanType;break;case g.BooleanTupleType._value:var u=n(t,e+o);r=new g.BooleanTupleType(u.value),o+=u.length;break;case g.BooleanArrayType._value:r=new g.BooleanArrayType;break;case g.CharType._value:r=new g.CharType;break;case g.StringType._value:r=new g.StringType;break;case g.OctetsType._value:r=new g.OctetsType;break;case g.TupleType._value:var s=a(t,e+o);o+=s.length;var c=n(t,e+o);o+=c.length,r=new g.TupleType({type:s.value,length:c.value});break;case g.StructType._value:l.assert(t.byteLength>e+o,v);var y=new Uint8Array(t),p=y[e+o];o++;for(var d={},w=0;we+o,v);var b=y[e+o];o++,l.assert(t.byteLength>=e+o+b,v);var T=h.toString(y.subarray(e+o,e+o+b));o+=b;var A=a(t,e+o);d[T]=A.value,o+=A.length}r=new g.StructType(d);break;case g.ArrayType._value:var O=a(t,e+o);o+=O.length,r=new g.ArrayType(O.value);break;case g.SetType._value:var m=a(t,e+o);o+=m.length,r=new g.SetType(m.value);break;case g.MapType._value:var S=a(t,e+o);o+=S.length;var B=a(t,e+o);o+=B.length,r=new g.MapType(S.value,B.value);break;case g.EnumType._value:var _=a(t,e+o);o+=_.length,l.assert(t.byteLength>e+o,v);var E=new Uint8Array(t)[e+o];o++;for(var k=[],U=0;Ue+o,v);var j=new Uint8Array(t)[e+o];o++;for(var R=new Array(j),x=0;x=e+D,v);var N=new DataView(t).getUint16(e+o),C=a(t,e+o-N);r=C.value,o=D;break;default:l.fail("No such type: 0x"+i(new Uint8Array(t)[e].toString(16),2))}return{value:r,length:o}}function o(t){var e=arguments.length<=1||void 0===arguments[1]||arguments[1];l.instanceOf(t,ArrayBuffer);var r=a(t,0),n=r.value,i=r.length;return e&&l.assert(i===t.byteLength,"Did not consume all of the buffer"),n}function u(t){var e=t.buffer,r=t.offset,n=t.count,i=new Array(n),a=c.modEight(i.length),o=c.dividedByEight(i.length),u=void 0;u=a?o+1:o,l.assert(e.byteLength>=r+u,v);for(var f=new Uint8Array(e),s=0;s=r+o,v),a=new Int8Array(e)[r];break;case g.ShortType:o=2,l.assert(e.byteLength>=r+o,v);var s=new DataView(e);a=s.getInt16(r);break;case g.IntType:o=4;var c=new DataView(e);a=c.getInt32(r);break;case g.LongType:o=8,l.assert(e.byteLength>=r+o,v);var d=new DataView(e),w=d.getInt32(r),b=d.getUint32(r+4);a=y.add(y.mul(String(w),y.LONG_UPPER_SHIFT),String(b));break;case g.UnsignedByteType:o=1,l.assert(e.byteLength>=r+o,v),a=new Uint8Array(e)[r];break;case g.UnsignedShortType:o=2,l.assert(e.byteLength>=r+o,v),a=new DataView(e).getUint16(r);break;case g.UnsignedIntType:o=4,l.assert(e.byteLength>=r+o,v),a=new DataView(e).getUint32(r);break;case g.UnsignedLongType:case g.DateType:o=8,l.assert(e.byteLength>=r+o,v);var T=new DataView(e),A=T.getUint32(r),O=T.getUint32(r+4);a=y.add(y.mul(String(A),y.LONG_UPPER_SHIFT),String(O)),i.constructor===g.DateType&&(a=new Date(Number(a)));break;case g.FloatType:o=4,l.assert(e.byteLength>=r+o,v),a=new DataView(e).getFloat32(r);break;case g.DoubleType:o=8,l.assert(e.byteLength>=r+o,v),a=new DataView(e).getFloat64(r);break;case g.BooleanType:o=1,l.assert(e.byteLength>=r+o,v);var m=new Uint8Array(e)[r];l.assert(0===m||255===m,"0x"+m.toString(16)+" is an invalid Boolean value"),a=!!m;break;case g.BooleanArrayType:var S=n(e,r);o=S.length;var B=u({buffer:e,offset:r+o,count:S.value});o+=B.length,a=B.value;break;case g.BooleanTupleType:var _=u({buffer:e,offset:r,count:i.length});a=_.value,o=_.length;break;case g.CharType:l.assert(e.byteLength>r,v),a=h.toString(new Uint8Array(e).subarray(r,r+4))[0],o=h.fromString(a).byteLength;break;case g.StringType:var E=new Uint8Array(e);for(o=0;l.assert(e.byteLength>r+o,v),E[r+o];o++);a=h.toString(new Uint8Array(e).subarray(r,r+o)),o++;break;case g.OctetsType:var k=n(e,r);o=k.length;var U=o+k.value;l.assert(e.byteLength>=r+U,v),a=e.slice(r+o,r+U),o=U;break;case g.TupleType:o=0,a=new Array(i.length);for(var P=0;P=r+o,v);var Q=new Uint8Array(e)[r];a=i.values[Q],void 0===a&&l.fail("Index "+String(Q)+" is invalid");break;case g.ChoiceType:o=1,l.assert(e.byteLength>=r+o,v);var Z=new Uint8Array(e)[r],K=f({buffer:e,offset:r+o,type:i.types[Z]});o+=K.length,a=K.value;break;case g.OptionalType:o=1,l.assert(e.byteLength>=r+o,v);var tt=new Uint8Array(e)[r];if(l.assert(0===tt||255===tt,"0x"+tt.toString(16)+" is an invalid Optional byte"),tt){var et=f({buffer:e,offset:r+o,type:i.type});o+=et.length,a=et.value}else a=null;break;case g.PointerType:var rt=n(e,r);o=rt.length,a=f({buffer:e,offset:rt.value,type:i.type}).value;break;default:l.fail("Not a structure type: "+p.inspect(i))}return{value:a,length:o}}function s(t){var e=t.buffer,r=t.type,n=t.offset;l.instanceOf(e,ArrayBuffer),l.instanceOf(r,g.Type),void 0===n&&(n=0),l.instanceOf(n,Number);var i=f({buffer:e,offset:n,type:r}),a=i.value;return a}"/"===r&&(r="");var l=t(r+"/lib/assert.js"),c=t(r+"/lib/bit-math.js"),h=t(r+"/lib/buffer-string.js"),y=t(r+"/lib/strint.js"),g=t(r+"/structure-types.js"),p=t("/lib/util-inspect.js"),v="Buffer is not long enough";e.exports={_consumeType:a,type:o,value:s}}).call(this,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js"}],"/structure-types.js":[function(t,e,r){(function(r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t),e}function u(t,e){if(e&&t.pointers){var r=!0,n=!1,i=void 0;try{for(var a,o=t.pointers[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=y(a.value,2),f=u[0],s=u[1],l=t.length;t.addAll(v.fromBinaryString(f));var c=new ArrayBuffer(4);new DataView(c).setUint32(0,l);var h=!0,g=!1,p=void 0;try{for(var d,w=s[Symbol.iterator]();!(h=(d=w.next()).done);h=!0){var b=d.value;t.setAll(b,c)}}catch(t){g=!0,p=t}finally{try{!h&&w.return&&w.return()}finally{if(g)throw p}}}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}}}function f(t){if(t&&t.constructor===String){var e=Number(t);if(!isNaN(e))return e}}function s(t,e){g.instanceOf(t,b),g.instanceOf(e,String),(T.gt(e,"18446744073709551615")||T.lt(e,"0"))&&g.fail("Value out of range");var r=T.div(e,T.LONG_UPPER_SHIFT),n=T.sub(e,T.mul(r,T.LONG_UPPER_SHIFT)),i=new ArrayBuffer(8),a=new DataView(i);a.setUint32(0,Number(r)),a.setUint32(4,Number(n)),t.addAll(i)}function l(t,e){g.instanceOf(e,Array);var r=S(e.length),n=m(e.length),i=void 0;i=r?n+1:n;for(var a=new ArrayBuffer(i),o=new Uint8Array(a),u=0;ue[$]?1:void 0}),r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 81}}]),h(e,[{key:"addToBuffer",value:function(t){if(c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var r=!0,n=!1,i=void 0;try{for(var a,o=this.fields[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=a.value,f=u[Q];t.add(f.byteLength),t.addAll(f),u[W].addToBuffer(t)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}}}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(t,b),g.instanceOf(e,Object);var n=!0,i=!1,a=void 0;try{for(var o,f=this.fields[Symbol.iterator]();!(n=(o=f.next()).done);n=!0){var s=o.value,l=e[s[$]];void 0===l&&g.fail("Value for field "+s[$]+" missing"),s[W].writeValue(t,l,!1)}}catch(t){i=!0,a=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw a}}u(t,r)}}]),e}(E),K=function(t){function e(t){a(this,e);var r=n(this,Object.getPrototypeOf(e).call(this));return g.instanceOf(t,_),r.type=t,r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 82}}]),h(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,r){g.instanceOf(t,b),g.fourByteUnsignedInteger(e.length),t.addAll(o(e.length));var n=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var l=f.value;this.type.writeValue(t,l,!1)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}u(t,r)}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(e,Array),this._writeValue(t,e,r)}}]),e}(E),tt=function(t){function e(t){return a(this,e),n(this,Object.getPrototypeOf(e).call(this,t))}return i(e,t),h(e,null,[{key:"_value",get:function(){return 83}}]),h(e,[{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,r)}}]),e}(K),et=function(t){function e(t,r){a(this,e);var i=n(this,Object.getPrototypeOf(e).call(this));return g.instanceOf(t,_),g.instanceOf(r,_),i.keyType=t,i.valueType=r,i}return i(e,t),h(e,null,[{key:"_value",get:function(){return 84}}]),h(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(t,b),g.instanceOf(e,Map),g.fourByteUnsignedInteger(e.size),t.addAll(o(e.size));var n=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var l=y(f.value,2),c=l[0],h=l[1];this.keyType.writeValue(t,c,!1),this.valueType.writeValue(t,h,!1)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}u(t,r)}}]),e}(E),rt=function(t){function e(t){var r=t.type,i=t.values;a(this,e);var o=n(this,Object.getPrototypeOf(e).call(this));g.instanceOf(r,E),g.instanceOf(i,Array);try{g.byteUnsignedInteger(i.length)}catch(t){g.fail(String(i.length)+" values is too many")}for(var u=new Map,f=0;f=200&&t.status<300||304===t.status;r?e[o]=t.response:e.text=t.statusText,n(t.status,t.statusText,e,t.getAllResponseHeaders())}),t.open(i,a,s),t.responseType=o;for(var f in r)r.hasOwnProperty(f)&&t.setRequestHeader(f,r[f]);t.send(u)},abort:function(){t&&t.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(e,t,r){"use strict";var n=e("/lib/assert.js");if(n.instanceOf(window.Map,Function),n.instanceOf(window.Set,Function),n.instanceOf(window.ArrayBuffer,Function),n.instanceOf(window.Uint8Array,Function),n.instanceOf(window.Symbol,Function),e("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=e("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(e,t,r){(function(r){"use strict";"/"===r&&(r="");var n=e(r+"/lib/assert.js"),a=e("base64-js"),i=7;n.between(0,i,65536);var o=2,u=new ArrayBuffer(o);new DataView(u).setUint16(0,i);var s=a.fromByteArray(new Uint8Array(u));t.exports={VERSION_STRING:s}}).call(this,"/")},{"base64-js":2}],"/lib/assert.js":[function(e,t,r){"use strict";var n=e("/lib/util-inspect.js"),a={instanceOf:function(e,t){t instanceof Array||(t=[t]);var r=!1,a=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var f=u.value;if(e instanceof f||void 0!==e&&null!==e&&e.constructor===f){r=!0;break}}}catch(e){i=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw o}}if(!r)throw new TypeError(n.inspect(e)+" is not an instance of "+t.map(function(e){return e.name}).join(" or "))},integer:function(e){if(a.instanceOf(e,Number),!Number.isSafeInteger(e))throw new RangeError(n.inspect(e)+" is not an integer")},between:function(e,t,r,a){if(t=r){var i=n.inspect(t)+" is not in ["+n.inspect(e)+","+n.inspect(r)+")";throw void 0===a?new RangeError(i):new RangeError(a+" ("+i+")")}},byteUnsignedInteger:function(e){a.integer(e),a.between(0,e,256)},fourByteUnsignedInteger:function(e){a.integer(e),a.between(0,e,4294967296)},fail:function(e){throw new Error(e)},assert:function(e,t){e||a.fail(t)},throws:function(e,t){var r=!0;try{e(),r=!1}catch(e){void 0!==t&&a.message(e,t)}a.assert(r,"Should throw an error")},equal:function(e,t){var r=new RangeError("Expected "+n.inspect(t)+" but got "+n.inspect(e));if(t&&t.constructor===Object){for(var i in t)if(t.hasOwnProperty(i))try{a.equal(e[i],t[i])}catch(e){throw r}}else if(t&&t.constructor===Array){if(!e||e.constructor!==Array)throw r;try{a.equal(e.length,t.length)}catch(e){throw r}for(var o=0;o>>3},modEight:function(e){return 7&e}}},{}],"/lib/buffer-string.js":[function(e,t,r){(function(r){"use strict";var n=e(r+"/assert.js"),a=e(r+"/growable-buffer.js"),i=4096;t.exports={toString:function(e){e&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),n.instanceOf(e,Uint8Array);for(var t=[],r=0;r239?4:a>223?3:a>191?2:1;if(r+u<=e.length){var s=void 0,f=void 0,l=void 0,c=void 0;switch(u){case 1:a<128&&(o=a);break;case 2:s=e[r+1],128===(192&s)&&(c=(31&a)<<6|63&s,c>127&&(o=c));break;case 3:s=e[r+1],f=e[r+2],128===(192&s)&&128===(192&f)&&(c=(15&a)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:s=e[r+1],f=e[r+2],l=e[r+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&a)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(o=c))}}void 0===o?(o=65533,u=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|1023&o),t.push(o),r+=u}for(var y="",h=0;h>6),t.add(128|63&l)):l<55296||l>=57344?(t.add(224|l>>12),t.add(128|l>>6&63),t.add(128|63&l)):(l=65536+((1023&l)<<10|1023&l),t.add(240|l>>18),t.add(128|l>>12&63),t.add(128|l>>6&63),t.add(128|63&l))}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return t.toBuffer()},toBinaryString:function(e){n.instanceOf(e,ArrayBuffer);var t="",r=new Uint8Array(e),a=!0,i=!1,o=void 0;try{for(var u,s=r[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var f=u.value;t+=String.fromCharCode(f)}}catch(e){i=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw o}}return t},fromBinaryString:function(e){n.instanceOf(e,String);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;athis.buffer.byteLength){var t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}},{key:"set",value:function(e,t){i.integer(e),i.integer(t),i.between(0,e,this.size,"Index out of bounds: "+String(e)),i.between(0,t,256,"Not a byte: "+String(t));var r=new Uint8Array(this.buffer);return r[e]=t,this}},{key:"setAll",value:function(e,t){i.instanceOf(t,ArrayBuffer),i.integer(e),i.between(0,e,this.size-t.byteLength+1,"Index out of bounds: "+String(e)),new Uint8Array(this.buffer).set(new Uint8Array(t),e)}},{key:"get",value:function(e){return i.integer(e),i.between(0,e,this.size,"Index out of bounds: "+String(e)),new Uint8Array(this.buffer)[e]}},{key:"add",value:function(e){var t=this.size,r=t+1;this.grow(r),this.size=r;var n=new Uint8Array(this.buffer);return n[t]=e,this}},{key:"addAll",value:function(e){i.instanceOf(e,ArrayBuffer);var t=this.size,r=this.size+e.byteLength;return this.grow(r),this.size=r,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),e}();t.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a={};!function(){function e(e,t){return k(e)===k(t)}function t(e,t){for(;t>0;)e+="0",t--;return e}function r(e){f(e,"string")}function i(e){r(e),s(e,k,"isPositive")}function o(e){f(e,"number")}function u(e){if(f(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function s(e,t,r){if(!t.call(null,e))throw new Error("Condition "+r+" failed for value "+e)}function f(e,t){if(("undefined"==typeof e?"undefined":n(e))!==t)throw new Error("Not a "+t+": "+e)}var l=a.subPositive=function(e,t){if(i(e),i(t),!O(e,t))throw new Error("x must be greater or equal to y");for(var r=Math.max(e.length,t.length),n="",a=0,o=0,u=0;u=10;)l-=10,a++;0===l?o++:(n=String(l)+V(n,o),o=0)}return a>0&&(n=String(a)+V(n,o)),n},y=a.add=function(e,t){if(r(e),r(t),k(e)&&k(t))return c(e,t);if(S(e)&&S(t))return B(c(m(e),m(t)));if(T(m(e),m(t))){var n=e;e=t,t=n}var a=l(m(e),m(t));return k(e)?a:B(a)},h=a.sub=function(e,t){return r(e),r(t),y(e,B(t))},v=a.timesDigit=function(e,t){i(e),o(t);for(var r="",n=E(e),a=0,u=0,s=0;s=10;)f-=10,a++;0===f?u++:(r=String(f)+V(r,u),u=0)}return a>0&&(r=String(a)+V(r,u)),0===r.length?"0":r},g=a.mulPositive=function(e,r){i(e),i(r);for(var n="0",a=E(r),o=0;o=E(e)?"0":e.charAt(e.length-t-1)},E=function(e){return S(e)?e.length-1:e.length}}(),a.LONG_UPPER_SHIFT="4294967296",t.exports=a},{}],"/lib/util-inspect.js":[function(e,t,r){"use strict";r.inspect=function(e){if(void 0===e)return"undefined";if(null===e||e.constructor===Object||e.constructor===Array||e.constructor===String||e.constructor===Number||e.constructor===Boolean||e.constructor===Date)return JSON.stringify(e);if(e.constructor===Set){for(var t="Set {",n=e.values(),a=n.next();!a.done;)t+=r.inspect(a.value),a=n.next(),a.done||(t+=", ");return t+"}"}if(e.constructor===Map){for(var i="Map {",o=e.entries(),u=o.next();!u.done;)i+=r.inspect(u.value[0]),i+=" => ",i+=r.inspect(u.value[1]),u=o.next(),u.done||(i+=", ");return i+"}"}return e.constructor.name?e.constructor.name+" "+JSON.stringify(e):JSON.stringify(e)}},{}],1:[function(e,t,r){"use strict";!function(){function t(){var e={};for(var t in i)e[t]={sig:i[t].sig,type:n.fromByteArray(new Uint8Array(i[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}e("/client-side/common.js");var r=e("/lib/assert.js"),n=e("base64-js"),a=e("/read.js"),i={};if(void 0===localStorage.typeCache)t();else{var o=JSON.parse(localStorage.typeCache);for(var u in o)i[u]={sig:o[u].sig,type:a.type(new Uint8Array(n.toByteArray(o[u].type)).buffer)}}window.sb.download=function(e,n){function o(e,t,r){if(s){s instanceof Array||(s=[s]);var n=!0,a=!1,i=void 0;try{for(var o,u=s[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var f=o.value;f(e,t,r)}}catch(e){a=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw i}}}}r.instanceOf(e,String),r.instanceOf(n,Object),n.processData=!1,n.dataType="arraybuffer";var u=!1;i[e]&&(u=!0,n.headers||(n.headers={}),n.headers.sig=i[e].sig);var s=n.success;n.success=function(r,n,s){var f=s.getResponseHeader("sig");if(u&&i[e].sig===f){var l=i[e].type,c=a.value({buffer:r,type:l});o(c,n,s)}else{var y=a._consumeType(r,0),h=a.value({buffer:r,offset:y.length,type:y.value}),v=y.value;i[e]={sig:f,type:v},t(),o(h,n,s)}},$.ajax(n)}}()},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js","/read.js":"/read.js","base64-js":2}],2:[function(e,t,r){"use strict";function n(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[u-2]?2:"="===e[u-1]?1:0,o=new l(3*u/4-i),n=i>0?u-4:u;var s=0;for(t=0,r=0;t>16&255,o[s++]=a>>8&255,o[s++]=255&a;return 2===i?(a=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,o[s++]=255&a):1===i&&(a=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,o[s++]=a>>8&255,o[s++]=255&a),o}function i(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function o(e,t,r){for(var n,a=[],o=t;ol?l:f+u));return 1===n?(t=e[r-1],a+=s[t>>2],a+=s[t<<4&63],a+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],a+=s[t>>10],a+=s[t>>4&63],a+=s[t<<2&63],a+="="),i.push(a),i.join("")}r.toByteArray=a,r.fromByteArray=u;var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(e,t,r){!function(e){"use strict";function r(e){return e.map(function(e){return n(e.toString(16),2)}).join("")}function n(e,t){return e.length>t?e:Array(t-e.length+1).join("0")+e}var a={bytesToHex:function(e){return r(e)},hexToBytes:function(e){if(e.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map(function(e){return parseInt(e,16)})}};"undefined"!=typeof t&&t.exports?t.exports=a:e.convertHex=a}(this)},{}],4:[function(e,t,r){!function(e){"use strict";var r={bytesToString:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")},stringToBytes:function(e){return e.split("").map(function(e){return e.charCodeAt(0)})}};r.UTF8={bytesToString:function(e){return decodeURIComponent(escape(r.bytesToString(e)))},stringToBytes:function(e){return r.stringToBytes(unescape(encodeURIComponent(e)))}},"undefined"!=typeof t&&t.exports?t.exports=r:e.convertString=r}(this)},{}],5:[function(e,t,r){!function(r){"use strict";function n(e,t){e.constructor===String&&(e=a.convertString.UTF8.stringToBytes(e));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=o(e),i=8*e.length;n[i>>5]|=128<<24-i%32,n[(i+64>>9<<4)+15]=i;for(var s=0;s>>5]|=e[r]<<24-n%32;return t},u=function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},s=[],f=function(e,t,r){for(var n=e[0],a=e[1],o=e[2],u=e[3],f=e[4],l=e[5],c=e[6],y=e[7],h=0;h<64;h++){if(h<16)s[h]=0|t[r+h];else{var v=s[h-15],g=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,d=s[h-2],p=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;s[h]=g+s[h-7]+p+s[h-16]}var b=f&l^~f&c,w=n&a^n&o^a&o,T=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),O=(f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25),A=y+O+b+i[h]+s[h],S=T+w;y=c,c=l,l=f,f=u+A|0,u=o,o=a,a=n,n=A+S|0}e[0]=e[0]+n|0,e[1]=e[1]+a|0,e[2]=e[2]+o|0,e[3]=e[3]+u|0,e[4]=e[4]+f|0,e[5]=e[5]+l|0,e[6]=e[6]+c|0,e[7]=e[7]+y|0};n.x2=function(e,t){return n(n(e,{asBytes:!0}),t)}}(this)},{"convert-hex":3,"convert-string":4}],"/read.js":[function(e,t,r){(function(r){"use strict";function n(e,t){try{return{value:new DataView(e).getUint32(t),length:4}}catch(e){l.fail(d)}}function a(e,t){return e.length=0,"Offset is negative: "+String(t)),l.assert(e.byteLength>t,d);var r=void 0,o=1;switch(new Uint8Array(e)[t]){case v.ByteType._value:r=new v.ByteType;break;case v.ShortType._value:r=new v.ShortType;break;case v.IntType._value:r=new v.IntType;break;case v.LongType._value:r=new v.LongType;break;case v.UnsignedByteType._value:r=new v.UnsignedByteType;break;case v.UnsignedShortType._value:r=new v.UnsignedShortType;break;case v.UnsignedIntType._value:r=new v.UnsignedIntType;break;case v.UnsignedLongType._value:r=new v.UnsignedLongType;break;case v.DateType._value:r=new v.DateType;break;case v.FloatType._value:r=new v.FloatType;break;case v.DoubleType._value:r=new v.DoubleType;break;case v.BooleanType._value:r=new v.BooleanType;break;case v.BooleanTupleType._value:var u=n(e,t+o);r=new v.BooleanTupleType(u.value),o+=u.length;break;case v.BooleanArrayType._value:r=new v.BooleanArrayType;break;case v.CharType._value:r=new v.CharType;break;case v.StringType._value:r=new v.StringType;break;case v.OctetsType._value:r=new v.OctetsType;break;case v.TupleType._value:var f=i(e,t+o);o+=f.length;var c=n(e,t+o);o+=c.length,r=new v.TupleType({type:f.value,length:c.value});break;case v.StructType._value:l.assert(e.byteLength>t+o,d);var h=new Uint8Array(e),g=h[t+o];o++;for(var p={},b=0;bt+o,d);var w=h[t+o];o++,l.assert(e.byteLength>=t+o+w,d);var T=y.toString(h.subarray(t+o,t+o+w));o+=w;var O=i(e,t+o);p[T]=O.value,o+=O.length}r=new v.StructType(p);break;case v.ArrayType._value:var A=i(e,t+o);o+=A.length,r=new v.ArrayType(A.value);break;case v.SetType._value:var S=i(e,t+o);o+=S.length,r=new v.SetType(S.value);break;case v.MapType._value:var k=i(e,t+o);o+=k.length;var m=i(e,t+o);o+=m.length,r=new v.MapType(k.value,m.value);break;case v.EnumType._value:var B=i(e,t+o);o+=B.length,l.assert(e.byteLength>t+o,d);var j=new Uint8Array(e)[t+o];o++;for(var U=[],_=0;_t+o,d);var V=new Uint8Array(e)[t+o];o++;for(var P=new Array(V),E=0;E=t+D,d);var C=new DataView(e).getUint16(t+o),F=i(e,t+o-C);r=F.value,o=D;break;default:l.fail("No such type: 0x"+a(new Uint8Array(e)[t].toString(16),2))}return{value:r,length:o}}function o(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];l.instanceOf(e,ArrayBuffer);var r=i(e,0),n=r.value,a=r.length;return t&&l.assert(a===e.byteLength,"Did not consume all of the buffer"),n}function u(e){var t=e.buffer,r=e.offset,n=e.count,a=new Array(n),i=c.modEight(a.length),o=c.dividedByEight(a.length),u=void 0;u=i?o+1:o,l.assert(t.byteLength>=r+u,d);for(var s=new Uint8Array(t),f=0;f=r+o,d),i=new Int8Array(t)[r];break;case v.ShortType:o=2,l.assert(t.byteLength>=r+o,d);var f=new DataView(t);i=f.getInt16(r);break;case v.IntType:o=4;var c=new DataView(t);i=c.getInt32(r);break;case v.LongType:o=8,l.assert(t.byteLength>=r+o,d);var p=new DataView(t),b=p.getInt32(r),w=p.getUint32(r+4);i=h.add(h.mul(String(b),h.LONG_UPPER_SHIFT),String(w));break;case v.UnsignedByteType:o=1,l.assert(t.byteLength>=r+o,d),i=new Uint8Array(t)[r];break;case v.UnsignedShortType:o=2,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getUint16(r);break;case v.UnsignedIntType:o=4,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getUint32(r);break;case v.UnsignedLongType:case v.DateType:o=8,l.assert(t.byteLength>=r+o,d);var T=new DataView(t),O=T.getUint32(r),A=T.getUint32(r+4);i=h.add(h.mul(String(O),h.LONG_UPPER_SHIFT),String(A)),a.constructor===v.DateType&&(i=new Date(Number(i)));break;case v.FloatType:o=4,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getFloat32(r);break;case v.DoubleType:o=8,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getFloat64(r);break;case v.BooleanType:o=1,l.assert(t.byteLength>=r+o,d);var S=new Uint8Array(t)[r];l.assert(0===S||255===S,"0x"+S.toString(16)+" is an invalid Boolean value"),i=!!S;break;case v.BooleanArrayType:var k=n(t,r);o=k.length;var m=u({buffer:t,offset:r+o,count:k.value});o+=m.length,i=m.value;break;case v.BooleanTupleType:var B=u({buffer:t,offset:r,count:a.length});i=B.value,o=B.length;break;case v.CharType:l.assert(t.byteLength>r,d),i=y.toString(new Uint8Array(t).subarray(r,r+4))[0],o=y.fromString(i).byteLength;break;case v.StringType:var j=new Uint8Array(t);for(o=0;l.assert(t.byteLength>r+o,d),j[r+o];o++);i=y.toString(new Uint8Array(t).subarray(r,r+o)),o++;break;case v.OctetsType:var U=n(t,r);o=U.length;var _=o+U.value;l.assert(t.byteLength>=r+_,d),i=t.slice(r+o,r+_),o=_;break;case v.TupleType:o=0,i=new Array(a.length);for(var x=0;x=r+o,d);var Q=new Uint8Array(t)[r];i=a.values[Q],void 0===i&&l.fail("Index "+String(Q)+" is invalid");break;case v.ChoiceType:o=1,l.assert(t.byteLength>=r+o,d);var K=new Uint8Array(t)[r],Z=s({buffer:t,offset:r+o,type:a.types[K]});o+=Z.length,i=Z.value;break;case v.OptionalType:o=1,l.assert(t.byteLength>=r+o,d);var ee=new Uint8Array(t)[r];if(l.assert(0===ee||255===ee,"0x"+ee.toString(16)+" is an invalid Optional byte"),ee){var te=s({buffer:t,offset:r+o,type:a.type});o+=te.length,i=te.value}else i=null;break;case v.PointerType:var re=n(t,r);o=re.length,i=s({buffer:t,offset:re.value,type:a.type}).value;break;default:l.fail("Not a structure type: "+g.inspect(a))}return{value:i,length:o}}function f(e){var t=e.buffer,r=e.type,n=e.offset;l.instanceOf(t,ArrayBuffer),l.instanceOf(r,v.Type),void 0===n&&(n=0),l.instanceOf(n,Number);var a=s({buffer:t,offset:n,type:r}),i=a.value;return i}"/"===r&&(r="");var l=e(r+"/lib/assert.js"),c=e(r+"/lib/bit-math.js"),y=e(r+"/lib/buffer-string.js"),h=e(r+"/lib/strint.js"),v=e(r+"/structure-types.js"),g=e("/lib/util-inspect.js"),d="Buffer is not long enough";t.exports={_consumeType:i,type:o,value:f}}).call(this,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js"}],"/structure-types.js":[function(e,t,r){(function(r){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e),t}function u(e,t){if(t&&e.pointers){var r=!0,n=!1,a=void 0;try{for(var i,o=e.pointers[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var u=h(i.value,2),s=u[0],f=u[1],l=e.length;e.addAll(d.fromBinaryString(s));var c=new ArrayBuffer(4);new DataView(c).setUint32(0,l);var y=!0,v=!1,g=void 0;try{for(var p,b=f[Symbol.iterator]();!(y=(p=b.next()).done);y=!0){var w=p.value;e.setAll(w,c)}}catch(e){v=!0,g=e}finally{try{!y&&b.return&&b.return()}finally{if(v)throw g}}}}catch(e){n=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw a}}}}function s(e){if(e&&e.constructor===String){var t=Number(e);if(!isNaN(t))return t}}function f(e,t){v.instanceOf(e,w),v.instanceOf(t,String),(T.gt(t,"18446744073709551615")||T.lt(t,"0"))&&v.fail("Value out of range");var r=T.div(t,T.LONG_UPPER_SHIFT),n=T.sub(t,T.mul(r,T.LONG_UPPER_SHIFT)),a=new ArrayBuffer(8),i=new DataView(a);i.setUint32(0,Number(r)),i.setUint32(4,Number(n)),e.addAll(a)}function l(e,t){v.instanceOf(t,Array);var r=k(t.length),n=S(t.length),a=void 0;a=r?n+1:n;for(var i=new ArrayBuffer(a),o=new Uint8Array(i),u=0;ut[Y]?1:void 0}),r}return a(t,e),y(t,null,[{key:"_value",get:function(){return 81}}]),y(t,[{key:"addToBuffer",value:function(e){if(c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)){e.add(this.fields.length);var r=!0,n=!1,a=void 0;try{for(var i,o=this.fields[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var u=i.value,s=u[Q];e.add(s.byteLength),e.addAll(s),u[$].addToBuffer(e)}}catch(e){n=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw a}}}}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,w),v.instanceOf(t,Object);var n=!0,a=!1,i=void 0;try{for(var o,s=this.fields[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var f=o.value,l=t[f[Y]];void 0===l&&v.fail("Value for field "+f[Y]+" missing"),f[$].writeValue(e,l,!1)}}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}u(e,r)}}]),t}(j),Z=function(e){function t(e){i(this,t);var r=n(this,Object.getPrototypeOf(t).call(this));return v.instanceOf(e,B),r.type=e,r}return a(t,e),y(t,null,[{key:"_value",get:function(){return 82}}]),y(t,[{key:"addToBuffer",value:function(e){c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&this.type.addToBuffer(e)}},{key:"_writeValue",value:function(e,t,r){v.instanceOf(e,w),v.fourByteUnsignedInteger(t.length),e.addAll(o(t.length));var n=!0,a=!1,i=void 0;try{for(var s,f=t[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var l=s.value;this.type.writeValue(e,l,!1)}}catch(e){a=!0,i=e}finally{try{!n&&f.return&&f.return()}finally{if(a)throw i}}u(e,r)}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,Array),this._writeValue(e,t,r)}}]),t}(j),ee=function(e){function t(e){return i(this,t),n(this,Object.getPrototypeOf(t).call(this,e))}return a(t,e),y(t,null,[{key:"_value",get:function(){return 83}}]),y(t,[{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,Set),t.length=t.size,this._writeValue(e,t,r)}}]),t}(Z),te=function(e){function t(e,r){i(this,t);var a=n(this,Object.getPrototypeOf(t).call(this));return v.instanceOf(e,B),v.instanceOf(r,B),a.keyType=e,a.valueType=r,a}return a(t,e),y(t,null,[{key:"_value",get:function(){return 84}}]),y(t,[{key:"addToBuffer",value:function(e){c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&(this.keyType.addToBuffer(e),this.valueType.addToBuffer(e))}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,w),v.instanceOf(t,Map),v.fourByteUnsignedInteger(t.size),e.addAll(o(t.size));var n=!0,a=!1,i=void 0;try{for(var s,f=t[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var l=h(s.value,2),c=l[0],y=l[1];this.keyType.writeValue(e,c,!1),this.valueType.writeValue(e,y,!1)}}catch(e){a=!0,i=e}finally{try{!n&&f.return&&f.return()}finally{if(a)throw i}}u(e,r)}}]),t}(j),re=function(e){function t(e){var r=e.type,a=e.values;i(this,t);var o=n(this,Object.getPrototypeOf(t).call(this));v.instanceOf(r,j),v.instanceOf(a,Array);try{v.byteUnsignedInteger(a.length)}catch(e){v.fail(String(a.length)+" values is too many")}for(var u=new Map,s=0;s=200&&e.status<300||304===e.status;r?t[o]=e.response:t.text=e.statusText,n(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(a,i,f),e.responseType=o;for(var s in r)r.hasOwnProperty(s)&&e.setRequestHeader(s,r[s]);e.send(u)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(t,e,r){"use strict";var n=t("/lib/assert.js");if(n.instanceOf(window.Map,Function),n.instanceOf(window.Set,Function),n.instanceOf(window.ArrayBuffer,Function),n.instanceOf(window.Uint8Array,Function),n.instanceOf(window.Symbol,Function),t("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=t("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(t,e,r){(function(r,n){"use strict";"/"===n&&(n="");var i=t(n+"/lib/assert.js"),a=7;i.between(0,a,65536);var o=2,u=r.allocUnsafe(o);u.writeUInt16BE(a,0);var f=u.toString("base64");e.exports={VERSION_STRING:f}}).call(this,t("buffer").Buffer,"/")},{buffer:3}],"/lib/assert.js":[function(t,e,r){"use strict";var n=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var r=!1,i=!0,a=!1,o=void 0;try{for(var u,f=e[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;if(t instanceof s||void 0!==t&&null!==t&&t.constructor===s){r=!0;break}}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}if(!r)throw new TypeError(n.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(n.inspect(t)+" is not an integer")},between:function(t,e,r,i){if(e=r){var a=n.inspect(e)+" is not in ["+n.inspect(t)+","+n.inspect(r)+")";throw void 0===i?new RangeError(a):new RangeError(i+" ("+a+")")}},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t,e){var r=!0;try{t(),r=!1}catch(t){void 0!==e&&i.message(t,e)}i.assert(r,"Should throw an error")},equal:function(t,e){var r=new RangeError("Expected "+n.inspect(e)+" but got "+n.inspect(t));if(e&&e.constructor===Object){for(var a in e)if(e.hasOwnProperty(a))try{i.equal(t[a],e[a])}catch(t){throw r}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw r;try{i.equal(t.length,e.length)}catch(t){throw r}for(var o=0;o>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-string.js":[function(t,e,r){(function(r){"use strict";var n=t(r+"/assert.js"),i=t(r+"/growable-buffer.js"),a=4096;e.exports={toString:function(t){t&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),n.instanceOf(t,Uint8Array);for(var e=[],r=0;r239?4:i>223?3:i>191?2:1;if(r+u<=t.length){var f=void 0,s=void 0,c=void 0,l=void 0;switch(u){case 1:i<128&&(o=i);break;case 2:f=t[r+1],128===(192&f)&&(l=(31&i)<<6|63&f,l>127&&(o=l));break;case 3:f=t[r+1],s=t[r+2],128===(192&f)&&128===(192&s)&&(l=(15&i)<<12|(63&f)<<6|63&s,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:f=t[r+1],s=t[r+2],c=t[r+3],128===(192&f)&&128===(192&s)&&128===(192&c)&&(l=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&c,l>65535&&l<1114112&&(o=l))}}void 0===o?(o=65533,u=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|1023&o),e.push(o),r+=u}for(var h="",y=0;y>6),e.add(128|63&c)):c<55296||c>=57344?(e.add(224|c>>12),e.add(128|c>>6&63),e.add(128|63&c)):(c=65536+((1023&c)<<10|1023&c),e.add(240|c>>18),e.add(128|c>>12&63),e.add(128|c>>6&63),e.add(128|63&c))}}catch(t){a=!0,o=t}finally{try{!r&&f.return&&f.return()}finally{if(a)throw o}}return e.toBuffer()},toBinaryString:function(t){n.instanceOf(t,ArrayBuffer);var e="",r=new Uint8Array(t),i=!0,a=!1,o=void 0;try{for(var u,f=r[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;e+=String.fromCharCode(s)}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return e},fromBinaryString:function(t){n.instanceOf(t,String);for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),i=0;ithis.buffer.byteLength){var e=new ArrayBuffer(t<<1);new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=e}return this}},{key:"set",value:function(t,e){a.integer(t),a.integer(e),a.between(0,t,this.size,"Index out of bounds: "+String(t)),a.between(0,e,256,"Not a byte: "+String(e));var r=new Uint8Array(this.buffer);return r[t]=e,this}},{key:"setAll",value:function(t,e){a.instanceOf(e,ArrayBuffer),a.integer(t),a.between(0,t,this.size-e.byteLength+1,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer).set(new Uint8Array(e),t)}},{key:"get",value:function(t){return a.integer(t),a.between(0,t,this.size,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer)[t]}},{key:"add",value:function(t){var e=this.size,r=e+1;this.grow(r),this.size=r;var n=new Uint8Array(this.buffer);return n[e]=t,this}},{key:"addAll",value:function(t){a.instanceOf(t,ArrayBuffer);var e=this.size,r=this.size+t.byteLength;return this.grow(r),this.size=r,new Uint8Array(this.buffer).set(new Uint8Array(t),e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}();e.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return S(t)===S(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function r(t){s(t,"string")}function a(t){r(t),f(t,S,"isPositive")}function o(t){s(t,"number")}function u(t){if(s(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function f(t,e,r){if(!e.call(null,t))throw new Error("Condition "+r+" failed for value "+t)}function s(t,e){if(("undefined"==typeof t?"undefined":n(t))!==e)throw new Error("Not a "+e+": "+t)}var c=i.subPositive=function(t,e){if(a(t),a(e),!O(t,e))throw new Error("x must be greater or equal to y");for(var r=Math.max(t.length,e.length),n="",i=0,o=0,u=0;u=10;)c-=10,i++;0===c?o++:(n=String(c)+j(n,o),o=0)}return i>0&&(n=String(i)+j(n,o)),n},h=i.add=function(t,e){if(r(t),r(e),S(t)&&S(e))return l(t,e);if(m(t)&&m(e))return _(l(B(t),B(e)));if(T(B(t),B(e))){var n=t;t=e,e=n}var i=c(B(t),B(e));return S(t)?i:_(i)},y=i.sub=function(t,e){return r(t),r(e),h(t,_(e))},p=i.timesDigit=function(t,e){a(t),o(e);for(var r="",n=x(t),i=0,u=0,f=0;f=10;)s-=10,i++;0===s?u++:(r=String(s)+j(r,u),u=0)}return i>0&&(r=String(i)+j(r,u)),0===r.length?"0":r},g=i.mulPositive=function(t,r){a(t),a(r);for(var n="0",i=x(r),o=0;o=x(t)?"0":t.charAt(t.length-e-1)},x=function(t){return m(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,r){"use strict";r.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",n=t.values(),i=n.next();!i.done;)e+=r.inspect(i.value),i=n.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var a="Map {",o=t.entries(),u=o.next();!u.done;)a+=r.inspect(u.value[0]),a+=" => ",a+=r.inspect(u.value[1]),u=o.next(),u.done||(a+=", ");return a+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],1:[function(t,e,r){(function(e){"use strict";!function(){t("/client-side/common.js");var e=t("/lib/assert.js");window.sb.upload=function(t,r){var n=t.type,i=t.value;if(e.instanceOf(n,window.sb.Type),e.instanceOf(r,Object),"POST"!==r.type&&"POST"!==r.method)throw new Error("Must use POST when uploading");r.processData=!1,r.data=n.valueBuffer(i),$.ajax(r)}}(),function(){function r(){var t={};for(var e in o)t[e]={sig:o[e].sig,type:o[e].type.toBuffer().toString(a)};localStorage.typeCache=JSON.stringify(t)}t("/client-side/common.js");var n=t("/lib/assert.js"),i=t("/read.js"),a="base64",o={};if(void 0===localStorage.typeCache)r();else{var u=JSON.parse(localStorage.typeCache);for(var f in u)o[f]={sig:u[f].sig,type:i.type(e.from(u[f].type,a))}}window.sb.download=function(t,e){function a(t,e,r){if(f){f instanceof Array||(f=[f]);var n=!0,i=!1,a=void 0;try{for(var o,u=f[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var s=o.value;s(t,e,r)}}catch(t){i=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw a}}}}n.instanceOf(t,String),n.instanceOf(e,Object),e.processData=!1,e.dataType="arraybuffer";var u=!1;o[t]&&(u=!0,e.headers||(e.headers={}),e.headers.sig=o[t].sig);var f=e.success;e.success=function(e,n,f){var s=f.getResponseHeader("sig");if(u&&o[t].sig===s){var c=o[t].type,l=i.value({buffer:e,type:c});a(l,n,f)}else{var h=i._consumeType(e,0),y=i.value({buffer:e,offset:h.length,type:h.value}),p=h.value;o[t]={sig:s,type:p},r(),a(y,n,f)}},$.ajax(e)}}()}).call(this,t("buffer").Buffer)},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js","/read.js":"/read.js",buffer:3}],2:[function(t,e,r){"use strict";function n(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===t[u-2]?2:"="===t[u-1]?1:0,o=new c(3*u/4-a),n=a>0?u-4:u;var f=0;for(e=0,r=0;e>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,o[f++]=255&i):1===a&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function a(t){return f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}function o(t,e,r){for(var n,i=[],o=e;oc?c:s+u));return 1===n?(e=t[r-1],i+=f[e>>2],i+=f[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=f[e>>10],i+=f[e>>4&63],i+=f[e<<2&63],i+="="),a.push(i),a.join("")}r.toByteArray=i,r.fromByteArray=u;var f=[],s=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),o.alloc(+t)}function d(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return U(this,e,r);case"binary":return j(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function T(t,e,r,n){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,o=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,o/=2,u/=2,r/=2}for(var f=-1,s=r;si&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+u<=r){var f,s,c,l;switch(u){case 1:a<128&&(o=a);break;case 2:f=t[i+1],128===(192&f)&&(l=(31&a)<<6|63&f,l>127&&(o=l));break;case 3:f=t[i+1],s=t[i+2],128===(192&f)&&128===(192&s)&&(l=(15&a)<<12|(63&f)<<6|63&s,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:f=t[i+1],s=t[i+2],c=t[i+3],128===(192&f)&&128===(192&s)&&128===(192&c)&&(l=(15&a)<<18|(63&f)<<12|(63&s)<<6|63&c,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=u}return P(n)}function P(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function V(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function N(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return i||N(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return i||N(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function J(t){return W.toByteArray(Y(t))}function X(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t){return t!==t}var W=t("base64-js"),Q=t("ieee754"),Z=t("isarray");r.Buffer=o,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,r){return u(null,t,e,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,r){return s(null,t,e,r)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},o.prototype.compare=function(t,e,r,n,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,u=r-e,f=Math.min(a,u),s=this.slice(n,i),c=t.slice(e,r),l=0;l2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:T(this,t,e,r);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):T(this,[t],e,r);throw new TypeError("val must be string, number or Buffer")},o.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return A(this,t,e,r);case"ascii":return m(this,t,e,r);case"binary":return S(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;o.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+a]=t/o&255;return e+r},o.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,r){ -return t=+t,e=0|e,r||L(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=0,o=1,u=0;for(this[e]=255&t;++a>0)-u&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=r-1,o=1,u=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/o>>0)-u&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;ae?t:Array(e-t.length+1).join("0")+t}var i={bytesToHex:function(t){return r(t)},hexToBytes:function(t){if(t.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===t.indexOf("0x")&&(t=t.slice(2)),t.match(/../g).map(function(t){return parseInt(t,16)})}};"undefined"!=typeof e&&e.exports?e.exports=i:t.convertHex=i}(this)},{}],5:[function(t,e,r){!function(t){"use strict";var r={bytesToString:function(t){return t.map(function(t){return String.fromCharCode(t)}).join("")},stringToBytes:function(t){return t.split("").map(function(t){return t.charCodeAt(0)})}};r.UTF8={bytesToString:function(t){return decodeURIComponent(escape(r.bytesToString(t)))},stringToBytes:function(t){return r.stringToBytes(unescape(encodeURIComponent(t)))}},"undefined"!=typeof e&&e.exports?e.exports=r:t.convertString=r}(this)},{}],6:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,u=8*i-n-1,f=(1<>1,c=-7,l=r?i-1:0,h=r?-1:1,y=t[e+l];for(l+=h,a=y&(1<<-c)-1,y>>=-c,c+=u;c>0;a=256*a+t[e+l],l+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+l],l+=h,c-=8);if(0===a)a=1-s;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o+=Math.pow(2,n),a-=s}return(y?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,u,f,s=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),e+=o+l>=1?h/f:h*Math.pow(2,1-l),e*f>=2&&(o++,f/=2),o+l>=c?(u=0,o=c):o+l>=1?(u=(e*f-1)*Math.pow(2,i),o+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=255&u,y+=p,u/=256,i-=8);for(o=o<0;t[r+y]=255&o,y+=p,o/=256,s-=8);t[r+y-p]|=128*g}},{}],7:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],8:[function(t,e,r){!function(r){"use strict";function n(t,e){t.constructor===String&&(t=i.convertString.UTF8.stringToBytes(t));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=o(t),a=8*t.length;n[a>>5]|=128<<24-a%32,n[(a+64>>9<<4)+15]=a;for(var f=0;f>>5]|=t[r]<<24-n%32;return e},u=function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},f=[],s=function(t,e,r){for(var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],c=t[5],l=t[6],h=t[7],y=0;y<64;y++){if(y<16)f[y]=0|e[r+y];else{var p=f[y-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=f[y-2],d=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;f[y]=g+f[y-7]+d+f[y-16]}var w=s&c^~s&l,b=n&i^n&o^i&o,T=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),O=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),A=h+O+w+a[y]+f[y],m=T+b;h=l,l=c,c=s,s=u+A|0,u=o,o=i,i=n,n=A+m|0}t[0]=t[0]+n|0,t[1]=t[1]+i|0,t[2]=t[2]+o|0,t[3]=t[3]+u|0,t[4]=t[4]+s|0,t[5]=t[5]+c|0,t[6]=t[6]+l|0,t[7]=t[7]+h|0};n.x2=function(t,e){return n(n(t,{asBytes:!0}),e)}}(this)},{"convert-hex":4,"convert-string":5}],"/read.js":[function(t,e,r){(function(r){"use strict";function n(t,e){try{return{value:new DataView(t).getUint32(e),length:4}}catch(t){c.fail(v)}}function i(t,e){return t.length=0,"Offset is negative: "+String(e)),c.assert(t.byteLength>e,v);var r=void 0,o=1;switch(new Uint8Array(t)[e]){case p.ByteType._value:r=new p.ByteType;break;case p.ShortType._value:r=new p.ShortType;break;case p.IntType._value:r=new p.IntType;break;case p.LongType._value:r=new p.LongType;break;case p.UnsignedByteType._value:r=new p.UnsignedByteType;break;case p.UnsignedShortType._value:r=new p.UnsignedShortType;break;case p.UnsignedIntType._value:r=new p.UnsignedIntType;break;case p.UnsignedLongType._value:r=new p.UnsignedLongType;break;case p.DateType._value:r=new p.DateType;break;case p.FloatType._value:r=new p.FloatType;break;case p.DoubleType._value:r=new p.DoubleType;break;case p.BooleanType._value:r=new p.BooleanType;break;case p.BooleanTupleType._value:var u=n(t,e+o);r=new p.BooleanTupleType(u.value),o+=u.length;break;case p.BooleanArrayType._value:r=new p.BooleanArrayType;break;case p.CharType._value:r=new p.CharType;break;case p.StringType._value:r=new p.StringType;break;case p.OctetsType._value:r=new p.OctetsType;break;case p.TupleType._value:var s=a(t,e+o);o+=s.length;var l=n(t,e+o);o+=l.length,r=new p.TupleType({type:s.value,length:l.value});break;case p.StructType._value:c.assert(t.byteLength>e+o,v);var y=new Uint8Array(t),g=y[e+o];o++;for(var d={},w=0;we+o,v);var b=y[e+o];o++,c.assert(t.byteLength>=e+o+b,v);var T=h.toString(y.subarray(e+o,e+o+b));o+=b;var O=a(t,e+o);d[T]=O.value,o+=O.length}r=new p.StructType(d);break;case p.ArrayType._value:var A=a(t,e+o);o+=A.length,r=new p.ArrayType(A.value);break;case p.SetType._value:var m=a(t,e+o);o+=m.length,r=new p.SetType(m.value);break;case p.MapType._value:var S=a(t,e+o);o+=S.length;var B=a(t,e+o);o+=B.length,r=new p.MapType(S.value,B.value);break;case p.EnumType._value:var _=a(t,e+o);o+=_.length,c.assert(t.byteLength>e+o,v);var E=new Uint8Array(t)[e+o];o++;for(var k=[],P=0;Pe+o,v);var j=new Uint8Array(t)[e+o];o++;for(var R=new Array(j),x=0;x=e+D,v);var N=new DataView(t).getUint16(e+o),C=a(t,e+o-N);r=C.value,o=D;break;default:c.fail("No such type: 0x"+i(new Uint8Array(t)[e].toString(16),2))}return{value:r,length:o}}function o(t){var e=arguments.length<=1||void 0===arguments[1]||arguments[1];c.instanceOf(t,ArrayBuffer);var r=a(t,0),n=r.value,i=r.length;return e&&c.assert(i===t.byteLength,"Did not consume all of the buffer"),n}function u(t){var e=t.buffer,r=t.offset,n=t.count,i=new Array(n),a=l.modEight(i.length),o=l.dividedByEight(i.length),u=void 0;u=a?o+1:o,c.assert(e.byteLength>=r+u,v);for(var f=new Uint8Array(e),s=0;s=r+o,v),a=new Int8Array(e)[r];break;case p.ShortType:o=2,c.assert(e.byteLength>=r+o,v);var s=new DataView(e);a=s.getInt16(r);break;case p.IntType:o=4;var l=new DataView(e);a=l.getInt32(r);break;case p.LongType:o=8,c.assert(e.byteLength>=r+o,v);var d=new DataView(e),w=d.getInt32(r),b=d.getUint32(r+4);a=y.add(y.mul(String(w),y.LONG_UPPER_SHIFT),String(b));break;case p.UnsignedByteType:o=1,c.assert(e.byteLength>=r+o,v),a=new Uint8Array(e)[r];break;case p.UnsignedShortType:o=2,c.assert(e.byteLength>=r+o,v),a=new DataView(e).getUint16(r);break;case p.UnsignedIntType:o=4,c.assert(e.byteLength>=r+o,v),a=new DataView(e).getUint32(r);break;case p.UnsignedLongType:case p.DateType:o=8,c.assert(e.byteLength>=r+o,v);var T=new DataView(e),O=T.getUint32(r),A=T.getUint32(r+4);a=y.add(y.mul(String(O),y.LONG_UPPER_SHIFT),String(A)),i.constructor===p.DateType&&(a=new Date(Number(a)));break;case p.FloatType:o=4,c.assert(e.byteLength>=r+o,v),a=new DataView(e).getFloat32(r);break;case p.DoubleType:o=8,c.assert(e.byteLength>=r+o,v),a=new DataView(e).getFloat64(r);break;case p.BooleanType:o=1,c.assert(e.byteLength>=r+o,v);var m=new Uint8Array(e)[r];c.assert(0===m||255===m,"0x"+m.toString(16)+" is an invalid Boolean value"),a=!!m;break;case p.BooleanArrayType:var S=n(e,r);o=S.length;var B=u({buffer:e,offset:r+o,count:S.value});o+=B.length,a=B.value;break;case p.BooleanTupleType:var _=u({buffer:e,offset:r,count:i.length});a=_.value,o=_.length;break;case p.CharType:c.assert(e.byteLength>r,v),a=h.toString(new Uint8Array(e).subarray(r,r+4))[0],o=h.fromString(a).byteLength;break;case p.StringType:var E=new Uint8Array(e);for(o=0;c.assert(e.byteLength>r+o,v),E[r+o];o++);a=h.toString(new Uint8Array(e).subarray(r,r+o)),o++;break;case p.OctetsType:var k=n(e,r);o=k.length;var P=o+k.value;c.assert(e.byteLength>=r+P,v),a=e.slice(r+o,r+P),o=P;break;case p.TupleType:o=0,a=new Array(i.length);for(var U=0;U=r+o,v);var Q=new Uint8Array(e)[r];a=i.values[Q],void 0===a&&c.fail("Index "+String(Q)+" is invalid");break;case p.ChoiceType:o=1,c.assert(e.byteLength>=r+o,v);var Z=new Uint8Array(e)[r],K=f({buffer:e,offset:r+o,type:i.types[Z]});o+=K.length,a=K.value;break;case p.OptionalType:o=1,c.assert(e.byteLength>=r+o,v);var tt=new Uint8Array(e)[r];if(c.assert(0===tt||255===tt,"0x"+tt.toString(16)+" is an invalid Optional byte"),tt){var et=f({buffer:e,offset:r+o,type:i.type});o+=et.length,a=et.value}else a=null;break;case p.PointerType:var rt=n(e,r);o=rt.length,a=f({buffer:e,offset:rt.value,type:i.type}).value;break;default:c.fail("Not a structure type: "+g.inspect(i))}return{value:a,length:o}}function s(t){var e=t.buffer,r=t.type,n=t.offset;c.instanceOf(e,ArrayBuffer),c.instanceOf(r,p.Type),void 0===n&&(n=0),c.instanceOf(n,Number);var i=f({buffer:e,offset:n,type:r}),a=i.value;return a}"/"===r&&(r="");var c=t(r+"/lib/assert.js"),l=t(r+"/lib/bit-math.js"),h=t(r+"/lib/buffer-string.js"),y=t(r+"/lib/strint.js"),p=t(r+"/structure-types.js"),g=t("/lib/util-inspect.js"),v="Buffer is not long enough";e.exports={_consumeType:a,type:o,value:s}}).call(this,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js"}],"/structure-types.js":[function(t,e,r){(function(r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t),e}function u(t,e){if(e&&t.pointers){var r=!0,n=!1,i=void 0;try{for(var a,o=t.pointers[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=y(a.value,2),f=u[0],s=u[1],c=t.length;t.addAll(v.fromBinaryString(f));var l=new ArrayBuffer(4);new DataView(l).setUint32(0,c);var h=!0,p=!1,g=void 0;try{for(var d,w=s[Symbol.iterator]();!(h=(d=w.next()).done);h=!0){var b=d.value;t.setAll(b,l)}}catch(t){p=!0,g=t}finally{try{!h&&w.return&&w.return()}finally{if(p)throw g}}}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}}}function f(t){if(t&&t.constructor===String){var e=Number(t);if(!isNaN(e))return e}}function s(t,e){p.instanceOf(t,b),p.instanceOf(e,String),(T.gt(e,"18446744073709551615")||T.lt(e,"0"))&&p.fail("Value out of range");var r=T.div(e,T.LONG_UPPER_SHIFT),n=T.sub(e,T.mul(r,T.LONG_UPPER_SHIFT)),i=new ArrayBuffer(8),a=new DataView(i);a.setUint32(0,Number(r)),a.setUint32(4,Number(n)),t.addAll(i)}function c(t,e){p.instanceOf(e,Array);var r=S(e.length),n=m(e.length),i=void 0;i=r?n+1:n;for(var a=new ArrayBuffer(i),o=new Uint8Array(a),u=0;ue[$]?1:void 0}),r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 81}}]),h(e,[{key:"addToBuffer",value:function(t){if(l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var r=!0,n=!1,i=void 0;try{for(var a,o=this.fields[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=a.value,f=u[Q];t.add(f.byteLength),t.addAll(f),u[W].addToBuffer(t)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}}}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,b),p.instanceOf(e,Object);var n=!0,i=!1,a=void 0;try{for(var o,f=this.fields[Symbol.iterator]();!(n=(o=f.next()).done);n=!0){var s=o.value,c=e[s[$]];void 0===c&&p.fail("Value for field "+s[$]+" missing"),s[W].writeValue(t,c,!1)}}catch(t){i=!0,a=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw a}}u(t,r)}}]),e}(E),K=function(t){function e(t){a(this,e);var r=n(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,_),r.type=t,r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 82}}]),h(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,r){p.instanceOf(t,b),p.fourByteUnsignedInteger(e.length),t.addAll(o(e.length));var n=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var c=f.value;this.type.writeValue(t,c,!1)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}u(t,r)}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Array),this._writeValue(t,e,r)}}]),e}(E),tt=function(t){function e(t){return a(this,e),n(this,Object.getPrototypeOf(e).call(this,t))}return i(e,t),h(e,null,[{key:"_value",get:function(){return 83}}]),h(e,[{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,r)}}]),e}(K),et=function(t){function e(t,r){a(this,e);var i=n(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,_),p.instanceOf(r,_),i.keyType=t,i.valueType=r,i}return i(e,t),h(e,null,[{key:"_value",get:function(){return 84}}]),h(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,b),p.instanceOf(e,Map),p.fourByteUnsignedInteger(e.size),t.addAll(o(e.size));var n=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var c=y(f.value,2),l=c[0],h=c[1];this.keyType.writeValue(t,l,!1),this.valueType.writeValue(t,h,!1)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}u(t,r)}}]),e}(E),rt=function(t){function e(t){var r=t.type,i=t.values;a(this,e);var o=n(this,Object.getPrototypeOf(e).call(this));p.instanceOf(r,E),p.instanceOf(i,Array);try{p.byteUnsignedInteger(i.length)}catch(t){p.fail(String(i.length)+" values is too many")}for(var u=new Map,f=0;f=200&&t.status<300||304===t.status;r?e[o]=t.response:e.text=t.statusText,n(t.status,t.statusText,e,t.getAllResponseHeaders())}),t.open(i,a,s),t.responseType=o;for(var f in r)r.hasOwnProperty(f)&&t.setRequestHeader(f,r[f]);t.send(u)},abort:function(){t&&t.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(e,t,r){"use strict";var n=e("/lib/assert.js");if(n.instanceOf(window.Map,Function),n.instanceOf(window.Set,Function),n.instanceOf(window.ArrayBuffer,Function),n.instanceOf(window.Uint8Array,Function),n.instanceOf(window.Symbol,Function),e("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=e("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(e,t,r){(function(r){"use strict";"/"===r&&(r="");var n=e(r+"/lib/assert.js"),a=e("base64-js"),i=7;n.between(0,i,65536);var o=2,u=new ArrayBuffer(o);new DataView(u).setUint16(0,i);var s=a.fromByteArray(new Uint8Array(u));t.exports={VERSION_STRING:s}}).call(this,"/")},{"base64-js":2}],"/lib/assert.js":[function(e,t,r){"use strict";var n=e("/lib/util-inspect.js"),a={instanceOf:function(e,t){t instanceof Array||(t=[t]);var r=!1,a=!0,i=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var f=u.value;if(e instanceof f||void 0!==e&&null!==e&&e.constructor===f){r=!0;break}}}catch(e){i=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw o}}if(!r)throw new TypeError(n.inspect(e)+" is not an instance of "+t.map(function(e){return e.name}).join(" or "))},integer:function(e){if(a.instanceOf(e,Number),!Number.isSafeInteger(e))throw new RangeError(n.inspect(e)+" is not an integer")},between:function(e,t,r,a){if(t=r){var i=n.inspect(t)+" is not in ["+n.inspect(e)+","+n.inspect(r)+")";throw void 0===a?new RangeError(i):new RangeError(a+" ("+i+")")}},byteUnsignedInteger:function(e){a.integer(e),a.between(0,e,256)},fourByteUnsignedInteger:function(e){a.integer(e),a.between(0,e,4294967296)},fail:function(e){throw new Error(e)},assert:function(e,t){e||a.fail(t)},throws:function(e,t){var r=!0;try{e(),r=!1}catch(e){void 0!==t&&a.message(e,t)}a.assert(r,"Should throw an error")},equal:function(e,t){var r=new RangeError("Expected "+n.inspect(t)+" but got "+n.inspect(e));if(t&&t.constructor===Object){for(var i in t)if(t.hasOwnProperty(i))try{a.equal(e[i],t[i])}catch(e){throw r}}else if(t&&t.constructor===Array){if(!e||e.constructor!==Array)throw r;try{a.equal(e.length,t.length)}catch(e){throw r}for(var o=0;o>>3},modEight:function(e){return 7&e}}},{}],"/lib/buffer-string.js":[function(e,t,r){(function(r){"use strict";var n=e(r+"/assert.js"),a=e(r+"/growable-buffer.js"),i=4096;t.exports={toString:function(e){e&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),n.instanceOf(e,Uint8Array);for(var t=[],r=0;r239?4:a>223?3:a>191?2:1;if(r+u<=e.length){var s=void 0,f=void 0,l=void 0,c=void 0;switch(u){case 1:a<128&&(o=a);break;case 2:s=e[r+1],128===(192&s)&&(c=(31&a)<<6|63&s,c>127&&(o=c));break;case 3:s=e[r+1],f=e[r+2],128===(192&s)&&128===(192&f)&&(c=(15&a)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:s=e[r+1],f=e[r+2],l=e[r+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&a)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(o=c))}}void 0===o?(o=65533,u=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|1023&o),t.push(o),r+=u}for(var y="",h=0;h>6),t.add(128|63&l)):l<55296||l>=57344?(t.add(224|l>>12),t.add(128|l>>6&63),t.add(128|63&l)):(l=65536+((1023&l)<<10|1023&l),t.add(240|l>>18),t.add(128|l>>12&63),t.add(128|l>>6&63),t.add(128|63&l))}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return t.toBuffer()},toBinaryString:function(e){n.instanceOf(e,ArrayBuffer);var t="",r=new Uint8Array(e),a=!0,i=!1,o=void 0;try{for(var u,s=r[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var f=u.value;t+=String.fromCharCode(f)}}catch(e){i=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw o}}return t},fromBinaryString:function(e){n.instanceOf(e,String);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;athis.buffer.byteLength){var t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}},{key:"set",value:function(e,t){i.integer(e),i.integer(t),i.between(0,e,this.size,"Index out of bounds: "+String(e)),i.between(0,t,256,"Not a byte: "+String(t));var r=new Uint8Array(this.buffer);return r[e]=t,this}},{key:"setAll",value:function(e,t){i.instanceOf(t,ArrayBuffer),i.integer(e),i.between(0,e,this.size-t.byteLength+1,"Index out of bounds: "+String(e)),new Uint8Array(this.buffer).set(new Uint8Array(t),e)}},{key:"get",value:function(e){return i.integer(e),i.between(0,e,this.size,"Index out of bounds: "+String(e)),new Uint8Array(this.buffer)[e]}},{key:"add",value:function(e){var t=this.size,r=t+1;this.grow(r),this.size=r;var n=new Uint8Array(this.buffer);return n[t]=e,this}},{key:"addAll",value:function(e){i.instanceOf(e,ArrayBuffer);var t=this.size,r=this.size+e.byteLength;return this.grow(r),this.size=r,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),e}();t.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a={};!function(){function e(e,t){return k(e)===k(t)}function t(e,t){for(;t>0;)e+="0",t--;return e}function r(e){f(e,"string")}function i(e){r(e),s(e,k,"isPositive")}function o(e){f(e,"number")}function u(e){if(f(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function s(e,t,r){if(!t.call(null,e))throw new Error("Condition "+r+" failed for value "+e)}function f(e,t){if(("undefined"==typeof e?"undefined":n(e))!==t)throw new Error("Not a "+t+": "+e)}var l=a.subPositive=function(e,t){if(i(e),i(t),!O(e,t))throw new Error("x must be greater or equal to y");for(var r=Math.max(e.length,t.length),n="",a=0,o=0,u=0;u=10;)l-=10,a++;0===l?o++:(n=String(l)+P(n,o),o=0)}return a>0&&(n=String(a)+P(n,o)),n},y=a.add=function(e,t){if(r(e),r(t),k(e)&&k(t))return c(e,t);if(S(e)&&S(t))return B(c(m(e),m(t)));if(T(m(e),m(t))){var n=e;e=t,t=n}var a=l(m(e),m(t));return k(e)?a:B(a)},h=a.sub=function(e,t){return r(e),r(t),y(e,B(t))},v=a.timesDigit=function(e,t){i(e),o(t);for(var r="",n=E(e),a=0,u=0,s=0;s=10;)f-=10,a++;0===f?u++:(r=String(f)+P(r,u),u=0)}return a>0&&(r=String(a)+P(r,u)),0===r.length?"0":r},g=a.mulPositive=function(e,r){i(e),i(r);for(var n="0",a=E(r),o=0;o=E(e)?"0":e.charAt(e.length-t-1)},E=function(e){return S(e)?e.length-1:e.length}}(),a.LONG_UPPER_SHIFT="4294967296",t.exports=a},{}],"/lib/util-inspect.js":[function(e,t,r){"use strict";r.inspect=function(e){if(void 0===e)return"undefined";if(null===e||e.constructor===Object||e.constructor===Array||e.constructor===String||e.constructor===Number||e.constructor===Boolean||e.constructor===Date)return JSON.stringify(e);if(e.constructor===Set){for(var t="Set {",n=e.values(),a=n.next();!a.done;)t+=r.inspect(a.value),a=n.next(),a.done||(t+=", ");return t+"}"}if(e.constructor===Map){for(var i="Map {",o=e.entries(),u=o.next();!u.done;)i+=r.inspect(u.value[0]),i+=" => ",i+=r.inspect(u.value[1]),u=o.next(),u.done||(i+=", ");return i+"}"}return e.constructor.name?e.constructor.name+" "+JSON.stringify(e):JSON.stringify(e)}},{}],1:[function(e,t,r){"use strict";!function(){e("/client-side/common.js");var t=e("/lib/assert.js");window.sb.upload=function(e,r){var n=e.type,a=e.value;if(t.instanceOf(n,window.sb.Type),t.instanceOf(r,Object),"POST"!==r.type&&"POST"!==r.method)throw new Error("Must use POST when uploading");r.processData=!1,r.data=n.valueBuffer(a),$.ajax(r)}}(),function(){function t(){var e={};for(var t in i)e[t]={sig:i[t].sig,type:n.fromByteArray(new Uint8Array(i[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}e("/client-side/common.js");var r=e("/lib/assert.js"),n=e("base64-js"),a=e("/read.js"),i={};if(void 0===localStorage.typeCache)t();else{var o=JSON.parse(localStorage.typeCache);for(var u in o)i[u]={sig:o[u].sig,type:a.type(new Uint8Array(n.toByteArray(o[u].type)).buffer)}}window.sb.download=function(e,n){function o(e,t,r){if(s){s instanceof Array||(s=[s]);var n=!0,a=!1,i=void 0;try{for(var o,u=s[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var f=o.value;f(e,t,r)}}catch(e){a=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw i}}}}r.instanceOf(e,String),r.instanceOf(n,Object),n.processData=!1,n.dataType="arraybuffer";var u=!1;i[e]&&(u=!0,n.headers||(n.headers={}),n.headers.sig=i[e].sig);var s=n.success;n.success=function(r,n,s){var f=s.getResponseHeader("sig");if(u&&i[e].sig===f){var l=i[e].type,c=a.value({buffer:r,type:l});o(c,n,s)}else{var y=a._consumeType(r,0),h=a.value({buffer:r,offset:y.length,type:y.value}),v=y.value;i[e]={sig:f,type:v},t(),o(h,n,s)}},$.ajax(n)}}()},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js","/read.js":"/read.js","base64-js":2}],2:[function(e,t,r){"use strict";function n(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[u-2]?2:"="===e[u-1]?1:0,o=new l(3*u/4-i),n=i>0?u-4:u;var s=0;for(t=0,r=0;t>16&255,o[s++]=a>>8&255,o[s++]=255&a;return 2===i?(a=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,o[s++]=255&a):1===i&&(a=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,o[s++]=a>>8&255,o[s++]=255&a),o}function i(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function o(e,t,r){for(var n,a=[],o=t;ol?l:f+u));return 1===n?(t=e[r-1],a+=s[t>>2],a+=s[t<<4&63],a+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],a+=s[t>>10],a+=s[t>>4&63],a+=s[t<<2&63],a+="="),i.push(a),i.join("")}r.toByteArray=a,r.fromByteArray=u;var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(e,t,r){!function(e){"use strict";function r(e){return e.map(function(e){return n(e.toString(16),2)}).join("")}function n(e,t){return e.length>t?e:Array(t-e.length+1).join("0")+e}var a={bytesToHex:function(e){return r(e)},hexToBytes:function(e){if(e.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map(function(e){return parseInt(e,16)})}};"undefined"!=typeof t&&t.exports?t.exports=a:e.convertHex=a}(this)},{}],4:[function(e,t,r){!function(e){"use strict";var r={bytesToString:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")},stringToBytes:function(e){return e.split("").map(function(e){return e.charCodeAt(0)})}};r.UTF8={bytesToString:function(e){return decodeURIComponent(escape(r.bytesToString(e)))},stringToBytes:function(e){return r.stringToBytes(unescape(encodeURIComponent(e)))}},"undefined"!=typeof t&&t.exports?t.exports=r:e.convertString=r}(this)},{}],5:[function(e,t,r){!function(r){"use strict";function n(e,t){e.constructor===String&&(e=a.convertString.UTF8.stringToBytes(e));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=o(e),i=8*e.length;n[i>>5]|=128<<24-i%32,n[(i+64>>9<<4)+15]=i;for(var s=0;s>>5]|=e[r]<<24-n%32;return t},u=function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},s=[],f=function(e,t,r){for(var n=e[0],a=e[1],o=e[2],u=e[3],f=e[4],l=e[5],c=e[6],y=e[7],h=0;h<64;h++){if(h<16)s[h]=0|t[r+h];else{var v=s[h-15],g=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,d=s[h-2],p=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;s[h]=g+s[h-7]+p+s[h-16]}var b=f&l^~f&c,w=n&a^n&o^a&o,T=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),O=(f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25),A=y+O+b+i[h]+s[h],S=T+w;y=c,c=l,l=f,f=u+A|0,u=o,o=a,a=n,n=A+S|0}e[0]=e[0]+n|0,e[1]=e[1]+a|0,e[2]=e[2]+o|0,e[3]=e[3]+u|0,e[4]=e[4]+f|0,e[5]=e[5]+l|0,e[6]=e[6]+c|0,e[7]=e[7]+y|0};n.x2=function(e,t){return n(n(e,{asBytes:!0}),t)}}(this)},{"convert-hex":3,"convert-string":4}],"/read.js":[function(e,t,r){(function(r){"use strict";function n(e,t){try{return{value:new DataView(e).getUint32(t),length:4}}catch(e){l.fail(d)}}function a(e,t){return e.length=0,"Offset is negative: "+String(t)),l.assert(e.byteLength>t,d);var r=void 0,o=1;switch(new Uint8Array(e)[t]){case v.ByteType._value:r=new v.ByteType;break;case v.ShortType._value:r=new v.ShortType;break;case v.IntType._value:r=new v.IntType;break;case v.LongType._value:r=new v.LongType;break;case v.UnsignedByteType._value:r=new v.UnsignedByteType;break;case v.UnsignedShortType._value:r=new v.UnsignedShortType;break;case v.UnsignedIntType._value:r=new v.UnsignedIntType;break;case v.UnsignedLongType._value:r=new v.UnsignedLongType;break;case v.DateType._value:r=new v.DateType;break;case v.FloatType._value:r=new v.FloatType;break;case v.DoubleType._value:r=new v.DoubleType;break;case v.BooleanType._value:r=new v.BooleanType;break;case v.BooleanTupleType._value:var u=n(e,t+o);r=new v.BooleanTupleType(u.value),o+=u.length;break;case v.BooleanArrayType._value:r=new v.BooleanArrayType;break;case v.CharType._value:r=new v.CharType;break;case v.StringType._value:r=new v.StringType;break;case v.OctetsType._value:r=new v.OctetsType;break;case v.TupleType._value:var f=i(e,t+o);o+=f.length;var c=n(e,t+o);o+=c.length,r=new v.TupleType({type:f.value,length:c.value});break;case v.StructType._value:l.assert(e.byteLength>t+o,d);var h=new Uint8Array(e),g=h[t+o];o++;for(var p={},b=0;bt+o,d);var w=h[t+o];o++,l.assert(e.byteLength>=t+o+w,d);var T=y.toString(h.subarray(t+o,t+o+w));o+=w;var O=i(e,t+o);p[T]=O.value,o+=O.length}r=new v.StructType(p);break;case v.ArrayType._value:var A=i(e,t+o);o+=A.length,r=new v.ArrayType(A.value);break;case v.SetType._value:var S=i(e,t+o);o+=S.length,r=new v.SetType(S.value);break;case v.MapType._value:var k=i(e,t+o);o+=k.length;var m=i(e,t+o);o+=m.length,r=new v.MapType(k.value,m.value);break;case v.EnumType._value:var B=i(e,t+o);o+=B.length,l.assert(e.byteLength>t+o,d);var j=new Uint8Array(e)[t+o];o++;for(var U=[],_=0;_t+o,d);var P=new Uint8Array(e)[t+o];o++;for(var V=new Array(P),E=0;E=t+D,d);var C=new DataView(e).getUint16(t+o),F=i(e,t+o-C);r=F.value,o=D;break;default:l.fail("No such type: 0x"+a(new Uint8Array(e)[t].toString(16),2))}return{value:r,length:o}}function o(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];l.instanceOf(e,ArrayBuffer);var r=i(e,0),n=r.value,a=r.length;return t&&l.assert(a===e.byteLength,"Did not consume all of the buffer"),n}function u(e){var t=e.buffer,r=e.offset,n=e.count,a=new Array(n),i=c.modEight(a.length),o=c.dividedByEight(a.length),u=void 0;u=i?o+1:o,l.assert(t.byteLength>=r+u,d);for(var s=new Uint8Array(t),f=0;f=r+o,d),i=new Int8Array(t)[r];break;case v.ShortType:o=2,l.assert(t.byteLength>=r+o,d);var f=new DataView(t);i=f.getInt16(r);break;case v.IntType:o=4;var c=new DataView(t);i=c.getInt32(r);break;case v.LongType:o=8,l.assert(t.byteLength>=r+o,d);var p=new DataView(t),b=p.getInt32(r),w=p.getUint32(r+4);i=h.add(h.mul(String(b),h.LONG_UPPER_SHIFT),String(w));break;case v.UnsignedByteType:o=1,l.assert(t.byteLength>=r+o,d),i=new Uint8Array(t)[r];break;case v.UnsignedShortType:o=2,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getUint16(r);break;case v.UnsignedIntType:o=4,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getUint32(r);break;case v.UnsignedLongType:case v.DateType:o=8,l.assert(t.byteLength>=r+o,d);var T=new DataView(t),O=T.getUint32(r),A=T.getUint32(r+4);i=h.add(h.mul(String(O),h.LONG_UPPER_SHIFT),String(A)),a.constructor===v.DateType&&(i=new Date(Number(i)));break;case v.FloatType:o=4,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getFloat32(r);break;case v.DoubleType:o=8,l.assert(t.byteLength>=r+o,d),i=new DataView(t).getFloat64(r);break;case v.BooleanType:o=1,l.assert(t.byteLength>=r+o,d);var S=new Uint8Array(t)[r];l.assert(0===S||255===S,"0x"+S.toString(16)+" is an invalid Boolean value"),i=!!S;break;case v.BooleanArrayType:var k=n(t,r);o=k.length;var m=u({buffer:t,offset:r+o,count:k.value});o+=m.length,i=m.value;break;case v.BooleanTupleType:var B=u({buffer:t,offset:r,count:a.length});i=B.value,o=B.length;break;case v.CharType:l.assert(t.byteLength>r,d),i=y.toString(new Uint8Array(t).subarray(r,r+4))[0],o=y.fromString(i).byteLength;break;case v.StringType:var j=new Uint8Array(t);for(o=0;l.assert(t.byteLength>r+o,d),j[r+o];o++);i=y.toString(new Uint8Array(t).subarray(r,r+o)),o++;break;case v.OctetsType:var U=n(t,r);o=U.length;var _=o+U.value;l.assert(t.byteLength>=r+_,d),i=t.slice(r+o,r+_),o=_;break;case v.TupleType:o=0,i=new Array(a.length);for(var x=0;x=r+o,d);var Q=new Uint8Array(t)[r];i=a.values[Q],void 0===i&&l.fail("Index "+String(Q)+" is invalid");break;case v.ChoiceType:o=1,l.assert(t.byteLength>=r+o,d);var K=new Uint8Array(t)[r],Z=s({buffer:t,offset:r+o,type:a.types[K]});o+=Z.length,i=Z.value;break;case v.OptionalType:o=1,l.assert(t.byteLength>=r+o,d);var ee=new Uint8Array(t)[r];if(l.assert(0===ee||255===ee,"0x"+ee.toString(16)+" is an invalid Optional byte"),ee){var te=s({buffer:t,offset:r+o,type:a.type});o+=te.length,i=te.value}else i=null;break;case v.PointerType:var re=n(t,r);o=re.length,i=s({buffer:t,offset:re.value,type:a.type}).value;break;default:l.fail("Not a structure type: "+g.inspect(a))}return{value:i,length:o}}function f(e){var t=e.buffer,r=e.type,n=e.offset;l.instanceOf(t,ArrayBuffer),l.instanceOf(r,v.Type),void 0===n&&(n=0),l.instanceOf(n,Number);var a=s({buffer:t,offset:n,type:r}),i=a.value;return i}"/"===r&&(r="");var l=e(r+"/lib/assert.js"),c=e(r+"/lib/bit-math.js"),y=e(r+"/lib/buffer-string.js"),h=e(r+"/lib/strint.js"),v=e(r+"/structure-types.js"),g=e("/lib/util-inspect.js"),d="Buffer is not long enough";t.exports={_consumeType:i,type:o,value:f}}).call(this,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js"}],"/structure-types.js":[function(e,t,r){(function(r){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e),t}function u(e,t){if(t&&e.pointers){var r=!0,n=!1,a=void 0;try{for(var i,o=e.pointers[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var u=h(i.value,2),s=u[0],f=u[1],l=e.length;e.addAll(d.fromBinaryString(s));var c=new ArrayBuffer(4);new DataView(c).setUint32(0,l);var y=!0,v=!1,g=void 0;try{for(var p,b=f[Symbol.iterator]();!(y=(p=b.next()).done);y=!0){var w=p.value;e.setAll(w,c)}}catch(e){v=!0,g=e}finally{try{!y&&b.return&&b.return()}finally{if(v)throw g}}}}catch(e){n=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw a}}}}function s(e){if(e&&e.constructor===String){var t=Number(e);if(!isNaN(t))return t}}function f(e,t){v.instanceOf(e,w),v.instanceOf(t,String),(T.gt(t,"18446744073709551615")||T.lt(t,"0"))&&v.fail("Value out of range");var r=T.div(t,T.LONG_UPPER_SHIFT),n=T.sub(t,T.mul(r,T.LONG_UPPER_SHIFT)),a=new ArrayBuffer(8),i=new DataView(a);i.setUint32(0,Number(r)),i.setUint32(4,Number(n)),e.addAll(a)}function l(e,t){v.instanceOf(t,Array);var r=k(t.length),n=S(t.length),a=void 0;a=r?n+1:n;for(var i=new ArrayBuffer(a),o=new Uint8Array(i),u=0;ut[X]?1:void 0}),r}return a(t,e),y(t,null,[{key:"_value",get:function(){return 81}}]),y(t,[{key:"addToBuffer",value:function(e){if(c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)){e.add(this.fields.length);var r=!0,n=!1,a=void 0;try{for(var i,o=this.fields[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var u=i.value,s=u[Q];e.add(s.byteLength),e.addAll(s),u[Y].addToBuffer(e)}}catch(e){n=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw a}}}}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,w),v.instanceOf(t,Object);var n=!0,a=!1,i=void 0;try{for(var o,s=this.fields[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var f=o.value,l=t[f[X]];void 0===l&&v.fail("Value for field "+f[X]+" missing"),f[Y].writeValue(e,l,!1)}}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}u(e,r)}}]),t}(j),Z=function(e){function t(e){i(this,t);var r=n(this,Object.getPrototypeOf(t).call(this));return v.instanceOf(e,B),r.type=e,r}return a(t,e),y(t,null,[{key:"_value",get:function(){return 82}}]),y(t,[{key:"addToBuffer",value:function(e){c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&this.type.addToBuffer(e)}},{key:"_writeValue",value:function(e,t,r){v.instanceOf(e,w),v.fourByteUnsignedInteger(t.length),e.addAll(o(t.length));var n=!0,a=!1,i=void 0;try{for(var s,f=t[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var l=s.value;this.type.writeValue(e,l,!1)}}catch(e){a=!0,i=e}finally{try{!n&&f.return&&f.return()}finally{if(a)throw i}}u(e,r)}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,Array),this._writeValue(e,t,r)}}]),t}(j),ee=function(e){function t(e){return i(this,t),n(this,Object.getPrototypeOf(t).call(this,e))}return a(t,e),y(t,null,[{key:"_value",get:function(){return 83}}]),y(t,[{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,Set),t.length=t.size,this._writeValue(e,t,r)}}]),t}(Z),te=function(e){function t(e,r){i(this,t);var a=n(this,Object.getPrototypeOf(t).call(this));return v.instanceOf(e,B),v.instanceOf(r,B),a.keyType=e,a.valueType=r,a}return a(t,e),y(t,null,[{key:"_value",get:function(){return 84}}]),y(t,[{key:"addToBuffer",value:function(e){c(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&(this.keyType.addToBuffer(e),this.valueType.addToBuffer(e))}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,w),v.instanceOf(t,Map),v.fourByteUnsignedInteger(t.size),e.addAll(o(t.size));var n=!0,a=!1,i=void 0;try{for(var s,f=t[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var l=h(s.value,2),c=l[0],y=l[1];this.keyType.writeValue(e,c,!1),this.valueType.writeValue(e,y,!1)}}catch(e){a=!0,i=e}finally{try{!n&&f.return&&f.return()}finally{if(a)throw i}}u(e,r)}}]),t}(j),re=function(e){function t(e){var r=e.type,a=e.values;i(this,t);var o=n(this,Object.getPrototypeOf(t).call(this));v.instanceOf(r,j),v.instanceOf(a,Array);try{v.byteUnsignedInteger(a.length)}catch(e){v.fail(String(a.length)+" values is too many")}for(var u=new Map,s=0;s=200&&e.status<300||304===e.status;r?t[a]=e.response:t.text=e.statusText,n(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(o,i,f),e.responseType=a;for(var s in r)r.hasOwnProperty(s)&&e.setRequestHeader(s,r[s]);e.send(u)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(t,e,r){"use strict";var n=t("/lib/assert.js");if(n.instanceOf(window.Map,Function),n.instanceOf(window.Set,Function),n.instanceOf(window.ArrayBuffer,Function),n.instanceOf(window.Uint8Array,Function),n.instanceOf(window.Symbol,Function),t("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=t("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(t,e,r){(function(r,n){"use strict";"/"===n&&(n="");var i=t(n+"/lib/assert.js"),o=7;i.between(0,o,65536);var a=2,u=r.allocUnsafe(a);u.writeUInt16BE(o,0);var f=u.toString("base64");e.exports={VERSION_STRING:f}}).call(this,t("buffer").Buffer,"/")},{buffer:3}],"/lib/assert.js":[function(t,e,r){"use strict";var n=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var r=!1,i=!0,o=!1,a=void 0;try{for(var u,f=e[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;if(t instanceof s||void 0!==t&&null!==t&&t.constructor===s){r=!0;break}}}catch(t){o=!0,a=t}finally{try{!i&&f.return&&f.return()}finally{if(o)throw a}}if(!r)throw new TypeError(n.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(n.inspect(t)+" is not an integer")},between:function(t,e,r,i){if(e=r){var o=n.inspect(e)+" is not in ["+n.inspect(t)+","+n.inspect(r)+")";throw void 0===i?new RangeError(o):new RangeError(i+" ("+o+")")}},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t,e){var r=!0;try{t(),r=!1}catch(t){void 0!==e&&i.message(t,e)}i.assert(r,"Should throw an error")},equal:function(t,e){var r=new RangeError("Expected "+n.inspect(e)+" but got "+n.inspect(t));if(e&&e.constructor===Object){for(var o in e)if(e.hasOwnProperty(o))try{i.equal(t[o],e[o])}catch(t){throw r}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw r;try{i.equal(t.length,e.length)}catch(t){throw r}for(var a=0;a>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-string.js":[function(t,e,r){(function(r){"use strict";var n=t(r+"/assert.js"),i=t(r+"/growable-buffer.js"),o=4096;e.exports={toString:function(t){t&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),n.instanceOf(t,Uint8Array);for(var e=[],r=0;r239?4:i>223?3:i>191?2:1;if(r+u<=t.length){var f=void 0,s=void 0,c=void 0,l=void 0;switch(u){case 1:i<128&&(a=i);break;case 2:f=t[r+1],128===(192&f)&&(l=(31&i)<<6|63&f,l>127&&(a=l));break;case 3:f=t[r+1],s=t[r+2],128===(192&f)&&128===(192&s)&&(l=(15&i)<<12|(63&f)<<6|63&s,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[r+1],s=t[r+2],c=t[r+3],128===(192&f)&&128===(192&s)&&128===(192&c)&&(l=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&c,l>65535&&l<1114112&&(a=l))}}void 0===a?(a=65533,u=1):a>65535&&(a-=65536,e.push(a>>>10&1023|55296),a=56320|1023&a),e.push(a),r+=u}for(var h="",y=0;y>6),e.add(128|63&c)):c<55296||c>=57344?(e.add(224|c>>12),e.add(128|c>>6&63),e.add(128|63&c)):(c=65536+((1023&c)<<10|1023&c),e.add(240|c>>18),e.add(128|c>>12&63),e.add(128|c>>6&63),e.add(128|63&c))}}catch(t){o=!0,a=t}finally{try{!r&&f.return&&f.return()}finally{if(o)throw a}}return e.toBuffer()},toBinaryString:function(t){n.instanceOf(t,ArrayBuffer);var e="",r=new Uint8Array(t),i=!0,o=!1,a=void 0;try{for(var u,f=r[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;e+=String.fromCharCode(s)}}catch(t){o=!0,a=t}finally{try{!i&&f.return&&f.return()}finally{if(o)throw a}}return e},fromBinaryString:function(t){n.instanceOf(t,String);for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),i=0;ithis.buffer.byteLength){var e=new ArrayBuffer(t<<1);new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=e}return this}},{key:"set",value:function(t,e){o.integer(t),o.integer(e),o.between(0,t,this.size,"Index out of bounds: "+String(t)),o.between(0,e,256,"Not a byte: "+String(e));var r=new Uint8Array(this.buffer);return r[t]=e,this}},{key:"setAll",value:function(t,e){o.instanceOf(e,ArrayBuffer),o.integer(t),o.between(0,t,this.size-e.byteLength+1,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer).set(new Uint8Array(e),t)}},{key:"get",value:function(t){return o.integer(t),o.between(0,t,this.size,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer)[t]}},{key:"add",value:function(t){var e=this.size,r=e+1;this.grow(r),this.size=r;var n=new Uint8Array(this.buffer);return n[e]=t,this}},{key:"addAll",value:function(t){o.instanceOf(t,ArrayBuffer);var e=this.size,r=this.size+t.byteLength;return this.grow(r),this.size=r,new Uint8Array(this.buffer).set(new Uint8Array(t),e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}();e.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return B(t)===B(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function r(t){s(t,"string")}function o(t){r(t),f(t,B,"isPositive")}function a(t){s(t,"number")}function u(t){if(s(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function f(t,e,r){if(!e.call(null,t))throw new Error("Condition "+r+" failed for value "+t)}function s(t,e){if(("undefined"==typeof t?"undefined":n(t))!==e)throw new Error("Not a "+e+": "+t)}var c=i.subPositive=function(t,e){if(o(t),o(e),!A(t,e))throw new Error("x must be greater or equal to y");for(var r=Math.max(t.length,e.length),n="",i=0,a=0,u=0;u=10;)c-=10,i++;0===c?a++:(n=String(c)+R(n,a),a=0)}return i>0&&(n=String(i)+R(n,a)),n},h=i.add=function(t,e){if(r(t),r(e),B(t)&&B(e))return l(t,e);if(T(t)&&T(e))return E(l(S(t),S(e)));if(O(S(t),S(e))){var n=t;t=e,e=n}var i=c(S(t),S(e));return B(t)?i:E(i)},y=i.sub=function(t,e){return r(t),r(e),h(t,E(e))},g=i.timesDigit=function(t,e){o(t),a(e);for(var r="",n=x(t),i=0,u=0,f=0;f=10;)s-=10,i++;0===s?u++:(r=String(s)+R(r,u),u=0)}return i>0&&(r=String(i)+R(r,u)),0===r.length?"0":r},p=i.mulPositive=function(t,r){o(t),o(r);for(var n="0",i=x(r),a=0;a=x(t)?"0":t.charAt(t.length-e-1)},x=function(t){return T(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,r){"use strict";r.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",n=t.values(),i=n.next();!i.done;)e+=r.inspect(i.value),i=n.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var o="Map {",a=t.entries(),u=a.next();!u.done;)o+=r.inspect(u.value[0]),o+=" => ",o+=r.inspect(u.value[1]),u=a.next(),u.done||(o+=", ");return o+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],1:[function(t,e,r){"use strict";!function(){t("/client-side/common.js");var e=t("/lib/assert.js");window.sb.upload=function(t,r){var n=t.type,i=t.value;if(e.instanceOf(n,window.sb.Type),e.instanceOf(r,Object),"POST"!==r.type&&"POST"!==r.method)throw new Error("Must use POST when uploading");r.processData=!1,r.data=n.valueBuffer(i),$.ajax(r)}}()},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js"}],2:[function(t,e,r){"use strict";function n(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new c(3*u/4-o),n=o>0?u-4:u;var f=0;for(e=0,r=0;e>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}function o(t){return f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}function a(t,e,r){for(var n,i=[],a=e;ac?c:s+u));return 1===n?(e=t[r-1],i+=f[e>>2],i+=f[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=f[e>>10],i+=f[e>>4&63],i+=f[e<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=u;var f=[],s=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return U(this,e,r);case"binary":return R(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function O(t,e,r,n){function i(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,r/=2}for(var f=-1,s=r;si&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+u<=r){var f,s,c,l;switch(u){case 1:o<128&&(a=o);break;case 2:f=t[i+1],128===(192&f)&&(l=(31&o)<<6|63&f,l>127&&(a=l));break;case 3:f=t[i+1],s=t[i+2],128===(192&f)&&128===(192&s)&&(l=(15&o)<<12|(63&f)<<6|63&s,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],s=t[i+2],c=t[i+3],128===(192&f)&&128===(192&s)&&128===(192&c)&&(l=(15&o)<<18|(63&f)<<12|(63&s)<<6|63&c,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=u}return j(n)}function j(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function V(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return i||M(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||M(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function Y(t){if(t=q(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function J(t){return W.toByteArray(Y(t))}function X(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t){return t!==t}var W=t("base64-js"),Q=t("ieee754"),Z=t("isarray");r.Buffer=a,r.SlowBuffer=d,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return u(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return s(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,u=r-e,f=Math.min(o,u),s=this.slice(n,i),c=t.slice(e,r),l=0;l2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:O(this,t,e,r);if("number"==typeof t)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):O(this,[t],e,r);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return T(this,t,e,r);case"binary":return B(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;V(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);V(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);V(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,4,2147483647,-2147483648), -a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||V(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;oe?t:Array(e-t.length+1).join("0")+t}var i={bytesToHex:function(t){return r(t)},hexToBytes:function(t){if(t.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===t.indexOf("0x")&&(t=t.slice(2)),t.match(/../g).map(function(t){return parseInt(t,16)})}};"undefined"!=typeof e&&e.exports?e.exports=i:t.convertHex=i}(this)},{}],5:[function(t,e,r){!function(t){"use strict";var r={bytesToString:function(t){return t.map(function(t){return String.fromCharCode(t)}).join("")},stringToBytes:function(t){return t.split("").map(function(t){return t.charCodeAt(0)})}};r.UTF8={bytesToString:function(t){return decodeURIComponent(escape(r.bytesToString(t)))},stringToBytes:function(t){return r.stringToBytes(unescape(encodeURIComponent(t)))}},"undefined"!=typeof e&&e.exports?e.exports=r:t.convertString=r}(this)},{}],6:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,u=8*i-n-1,f=(1<>1,c=-7,l=r?i-1:0,h=r?-1:1,y=t[e+l];for(l+=h,o=y&(1<<-c)-1,y>>=-c,c+=u;c>0;o=256*o+t[e+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:(y?-1:1)*(1/0);a+=Math.pow(2,n),o-=s}return(y?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,u,f,s=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,g=n?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),e+=a+l>=1?h/f:h*Math.pow(2,1-l),e*f>=2&&(a++,f/=2),a+l>=c?(u=0,a=c):a+l>=1?(u=(e*f-1)*Math.pow(2,i),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+y]=255&u,y+=g,u/=256,i-=8);for(a=a<0;t[r+y]=255&a,y+=g,a/=256,s-=8);t[r+y-g]|=128*p}},{}],7:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],8:[function(t,e,r){!function(r){"use strict";function n(t,e){t.constructor===String&&(t=i.convertString.UTF8.stringToBytes(t));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n=a(t),o=8*t.length;n[o>>5]|=128<<24-o%32,n[(o+64>>9<<4)+15]=o;for(var f=0;f>>5]|=t[r]<<24-n%32;return e},u=function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},f=[],s=function(t,e,r){for(var n=t[0],i=t[1],a=t[2],u=t[3],s=t[4],c=t[5],l=t[6],h=t[7],y=0;y<64;y++){if(y<16)f[y]=0|e[r+y];else{var g=f[y-15],p=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,d=f[y-2],v=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;f[y]=p+f[y-7]+v+f[y-16]}var w=s&c^~s&l,b=n&i^n&a^i&a,O=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),A=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),m=h+A+w+o[y]+f[y],T=O+b;h=l,l=c,c=s,s=u+m|0,u=a,a=i,i=n,n=m+T|0}t[0]=t[0]+n|0,t[1]=t[1]+i|0,t[2]=t[2]+a|0,t[3]=t[3]+u|0,t[4]=t[4]+s|0,t[5]=t[5]+c|0,t[6]=t[6]+l|0,t[7]=t[7]+h|0};n.x2=function(t,e){return n(n(t,{asBytes:!0}),e)}}(this)},{"convert-hex":4,"convert-string":5}],"/structure-types.js":[function(t,e,r){(function(r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t){var e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t),e}function u(t,e){if(e&&t.pointers){var r=!0,n=!1,i=void 0;try{for(var o,a=t.pointers[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var u=y(o.value,2),f=u[0],s=u[1],c=t.length;t.addAll(d.fromBinaryString(f));var l=new ArrayBuffer(4);new DataView(l).setUint32(0,c);var h=!0,g=!1,p=void 0;try{for(var v,w=s[Symbol.iterator]();!(h=(v=w.next()).done);h=!0){var b=v.value;t.setAll(b,l)}}catch(t){g=!0,p=t}finally{try{!h&&w.return&&w.return()}finally{if(g)throw p}}}}catch(t){n=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(n)throw i}}}}function f(t){if(t&&t.constructor===String){var e=Number(t);if(!isNaN(e))return e}}function s(t,e){g.instanceOf(t,b),g.instanceOf(e,String),(O.gt(e,"18446744073709551615")||O.lt(e,"0"))&&g.fail("Value out of range");var r=O.div(e,O.LONG_UPPER_SHIFT),n=O.sub(e,O.mul(r,O.LONG_UPPER_SHIFT)),i=new ArrayBuffer(8),o=new DataView(i);o.setUint32(0,Number(r)),o.setUint32(4,Number(n)),t.addAll(i)}function c(t,e){g.instanceOf(e,Array);var r=B(e.length),n=T(e.length),i=void 0;i=r?n+1:n;for(var o=new ArrayBuffer(i),a=new Uint8Array(o),u=0;ue[$]?1:void 0}),r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 81}}]),h(e,[{key:"addToBuffer",value:function(t){if(l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var r=!0,n=!1,i=void 0;try{for(var o,a=this.fields[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var u=o.value,f=u[Q];t.add(f.byteLength),t.addAll(f),u[W].addToBuffer(t)}}catch(t){n=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(n)throw i}}}}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(t,b),g.instanceOf(e,Object);var n=!0,i=!1,o=void 0;try{for(var a,f=this.fields[Symbol.iterator]();!(n=(a=f.next()).done);n=!0){var s=a.value,c=e[s[$]];void 0===c&&g.fail("Value for field "+s[$]+" missing"),s[W].writeValue(t,c,!1)}}catch(t){i=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(t,r)}}]),e}(_),K=function(t){function e(t){o(this,e);var r=n(this,Object.getPrototypeOf(e).call(this));return g.instanceOf(t,E),r.type=t,r}return i(e,t),h(e,null,[{key:"_value",get:function(){return 82}}]),h(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,r){g.instanceOf(t,b),g.fourByteUnsignedInteger(e.length),t.addAll(a(e.length));var n=!0,i=!1,o=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var c=f.value;this.type.writeValue(t,c,!1)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}u(t,r)}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(e,Array),this._writeValue(t,e,r)}}]),e}(_),tt=function(t){function e(t){return o(this,e),n(this,Object.getPrototypeOf(e).call(this,t))}return i(e,t),h(e,null,[{key:"_value",get:function(){return 83}}]),h(e,[{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,r)}}]),e}(K),et=function(t){function e(t,r){o(this,e);var i=n(this,Object.getPrototypeOf(e).call(this));return g.instanceOf(t,E),g.instanceOf(r,E),i.keyType=t,i.valueType=r,i}return i(e,t),h(e,null,[{key:"_value",get:function(){return 84}}]),h(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];g.instanceOf(t,b),g.instanceOf(e,Map),g.fourByteUnsignedInteger(e.size),t.addAll(a(e.size));var n=!0,i=!1,o=void 0;try{for(var f,s=e[Symbol.iterator]();!(n=(f=s.next()).done);n=!0){var c=y(f.value,2),l=c[0],h=c[1];this.keyType.writeValue(t,l,!1),this.valueType.writeValue(t,h,!1)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}u(t,r)}}]),e}(_),rt=function(t){function e(t){var r=t.type,i=t.values;o(this,e);var a=n(this,Object.getPrototypeOf(e).call(this));g.instanceOf(r,_),g.instanceOf(i,Array);try{g.byteUnsignedInteger(i.length)}catch(t){g.fail(String(i.length)+" values is too many")}for(var u=new Map,f=0;f=200&&e.status<300||304===e.status;n?t[o]=e.response:t.text=e.statusText,r(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(a,i,f),e.responseType=o;for(var s in n)n.hasOwnProperty(s)&&e.setRequestHeader(s,n[s]);e.send(u)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/client-side/common.js":[function(t,e,n){"use strict";var r=t("/lib/assert.js");if(r.instanceOf(window.Map,Function),r.instanceOf(window.Set,Function),r.instanceOf(window.ArrayBuffer,Function),r.instanceOf(window.Uint8Array,Function),r.instanceOf(window.Symbol,Function),t("/client-side/binary-ajax.js"),void 0===window.sb)window.sb=t("/structure-types.js");else if(!(window.sb instanceof Object))throw new Error("window.sb is already defined")},{"/client-side/binary-ajax.js":"/client-side/binary-ajax.js","/lib/assert.js":"/lib/assert.js","/structure-types.js":"/structure-types.js"}],"/config.js":[function(t,e,n){(function(n){"use strict";"/"===n&&(n="");var r=t(n+"/lib/assert.js"),i=t("base64-js"),a=7;r.between(0,a,65536);var o=2,u=new ArrayBuffer(o);new DataView(u).setUint16(0,a);var f=i.fromByteArray(new Uint8Array(u));e.exports={VERSION_STRING:f}}).call(this,"/")},{"base64-js":2}],"/lib/assert.js":[function(t,e,n){"use strict";var r=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var n=!1,i=!0,a=!1,o=void 0;try{for(var u,f=e[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;if(t instanceof s||void 0!==t&&null!==t&&t.constructor===s){n=!0;break}}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}if(!n)throw new TypeError(r.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(r.inspect(t)+" is not an integer")},between:function(t,e,n,i){if(e=n){var a=r.inspect(e)+" is not in ["+r.inspect(t)+","+r.inspect(n)+")";throw void 0===i?new RangeError(a):new RangeError(i+" ("+a+")")}},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t,e){var n=!0;try{t(),n=!1}catch(t){void 0!==e&&i.message(t,e)}i.assert(n,"Should throw an error")},equal:function(t,e){var n=new RangeError("Expected "+r.inspect(e)+" but got "+r.inspect(t));if(e&&e.constructor===Object){for(var a in e)if(e.hasOwnProperty(a))try{i.equal(t[a],e[a])}catch(t){throw n}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw n;try{i.equal(t.length,e.length)}catch(t){throw n}for(var o=0;o>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-string.js":[function(t,e,n){(function(n){"use strict";var r=t(n+"/assert.js"),i=t(n+"/growable-buffer.js"),a=4096;e.exports={toString:function(t){t&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r.instanceOf(t,Uint8Array);for(var e=[],n=0;n239?4:i>223?3:i>191?2:1;if(n+u<=t.length){var f=void 0,s=void 0,c=void 0,l=void 0;switch(u){case 1:i<128&&(o=i);break;case 2:f=t[n+1],128===(192&f)&&(l=(31&i)<<6|63&f,l>127&&(o=l));break;case 3:f=t[n+1],s=t[n+2],128===(192&f)&&128===(192&s)&&(l=(15&i)<<12|(63&f)<<6|63&s,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:f=t[n+1],s=t[n+2],c=t[n+3],128===(192&f)&&128===(192&s)&&128===(192&c)&&(l=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&c,l>65535&&l<1114112&&(o=l))}}void 0===o?(o=65533,u=1):o>65535&&(o-=65536,e.push(o>>>10&1023|55296),o=56320|1023&o),e.push(o),n+=u}for(var y="",h=0;h>6),e.add(128|63&c)):c<55296||c>=57344?(e.add(224|c>>12),e.add(128|c>>6&63),e.add(128|63&c)):(c=65536+((1023&c)<<10|1023&c),e.add(240|c>>18),e.add(128|c>>12&63),e.add(128|c>>6&63),e.add(128|63&c))}}catch(t){a=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(a)throw o}}return e.toBuffer()},toBinaryString:function(t){r.instanceOf(t,ArrayBuffer);var e="",n=new Uint8Array(t),i=!0,a=!1,o=void 0;try{for(var u,f=n[Symbol.iterator]();!(i=(u=f.next()).done);i=!0){var s=u.value;e+=String.fromCharCode(s)}}catch(t){a=!0,o=t}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return e},fromBinaryString:function(t){r.instanceOf(t,String);for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),i=0;ithis.buffer.byteLength){var e=new ArrayBuffer(t<<1);new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=e}return this}},{key:"set",value:function(t,e){a.integer(t),a.integer(e),a.between(0,t,this.size,"Index out of bounds: "+String(t)),a.between(0,e,256,"Not a byte: "+String(e));var n=new Uint8Array(this.buffer);return n[t]=e,this}},{key:"setAll",value:function(t,e){a.instanceOf(e,ArrayBuffer),a.integer(t),a.between(0,t,this.size-e.byteLength+1,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer).set(new Uint8Array(e),t)}},{key:"get",value:function(t){return a.integer(t),a.between(0,t,this.size,"Index out of bounds: "+String(t)),new Uint8Array(this.buffer)[t]}},{key:"add",value:function(t){var e=this.size,n=e+1;this.grow(n),this.size=n;var r=new Uint8Array(this.buffer);return r[e]=t,this}},{key:"addAll",value:function(t){a.instanceOf(t,ArrayBuffer);var e=this.size,n=this.size+t.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(t),e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}();e.exports=u}).call(this,"/lib")},{}],"/lib/strint.js":[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return B(t)===B(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function n(t){s(t,"string")}function a(t){n(t),f(t,B,"isPositive")}function o(t){s(t,"number")}function u(t){if(s(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function f(t,e,n){if(!e.call(null,t))throw new Error("Condition "+n+" failed for value "+t)}function s(t,e){if(("undefined"==typeof t?"undefined":r(t))!==e)throw new Error("Not a "+e+": "+t)}var c=i.subPositive=function(t,e){if(a(t),a(e),!m(t,e))throw new Error("x must be greater or equal to y");for(var n=Math.max(t.length,e.length),r="",i=0,o=0,u=0;u=10;)c-=10,i++;0===c?o++:(r=String(c)+_(r,o),o=0)}return i>0&&(r=String(i)+_(r,o)),r},y=i.add=function(t,e){if(n(t),n(e),B(t)&&B(e))return l(t,e);if(T(t)&&T(e))return S(l(j(t),j(e)));if(O(j(t),j(e))){var r=t;t=e,e=r}var i=c(j(t),j(e));return B(t)?i:S(i)},h=i.sub=function(t,e){return n(t),n(e),y(t,S(e))},v=i.timesDigit=function(t,e){a(t),o(e);for(var n="",r=E(t),i=0,u=0,f=0;f=10;)s-=10,i++;0===s?u++:(n=String(s)+_(n,u),u=0)}return i>0&&(n=String(i)+_(n,u)),0===n.length?"0":n},d=i.mulPositive=function(t,n){a(t),a(n);for(var r="0",i=E(n),o=0;o=E(t)?"0":t.charAt(t.length-e-1)},E=function(t){return T(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,n){"use strict";n.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",r=t.values(),i=r.next();!i.done;)e+=n.inspect(i.value),i=r.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var a="Map {",o=t.entries(),u=o.next();!u.done;)a+=n.inspect(u.value[0]),a+=" => ",a+=n.inspect(u.value[1]),u=o.next(),u.done||(a+=", ");return a+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],1:[function(t,e,n){"use strict";!function(){t("/client-side/common.js");var e=t("/lib/assert.js");window.sb.upload=function(t,n){var r=t.type,i=t.value;if(e.instanceOf(r,window.sb.Type),e.instanceOf(n,Object),"POST"!==n.type&&"POST"!==n.method)throw new Error("Must use POST when uploading");n.processData=!1,n.data=r.valueBuffer(i),$.ajax(n)}}()},{"/client-side/common.js":"/client-side/common.js","/lib/assert.js":"/lib/assert.js"}],2:[function(t,e,n){"use strict";function r(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===t[u-2]?2:"="===t[u-1]?1:0,o=new c(3*u/4-a),r=a>0?u-4:u;var f=0;for(e=0,n=0;e>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,o[f++]=255&i):1===a&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function a(t){return f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}function o(t,e,n){for(var r,i=[],o=e;oc?c:s+u));return 1===r?(e=t[n-1],i+=f[e>>2],i+=f[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=f[e>>10],i+=f[e>>4&63],i+=f[e<<2&63],i+="="),a.push(i),a.join("")}n.toByteArray=i,n.fromByteArray=u;var f=[],s=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],3:[function(t,e,n){!function(t){"use strict";function n(t){return t.map(function(t){return r(t.toString(16),2)}).join("")}function r(t,e){return t.length>e?t:Array(e-t.length+1).join("0")+t}var i={bytesToHex:function(t){return n(t)},hexToBytes:function(t){if(t.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===t.indexOf("0x")&&(t=t.slice(2)),t.match(/../g).map(function(t){return parseInt(t,16)})}};"undefined"!=typeof e&&e.exports?e.exports=i:t.convertHex=i}(this)},{}],4:[function(t,e,n){!function(t){"use strict";var n={bytesToString:function(t){return t.map(function(t){return String.fromCharCode(t)}).join("")},stringToBytes:function(t){return t.split("").map(function(t){return t.charCodeAt(0)})}};n.UTF8={bytesToString:function(t){return decodeURIComponent(escape(n.bytesToString(t)))},stringToBytes:function(t){return n.stringToBytes(unescape(encodeURIComponent(t)))}},"undefined"!=typeof e&&e.exports?e.exports=n:t.convertString=n}(this)},{}],5:[function(t,e,n){!function(n){"use strict";function r(t,e){t.constructor===String&&(t=i.convertString.UTF8.stringToBytes(t));var n=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],r=o(t),a=8*t.length;r[a>>5]|=128<<24-a%32,r[(a+64>>9<<4)+15]=a;for(var f=0;f>>5]|=t[n]<<24-r%32;return e},u=function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},f=[],s=function(t,e,n){for(var r=t[0],i=t[1],o=t[2],u=t[3],s=t[4],c=t[5],l=t[6],y=t[7],h=0;h<64;h++){if(h<16)f[h]=0|e[n+h];else{var v=f[h-15],d=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,g=f[h-2],p=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[h]=d+f[h-7]+p+f[h-16]}var w=s&c^~s&l,b=r&i^r&o^i&o,O=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),A=y+m+w+a[h]+f[h],T=O+b;y=l,l=c,c=s,s=u+A|0,u=o,o=i,i=r,r=A+T|0}t[0]=t[0]+r|0,t[1]=t[1]+i|0,t[2]=t[2]+o|0,t[3]=t[3]+u|0,t[4]=t[4]+s|0,t[5]=t[5]+c|0,t[6]=t[6]+l|0,t[7]=t[7]+y|0};r.x2=function(t,e){return r(r(t,{asBytes:!0}),e)}}(this)},{"convert-hex":3,"convert-string":4}],"/structure-types.js":[function(t,e,n){(function(n){"use strict";function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t),e}function u(t,e){if(e&&t.pointers){var n=!0,r=!1,i=void 0;try{for(var a,o=t.pointers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=h(a.value,2),f=u[0],s=u[1],c=t.length;t.addAll(g.fromBinaryString(f));var l=new ArrayBuffer(4);new DataView(l).setUint32(0,c);var y=!0,v=!1,d=void 0;try{for(var p,w=s[Symbol.iterator]();!(y=(p=w.next()).done);y=!0){var b=p.value;t.setAll(b,l)}}catch(t){v=!0,d=t}finally{try{!y&&w.return&&w.return()}finally{if(v)throw d}}}}catch(t){r=!0,i=t}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}}function f(t){if(t&&t.constructor===String){var e=Number(t);if(!isNaN(e))return e}}function s(t,e){v.instanceOf(t,b),v.instanceOf(e,String),(O.gt(e,"18446744073709551615")||O.lt(e,"0"))&&v.fail("Value out of range");var n=O.div(e,O.LONG_UPPER_SHIFT),r=O.sub(e,O.mul(n,O.LONG_UPPER_SHIFT)),i=new ArrayBuffer(8),a=new DataView(i);a.setUint32(0,Number(n)),a.setUint32(4,Number(r)),t.addAll(i)}function c(t,e){v.instanceOf(e,Array);var n=B(e.length),r=T(e.length),i=void 0;i=n?r+1:r;for(var a=new ArrayBuffer(i),o=new Uint8Array(a),u=0;ue[$]?1:void 0}),n}return i(e,t),y(e,null,[{key:"_value",get:function(){return 81}}]),y(e,[{key:"addToBuffer",value:function(t){if(l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var n=!0,r=!1,i=void 0;try{for(var a,o=this.fields[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value,f=u[Y];t.add(f.byteLength),t.addAll(f),u[Q].addToBuffer(t)}}catch(t){r=!0,i=t}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"writeValue",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,b),v.instanceOf(e,Object);var r=!0,i=!1,a=void 0;try{for(var o,f=this.fields[Symbol.iterator]();!(r=(o=f.next()).done);r=!0){var s=o.value,c=e[s[$]];void 0===c&&v.fail("Value for field "+s[$]+" missing"),s[Q].writeValue(t,c,!1)}}catch(t){i=!0,a=t}finally{try{!r&&f.return&&f.return()}finally{if(i)throw a}}u(t,n)}}]),e}(k),Z=function(t){function e(t){a(this,e);var n=r(this,Object.getPrototypeOf(e).call(this));return v.instanceOf(t,S),n.type=t,n}return i(e,t),y(e,null,[{key:"_value",get:function(){return 82}}]),y(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,n){v.instanceOf(t,b),v.fourByteUnsignedInteger(e.length),t.addAll(o(e.length));var r=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(r=(f=s.next()).done);r=!0){var c=f.value;this.type.writeValue(t,c,!1)}}catch(t){i=!0,a=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}u(t,n)}},{key:"writeValue",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,Array),this._writeValue(t,e,n)}}]),e}(k),tt=function(t){function e(t){return a(this,e),r(this,Object.getPrototypeOf(e).call(this,t))}return i(e,t),y(e,null,[{key:"_value",get:function(){return 83}}]),y(e,[{ +key:"writeValue",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,n)}}]),e}(Z),et=function(t){function e(t,n){a(this,e);var i=r(this,Object.getPrototypeOf(e).call(this));return v.instanceOf(t,S),v.instanceOf(n,S),i.keyType=t,i.valueType=n,i}return i(e,t),y(e,null,[{key:"_value",get:function(){return 84}}]),y(e,[{key:"addToBuffer",value:function(t){l(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]||arguments[2];v.instanceOf(t,b),v.instanceOf(e,Map),v.fourByteUnsignedInteger(e.size),t.addAll(o(e.size));var r=!0,i=!1,a=void 0;try{for(var f,s=e[Symbol.iterator]();!(r=(f=s.next()).done);r=!0){var c=h(f.value,2),l=c[0],y=c[1];this.keyType.writeValue(t,l,!1),this.valueType.writeValue(t,y,!1)}}catch(t){i=!0,a=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}u(t,n)}}]),e}(k),nt=function(t){function e(t){var n=t.type,i=t.values;a(this,e);var o=r(this,Object.getPrototypeOf(e).call(this));v.instanceOf(n,k),v.instanceOf(i,Array);try{v.byteUnsignedInteger(i.length)}catch(t){v.fail(String(i.length)+" values is too many")}for(var u=new Map,f=0;f