TMT-Demo/assets/url.b1bd21f4.js

3 lines
10 KiB
JavaScript
Raw Normal View History

import{c as st}from"./earcut.17d42416.js";import{q as ct}from"./querystring.776b9ab3.js";var ht={exports:{}};/*! https://mths.be/punycode v1.3.2 by @mathias */(function(s,a){(function(t){var g=a&&!a.nodeType&&a,p=s&&!s.nodeType&&s,d=typeof st=="object"&&st;(d.global===d||d.window===d||d.self===d)&&(t=d);var m,h=2147483647,x=36,y=1,j=26,G=38,b=700,f=72,T=128,k="-",q=/^xn--/,Z=/[^\x20-\x7E]/,r=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=x-y,u=Math.floor,v=String.fromCharCode,z;function O(e){throw RangeError(c[e])}function I(e,o){for(var n=e.length,i=[];n--;)i[n]=o(e[n]);return i}function S(e,o){var n=e.split("@"),i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(r,".");var l=e.split("."),w=I(l,o).join(".");return i+w}function K(e){for(var o=[],n=0,i=e.length,l,w;n<i;)l=e.charCodeAt(n++),l>=55296&&l<=56319&&n<i?(w=e.charCodeAt(n++),(w&64512)==56320?o.push(((l&1023)<<10)+(w&1023)+65536):(o.push(l),n--)):o.push(l);return o}function E(e){return I(e,function(o){var n="";return o>65535&&(o-=65536,n+=v(o>>>10&1023|55296),o=56320|o&1023),n+=v(o),n}).join("")}function _(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function W(e,o){return e+22+75*(e<26)-((o!=0)<<5)}function X(e,o,n){var i=0;for(e=n?u(e/b):e>>1,e+=u(e/o);e>F*j>>1;i+=x)e=u(e/F);return u(i+(F+1)*e/(e+G))}function V(e){var o=[],n=e.length,i,l=0,w=T,C=f,M,P,D,$,A,N,U,B,J;for(M=e.lastIndexOf(k),M<0&&(M=0),P=0;P<M;++P)e.charCodeAt(P)>=128&&O("not-basic"),o.push(e.charCodeAt(P));for(D=M>0?M+1:0;D<n;){for($=l,A=1,N=x;D>=n&&O("invalid-input"),U=_(e.charCodeAt(D++)),(U>=x||U>u((h-l)/A))&&O("overflow"),l+=U*A,B=N<=C?y:N>=C+j?j:N-C,!(U<B);N+=x)J=x-B,A>u(h/J)&&O("overflow"),A*=J;i=o.length+1,C=X(l-$,i,$==0),u(l/i)>h-w&&O("overflow"),w+=u(l/i),l%=i,o.splice(l++,0,w)}return E(o)}function H(e){var o,n,i,l,w,C,M,P,D,$,A,N=[],U,B,J,tt;for(e=K(e),U=e.length,o=T,n=0,w=f,C=0;C<U;++C)A=e[C],A<128&&N.push(v(A));for(i=l=N.length,l&&N.push(k);i<U;){for(M=h,C=0;C<U;++C)A=e[C],A>=o&&A<M&&(M=A);for(B=i+1,M-o>u((h-n)/B)&&O("overflow"),n+=(M-o)*B,o=M,C=0;C<U;++C)if(A=e[C],A<o&&++n>h&&O("overflow"),A==o){for(P=n,D=x;$=D<=w?y:D>=w+j?j:D-w,!(P<$);D+=x)tt=P-$,J=x-$,N.push(v(W($+tt%J,0))),P=u(tt/J);N.push(v(W(P,0))),w=X(n,B,i==l),n=0,++i}++n,++o}return N.join("")}function ft(e){return S(e,function(o){return q.test(o)?V(o.slice(4).toLowerCase()):o})}function ut(e){return S(e,function(o){return Z.test(o)?"xn--"+H(o):o})}if(m={version:"1.3.2",ucs2:{decode:K,encode:E},decode:V,encode:H,toASCII:ut,toUnicode:ft},g&&p)if(s.exports==g)p.exports=m;else for(z in m)m.hasOwnProperty(z)&&(g[z]=m[z]);else t.punycode=m})(st)})(ht,ht.exports);var lt={isString:function(s){return typeof s=="string"},isObject:function(s){return typeof s=="object"&&s!==null},isNull:function(s){return s===null},isNullOrUndefined:function(s){return s==null}},pt=ht.exports,L=lt,Ft=Q,jt=Ot,It=qt;function R(){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 mt=/^([a-z0-9.+-]+:)/i,xt=/:[0-9]*$/,gt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,dt=["<",">",'"',"`"," ","\r",`
`," "],yt=["{","}","|","\\","^","`"].concat(dt),et=["'"].concat(yt),nt=["%","/","?",";","#"].concat(et),at=["/","?","#"],bt=255,it=/^[+a-z0-9A-Z_-]{0,63}$/,vt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ct={javascript:!0,"javascript:":!0},rt={javascript:!0,"javascript:":!0},Y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ot=ct;function Q(s,a,t){if(s&&L.isObject(s)&&s instanceof R)return s;var g=new R;return g.parse(s,a,t),g}R.prototype.parse=function(s,a,t){if(!L.isString(s))throw new TypeError("Parameter 'url' must be a string, not "+typeof s);var g=s.indexOf("?"),p=g!==-1&&g<s.indexOf("#")?"?":"#",d=s.split(p),m=/\\/g;d[0]=d[0].replace(m,"/"),s=d.join(p);var h=s;if(h=h.trim(),!t&&s.split("#").length===1){var x=gt.exec(h);if(x)return this.path=h,this.href=h,this.pathname=x[1],x[2]?(this.search=x[2],a?this.query=ot.parse(this.search.substr(1)):this.query=this.search.substr(1)):a&&(this.search="",this.query={}),this}var y=mt.exec(h);if(y){y=y[0];var j=y.toLowerCase();this.protocol=j,h=h.substr(y.length)}if(t||y||h.match(/^\/\/[^@\/]+@[^@\/]+/)){var G=h.substr(0,2)==="//";G&&!(y&&rt[y])&&(h=h.substr(2),this.slashes=!0)}if(!rt[y]&&(G||y&&!Y[y])){for(var b=-1,f=0;f<at.length;f++){var T=h.indexOf(at[f]);T!==-1&&(b===-1||T<b)&&(b=T)}var k,q;b===-1?q=h.lastIndexOf("@"):q=h.lastIndexOf("@",b),q!==-1&&(k=h.slice(0,q),h=h.slice(q+1),this.auth=decodeURIComponent(k)),b=-1;for(var f=0;f<nt.length;f++){var T=h.indexOf(nt[f]);T!==-1&&(b===-1||T<b)&&(b=T)}b===-1&&(b=h.length),this.host=h.slice(0,b),h=h.slice(b),this.parseHost(),this.hostname=this.hostname||"";var Z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Z)for(var r=this.hostname.split(/\./),f=0,c=r.length;f<c;f++){var F=r[f];if(!!F&&!F.match(it)){for(var u="",v=0,z=F.length;v<z;v++)F.charCodeAt(v)>127?u+="x":u+=F[v];if(!u.match(it)){var O=r.slice(0,f),I=r.slice(f+1),S=F.match(vt);S&&(O.push(S[1]),I.unshift(S[2])),I.length&&(h="/"+I.join(".")+h),this.hostname=O.join(".");break}}}this.hostname.length>bt?this.hostname="":this.hostname=this.hostname.toLowerCase(),Z||(this.hostname=pt.toASCII(this.hostname));var K=this.port?":"+this.port:"",E=this.hostname||"";this.host=E+K,this.href+=this.host,Z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),h[0]!=="/"&&(h="/"+h))}if(!Ct[j])for(var f=0,c=et.length;f<c;f++){var _=et[f];if(h.indexOf(_)!==-1){var W=encodeURIComponent(_);W===_&&(W=escape(_)),h=h.split(_).join(W)}}var X=h.indexOf("#");X!==-1&&(this.hash=h.substr(X),h=h.slice(0,X));var V=h.indexOf("?");if(V!==-1?(this.search=h.substr(V),this.query=h.substr(V+1),a&&(this.query=ot.parse(this.query)),h=h.slice(0,V)):a&&(this.search="",this.query={}),h&&(this.pathname=h),Y[j]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var K=this.pathname||"",H=this.search||"";this.path=K+H}return this.href=this.format(),this};function qt(s){return L.isString(s)&&(s=Q(s)),s instanceof R?s.format():R.prototype.format.call(s)}R.prototype.format=function(){var s=this.auth||"";s&&(s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@");var a=this.protocol||"",t=this.pathname||"",g=this.hash||"",p=!1,d="";this.host?p=s+this.host:this.hostname&&(p=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(p+=":"+this.port)),this.query&&L.isObject(this.query)&&Object.keys(this.query).length&&(d=ot.stringify(this.query));var m=this.search||d&&"?"+d||"";return a&&a.substr(-1)!==":"&&(a+=":"),this.slashes||(!a||Y[a])&&p!==!1?(p="//"+(p||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):p||(p=""),g&&g.charAt(0)!=="#"&&(g="#"+g),m&&m.charAt(0)!=="?"&&(m="?"+m),t=t.replace(/[?#]/g,function(h){return encodeURIComponent(h)}),m=m.replace("#","%23"),a+p+t+m+g};function Ot(s,a){return Q(s,!1,!0).resolve(a)}R.prototype.resolve=function(s){return this.resolveObject(Q(s,!1,!0)).format()};R.prototype.resolveObject=function(s){if(L.isString(s)){var a=new R;a.parse(s,!1,!0),s=a}for(var t=new R,g=Object.keys(this),p=0;p<g.length;p++){var d=g[p];t[d]=this[d]}if(t.hash=s.hash,s.href==="")return t.href=t.fo