简单记录一下Mock数据运行成功。
1.最基础的HTML+jQuery,如何运行Mock数据
- 新建一个文件夹,用于存放mock.min.js文件和mustache.min.js文件,(压缩文件)
代码自取⬇️
mock.min.js
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Mock=e():t.Mock=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r,a=n(1),o=n(3),u=n(5),l=n(20),i=n(23),s=n(25);"undefined"!=typeof window&&(r=n(27));/*!
Mock - 模拟请求 & 模拟数据
https://github.com/nuysoft/Mock
墨智 mozhi.gyy@taobao.com nuysoft@gmail.com
*/
var c={Handler:a,Random:u,Util:o,XHR:r,RE:l,toJSONSchema:i,valid:s,heredoc:o.heredoc,setup:function(t){return r.setup(t)},_mocked:{}};c.version="1.0.0-beta2",r&&(r.Mock=c),c.mock=function(t,e,n){return 1===arguments.length?a.gen(t):(2===arguments.length&&(n=e,e=void 0),r&&(window.XMLHttpRequest=r),c._mocked[t+(e||"")]={rurl:t,rtype:e,template:n},c)},t.exports=c},function(module,exports,__webpack_require__){var Constant=__webpack_require__(2),Util=__webpack_require__(3),Parser=__webpack_require__(4),Random=__webpack_require__(5),RE=__webpack_require__(20),Handler={extend:Util.extend};Handler.gen=function(t,e,n){e=void 0==e?"":e+"",n=n||{},n={path:n.path||[Constant.GUID],templatePath:n.templatePath||[Constant.GUID++],currentContext:n.currentContext,templateCurrentContext:n.templateCurrentContext||t,root:n.root||n.currentContext,templateRoot:n.templateRoot||n.templateCurrentContext||t};var r,a=Parser.parse(e),o=Util.type(t);return Handler[o]?(r=Handler[o]({type:o,template:t,name:e,parsedName:e?e.replace(Constant.RE_KEY,"$1"):e,rule:a,context:n}),n.root||(n.root=r),r):t},Handler.extend({array:function(t){var e,n,r=[];if(0===t.template.length)return r;if(t.rule.parameters)if(1===t.rule.min&&void 0===t.rule.max)t.context.path.push(t.name),t.context.templatePath.push(t.name),r=Random.pick(Handler.gen(t.template,void 0,{path:t.context.path,templatePath:t.context.templatePath,currentContext:r,templateCurrentContext:t.template,root:t.context.root||r,templateRoot:t.context.templateRoot||t.template})),t.context.path.pop(),t.context.templatePath.pop();else if(t.rule.parameters[2])t.template.__order_index=t.template.__order_index||0,t.context.path.push(t.name),t.context.templatePath.push(t.name),r=Handler.gen(t.template,void 0,{path:t.context.path,templatePath:t.context.templatePath,currentContext:r,templateCurrentContext:t.template,root:t.context.root||r,templateRoot:t.context.templateRoot||t.template})[t.template.__order_index%t.template.length],t.template.__order_index+=+t.rule.parameters[2],t.context.path.pop(),t.context.templatePath.pop();else for(e=0;e<t.rule.count;e++)for(n=0;n<t.template.length;n++)t.context.path.push(r.length),t.context.templatePath.push(n),r.push(Handler.gen(t.template[n],r.length,{path:t.context.path,templatePath:t.context.templatePath,currentContext:r,templateCurrentContext:t.template,root:t.context.root||r,templateRoot:t.context.templateRoot||t.template})),t.context.path.pop(),t.context.templatePath.pop();else for(e=0;e<t.template.length;e++)t.context.path.push(e),t.context.templatePath.push(e),r.push(Handler.gen(t.template[e],e,{path:t.context.path,templatePath:t.context.templatePath,currentContext:r,templateCurrentContext:t.template,root:t.context.root||r,templateRoot:t.context.templateRoot||t.template})),t.context.path.pop(),t.context.templatePath.pop();return r},object:function(t){var e,n,r,a,o,u,l={};if(void 0!=t.rule.min)for(e=Util.keys(t.template),e=Random.shuffle(e),e=e.slice(0,t.rule.count),u=0;u<e.length;u++)r=e[u],a=r.replace(Constant.RE_KEY,"$1"),t.context.path.push(a),t.context.templatePath.push(r),l[a]=Handler.gen(t.template[r],r,{path:t.context.path,templatePath:t.context.templatePath,currentContext:l,templateCurrentContext:t.template,root:t.context.root||l,templateRoot:t.context.templateRoot||t.template}),t.context.path.pop(),t.context.templatePath.pop();else{e=[],n=[];for(r in t.template)("function"==typeof t.template[r]?n:e).push(r);for(e=e.concat(n),u=0;u<e.length;u++)r=e[u],a=r.replace(Constant.RE_KEY,"$1"),t.context.path.push(a),t.context.templatePath.push(r),l[a]=Handler.gen(t.template[r],r,{path:t.context.path,templatePath:t.context.templatePath,currentContext:l,templateCurrentContext:t.template,root:t.context.root||l,templateRoot:t.context.templateRoot||t.template}),t.context.path.pop(),t.context.templatePath.pop(),o=r.match(Constant.RE_KEY),o&&o[2]&&"number"===Util.type(t.template[r])&&(t.template[r]+=parseInt(o[2],10))}return l},number:function(t){var e,n;if(t.rule.decimal){for(t.template+="",n=t.template.split("."),n[0]=t.rule.range?t.rule.count:n[0],n[1]=(n[1]||"").slice(0,t.rule.dcount);n[1].length<t.rule.dcount;)n[1]+=n[1].length<t.rule.dcount-1?Random.character("number"):Random.character("123456789");e=parseFloat(n.join("."),10)}else e=t.rule.range&&!t.rule.parameters[2]?t.rule.count:t.template;return e},"boolean":function(t){var e;return e=t.rule.parameters?Random.bool(t.rule.min,t.rule.max,t.template):t.template},string:function(t){var e,n,r,a,o="";if(t.template.length){for(void 0==t.rule.count&&(o+=t.template),e=0;e<t.rule.count;e++)o+=t.template;for(n=o.match(Constant.RE_PLACEHOLDER)||[],e=0;e<n.length;e++)if(r=n[e],/^\\/.test(r))n.splice(e--,1);else{if(a=Handler.placeholder(r,t.context.currentContext,t.context.templateCurrentContext,t),1===n.length&&r===o&&typeof a!=typeof o){o=a;break}o=o.replace(r,a)}}else o=t.rule.range?Random.string(t.rule.count):t.template;return o},"function":function(t){return t.template.call(t.context.currentContext,t)},regexp:function(t){for(var e=t.template.source,n=0;n<t.rule.count;n++)e+=t.template.source;return RE.Handler.gen(RE.Parser.parse(e))}}),Handler.extend({_all:function(){var t={};for(var e in Random)t[e.toLowerCase()]=e;return t},placeholder:function(placeholder,obj,templateContext,options){Constant.RE_PLACEHOLDER.exec("");var parts=Constant.RE_PLACEHOLDER.exec(placeholder),key=parts&&parts[1],lkey=key&&key.toLowerCase(),okey=this._all()[lkey],params=parts&&parts[2]||"",pathParts=this.splitPathToArray(key);try{params=eval("(function(){ return [].splice.call(arguments, 0 ) })("+params+")")}catch(error){params=parts[2].split(/,\s*/)}if(obj&&key in obj)return obj[key];if("/"===key.charAt(0)||pathParts.length>1)return this.getValueByKeyPath(key,options);if(templateContext&&"object"==typeof templateContext&&key in templateContext&&placeholder!==templateContext[key])return templateContext[key]=Handler.gen(templateContext[key],key,{currentContext:obj,templateCurrentContext:templateContext}),templateContext[key];if(!(key in Random||lkey in Random||okey in Random))return placeholder;for(var i=0;i<params.length;i++)Constant.RE_PLACEHOLDER.exec(""),Constant.RE_PLACEHOLDER.test(params[i])&&(params[i]=Handler.placeholder(params[i],obj,templateContext,options));var handle=Random[key]||Random[lkey]||Random[okey];switch(Util.type(handle)){case"array":return Random.pick(handle);case"function":handle.options=options;var re=handle.apply(Random,params);return void 0===re&&(re=""),delete handle.options,re}},getValueByKeyPath:function(t,e){var n=t,r=this.splitPathToArray(t),a=[];"/"===t.charAt(0)?a=[e.context.path[0]].concat(this.normalizePath(r)):r.length>1&&(a=e.context.path.slice(0),a.pop(),a=this.normalizePath(a.concat(r))),t=r[r.length-1];for(var o=e.context.root,u=e.context.templateRoot,l=1;l<a.length-1;l++)o=o[a[l]],u=u[a[l]];return o&&t in o?o[t]:u&&"object"==typeof u&&t in u&&n!==u[t]?(u[t]=Handler.gen(u[t],t,{currentContext:o,templateCurrentContext:u}),u[t]):void 0},normalizePath:function(t){for(var e=[],n=0;n<t.length;n++)switch(t[n]){case"..":e.pop();break;case".":break;default:e.push(t[n])}return e},splitPathToArray:function(t){var e=t.split(/\/+/);return e[e.length-1]||(e=e.slice(0,-1)),e[0]||(e=e.slice(1)),e}}),module.exports=Handler},function(t,e){t.exports={GUID:1,RE_KEY:/(.+)\|(?:\+(\d+)|([\+\-]?\d+-?[\+\-]?\d*)?(?:\.(\d+-?\d*))?)/,RE_RANGE:/([\+\-]?\d+)-?([\+\-]?\d+)?/,RE_PLACEHOLDER:/\\*@([^@#%&()\?\s]+)(?:\((.*?)\))?/g}},function(t,e){var n={};n.extend=function(){var t,e,r,a,o,u=arguments[0]||{},l=1,i=arguments.length;for(1===i&&(u=this,l=0);i>l;l++)if(t=arguments[l])for(e in t)r=u[e],a=t[e],u!==a&&void 0!==a&&(n.isArray(a)||n.isObject(a)?(n.isArray(a)&&(o=r&&n.isArray(r)?r:[]),n.isObject(a)&&(o=r&&n.isObject(r)?r:{}),u[e]=n.extend(o,a)):u[e]=a);return u},n.each=function(t,e,n){var r,a;if("number"===this.type(t))for(r=0;t>r;r++)e(r,r);else if(t.length===+t.length)for(r=0;r<t.length&&e.call(n,t[r],r,t)!==!1;r++);else for(a in t)if(e.call(n,t[a],a,t)===!1)break},n.type=function(t){return null===t||void 0===t?String(t):Object.prototype.toString.call(t).match(/\[object (\w+)\]/)[1].toLowerCase()},n.each("String Object Array RegExp Function".split(" "),function(t){n["is"+t]=function(e){return n.type(e)===t.toLowerCase()}}),n.isObjectOrArray=function(t){return n.isObject(t)||n.isArray(t)},n.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},n.keys=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},n.values=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e},n.heredoc=function(t){return t.toString().replace(/^[^\/]+\/\*!?/,"").replace(/\*\/[^\/]+$/,"").replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")},n.noop=function(){},t.exports=n},function(t,e,n){var r=n(2),a=n(5);t.exports={parse:function(t){t=void 0==t?"":t+"";var e=(t||"").match(r.RE_KEY),n=e&&e[3]&&e[3].match(r.RE_RANGE),o=n&&n[1]&&parseInt(n[1],10),u=n&&n[2]&&parseInt(n[2],10),l=n?n[2]?a.integer(o,u):parseInt(n[1],10):void 0,i=e&&e[4]&&e[4].match(r.RE_RANGE),s=i&&parseInt(i[1],10),c=i&&parseInt(i[2],10),h=i?!i[2]&&parseInt(i[1],10)||a.integer(s,c):void 0,p={parameters:e,range:n,min:o,max:u,count:l,decimal:i,dmin:s,dmax:c,dcount:h};for(var f in p)if(void 0!=p[f])return p;return{}}}},function(t,e,n){var r=n(3),a={extend:r.extend};a.extend(n(6)),a.extend(n(7)),a.extend(n(8)),a.extend(n(10)),a.extend(n(13)),a.extend(n(15)),a.extend(n(16)),a.extend(n(17)),a.extend(n(14)),a.extend(n(19)),t.exports=a},function(t,e){t.exports={"boolean":function(t,e,n){return void 0!==n?(t="undefined"==typeof t||isNaN(t)?1:parseInt(t,10),e="undefined"==typeof e||isNaN(e)?1:parseInt(e,10),Math.random()>1/(t+e)*t?!n:n):Math.random()>=.5},bool:function(t,e,n){return this["boolean"](t,e,n)},natural:function(t,e){return t="undefined"!=typeof t?parseInt(t,10):0,e="undefined"!=typeof e?parseInt(e,10):9007199254740992,Math.round(Math.random()*(e-t))+t},integer:function(t,e){return t="undefined"!=typeof t?parseInt(t,10):-9007199254740992,e="undefined"!=typeof e?parseInt(e,10):9007199254740992,Math.round(Math.random()*(e-t))+t},"int":function(t,e){return this.integer(t,e)},"float":function(t,e,n,r){n=void 0===n?0:n,n=Math.max(Math.min(n,17),0),r=void 0===r?17:r,r=Math.max(Math.min(r,17),0);for(var a=this.integer(t,e)+".",o=0,u=this.natural(n,r);u>o;o++)a+=u-1>o?this.character("number"):this.character("123456789");return parseFloat(a,10)},character:function(t){var e={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",number:"0123456789",symbol:"!@#$%^&*()[]"};return e.alpha=e.lower+e.upper,e.undefined=e.lower+e.upper+e.number+e.symbol,t=e[(""+t).toLowerCase()]||t,t.charAt(this.natural(0,t.length-1))},"char":function(t){return this.character(t)},string:function(t,e,n){var r;switch(arguments.length){case 0:r=this.natural(3,7);break;case 1:r=t,t=void 0;break;case 2:"string"==typeof arguments[0]?r=e:(r=this.natural(t,e),t=void 0);break;case 3:r=this.natural(e,n)}for(var a="",o=0;r>o;o++)a+=this.character(t);return a},str:function(){return this.string.apply(this,arguments)},range:function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1,t=+t,e=+e,n=+n;for(var r=Math.max(Math.ceil((e-t)/n),0),a=0,o=new Array(r);r>a;)o[a++]=t,t+=n;return o}}},function(t,e){var n={yyyy:"getFullYear",yy:function(t){return(""+t.getFullYear()).slice(2)},y:"yy",MM:function(t){var e=t.getMonth()+1;return 10>e?"0"+e:e},M:function(t){return t.getMonth()+1},dd:function(t){var e=t.getDate();return 10>e?"0"+e:e},d:"getDate",HH:function(t){var e=t.getHours();return 10>e?"0"+e:e},H:"getHours",hh:function(t){var e=t.getHours()%12;return 10>e?"0"+e:e},h:function(t){return t.getHours()%12},mm:function(t){var e=t.getMinutes();return 10>e?"0"+e:e},m:"getMinutes",ss:function(t){var e=t.getSeconds();return 10>e?"0"+e:e},s:"getSeconds",SS:function(t){var e=t.getMilliseconds();return 10>e&&"00"+e||100>e&&"0"+e||e},S:"getMilliseconds",A:function(t){return t.getHours()<12?"AM":"PM"},a:function(t){return t.getHours()<12?"am":"pm"},T:"getTime"};t.exports={_patternLetters:n,_rformat:new RegExp(function(){var t=[];for(var e in n)t.push(e);return"("+t.join("|")+")"}(),"g"),_formatDate:function(t,e){return e.replace(this._rformat,function r(e,a){return"function"==typeof n[a]?n[a](t):n[a]in n?r(e,n[a]):t[n[a]]()})},_randomDate:function(t,e){return t=void 0===t?new Date(0):t,e=void 0===e?new Date:e,new Date(Math.random()*(e.getTime()-t.getTime()))},date:function(t){return t=t||"yyyy-MM-dd",this._formatDate(this._randomDate(),t)},time:function(t){return t=t||"HH:mm:ss",this._formatDate(this._randomDate(),t)},datetime:function(t){return t=t||"yyyy-MM-dd HH:mm:ss",this._formatDate(this._randomDate(),t)},now:function(t,e){1===arguments.length&&(/year|month|day|hour|minute|second|week/.test(t)||(e=t,t="")),t=(t||"").toLowerCase(),e=e||"yyyy-MM-dd HH:mm:ss";var n=new Date;switch(t){case"year":n.setMonth(0);case"month":n.setDate(1);case"week":case"day":n.setHours(0);case"hour":n.setMinutes(0);case"minute":n.setSeconds(0);case"second":n.setMilliseconds(0)}switch(t){case"week":n.setDate(n.getDate()-n.getDay())}return this._formatDate(n,e)}}},function(t,e,n){(function(t){t.exports={_adSize:["300x250","250x250","240x400","336x280","180x150","720x300","468x60","234x60","88x31","120x90","120x60","120x240","125x125","728x90","160x600","120x600","300x600"],_screenSize:["320x200","320x240","640x480","800x480","800x480","1024x600","1024x768","1280x800","1440x900","1920x1200","2560x1600"],_videoSize:["720x480","768x576","1280x720","1920x1080"],image:function(t,e,n,r,a){return 4===arguments.length&&(a=r,r=void 0),3===arguments.length&&(a=n,n=void 0),t||(t=this.pick(this._adSize)),e&&~e.indexOf("#")&&(e=e.slice(1)),n&&~n.indexOf("#")&&(n=n.slice(1)),"http://dummyimage.com/"+t+(e?"/"+e:"")+(n?"/"+n:"")+(r?"."+r:"")+(a?"&text="+a:"")},img:function(){return this.image.apply(this,arguments)},_brandColors:{"4ormat":"#fb0a2a","500px":"#02adea","About.me (blue)":"#00405d","About.me (yellow)":"#ffcc33",Addvocate:"#ff6138",Adobe:"#ff0000",Aim:"#fcd20b",Amazon:"#e47911",Android:"#a4c639","Angie's List":"#7fbb00",AOL:"#0060a3",Atlassian:"#003366",Behance:"#053eff","Big Cartel":"#97b538",bitly:"#ee6123",Blogger:"#fc4f08",Boeing:"#0039a6","Booking.com":"#003580",Carbonmade:"#613854",Cheddar:"#ff7243","Code School":"#3d4944",Delicious:"#205cc0",Dell:"#3287c1",Designmoo:"#e54a4f",Deviantart:"#4e6252","Designer News":"#2d72da",Devour:"#fd0001",DEWALT:"#febd17","Disqus (blue)":"#59a3fc","Disqus (orange)":"#db7132",Dribbble:"#ea4c89",Dropbox:"#3d9ae8",Drupal:"#0c76ab",Dunked:"#2a323a",eBay:"#89c507",Ember:"#f05e1b",Engadget:"#00bdf6",Envato:"#528036",Etsy:"#eb6d20",Evernote:"#5ba525","Fab.com":"#dd0017",Facebook:"#3b5998",Firefox:"#e66000","Flickr (blue)":"#0063dc","Flickr (pink)":"#ff0084",Forrst:"#5b9a68",Foursquare:"#25a0ca",Garmin:"#007cc3",GetGlue:"#2d75a2",Gimmebar:"#f70078",GitHub:"#171515","Google Blue":"#0140ca","Google Green":"#16a61e","Google Red":"#dd1812","Google Yellow":"#fcca03","Google+":"#dd4b39",Grooveshark:"#f77f00",Groupon:"#82b548","Hacker News":"#ff6600",HelloWallet:"#0085ca","Heroku (light)":"#c7c5e6","Heroku (dark)":"#6567a5",HootSuite:"#003366",Houzz:"#73ba37",HTML5:"#ec6231",IKEA:"#ffcc33",IMDb:"#f3ce13",Instagram:"#3f729b",Intel:"#0071c5",Intuit:"#365ebf",Kickstarter:"#76cc1e",kippt:"#e03500",Kodery:"#00af81",LastFM:"#c3000d",LinkedIn:"#0e76a8",Livestream:"#cf0005",Lumo:"#576396",Mixpanel:"#a086d3",Meetup:"#e51937",Nokia:"#183693",NVIDIA:"#76b900",Opera:"#cc0f16",Path:"#e41f11","PayPal (dark)":"#1e477a","PayPal (light)":"#3b7bbf",Pinboard:"#0000e6",Pinterest:"#c8232c",PlayStation:"#665cbe",Pocket:"#ee4056",Prezi:"#318bff",Pusha:"#0f71b4",Quora:"#a82400","QUOTE.fm":"#66ceff",Rdio:"#008fd5",Readability:"#9c0000","Red Hat":"#cc0000",Resource:"#7eb400",Rockpack:"#0ba6ab",Roon:"#62b0d9",RSS:"#ee802f",Salesforce:"#1798c1",Samsung:"#0c4da2",Shopify:"#96bf48",Skype:"#00aff0",Snagajob:"#f47a20",Softonic:"#008ace",SoundCloud:"#ff7700","Space Box":"#f86960",Spotify:"#81b71a",Sprint:"#fee100",Squarespace:"#121212",StackOverflow:"#ef8236",Staples:"#cc0000","Status Chart":"#d7584f",Stripe:"#008cdd",StudyBlue:"#00afe1",StumbleUpon:"#f74425","T-Mobile":"#ea0a8e",Technorati:"#40a800","The Next Web":"#ef4423",Treehouse:"#5cb868",Trulia:"#5eab1f",Tumblr:"#34526f","Twitch.tv":"#6441a5",Twitter:"#00acee",TYPO3:"#ff8700",Ubuntu:"#dd4814",Ustream:"#3388ff",Verizon:"#ef1d1d",Vimeo:"#86c9ef",Vine:"#00a478",Virb:"#06afd8","Virgin Media":"#cc0000",Wooga:"#5b009c","WordPress (blue)":"#21759b","WordPress (orange)":"#d54e21","WordPress (grey)":"#464646",Wunderlist:"#2b88d9",XBOX:"#9bc848",XING:"#126567","Yahoo!":"#720e9e",Yandex:"#ffcc00",Yelp:"#c41200",YouTube:"#c4302b",Zalongo:"#5498dc",Zendesk:"#78a300",Zerply:"#9dcc7a",Zootool:"#5e8b1d"},_brandNames:function(){var t=[];for(var e in this._brandColors)t.push(e);return t},dataImage:function(e,n){var r;if("undefined"!=typeof document)r=document.createElement("canvas");else{var a=t.require("canvas");r=new a}var o=r&&r.getContext&&r.getContext("2d");if(!r||!o)return"";e||(e=this.pick(this._adSize)),n=void 0!==n?n:e,e=e.split("x");var u=parseInt(e[0],10),l=parseInt(e[1],10),i=this._brandColors[this.pick(this._brandNames())],s="#FFF",c=14,h="sans-serif";return r.width=u,r.height=l,o.textAlign="center",o.textBaseline="middle",o.fillStyle=i,o.fillRect(0,0,u,l),o.fillStyle=s,o.font="bold "+c+"px "+h,o.fillText(n,u/2,l/2,u),r.toDataURL("image/png")}}}).call(e,n(9)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){var r=n(11),a=n(12);t.exports={color:function(t){return t||a[t]?a[t].nicer:this.hex()},hex:function(){var t=this._goldenRatioColor(),e=r.hsv2rgb(t),n=r.rgb2hex(e[0],e[1],e[2]);return n},rgb:function(){var t=this._goldenRatioColor(),e=r.hsv2rgb(t);return"rgb("+parseInt(e[0],10)+", "+parseInt(e[1],10)+", "+parseInt(e[2],10)+")"},rgba:function(){var t=this._goldenRatioColor(),e=r.hsv2rgb(t);return"rgba("+parseInt(e[0],10)+", "+parseInt(e[1],10)+", "+parseInt(e[2],10)+", "+Math.random().toFixed(2)+")"},hsl:function(){var t=this._goldenRatioColor(),e=r.hsv2hsl(t);return"hsl("+parseInt(e[0],10)+", "+parseInt(e[1],10)+", "+parseInt(e[2],10)+")"},_goldenRatioColor:function(t,e){return this._goldenRatio=.618033988749895,this._hue=this._hue||Math.random(),this._hue+=this._goldenRatio,this._hue%=1,"number"!=typeof t&&(t=.5),"number"!=typeof e&&(e=.95),[360*this._hue,100*t,100*e]}}},function(t,e){t.exports={rgb2hsl:function(t){var e,n,r,a=t[0]/255,o=t[1]/255,u=t[2]/255,l=Math.min(a,o,u),i=Math.max(a,o,u),s=i-l;return i==l?e=0:a==i?e=(o-u)/s:o==i?e=2+(u-a)/s:u==i&&(e=4+(a-o)/s),e=Math.min(60*e,360),0>e&&(e+=360),r=(l+i)/2,n=i==l?0:.5>=r?s/(i+l):s/(2-i-l),[e,100*n,100*r]},rgb2hsv:function(t){var e,n,r,a=t[0],o=t[1],u=t[2],l=Math.min(a,o,u),i=Math.max(a,o,u),s=i-l;return n=0===i?0:s/i*1e3/10,i==l?e=0:a==i?e=(o-u)/s:o==i?e=2+(u-a)/s:u==i&&(e=4+(a-o)/s),e=Math.min(60*e,360),0>e&&(e+=360),r=i/255*1e3/10,[e,n,r]},hsl2rgb:function(t){var e,n,r,a,o,u=t[0]/360,l=t[1]/100,i=t[2]/100;if(0===l)return o=255*i,[o,o,o];n=.5>i?i*(1+l):i+l-i*l,e=2*i-n,a=[0,0,0];for(var s=0;3>s;s++)r=u+1/3*-(s-1),0>r&&r++,r>1&&r--,o=1>6*r?e+6*(n-e)*r:1>2*r?n:2>3*r?e+(n-e)*(2/3-r)*6:e,a[s]=255*o;return a},hsl2hsv:function(t){var e,n,r=t[0],a=t[1]/100,o=t[2]/100;return o*=2,a*=1>=o?o:2-o,n=(o+a)/2,e=2*a/(o+a),[r,100*e,100*n]},hsv2rgb:function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),u=255*r*(1-n),l=255*r*(1-n*o),i=255*r*(1-n*(1-o));switch(r=255*r,a){case 0:return[r,i,u];case 1:return[l,r,u];case 2:return[u,r,i];case 3:return[u,l,r];case 4:return[i,u,r];case 5:return[r,u,l]}},hsv2hsl:function(t){var e,n,r=t[0],a=t[1]/100,o=t[2]/100;return n=(2-a)*o,e=a*o,e/=1>=n?n:2-n,n/=2,[r,100*e,100*n]},rgb2hex:function(t,e,n){return"#"+((256+t<<8|e)<<8|n).toString(16).slice(1)},hex2rgb:function(t){return t="0x"+t.slice(1).replace(t.length>4?t:/./g,"$&$&")|0,[t>>16,t>>8&255,255&t]}}},function(t,e){t.exports={navy:{value:"#000080",nicer:"#001F3F"},blue:{value:"#0000ff",nicer:"#0074D9"},aqua:{value:"#00ffff",nicer:"#7FDBFF"},teal:{value:"#008080",nicer:"#39CCCC"},olive:{value:"#008000",nicer:"#3D9970"},green:{value:"#008000",nicer:"#2ECC40"},lime:{value:"#00ff00",nicer:"#01FF70"},yellow:{value:"#ffff00",nicer:"#FFDC00"},orange:{value:"#ffa500",nicer:"#FF851B"},red:{value:"#ff0000",nicer:"#FF4136"},maroon:{value:"#800000",nicer:"#85144B"},fuchsia:{value:"#ff00ff",nicer:"#F012BE"},purple:{value:"#800080",nicer:"#B10DC9"},silver:{value:"#c0c0c0",nicer:"#DDDDDD"},gray:{value:"#808080",nicer:"#AAAAAA"},black:{value:"#000000",nicer:"#111111"},white:{value:"#FFFFFF",nicer:"#FFFFFF"}}},function(t,e,n){function r(t,e,n,r){return void 0===n?a.natural(t,e):void 0===r?n:a.natural(parseInt(n,10),parseInt(r,10))}var a=n(6),o=n(14);t.exports={paragraph:function(t,e){for(var n=r(3,7,t,e),a=[],o=0;n>o;o++)a.push(this.sentence());return a.join(" ")},cparagraph:function(t,e){for(var n=r(3,7,t,e),a=[],o=0;n>o;o++)a.push(this.csentence());return a.join("")},sentence:function(t,e){for(var n=r(12,18,t,e),a=[],u=0;n>u;u++)a.push(this.word());return o.capitalize(a.join(" "))+"."},csentence:function(t,e){for(var n=r(12,18,t,e),a=[],o=0;n>o;o++)a.push(this.cword());return a.join("")+"。"},word:function(t,e){for(var n=r(3,10,t,e),o="",u=0;n>u;u++)o+=a.character("lower");return o},cword:function(t,e,n){var r,a="的一是在不了有和人这中大为上个国我以要他时来用们生到作地于出就分对成会可主发年动同工也能下过子说产种面而方后多定行学法所民得经十三之进着等部度家电力里如水化高自二理起小物现实加量都两体制机当使点从业本去把性好应开它合还因由其些然前外天政四日那社义事平形相全表间样与关各重新线内数正心反你明看原又么利比或但质气第向道命此变条只没结解问意建月公无系军很情者最立代想已通并提直题党程展五果料象员革位入常文总次品式活设及管特件长求老头基资边流路级少图山统接知较将组见计别她手角期根论运农指几九区强放决西被干做必战先回则任取据处队南给色光门即保治北造百规热领七海口东导器压志世金增争济阶油思术极交受联什认六共权收证改清己美再采转更单风切打白教速花带安场身车例真务具万每目至达走积示议声报斗完类八离华名确才科张信马节话米整空元况今集温传土许步群广石记需段研界拉林律叫且究观越织装影算低持音众书布复容儿须际商非验连断深难近矿千周委素技备半办青省列习响约支般史感劳便团往酸历市克何除消构府称太准精值号率族维划选标写存候毛亲快效斯院查江型眼王按格养易置派层片始却专状育厂京识适属圆包火住调满县局照参红细引听该铁价严龙飞";switch(arguments.length){case 0:t=a,r=1;break;case 1:"string"==typeof arguments[0]?r=1:(r=t,t=a);break;case 2:"string"==typeof arguments[0]?r=e:(r=this.natural(t,e),t=a);break;case 3:r=this.natural(e,n)}for(var o="",u=0;r>u;u++)o+=t.charAt(this.natural(0,t.length-1));return o},title:function(t,e){for(var n=r(3,7,t,e),a=[],o=0;n>o;o++)a.push(this.capitalize(this.word()));return a.join(" ")},ctitle:function(t,e){for(var n=r(3,7,t,e),a=[],o=0;n>o;o++)a.push(this.cword());return a.join("")}}},function(t,e){t.exports={capitalize:function(t){return(t+"").charAt(0).toUpperCase()+(t+"").substr(1)},upper:function(t){return(t+"").toUpperCase()},lower:function(t){return(t+"").toLowerCase()},pick:function(t,e,n){switch(t=t||[],arguments.length){case 1:return t[this.natural(0,t.length-1)];case 2:n=e;case 3:return this.shuffle(t,e,n)}},shuffle:function(t,e,n){t=t||[];for(var r=t.slice(0),a=[],o=0,u=r.length,l=0;u>l;l++)o=this.natural(0,r.length-1),a.push(r[o]),r.splice(o,1);switch(arguments.length){case 0:case 1:return a;case 2:n=e;case 3:return e=parseInt(e,10),n=parseInt(n,10),a.slice(0,this.natural(e,n))}},order:function n(t){n.cache=n.cache||{},arguments.length>1&&(t=[].slice.call(arguments,0));var e=n.options,r=e.context.templatePath.join("."),a=n.cache[r]=n.cache[r]||{index:0,array:t};return a.array[a.index++%a.array.length]}}},function(t,e){t.exports={first:function(){var t=["James","John","Robert","Michael","William","David","Richard","Charles","Joseph","Thomas","Christopher","Daniel","Paul","Mark","Donald","George","Kenneth","Steven","Edward","Brian","Ronald","Anthony","Kevin","Jason","Matthew","Gary","Timothy","Jose","Larry","Jeffrey","Frank","Scott","Eric"].concat(["Mary","Patricia","Linda","Barbara","Elizabeth","Jennifer","Maria","Susan","Margaret","Dorothy","Lisa","Nancy","Karen","Betty","Helen","Sandra","Donna","Carol","Ruth","Sharon","Michelle","Laura","Sarah","Kimberly","Deborah","Jessica","Shirley","Cynthia","Angela","Melissa","Brenda","Amy","Anna"]);return this.pick(t)},last:function(){var t=["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen"];return this.pick(t)},name:function(t){return this.first()+" "+(t?this.first()+" ":"")+this.last()},cfirst:function(){var t="王 李 张 刘 陈 杨 赵 黄 周 吴 徐 孙 胡 朱 高 林 何 郭 马 罗 梁 宋 郑 谢 韩 唐 冯 于 董 萧 程 曹 袁 邓 许 傅 沈 曾 彭 吕 苏 卢 蒋 蔡 贾 丁 魏 薛 叶 阎 余 潘 杜 戴 夏 锺 汪 田 任 姜 范 方 石 姚 谭 廖 邹 熊 金 陆 郝 孔 白 崔 康 毛 邱 秦 江 史 顾 侯 邵 孟 龙 万 段 雷 钱 汤 尹 黎 易 常 武 乔 贺 赖 龚 文".split(" ");return this.pick(t)},clast:function(){var t="伟 芳 娜 秀英 敏 静 丽 强 磊 军 洋 勇 艳 杰 娟 涛 明 超 秀兰 霞 平 刚 桂英".split(" ");return this.pick(t)},cname:function(){return this.cfirst()+this.clast()}}},function(t,e){t.exports={url:function(t,e){return(t||this.protocol())+"://"+(e||this.domain())+"/"+this.word()},protocol:function(){return this.pick("http ftp gopher mailto mid cid news nntp prospero telnet rlogin tn3270 wais".split(" "))},domain:function(t){return this.word()+"."+(t||this.tld())},tld:function(){return this.pick("com net org edu gov int mil cn com.cn net.cn gov.cn org.cn 中国 中国互联.公司 中国互联.网络 tel biz cc tv info name hk mobi asia cd travel pro museum coop aero ad ae af ag ai al am an ao aq ar as at au aw az ba bb bd be bf bg bh bi bj bm bn bo br bs bt bv bw by bz ca cc cf cg ch ci ck cl cm cn co cq cr cu cv cx cy cz de dj dk dm do dz ec ee eg eh es et ev fi fj fk fm fo fr ga gb gd ge gf gh gi gl gm gn gp gr gt gu gw gy hk hm hn hr ht hu id ie il in io iq ir is it 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 mg mh ml mm mn mo mp mq mr ms mt mv mw mx my mz na nc ne nf ng ni nl no np nr nt nu nz om qa pa pe pf pg ph pk pl pm pn pr pt pw py re ro ru rw sa sb sc sd se sg sh si sj sk sl sm sn so sr st su sy sz tc td tf tg th tj tk tm tn to tp tr tt tv tw tz ua ug uk us uy va vc ve vg vn vu wf ws ye yu za zm zr zw".split(" "))},email:function(t){return this.character("lower")+"."+this.word()+"@"+(t||this.word()+"."+this.tld())},ip:function(){return this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)}}},function(t,e,n){var r=n(18),a=["东北","华北","华东","华中","华南","西南","西北"];t.exports={region:function(){return this.pick(a)},province:function(){return this.pick(r).name},city:function(t){var e=this.pick(r),n=this.pick(e.children);return t?[e.name,n.name].join(" "):n.name},county:function(t){var e=this.pick(r),n=this.pick(e.children),a=this.pick(n.children)||{name:"-"};return t?[e.name,n.name,a.name].join(" "):a.name},zip:function(t)