(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i>>16,c=b(c,2246822507),c^=c>>>13,c=b(c,3266489909),c^=c>>>16;const d=1|65535&c;return this._mw=d,this._mz=123456789,a},Srand.randomize=Srand.prototype.randomize=function(){return this.seed(1+Math.floor(4294967295*Math.random()))},Srand.getState=Srand.prototype.getState=function(){return{seed:this._seed,mz:this._mz,mw:this._mw}},Srand.setState=Srand.prototype.setState=function(a){if(null==a||"object"!=typeof a||"number"!=typeof a.seed||"number"!=typeof a.mz||"number"!=typeof a.mw)throw new Error("Invalid state.");this._seed=a.seed,this._mz=a.mz,this._mw=a.mw},Srand.random=Srand.prototype.random=function(){null==this._seed&&this.randomize();let a=this._mz,b=this._mw;a=4294967295&36969*(65535&a)+(a>>16),b=4294967295&18e3*(65535&b)+(b>>16),this._mz=a,this._mw=b;const c=(4294967295&(a<<16)+b)/4294967296;return .5+c},Srand.inRange=Srand.prototype.inRange=function(c,a){return c+this.random()*(a-c)},Srand.intInRange=Srand.prototype.intInRange=function(a,b){return a+Math.floor(this.random()*(b-a+1))},Srand.choice=Srand.prototype.choice=function(a){if(0===a.length)throw new Error("Cannot choose random element from empty array.");const b=this.intInRange(0,a.length-1);return a[b]},Srand.choices=Srand.prototype.choices=function(a,b){const c=Array(b);for(let d=0;da.length)throw new Error("Sample size cannot exceed population size.");if(b===a.length)return this.shuffle([...a]);const c=a.length-1,d=Array(b),e={};for(let f,g=0;gb[d])throw new Error("Weights must be non-negative.");c+=b[d]}if(0===c)throw new Error("At least one weight must be greater than zero.");const d=this.random()*c;let e=0;for(let c=0;c=a)throw new Error("For exponential distributions, lambda must be positive.");return-Math.log(1-this.random())/a},Srand.poisson=Srand.prototype.poisson=function(a){if(0>=a)throw new Error("For Poisson distributions, lambda must be positive.");const b=Math.exp(-a);let c=0,d=1;do c++,d*=this.random();while(d>b);return c-1},Srand._oldSrand=void 0,Srand.noConflict=function(){return Srand};var _default=Srand;exports.default=_default; },{}],2:[function(require,module,exports){ "use strict";var _jsrand=_interopRequireDefault(require("./jsrand.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}_jsrand.default._oldSrand=window.Srand,_jsrand.default.noConflict=function(){return window.Srand=_jsrand.default._oldSrand,_jsrand.default},window.Srand=_jsrand.default; },{"./jsrand.js":1}]},{},[2]) //# sourceMappingURL=jsrand.min.js.map