text: // This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
  import r from"./../../utils/define-nonenumerable-read-only-property.js";import t from"./../../utils/define-nonenumerable-read-only-accessor.js";import e from"./../../utils/define-nonenumerable-read-write-accessor.js";import n from"./../../assert/is-positive-number.js";import o from"./../../assert/is-plain-object.js";import i from"./../../assert/is-function.js";import s from"./../../assert/has-own-property.js";import a from"./../../utils/constant-function.js";import m from"./../../utils/noop.js";import p from"./mt19937.js";import u from"./../../math/base/assert/is-nan.js";import f from"./../../array/to-json.js";import l from"./../../math/base/special/exp.js";import c from"./../../math/base/special/factorialln.js";import g from"./../../math/base/special/floor.js";import h from"./../../math/base/special/signum.js";import b from"./../../math/base/special/sqrt.js";import d from"./../../math/base/special/abs.js";import j from"./../../math/base/special/ln.js";import v from"./../../constants/math/float64-ln-sqrt-two-pi.js";var y=l;function w(r,t){for(var e=r(),n=1;e>y(-t);)n+=1,e*=r();return n-1}var L=c,N=g,E=h,O=b,P=d,T=j,G=v,R=1/12,q=1/360;function x(r,t){var e,n,o,i,s,a,m,p,u,f;for(a=.02483*(m=2.53*(e=O(t))+.931)-.059,n=1.1328/(m-3.4)+1.1239,o=.86*(s=-3.6224/(m-2)+.9277);;){if((f=r())<=o)return u=f/s-.43,u*=2*a/(.5-P(u))+m,N(u+=t+.445);if(f>=s?u=r()-.5:(u=.5*E(u=f/s-.93)-u,f=s*r()),(i=.5-P(u))>=.013||i>=f){if(f*=n/(a/(i*i)+m),u=((p=N((2*a/i+m)*u+t+.445))+.5)*T(t/p),u+=-t-G+p,u-=(R-q/(p*p))/p,p>=10&&u>=T(f*e))return p;if(u=p*T(t)-t-L(p),p>=0&&p<=9&&u>=T(f))return p}}}var A=w,J=x;function M(r,t){return t<30?A(r,t):J(r,t)}var S=r,V=t,z=e,F=n.isPrimitive,k=o,B=i,C=s,D=a,H=m,I=p.factory,K=u,Q=f,U=M;function W(){var r,t,e,n;if(0===arguments.length)e=I();else if(1===arguments.length&&k(arguments[0]))if(C(t=arguments[0],"prng")){if(!B(t.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+t.prng+"`.");e=t.prng}else e=I(t);else{if(!F(r=arguments[0]))throw new TypeError("invalid argument. First argument must be a positive number. Value: `"+r+"`.");if(arguments.length>1){if(!k(t=arguments[1]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+t+"`.");if(C(t,"prng")){if(!B(t.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+t.prng+"`.");e=t.prng}else e=I(t)}else e=I()}return S(n=void 0===r?l:f,"NAME","poisson"),t&&t.prng?(S(n,"seed",null),S(n,"seedLength",null),z(n,"state",D(null),H),S(n,"stateLength",null),S(n,"byteLength",null),S(n,"toJSON",D(null)),S(n,"PRNG",e)):(V(n,"seed",o),V(n,"seedLength",i),z(n,"state",m,p),V(n,"stateLength",s),V(n,"byteLength",a),S(n,"toJSON",u),S(n,"PRNG",e),e=e.normalized),n;function o(){return e.seed}function i(){return e.seedLength}function s(){return e.stateLength}function a(){return e.byteLength}function m(){return e.state}function p(r){e.state=r}function u(){var t={type:"PRNG"};return t.name=n.NAME,t.state=Q(e.state),t.params=void 0===r?[]:[r],t}function f(){return U(e,r)}function l(r){return K(r)||r<=0?NaN:U(e,r)}}var X=W,Y=X(),Z=r,$=Y,_=W;Z($,"factory",_);export default $;
  //# sourceMappingURL=poisson.js.map