UNPKG

chance

Version:

Chance - Utility library to generate anything random

1 lines 211 kB
!function(){var a=9007199254740992,e="0123456789",n="abcdefghijklmnopqrstuvwxyz",i=n.toUpperCase(),r=e+"abcdef";function o(a){this.name="UnsupportedError",this.message=a||"This feature is not supported on this platform"}o.prototype=new Error,o.prototype.constructor=o;var t=Array.prototype.slice;function s(a){if(!(this instanceof s))return a||(a=null),null===a?new s:new s(a);if("function"==typeof a)return this.random=a,this;arguments.length&&(this.seed=0);for(var e=0;e<arguments.length;e++){var n=0;if("[object String]"===Object.prototype.toString.call(arguments[e]))for(var i=0;i<arguments[e].length;i++){for(var r=0,o=0;o<arguments[e].length;o++)r=arguments[e].charCodeAt(o)+(r<<6)+(r<<16)-r;n+=r}else n=arguments[e];this.seed+=(arguments.length-e)*n}return this.mt=this.mersenne_twister(this.seed),this.bimd5=this.blueimp_md5(),this.random=function(){return this.mt.random(this.seed)},this}function l(a,e){if(a=a||{},e)for(var n in e)void 0===a[n]&&(a[n]=e[n]);return a}function c(a,e){if(a)throw new RangeError(e)}s.prototype.VERSION="1.1.8";var m=function(){throw new Error("No Base64 encoder available.")};function u(a){this.c=a}function d(a){this.c=a}function h(a){this.c=a}function b(a){return function(){return this.natural(a)}}"function"==typeof btoa?m=btoa:"function"==typeof Buffer&&(m=function(a){return new Buffer(a).toString("base64")}),s.prototype.bool=function(a){return c((a=l(a,{likelihood:50})).likelihood<0||a.likelihood>100,"Chance: Likelihood accepts values from 0 to 100."),100*this.random()<a.likelihood},s.prototype.falsy=function(a){var e=(a=l(a,{pool:[!1,null,0,NaN,"",void 0]})).pool;return e[this.integer({min:0,max:e.length-1})]},s.prototype.animal=function(a){if(void 0!==(a=l(a)).type)return c(!this.get("animals")[a.type.toLowerCase()],"Please pick from desert, ocean, grassland, forest, zoo, pets, farm."),this.pick(this.get("animals")[a.type.toLowerCase()]);return this.pick(this.get("animals")[this.pick(["desert","forest","ocean","zoo","farm","pet","grassland"])])},s.prototype.character=function(a){var r,o,t="!@#$%^&*()[]";return r="lower"===(a=l(a)).casing?n:"upper"===a.casing?i:n+i,a.pool?o=a.pool:(o="",a.alpha&&(o+=r),a.numeric&&(o+=e),a.symbols&&(o+=t),o||(o=r+e+t)),o.charAt(this.natural({max:o.length-1}))},s.prototype.floating=function(e){c((e=l(e,{fixed:4})).fixed&&e.precision,"Chance: Cannot specify both fixed and precision.");var n=Math.pow(10,e.fixed),i=a/n,r=-i;c(e.min&&e.fixed&&e.min<r,"Chance: Min specified is out of range with fixed. Min should be, at least, "+r),c(e.max&&e.fixed&&e.max>i,"Chance: Max specified is out of range with fixed. Max should be, at most, "+i),e=l(e,{min:r,max:i});var o=(this.integer({min:e.min*n,max:e.max*n})/n).toFixed(e.fixed);return parseFloat(o)},s.prototype.integer=function(e){return c((e=l(e,{min:-9007199254740992,max:a})).min>e.max,"Chance: Min cannot be greater than Max."),Math.floor(this.random()*(e.max-e.min+1)+e.min)},s.prototype.natural=function(e){if("number"==typeof(e=l(e,{min:0,max:a})).numerals&&(c(e.numerals<1,"Chance: Numerals cannot be less than one."),e.min=Math.pow(10,e.numerals-1),e.max=Math.pow(10,e.numerals)-1),c(e.min<0,"Chance: Min cannot be less than zero."),e.exclude){for(var n in c(!Array.isArray(e.exclude),"Chance: exclude must be an array."),e.exclude)c(!Number.isInteger(e.exclude[n]),"Chance: exclude must be numbers.");var i=e.min+this.natural({max:e.max-e.min-e.exclude.length}),r=e.exclude.sort();for(var o in r){if(i<r[o])break;i++}return i}return this.integer(e)},s.prototype.prime=function(a){c((a=l(a,{min:0,max:1e4})).min<0,"Chance: Min cannot be less than zero."),c(a.min>a.max,"Chance: Min cannot be greater than Max.");var e=p.primes[p.primes.length-1];if(a.max>e)for(var n=e+2;n<=a.max;++n)this.is_prime(n)&&p.primes.push(n);var i=p.primes.filter((function(e){return e>=a.min&&e<=a.max}));return this.pick(i)},s.prototype.is_prime=function(a){if(a%1||a<2)return!1;if(a%2==0)return 2===a;if(a%3==0)return 3===a;for(var e=Math.sqrt(a),n=5;n<=e;n+=6)if(a%n==0||a%(n+2)==0)return!1;return!0},s.prototype.hex=function(e){c((e=l(e,{min:0,max:a,casing:"lower"})).min<0,"Chance: Min cannot be less than zero.");var n=this.natural({min:e.min,max:e.max});return"upper"===e.casing?n.toString(16).toUpperCase():n.toString(16)},s.prototype.letter=function(a){a=l(a,{casing:"lower"});var e=this.character({pool:"abcdefghijklmnopqrstuvwxyz"});return"upper"===a.casing&&(e=e.toUpperCase()),e},s.prototype.string=function(a){0===(a=l(a,{min:5,max:20})).length||a.length||(a.length=this.natural({min:a.min,max:a.max})),c(a.length<0,"Chance: Length cannot be less than zero.");var e=a.length;return this.n(this.character,e,a).join("")},u.prototype={substitute:function(){return this.c}},d.prototype={substitute:function(){if(!/[{}\\]/.test(this.c))throw new Error('Invalid escape sequence: "\\'+this.c+'".');return this.c}},h.prototype={replacers:{"#":function(a){return a.character({pool:e})},A:function(a){return a.character({pool:i})},a:function(a){return a.character({pool:n})}},substitute:function(a){var e=this.replacers[this.c];if(!e)throw new Error('Invalid replacement character: "'+this.c+'".');return e(a)}},s.prototype.template=function(a){if(!a)throw new Error("Template string is required");var e=this;return function(a){for(var e=[],n="identity",i=0;i<a.length;i++){var r=a[i];switch(n){case"escape":e.push(new d(r)),n="identity";break;case"identity":"{"===r?n="replace":"\\"===r?n="escape":e.push(new u(r));break;case"replace":"}"===r?n="identity":e.push(new h(r))}}return e}(a).map((function(a){return a.substitute(e)})).join("")},s.prototype.buffer=function(a){if("undefined"==typeof Buffer)throw new o("Sorry, the buffer() function is not supported on your platform");c((a=l(a,{length:this.natural({min:5,max:20})})).length<0,"Chance: Length cannot be less than zero.");var e=a.length,n=this.n(this.character,e,a);return Buffer.from(n)},s.prototype.capitalize=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},s.prototype.mixin=function(a){for(var e in a)s.prototype[e]=a[e];return this},s.prototype.unique=function(a,e,n){c("function"!=typeof a,"Chance: The first argument must be a function.");var i=function(a,e){return-1!==a.indexOf(e)};n&&(i=n.comparator||i);for(var r,o=[],s=0,l=50*e,m=t.call(arguments,2);o.length<e;){var u=JSON.parse(JSON.stringify(m));if(i(o,r=a.apply(this,u))||(o.push(r),s=0),++s>l)throw new RangeError("Chance: num is likely too large for sample set")}return o},s.prototype.n=function(a,e){c("function"!=typeof a,"Chance: The first argument must be a function."),void 0===e&&(e=1);var n=e,i=[],r=t.call(arguments,2);for(n=Math.max(0,n);n--;null)i.push(a.apply(this,r));return i},s.prototype.pad=function(a,e,n){return n=n||"0",(a+="").length>=e?a:new Array(e-a.length+1).join(n)+a},s.prototype.pick=function(a,e){if(0===a.length)throw new RangeError("Chance: Cannot pick() from an empty array");return e&&1!==e?this.shuffle(a).slice(0,e):a[this.natural({max:a.length-1})]},s.prototype.pickone=function(a){if(0===a.length)throw new RangeError("Chance: Cannot pickone() from an empty array");return a[this.natural({max:a.length-1})]},s.prototype.pickset=function(a,e){if(0===e)return[];if(0===a.length)throw new RangeError("Chance: Cannot pickset() from an empty array");if(e<0)throw new RangeError("Chance: Count must be a positive number");if(e&&1!==e){var n=a.slice(0),i=n.length;return this.n((function(){var a=this.natural({max:--i}),e=n[a];return n[a]=n[i],e}),Math.min(i,e))}return[this.pickone(a)]},s.prototype.shuffle=function(a){for(var e,n,i=[],r=0,o=Number(a.length),t=(n=o,Array.apply(null,Array(n)).map((function(a,e){return e}))),s=o-1,l=0;l<o;l++)r=t[e=this.natural({max:s})],i[l]=a[r],t[e]=t[s],s-=1;return i},s.prototype.weighted=function(a,e,n){if(a.length!==e.length)throw new RangeError("Chance: Length of array and weights must match");for(var i,r=0,o=0;o<e.length;++o){if(i=e[o],isNaN(i))throw new RangeError("Chance: All weights must be numbers");i>0&&(r+=i)}if(0===r)throw new RangeError("Chance: No valid entries in array weights");var t,s=this.random()*r,l=0,c=-1;for(o=0;o<e.length;++o){if(l+=i=e[o],i>0){if(s<=l){t=o;break}c=o}o===e.length-1&&(t=c)}var m=a[t];return(n=void 0!==n&&n)&&(a.splice(t,1),e.splice(t,1)),m},s.prototype.paragraph=function(a){var e=(a=l(a)).sentences||this.natural({min:3,max:7}),n=this.n(this.sentence,e),i=!0===a.linebreak?"\n":" ";return n.join(i)},s.prototype.sentence=function(a){var e,n=(a=l(a)).words||this.natural({min:12,max:18}),i=a.punctuation;return e=this.n(this.word,n).join(" "),e=this.capitalize(e),!1===i||/^[.?;!:]$/.test(i)||(i="."),i&&(e+=i),e},s.prototype.syllable=function(a){for(var e,n=(a=l(a)).length||this.natural({min:2,max:3}),i="bcdfghjklmnprstvwz",r="aeiou",o="",t=0;t<n;t++)o+=e=0===t?this.character({pool:"bcdfghjklmnprstvwzaeiou"}):-1===i.indexOf(e)?this.character({pool:i}):this.character({pool:r});return a.capitalize&&(o=this.capitalize(o)),o},s.prototype.word=function(a){c((a=l(a)).syllables&&a.length,"Chance: Cannot specify both syllables AND length.");var e=a.syllables||this.natural({min:1,max:3}),n="";if(a.length){do{n+=this.syllable()}while(n.length<a.length);n=n.substring(0,a.length)}else for(var i=0;i<e;i++)n+=this.syllable();return a.capitalize&&(n=this.capitalize(n)),n},s.prototype.age=function(a){var e;switch((a=l(a)).type){case"child":e={min:0,max:12};break;case"teen":e={min:13,max:19};break;case"adult":default:e={min:18,max:65};break;case"senior":e={min:65,max:100};break;case"all":e={min:0,max:100}}return this.natural(e)},s.prototype.birthday=function(a){var e=this.age(a),n=(new Date).getFullYear();if(a&&a.type){var i=new Date,r=new Date;i.setFullYear(n-e-1),r.setFullYear(n-e),a=l(a,{min:i,max:r})}else a=l(a,{year:n-e});return this.date(a)},s.prototype.cpf=function(a){a=l(a,{formatted:!0});var e=this.n(this.natural,9,{max:9}),n=2*e[8]+3*e[7]+4*e[6]+5*e[5]+6*e[4]+7*e[3]+8*e[2]+9*e[1]+10*e[0];(n=11-n%11)>=10&&(n=0);var i=2*n+3*e[8]+4*e[7]+5*e[6]+6*e[5]+7*e[4]+8*e[3]+9*e[2]+10*e[1]+11*e[0];(i=11-i%11)>=10&&(i=0);var r=""+e[0]+e[1]+e[2]+"."+e[3]+e[4]+e[5]+"."+e[6]+e[7]+e[8]+"-"+n+i;return a.formatted?r:r.replace(/\D/g,"")},s.prototype.cnpj=function(a){a=l(a,{formatted:!0});var e=this.n(this.natural,12,{max:12}),n=2*e[11]+3*e[10]+4*e[9]+5*e[8]+6*e[7]+7*e[6]+8*e[5]+9*e[4]+2*e[3]+3*e[2]+4*e[1]+5*e[0];(n=11-n%11)<2&&(n=0);var i=2*n+3*e[11]+4*e[10]+5*e[9]+6*e[8]+7*e[7]+8*e[6]+9*e[5]+2*e[4]+3*e[3]+4*e[2]+5*e[1]+6*e[0];(i=11-i%11)<2&&(i=0);var r=""+e[0]+e[1]+"."+e[2]+e[3]+e[4]+"."+e[5]+e[6]+e[7]+"/"+e[8]+e[9]+e[10]+e[11]+"-"+n+i;return a.formatted?r:r.replace(/\D/g,"")},s.prototype.first=function(a){return a=l(a,{gender:this.gender(),nationality:"en"}),this.pick(this.get("firstNames")[a.gender.toLowerCase()][a.nationality.toLowerCase()])},s.prototype.profession=function(a){return(a=l(a)).rank?this.pick(["Apprentice ","Junior ","Senior ","Lead "])+this.pick(this.get("profession")):this.pick(this.get("profession"))},s.prototype.company=function(){return this.pick(this.get("company"))},s.prototype.gender=function(a){return a=l(a,{extraGenders:[]}),this.pick(["Male","Female"].concat(a.extraGenders))},s.prototype.last=function(a){if("*"===(a=l(a,{nationality:"*"})).nationality){var e=[],n=this.get("lastNames");return Object.keys(n).forEach((function(a){e=e.concat(n[a])})),this.pick(e)}return this.pick(this.get("lastNames")[a.nationality.toLowerCase()])},s.prototype.israelId=function(){for(var a=this.string({pool:"0123456789",length:8}),e=0,n=0;n<a.length;n++){var i=a[n]*(n/2===parseInt(n/2)?1:2);i=this.pad(i,2).toString(),e+=i=parseInt(i[0])+parseInt(i[1])}return a+=(10-parseInt(e.toString().slice(-1))).toString().slice(-1)},s.prototype.mrz=function(a){var e,n,i,r,o=function(a){var e="<ABCDEFGHIJKLMNOPQRSTUVWXYXZ".split(""),n=[7,3,1],i=0;return"string"!=typeof a&&(a=a.toString()),a.split("").forEach((function(a,r){var o=e.indexOf(a);a=-1!==o?0===o?0:o+9:parseInt(a,10),i+=a*=n[r%n.length]})),i%10},t=this;return a=l(a,{first:this.first(),last:this.last(),passportNumber:this.integer({min:1e8,max:999999999}),dob:(e=t.birthday({type:"adult"}),[e.getFullYear().toString().substr(2),t.pad(e.getMonth()+1,2),t.pad(e.getDate(),2)].join("")),expiry:function(){var a=new Date;return[(a.getFullYear()+5).toString().substr(2),t.pad(a.getMonth()+1,2),t.pad(a.getDate(),2)].join("")}(),gender:"Female"===this.gender()?"F":"M",issuer:"GBR",nationality:"GBR"}),i=function(a){return new Array(a+1).join("<")},(r=["P<",(n=a).issuer,n.last.toUpperCase(),"<<",n.first.toUpperCase(),i(39-(n.last.length+n.first.length+2)),n.passportNumber,o(n.passportNumber),n.nationality,n.dob,o(n.dob),n.gender,n.expiry,o(n.expiry),i(14),o(i(14))].join(""))+o(r.substr(44,10)+r.substr(57,7)+r.substr(65,7))},s.prototype.name=function(a){a=l(a);var e,n=this.first(a),i=this.last(a);return e=a.middle?n+" "+this.first(a)+" "+i:a.middle_initial?n+" "+this.character({alpha:!0,casing:"upper"})+". "+i:n+" "+i,a.prefix&&(e=this.prefix(a)+" "+e),a.suffix&&(e=e+" "+this.suffix(a)),e},s.prototype.name_prefixes=function(a){var e=[{name:"Doctor",abbreviation:"Dr."}];return"male"!==(a=(a=a||"all").toLowerCase())&&"all"!==a||e.push({name:"Mister",abbreviation:"Mr."}),"female"!==a&&"all"!==a||(e.push({name:"Miss",abbreviation:"Miss"}),e.push({name:"Misses",abbreviation:"Mrs."})),e},s.prototype.prefix=function(a){return this.name_prefix(a)},s.prototype.name_prefix=function(a){return(a=l(a,{gender:"all"})).full?this.pick(this.name_prefixes(a.gender)).name:this.pick(this.name_prefixes(a.gender)).abbreviation},s.prototype.HIDN=function(){var a="";return a+=this.string({pool:"0123456789",length:6}),a+=this.string({pool:"ABCDEFGHIJKLMNOPQRSTUVWXYXZ",length:2})},s.prototype.ssn=function(a){var e="1234567890",n=(a=l(a,{ssnFour:!1,dashes:!0})).dashes?"-":"";return a.ssnFour?this.string({pool:e,length:4}):this.string({pool:e,length:3})+n+this.string({pool:e,length:2})+n+this.string({pool:e,length:4})},s.prototype.aadhar=function(a){var e="1234567890",n=(a=l(a,{onlyLastFour:!1,separatedByWhiteSpace:!0})).separatedByWhiteSpace?" ":"";return a.onlyLastFour?this.string({pool:e,length:4}):this.string({pool:e,length:4})+n+this.string({pool:e,length:4})+n+this.string({pool:e,length:4})},s.prototype.name_suffixes=function(){return[{name:"Doctor of Osteopathic Medicine",abbreviation:"D.O."},{name:"Doctor of Philosophy",abbreviation:"Ph.D."},{name:"Esquire",abbreviation:"Esq."},{name:"Junior",abbreviation:"Jr."},{name:"Juris Doctor",abbreviation:"J.D."},{name:"Master of Arts",abbreviation:"M.A."},{name:"Master of Business Administration",abbreviation:"M.B.A."},{name:"Master of Science",abbreviation:"M.S."},{name:"Medical Doctor",abbreviation:"M.D."},{name:"Senior",abbreviation:"Sr."},{name:"The Third",abbreviation:"III"},{name:"The Fourth",abbreviation:"IV"},{name:"Bachelor of Engineering",abbreviation:"B.E"},{name:"Bachelor of Technology",abbreviation:"B.TECH"}]},s.prototype.suffix=function(a){return this.name_suffix(a)},s.prototype.name_suffix=function(a){return(a=l(a)).full?this.pick(this.name_suffixes()).name:this.pick(this.name_suffixes()).abbreviation},s.prototype.nationalities=function(){return this.get("nationalities")},s.prototype.nationality=function(){return this.pick(this.nationalities()).name},s.prototype.android_id=function(){return"APA91"+this.string({pool:"0123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_",length:178})},s.prototype.apple_token=function(){return this.string({pool:"abcdef1234567890",length:64})},s.prototype.wp8_anid2=function(){return m(this.hash({length:32}))},s.prototype.wp7_anid=function(){return"A="+this.guid().replace(/-/g,"").toUpperCase()+"&E="+this.hash({length:3})+"&W="+this.integer({min:0,max:9})},s.prototype.bb_pin=function(){return this.hash({length:8})},s.prototype.avatar=function(a){var e={protocol:null,email:null,fileExtension:null,size:null,fallback:null,rating:null};if(a)if("string"==typeof a)e.email=a,a={};else{if("object"!=typeof a)return null;if("Array"===a.constructor)return null}else e.email=this.email(),a={};return(e=l(a,e)).email||(e.email=this.email()),e.protocol={http:"http",https:"https"}[e.protocol]?e.protocol+":":"",e.size=parseInt(e.size,0)?e.size:"",e.rating={g:"g",pg:"pg",r:"r",x:"x"}[e.rating]?e.rating:"",e.fallback={404:"404",mm:"mm",identicon:"identicon",monsterid:"monsterid",wavatar:"wavatar",retro:"retro",blank:"blank"}[e.fallback]?e.fallback:"",e.fileExtension={bmp:"bmp",gif:"gif",jpg:"jpg",png:"png"}[e.fileExtension]?e.fileExtension:"",e.protocol+"//www.gravatar.com/avatar/"+this.bimd5.md5(e.email)+(e.fileExtension?"."+e.fileExtension:"")+(e.size||e.rating||e.fallback?"?":"")+(e.size?"&s="+e.size.toString():"")+(e.rating?"&r="+e.rating:"")+(e.fallback?"&d="+e.fallback:"")},s.prototype.color=function(a){function e(a,e){return[a,a,a].join(e||"")}function n(a){var n=a?"rgba":"rgb",i=a?","+this.floating({min:p,max:C}):"";return n+"("+(o?e(this.natural({min:t,max:s}),","):this.natural({min:u,max:d})+","+this.natural({min:h,max:b})+","+this.natural({max:255}))+i+")"}function i(n,i,r){var l=r?"#":"",p="";return o?(p=e(this.pad(this.hex({min:t,max:s}),2)),"shorthex"===a.format&&(p=e(this.hex({min:0,max:15})))):p="shorthex"===a.format?this.pad(this.hex({min:Math.floor(c/16),max:Math.floor(m/16)}),1)+this.pad(this.hex({min:Math.floor(u/16),max:Math.floor(d/16)}),1)+this.pad(this.hex({min:Math.floor(h/16),max:Math.floor(b/16)}),1):void 0!==c||void 0!==m||void 0!==u||void 0!==d||void 0!==h||void 0!==b?this.pad(this.hex({min:c,max:m}),2)+this.pad(this.hex({min:u,max:d}),2)+this.pad(this.hex({min:h,max:b}),2):this.pad(this.hex({min:t,max:s}),2)+this.pad(this.hex({min:t,max:s}),2)+this.pad(this.hex({min:t,max:s}),2),l+p}var r,o=(a=l(a,{format:this.pick(["hex","shorthex","rgb","rgba","0x","name"]),grayscale:!1,casing:"lower",min:0,max:255,min_red:void 0,max_red:void 0,min_green:void 0,max_green:void 0,min_blue:void 0,max_blue:void 0,min_alpha:0,max_alpha:1})).grayscale,t=a.min,s=a.max,c=a.min_red,m=a.max_red,u=a.min_green,d=a.max_green,h=a.min_blue,b=a.max_blue,p=a.min_alpha,C=a.max_alpha;if(void 0===a.min_red&&(c=t),void 0===a.max_red&&(m=s),void 0===a.min_green&&(u=t),void 0===a.max_green&&(d=s),void 0===a.min_blue&&(h=t),void 0===a.max_blue&&(b=s),void 0===a.min_alpha&&(p=0),void 0===a.max_alpha&&(C=1),o&&0===t&&255===s&&void 0!==c&&void 0!==m&&(t=(c+u+h)/3,s=(m+d+b)/3),"hex"===a.format)r=i.call(this,2,6,!0);else if("shorthex"===a.format)r=i.call(this,1,3,!0);else if("rgb"===a.format)r=n.call(this,!1);else if("rgba"===a.format)r=n.call(this,!0);else{if("0x"!==a.format){if("name"===a.format)return this.pick(this.get("colorNames"));throw new RangeError('Invalid format provided. Please provide one of "hex", "shorthex", "rgb", "rgba", "0x" or "name".')}r="0x"+i.call(this,2,6)}return"upper"===a.casing&&(r=r.toUpperCase()),r},s.prototype.domain=function(a){return a=l(a),this.word()+"."+(a.tld||this.tld())},s.prototype.email=function(a){return a=l(a),this.word({length:a.length})+"@"+(a.domain||this.domain())},s.prototype.fbid=function(){return"10000"+this.string({pool:"1234567890",length:11})},s.prototype.google_analytics=function(){return"UA-"+this.pad(this.natural({max:999999}),6)+"-"+this.pad(this.natural({max:99}),2)},s.prototype.hashtag=function(){return"#"+this.word()},s.prototype.ip=function(){return this.natural({min:1,max:254})+"."+this.natural({max:255})+"."+this.natural({max:255})+"."+this.natural({min:1,max:254})},s.prototype.ipv6=function(){return this.n(this.hash,8,{length:4}).join(":")},s.prototype.klout=function(){return this.natural({min:1,max:99})},s.prototype.mac=function(a){return a=l(a,{delimiter:":"}),this.pad(this.natural({max:255}).toString(16),2)+a.delimiter+this.pad(this.natural({max:255}).toString(16),2)+a.delimiter+this.pad(this.natural({max:255}).toString(16),2)+a.delimiter+this.pad(this.natural({max:255}).toString(16),2)+a.delimiter+this.pad(this.natural({max:255}).toString(16),2)+a.delimiter+this.pad(this.natural({max:255}).toString(16),2)},s.prototype.semver=function(a){a=l(a,{include_prerelease:!0});var e=this.pickone(["^","~","<",">","<=",">=","="]);a.range&&(e=a.range);var n="";return a.include_prerelease&&(n=this.weighted(["","-dev","-beta","-alpha"],[50,10,5,1])),e+this.rpg("3d10").join(".")+n},s.prototype.tlds=function(){return["com","org","edu","gov","co.uk","net","io","ac","ad","ae","af","ag","ai","al","am","ao","aq","ar","as","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","io","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tf","tg","th","tj","tk","tl","tm","tn","to","tp","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","za","zm","zw"]},s.prototype.tld=function(){return this.pick(this.tlds())},s.prototype.twitter=function(){return"@"+this.word()},s.prototype.url=function(a){var e=(a=l(a,{protocol:"http",domain:this.domain(a),domain_prefix:"",path:this.word(),extensions:[]})).extensions.length>0?"."+this.pick(a.extensions):"",n=a.domain_prefix?a.domain_prefix+"."+a.domain:a.domain;return a.protocol+"://"+n+"/"+a.path+e},s.prototype.port=function(){return this.integer({min:0,max:65535})},s.prototype.locale=function(a){return(a=l(a)).region?this.pick(this.get("locale_regions")):this.pick(this.get("locale_languages"))},s.prototype.locales=function(a){return(a=l(a)).region?this.get("locale_regions"):this.get("locale_languages")},s.prototype.loremPicsum=function(a){var e=(a=l(a,{width:500,height:500,greyscale:!1,blurred:!1})).greyscale?"g/":"",n=a.blurred?"/?blur":"/?random";return"https://picsum.photos/"+e+a.width+"/"+a.height+n},s.prototype.address=function(a){return a=l(a),this.natural({min:5,max:2e3})+" "+this.street(a)},s.prototype.altitude=function(a){return a=l(a,{fixed:5,min:0,max:8848}),this.floating({min:a.min,max:a.max,fixed:a.fixed})},s.prototype.areacode=function(a){var e=(a=l(a,{parens:!0})).exampleNumber?"555":this.natural({min:2,max:9}).toString()+this.natural({min:0,max:8}).toString()+this.natural({min:0,max:9}).toString();return a.parens?"("+e+")":e},s.prototype.city=function(){return this.capitalize(this.word({syllables:3}))},s.prototype.coordinates=function(a){return this.latitude(a)+", "+this.longitude(a)},s.prototype.countries=function(){return this.get("countries")},s.prototype.country=function(a){a=l(a);var e=this.pick(this.countries());return a.raw?e:a.full?e.name:e.abbreviation},s.prototype.depth=function(a){return a=l(a,{fixed:5,min:-10994,max:0}),this.floating({min:a.min,max:a.max,fixed:a.fixed})},s.prototype.geohash=function(a){return a=l(a,{length:7}),this.string({length:a.length,pool:"0123456789bcdefghjkmnpqrstuvwxyz"})},s.prototype.geojson=function(a){return this.latitude(a)+", "+this.longitude(a)+", "+this.altitude(a)},s.prototype.latitude=function(a){var[e,n,i]=["ddm","dms","dd"],r=(a=l(a,a&&a.format&&[e,n].includes(a.format.toLowerCase())?{min:0,max:89,fixed:4}:{fixed:5,min:-90,max:90,format:i})).format.toLowerCase();switch(r!==e&&r!==n||(c(a.min<0||a.min>89,"Chance: Min specified is out of range. Should be between 0 - 89"),c(a.max<0||a.max>89,"Chance: Max specified is out of range. Should be between 0 - 89"),c(a.fixed>4,"Chance: Fixed specified should be below or equal to 4")),r){case e:return this.integer({min:a.min,max:a.max})+"°"+this.floating({min:0,max:59,fixed:a.fixed});case n:return this.integer({min:a.min,max:a.max})+"°"+this.integer({min:0,max:59})+"’"+this.floating({min:0,max:59,fixed:a.fixed})+"”";default:return this.floating({min:a.min,max:a.max,fixed:a.fixed})}},s.prototype.longitude=function(a){var[e,n,i]=["ddm","dms","dd"],r=(a=l(a,a&&a.format&&[e,n].includes(a.format.toLowerCase())?{min:0,max:179,fixed:4}:{fixed:5,min:-180,max:180,format:i})).format.toLowerCase();switch(r!==e&&r!==n||(c(a.min<0||a.min>179,"Chance: Min specified is out of range. Should be between 0 - 179"),c(a.max<0||a.max>179,"Chance: Max specified is out of range. Should be between 0 - 179"),c(a.fixed>4,"Chance: Fixed specified should be below or equal to 4")),r){case e:return this.integer({min:a.min,max:a.max})+"°"+this.floating({min:0,max:59.9999,fixed:a.fixed});case n:return this.integer({min:a.min,max:a.max})+"°"+this.integer({min:0,max:59})+"’"+this.floating({min:0,max:59.9999,fixed:a.fixed})+"”";default:return this.floating({min:a.min,max:a.max,fixed:a.fixed})}},s.prototype.phone=function(a){var e,n,i=this,r=function(a){var e=[];return a.sections.forEach((function(a){e.push(i.string({pool:"0123456789",length:a}))})),a.area+e.join(" ")};switch((a=l(a,{formatted:!0,country:"us",mobile:!1,exampleNumber:!1})).formatted||(a.parens=!1),a.country){case"fr":a.mobile?(e=this.pick(["06","07"])+i.string({pool:"0123456789",length:8}),n=a.formatted?e.match(/../g).join(" "):e):(e=this.pick(["01"+this.pick(["30","34","39","40","41","42","43","44","45","46","47","48","49","53","55","56","58","60","64","69","70","72","73","74","75","76","77","78","79","80","81","82","83"])+i.string({pool:"0123456789",length:6}),"02"+this.pick(["14","18","22","23","28","29","30","31","32","33","34","35","36","37","38","40","41","43","44","45","46","47","48","49","50","51","52","53","54","56","57","61","62","69","72","76","77","78","85","90","96","97","98","99"])+i.string({pool:"0123456789",length:6}),"03"+this.pick(["10","20","21","22","23","24","25","26","27","28","29","39","44","45","51","52","54","55","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","80","81","82","83","84","85","86","87","88","89","90"])+i.string({pool:"0123456789",length:6}),"04"+this.pick(["11","13","15","20","22","26","27","30","32","34","37","42","43","44","50","56","57","63","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","88","89","90","91","92","93","94","95","97","98"])+i.string({pool:"0123456789",length:6}),"05"+this.pick(["08","16","17","19","24","31","32","33","34","35","40","45","46","47","49","53","55","56","57","58","59","61","62","63","64","65","67","79","81","82","86","87","90","94"])+i.string({pool:"0123456789",length:6}),"09"+i.string({pool:"0123456789",length:8})]),n=a.formatted?e.match(/../g).join(" "):e);break;case"uk":a.mobile?(e=this.pick([{area:"07"+this.pick(["4","5","7","8","9"]),sections:[2,6]},{area:"07624 ",sections:[6]}]),n=a.formatted?r(e):r(e).replace(" ","")):(e=this.pick([{area:"01"+this.character({pool:"234569"})+"1 ",sections:[3,4]},{area:"020 "+this.character({pool:"378"}),sections:[3,4]},{area:"023 "+this.character({pool:"89"}),sections:[3,4]},{area:"024 7",sections:[3,4]},{area:"028 "+this.pick(["25","28","37","71","82","90","92","95"]),sections:[2,4]},{area:"012"+this.pick(["04","08","54","76","97","98"])+" ",sections:[6]},{area:"013"+this.pick(["63","64","84","86"])+" ",sections:[6]},{area:"014"+this.pick(["04","20","60","61","80","88"])+" ",sections:[6]},{area:"015"+this.pick(["24","27","62","66"])+" ",sections:[6]},{area:"016"+this.pick(["06","29","35","47","59","95"])+" ",sections:[6]},{area:"017"+this.pick(["26","44","50","68"])+" ",sections:[6]},{area:"018"+this.pick(["27","37","84","97"])+" ",sections:[6]},{area:"019"+this.pick(["00","05","35","46","49","63","95"])+" ",sections:[6]}]),n=a.formatted?r(e):r(e).replace(" ","","g"));break;case"za":a.mobile?(e=this.pick(["060"+this.pick(["3","4","5","6","7","8","9"])+i.string({pool:"0123456789",length:6}),"061"+this.pick(["0","1","2","3","4","5","8"])+i.string({pool:"0123456789",length:6}),"06"+i.string({pool:"0123456789",length:7}),"071"+this.pick(["0","1","2","3","4","5","6","7","8","9"])+i.string({pool:"0123456789",length:6}),"07"+this.pick(["2","3","4","6","7","8","9"])+i.string({pool:"0123456789",length:7}),"08"+this.pick(["0","1","2","3","4","5"])+i.string({pool:"0123456789",length:7})]),n=a.formatted||e):(e=this.pick(["01"+this.pick(["0","1","2","3","4","5","6","7","8"])+i.string({pool:"0123456789",length:7}),"02"+this.pick(["1","2","3","4","7","8"])+i.string({pool:"0123456789",length:7}),"03"+this.pick(["1","2","3","5","6","9"])+i.string({pool:"0123456789",length:7}),"04"+this.pick(["1","2","3","4","5","6","7","8","9"])+i.string({pool:"0123456789",length:7}),"05"+this.pick(["1","3","4","6","7","8"])+i.string({pool:"0123456789",length:7})]),n=a.formatted||e);break;case"us":var o=this.areacode(a).toString(),t=this.natural({min:2,max:9}).toString()+this.natural({min:0,max:9}).toString()+this.natural({min:0,max:9}).toString(),s=this.natural({min:1e3,max:9999}).toString();n=a.formatted?o+" "+t+"-"+s:o+t+s;break;case"br":var c,m=this.pick(["11","12","13","14","15","16","17","18","19","21","22","24","27","28","31","32","33","34","35","37","38","41","42","43","44","45","46","47","48","49","51","53","54","55","61","62","63","64","65","66","67","68","69","71","73","74","75","77","79","81","82","83","84","85","86","87","88","89","91","92","93","94","95","96","97","98","99"]);c=a.mobile?"9"+i.string({pool:"0123456789",length:4}):this.natural({min:2e3,max:5999}).toString();var u=i.string({pool:"0123456789",length:4});n=a.formatted?"("+m+") "+c+"-"+u:m+c+u}return n},s.prototype.postal=function(){return this.character({pool:"XVTSRPNKLMHJGECBA"})+this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+" "+(this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+this.natural({max:9}))},s.prototype.postcode=function(){return this.pick(this.get("postcodeAreas")).code+this.natural({max:9})+(this.bool()?this.character({alpha:!0,casing:"upper"}):"")+" "+(this.natural({max:9})+(this.character({alpha:!0,casing:"upper"})+this.character({alpha:!0,casing:"upper"})))},s.prototype.counties=function(a){return a=l(a,{country:"uk"}),this.get("counties")[a.country.toLowerCase()]},s.prototype.county=function(a){return this.pick(this.counties(a)).name},s.prototype.provinces=function(a){return a=l(a,{country:"ca"}),this.get("provinces")[a.country.toLowerCase()]},s.prototype.province=function(a){return a&&a.full?this.pick(this.provinces(a)).name:this.pick(this.provinces(a)).abbreviation},s.prototype.state=function(a){return a&&a.full?this.pick(this.states(a)).name:this.pick(this.states(a)).abbreviation},s.prototype.states=function(a){var e;switch((a=l(a,{country:"us",us_states_and_dc:!0})).country.toLowerCase()){case"us":var n=this.get("us_states_and_dc"),i=this.get("territories"),r=this.get("armed_forces");e=[],a.us_states_and_dc&&(e=e.concat(n)),a.territories&&(e=e.concat(i)),a.armed_forces&&(e=e.concat(r));break;case"it":case"mx":e=this.get("country_regions")[a.country.toLowerCase()];break;case"uk":e=this.get("counties")[a.country.toLowerCase()]}return e},s.prototype.street=function(a){var e;switch((a=l(a,{country:"us",syllables:2})).country.toLowerCase()){case"us":e=this.word({syllables:a.syllables}),e=this.capitalize(e),e+=" ",e+=a.short_suffix?this.street_suffix(a).abbreviation:this.street_suffix(a).name;break;case"it":e=this.word({syllables:a.syllables}),e=this.capitalize(e),e=(a.short_suffix?this.street_suffix(a).abbreviation:this.street_suffix(a).name)+" "+e}return e},s.prototype.street_suffix=function(a){return a=l(a,{country:"us"}),this.pick(this.street_suffixes(a))},s.prototype.street_suffixes=function(a){return a=l(a,{country:"us"}),this.get("street_suffixes")[a.country.toLowerCase()]},s.prototype.zip=function(a){var e=this.n(this.natural,5,{max:9});return a&&!0===a.plusfour&&(e.push("-"),e=e.concat(this.n(this.natural,4,{max:9}))),e.join("")},s.prototype.ampm=function(){return this.bool()?"am":"pm"},s.prototype.date=function(a){var e,n;if(a&&(a.min||a.max)){var i=void 0!==(a=l(a,{american:!0,string:!1})).min?a.min.getTime():1,r=void 0!==a.max?a.max.getTime():864e13;n=new Date(this.integer({min:i,max:r}))}else{var o=this.month({raw:!0}),t=o.days;a&&a.month&&(t=this.get("months")[(a.month%12+12)%12].days),a=l(a,{year:parseInt(this.year(),10),month:o.numeric-1,day:this.natural({min:1,max:t}),hour:this.hour({twentyfour:!0}),minute:this.minute(),second:this.second(),millisecond:this.millisecond(),american:!0,string:!1}),n=new Date(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond)}return e=a.american?n.getMonth()+1+"/"+n.getDate()+"/"+n.getFullYear():n.getDate()+"/"+(n.getMonth()+1)+"/"+n.getFullYear(),a.string?e:n},s.prototype.hammertime=function(a){return this.date(a).getTime()},s.prototype.hour=function(a){return c((a=l(a,{min:a&&a.twentyfour?0:1,max:a&&a.twentyfour?23:12})).min<0,"Chance: Min cannot be less than 0."),c(a.twentyfour&&a.max>23,"Chance: Max cannot be greater than 23 for twentyfour option."),c(!a.twentyfour&&a.max>12,"Chance: Max cannot be greater than 12."),c(a.min>a.max,"Chance: Min cannot be greater than Max."),this.natural({min:a.min,max:a.max})},s.prototype.millisecond=function(){return this.natural({max:999})},s.prototype.minute=s.prototype.second=function(a){return c((a=l(a,{min:0,max:59})).min<0,"Chance: Min cannot be less than 0."),c(a.max>59,"Chance: Max cannot be greater than 59."),c(a.min>a.max,"Chance: Min cannot be greater than Max."),this.natural({min:a.min,max:a.max})},s.prototype.month=function(a){c((a=l(a,{min:1,max:12})).min<1,"Chance: Min cannot be less than 1."),c(a.max>12,"Chance: Max cannot be greater than 12."),c(a.min>a.max,"Chance: Min cannot be greater than Max.");var e=this.pick(this.months().slice(a.min-1,a.max));return a.raw?e:e.name},s.prototype.months=function(){return this.get("months")},s.prototype.second=function(){return this.natural({max:59})},s.prototype.timestamp=function(){return this.natural({min:1,max:parseInt((new Date).getTime()/1e3,10)})},s.prototype.weekday=function(a){var e=["Monday","Tuesday","Wednesday","Thursday","Friday"];return(a=l(a,{weekday_only:!1})).weekday_only||(e.push("Saturday"),e.push("Sunday")),this.pickone(e)},s.prototype.year=function(a){return(a=l(a,{min:(new Date).getFullYear()})).max=void 0!==a.max?a.max:a.min+100,this.natural(a).toString()},s.prototype.cc=function(a){var e,n,i;return n=(e=(a=l(a)).type?this.cc_type({name:a.type,raw:!0}):this.cc_type({raw:!0})).prefix.split(""),i=e.length-e.prefix.length-1,(n=n.concat(this.n(this.integer,i,{min:0,max:9}))).push(this.luhn_calculate(n.join(""))),n.join("")},s.prototype.cc_types=function(){return this.get("cc_types")},s.prototype.cc_type=function(a){a=l(a);var e=this.cc_types(),n=null;if(a.name){for(var i=0;i<e.length;i++)if(e[i].name===a.name||e[i].short_name===a.name){n=e[i];break}if(null===n)throw new RangeError("Chance: Credit card type '"+a.name+"' is not supported")}else n=this.pick(e);return a.raw?n:n.name},s.prototype.currency_types=function(){return this.get("currency_types")},s.prototype.currency=function(){return this.pick(this.currency_types())},s.prototype.timezones=function(){return this.get("timezones")},s.prototype.timezone=function(){return this.pick(this.timezones())},s.prototype.currency_pair=function(a){var e=this.unique(this.currency,2,{comparator:function(a,e){return a.reduce((function(a,n){return a||n.code===e.code}),!1)}});return a?e[0].code+"/"+e[1].code:e},s.prototype.dollar=function(a){a=l(a,{max:1e4,min:0});var e=this.floating({min:a.min,max:a.max,fixed:2}).toString(),n=e.split(".")[1];return void 0===n?e+=".00":n.length<2&&(e+="0"),e<0?"-$"+e.replace("-",""):"$"+e},s.prototype.euro=function(a){return Number(this.dollar(a).replace("$","")).toLocaleString()+"€"},s.prototype.exp=function(a){a=l(a);var e={};return e.year=this.exp_year(),e.year===(new Date).getFullYear().toString()?e.month=this.exp_month({future:!0}):e.month=this.exp_month(),a.raw?e:e.month+"/"+e.year},s.prototype.exp_month=function(a){a=l(a);var e,n,i=(new Date).getMonth()+1;if(a.future&&12!==i)do{e=this.month({raw:!0}).numeric,n=parseInt(e,10)}while(n<=i);else e=this.month({raw:!0}).numeric;return e},s.prototype.exp_year=function(){var a=(new Date).getMonth()+1,e=(new Date).getFullYear();return this.year({min:12===a?e+1:e,max:e+10})},s.prototype.vat=function(a){if("it"===(a=l(a,{country:"it"})).country.toLowerCase())return this.it_vat()},s.prototype.iban=function(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";return this.string({length:2,pool:a})+this.pad(this.integer({min:0,max:99}),2)+this.string({length:4,pool:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"})+this.pad(this.natural(),this.natural({min:6,max:26}))},s.prototype.it_vat=function(){var a=this.natural({min:1,max:18e5});return(a=this.pad(a,7)+this.pad(this.pick(this.provinces({country:"it"})).code,3))+this.luhn_calculate(a)},s.prototype.cf=function(a){var e=(a=a||{}).gender?a.gender:this.gender(),n=a.first?a.first:this.first({gender:e,nationality:"it"}),i=a.last?a.last:this.last({nationality:"it"}),r=a.birthday?a.birthday:this.birthday(),o=a.city?a.city:this.pickone(["A","B","C","D","E","F","G","H","I","L","M","Z"])+this.pad(this.natural({max:999}),3),t=[],s=function(a,e){var n,i=[];return a.length<3?i=a.split("").concat("XXX".split("")).splice(0,3):((n=a.toUpperCase().split("").map((function(a){return-1!=="BCDFGHJKLMNPRSTVWZ".indexOf(a)?a:void 0})).join("")).length>3&&(n=e?n.substr(0,3):n[0]+n.substr(2,2)),n.length<3&&(i=n,n=a.toUpperCase().split("").map((function(a){return-1!=="AEIOU".indexOf(a)?a:void 0})).join("").substr(0,3-i.length)),i+=n),i};return t=t.concat(s(i,!0),s(n),function(a,e,n){return a.getFullYear().toString().substr(2)+["A","B","C","D","E","H","L","M","P","R","S","T"][a.getMonth()]+n.pad(a.getDate()+("female"===e.toLowerCase()?40:0),2)}(r,e,this),o.toUpperCase().split("")).join(""),(t+=function(a){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n="ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ",i="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=0,o=0;o<15;o++)r+=o%2!=0?i.indexOf(n[e.indexOf(a[o])]):"BAKPLCQDREVOSFTGUHMINJWZYX".indexOf(n[e.indexOf(a[o])]);return i[r%26]}(t.toUpperCase())).toUpperCase()},s.prototype.pl_pesel=function(){for(var a=this.natural({min:1,max:9999999999}),e=this.pad(a,10).split(""),n=0;n<e.length;n++)e[n]=parseInt(e[n]);var i=(1*e[0]+3*e[1]+7*e[2]+9*e[3]+1*e[4]+3*e[5]+7*e[6]+9*e[7]+1*e[8]+3*e[9])%10;return 0!==i&&(i=10-i),e.join("")+i},s.prototype.pl_nip=function(){for(var a=this.natural({min:1,max:999999999}),e=this.pad(a,9).split(""),n=0;n<e.length;n++)e[n]=parseInt(e[n]);var i=(6*e[0]+5*e[1]+7*e[2]+2*e[3]+3*e[4]+4*e[5]+5*e[6]+6*e[7]+7*e[8])%11;return 10===i?this.pl_nip():e.join("")+i},s.prototype.pl_regon=function(){for(var a=this.natural({min:1,max:99999999}),e=this.pad(a,8).split(""),n=0;n<e.length;n++)e[n]=parseInt(e[n]);var i=(8*e[0]+9*e[1]+2*e[2]+3*e[3]+4*e[4]+5*e[5]+6*e[6]+7*e[7])%11;return 10===i&&(i=0),e.join("")+i},s.prototype.note=function(a){a=l(a,{notes:"flatKey"});var e={naturals:["C","D","E","F","G","A","B"],flats:["D♭","E♭","G♭","A♭","B♭"],sharps:["C♯","D♯","F♯","G♯","A♯"]};return e.all=e.naturals.concat(e.flats.concat(e.sharps)),e.flatKey=e.naturals.concat(e.flats),e.sharpKey=e.naturals.concat(e.sharps),this.pickone(e[a.notes])},s.prototype.midi_note=function(a){return a=l(a,{min:0,max:127}),this.integer({min:a.min,max:a.max})},s.prototype.chord_quality=function(a){var e=["maj","min","aug","dim"];return(a=l(a,{jazz:!0})).jazz&&(e=["maj7","min7","7","sus","dim","ø"]),this.pickone(e)},s.prototype.chord=function(a){return a=l(a),this.note(a)+this.chord_quality(a)},s.prototype.tempo=function(a){return a=l(a,{min:40,max:320}),this.integer({min:a.min,max:a.max})},s.prototype.coin=function(){return this.bool()?"heads":"tails"},s.prototype.d4=b({min:1,max:4}),s.prototype.d6=b({min:1,max:6}),s.prototype.d8=b({min:1,max:8}),s.prototype.d10=b({min:1,max:10}),s.prototype.d12=b({min:1,max:12}),s.prototype.d20=b({min:1,max:20}),s.prototype.d30=b({min:1,max:30}),s.prototype.d100=b({min:1,max:100}),s.prototype.rpg=function(a,e){if(e=l(e),a){var n=a.toLowerCase().split("d"),i=[];if(2!==n.length||!parseInt(n[0],10)||!parseInt(n[1],10))throw new Error("Chance: Invalid format provided. Please provide #d# where the first # is the number of dice to roll, the second # is the max of each die");for(var r=n[0];r>0;r--)i[r-1]=this.natural({min:1,max:n[1]});return void 0!==e.sum&&e.sum?i.reduce((function(a,e){return a+e})):i}throw new RangeError("Chance: A type of die roll must be included")},s.prototype.guid=function(a){a=l(a,{version:5});var e="abcdef1234567890";return this.string({pool:e,length:8})+"-"+this.string({pool:e,length:4})+"-"+a.version+this.string({pool:e,length:3})+"-"+this.string({pool:"ab89",length:1})+this.string({pool:e,length:3})+"-"+this.string({pool:e,length:12})},s.prototype.hash=function(a){var e="upper"===(a=l(a,{length:40,casing:"lower"})).casing?r.toUpperCase():r;return this.string({pool:e,length:a.length})},s.prototype.luhn_check=function(a){var e=a.toString();return+e.substring(e.length-1)===this.luhn_calculate(+e.substring(0,e.length-1))},s.prototype.luhn_calculate=function(a){for(var e,n=a.toString().split("").reverse(),i=0,r=0,o=n.length;o>r;++r)e=+n[r],r%2==0&&(e*=2)>9&&(e-=9),i+=e;return 9*i%10},s.prototype.md5=function(a){var e={str:"",key:null,raw:!1};if(a)if("string"==typeof a)e.str=a,a={};else{if("object"!=typeof a)return null;if("Array"===a.constructor)return null}else e.str=this.string(),a={};if(!(e=l(a,e)).str)throw new Error("A parameter is required to return an md5 hash.");return this.bimd5.md5(e.str,e.key,e.raw)},s.prototype.file=function(a){var e,n=a||{},i="fileExtension",r=Object.keys(this.get("fileExtension"));if(e=this.word({length:n.length}),n.extension)return e+"."+n.extension;if(n.extensions){if(Array.isArray(n.extensions))return e+"."+this.pickone(n.extensions);if(n.extensions.constructor===Object){var o=n.extensions,t=Object.keys(o);return e+"."+this.pickone(o[this.pickone(t)])}throw new Error("Chance: Extensions must be an Array or Object")}if(n.fileType){var s=n.fileType;if(-1!==r.indexOf(s))return e+"."+this.pickone(this.get(i)[s]);throw new RangeError("Chance: Expect file type value to be 'raster', 'vector', '3d' or 'document'")}return e+"."+this.pickone(this.get(i)[this.pickone(r)])};var p={firstNames:{male:{en:["James","John","Robert","Michael","William","David","Richard","Joseph","Charles","Thomas","Christopher","Daniel","Matthew","George","Donald","Anthony","Paul","Mark","Edward","Steven","Kenneth","Andrew","Brian","Joshua","Kevin","Ronald","Timothy","Jason","Jeffrey","Frank","Gary","Ryan","Nicholas","Eric","Stephen","Jacob","Larry","Jonathan","Scott","Raymond","Justin","Brandon","Gregory","Samuel","Benjamin","Patrick","Jack","Henry","Walter","Dennis","Jerry","Alexander","Peter","Tyler","Douglas","Harold","Aaron","Jose","Adam","Arthur","Zachary","Carl","Nathan","Albert","Kyle","Lawrence","Joe","Willie","Gerald","Roger","Keith","Jeremy","Terry","Harry","Ralph","Sean","Jesse","Roy","Louis","Billy","Austin","Bruce","Eugene","Christian","Bryan","Wayne","Russell","Howard","Fred","Ethan","Jordan","Philip","Alan","Juan","Randy","Vincent","Bobby","Dylan","Johnny","Phillip","Victor","Clarence","Ernest","Martin","Craig","Stanley","Shawn","Travis","Bradley","Leonard","Earl","Gabriel","Jimmy","Francis","Todd","Noah","Danny","Dale","Cody","Carlos","Allen","Frederick","Logan","Curtis","Alex","Joel","Luis","Norman","Marvin","Glenn","Tony","Nathaniel","Rodney","Melvin","Alfred","Steve","Cameron","Chad","Edwin","Caleb","Evan","Antonio","Lee","Herbert","Jeffery","Isaac","Derek","Ricky","Marcus","Theodore","Elijah","Luke","Jesus","Eddie","Troy","Mike","Dustin","Ray","Adrian","Bernard","Leroy","Angel","Randall","Wesley","Ian","Jared","Mason","Hunter","Calvin","Oscar","Clifford","Jay","Shane","Ronnie","Barry","Lucas","Corey","Manuel","Leo","Tommy","Warren","Jackson","Isaiah","Connor","Don","Dean","Jon","Julian","Miguel","Bill","Lloyd","Charlie","Mitchell","Leon","Jerome","Darrell","Jeremiah","Alvin","Brett","Seth","Floyd","Jim","Blake","Micheal","Gordon","Trevor","Lewis","Erik","Edgar","Vernon","Devin","Gavin","Jayden","Chris","Clyde","Tom","Derrick","Mario","Brent","Marc","Herman","Chase","Dominic","Ricardo","Franklin","Maurice","Max","Aiden","Owen","Lester","Gilbert","Elmer","Gene","Francisco","Glen","Cory","Garrett","Clayton","Sam","Jorge","Chester","Alejandro","Jeff","Harvey","Milton","Cole","Ivan","Andre","Duane","Landon"],it:["Adolfo","Alberto","Aldo","Alessandro","Alessio","Alfredo","Alvaro","Andrea","Angelo","Angiolo","Antonino","Antonio","Attilio","Benito","Bernardo","Bruno","Carlo","Cesare","Christian","Claudio","Corrado","Cosimo","Cristian","Cristiano","Daniele","Dario","David","Davide","Diego","Dino","Domenico","Duccio","Edoardo","Elia","Elio","Emanuele","Emiliano","Emilio","Enrico","Enzo","Ettore","Fabio","Fabrizio","Federico","Ferdinando","Fernando","Filippo","Francesco","Franco","Gabriele","Giacomo","Giampaolo","Giampiero","Giancarlo","Gianfranco","Gianluca","Gianmarco","Gianni","Gino","Giorgio","Giovanni","Giuliano","Giulio","Giuseppe","Graziano","Gregorio","Guido","Iacopo","Jacopo","Lapo","Leonardo","Lorenzo","Luca","Luciano","Luigi","Manuel","Marcello","Marco","Marino","Mario","Massimiliano","Massimo","Matteo","Mattia","Maurizio","Mauro","Michele","Mirko","Mohamed","Nello","Neri","Niccolò","Nicola","Osvaldo","Otello","Paolo","Pier Luigi","Piero","Pietro","Raffaele","Remo","Renato","Renzo","Riccardo","Roberto","Rolando","Romano","Salvatore","Samuele","Sandro","Sergio","Silvano","Simone","Stefano","Thomas","Tommaso","Ubaldo","Ugo","Umberto","Valerio","Valter","Vasco","Vincenzo","Vittorio"],nl:["Aaron","Abel","Adam","Adriaan","Albert","Alexander","Ali","Arjen","Arno","Bart","Bas","Bastiaan","Benjamin","Bob","Boris","Bram","Brent","Cas","Casper","Chris","Christiaan","Cornelis","Daan","Daley","Damian","Dani","Daniel","Daniël","David","Dean","Dirk","Dylan","Egbert","Elijah","Erik","Erwin","Evert","Ezra","Fabian","Fedde","Finn","Florian","Floris","Frank","Frans","Frederik","Freek","Geert","Gerard","Gerben","Gerrit","Gijs","Guus","Hans","Hendrik","Henk","Herman","Hidde","Hugo","Jaap","Jan Jaap","Jan-Willem","Jack","Jacob","Jan","Jason","Jasper","Jayden","Jelle","Jelte","Jens","Jeroen","Jesse","Jim","Job","Joep","Johannes","John","Jonathan","Joris","Joshua","Joël","Julian","Kees","Kevin","Koen","Lars","Laurens","Leendert","Lennard","Lodewijk","Luc","Luca","Lucas","Lukas","Luuk","Maarten","Marcus","Martijn","Martin","Matthijs","Maurits","Max","Mees","Melle","Mick","Mika","Milan","Mohamed","Mohammed","Morris","Muhammed","Nathan","Nick","Nico","Niek","Niels","Noah","Noud","Olivier","Oscar","Owen","Paul","Pepijn","Peter","Pieter","Pim","Quinten","Reinier","Rens","Robin","Ruben","Sam","Samuel","Sander","Sebastiaan","Sem","Sep","Sepp","Siem","Simon","Stan","Stef","Steven","Stijn","Sven","Teun","Thijmen","Thijs","Thomas","Tijn","Tim","Timo","Tobias","Tom","Victor","Vince","Willem","Wim","Wouter","Yusuf"],fr:["Aaron","Abdon","Abel","Abélard","Abelin","Abondance","Abraham","Absalon","Acace","Achaire","Achille","Adalard","Adalbald","Adalbéron","Adalbert","Adalric","Adam","Adegrin","Adel","Adelin","Andelin","Adelphe","Adam","Adéodat","Adhémar","Adjutor","Adolphe","Adonis","Adon","Adrien","Agapet","Agathange","Agathon","Agilbert","Agénor","Agnan","Aignan","Agrippin","Aimable","Aimé","Alain","Alban","Albin","Aubin","Albéric","Albert","Albertet","Alcibiade","Alcide","Alcée","Alcime","Aldonce","Aldric","Aldéric","Aleaume","Alexandre","Alexis","Alix","Alliaume","Aleaume","Almine","Almire","Aloïs","Alphée","Alphonse","Alpinien","Alverède","Amalric","Amaury","Amandin","Amant","Ambroise","Amédée","Amélien","Amiel","Amour","Anaël","Anastase","Anatole","Ancelin","Andéol","Andoche","André","Andoche","Ange","Angelin","Angilbe","Anglebert","Angoustan","Anicet","Anne","Annibal","Ansbert","Anselme","Anthelme","Antheaume","Anthime","Antide","Antoine","Antonius","Antonin","Apollinaire","Apollon","Aquilin","Arcade","Archambaud","Archambeau","Archange","Archibald","Arian","Ariel","Ariste","Aristide","Armand","Armel","Armin","Arnould","Arnaud","Arolde","Arsène","Arsinoé","Arthaud","Arthème","Arthur","Ascelin","Athanase","Aubry","Audebert","Audouin","Audran","Audric","Auguste","Augustin","Aurèle","Aurélien","Aurian","Auxence","Axel","Aymard","Aymeric","Aymon","Aymond","Balthazar","Baptiste","Barnabé","Barthélemy","Bartimée","Basile","Bastien","Baudouin","Bénigne","Benjamin","Benoît","Bérenger","Bérard","Bernard","Bertrand","Blaise","Bon","Boniface","Bouchard","Brice","Brieuc","Bruno","Brunon","Calixte","Calliste","Camélien","Camille","Camillien","Candide","Caribert","Carloman","Cassandre","Cassien","Cédric","Céleste","Célestin","Célien","Césaire","César","Charles","Charlemagne","Childebert","Chilpéric","Chrétien","Christian","Christodule","Christophe","Chrysostome","Clarence","Claude","Claudien","Cléandre","Clément","Clotaire","Côme","Constance","Constant","Constantin","Corentin","Cyprien","Cyriaque","Cyrille","Cyril","Damien","Daniel","David","Delphin","Denis","Désiré","Didier","Dieudonné","Dimitri","Dominique","Dorian","Dorothée","Edgard","Edmond","Édouard","Éleuthère","Élie","Élisée","Émeric","Émile","Émilien","Emmanuel","Enguerrand","Épiphane","Éric","Esprit","Ernest","Étienne","Eubert","Eudes","Eudoxe","Eugène","Eusèbe","Eustache","Évariste","Évrard","Fabien","Fabrice","Falba","Félicité","Félix","Ferdinand","Fiacre","Fidèle","Firmin","Flavien","Flodoard","Florent","Florentin","Florestan","Florian","Fortuné","Foulques","Francisque","François","Français","Franciscus","Francs","Frédéric","Fulbert","Fulcran","Fulgence","Gabin","Gabriel","Gaël","Garnier","Gaston","Gaspard","Gatien","Gaud","Gautier","Gédéon","Geoffro