1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[155],{827:function(t,e,n){"use strict";var r=n(828),s=n(829);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=y,e.resolve=function(t,e){return y(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?y(t,!1,!0).resolveObject(e):e},e.format=function(t){s.isString(t)&&(t=y(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),u=["%","/","?",";","#"].concat(l),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(830);function y(t,e,n){if(t&&s.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!s.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),h=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(h);c[0]=c[0].replace(/\\/g,"/");var y=t=c.join(h);if(y=y.trim(),!n&&1===t.split("#").length){var j=i.exec(y);if(j)return this.path=y,this.href=y,this.pathname=j[1],j[2]?(this.search=j[2],this.query=e?g.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var O=a.exec(y);if(O){var w=(O=O[0]).toLowerCase();this.protocol=w,y=y.substr(O.length)}if(n||O||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===y.substr(0,2);!x||O&&d[O]||(y=y.substr(2),this.slashes=!0)}if(!d[O]&&(x||O&&!b[O])){for(var C,A,I=-1,q=0;q<p.length;q++){-1!==(E=y.indexOf(p[q]))&&(-1===I||E<I)&&(I=E)}-1!==(A=-1===I?y.lastIndexOf("@"):y.lastIndexOf("@",I))&&(C=y.slice(0,A),y=y.slice(A+1),this.auth=decodeURIComponent(C)),I=-1;for(q=0;q<u.length;q++){var E;-1!==(E=y.indexOf(u[q]))&&(-1===I||E<I)&&(I=E)}-1===I&&(I=y.length),this.host=y.slice(0,I),y=y.slice(I),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var U=this.hostname.split(/\./),k=(q=0,U.length);q<k;q++){var R=U[q];if(R&&!R.match(f)){for(var _="",S=0,F=R.length;S<F;S++)R.charCodeAt(S)>127?_+="x":_+=R[S];if(!_.match(f)){var z=U.slice(0,q),H=U.slice(q+1),P=R.match(m);P&&(z.push(P[1]),H.unshift(P[2])),H.length&&(y="/"+H.join(".")+y),this.hostname=z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var V=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+V,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!v[w])for(q=0,k=l.length;q<k;q++){var L=l[q];if(-1!==y.indexOf(L)){var M=encodeURIComponent(L);M===L&&(M=escape(L)),y=y.split(L).join(M)}}var T=y.indexOf("#");-1!==T&&(this.hash=y.substr(T),y=y.slice(0,T));var J=y.indexOf("?");if(-1!==J?(this.search=y.substr(J),this.query=y.substr(J+1),e&&(this.query=g.parse(this.query)),y=y.slice(0,J)):e&&(this.search="",this.query={}),y&&(this.pathname=y),b[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){V=this.pathname||"";var K=this.search||"";this.path=V+K}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&s.isObject(this.query)&&Object.keys(this.query).length&&(a=g.stringify(this.query));var h=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||b[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):
|