3 lines
35 KiB
JavaScript
3 lines
35 KiB
JavaScript
!function(){return function t(e,r,n){function o(a,u){if(!r[a]){if(!e[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){return o(e[a][1][t]||t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}}()({1:[function(t,e,r){"use strict";r.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){for(var e,r=s(t),n=r[0],a=r[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,n,a)),f=0,h=a>0?n-4:n,c=0;c<h;c+=4)e=o[t.charCodeAt(c)]<<18|o[t.charCodeAt(c+1)]<<12|o[t.charCodeAt(c+2)]<<6|o[t.charCodeAt(c+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===a&&(e=o[t.charCodeAt(c)]<<2|o[t.charCodeAt(c+1)]>>4,u[f++]=255&e);1===a&&(e=o[t.charCodeAt(c)]<<10|o[t.charCodeAt(c+1)]<<4|o[t.charCodeAt(c+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},r.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(h(t,a,a+16383>u?u:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=a.length;u<f;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){"use strict";var n=t("base64-js"),o=t("ieee754");r.Buffer=u,r.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=u.prototype,e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=u.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var o=function(t){if(u.isBuffer(t)){var e=0|l(t.length),r=a(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(void 0!==t.length)return"number"!=typeof t.length||z(t.length)?a(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return s(t),a(t<0?0:0|l(t))}function c(t){for(var e=t.length<0?0:0|l(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(o)return n?-1:D(t).length;e=(""+e).toLowerCase(),o=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:d(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):d(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function d(t,e,r,n,o){var i,a=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,f/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var h=-1;for(i=r;i<u;i++)if(s(t,i)===s(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===f)return h*a}else-1!==h&&(i-=i-h),h=-1}else for(r+f>u&&(r=u-f),i=r;i>=0;i--){for(var c=!0,l=0;l<f;l++)if(s(t,i+l)!==s(e,l)){c=!1;break}if(c)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(z(u))return a;t[r+a]=u}return a}function w(t,e,r,n){return j(D(e,t.length-r),t,r,n)}function b(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function m(t,e,r,n){return b(t,e,r,n)}function E(t,e,r,n){return j(P(e),t,r,n)}function A(t,e,r,n){return j(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,f,s=t[o],h=null,c=s>239?4:s>223?3:s>191?2:1;if(o+c<=r)switch(c){case 1:s<128&&(h=s);break;case 2:128==(192&(i=t[o+1]))&&(f=(31&s)<<6|63&i)>127&&(h=f);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(f=(15&s)<<12|(63&i)<<6|63&a)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(h=f)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=_));return r}(n)}r.kMaxLength=i,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),u.poolSize=8192,u.from=function(t,e,r){return f(t,e,r)},u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,u.alloc=function(t,e,r){return function(t,e,r){return s(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return h(t)},u.allocUnsafeSlow=function(t){return h(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(F(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),F(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(F(i,Uint8Array)&&(i=u.from(i)),!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):function(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(F(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),f=Math.min(i,a),s=this.slice(n,o),h=t.slice(e,r),c=0;c<f;++c)if(s[c]!==h[c]){i=s[c],a=h[c];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},u.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,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function C(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function U(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=O(t[i]);return o}function M(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=u.prototype,n},u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;i>=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=u.isBuffer(t)?t:u.from(t,n),f=a.length;if(0===f)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=a[i%f]}return this};var N=/[^+/0-9A-Za-z-_]/g;function O(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}},{"base64-js":1,ieee754:3}],3:[function(t,e,r){r.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,f=(1<<u)-1,s=f>>1,h=-7,c=r?o-1:0,l=r?-1:1,p=t[e+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=u;h>0;i=256*i+t[e+c],c+=l,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=l,h-=8);if(0===i)i=1-s;else{if(i===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=s}return(p?-1:1)*a*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var a,u,f,s=8*i-o-1,h=(1<<s)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=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,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?l/f:l*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=h?(u=0,a=h):a+c>=1?(u=(e*f-1)*Math.pow(2,o),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&u,p+=y,u/=256,o-=8);for(a=a<<o|u,s+=o;s>0;t[r+p]=255&a,p+=y,a/=256,s-=8);t[r+p-y]|=128*g}},{}],4:[function(t,e,r){(function(n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var Aes={cipher:function(t,e){for(var r=e.length/4-1,n=[[],[],[],[]],o=0;o<16;o++)n[o%4][Math.floor(o/4)]=t[o];n=Aes.addRoundKey(n,e,0,4);for(var i=1;i<r;i++)n=Aes.subBytes(n,4),n=Aes.shiftRows(n,4),n=Aes.mixColumns(n,4),n=Aes.addRoundKey(n,e,i,4);n=Aes.subBytes(n,4),n=Aes.shiftRows(n,4),n=Aes.addRoundKey(n,e,r,4);var a=new Array(16);for(o=0;o<16;o++)a[o]=n[o%4][Math.floor(o/4)];return a},keyExpansion:function(t){for(var e=t.length/4,r=e+6,n=new Array(4*(r+1)),o=new Array(4),i=0;i<e;i++){var a=[t[4*i],t[4*i+1],t[4*i+2],t[4*i+3]];n[i]=a}for(i=e;i<4*(r+1);i++){n[i]=new Array(4);for(var u=0;u<4;u++)o[u]=n[i-1][u];if(i%e==0){o=Aes.subWord(Aes.rotWord(o));for(u=0;u<4;u++)o[u]^=Aes.rCon[i/e][u]}else e>6&&i%e==4&&(o=Aes.subWord(o));for(u=0;u<4;u++)n[i][u]=n[i-e][u]^o[u]}return n},subBytes:function(t,e){for(var r=0;r<4;r++)for(var n=0;n<e;n++)t[r][n]=Aes.sBox[t[r][n]];return t},shiftRows:function(t,e){for(var r=new Array(4),n=1;n<4;n++){for(var o=0;o<4;o++)r[o]=t[n][(o+n)%e];for(o=0;o<4;o++)t[n][o]=r[o]}return t},mixColumns:function(t,e){for(var r=0;r<4;r++){for(var n=new Array(4),o=new Array(4),i=0;i<4;i++)n[i]=t[i][r],o[i]=128&t[i][r]?t[i][r]<<1^283:t[i][r]<<1;t[0][r]=o[0]^n[1]^o[1]^n[2]^n[3],t[1][r]=n[0]^o[1]^n[2]^o[2]^n[3],t[2][r]=n[0]^n[1]^o[2]^n[3]^o[3],t[3][r]=n[0]^o[0]^n[1]^n[2]^o[3]}return t},addRoundKey:function(t,e,r,n){for(var o=0;o<4;o++)for(var i=0;i<n;i++)t[o][i]^=e[4*r+i][o];return t},subWord:function(t){for(var e=0;e<4;e++)t[e]=Aes.sBox[t[e]];return t},rotWord:function(t){for(var e=t[0],r=0;r<3;r++)t[r]=t[r+1];return t[3]=e,t},sBox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],rCon:[[0,0,0,0],[1,0,0,0],[2,0,0,0],[4,0,0,0],[8,0,0,0],[16,0,0,0],[32,0,0,0],[64,0,0,0],[128,0,0,0],[27,0,0,0],[54,0,0,0]]};if(void 0!==e&&e.exports&&(e.exports=Aes),"function"==typeof define&&define.amd&&define([],function(){return Aes}),void 0!==e&&e.exports)Aes=t("./Aes");Aes.Ctr={},Aes.Ctr.encrypt=function(t,e,r){if(128!=r&&192!=r&&256!=r)return"";t=String(t).utf8Encode(),e=String(e).utf8Encode();for(var n=r/8,o=new Array(n),i=0;i<n;i++)o[i]=isNaN(e.charCodeAt(i))?0:e.charCodeAt(i);var a=Aes.cipher(o,Aes.keyExpansion(o));a=a.concat(a.slice(0,n-16));var u=new Array(16),f=(new Date).getTime(),s=f%1e3,h=Math.floor(f/1e3),c=Math.floor(65535*Math.random());for(i=0;i<2;i++)u[i]=s>>>8*i&255;for(i=0;i<2;i++)u[i+2]=c>>>8*i&255;for(i=0;i<4;i++)u[i+4]=h>>>8*i&255;var l="";for(i=0;i<8;i++)l+=String.fromCharCode(u[i]);for(var p=Aes.keyExpansion(a),y=Math.ceil(t.length/16),g=new Array(y),d=0;d<y;d++){for(var v=0;v<4;v++)u[15-v]=d>>>8*v&255;for(v=0;v<4;v++)u[15-v-4]=d/4294967296>>>8*v;var w=Aes.cipher(u,p),b=d<y-1?16:(t.length-1)%16+1,m=new Array(b);for(i=0;i<b;i++)m[i]=w[i]^t.charCodeAt(16*d+i),m[i]=String.fromCharCode(m[i]);g[d]=m.join("")}var E=l+g.join("");return E=E.base64Encode()},Aes.Ctr.decrypt=function(t,e,r){if(128!=r&&192!=r&&256!=r)return"";t=String(t).base64Decode(),e=String(e).utf8Encode();for(var n=r/8,o=new Array(n),i=0;i<n;i++)o[i]=isNaN(e.charCodeAt(i))?0:e.charCodeAt(i);var a=Aes.cipher(o,Aes.keyExpansion(o));a=a.concat(a.slice(0,n-16));var u=new Array(8),f=t.slice(0,8);for(i=0;i<8;i++)u[i]=f.charCodeAt(i);for(var s=Aes.keyExpansion(a),h=Math.ceil((t.length-8)/16),c=new Array(h),l=0;l<h;l++)c[l]=t.slice(8+16*l,8+16*l+16);t=c;var p=new Array(t.length);for(l=0;l<h;l++){for(var y=0;y<4;y++)u[15-y]=l>>>8*y&255;for(y=0;y<4;y++)u[15-y-4]=(l+1)/4294967296-1>>>8*y&255;var g=Aes.cipher(u,s),d=new Array(t[l].length);for(i=0;i<t[l].length;i++)d[i]=g[i]^t[l].charCodeAt(i),d[i]=String.fromCharCode(d[i]);p[l]=d.join("")}var v=p.join("");return v=v.utf8Decode()},void 0===String.prototype.utf8Encode&&(String.prototype.utf8Encode=function(){return unescape(encodeURIComponent(this))}),void 0===String.prototype.utf8Decode&&(String.prototype.utf8Decode=function(){try{return decodeURIComponent(escape(this))}catch(t){return this}}),void 0===String.prototype.base64Encode&&(String.prototype.base64Encode=function(){if("undefined"!=typeof btoa)return btoa(this);if(void 0!==n)return new n(this,"utf8").toString("base64");throw new Error("No Base64 Encode")}),void 0===String.prototype.base64Decode&&(String.prototype.base64Decode=function(){if("undefined"!=typeof atob)return atob(this);if(void 0!==n)return new n(this,"base64").toString("utf8");throw new Error("No Base64 Decode")}),void 0!==e&&e.exports&&(e.exports=Aes.Ctr),"function"==typeof define&&define.amd&&define(["Aes"],function(){return Aes.Ctr}),r.default=Aes}).call(this,t("buffer").Buffer)},{"./Aes":4,buffer:2}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl="",this.templates={}}return n(t,[{key:"setBaseUrl",value:function(t){this.baseUrl=t}},{key:"setTemplates",value:function(t){this.templates=t}},{key:"setTimeUtils",value:function(t){this.timeUtils=t}},{key:"getNotifications",value:function(t,e){var r=this;$.getJSON(this.baseUrl,{a:"getNotifications"},function(t){"SUCCESS"===t.status&&r.renderNotifications(t.data[1],t.data[0])})}},{key:"clearPendingNotifications",value:function(t,e){$.getJSON(this.baseUrl,{a:"clearNotifications"},function(t){})}},{key:"renderNotifications",value:function(t,e){if(0!==t.length){var r=this.templates.notifications;e>0?(r=r.replace("#_count_#",e),r=e>1?r.replace("#_header_#","You have "+e+" new notifications"):r.replace("#_header_#","You have "+e+" new notification")):r=(r=r.replace("#_count_#","")).replace("#_header_#","You have no new notifications");var n="";for(var o in t)n+=this.renderNotification(t[o]);r=r.replace("#_notifications_#",n);var i=$(r);0===e&&i.find(".label-danger").remove(),i.attr("id","notifications"),$("#notifications").replaceWith(i),$(".navbar .menu").slimscroll({height:"320px",alwaysVisible:!1,size:"3px"}).css("width","100%"),this.timeUtils.convertToRelativeTime($(".notificationTime"))}}},{key:"renderNotification",value:function(t){var e=this.templates.notification;e=e.replace("#_image_#",t.image);try{var r=JSON.parse(t.action);e=e.replace("#_url_#",this.baseUrl.replace("service.php","?")+r.url)}catch(t){e=e.replace("#_url_#","")}return e=(e=(e=e.replace("#_time_#",t.time)).replace("#_fromName_#",t.type)).replace("#_message_#",this.getLineBreakString(t.message,27))}},{key:"getLineBreakString",value:function(t,e){var r="";try{for(var n=t.split(" "),o=0,i=0;i<n.length;i++)(o+=n[i].length+1)>e?(r+=n[i]+"<br/>",o=0):r+=n[i]+" "}catch(t){}return r}}]),t}();r.default=o},{}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var RequestCache=function(){function RequestCache(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,RequestCache)}return n(RequestCache,[{key:"getKey",value:function(t,e){var r=t+"|";for(var n in e)r+=n+"="+e[n]+"|";return r}},{key:"invalidateTable",value:function(t){for(var e=void 0,r=0;r<localStorage.length;r++)(e=localStorage.key(r)).indexOf("t="+t)>0&&localStorage.removeItem(e)}},{key:"getData",value:function(t){var e=void 0;if("undefined"==typeof Storage)return null;var r=localStorage.getItem(t);return void 0!==r&&null!=r&&""!==r?void 0===(e=JSON.parse(r))||null==e?null:void 0!==e.status&&null!=e.status&&"SUCCESS"!==e.status?null:e:null}},{key:"setData",value:function(t,e){if("undefined"==typeof Storage)return null;if(void 0!==e.status&&null!=e.status&&"SUCCESS"!==e.status)return null;var r=JSON.stringify(e);return localStorage.setItem(t,r),r}}]),RequestCache}();r.default=RequestCache},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var SocialShare={facebook:function(t){var e=screen.width/2-350,r=screen.height/2-250;return t="https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t),window.open(t,"Share on Facebook","width=700,height=500,left="+e+",top="+r),!1},google:function(t){var e=screen.width/2-250,r=screen.height/2-250;return t="https://plus.google.com/share?url="+encodeURIComponent(t),window.open(t,"Share on Google","width=500,height=500,left="+e+",top="+r),!1},linkedin:function(t){var e=screen.width/2-250,r=screen.height/2-250;return t="https://www.linkedin.com/cws/share?url="+encodeURIComponent(t),window.open(t,"Share on Linked in","width=500,height=500,left="+e+",top="+r),!1},twitter:function(t,e){return window.open("http://twitter.com/share?text="+escape(e)+"&url="+escape(t),"popup","width=550,height=260,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=200,top=200"),!1}};r.default=SocialShare},{}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,[{key:"setServerGMToffset",value:function(t){this.serverGMToffset=t}},{key:"getMySQLFormatDate",value:function(t){var e=function(t){return t<10?"0"+t:t};return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())}},{key:"convertToRelativeTime",value:function(t){var e=function(t,e){var r="am",n=t;n>=12&&(r="pm",n>12&&(n-=12));var o="";e<10&&(o="0");var i="";return 0===t&&(i="0")," at "+i+n+":"+o+e+r},r=new Date,n=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=60*(this.serverGMToffset- -(new Date).getTimezoneOffset()/60)*60*1e3;t.each(function(){try{var t=$(this).html().split(" "),a=t[0],u=t[1],f=a.split("-"),s=f[0],h=f[1]-1,c=f[2],l=u.split(":"),p=l[0],y=l[1],g=l[2],d=new Date(s,h,c,p,y,g).getTime(),v=new Date(d-i),w=v.toString("d"),b=v.getFullYear(),m=v.getHours(),E=v.getMinutes(),A=o[v.getDay()]+", "+n[v.getMonth()]+" "+w+", "+b+e(m,E),S=(r.getTime()-v.getTime())/1e3,B=Math.abs(S/60),_=Math.abs(S/3600),C=Math.abs(S/86400),U=Math.abs(S/31536e3),T="";if(C>1)T=w+" "+n[v.getMonth()].substring(0,3),U>1&&(T=T+" "+s),T+=e(m,E);else if(_>=1){var M=Math.round(_);T=1===M?"about an hour ago":M+" hours ago"}else if(B>=1){var k=Math.round(B);T=1===k?"about a minute ago":k+" minutes ago"}else B<1&&(T="less than a minute ago");$(this).html(T),$(this).attr("title",A)}catch(t){}})}}]),t}();r.default=o},{}],9:[function(t,e,r){"use strict";var n=u(t("./Notifications")),o=u(t("./TimeUtils")),i=u(t("./RequestCache")),a=u(t("./SocialShare"));function u(t){return t&&t.__esModule?t:{default:t}}t("./Aes");window.RequestCache=i.default,window.SocialShare=a.default,window.setupTimeUtils=function(t){var e=new o.default;return e.setServerGMToffset(t),e},window.setupNotifications=function(t){var e=new n.default;return e.setBaseUrl(t),e.setTimeUtils(timeUtils),e}},{"./Aes":4,"./Notifications":5,"./RequestCache":6,"./SocialShare":7,"./TimeUtils":8}]},{},[9]);
|
|
//# sourceMappingURL=common.js.map
|