next
Version:
The React Framework
1 lines • 8.61 kB
JavaScript
module.exports=(()=>{"use strict";var t={406:(t,s,h)=>{var e=h(213);var o=h(838);s.parse=urlParse;s.resolve=urlResolve;s.resolveObject=urlResolveObject;s.format=urlFormat;s.Url=Url;function Url(){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}var i=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,n=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(f),p=["%","/","?",";","#"].concat(l),u=["/","?","#"],c=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:true,"javascript:":true},O={javascript:true,"javascript:":true},d={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},j=h(191);function urlParse(t,s,h){if(t&&o.isObject(t)&&t instanceof Url)return t;var e=new Url;e.parse(t,s,h);return e}Url.prototype.parse=function(t,s,h){if(!o.isString(t)){throw new TypeError("Parameter 'url' must be a string, not "+typeof t)}var r=t.indexOf("?"),a=r!==-1&&r<t.indexOf("#")?"?":"#",f=t.split(a),y=/\\/g;f[0]=f[0].replace(y,"/");t=f.join(a);var x=t;x=x.trim();if(!h&&t.split("#").length===1){var _=n.exec(x);if(_){this.path=x;this.href=x;this.pathname=_[1];if(_[2]){this.search=_[2];if(s){this.query=j.parse(this.search.substr(1))}else{this.query=this.search.substr(1)}}else if(s){this.search="";this.query={}}return this}}var g=i.exec(x);if(g){g=g[0];var U=g.toLowerCase();this.protocol=U;x=x.substr(g.length)}if(h||g||x.match(/^\/\/[^@\/]+@[^@\/]+/)){var A=x.substr(0,2)==="//";if(A&&!(g&&O[g])){x=x.substr(2);this.slashes=true}}if(!O[g]&&(A||g&&!d[g])){var q=-1;for(var w=0;w<u.length;w++){var k=x.indexOf(u[w]);if(k!==-1&&(q===-1||k<q))q=k}var C,I;if(q===-1){I=x.lastIndexOf("@")}else{I=x.lastIndexOf("@",q)}if(I!==-1){C=x.slice(0,I);x=x.slice(I+1);this.auth=decodeURIComponent(C)}q=-1;for(var w=0;w<p.length;w++){var k=x.indexOf(p[w]);if(k!==-1&&(q===-1||k<q))q=k}if(q===-1)q=x.length;this.host=x.slice(0,q);x=x.slice(q);this.parseHost();this.hostname=this.hostname||"";var R=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!R){var N=this.hostname.split(/\./);for(var w=0,$=N.length;w<$;w++){var z=N[w];if(!z)continue;if(!z.match(m)){var F="";for(var H=0,L=z.length;H<L;H++){if(z.charCodeAt(H)>127){F+="x"}else{F+=z[H]}}if(!F.match(m)){var Z=N.slice(0,w);var E=N.slice(w+1);var T=z.match(v);if(T){Z.push(T[1]);E.unshift(T[2])}if(E.length){x="/"+E.join(".")+x}this.hostname=Z.join(".");break}}}}if(this.hostname.length>c){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!R){this.hostname=e.toASCII(this.hostname)}var B=this.port?":"+this.port:"";var D=this.hostname||"";this.host=D+B;this.href+=this.host;if(R){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(x[0]!=="/"){x="/"+x}}}if(!b[U]){for(var w=0,$=l.length;w<$;w++){var G=l[w];if(x.indexOf(G)===-1)continue;var J=encodeURIComponent(G);if(J===G){J=escape(G)}x=x.split(G).join(J)}}var K=x.indexOf("#");if(K!==-1){this.hash=x.substr(K);x=x.slice(0,K)}var M=x.indexOf("?");if(M!==-1){this.search=x.substr(M);this.query=x.substr(M+1);if(s){this.query=j.parse(this.query)}x=x.slice(0,M)}else if(s){this.search="";this.query={}}if(x)this.pathname=x;if(d[U]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var B=this.pathname||"";var V=this.search||"";this.path=B+V}this.href=this.format();return this};function urlFormat(t){if(o.isString(t))t=urlParse(t);if(!(t instanceof Url))return Url.prototype.format.call(t);return t.format()}Url.prototype.format=function(){var t=this.auth||"";if(t){t=encodeURIComponent(t);t=t.replace(/%3A/i,":");t+="@"}var s=this.protocol||"",h=this.pathname||"",e=this.hash||"",i=false,r="";if(this.host){i=t+this.host}else if(this.hostname){i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){i+=":"+this.port}}if(this.query&&o.isObject(this.query)&&Object.keys(this.query).length){r=j.stringify(this.query)}var n=this.search||r&&"?"+r||"";if(s&&s.substr(-1)!==":")s+=":";if(this.slashes||(!s||d[s])&&i!==false){i="//"+(i||"");if(h&&h.charAt(0)!=="/")h="/"+h}else if(!i){i=""}if(e&&e.charAt(0)!=="#")e="#"+e;if(n&&n.charAt(0)!=="?")n="?"+n;h=h.replace(/[?#]/g,function(t){return encodeURIComponent(t)});n=n.replace("#","%23");return s+i+h+n+e};function urlResolve(t,s){return urlParse(t,false,true).resolve(s)}Url.prototype.resolve=function(t){return this.resolveObject(urlParse(t,false,true)).format()};function urlResolveObject(t,s){if(!t)return s;return urlParse(t,false,true).resolveObject(s)}Url.prototype.resolveObject=function(t){if(o.isString(t)){var s=new Url;s.parse(t,false,true);t=s}var h=new Url;var e=Object.keys(this);for(var i=0;i<e.length;i++){var r=e[i];h[r]=this[r]}h.hash=t.hash;if(t.href===""){h.href=h.format();return h}if(t.slashes&&!t.protocol){var n=Object.keys(t);for(var a=0;a<n.length;a++){var f=n[a];if(f!=="protocol")h[f]=t[f]}if(d[h.protocol]&&h.hostname&&!h.pathname){h.path=h.pathname="/"}h.href=h.format();return h}if(t.protocol&&t.protocol!==h.protocol){if(!d[t.protocol]){var l=Object.keys(t);for(var p=0;p<l.length;p++){var u=l[p];h[u]=t[u]}h.href=h.format();return h}h.protocol=t.protocol;if(!t.host&&!O[t.protocol]){var c=(t.pathname||"").split("/");while(c.length&&!(t.host=c.shift()));if(!t.host)t.host="";if(!t.hostname)t.hostname="";if(c[0]!=="")c.unshift("");if(c.length<2)c.unshift("");h.pathname=c.join("/")}else{h.pathname=t.pathname}h.search=t.search;h.query=t.query;h.host=t.host||"";h.auth=t.auth;h.hostname=t.hostname||t.host;h.port=t.port;if(h.pathname||h.search){var m=h.pathname||"";var v=h.search||"";h.path=m+v}h.slashes=h.slashes||t.slashes;h.href=h.format();return h}var b=h.pathname&&h.pathname.charAt(0)==="/",j=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=j||b||h.host&&t.pathname,x=y,_=h.pathname&&h.pathname.split("/")||[],c=t.pathname&&t.pathname.split("/")||[],g=h.protocol&&!d[h.protocol];if(g){h.hostname="";h.port=null;if(h.host){if(_[0]==="")_[0]=h.host;else _.unshift(h.host)}h.host="";if(t.protocol){t.hostname=null;t.port=null;if(t.host){if(c[0]==="")c[0]=t.host;else c.unshift(t.host)}t.host=null}y=y&&(c[0]===""||_[0]==="")}if(j){h.host=t.host||t.host===""?t.host:h.host;h.hostname=t.hostname||t.hostname===""?t.hostname:h.hostname;h.search=t.search;h.query=t.query;_=c}else if(c.length){if(!_)_=[];_.pop();_=_.concat(c);h.search=t.search;h.query=t.query}else if(!o.isNullOrUndefined(t.search)){if(g){h.hostname=h.host=_.shift();var U=h.host&&h.host.indexOf("@")>0?h.host.split("@"):false;if(U){h.auth=U.shift();h.host=h.hostname=U.shift()}}h.search=t.search;h.query=t.query;if(!o.isNull(h.pathname)||!o.isNull(h.search)){h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")}h.href=h.format();return h}if(!_.length){h.pathname=null;if(h.search){h.path="/"+h.search}else{h.path=null}h.href=h.format();return h}var A=_.slice(-1)[0];var q=(h.host||t.host||_.length>1)&&(A==="."||A==="..")||A==="";var w=0;for(var k=_.length;k>=0;k--){A=_[k];if(A==="."){_.splice(k,1)}else if(A===".."){_.splice(k,1);w++}else if(w){_.splice(k,1);w--}}if(!y&&!x){for(;w--;w){_.unshift("..")}}if(y&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")){_.unshift("")}if(q&&_.join("/").substr(-1)!=="/"){_.push("")}var C=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(g){h.hostname=h.host=C?"":_.length?_.shift():"";var U=h.host&&h.host.indexOf("@")>0?h.host.split("@"):false;if(U){h.auth=U.shift();h.host=h.hostname=U.shift()}}y=y||h.host&&_.length;if(y&&!C){_.unshift("")}if(!_.length){h.pathname=null;h.path=null}else{h.pathname=_.join("/")}if(!o.isNull(h.pathname)||!o.isNull(h.search)){h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")}h.auth=t.auth||h.auth;h.slashes=h.slashes||t.slashes;h.href=h.format();return h};Url.prototype.parseHost=function(){var t=this.host;var s=r.exec(t);if(s){s=s[0];if(s!==":"){this.port=s.substr(1)}t=t.substr(0,t.length-s.length)}if(t)this.hostname=t}},838:t=>{t.exports={isString:function(t){return typeof t==="string"},isObject:function(t){return typeof t==="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}}},213:t=>{t.exports=require("punycode")},191:t=>{t.exports=require("querystring")}};var s={};function __nccwpck_require__(h){if(s[h]){return s[h].exports}var e=s[h]={exports:{}};var o=true;try{t[h](e,e.exports,__nccwpck_require__);o=false}finally{if(o)delete s[h]}return e.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(406)})();