const t=2147483647,n=36,o=/^xn--/,e=/[^\0-\x7F]/,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"},s=Math.floor,i=String.fromCharCode;function f(t){throw new RangeError(c[t])}function u(t,n){const o=t.split("@");let e="";o.length>1&&(e=o[0]+"@",t=o[1]);const c=function(t,n){const o=[];let e=t.length;for(;e--;)o[e]=n(t[e]);return o}((t=t.replace(r,".")).split("."),n).join(".");return e+c}function l(t){const n=[];let o=0;const e=t.length;for(;o=55296&&r<=56319&&o=48&&t<58?t-48+26:t>=65&&t<91?t-65:t>=97&&t<123?t-97:n},d=function(t,n){return t+22+75*(t<26)-((0!=n)<<5)},h=function(t,o,e){let r=0;for(t=e?s(t/700):t>>1,t+=s(t/o);t>455;r+=n)t=s(t/35);return s(r+36*t/(t+38))},p=function(o){const e=[],r=o.length;let c=0,i=128,u=72,l=o.lastIndexOf("-");l<0&&(l=0);for(let t=0;t=128&&f("not-basic"),e.push(o.charCodeAt(t));for(let d=l>0?l+1:0;d=r&&f("invalid-input");const l=a(o.charCodeAt(d++));l>=n&&f("invalid-input"),l>s((t-c)/e)&&f("overflow"),c+=l*e;const h=i<=u?1:i>=u+26?26:i-u;if(ls(t/p)&&f("overflow"),e*=p}const p=e.length+1;u=h(c-l,p,0==l),s(c/p)>t-i&&f("overflow"),i+=s(c/p),c%=p,e.splice(c++,0,i)}return String.fromCodePoint(...e)},g=function(o){const e=[],r=(o=l(o)).length;let c=128,u=0,a=72;for(const t of o)t<128&&e.push(i(t));const p=e.length;let g=p;for(p&&e.push("-");g=c&&ts((t-u)/l)&&f("overflow"),u+=(r-c)*l,c=r;for(const v of o)if(vt&&f("overflow"),v===c){let t=u;for(let o=n;;o+=n){const r=o<=a?1:o>=a+26?26:o-a;if(t * @memberOf punycode * @type Object */ ucs2:{decode:l,encode:t=>String.fromCodePoint(...t)},decode:p,encode:g,toASCII:function(t){return u(t,function(t){return e.test(t)?"xn--"+g(t):t})},toUnicode:function(t){return u(t,function(t){return o.test(t)?p(t.slice(4).toLowerCase()):t})}};export{v as p};