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.

9 lines
184 KiB

3 years ago
  1. import{aG as commonjsGlobal}from "../assets/vendor.25fb900a.js";var mock={exports:{}};(function(module, exports){(function(x, n){module.exports=n()})(commonjsGlobal,function(){return function(l){var x={};function n(u){if(x[u])return x[u].exports;var a=x[u]={exports:{},id:u,loaded:!1};return l[u].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}return n.m=l,n.c=x,n.p="",n(0)}([function(l, x, n){var u=n(1),a=n(3),s=n(5),c=n(20),p=n(23),f=n(25),o;typeof window!="undefined"&&(o=n(27));/*!
  2. Mock - 模拟请求 & 模拟数据
  3. https://github.com/nuysoft/Mock
  4. 墨智 mozhi.gyy@taobao.com nuysoft@gmail.com
  5. */var v={Handler:u,Random:s,Util:a,XHR:o,RE:c,toJSONSchema:p,valid:f,heredoc:a.heredoc,setup:function(y){return o.setup(y)},_mocked:{}};v.version="1.0.1-beta3",o&&(o.Mock=v),v.mock=function(y,m,C){return arguments.length===1?u.gen(y):(arguments.length===2&&(C=m,m=void 0),o&&(window.XMLHttpRequest=o),v._mocked[y+(m||"")]={rurl:y,rtype:m,template:C},v)},l.exports=v},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(l,x,n){x=x==null?"":x+"",n=n||{},n={path:n.path||[Constant.GUID],templatePath:n.templatePath||[Constant.GUID++],currentContext:n.currentContext,templateCurrentContext:n.templateCurrentContext||l,root:n.root||n.currentContext,templateRoot:n.templateRoot||n.templateCurrentContext||l};var u=Parser.parse(x),a=Util.type(l),s;return Handler[a]?(s=Handler[a]({type:a,template:l,name:x,parsedName:x&&x.replace(Constant.RE_KEY,"$1"),rule:u,context:n}),n.root||(n.root=s),s):l},Handler.extend({array:function(l){var x=[],n,u;if(l.template.length===0)return x;if(l.rule.parameters)if(l.rule.min===1&&l.rule.max===void 0)l.context.path.push(l.name),l.context.templatePath.push(l.name),x=Random.pick(Handler.gen(l.template,void 0,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template})),l.context.path.pop(),l.context.templatePath.pop();else if(l.rule.parameters[2])l.template.__order_index=l.template.__order_index||0,l.context.path.push(l.name),l.context.templatePath.push(l.name),x=Handler.gen(l.template,void 0,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template})[l.template.__order_index%l.template.length],l.template.__order_index+=+l.rule.parameters[2],l.context.path.pop(),l.context.templatePath.pop();else for(n=0;n<l.rule.count;n++)for(u=0;u<l.template.length;u++)l.context.path.push(x.length),l.context.templatePath.push(u),x.push(Handler.gen(l.template[u],x.length,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template})),l.context.path.pop(),l.context.templatePath.pop();else for(n=0;n<l.template.length;n++)l.context.path.push(n),l.context.templatePath.push(n),x.push(Handler.gen(l.template[n],n,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template})),l.context.path.pop(),l.context.templatePath.pop();return x},object:function(l){var x={},n,u,a,s,c,p;if(l.rule.min!=null)for(n=Util.keys(l.template),n=Random.shuffle(n),n=n.slice(0,l.rule.count),p=0;p<n.length;p++)a=n[p],s=a.replace(Constant.RE_KEY,"$1"),l.context.path.push(s),l.context.templatePath.push(a),x[s]=Handler.gen(l.template[a],a,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template}),l.context.path.pop(),l.context.templatePath.pop();else{n=[],u=[];for(a in l.template)(typeof l.template[a]=="function"?u:n).push(a);for(n=n.concat(u),p=0;p<n.length;p++)a=n[p],s=a.replace(Constant.RE_KEY,"$1"),l.context.path.push(s),l.context.templatePath.push(a),x[s]=Handler.gen(l.template[a],a,{path:l.context.path,templatePath:l.context.templatePath,currentContext:x,templateCurrentContext:l.template,root:l.context.root||x,templateRoot:l.context.templateRoot||l.template}),l.context.path.pop(),l.context.templatePath.pop(),c=a.match(Constant.RE_KEY),c&&c[2]&&Util.type(l.template[a])==="number"&&(l.template[a]+=parseInt(c[2],10))}return x},number:function(l){var x,n;if(l.rule.decimal){for(l.template+="",n=l.template.split("."),n[0]=l.rule.range?l.rule.count:n[0],n[1]=(n[1]||"").slice(0,l.rule
  6. `?(g.seenCR||g.line++,g.column=1,g.seenCR=!1):W==="\r"||W==="\u2028"||W==="\u2029"?(g.line++,g.column=1,g.seenCR=!0):(g.column++,g.seenCR=!1)}return K!==e&&(K>e&&(K=0,s0={line:1,column:1,seenCR:!1}),t(s0,K,e),K=e),s0}function E(e){r0>r||(r>r0&&(r0=r,a0=[]),a0.push(e))}function u0(e){var t=0;for(e.sort();t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}function I(){var e,t,g,A,P;return e=r,t=J(),t!==null?(g=r,R.charCodeAt(r)===124?(A=O2,r++):(A=null,w===0&&E(F2)),A!==null?(P=I(),P!==null?(A=[A,P],g=A):(r=g,g=T)):(r=g,g=T),g===null&&(g=z),g!==null?(M=e,t=I2(t,g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T),e}function J(){var e,t,g,A,P;if(e=r,t=G(),t===null&&(t=z),t!==null)if(g=r,w++,A=B(),w--,A===null?g=z:(r=g,g=T),g!==null){for(A=[],P=$(),P===null&&(P=X());P!==null;)A.push(P),P=$(),P===null&&(P=X());A!==null?(P=Y(),P===null&&(P=z),P!==null?(M=e,t=N2(t,A,P),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T)}else r=e,e=T;else r=e,e=T;return e}function X(){var e;return e=x2(),e===null&&(e=w2(),e===null&&(e=k2())),e}function G(){var e,t;return e=r,R.charCodeAt(r)===94?(t=H0,r++):(t=null,w===0&&E(D0)),t!==null&&(M=e,t=q2()),t===null&&(r=e),e=t,e}function Y(){var e,t;return e=r,R.charCodeAt(r)===36?(t=U2,r++):(t=null,w===0&&E(j2)),t!==null&&(M=e,t=B2()),t===null&&(r=e),e=t,e}function $(){var e,t,g;return e=r,t=X(),t!==null?(g=B(),g!==null?(M=e,t=G2(t,g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T),e}function B(){var e,t,g;return w++,e=r,t=N(),t!==null?(g=m2(),g===null&&(g=z),g!==null?(M=e,t=X2(t,g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T),w--,e===null&&(t=null,w===0&&E(z2)),e}function N(){var e;return e=f2(),e===null&&(e=h2(),e===null&&(e=p2(),e===null&&(e=d2(),e===null&&(e=v2(),e===null&&(e=g2()))))),e}function f2(){var e,t,g,A,P,j;return e=r,R.charCodeAt(r)===123?(t=i0,r++):(t=null,w===0&&E(o0)),t!==null?(g=V(),g!==null?(R.charCodeAt(r)===44?(A=K2,r++):(A=null,w===0&&E(W2)),A!==null?(P=V(),P!==null?(R.charCodeAt(r)===125?(j=L0,r++):(j=null,w===0&&E(O0)),j!==null?(M=e,t=J2(g,P),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T)):(r=e,e=T)):(r=e,e=T)):(r=e,e=T),e}function h2(){var e,t,g,A;return e=r,R.charCodeAt(r)===123?(t=i0,r++):(t=null,w===0&&E(o0)),t!==null?(g=V(),g!==null?(R.substr(r,2)===F0?(A=F0,r+=2):(A=null,w===0&&E(Y2)),A!==null?(M=e,t=$2(g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T)):(r=e,e=T),e}function p2(){var e,t,g,A;return e=r,R.charCodeAt(r)===123?(t=i0,r++):(t=null,w===0&&E(o0)),t!==null?(g=V(),g!==null?(R.charCodeAt(r)===125?(A=L0,r++):(A=null,w===0&&E(O0)),A!==null?(M=e,t=V2(g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T)):(r=e,e=T),e}function d2(){var e,t;return e=r,R.charCodeAt(r)===43?(t=_2,r++):(t=null,w===0&&E(Q2)),t!==null&&(M=e,t=Z2()),t===null&&(r=e),e=t,e}function v2(){var e,t;return e=r,R.charCodeAt(r)===42?(t=e1,r++):(t=null,w===0&&E(t1)),t!==null&&(M=e,t=n1()),t===null&&(r=e),e=t,e}function g2(){var e,t;return e=r,R.charCodeAt(r)===63?(t=I0,r++):(t=null,w===0&&E(N0)),t!==null&&(M=e,t=r1()),t===null&&(r=e),e=t,e}function m2(){var e;return R.charCodeAt(r)===63?(e=I0,r++):(e=null,w===0&&E(N0)),e}function V(){var e,t,g;if(e=r,t=[],q0.test(R.charAt(r))?(g=R.charAt(r),r++):(g=null,w===0&&E(U0)),g!==null)for(;g!==null;)t.push(g),q0.test(R.charAt(r))?(g=R.charAt(r),r++):(g=null,w===0&&E(U0));else t=T;return t!==null&&(M=e,t=a1(t)),t===null&&(r=e),e=t,e}function x2(){var e,t,g,A;return e=r,R.charCodeAt(r)===40?(t=u1,r++):(t=null,w===0&&E(l1)),t!==null?(g=C2(),g===null&&(g=R2(),g===null&&(g=b2(),g===null&&(g=y2()))),g!==null?(R.charCodeAt(r)===41?(A=i1,r++):(A=null,w===0&&E(o1)),A!==null?(M=e,t=c1(g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T)):(r=e,e=T),e}function y2(){var e,t;return e=r,t=I(),t!==null&&(M=e,t=s1(t)),t===null&&(r=e),e=t,e}function b2(){var e,t,g;return e=r,R.substr(r,2)===j0?(t=j0,r+=2):(t=null,w===0&&E(f1)),t!==null?(g=I(),g!==null?(M=e,t=h1(g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T),e}function C2(){var e,t,g;return e=r,R.substr(r,2)===B0?(t=B0,r+=2):(t=null,w===0&&E(p1)),t!==null?(g=I(),g!==null?(M=e,t=d1(g),t===null&&(r=e),e=t):(r=e,e=T)):(r=e,e=T),e}function R2(){var e,t,g;return e=r,R.substr(r,2)===G0?(t=G0,r+=2)
  7. \r \v\xA0\u2028\u2029`,m={"\\w":c+p+f+"_","\\W":o.replace("_",""),"\\s":y,"\\S":function(){for(var h=v,d=0;d<y.length;d++)h=h.replace(y[d],"");return h}(),"\\d":f,"\\D":c+p+o};function C(h,d){for(var b="",k=h;k<=d;k++)b+=String.fromCharCode(k);return b}s.gen=function(h,d,b){return b=b||{guid:1},s[h.type]?s[h.type](h,d,b):s.token(h,d,b)},s.extend({token:function(h,d,b){switch(h.type){case"start":case"end":return"";case"any-character":return a.character();case"backspace":return"";case"word-boundary":return"";case"non-word-boundary":break;case"digit":return a.pick(f.split(""));case"non-digit":return a.pick((c+p+o).split(""));case"form-feed":break;case"line-feed":return h.body||h.text;case"carriage-return":break;case"white-space":return a.pick(y.split(""));case"non-white-space":return a.pick((c+p+f).split(""));case"tab":break;case"vertical-tab":break;case"word":return a.pick((c+p+f).split(""));case"non-word":return a.pick(o.replace("_","").split(""))}return h.body||h.text},alternate:function(h,d,b){return this.gen(a.boolean()?h.left:h.right,d,b)},match:function(h,d,b){d="";for(var k=0;k<h.body.length;k++)d+=this.gen(h.body[k],d,b);return d},"capture-group":function(h,d,b){return d=this.gen(h.body,d,b),b[b.guid++]=d,d},"non-capture-group":function(h,d,b){return this.gen(h.body,d,b)},"positive-lookahead":function(h,d,b){return this.gen(h.body,d,b)},"negative-lookahead":function(h,d,b){return""},quantified:function(h,d,b){d="";for(var k=this.quantifier(h.quantifier),H=0;H<k;H++)d+=this.gen(h.body,d,b);return d},quantifier:function(h,d,b){var k=Math.max(h.min,0),H=isFinite(h.max)?h.max:k+a.integer(3,7);return a.integer(k,H)},charset:function(h,d,b){if(h.invert)return this["invert-charset"](h,d,b);var k=a.pick(h.body);return this.gen(k,d,b)},"invert-charset":function(h,d,b){for(var k=v,H=0,O;H<h.body.length;H++)switch(O=h.body[H],O.type){case"literal":k=k.replace(O.body,"");break;case"range":for(var S=this.gen(O.start,d,b).charCodeAt(),D=this.gen(O.end,d,b).charCodeAt(),q=S;q<=D;q++)k=k.replace(String.fromCharCode(q),"");default:var R=m[O.text];if(R)for(var L=0;L<=R.length;L++)k=k.replace(R[L],"")}return a.pick(k.split(""))},range:function(h,d,b){var k=this.gen(h.start,d,b).charCodeAt(),H=this.gen(h.end,d,b).charCodeAt();return String.fromCharCode(a.integer(k,H))},literal:function(h,d,b){return h.escaped?h.body:h.text},unicode:function(h,d,b){return String.fromCharCode(parseInt(h.code,16))},hex:function(h,d,b){return String.fromCharCode(parseInt(h.code,16))},octal:function(h,d,b){return String.fromCharCode(parseInt(h.code,8))},"back-reference":function(h,d,b){return b[h.code]||""},CONTROL_CHARACTER_MAP:function(){for(var h="@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ] ^ _".split(" "),d=`\0       \x07 \b
  8. \v \f \r                  `.split(" "),b={},k=0;k<h.length;k++)b[h[k]]=d[k];return b}(),"control-character":function(h,d,b){return this.CONTROL_CHARACTER_MAP[h.code]}}),l.exports=s},function(l,x,n){l.exports=n(24)},function(l,x,n){var u=n(2),a=n(3),s=n(4);function c(p,f,o){o=o||[];var v={name:typeof f=="string"?f.replace(u.RE_KEY,"$1"):f,template:p,type:a.type(p),rule:s.parse(f)};switch(v.path=o.slice(0),v.path.push(f===void 0?"ROOT":v.name),v.type){case"array":v.items=[],a.each(p,function(y,m){v.items.push(c(y,m,v.path))});break;case"object":v.properties=[],a.each(p,function(y,m){v.properties.push(c(y,m,v.path))});break}return v}l.exports=c},function(l,x,n){l.exports=n(26)},function(l,x,n){var u=n(2),a=n(3),s=n(23);function c(o,v){for(var y=s(o),m=p.diff(y,v),C=0;C<m.length;C++);return m}var p={diff:function(v,y,m){var C=[];return this.name(v,y,m,C)&&this.type(v,y,m,C)&&(this.value(v,y,m,C),this.properties(v,y,m,C),this.items(v,y,m,C)),C},name:function(o,v,y,m){var C=m.length;return f.equal("name",o.path,y+"",o.name+"",m),m.length===C},type:function(o,v,y,m){var C=m.length;switch(o.type){case"string":if(o.template.match(u.RE_PLACEHOLDER))return!0;break;case"array":if(o.rule.parameters&&(o.rule.min!==void 0&&o.rule.max===void 0&&o.rule.count===1||o.rule.parameters[2]))return!0;break;case"function":return!0}return f.equal("type",o.path,a.type(v),o.type,m),m.length===C},value:function(o,v,y,m){var C=m.length,h=o.rule,d=o.type;if(d==="object"||d==="array"||d==="function")return!0;if(!h.parameters){switch(d){case"regexp":return f.match("value",o.path,v,o.template,m),m.length===C;case"string":if(o.template.match(u.RE_PLACEHOLDER))return m.length===C;break}return f.equal("value",o.path,v,o.template,m),m.length===C}var b;switch(d){case"number":var k=(v+"").split(".");k[0]=+k[0],h.min!==void 0&&h.max!==void 0&&(f.greaterThanOrEqualTo("value",o.path,k[0],Math.min(h.min,h.max),m),f.lessThanOrEqualTo("value",o.path,k[0],Math.max(h.min,h.max),m)),h.min!==void 0&&h.max===void 0&&f.equal("value",o.path,k[0],h.min,m,"[value] "+y),h.decimal&&(h.dmin!==void 0&&h.dmax!==void 0&&(f.greaterThanOrEqualTo("value",o.path,k[1].length,h.dmin,m),f.lessThanOrEqualTo("value",o.path,k[1].length,h.dmax,m)),h.dmin!==void 0&&h.dmax===void 0&&f.equal("value",o.path,k[1].length,h.dmin,m));break;case"boolean":break;case"string":b=v.match(new RegExp(o.template,"g")),b=b?b.length:0,h.min!==void 0&&h.max!==void 0&&(f.greaterThanOrEqualTo("repeat count",o.path,b,h.min,m),f.lessThanOrEqualTo("repeat count",o.path,b,h.max,m)),h.min!==void 0&&h.max===void 0&&f.equal("repeat count",o.path,b,h.min,m);break;case"regexp":b=v.match(new RegExp(o.template.source.replace(/^\^|\$$/g,""),"g")),b=b?b.length:0,h.min!==void 0&&h.max!==void 0&&(f.greaterThanOrEqualTo("repeat count",o.path,b,h.min,m),f.lessThanOrEqualTo("repeat count",o.path,b,h.max,m)),h.min!==void 0&&h.max===void 0&&f.equal("repeat count",o.path,b,h.min,m);break}return m.length===C},properties:function(o,v,y,m){var C=m.length,h=o.rule,d=a.keys(v);if(!!o.properties){if(o.rule.parameters?(h.min!==void 0&&h.max!==void 0&&(f.greaterThanOrEqualTo("properties length",o.path,d.length,Math.min(h.min,h.max),m),f.lessThanOrEqualTo("properties length",o.path,d.length,Math.max(h.min,h.max),m)),h.min!==void 0&&h.max===void 0&&h.count!==1&&f.equal("properties length",o.path,d.length,h.min,m)):f.equal("properties length",o.path,d.length,o.properties.length,m),m.length!==C)return!1;for(var b=0;b<d.length;b++)m.push.apply(m,this.diff(function(){var k;return a.each(o.properties,function(H){H.name===d[b]&&(k=H)}),k||o.properties[b]}(),v[d[b]],d[b]));return m.length===C}},items:function(o,v,y,m){var C=m.length;if(!!o.items){var h=o.rule;if(!o.rule.parameters)f.equal("items length",o.path,v.length,o.items.length,m);else{if(h.min!==void 0&&h.max!==void 0&&(f.greaterThanOrEqualTo("items",o.path,v.length,Math.min(h.min,h.max)*o.items.length,m,"[{utype}] array is too short: {path} must have at least {expected} elements but instance has {actual} elements"),f.lessThanOrEqualTo("items",o.path,v.length,Math.max(h.min
  9. `);return h},overrideMimeType:function(){},responseType:"",response:null,responseText:"",responseXML:null}),u.extend(o.prototype,{addEventListener:function(h,d){var b=this.custom.events;b[h]||(b[h]=[]),b[h].push(d)},removeEventListener:function(h,d){for(var b=this.custom.events[h]||[],k=0;k<b.length;k++)b[k]===d&&b.splice(k--,1)},dispatchEvent:function(h){for(var d=this.custom.events[h.type]||[],b=0;b<d.length;b++)d[b].call(this,h);var k="on"+h.type;this[k]&&this[k](h)}});function v(){var C=function(){var b=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,k=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,H=location.href,O=k.exec(H.toLowerCase())||[];return b.test(O[1])}();return window.ActiveXObject?!C&&h()||d():h();function h(){try{return new window._XMLHttpRequest}catch{}}function d(){try{return new window._ActiveXObject("Microsoft.XMLHTTP")}catch{}}}function y(C){for(var h in o.Mock._mocked){var d=o.Mock._mocked[h];if((!d.rurl||b(d.rurl,C.url))&&(!d.rtype||b(d.rtype,C.type.toLowerCase())))return d}function b(k,H){if(u.type(k)==="string")return k===H;if(u.type(k)==="regexp")return k.test(H)}}function m(C,h){return u.isFunction(C.template)?C.template(h):o.Mock.mock(C.template)}l.exports=o}])})})(mock);var Mock=mock.exports;export{Mock as M};