Loading
function(e){"use strict";let t=0x7fffffff,n=36,r=1,i=26,s=38,a=700,o=72,l=128,u="-",c=/^xn--/,d=/[^\0-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=35,h=Math.floor,m=String.fromCharCode;function E(e){throw RangeError(f[e])}function g(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function A(e,t){let n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(_,".")).split("."),t).join(".")}function I(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(64512&r)==56320?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t}let T=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:n},S=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},y=function(e,t,r){let o=0;for(e=r?h(e/a):e>>1,e+=h(e/t);e>p*i>>1;o+=n)e=h(e/p);return h(o+(p+1)*e/(e+s))},v=function(e){let s=[],a=e.length,c=0,d=l,_=o,f=e.lastIndexOf(u);f<0&&(f=0);for(let t=0;t<f;++t)e.charCodeAt(t)>=128&&E("not-basic"),s.push(e.charCodeAt(t));for(let o=f>0?f+1:0;o<a;){let l=c;for(let s=1,l=n;;l+=n){o>=a&&E("invalid-input");let u=T(e.charCodeAt(o++));(u>=n||u>h((t-c)/s))&&E("overflow"),c+=u*s;let d=l<=_?r:l>=_+i?i:l-_;if(u<d)break;let f=n-d;s>h(t/f)&&E("overflow"),s*=f}let u=s.length+1;_=y(c-l,u,0==l),h(c/u)>t-d&&E("overflow"),d+=h(c/u),c%=u,s.splice(c++,0,d)}return String.fromCodePoint(...s)},N=function(e){let s=[],a=(e=I(e)).length,c=l,d=0,_=o;for(let t of e)t<128&&s.push(m(t));let f=s.length,p=f;for(f&&s.push(u);p<a;){let a=t;for(let t of e)t>=c&&t<a&&(a=t);let o=p+1;for(let l of(a-c>h((t-d)/o)&&E("overflow"),d+=(a-c)*o,c=a,e))if(l<c&&++d>t&&E("overflow"),l==c){let e=d;for(let t=n;;t+=n){let a=t<=_?r:t>=_+i?i:t-_;if(e<a)break;let o=e-a,l=n-a;s.push(m(S(a+o%l,0))),e=h(o/l)}s.push(m(S(e,0))),_=y(d,o,p==f),d=0,++p}++d,++c}return s.join("")},C=function(e){return A(e,function(e){return c.test(e)?v(e.slice(4).toLowerCase()):e})},R=function(e){return A(e,function(e){return d.test(e)?"xn--"+N(e):e})};e.exports={version:"2.1.0",ucs2:{decode:I,encode:e=>String.fromCodePoint(...e)},decode:v,encode:N,toASCII:R,toUnicode:C}}