dootask/public/js/build/punycode.50f384b0.js

2 lines
2.5 KiB
JavaScript
Vendored

import{b as L}from"./@babel.43d8d0a5.js";const C=2147483647,l=36,m=1,v=26,q=38,N=700,k=72,j=128,B="-",U=/^xn--/,V=/[^\0-\x7F]/,$=/[\x2E\u3002\uFF0E\uFF61]/g,z={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-m,f=Math.floor,F=String.fromCharCode;function p(e){throw new RangeError(z[e])}function R(e,t){const n=[];let o=e.length;for(;o--;)n[o]=t(e[o]);return n}function D(e,t){const n=e.split("@");let o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace($,".");const c=e.split("."),s=R(c,t).join(".");return o+s}function I(e){const t=[];let n=0;const o=e.length;for(;n<o;){const c=e.charCodeAt(n++);if(c>=55296&&c<=56319&&n<o){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((c&1023)<<10)+(s&1023)+65536):(t.push(c),n--)}else t.push(c)}return t}const O=e=>String.fromCodePoint(...e),G=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:l},T=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},_=function(e,t,n){let o=0;for(e=n?f(e/N):e>>1,e+=f(e/t);e>w*v>>1;o+=l)e=f(e/w);return f(o+(w+1)*e/(e+q))},A=function(e){const t=[],n=e.length;let o=0,c=j,s=k,a=e.lastIndexOf(B);a<0&&(a=0);for(let r=0;r<a;++r)e.charCodeAt(r)>=128&&p("not-basic"),t.push(e.charCodeAt(r));for(let r=a>0?a+1:0;r<n;){const i=o;for(let u=1,d=l;;d+=l){r>=n&&p("invalid-input");const h=G(e.charCodeAt(r++));h>=l&&p("invalid-input"),h>f((C-o)/u)&&p("overflow"),o+=h*u;const g=d<=s?m:d>=s+v?v:d-s;if(h<g)break;const b=l-g;u>f(C/b)&&p("overflow"),u*=b}const x=t.length+1;s=_(o-i,x,i==0),f(o/x)>C-c&&p("overflow"),c+=f(o/x),o%=x,t.splice(o++,0,c)}return String.fromCodePoint(...t)},S=function(e){const t=[];e=I(e);const n=e.length;let o=j,c=0,s=k;for(const i of e)i<128&&t.push(F(i));const a=t.length;let r=a;for(a&&t.push(B);r<n;){let i=C;for(const u of e)u>=o&&u<i&&(i=u);const x=r+1;i-o>f((C-c)/x)&&p("overflow"),c+=(i-o)*x,o=i;for(const u of e)if(u<o&&++c>C&&p("overflow"),u===o){let d=c;for(let h=l;;h+=l){const g=h<=s?m:h>=s+v?v:h-s;if(d<g)break;const b=d-g,M=l-g;t.push(F(T(g+b%M,0))),d=f(b/M)}t.push(F(T(d,0))),s=_(c,x,r===a),c=0,++r}++c,++o}return t.join("")},y=function(e){return D(e,function(t){return U.test(t)?A(t.slice(4).toLowerCase()):t})},E=function(e){return D(e,function(t){return V.test(t)?"xn--"+S(t):t})},H={version:"2.3.1",ucs2:{decode:I,encode:O},decode:A,encode:S,toASCII:E,toUnicode:y};var J=Object.freeze(Object.defineProperty({__proto__:null,ucs2decode:I,ucs2encode:O,decode:A,encode:S,toASCII:E,toUnicode:y,default:H},Symbol.toStringTag,{value:"Module"})),Q=L(J);export{Q as r};