You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
84 KiB
11 lines
84 KiB
2 years ago
|
(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(c,e,t){function r(i,o){if(!e[i]){if(!c[i]){var s="function"==typeof require&&require;if(!o&&s)return s(i,!0);if(n)return n(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=e[i]={exports:{}};c[i][0].call(p.exports,function(t){var e=c[i][1][t];return r(e?e:t)},p,p.exports,d,c,e,t)}return e[i].exports}for(var n="function"==typeof require&&require,a=0;a<t.length;a++)r(t[a]);return r}return d}()({1:[function(e,t,n){"use strict";function r(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function o(e){var t,n,o,a,s,d=e.length;a=r(e),s=new p(3*d/4-a),n=0<a?d-4:d;var f=0;for(t=0;t<n;t+=4)o=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],s[f++]=255&o>>16,s[f++]=255&o>>8,s[f++]=255&o;return 2===a?(o=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[f++]=255&o):1===a&&(o=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[f++]=255&o>>8,s[f++]=255&o),s}function a(e){return l[63&e>>18]+l[63&e>>12]+l[63&e>>6]+l[63&e]}function s(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(16711680&e[s]<<16)+(65280&e[s+1]<<8)+(255&e[s+2]),o.push(a(r));return o.join("")}function d(e){for(var t,n=e.length,r=n%3,o="",a=[],d=16383,c=0,p=n-r;c<p;c+=d)a.push(s(e,c,c+d>p?p:c+d));return 1===r?(t=e[n-1],o+=l[t>>2],o+=l[63&t<<4],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=l[t>>10],o+=l[63&t>>4],o+=l[63&t<<2],o+="="),a.push(o),a.join("")}n.byteLength=function(e){return 3*e.length/4-r(e)},n.toByteArray=o,n.fromByteArray=d;for(var l=[],c=[],p="undefined"==typeof Uint8Array?Array:Uint8Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,g=f.length;u<g;++u)l[u]=f[u],c[f.charCodeAt(u)]=u;c[45]=62,c[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||
|
* @license MIT
|
||
|
*/"use strict";var J=String.fromCharCode,K=Math.min;function o(e){if(2147483647<e)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=s.prototype,t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(e)}return d(e,t,n)}function d(e,t,n){if("number"==typeof e)throw new TypeError("\"value\" argument must not be a number");return Y(e)||e&&Y(e.buffer)?g(e,t,n):"string"==typeof e?f(e,t):h(e)}function l(e){if("number"!=typeof e)throw new TypeError("\"size\" argument must be of type number");else if(0>e)throw new RangeError("\"size\" argument must not be negative")}function c(e,t,n){return l(e),0>=e?o(e):void 0===t?o(e):"string"==typeof n?o(e).fill(t,n):o(e).fill(t)}function p(e){return l(e),o(0>e?0:0|_(e))}function f(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|m(e,t),r=o(n),a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function u(e){for(var t=0>e.length?0:0|_(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function g(e,t,n){if(0>t||e.byteLength<t)throw new RangeError("\"offset\" is outside of buffer bounds");if(e.byteLength<t+(n||0))throw new RangeError("\"length\" is outside of buffer bounds");var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),r.__proto__=s.prototype,r}function h(e){if(s.isBuffer(e)){var t=0|_(e.length),n=o(t);return 0===n.length?n:(e.copy(n,0,0,t),n)}if(e){if(ArrayBuffer.isView(e)||"length"in e)return"number"!=typeof e.length||X(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}function _(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function m(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return W(e).length;t=(""+t).toLowerCase(),r=!0;}}function b(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return B(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0;}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function C(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),n=+n,X(n)&&(n=o?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(0>n)if(o)n=0;else return-1;if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,o){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,d=e.length,l=t.length;if(void 0!==r&&(r=(r+"").toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(2>e.length||2>t.length)return-1;s=2,d/=2,l/=2,n/=2}var c;if(o){var p=-1;for(c=n;c<d;c++)if(a(e,c)!==a(t,-1===p?0:c-p))-1!==p&&(c-=c-p),p=-1;else if(-1===p&&(p=c),c-p+1===l)return p*s}else for(n+l>d&&(n=d-l),c=n;0<=c;c--){for(var f=!0
|
||
|
* Determine if an object is a Buffer
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||
|
* @license MIT
|
||
|
*/t.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},{}],13:[function(e,t){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],14:[function(e,t){(function(e){"use strict";t.exports=e.version&&0!==e.version.indexOf("v0.")&&(0!==e.version.indexOf("v1.")||0===e.version.indexOf("v1.8."))?e:{nextTick:function(t,n,r,o){if("function"!=typeof t)throw new TypeError("\"callback\" argument must be a function");var a,s,d=arguments.length;switch(d){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,o)});default:for(a=Array(d-1),s=0;s<a.length;)a[s++]=arguments[s];return e.nextTick(function(){t.apply(null,a)});}}}}).call(this,e("_process"))},{_process:15}],15:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(n){try{return c.call(null,t,0)}catch(n){return c.call(this,t,0)}}}function a(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(n){try{return p.call(null,t)}catch(n){return p.call(this,t)}}}function i(){h&&u&&(h=!1,u.length?g=u.concat(g):_=-1,g.length&&s())}function s(){if(!h){var e=o(i);h=!0;for(var t=g.length;t;){for(u=g,g=[];++_<t;)u&&u[_].run();_=-1,t=g.length}u=null,h=!1,a(e)}}function d(e,t){this.fun=e,this.array=t}function l(){}var c,p,f=t.exports={};(function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}})();var u,g=[],h=!1,_=-1;f.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];g.push(new d(e,t)),1!==g.length||h||o(s)},d.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(){return[]},f.binding=function(){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],16:[function(e,t){(function(n,r){"use strict";var o=e("safe-buffer").Buffer,a=r.crypto||r.msCrypto;t.exports=a&&a.getRandomValues?function(e,t){if(65536<e)throw new Error("requested too many random bytes");var i=new r.Uint8Array(e);0<e&&a.getRandomValues(i);var s=o.from(i.buffer);return"function"==typeof t?n.nextTick(function(){t(null,s)}):s}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{_process:15,"safe-buffer":26}],17:[function(e,t){"use strict";function n(e){return this instanceof n?void(d.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",r)):new n(e)}function r(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=e("process-nextick-args").nextTick,i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=n;var s=e("core-util-is");s.inherits=e("inherits");var d=e("./_stream_readable"),l=e("./_stream_writable");s.inherits(n,d);for(var c,p=i(l.prototype),f=0;f<p.length;f++)c=p[f],n.prototype[c]||(n.prototype[c]=l.prototype[c]);Object.defineProperty(n.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.des
|