codigo0/node_modules/tldts/dist/index.esm.min.js

3 lines
107 KiB
JavaScript
Raw Normal View History

function a(a,e){let o=0,i=a.length,s=!1;if(!e){if(a.startsWith("data:"))return null;for(;o<a.length&&a.charCodeAt(o)<=32;)o+=1;for(;i>o+1&&a.charCodeAt(i-1)<=32;)i-=1;if(47===a.charCodeAt(o)&&47===a.charCodeAt(o+1))o+=2;else{const e=a.indexOf(":/",o);if(-1!==e){const i=e-o,s=a.charCodeAt(o),n=a.charCodeAt(o+1),t=a.charCodeAt(o+2),r=a.charCodeAt(o+3),u=a.charCodeAt(o+4);if(5===i&&104===s&&116===n&&116===t&&112===r&&115===u);else if(4===i&&104===s&&116===n&&116===t&&112===r);else if(3===i&&119===s&&115===n&&115===t);else if(2===i&&119===s&&115===n);else for(let i=o;i<e;i+=1){const e=32|a.charCodeAt(i);if(!(e>=97&&e<=122||e>=48&&e<=57||46===e||45===e||43===e))return null}for(o=e+2;47===a.charCodeAt(o);)o+=1}}let e=-1,n=-1,t=-1;for(let r=o;r<i;r+=1){const o=a.charCodeAt(r);if(35===o||47===o||63===o){i=r;break}64===o?e=r:93===o?n=r:58===o?t=r:o>=65&&o<=90&&(s=!0)}if(-1!==e&&e>o&&e<i&&(o=e+1),91===a.charCodeAt(o))return-1!==n?a.slice(o+1,n).toLowerCase():null;-1!==t&&t>o&&t<i&&(i=t)}for(;i>o+1&&46===a.charCodeAt(i-1);)i-=1;const n=0!==o||i!==a.length?a.slice(o,i):a;return s?n.toLowerCase():n}function e(a){return a>=97&&a<=122||a>=48&&a<=57||a>127}function o(a){if(a.length>255)return!1;if(0===a.length)return!1;if(!e(a.charCodeAt(0))&&46!==a.charCodeAt(0)&&95!==a.charCodeAt(0))return!1;let o=-1,i=-1;const s=a.length;for(let n=0;n<s;n+=1){const s=a.charCodeAt(n);if(46===s){if(n-o>64||46===i||45===i||95===i)return!1;o=n}else if(!e(s)&&45!==s&&95!==s)return!1;i=s}return s-o-1<=63&&45!==i}const i=function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,extractHostname:i=!0,mixedInputs:s=!0,validHosts:n=null,validateHostname:t=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,extractHostname:i,mixedInputs:s,validHosts:n,validateHostname:t}}({});function s(e,s,n,t,r){const u=function(a){return void 0===a?i:function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,extractHostname:i=!0,mixedInputs:s=!0,validHosts:n=null,validateHostname:t=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,extractHostname:i,mixedInputs:s,validHosts:n,validateHostname:t}}(a)}(t);return"string"!=typeof e?r:(u.extractHostname?u.mixedInputs?r.hostname=a(e,o(e)):r.hostname=a(e,!1):r.hostname=e,u.detectIp&&null!==r.hostname&&(r.isIp=function(a){if(a.length<3)return!1;let e=a.startsWith("[")?1:0,o=a.length;if("]"===a[o-1]&&(o-=1),o-e>39)return!1;let i=!1;for(;e<o;e+=1){const o=a.charCodeAt(e);if(58===o)i=!0;else if(!(o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=90))return!1}return i}(l=r.hostname)||function(a){if(a.length<7)return!1;if(a.length>15)return!1;let e=0;for(let o=0;o<a.length;o+=1){const i=a.charCodeAt(o);if(46===i)e+=1;else if(i<48||i>57)return!1}return 3===e&&46!==a.charCodeAt(0)&&46!==a.charCodeAt(a.length-1)}(l),r.isIp)?r:u.validateHostname&&u.extractHostname&&null!==r.hostname&&!o(r.hostname)?(r.hostname=null,r):0===s||null===r.hostname?r:(n(r.hostname,u,r),2===s||null===r.publicSuffix?r:(r.domain=function(a,e,o){if(null!==o.validHosts){const a=o.validHosts;for(const o of a)if(function(a,e){return!!a.endsWith(e)&&(a.length===e.length||"."===a[a.length-e.length-1])}(e,o))return o}let i=0;if(e.startsWith("."))for(;i<e.length&&"."===e[i];)i+=1;return a.length===e.length-i?null:function(a,e){const o=a.length-e.length-2,i=a.lastIndexOf(".",o);return-1===i?a:a.slice(i+1)}(e,a)}(r.publicSuffix,r.hostname,u),3===s||null===r.domain?r:(r.subdomain=function(a,e){return e.length===a.length?"":a.slice(0,-e.length-1)}(r.hostname,r.domain),4===s||(r.domainWithoutSuffix=(m=r.domain,c=r.publicSuffix,m.slice(0,-c.length-1))),r))));var l,m,c}const n=function(){const a=[1,{}],e=[0,{city:a}];return[0,{ck:[0,{www:a}],jp:[0,{kawasaki:e,kitakyushu:e,kobe:e,nagoya:e,sapporo:e,sendai:e,yokohama:e}]}]}(),t=function(){const a=[1,{}],e=[2,{}],o=[1,{com:a,edu:a,gov:a,net:a,org:a}],i=[1,{com:a,edu:a,gov:a,mil:a,net:a,org:a}],s=[0,{"*":e}],n=[2,{s:s}],t=[0,{relay:e}],r=[2,{id:e}],u=[1,{gov:a}],l=[0,{airflow:s,"lambda-url":e,"transfer-webapp":e}],m=[0,{airflow:s,"transfer-webapp":e}],c=[0,{"transfer-webapp":e,"transfer-webapp
//# sourceMappingURL=index.esm.min.js.map