tldts-core 7.5.6 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/index.js +579 -141
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/src/extract-hostname.js +222 -92
  4. package/dist/cjs/src/extract-hostname.js.map +1 -1
  5. package/dist/cjs/src/factory.js +25 -1
  6. package/dist/cjs/src/factory.js.map +1 -1
  7. package/dist/cjs/src/ip-mapping.js +19 -0
  8. package/dist/cjs/src/ip-mapping.js.map +1 -0
  9. package/dist/cjs/src/is-ip.js +305 -44
  10. package/dist/cjs/src/is-ip.js.map +1 -1
  11. package/dist/cjs/src/is-valid.js +11 -4
  12. package/dist/cjs/src/is-valid.js.map +1 -1
  13. package/dist/cjs/src/options.js +2 -1
  14. package/dist/cjs/src/options.js.map +1 -1
  15. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  16. package/dist/es6/src/extract-hostname.js +221 -91
  17. package/dist/es6/src/extract-hostname.js.map +1 -1
  18. package/dist/es6/src/factory.js +26 -2
  19. package/dist/es6/src/factory.js.map +1 -1
  20. package/dist/es6/src/ip-mapping.js +16 -0
  21. package/dist/es6/src/ip-mapping.js.map +1 -0
  22. package/dist/es6/src/is-ip.js +305 -44
  23. package/dist/es6/src/is-ip.js.map +1 -1
  24. package/dist/es6/src/is-valid.js +11 -4
  25. package/dist/es6/src/is-valid.js.map +1 -1
  26. package/dist/es6/src/options.js +2 -1
  27. package/dist/es6/src/options.js.map +1 -1
  28. package/dist/es6/tsconfig.bundle.tsbuildinfo +1 -1
  29. package/dist/types/src/extract-hostname.d.ts +1 -0
  30. package/dist/types/src/ip-mapping.d.ts +4 -0
  31. package/dist/types/src/is-ip.d.ts +13 -4
  32. package/dist/types/src/options.d.ts +1 -1
  33. package/package.json +2 -2
  34. package/src/extract-hostname.ts +253 -91
  35. package/src/factory.ts +36 -4
  36. package/src/ip-mapping.ts +15 -0
  37. package/src/is-ip.ts +336 -48
  38. package/src/is-valid.ts +12 -4
  39. package/src/options.ts +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/domain.ts","../../src/domain-without-suffix.ts","../../src/extract-hostname.ts","../../src/is-ip.ts","../../src/is-special-use.ts","../../src/is-valid.ts","../../src/lookup/extra-suffixes.ts","../../src/options.ts","../../src/subdomain.ts","../../src/factory.ts","../../src/lookup/fast-path.ts"],"sourcesContent":["import { IOptions } from './options';\n\n/**\n * Check if `vhost` is a valid suffix of `hostname` (top-domain)\n *\n * It means that `vhost` needs to be a suffix of `hostname` and we then need to\n * make sure that: either they are equal, or the character preceding `vhost` in\n * `hostname` is a '.' (it should not be a partial label).\n *\n * * hostname = 'not.evil.com' and vhost = 'vil.com' => not ok\n * * hostname = 'not.evil.com' and vhost = 'evil.com' => ok\n * * hostname = 'not.evil.com' and vhost = 'not.evil.com' => ok\n */\nexport function shareSameDomainSuffix(\n hostname: string,\n vhost: string,\n): boolean {\n if (hostname.endsWith(vhost)) {\n return (\n hostname.length === vhost.length ||\n hostname[hostname.length - vhost.length - 1] === '.'\n );\n }\n\n return false;\n}\n\n/**\n * Given a hostname and its public suffix, extract the general domain.\n */\nfunction extractDomainWithSuffix(\n hostname: string,\n publicSuffix: string,\n): string {\n // Locate the index of the last '.' in the part of the `hostname` preceding\n // the public suffix.\n //\n // examples:\n // 1. not.evil.co.uk => evil.co.uk\n // ^ ^\n // | | start of public suffix\n // | index of the last dot\n //\n // 2. example.co.uk => example.co.uk\n // ^ ^\n // | | start of public suffix\n // |\n // | (-1) no dot found before the public suffix\n const publicSuffixIndex = hostname.length - publicSuffix.length - 2;\n const lastDotBeforeSuffixIndex = hostname.lastIndexOf('.', publicSuffixIndex);\n\n // No '.' found, then `hostname` is the general domain (no sub-domain)\n if (lastDotBeforeSuffixIndex === -1) {\n return hostname;\n }\n\n // Extract the part between the last '.'\n return hostname.slice(lastDotBeforeSuffixIndex + 1);\n}\n\n/**\n * Detects the domain based on rules and upon and a host string\n */\nexport default function getDomain(\n suffix: string,\n hostname: string,\n options: IOptions,\n): string | null {\n // Check if `hostname` ends with a member of `validHosts`.\n if (options.validHosts !== null) {\n const validHosts = options.validHosts;\n for (const vhost of validHosts) {\n if (/*@__INLINE__*/ shareSameDomainSuffix(hostname, vhost)) {\n return vhost;\n }\n }\n }\n\n let numberOfLeadingDots = 0;\n if (hostname.startsWith('.')) {\n while (\n numberOfLeadingDots < hostname.length &&\n hostname[numberOfLeadingDots] === '.'\n ) {\n numberOfLeadingDots += 1;\n }\n }\n\n // If `hostname` is a valid public suffix, then there is no domain to return.\n // Since we already know that `getPublicSuffix` returns a suffix of `hostname`\n // there is no need to perform a string comparison and we only compare the\n // size.\n if (suffix.length === hostname.length - numberOfLeadingDots) {\n return null;\n }\n\n // To extract the general domain, we start by identifying the public suffix\n // (if any), then consider the domain to be the public suffix with one added\n // level of depth. (e.g.: if hostname is `not.evil.co.uk` and public suffix:\n // `co.uk`, then we take one more level: `evil`, giving the final result:\n // `evil.co.uk`).\n return /*@__INLINE__*/ extractDomainWithSuffix(hostname, suffix);\n}\n","/**\n * Return the part of domain without suffix.\n *\n * Example: for domain 'foo.com', the result would be 'foo'.\n */\nexport default function getDomainWithoutSuffix(\n domain: string,\n suffix: string,\n): string {\n // Note: here `domain` and `suffix` cannot have the same length because in\n // this case we set `domain` to `null` instead. It is thus safe to assume\n // that `suffix` is shorter than `domain`.\n return domain.slice(0, -suffix.length - 1);\n}\n","/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// complex authority — userinfo/port/brackets/trailing-dot/control — an invalid\n// host, or a non-main return path); `parseImpl` then validates as usual. The\n// fast path can only ever SKIP a redundant scan for hosts already known valid,\n// never accept an invalid one.\nexport let extractedHostnameValidated = false;\n\n/**\n * True if char `code` is a valid hostname character. This is the per-char half\n * of `is-valid.ts`'s `isValidAscii` (a-z, 0-9, > U+007F) PLUS three additions:\n * A-Z (the host is lowercased before validation, so uppercase ≡ a valid\n * lowercase letter) and '-' / '_' (valid inside a label). KEEP IN SYNC with\n * `is-valid.ts`: these rules are deliberately duplicated to validate during\n * extraction, so any change to the accepted character set there must be\n * mirrored here (and vice-versa).\n */\nfunction isValidHostnameChar(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || // a-z\n (code >= 48 && code <= 57) || // 0-9\n code > 127 || // non-ASCII (accepted, not punycode-checked)\n (code >= 65 && code <= 90) || // A-Z (becomes valid once lowercased)\n code === 45 || // '-'\n code === 95 // '_'\n );\n}\n\n/**\n * Classify scheme `url.slice(schemeStart, colonIndex)` as a WHATWG special\n * scheme without allocating a substring (case-insensitive via `| 32`).\n * Special schemes: ftp, file, http, https, ws, wss\n * (https://url.spec.whatwg.org/#special-scheme).\n *\n * @returns 0 = not special, 1 = special, 2 = file (its host sits only between\n * \"//\" and the next slash).\n */\nfunction getSpecialScheme(\n url: string,\n schemeStart: number,\n colonIndex: number,\n): number {\n const length = colonIndex - schemeStart;\n const c0 = url.charCodeAt(schemeStart) | 32;\n if (length === 2) {\n return c0 === 119 && (url.charCodeAt(schemeStart + 1) | 32) === 115 ? 1 : 0; // ws\n } else if (length === 3) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n if (c0 === 119 && c1 === 115 && c2 === 115) return 1; // wss\n if (c0 === 102 && c1 === 116 && c2 === 112) return 1; // ftp\n return 0;\n } else if (length === 4) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n const c3 = url.charCodeAt(schemeStart + 3) | 32;\n if (c0 === 104 && c1 === 116 && c2 === 116 && c3 === 112) return 1; // http\n if (c0 === 102 && c1 === 105 && c2 === 108 && c3 === 101) return 2; // file\n return 0;\n } else if (length === 5) {\n return c0 === 104 &&\n (url.charCodeAt(schemeStart + 1) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 2) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 3) | 32) === 112 &&\n (url.charCodeAt(schemeStart + 4) | 32) === 115\n ? 1\n : 0; // https\n }\n return 0;\n}\n\n/**\n * Extract a hostname from `url`, matching a WHATWG URL parser's host-boundary\n * behaviour (https://url.spec.whatwg.org/#concept-basic-url-parser) for tldts'\n * scope. It deliberately does NOT normalise the host (no IDNA/punycode or IPv4\n * canonicalisation; IPv6 brackets are stripped, not compressed), strips trailing\n * dots, and stays lenient where a strict parser rejects (bare host:port,\n * out-of-range port, user@host) — all documented deviations.\n *\n * @param urlIsValidHostname - when true, `url` is already a valid hostname and is\n * returned by the same reference (factory.ts skips re-validation on that\n * identity), keeping the common path allocation-free.\n * @param validate - when true, validate the host inline during the authority\n * scan and publish the verdict via `extractedHostnameValidated` so `parseImpl`\n * can skip the redundant `isValidHostname` pass for simple authorities.\n */\nexport default function extractHostname(\n url: string,\n urlIsValidHostname: boolean,\n validate = false,\n): string | null {\n let start = 0;\n let end: number = url.length;\n let hasUpper = false;\n let isSpecial = true; // '\\' ends the host, unless non-special \"scheme://\"\n extractedHostnameValidated = false;\n\n if (!urlIsValidHostname) {\n // WHATWG step 1: trim leading/trailing C0 control or space (<= U+0020).\n // Tab/newline elsewhere are handled lazily below.\n while (start < url.length && url.charCodeAt(start) <= 32) {\n start += 1;\n }\n\n // \"data:\"/\"javascript:\" never reach a host (inline payload; data URLs may be\n // huge). `| 32` lowercases letters only; tab/newline is re-parsed below.\n if (\n (url.charCodeAt(start + 4) === 58 /* ':' */ &&\n (url.charCodeAt(start) | 32) === 100 /* d */ &&\n (url.charCodeAt(start + 1) | 32) === 97 /* a */ &&\n (url.charCodeAt(start + 2) | 32) === 116 /* t */ &&\n (url.charCodeAt(start + 3) | 32) === 97) /* a */ ||\n (url.charCodeAt(start + 10) === 58 /* ':' */ &&\n (url.charCodeAt(start) | 32) === 106 /* j */ &&\n (url.charCodeAt(start + 1) | 32) === 97 /* a */ &&\n (url.charCodeAt(start + 2) | 32) === 118 /* v */ &&\n (url.charCodeAt(start + 3) | 32) === 97 /* a */ &&\n (url.charCodeAt(start + 4) | 32) === 115 /* s */ &&\n (url.charCodeAt(start + 5) | 32) === 99 /* c */ &&\n (url.charCodeAt(start + 6) | 32) === 114 /* r */ &&\n (url.charCodeAt(start + 7) | 32) === 105 /* i */ &&\n (url.charCodeAt(start + 8) | 32) === 112 /* p */ &&\n (url.charCodeAt(start + 9) | 32) === 116) /* t */\n ) {\n return null;\n }\n\n while (end > start + 1 && url.charCodeAt(end - 1) <= 32) {\n end -= 1;\n }\n\n if (\n (url.charCodeAt(start) === 47 /* '/' */ ||\n url.charCodeAt(start) === 92) /* '\\' */ &&\n (url.charCodeAt(start + 1) === 47 /* '/' */ ||\n url.charCodeAt(start + 1) === 92) /* '\\' */\n ) {\n // Scheme-relative reference (\"//host/path\").\n start += 2;\n } else {\n let indexOfProtocol = url.indexOf(':/', start);\n if (indexOfProtocol !== -1) {\n // \"scheme://…\". Classify the scheme, then position `start` at the host.\n const special = getSpecialScheme(url, start, indexOfProtocol);\n if (special === 1) {\n // Special scheme: skip the run of '/' and '\\' after it\n // (special-authority-(ignore-)slashes states; '\\' acts as '/').\n start = indexOfProtocol + 2;\n while (\n url.charCodeAt(start) === 47 /* '/' */ ||\n url.charCodeAt(start) === 92 /* '\\' */\n ) {\n start += 1;\n }\n } else if (special === 2) {\n // file: the host is only what sits between \"//\" and the next slash, so\n // \"file://h/x\" => \"h\" but \"file:///x\" / \"file:/x\" => no host.\n start = indexOfProtocol + 1;\n let slashes = 0;\n while (\n (url.charCodeAt(start) === 47 || url.charCodeAt(start) === 92) &&\n slashes < 2\n ) {\n start += 1;\n slashes += 1;\n }\n if (slashes < 2) {\n return null;\n }\n } else {\n // Unknown scheme: validate the WHATWG scheme grammar [A-Za-z0-9+.-];\n // a control char means it was split by a tab/newline (strip + re-parse).\n for (let i = start; i < indexOfProtocol; i += 1) {\n const code = url.charCodeAt(i);\n if (!(\n ((code | 32) >= 97 && (code | 32) <= 122) || // [a-zA-Z] (fold letters only)\n (code >= 48 && code <= 57) || // [0, 9]\n code === 46 || // '.'\n code === 45 || // '-'\n code === 43 // '+'\n )) {\n if (\n code === 9 /* tab */ ||\n code === 10 /* LF */ ||\n code === 13 /* CR */\n ) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n // A '/', '\\', '?' or '#' first puts this ':/' in a path, query or\n // fragment (\"a.com/r?u=https://x\"): re-read the input without it.\n for (let j = i; j < indexOfProtocol; j += 1) {\n const c = url.charCodeAt(j);\n if (c === 47 || c === 92 || c === 63 || c === 35) {\n indexOfProtocol = -1;\n break;\n }\n }\n if (indexOfProtocol !== -1) {\n return null;\n }\n break;\n }\n }\n if (indexOfProtocol !== -1) {\n // A non-special scheme has an authority only after \"//\" (else it is\n // an opaque path with no host). `indexOf(':/')` already gave the\n // first '/'.\n if (url.charCodeAt(indexOfProtocol + 2) === 47 /* '/' */) {\n isSpecial = false;\n start = indexOfProtocol + 3;\n } else {\n return null;\n }\n }\n }\n }\n\n if (indexOfProtocol === -1 && url.charCodeAt(start) !== 91 /* '[' */) {\n // Cold path: no \"scheme://\" prefix, and not a bare IPv6 literal (whose\n // first ':' would otherwise look like a scheme separator; \"[…]\" falls\n // through to the ipv6 handling below). May be a bare host, a host:port,\n // a user@host, a slash-less special scheme (\"https:host\"), or an opaque\n // URI (\"mailto:\", \"tel:\", \"urn:…\").\n let indexOfColon = -1;\n for (let i = start; i < end; i += 1) {\n const code = url.charCodeAt(i);\n if (code === 9 || code === 10 || code === 13) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n if (code === 58 /* ':' */) {\n indexOfColon = i;\n break;\n }\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n }\n\n if (indexOfColon !== -1) {\n // An '@' before the next delimiter => the ':' is userinfo, not a\n // scheme (\"user:pass@host\", \"mailto:a@b\"): keep the whole authority.\n let hasIdentifier = false;\n for (let i = indexOfColon + 1; i < end; i += 1) {\n const code = url.charCodeAt(i);\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n if (code === 64 /* '@' */) {\n hasIdentifier = true;\n break;\n }\n }\n\n if (!hasIdentifier) {\n // All-digits after ':' => a bare \"host:port\" (tldts accepts\n // hostnames too); keep `start` and let the port handling trim it.\n let allDigits = true;\n let i = indexOfColon + 1;\n for (; i < end; i += 1) {\n const code = url.charCodeAt(i);\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n if (code < 48 /* '0' */ || code > 57 /* '9' */) {\n allDigits = false;\n break;\n }\n }\n if (i === indexOfColon + 1) {\n allDigits = false; // nothing after ':' => not a port\n }\n\n if (!allDigits) {\n const special = getSpecialScheme(url, start, indexOfColon);\n if (special === 0) {\n // No \"scheme://\" on the cold path and not a special scheme.\n // A second ':' before the host's end marks a bare, unbracketed\n // IPv6 literal (\"2a01:e35::1\"): fall through and let the host\n // loop + isIp classify it. Without one this is an opaque path\n // with no host (\"mailto:x\", \"foo:bar\").\n let isBareIpv6 = false;\n for (let j = indexOfColon + 1; j < end; j += 1) {\n const code = url.charCodeAt(j);\n if (\n code === 47 ||\n code === 92 ||\n code === 63 ||\n code === 35\n ) {\n break;\n }\n if (code === 58 /* ':' */) {\n isBareIpv6 = true;\n break;\n }\n }\n if (!isBareIpv6) {\n return null;\n }\n } else {\n start = indexOfColon + 1;\n if (special === 2) {\n // file (e.g. \"file:\\\\host\"): host only between \"//\" and next slash.\n let slashes = 0;\n while (\n (url.charCodeAt(start) === 47 ||\n url.charCodeAt(start) === 92) &&\n slashes < 2\n ) {\n start += 1;\n slashes += 1;\n }\n if (slashes < 2) {\n return null;\n }\n } else {\n while (\n url.charCodeAt(start) === 47 ||\n url.charCodeAt(start) === 92\n ) {\n start += 1;\n }\n }\n }\n }\n }\n }\n }\n }\n\n // Find the host's end: first '/', '?' or '#' (and '\\' for special URLs,\n // which WHATWG treats like '/'). Track the last '@', ']' and ':' for\n // userinfo, ipv6 and port, plus the first ':' of the host (reset at each\n // '@') to tell a bare IPv6 (>= 2 colons) from a host:port (exactly one);\n // flag uppercase and a stray tab/newline. The loop is split on `code < 64`\n // so common host characters take fewer comparisons.\n //\n // When `validate`, also accumulate `is-valid.ts`'s checks over the scanned\n // run so a simple authority's host can be validated in this single pass.\n // `vValid` only stays meaningful for a \"simple\" authority (no userinfo, port,\n // brackets, control or trailing dot); those cases clear it / are rejected by\n // the guard below, falling back to `isValidHostname`.\n let indexOfIdentifier = -1;\n let indexOfClosingBracket = -1;\n let indexOfPort = -1;\n let indexOfFirstColon = -1;\n let hasControl = false;\n let vValid = validate; // seeded true when validating; cleared on the first invalid char\n let vLastDot = start - 1; // mirrors is-valid.ts `lastDotIndex = -1` at host start\n let vLastCode = -1;\n if (validate && start < end) {\n // First-char rule: must be a valid host char, '.', or '_' (NOT '-').\n const c0 = url.charCodeAt(start);\n if (\n // Keep these parens: they scope /*@__INLINE__*/ for terser.\n // prettier-ignore\n !(\n /*@__INLINE__*/ (\n isValidHostnameChar(c0) ||\n c0 === 46 /* '.' */ ||\n c0 === 95 /* '_' */\n )\n ) ||\n c0 === 45 /* '-' (isValidHostnameChar allows it mid-label, not first) */\n ) {\n vValid = false;\n }\n }\n for (let i = start; i < end; i += 1) {\n const code: number = url.charCodeAt(i);\n if (code < 64) {\n if (code === 47 || code === 35 || code === 63) {\n end = i;\n break;\n } else if (code === 58 /* ':' */) {\n if (indexOfFirstColon === -1) {\n indexOfFirstColon = i;\n }\n indexOfPort = i;\n } else if (code === 9 || code === 10 || code === 13) {\n hasControl = true;\n } else if (validate) {\n if (code === 46 /* '.' */) {\n if (i - vLastDot > 64 || vLastCode === 46 || vLastCode === 45) {\n vValid = false;\n }\n vLastDot = i;\n } else if (code < 48 || code > 57) {\n // < 64 and not a delimiter/dot/digit => only '-' (45) is a valid\n // host char here; everything else (space, %, !, etc.) is invalid.\n // A '-' must also not START a label (the byte right after a '.') —\n // mirrors is-valid.ts; the first label is covered by the first-char\n // rule above. (RFC 1034 §3.5 / RFC 1035 §2.3.1 LDH.)\n if (code !== 45 || vLastCode === 46 /* label-leading '-' */) {\n vValid = false;\n }\n }\n }\n } else if (isSpecial && code === 92 /* '\\' */) {\n end = i;\n break;\n } else if (code === 64 /* '@' */) {\n indexOfIdentifier = i;\n indexOfFirstColon = -1; // colons before '@' are userinfo, not the host\n } else if (code === 93 /* ']' */) {\n indexOfClosingBracket = i;\n } else if (code >= 65 && code <= 90) {\n hasUpper = true;\n } else if (validate && !(/*@__INLINE__*/ isValidHostnameChar(code))) {\n // >= 64, not '@'/']'/upper: valid only if a-z, '_', or non-ASCII.\n vValid = false;\n }\n if (validate) {\n vLastCode = code;\n }\n }\n\n // A tab/newline inside the authority: strip everything and re-parse (rare).\n if (hasControl) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n\n // Skip userinfo. '>= start' so an empty userinfo (\"http://@host\") works too.\n if (\n indexOfIdentifier !== -1 &&\n indexOfIdentifier >= start &&\n indexOfIdentifier < end\n ) {\n start = indexOfIdentifier + 1;\n }\n\n if (url.charCodeAt(start) === 91 /* '[' */) {\n // ipv6 address: return what is between the brackets, or null if unclosed.\n if (indexOfClosingBracket !== -1) {\n return url.slice(start + 1, indexOfClosingBracket).toLowerCase();\n }\n return null;\n } else if (\n indexOfPort !== -1 &&\n indexOfPort > start &&\n indexOfPort < end &&\n // A host:port has exactly one ':' in the host (so its first ':' is its\n // last); a bare, unbracketed IPv6 literal (\"2a01:e35::1\") has >= 2, so\n // its first ':' precedes the last. Only the former has a ':port' to trim.\n indexOfFirstColon === indexOfPort\n ) {\n end = indexOfPort; // trim ':port'\n }\n\n // Empty authority (\"http://\", \"file:///path\", \"//\"); only reachable here via\n // extraction — a bare valid hostname never lands here.\n if (start >= end) {\n return null;\n }\n\n // Publish the inline-validation verdict — but only for a \"simple\" authority,\n // where the scanned run equals the final host: no userinfo skip, no port\n // trim, no brackets, no trailing dot (trimmed below), and length within RFC\n // limits. Anything else leaves it `false` so `parseImpl` re-validates.\n //\n // Every clause below is load-bearing for CORRECTNESS, not just speed: the\n // loop accumulates `vValid` over the whole scanned run (it does not stop at\n // ':' or '@', so any port/userinfo bytes are included), so the verdict is\n // only sound when that run equals the final host. Do not drop a clause as\n // \"redundant\" — e.g. without `indexOfPort === -1`, `host:8080` would be\n // wrongly accepted.\n if (\n validate &&\n vValid &&\n indexOfIdentifier === -1 &&\n indexOfPort === -1 &&\n indexOfClosingBracket === -1 &&\n url.charCodeAt(end - 1) !== 46 /* no trailing dot */ &&\n end - start <= 255 && // total length\n end - vLastDot - 1 <= 63 && // last label length\n vLastCode !== 45 /* last char not '-' */\n ) {\n extractedHostnameValidated = true;\n }\n }\n\n // Trim trailing dots\n while (end > start + 1 && url.charCodeAt(end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n\n const hostname: string =\n start !== 0 || end !== url.length ? url.slice(start, end) : url;\n\n if (hasUpper) {\n return hostname.toLowerCase();\n }\n\n return hostname;\n}\n","/**\n * Check if a hostname is an IP. You should be aware that this only works\n * because `hostname` is already garanteed to be a valid hostname!\n */\nfunction isProbablyIpv4(hostname: string): boolean {\n // Cannot be shorted than 1.1.1.1\n if (hostname.length < 7) {\n return false;\n }\n\n // Cannot be longer than: 255.255.255.255\n if (hostname.length > 15) {\n return false;\n }\n\n let numberOfDots = 0;\n\n for (let i = 0; i < hostname.length; i += 1) {\n const code = hostname.charCodeAt(i);\n\n if (code === 46 /* '.' */) {\n numberOfDots += 1;\n } else if (code < 48 /* '0' */ || code > 57 /* '9' */) {\n return false;\n }\n }\n\n return (\n numberOfDots === 3 &&\n hostname.charCodeAt(0) !== 46 /* '.' */ &&\n hostname.charCodeAt(hostname.length - 1) !== 46 /* '.' */\n );\n}\n\n/**\n * Similar to isProbablyIpv4.\n */\nfunction isProbablyIpv6(hostname: string): boolean {\n if (hostname.length < 3) {\n return hostname === '::';\n }\n\n let start = hostname.startsWith('[') ? 1 : 0;\n let end = hostname.length;\n\n if (hostname[end - 1] === ']') {\n end -= 1;\n }\n\n // We only consider the maximum size of a normal IPV6. Note that this will\n // fail on so-called \"IPv4 mapped IPv6 addresses\" but this is a corner-case\n // and a proper validation library should be used for these.\n if (end - start > 39) {\n return false;\n }\n\n let hasColon = false;\n\n for (; start < end; start += 1) {\n const code = hostname.charCodeAt(start);\n\n if (code === 58 /* ':' */) {\n hasColon = true;\n } else if (!(\n (code >= 48 && code <= 57) || // 0-9\n (code >= 97 && code <= 102) || // a-f\n (code >= 65 && code <= 70) // A-F (RFC 4291 §2.2: an IPv6 hextet is hex digits only)\n )) {\n return false;\n }\n }\n\n return hasColon;\n}\n\n/**\n * Check if `hostname` is *probably* a valid ip addr (either ipv6 or ipv4).\n * This *will not* work on any string. We need `hostname` to be a valid\n * hostname.\n */\nexport default function isIp(hostname: string): boolean {\n return isProbablyIpv6(hostname) || isProbablyIpv4(hostname);\n}\n","/**\n * Special-use domain names from the IANA \"Special-Use Domain Names\" registry:\n * the authoritative list, created by RFC 6761 and maintained as new RFCs add to\n * it: https://www.iana.org/assignments/special-use-domain-names/\n * Snapshot: 2026-05-24. (RFC 6761 is not obsoleted; draft-hoffman-rfc6761bis\n * proposes to retire its prose but keep this registry, so the registry is the\n * source of truth; re-sync this list against it.)\n *\n * These names never correspond to a public registration, yet neither\n * `isIcann` nor `isPrivate` marks one as special-use: most are absent from the\n * Public Suffix List (so `a.test` looks like a registrable domain), and the\n * few that are listed (`onion`, `home.arpa`) appear there as ordinary ICANN\n * suffixes. `isSpecialUse` is the single signal that covers them all.\n *\n * Per the registry and RFC 6761 (\"and any names falling within these domains\"),\n * the designation covers each listed name AND all of its sub-domains. DNS labels\n * are case-insensitive (RFC 4343); `hostname` is expected to be already\n * lower-cased and trailing-dot-stripped, as produced by `extractHostname`, the\n * same normalization the Public-Suffix-List lookup relies on.\n *\n * Two groups of registry entries are intentionally excluded: the numeric\n * reverse-DNS delegation zones (`10.in-addr.arpa`, the `*.ip6.arpa` ranges, …),\n * which are reverse-DNS PTR zones rather than hostnames and whose parents\n * (`in-addr.arpa`/`ip6.arpa`) are already in the Public Suffix List; and the\n * deprecated `eap-noob.arpa` entry.\n */\nconst SPECIAL_USE_DOMAINS: readonly string[] = [\n 'test', // RFC 6761\n 'localhost', // RFC 6761\n 'invalid', // RFC 6761\n 'example', // RFC 6761\n 'example.com', // RFC 6761\n 'example.net', // RFC 6761\n 'example.org', // RFC 6761\n 'local', // RFC 6762 (mDNS)\n 'onion', // RFC 7686 (Tor)\n 'alt', // RFC 9476\n 'home.arpa', // RFC 8375\n 'ipv4only.arpa', // RFC 8880\n 'resolver.arpa', // RFC 9462\n 'service.arpa', // RFC 9665\n '6tisch.arpa', // RFC 9031\n 'eap.arpa', // RFC 9965\n];\n\n/**\n * Return `true` if `hostname` is, or is a sub-domain of, a special-use domain\n * (see the registry note above). Expects an already-normalized `hostname`.\n */\nexport default function isSpecialUse(hostname: string): boolean {\n for (const name of SPECIAL_USE_DOMAINS) {\n // Match on a label boundary: `hostname` is either exactly `name` or ends\n // with `.name` (so `latest` is not matched by `test`, nor `myexample.com`\n // by `example.com`).\n if (\n hostname.endsWith(name) &&\n (hostname.length === name.length ||\n hostname.charCodeAt(hostname.length - name.length - 1) === 46) /* '.' */\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Implements fast shallow verification of hostnames. This does not perform a\n * struct check on the content of labels (classes of Unicode characters, etc.)\n * but instead check that the structure is valid (number of labels, length of\n * labels, etc.).\n *\n * If you need stricter validation, consider using an external library.\n */\n\n// KEEP IN SYNC with `extract-hostname.ts` `isValidHostnameChar` + its inline\n// scan/verdict, which duplicate these structural rules to validate during\n// extraction (a perf fusion). That copy additionally accepts A-Z (the host is\n// not yet lowercased there) and folds in '-' / '_'. Any change to the accepted\n// character set or the label/length rules here must be mirrored there.\nfunction isValidAscii(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || (code >= 48 && code <= 57) || code > 127\n );\n}\n\n/**\n * Check if a hostname string is valid. It's usually a preliminary check before\n * trying to use getDomain or anything else.\n *\n * Beware: it does not check if the TLD exists.\n */\nexport default function (hostname: string): boolean {\n if (hostname.length > 255) {\n return false;\n }\n\n if (hostname.length === 0) {\n return false;\n }\n\n if (\n /*@__INLINE__*/ !isValidAscii(hostname.charCodeAt(0)) &&\n hostname.charCodeAt(0) !== 46 && // '.' (dot)\n hostname.charCodeAt(0) !== 95 // '_' (underscore)\n ) {\n return false;\n }\n\n // Validate hostname according to RFC\n let lastDotIndex = -1;\n let lastCharCode = -1;\n const len = hostname.length;\n\n for (let i = 0; i < len; i += 1) {\n const code = hostname.charCodeAt(i);\n if (code === 46 /* '.' */) {\n if (\n // Check that previous label is < 63 bytes long (64 = 63 + '.')\n i - lastDotIndex > 64 ||\n // Check that previous character was not already a '.'\n lastCharCode === 46 ||\n // Check that the previous label does not end with '-' (RFC 1035 §2.3.1 LDH).\n // '_' is intentionally NOT restricted: DNS allows any octet (RFC 2181 §11) and\n // WHATWG URL does not treat '_' as a forbidden host code point.\n lastCharCode === 45\n ) {\n return false;\n }\n\n lastDotIndex = i;\n } else if (\n // A forbidden character in the label...\n // Keep these parens: they scope /*@__INLINE__*/ for terser.\n // prettier-ignore\n !(/*@__INLINE__*/ (isValidAscii(code) || code === 45 || code === 95)) ||\n // ...or a '-' starting a label (the byte right after a '.'). A label must\n // not begin with a hyphen (RFC 1034 §3.5 / RFC 1035 §2.3.1 LDH, as amended\n // by RFC 1123 §2.1; cf. UTS #46 CheckHyphens). The first label is covered by\n // the leading-character guard above; mirrors the trailing-'-' rule below.\n (code === 45 && lastCharCode === 46)\n ) {\n return false;\n }\n\n lastCharCode = code;\n }\n\n return (\n // Check that last label is shorter than 63 chars\n len - lastDotIndex - 1 <= 63 &&\n // Check that the last character is an allowed trailing label character.\n // Since we already checked that the char is a valid hostname character,\n // we only need to check that it's different from '-'.\n lastCharCode !== 45\n );\n}\n","import { shareSameDomainSuffix } from '../domain';\nimport { IOptions } from '../options';\nimport { IPublicSuffix } from './interface';\n\n/**\n * Apply `options.extraSuffixes` to the built-in lookup result in `out`, as if\n * they were part of the list (`isException`: the built-in winner is an\n * exception rule). As in browsers, the longest match prevails and an exception\n * beats a rule of the same length. Remaining ties go to the built-in match\n * (unless it matched no rule: both flags falsy), then to `icann`.\n */\nexport default function extraSuffixLookup(\n hostname: string,\n options: IOptions,\n isException: boolean,\n out: IPublicSuffix,\n): void {\n const suffix = out.publicSuffix;\n if (suffix === null) {\n return;\n }\n\n // Best extra exception and rule, as start indices in `hostname` (smaller is\n // longer; `none` if unmatched), and whether each is ICANN.\n const none = hostname.length + 1;\n let exception = none;\n let exceptionIsIcann = false;\n let rule = none;\n let ruleIsIcann = false;\n const extra = options.extraSuffixes!;\n for (let section = 0; section < 2; section += 1) {\n const isIcann = section === 0;\n const rules = isIcann\n ? options.allowIcannDomains && extra.icann\n : options.allowPrivateDomains && extra.private;\n if (!Array.isArray(rules)) {\n continue;\n }\n for (const r of rules) {\n // Sparse or untyped lists may hold non-strings.\n if (typeof r !== 'string') {\n continue;\n }\n const exceptionRule = r.startsWith('!');\n const wildcard = r.startsWith('*.');\n const body = exceptionRule ? r.slice(1) : wildcard ? r.slice(2) : r;\n // Skip empty rules, and exceptions without a parent ('!p').\n if (\n body === '' ||\n (exceptionRule && !body.includes('.')) ||\n !shareSameDomainSuffix(hostname, body)\n ) {\n continue;\n }\n let start = hostname.length - body.length;\n // Strict `<`: on a tie, the first match (`icann` first) wins.\n if (exceptionRule) {\n if (start < exception) {\n exception = start;\n exceptionIsIcann = isIcann;\n }\n continue;\n }\n // `*.p` also matches `p`, else one more non-empty label.\n if (wildcard && start > 1 && hostname.charCodeAt(start - 2) !== 46) {\n start = hostname.lastIndexOf('.', start - 2) + 1;\n }\n if (start < rule) {\n rule = start;\n ruleIsIcann = isIcann;\n }\n }\n }\n\n // Start of the built-in match: an exception starts one label left of its\n // suffix.\n const suffixStart = hostname.length - suffix.length;\n const builtin = isException\n ? hostname.lastIndexOf('.', suffixStart - 2) + 1\n : suffixStart;\n // An exception wins ties with rules; a built-in exception wins ties with\n // an extra one.\n if (\n exception <= rule &&\n (isException ? exception < builtin : exception <= builtin)\n ) {\n out.publicSuffix = hostname.slice(hostname.indexOf('.', exception) + 1);\n out.isIcann = exceptionIsIcann;\n out.isPrivate = !exceptionIsIcann;\n } else if (\n rule < builtin ||\n (rule === builtin && !out.isIcann && !out.isPrivate)\n ) {\n out.publicSuffix = hostname.slice(rule);\n out.isIcann = ruleIsIcann;\n out.isPrivate = !ruleIsIcann;\n }\n}\n","export interface IOptions {\n allowIcannDomains: boolean;\n allowPrivateDomains: boolean;\n detectIp: boolean;\n // Detect RFC 6761 / IANA special-use domains and expose the result as\n // `isSpecialUse` on `parse()`. Off by default so the common path stays\n // allocation-free with no extra work; enable it to populate the field.\n detectSpecialUse: boolean;\n // Extra public suffix rules, in PSL syntax, per section (default: null)\n extraSuffixes: {\n icann?: readonly string[];\n private?: readonly string[];\n } | null;\n extractHostname: boolean;\n mixedInputs: boolean;\n validHosts: string[] | null;\n validateHostname: boolean;\n}\n\nfunction setDefaultsImpl({\n allowIcannDomains = true,\n allowPrivateDomains = false,\n detectIp = true,\n detectSpecialUse = false,\n extraSuffixes = null,\n extractHostname = true,\n mixedInputs = true,\n validHosts = null,\n validateHostname = true,\n}: Partial<IOptions>): IOptions {\n return {\n allowIcannDomains,\n allowPrivateDomains,\n detectIp,\n detectSpecialUse,\n extraSuffixes,\n extractHostname,\n mixedInputs,\n validHosts,\n validateHostname,\n };\n}\n\nconst DEFAULT_OPTIONS = /*@__INLINE__*/ setDefaultsImpl({});\n\nexport function setDefaults(options?: Partial<IOptions>): IOptions {\n if (options === undefined) {\n return DEFAULT_OPTIONS;\n }\n\n return /*@__INLINE__*/ setDefaultsImpl(options);\n}\n","/**\n * Returns the subdomain of a hostname string\n */\nexport default function getSubdomain(hostname: string, domain: string): string {\n // If `hostname` and `domain` are the same, then there is no sub-domain\n if (domain.length === hostname.length) {\n return '';\n }\n\n return hostname.slice(0, -domain.length - 1);\n}\n","/**\n * Implement a factory allowing to plug different implementations of suffix\n * lookup (e.g.: using a trie or the packed hashes datastructures). This is used\n * and exposed in `tldts.ts` and `tldts-experimental.ts` bundle entrypoints.\n */\n\nimport getDomain from './domain';\nimport getDomainWithoutSuffix from './domain-without-suffix';\nimport extractHostname, {\n extractedHostnameValidated,\n} from './extract-hostname';\nimport isIp from './is-ip';\nimport isSpecialUse from './is-special-use';\nimport isValidHostname from './is-valid';\nimport extraSuffixLookup from './lookup/extra-suffixes';\nimport { IPublicSuffix, ISuffixLookupOptions } from './lookup/interface';\nimport { IOptions, setDefaults } from './options';\nimport getSubdomain from './subdomain';\n\nexport interface IResult {\n // `hostname` is either a registered name (including but not limited to a\n // hostname), or an IP address, directly extracted from the input URL. IPv4\n // addresses are in dot-decimal notation. IPv6 is returned without its\n // surrounding brackets; both bracketed (in URLs, e.g. `http://[::1]/`) and\n // bare unbracketed (e.g. `2a01:e35::1`) IPv6 literals are accepted.\n hostname: string | null;\n\n // Is `hostname` an IP? (IPv4 or IPv6)\n isIp: boolean | null;\n\n // `hostname` split between subdomain, domain and its public suffix (if any)\n subdomain: string | null;\n domain: string | null;\n publicSuffix: string | null;\n domainWithoutSuffix: string | null;\n\n // Specifies if `publicSuffix` comes from the ICANN or PRIVATE section of the list\n isIcann: boolean | null;\n isPrivate: boolean | null;\n\n // Is `hostname` a special-use domain from the IANA registry (RFC 6761 et al.:\n // e.g. `localhost`, `*.test`, `*.local`, `*.onion`, `home.arpa`)? `isIcann`/\n // `isPrivate` do not identify these (most are not in the Public Suffix List;\n // the few that are appear as ordinary ICANN suffixes). `null` unless the\n // `detectSpecialUse` option is enabled (see is-special-use.ts).\n isSpecialUse: boolean | null;\n}\n\nexport function getEmptyResult(): IResult {\n return {\n domain: null,\n domainWithoutSuffix: null,\n hostname: null,\n isIcann: null,\n isIp: null,\n isPrivate: null,\n isSpecialUse: null,\n publicSuffix: null,\n subdomain: null,\n };\n}\n\nexport function resetResult(result: IResult): void {\n result.domain = null;\n result.domainWithoutSuffix = null;\n result.hostname = null;\n result.isIcann = null;\n result.isIp = null;\n result.isPrivate = null;\n result.isSpecialUse = null;\n result.publicSuffix = null;\n result.subdomain = null;\n}\n\n// Flags representing steps in the `parse` function. They are used to implement\n// an early stop mechanism (simulating some form of laziness) to avoid doing\n// more work than necessary to perform a given action (e.g.: we don't need to\n// extract the domain and subdomain if we are only interested in public suffix).\nexport const enum FLAG {\n HOSTNAME,\n IS_VALID,\n PUBLIC_SUFFIX,\n DOMAIN,\n SUB_DOMAIN,\n ALL,\n}\n\nexport function parseImpl(\n url: string,\n step: FLAG,\n suffixLookup: (\n _1: string,\n _2: ISuffixLookupOptions,\n _3: IPublicSuffix,\n ) => unknown,\n partialOptions: Partial<IOptions> | undefined,\n result: IResult,\n): IResult {\n const options: IOptions = /*@__INLINE__*/ setDefaults(partialOptions);\n\n // Very fast approximate check to make sure `url` is a string. This is needed\n // because the library will not necessarily be used in a typed setup and\n // values of arbitrary types might be given as argument.\n if (typeof url !== 'string') {\n return result;\n }\n\n // Extract hostname from `url` only if needed. This can be made optional\n // using `options.extractHostname`. This option will typically be used\n // whenever we are sure the inputs to `parse` are already hostnames and not\n // arbitrary URLs.\n //\n // `mixedInput` allows to specify if we expect a mix of URLs and hostnames\n // as input. If only hostnames are expected then `extractHostname` can be\n // set to `false` to speed-up parsing. If only URLs are expected then\n // `mixedInputs` can be set to `false`. The `mixedInputs` is only a hint\n // and will not change the behavior of the library.\n // Whether `url` itself was already a valid hostname (only computed on the\n // mixedInputs path). Lets us skip the post-extraction validation below when\n // extractHostname returned `url` unchanged (same reference).\n let urlIsValid = false;\n if (!options.extractHostname) {\n // Trim trailing dots as extractHostname does (`new URL()` keeps them).\n let end = url.length;\n while (end > 1 && url.charCodeAt(end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n result.hostname = end === url.length ? url : url.slice(0, end);\n } else if (options.mixedInputs) {\n urlIsValid = isValidHostname(url);\n result.hostname = extractHostname(\n url,\n urlIsValid,\n options.validateHostname,\n );\n } else {\n result.hostname = extractHostname(url, false, options.validateHostname);\n }\n\n // Check if `hostname` is a valid ip address\n if (options.detectIp && result.hostname !== null) {\n result.isIp = isIp(result.hostname);\n if (result.isIp) {\n return result;\n }\n }\n\n // Perform hostname validation if enabled. If hostname is not valid, no need to\n // go further as there will be no valid domain or sub-domain. This validation\n // is applied before any early returns to ensure consistent behavior across\n // all API methods including getHostname().\n if (\n options.validateHostname &&\n options.extractHostname &&\n result.hostname !== null &&\n // Skip the re-scan when `url` was already validated and extractHostname\n // returned it unchanged (same reference => identical string, still valid).\n !(urlIsValid && result.hostname === url) &&\n // Skip the re-scan when extractHostname already validated the host inline\n // (a confirmed-valid simple authority — see extract-hostname.ts).\n !extractedHostnameValidated &&\n !isValidHostname(result.hostname)\n ) {\n result.hostname = null;\n return result;\n }\n\n if (step === FLAG.HOSTNAME || result.hostname === null) {\n return result;\n }\n\n // Flag special-use domains, only when opted in (`detectSpecialUse`) and only\n // for the full `parse()` result (FLAG.ALL). Computed here, before the\n // public-suffix/domain early-returns below, so single-label names like\n // `localhost` (which have no registrable domain) are still flagged.\n if (step === FLAG.ALL && options.detectSpecialUse) {\n result.isSpecialUse = isSpecialUse(result.hostname);\n }\n\n // Extract public suffix (`isException`: the winner is an exception rule)\n const isException = suffixLookup(result.hostname, options, result);\n if (options.extraSuffixes !== null) {\n extraSuffixLookup(result.hostname, options, isException === true, result);\n }\n if (step === FLAG.PUBLIC_SUFFIX || result.publicSuffix === null) {\n return result;\n }\n\n // Extract domain\n result.domain = getDomain(result.publicSuffix, result.hostname, options);\n if (step === FLAG.DOMAIN || result.domain === null) {\n return result;\n }\n\n // Extract subdomain\n result.subdomain = getSubdomain(result.hostname, result.domain);\n if (step === FLAG.SUB_DOMAIN) {\n return result;\n }\n\n // Extract domain without suffix\n result.domainWithoutSuffix = getDomainWithoutSuffix(\n result.domain,\n result.publicSuffix,\n );\n\n return result;\n}\n","import { IPublicSuffix, ISuffixLookupOptions } from './interface';\n\nexport default function (\n hostname: string,\n options: ISuffixLookupOptions,\n out: IPublicSuffix,\n): boolean {\n // Fast path for very popular suffixes; this allows to by-pass lookup\n // completely as well as any extra allocation or string manipulation.\n if (\n !options.allowPrivateDomains &&\n options.allowIcannDomains &&\n hostname.length > 3\n ) {\n const last: number = hostname.length - 1;\n const c3: number = hostname.charCodeAt(last);\n const c2: number = hostname.charCodeAt(last - 1);\n const c1: number = hostname.charCodeAt(last - 2);\n const c0: number = hostname.charCodeAt(last - 3);\n\n if (\n c3 === 109 /* 'm' */ &&\n c2 === 111 /* 'o' */ &&\n c1 === 99 /* 'c' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'com';\n return true;\n } else if (\n c3 === 103 /* 'g' */ &&\n c2 === 114 /* 'r' */ &&\n c1 === 111 /* 'o' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'org';\n return true;\n } else if (\n c3 === 117 /* 'u' */ &&\n c2 === 100 /* 'd' */ &&\n c1 === 101 /* 'e' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'edu';\n return true;\n } else if (\n c3 === 118 /* 'v' */ &&\n c2 === 111 /* 'o' */ &&\n c1 === 103 /* 'g' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'gov';\n return true;\n } else if (\n c3 === 116 /* 't' */ &&\n c2 === 101 /* 'e' */ &&\n c1 === 110 /* 'n' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'net';\n return true;\n } else if (\n c3 === 101 /* 'e' */ &&\n c2 === 100 /* 'd' */ &&\n c1 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'de';\n return true;\n }\n }\n\n return false;\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;AAUG;AACG,SAAU,qBAAqB,CACnC,QAAgB,EAChB,KAAa,EAAA;AAEb,IAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC5B,QAAA,QACE,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAChC,YAAA,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG;IAExD;AAEA,IAAA,OAAO,KAAK;AACd;AAEA;;AAEG;AACH,SAAS,uBAAuB,CAC9B,QAAgB,EAChB,YAAoB,EAAA;;;;;;;;;;;;;;;IAgBpB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC;IACnE,MAAM,wBAAwB,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC;;AAG7E,IAAA,IAAI,wBAAwB,KAAK,EAAE,EAAE;AACnC,QAAA,OAAO,QAAQ;IACjB;;IAGA,OAAO,QAAQ,CAAC,KAAK,CAAC,wBAAwB,GAAG,CAAC,CAAC;AACrD;AAEA;;AAEG;AACW,SAAU,SAAS,CAC/B,MAAc,EACd,QAAgB,EAChB,OAAiB,EAAA;;AAGjB,IAAA,IAAI,OAAO,CAAC,UAAU,KAAK,IAAI,EAAE;AAC/B,QAAA,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU;AACrC,QAAA,KAA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,aAAA,IACL,EAAE,KAAK,GAAG;YACV,EAAE,KAAK,GAAG;YACV,EAAE,KAAK,GAAG;AACV,YAAA,EAAE,KAAK,EAAE,YACT;AACA,YAAA,GAAG,CAAC,OAAO,GAAG,IAAI;AAClB,YAAA,GAAG,CAAC,SAAS,GAAG,KAAK;AACrB,YAAA,GAAG,CAAC,YAAY,GAAG,KAAK;AACxB,YAAA,OAAO,IAAI;QACb;AAAO,aAAA,IACL,EAAE,KAAK,GAAG;YACV,EAAE,KAAK,GAAG;AACV,YAAA,EAAE,KAAK,EAAE,YACT;AACA,YAAA,GAAG,CAAC,OAAO,GAAG,IAAI;AAClB,YAAA,GAAG,CAAC,SAAS,GAAG,KAAK;AACrB,YAAA,GAAG,CAAC,YAAY,GAAG,IAAI;AACvB,YAAA,OAAO,IAAI;QACb;IACF;AAEA,IAAA,OAAO,KAAK;AACd;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/domain.ts","../../src/domain-without-suffix.ts","../../src/extract-hostname.ts","../../src/ip-mapping.ts","../../src/is-ip.ts","../../src/is-special-use.ts","../../src/is-valid.ts","../../src/lookup/extra-suffixes.ts","../../src/options.ts","../../src/subdomain.ts","../../src/factory.ts","../../src/lookup/fast-path.ts"],"sourcesContent":["import { IOptions } from './options';\n\n/**\n * Check if `vhost` is a valid suffix of `hostname` (top-domain)\n *\n * It means that `vhost` needs to be a suffix of `hostname` and we then need to\n * make sure that: either they are equal, or the character preceding `vhost` in\n * `hostname` is a '.' (it should not be a partial label).\n *\n * * hostname = 'not.evil.com' and vhost = 'vil.com' => not ok\n * * hostname = 'not.evil.com' and vhost = 'evil.com' => ok\n * * hostname = 'not.evil.com' and vhost = 'not.evil.com' => ok\n */\nexport function shareSameDomainSuffix(\n hostname: string,\n vhost: string,\n): boolean {\n if (hostname.endsWith(vhost)) {\n return (\n hostname.length === vhost.length ||\n hostname[hostname.length - vhost.length - 1] === '.'\n );\n }\n\n return false;\n}\n\n/**\n * Given a hostname and its public suffix, extract the general domain.\n */\nfunction extractDomainWithSuffix(\n hostname: string,\n publicSuffix: string,\n): string {\n // Locate the index of the last '.' in the part of the `hostname` preceding\n // the public suffix.\n //\n // examples:\n // 1. not.evil.co.uk => evil.co.uk\n // ^ ^\n // | | start of public suffix\n // | index of the last dot\n //\n // 2. example.co.uk => example.co.uk\n // ^ ^\n // | | start of public suffix\n // |\n // | (-1) no dot found before the public suffix\n const publicSuffixIndex = hostname.length - publicSuffix.length - 2;\n const lastDotBeforeSuffixIndex = hostname.lastIndexOf('.', publicSuffixIndex);\n\n // No '.' found, then `hostname` is the general domain (no sub-domain)\n if (lastDotBeforeSuffixIndex === -1) {\n return hostname;\n }\n\n // Extract the part between the last '.'\n return hostname.slice(lastDotBeforeSuffixIndex + 1);\n}\n\n/**\n * Detects the domain based on rules and upon and a host string\n */\nexport default function getDomain(\n suffix: string,\n hostname: string,\n options: IOptions,\n): string | null {\n // Check if `hostname` ends with a member of `validHosts`.\n if (options.validHosts !== null) {\n const validHosts = options.validHosts;\n for (const vhost of validHosts) {\n if (/*@__INLINE__*/ shareSameDomainSuffix(hostname, vhost)) {\n return vhost;\n }\n }\n }\n\n let numberOfLeadingDots = 0;\n if (hostname.startsWith('.')) {\n while (\n numberOfLeadingDots < hostname.length &&\n hostname[numberOfLeadingDots] === '.'\n ) {\n numberOfLeadingDots += 1;\n }\n }\n\n // If `hostname` is a valid public suffix, then there is no domain to return.\n // Since we already know that `getPublicSuffix` returns a suffix of `hostname`\n // there is no need to perform a string comparison and we only compare the\n // size.\n if (suffix.length === hostname.length - numberOfLeadingDots) {\n return null;\n }\n\n // To extract the general domain, we start by identifying the public suffix\n // (if any), then consider the domain to be the public suffix with one added\n // level of depth. (e.g.: if hostname is `not.evil.co.uk` and public suffix:\n // `co.uk`, then we take one more level: `evil`, giving the final result:\n // `evil.co.uk`).\n return /*@__INLINE__*/ extractDomainWithSuffix(hostname, suffix);\n}\n","/**\n * Return the part of domain without suffix.\n *\n * Example: for domain 'foo.com', the result would be 'foo'.\n */\nexport default function getDomainWithoutSuffix(\n domain: string,\n suffix: string,\n): string {\n // Note: here `domain` and `suffix` cannot have the same length because in\n // this case we set `domain` to `null` instead. It is thus safe to assume\n // that `suffix` is shorter than `domain`.\n return domain.slice(0, -suffix.length - 1);\n}\n","// `charCodeAt.call(url, i)`, not `url.charCodeAt(i)`: see `is-valid.ts`.\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\nconst HAS_CONTROL_CHAR = /[\\t\\n\\r]/;\n\n/**\n * Matches a forbidden domain code point\n * (https://url.spec.whatwg.org/#forbidden-domain-code-point): a C0 control,\n * space, '#', '%', '/', ':', '<', '>', '?', '@', '[', '\\', ']', '^', '|' or DEL.\n */\n// eslint-disable-next-line no-control-regex\nconst FORBIDDEN_DOMAIN_CHAR = /[\\x00-\\x20#%/:<>?@[\\\\\\]^|\\x7f]/;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// complex authority — userinfo/port/brackets/trailing-dot/control — an invalid\n// host, or a non-main return path); `parseImpl` then validates as usual. The\n// fast path can only ever SKIP a redundant scan for hosts already known valid,\n// never accept an invalid one.\nexport let extractedHostnameValidated = false;\n\n// Set by `extractHostname`, like `extractedHostnameValidated`: `true` ONLY when\n// the returned host was in brackets (\"http://[::1]/\"). `parseImpl` then checks\n// that it is an IPv6 address, as browsers do.\nexport let extractedBracketedHost = false;\n\n/**\n * True if char `code` is a valid hostname character. This is the per-char half\n * of `is-valid.ts`'s `isValidAscii` (a-z, 0-9, > U+007F) PLUS three additions:\n * A-Z (the host is lowercased before validation, so uppercase ≡ a valid\n * lowercase letter) and '-' / '_' (valid inside a label). KEEP IN SYNC with\n * `is-valid.ts`: these rules are deliberately duplicated to validate during\n * extraction, so any change to the accepted character set there must be\n * mirrored here (and vice-versa).\n */\nfunction isValidHostnameChar(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || // a-z\n (code >= 48 && code <= 57) || // 0-9\n code > 127 || // non-ASCII (accepted, not punycode-checked)\n (code >= 65 && code <= 90) || // A-Z (becomes valid once lowercased)\n code === 45 || // '-'\n code === 95 // '_'\n );\n}\n\n/**\n * No hostname in `url`, unless a tab or newline, which browsers remove before\n * anything else, hides one (\"sc:\\t//host\", \"/\\t/host\"): `url` is then read\n * again without them. Only reached on inputs without a host.\n */\nfunction noHostname(\n url: string,\n urlIsValidHostname: boolean,\n validate: boolean,\n): string | null {\n return HAS_CONTROL_CHAR.test(url)\n ? extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n )\n : null;\n}\n\n/**\n * True if char `code` may follow the first letter of a scheme: an ASCII letter,\n * a digit, '+', '-' or '.' (https://url.spec.whatwg.org/#scheme-state).\n */\nfunction isSchemeChar(code: number): boolean {\n return (\n ((code | 32) >= 97 && (code | 32) <= 122) || // [a-zA-Z] (fold letters only)\n (code >= 48 && code <= 57) || // [0, 9]\n code === 46 || // '.'\n code === 45 || // '-'\n code === 43 // '+'\n );\n}\n\n/**\n * `hostname` percent-decoded as browsers decode the host of a special URL,\n * lower-cased and without trailing dots, or null where they find no valid host:\n * bytes that are no UTF-8 (\"%FF\"), a '%' not followed by two hexadecimal digits\n * (\"%zz\"), and characters forbidden in a domain once decoded (\"%2F\", \"%3A\",\n * \"%5B::1%5D\"). https://url.spec.whatwg.org/#concept-host-parser\n */\nfunction decodeHostname(hostname: string): string | null {\n let decoded: string;\n try {\n decoded = decodeURIComponent(hostname);\n } catch {\n return null;\n }\n if (FORBIDDEN_DOMAIN_CHAR.test(decoded)) {\n return null;\n }\n let end = decoded.length;\n while (end > 1 && charCodeAt.call(decoded, end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n return decoded.slice(0, end).toLowerCase();\n}\n\n/**\n * True if `url.slice(start, end)` is a scheme, as browsers read one: an ASCII\n * letter, then scheme characters.\n */\nfunction isScheme(url: string, start: number, end: number): boolean {\n const first = charCodeAt.call(url, start) | 32;\n if (start === end || first < 97 || first > 122) {\n return false;\n }\n for (let i = start + 1; i < end; i += 1) {\n if (!isSchemeChar(charCodeAt.call(url, i))) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Classify scheme `url.slice(schemeStart, colonIndex)` as a WHATWG special\n * scheme without allocating a substring (case-insensitive via `| 32`).\n * Special schemes: ftp, file, http, https, ws, wss\n * (https://url.spec.whatwg.org/#special-scheme).\n *\n * @returns 0 = not special, 1 = special, 2 = file (its host sits only between\n * \"//\" and the next slash).\n */\nfunction getSpecialScheme(\n url: string,\n schemeStart: number,\n colonIndex: number,\n): number {\n const length = colonIndex - schemeStart;\n const c0 = charCodeAt.call(url, schemeStart) | 32;\n if (length === 2) {\n return c0 === 119 && (charCodeAt.call(url, schemeStart + 1) | 32) === 115\n ? 1\n : 0; // ws\n } else if (length === 3) {\n const c1 = charCodeAt.call(url, schemeStart + 1) | 32;\n const c2 = charCodeAt.call(url, schemeStart + 2) | 32;\n if (c0 === 119 && c1 === 115 && c2 === 115) return 1; // wss\n if (c0 === 102 && c1 === 116 && c2 === 112) return 1; // ftp\n return 0;\n } else if (length === 4) {\n const c1 = charCodeAt.call(url, schemeStart + 1) | 32;\n const c2 = charCodeAt.call(url, schemeStart + 2) | 32;\n const c3 = charCodeAt.call(url, schemeStart + 3) | 32;\n if (c0 === 104 && c1 === 116 && c2 === 116 && c3 === 112) return 1; // http\n if (c0 === 102 && c1 === 105 && c2 === 108 && c3 === 101) return 2; // file\n return 0;\n } else if (length === 5) {\n return c0 === 104 &&\n (charCodeAt.call(url, schemeStart + 1) | 32) === 116 &&\n (charCodeAt.call(url, schemeStart + 2) | 32) === 116 &&\n (charCodeAt.call(url, schemeStart + 3) | 32) === 112 &&\n (charCodeAt.call(url, schemeStart + 4) | 32) === 115\n ? 1\n : 0; // https\n }\n return 0;\n}\n\n/**\n * Extract a hostname from `url`, matching a WHATWG URL parser's host-boundary\n * behaviour (https://url.spec.whatwg.org/#concept-basic-url-parser) for tldts'\n * scope. It deliberately does NOT normalise the host (no IDNA/punycode or IPv4\n * canonicalisation; IPv6 brackets are stripped, not compressed), strips trailing\n * dots, and stays lenient where a strict parser rejects (bare host:port,\n * out-of-range port, user@host) — all documented deviations.\n *\n * @param urlIsValidHostname - when true, `url` is already a valid hostname and is\n * returned by the same reference (factory.ts skips re-validation on that\n * identity), keeping the common path allocation-free.\n * @param validate - when true, validate the host inline during the authority\n * scan and publish the verdict via `extractedHostnameValidated` so `parseImpl`\n * can skip the redundant `isValidHostname` pass for simple authorities.\n */\nexport default function extractHostname(\n url: string,\n urlIsValidHostname: boolean,\n validate = false,\n): string | null {\n let start = 0;\n let end: number = url.length;\n let hasUpper = false;\n let failedValidation = false; // inline validation failed (always so with a '%')\n let isSpecial = true; // '\\' ends the host, unless non-special \"scheme://\"\n extractedHostnameValidated = false;\n extractedBracketedHost = false;\n\n if (!urlIsValidHostname) {\n // WHATWG step 1: trim leading/trailing C0 control or space (<= U+0020).\n // Tab/newline elsewhere are handled lazily below.\n while (start < url.length && charCodeAt.call(url, start) <= 32) {\n start += 1;\n }\n\n // \"data:\"/\"javascript:\" never reach a host (inline payload; data URLs may be\n // huge). `| 32` lowercases letters only; tab/newline is re-parsed below.\n if (\n (charCodeAt.call(url, start + 4) === 58 /* ':' */ &&\n (charCodeAt.call(url, start) | 32) === 100 /* d */ &&\n (charCodeAt.call(url, start + 1) | 32) === 97 /* a */ &&\n (charCodeAt.call(url, start + 2) | 32) === 116 /* t */ &&\n (charCodeAt.call(url, start + 3) | 32) === 97) /* a */ ||\n (charCodeAt.call(url, start + 10) === 58 /* ':' */ &&\n (charCodeAt.call(url, start) | 32) === 106 /* j */ &&\n (charCodeAt.call(url, start + 1) | 32) === 97 /* a */ &&\n (charCodeAt.call(url, start + 2) | 32) === 118 /* v */ &&\n (charCodeAt.call(url, start + 3) | 32) === 97 /* a */ &&\n (charCodeAt.call(url, start + 4) | 32) === 115 /* s */ &&\n (charCodeAt.call(url, start + 5) | 32) === 99 /* c */ &&\n (charCodeAt.call(url, start + 6) | 32) === 114 /* r */ &&\n (charCodeAt.call(url, start + 7) | 32) === 105 /* i */ &&\n (charCodeAt.call(url, start + 8) | 32) === 112 /* p */ &&\n (charCodeAt.call(url, start + 9) | 32) === 116) /* t */\n ) {\n return null;\n }\n\n while (end > start + 1 && charCodeAt.call(url, end - 1) <= 32) {\n end -= 1;\n }\n\n if (\n (charCodeAt.call(url, start) === 47 /* '/' */ ||\n charCodeAt.call(url, start) === 92) /* '\\' */ &&\n (charCodeAt.call(url, start + 1) === 47 /* '/' */ ||\n charCodeAt.call(url, start + 1) === 92) /* '\\' */\n ) {\n // Scheme-relative reference (\"//host/path\"). Relative to a web page, a\n // special URL, browsers skip any further slashes (\"///host\").\n start += 2;\n while (\n charCodeAt.call(url, start) === 47 /* '/' */ ||\n charCodeAt.call(url, start) === 92 /* '\\' */\n ) {\n start += 1;\n }\n } else {\n // The scheme ends at the first \":/\". Most URLs start with \"http://\" or\n // \"https://\", so check for those before searching.\n let indexOfProtocol =\n charCodeAt.call(url, start + 4) === 115 /* 's' */\n ? start + 5\n : start + 4;\n if (\n charCodeAt.call(url, start) !== 104 /* 'h' */ ||\n charCodeAt.call(url, start + 1) !== 116 /* 't' */ ||\n charCodeAt.call(url, start + 2) !== 116 /* 't' */ ||\n charCodeAt.call(url, start + 3) !== 112 /* 'p' */ ||\n charCodeAt.call(url, indexOfProtocol) !== 58 /* ':' */ ||\n charCodeAt.call(url, indexOfProtocol + 1) !== 47 /* '/' */\n ) {\n indexOfProtocol = url.indexOf(':/', start);\n }\n if (indexOfProtocol !== -1) {\n // \"scheme://…\". Classify the scheme, then position `start` at the host.\n const special = getSpecialScheme(url, start, indexOfProtocol);\n if (special === 1) {\n // Special scheme: skip the run of '/' and '\\' after it\n // (special-authority-(ignore-)slashes states; '\\' acts as '/').\n start = indexOfProtocol + 2;\n while (\n charCodeAt.call(url, start) === 47 /* '/' */ ||\n charCodeAt.call(url, start) === 92 /* '\\' */\n ) {\n start += 1;\n }\n } else if (special === 2) {\n // file: the host is only what sits between \"//\" and the next slash, so\n // \"file://h/x\" => \"h\" but \"file:///x\" / \"file:/x\" => no host.\n start = indexOfProtocol + 1;\n let slashes = 0;\n while (\n (charCodeAt.call(url, start) === 47 ||\n charCodeAt.call(url, start) === 92) &&\n slashes < 2\n ) {\n start += 1;\n slashes += 1;\n }\n if (slashes < 2) {\n return noHostname(url, urlIsValidHostname, validate);\n }\n } else if (!isScheme(url, start, start + 1)) {\n // No scheme: one starts with an ASCII letter (\"1a://x\" is no URL for\n // browsers). Read the input as an authority, as below.\n indexOfProtocol = -1;\n } else {\n // Unknown scheme: validate the WHATWG scheme grammar [A-Za-z0-9+.-];\n // a control char means it was split by a tab/newline (strip + re-parse).\n for (let i = start; i < indexOfProtocol; i += 1) {\n const code = charCodeAt.call(url, i);\n if (!isSchemeChar(code)) {\n if (\n code === 9 /* tab */ ||\n code === 10 /* LF */ ||\n code === 13 /* CR */\n ) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n // A scheme ending at a first ':' (other than a slash-less special\n // one) makes this ':/' part of an opaque path (\"foo:bar://x\", no\n // host), unless a '/', '\\', '?' or '#' first puts it in a path,\n // query or fragment (\"a.com/r?u=https://x\"). Otherwise no scheme\n // ends here: this ':/' is an empty port, after a slash-less\n // special scheme (\"http:a.com:/x\") or an authority\n // (\"user@host:/x\"). Read the input as such below.\n if (\n code === 58 /* ':' */ &&\n getSpecialScheme(url, start, i) !== 1\n ) {\n for (let j = i; j < indexOfProtocol; j += 1) {\n const c = charCodeAt.call(url, j);\n if (c === 47 || c === 92 || c === 63 || c === 35) {\n indexOfProtocol = -1;\n break;\n }\n }\n if (indexOfProtocol !== -1) {\n return noHostname(url, urlIsValidHostname, validate);\n }\n }\n indexOfProtocol = -1;\n break;\n }\n }\n if (indexOfProtocol !== -1) {\n // A non-special scheme has an authority only after \"//\" (else it is\n // an opaque path with no host). `indexOf(':/')` already gave the\n // first '/'.\n if (charCodeAt.call(url, indexOfProtocol + 2) === 47 /* '/' */) {\n isSpecial = false;\n start = indexOfProtocol + 3;\n } else {\n return noHostname(url, urlIsValidHostname, validate);\n }\n }\n }\n }\n\n if (\n indexOfProtocol === -1 &&\n charCodeAt.call(url, start) !== 91 /* '[' */\n ) {\n // Cold path: no \"scheme://\" prefix, and not a bare IPv6 literal (whose\n // first ':' would otherwise look like a scheme separator; \"[…]\" falls\n // through to the ipv6 handling below). May be a bare host, a host:port,\n // a user@host, a slash-less special scheme (\"https:host\"), or an opaque\n // URI (\"mailto:\", \"tel:\", \"urn:…\").\n let indexOfColon = -1;\n for (let i = start; i < end; i += 1) {\n const code = charCodeAt.call(url, i);\n if (code === 9 || code === 10 || code === 13) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n if (code === 58 /* ':' */) {\n indexOfColon = i;\n break;\n }\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n }\n\n if (indexOfColon !== -1) {\n // An '@' before the next delimiter => the ':' is userinfo, not a\n // scheme (\"user:pass@host\", \"mailto:a@b\"): keep the whole authority.\n // Not after \"file:\", which has no userinfo and no host without \"//\".\n const special = getSpecialScheme(url, start, indexOfColon);\n let hasIdentifier = false;\n for (\n let i = special === 2 ? end : indexOfColon + 1;\n i < end;\n i += 1\n ) {\n const code = charCodeAt.call(url, i);\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n if (code === 64 /* '@' */) {\n hasIdentifier = true;\n break;\n }\n }\n\n if (!hasIdentifier) {\n // All-digits after ':' => a bare \"host:port\" (tldts accepts\n // hostnames too); keep `start` and let the port handling trim it.\n // Not after a special scheme though: \"http:8080\" is a URL.\n let allDigits = special === 0;\n let i = indexOfColon + 1;\n for (; i < end; i += 1) {\n const code = charCodeAt.call(url, i);\n if (code === 47 || code === 92 || code === 63 || code === 35) {\n break;\n }\n if (code < 48 /* '0' */ || code > 57 /* '9' */) {\n allDigits = false;\n break;\n }\n }\n if (i === indexOfColon + 1) {\n allDigits = false; // nothing after ':' => not a port\n }\n\n if (!allDigits) {\n if (special === 0) {\n // No \"scheme://\" on the cold path and not a special scheme.\n // A second ':' before the host's end marks a bare, unbracketed\n // IPv6 literal (\"2a01:e35::1\"): fall through and let the host\n // loop + isIp classify it. Without one this is an opaque path\n // with no host (\"mailto:x\", \"foo:bar\").\n let isBareIpv6 = false;\n for (let j = indexOfColon + 1; j < end; j += 1) {\n const code = charCodeAt.call(url, j);\n if (\n code === 47 ||\n code === 92 ||\n code === 63 ||\n code === 35\n ) {\n break;\n }\n if (code === 58 /* ':' */) {\n isBareIpv6 = true;\n break;\n }\n }\n // Not a scheme either (\"@host:\", \"a_b:/x\"): an authority, if\n // its ':' starts an empty port (digits were read above).\n // Browsers have no host for \"a_b:x\".\n const next = charCodeAt.call(url, i);\n if (\n !isBareIpv6 &&\n (isScheme(url, start, indexOfColon) ||\n (i < end &&\n next !== 47 &&\n next !== 92 &&\n next !== 63 &&\n next !== 35))\n ) {\n return noHostname(url, urlIsValidHostname, validate);\n }\n } else {\n start = indexOfColon + 1;\n if (special === 2) {\n // file (e.g. \"file:\\\\host\"): host only between \"//\" and next slash.\n let slashes = 0;\n while (\n (charCodeAt.call(url, start) === 47 ||\n charCodeAt.call(url, start) === 92) &&\n slashes < 2\n ) {\n start += 1;\n slashes += 1;\n }\n if (slashes < 2) {\n return noHostname(url, urlIsValidHostname, validate);\n }\n } else {\n while (\n charCodeAt.call(url, start) === 47 ||\n charCodeAt.call(url, start) === 92\n ) {\n start += 1;\n }\n }\n }\n }\n }\n }\n }\n }\n\n // Find the host's end: first '/', '?' or '#' (and '\\' for special URLs,\n // which WHATWG treats like '/'). Track the last '@' and ':' for userinfo\n // and port, plus the first ':' of the host (reset at each\n // '@') to tell a bare IPv6 (>= 2 colons) from a host:port (exactly one);\n // flag uppercase and a stray tab/newline. The loop is split on `code < 64`\n // so common host characters take fewer comparisons.\n //\n // When `validate`, also accumulate `is-valid.ts`'s checks over the scanned\n // run so a simple authority's host can be validated in this single pass.\n // `vValid` only stays meaningful for a \"simple\" authority (no userinfo, port,\n // brackets, control or trailing dot); those cases clear it / are rejected by\n // the guard below, falling back to `isValidHostname`.\n let indexOfIdentifier = -1;\n let indexOfPort = -1;\n let indexOfFirstColon = -1;\n let hasControl = false;\n let vValid = validate; // seeded true when validating; cleared on the first invalid char\n let vLastDot = start - 1; // mirrors is-valid.ts `lastDotIndex = -1` at host start\n let vLastCode = -1;\n if (validate && start < end) {\n // First-char rule: must be a valid host char, '.', or '_' (NOT '-').\n const c0 = charCodeAt.call(url, start);\n if (\n // Keep these parens: they scope /*@__INLINE__*/ for terser.\n // prettier-ignore\n !(\n /*@__INLINE__*/ (\n isValidHostnameChar(c0) ||\n c0 === 46 /* '.' */ ||\n c0 === 95 /* '_' */\n )\n ) ||\n c0 === 45 /* '-' (isValidHostnameChar allows it mid-label, not first) */\n ) {\n vValid = false;\n }\n }\n for (let i = start; i < end; i += 1) {\n const code: number = charCodeAt.call(url, i);\n if (code < 64) {\n if (code === 47 || code === 35 || code === 63) {\n end = i;\n break;\n } else if (code === 58 /* ':' */) {\n if (indexOfFirstColon === -1) {\n indexOfFirstColon = i;\n }\n indexOfPort = i;\n } else if (code === 9 || code === 10 || code === 13) {\n hasControl = true;\n } else if (validate) {\n if (code === 46 /* '.' */) {\n if (i - vLastDot > 64 || vLastCode === 46 || vLastCode === 45) {\n vValid = false;\n }\n vLastDot = i;\n } else if (code < 48 || code > 57) {\n // < 64 and not a delimiter/dot/digit => only '-' (45) is a valid\n // host char here; everything else (space, %, !, etc.) is invalid.\n // A '-' must also not START a label (the byte right after a '.') —\n // mirrors is-valid.ts; the first label is covered by the first-char\n // rule above. (RFC 1034 §3.5 / RFC 1035 §2.3.1 LDH.)\n if (code !== 45 || vLastCode === 46 /* label-leading '-' */) {\n vValid = false;\n }\n }\n }\n } else if (isSpecial && code === 92 /* '\\' */) {\n end = i;\n break;\n } else if (code === 64 /* '@' */) {\n indexOfIdentifier = i;\n indexOfFirstColon = -1; // colons before '@' are userinfo, not the host\n } else if (code >= 65 && code <= 90) {\n hasUpper = true;\n } else if (validate && !(/*@__INLINE__*/ isValidHostnameChar(code))) {\n // >= 64, not '@'/']'/upper: valid only if a-z, '_', or non-ASCII.\n vValid = false;\n }\n if (validate) {\n vLastCode = code;\n }\n }\n\n // A tab/newline inside the authority: strip everything and re-parse (rare).\n if (hasControl) {\n return extractHostname(\n url.replace(CONTROL_CHARS, ''),\n urlIsValidHostname,\n validate,\n );\n }\n\n // Skip userinfo. '>= start' so an empty userinfo (\"http://@host\") works too.\n if (\n indexOfIdentifier !== -1 &&\n indexOfIdentifier >= start &&\n indexOfIdentifier < end\n ) {\n start = indexOfIdentifier + 1;\n }\n\n if (charCodeAt.call(url, start) === 91 /* '[' */) {\n // ipv6 address: return what is between the brackets, or null if they are\n // unclosed or followed by anything but a port (\"[::1]x\"). `parseImpl`\n // checks that they hold an IPv6 address (see `extractedBracketedHost`).\n const closingBracket = url.indexOf(']', start);\n if (\n closingBracket !== -1 &&\n closingBracket < end &&\n (closingBracket + 1 === end ||\n charCodeAt.call(url, closingBracket + 1) === 58) /* ':' */\n ) {\n extractedBracketedHost = true;\n return url.slice(start + 1, closingBracket).toLowerCase();\n }\n return null;\n } else if (\n indexOfPort !== -1 &&\n indexOfPort > start &&\n indexOfPort < end &&\n // A host:port has exactly one ':' in the host (so its first ':' is its\n // last); a bare, unbracketed IPv6 literal (\"2a01:e35::1\") has >= 2, so\n // its first ':' precedes the last. Only the former has a ':port' to trim.\n indexOfFirstColon === indexOfPort\n ) {\n end = indexOfPort; // trim ':port'\n }\n\n // Empty authority (\"http://\", \"file:///path\", \"//\"), unless a tab or\n // newline hides one (\"/\\t/host\"); only reachable here via extraction — a\n // bare valid hostname never lands here.\n if (start >= end) {\n return noHostname(url, urlIsValidHostname, validate);\n }\n\n // Publish the inline-validation verdict — but only for a \"simple\" authority,\n // where the scanned run equals the final host: no userinfo skip, no port\n // trim, no brackets, no trailing dot (trimmed below), and length within RFC\n // limits. Anything else leaves it `false` so `parseImpl` re-validates.\n //\n // Every clause below is load-bearing for CORRECTNESS, not just speed: the\n // loop accumulates `vValid` over the whole scanned run (it does not stop at\n // ':' or '@', so any port/userinfo bytes are included), so the verdict is\n // only sound when that run equals the final host. Do not drop a clause as\n // \"redundant\" — e.g. without `indexOfPort === -1`, `host:8080` would be\n // wrongly accepted.\n if (\n validate &&\n vValid &&\n indexOfIdentifier === -1 &&\n indexOfPort === -1 &&\n charCodeAt.call(url, end - 1) !== 46 /* no trailing dot */ &&\n end - start <= 255 && // total length\n end - vLastDot - 1 <= 63 && // last label length\n vLastCode !== 45 /* last char not '-' */\n ) {\n extractedHostnameValidated = true;\n }\n failedValidation = validate && !vValid;\n }\n\n // Trim trailing dots\n while (end > start + 1 && charCodeAt.call(url, end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n\n const hostname: string =\n start !== 0 || end !== url.length ? url.slice(start, end) : url;\n\n // Browsers percent-decode the host of a special URL (\"%74racker.com\" is\n // tracker.com). Only when validating: otherwise the host is kept as written.\n if (failedValidation && isSpecial && hostname.includes('%')) {\n return decodeHostname(hostname);\n }\n\n if (hasUpper) {\n return hostname.toLowerCase();\n }\n\n return hostname;\n}\n","// Auto-generated by packages/tldts-utils/bin/ip-mapping.js (Node.js v26.13.1, Unicode 18.0). Do not edit.\n//\n// Non-ASCII code points that the host parser of browsers deletes, or maps to\n// '.', or to digits, 'a'-'f' and 'x' only, as ranges: code points\n// `ipMappingFirst[k]` to `ipMappingLast[k]` map, with `value = ipMappingValue[k]`\n// and `offset` the position in the range: to nothing if `value` is 0, to the\n// character `value + offset` if `value` is below 128, to the decimal number\n// `value - 1000 + offset` if `value` is below 2000, and else to the two\n// characters `value >> 8` and `value & 255`.\nexport const ipMappingFirst = /*#__PURE__*/ new Uint32Array([170,173,178,185,739,847,4447,6068,6155,7468,7470,7472,7491,7495,7496,7580,7584,8203,8288,8298,8304,8308,8320,8336,8337,8339,8450,8492,8495,8496,8517,8518,8553,8557,8569,8573,9312,9321,9398,9421,9424,9447,9450,12290,12644,12881,12977,13170,13252,13253,13256,42994,42995,64256,65024,65279,65294,65296,65313,65336,65345,65368,65377,65440,113824,117974,117997,118000,119155,119808,119831,119834,119857,119860,119883,119886,119909,119912,119935,119938,119961,119964,119966,119987,119990,119995,120013,120016,120039,120042,120065,120068,120071,120091,120094,120117,120120,120123,120143,120146,120169,120172,120195,120198,120221,120224,120247,120250,120273,120276,120299,120302,120325,120328,120351,120354,120377,120380,120403,120406,120429,120432,120455,120458,120481,120782,120792,120802,120812,120822,127275,127277,127280,127303,130032,917760]);\nexport const ipMappingLast = /*#__PURE__*/ new Uint32Array([170,173,179,185,739,847,4448,6069,6159,7468,7470,7473,7491,7495,7497,7580,7584,8203,8292,8303,8304,8313,8329,8336,8337,8339,8450,8493,8495,8497,8517,8519,8553,8558,8569,8574,9320,9331,9403,9421,9429,9447,9450,12290,12644,12895,12991,13170,13252,13253,13256,42994,42995,64256,65039,65279,65294,65305,65318,65336,65350,65368,65377,65440,113827,117979,117997,118009,119162,119813,119831,119839,119857,119865,119883,119891,119909,119917,119935,119943,119961,119964,119967,119987,119993,119995,120013,120021,120039,120047,120065,120069,120073,120091,120099,120117,120121,120125,120143,120151,120169,120177,120195,120203,120221,120229,120247,120255,120273,120281,120299,120307,120325,120333,120351,120359,120377,120385,120403,120411,120429,120437,120455,120463,120481,120791,120801,120811,120821,120831,127275,127277,127285,127303,130041,917999]);\nexport const ipMappingValue = /*#__PURE__*/ new Uint16Array([97,0,50,49,120,0,0,0,0,97,98,100,97,98,100,99,102,0,0,0,48,52,48,97,101,120,99,98,101,101,100,100,120,99,120,99,49,1010,97,120,97,120,48,46,0,1021,1036,25697,25443,25444,25698,99,102,26214,0,0,46,48,97,120,97,120,46,0,0,97,120,48,0,97,120,97,120,97,120,97,120,97,120,97,120,97,99,120,97,102,120,97,120,97,120,97,100,120,97,120,97,100,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,97,120,48,48,48,48,48,99,25444,97,120,48,0]);\n// Bit `(cp >> 8) & 31` of `ipMappingBlocks[cp >> 13]` is set when the block of\n// 256 code points holding `cp` (below U+10000) holds any of them.\nexport const ipMappingBlocks = /*#__PURE__*/ new Uint32Array([562167821,983059,0,0,0,128,0,3355443200]);\n","/**\n * Detection of IP addresses, as defined by the host parser of the WHATWG URL\n * standard (https://url.spec.whatwg.org/#host-parsing), which browsers follow.\n * Addresses are recognized, never rewritten: `0x7f.1` is 127.0.0.1 for a\n * browser, hence an IP here, but stays `0x7f.1`.\n */\n\nimport {\n ipMappingBlocks,\n ipMappingFirst,\n ipMappingLast,\n ipMappingValue,\n} from './ip-mapping';\n\n/**\n * Value of the hexadecimal digit `code` (0 to 15), or 16 if it is not one.\n */\nfunction hexValue(code: number): number {\n if (code >= 48 && code <= 57) {\n return code - 48; // 0-9\n }\n const letter = code | 32; // lower-case\n return letter >= 97 && letter <= 102 ? letter - 87 : 16; // a-f\n}\n\n/**\n * Check if `hostname` is an IPv4 address: one to four numbers separated by\n * dots, each one decimal, octal (leading `0`) or hexadecimal (leading `0x`).\n * The last number fills the bytes the others leave, so `127.1` and\n * `2130706433` are both 127.0.0.1.\n * https://url.spec.whatwg.org/#concept-ipv4-parser\n */\nfunction isIpv4(hostname: string): boolean {\n const end = hostname.length;\n let i = 0;\n\n for (let numbers = 1; numbers <= 4; numbers += 1) {\n let radix = 10;\n if (i + 1 < end && hostname.charCodeAt(i) === 48 /* '0' */) {\n radix = 8;\n if ((hostname.charCodeAt(i + 1) | 32) === 120 /* 'x' */) {\n radix = 16;\n i += 2;\n }\n }\n\n const start = i;\n let value = 0;\n for (; i < end; i += 1) {\n const code = hostname.charCodeAt(i);\n if (code === 46 /* '.' */) {\n break;\n }\n const digit = hexValue(code);\n if (digit >= radix) {\n return false;\n }\n value = value * radix + digit;\n }\n\n // A number has digits, except \"0x\" which is 0.\n if (i === start && radix !== 16) {\n return false;\n }\n\n if (i === end) {\n return value <= 0xffffffff >>> (8 * (numbers - 1));\n }\n if (value > 255) {\n return false;\n }\n i += 1; // '.'\n }\n\n return false;\n}\n\n/**\n * Check if `hostname[i, end)` is made of four decimal numbers separated by\n * dots, each one between 0 and 255 and without leading zero.\n */\nfunction isDottedDecimal(hostname: string, i: number, end: number): boolean {\n for (let numbers = 1; numbers <= 4; numbers += 1) {\n const start = i;\n let value = 0;\n for (; i < end; i += 1) {\n const digit = hostname.charCodeAt(i) - 48;\n if (digit < 0 || digit > 9) {\n break;\n }\n value = value * 10 + digit;\n // Only a leading zero keeps a number of several digits below 10.\n if (value > 255 || (value < 10 && i !== start)) {\n return false;\n }\n }\n\n if (i === start) {\n return false;\n }\n if (numbers < 4) {\n if (hostname.charCodeAt(i) !== 46 /* '.' */) {\n return false;\n }\n i += 1;\n }\n }\n\n return i === end;\n}\n\n/**\n * Check if `hostname` is an IPv6 address, with or without its brackets: eight\n * groups of one to four hexadecimal digits separated by colons, where a `::`\n * may stand once for one or more missing groups, and a dotted-decimal IPv4\n * address may stand for the last two.\n * https://url.spec.whatwg.org/#concept-ipv6-parser\n */\nfunction isIpv6(hostname: string): boolean {\n let i = 0;\n let end = hostname.length;\n\n if (hostname.charCodeAt(0) === 91 /* '[' */) {\n if (hostname.charCodeAt(end - 1) !== 93 /* ']' */) {\n return false;\n }\n i = 1;\n end -= 1;\n }\n\n // An address only starts with a ':' if it starts with \"::\".\n if (i < end && hostname.charCodeAt(i) === 58 /* ':' */) {\n if (i + 1 === end || hostname.charCodeAt(i + 1) !== 58 /* ':' */) {\n return false;\n }\n i += 1;\n }\n\n let groups = 0;\n let compressed = false; // \"::\" was seen, and counted as one group\n\n // Here `i` is where a group starts: a ':' can only be the second of a \"::\".\n while (i < end && groups < 8) {\n if (hostname.charCodeAt(i) === 58 /* ':' */) {\n if (compressed) {\n return false;\n }\n compressed = true;\n groups += 1;\n i += 1;\n continue;\n }\n\n const start = i;\n while (\n i < end &&\n i - start < 4 &&\n hexValue(hostname.charCodeAt(i)) !== 16\n ) {\n i += 1;\n }\n if (i === start) {\n return false;\n }\n if (i === end) {\n return compressed || groups === 7;\n }\n\n if (hostname.charCodeAt(i) === 46 /* '.' */) {\n return (\n (compressed ? groups <= 6 : groups === 6) &&\n isDottedDecimal(hostname, start, end)\n );\n }\n\n // Anything else is a ':' followed by another group, or by a ':'.\n if (hostname.charCodeAt(i) !== 58 /* ':' */ || i + 1 === end) {\n return false;\n }\n groups += 1;\n i += 1;\n }\n\n return compressed && i === end;\n}\n\n/**\n * What the host parser of browsers maps the non-ASCII code point `cp` to, as\n * far as IP detection goes: nothing (deleted), '.', digits, 'a'-'f' or 'x', or\n * else 'g', standing for any character that keeps a label from being a number.\n * https://www.unicode.org/reports/tr46/#Processing\n */\nfunction mapCodePoint(cp: number): string {\n // Most letters, as in internationalized domain names, are in blocks of the\n // table without any entry.\n if (\n cp < 0x10000 &&\n ((ipMappingBlocks[cp >> 13]! >>> ((cp >> 8) & 31)) & 1) === 0\n ) {\n return 'g';\n }\n let low = 0;\n let high = ipMappingFirst.length - 1;\n while (low <= high) {\n const mid = (low + high) >>> 1;\n if (cp < ipMappingFirst[mid]!) {\n high = mid - 1;\n } else if (cp > ipMappingLast[mid]!) {\n low = mid + 1;\n } else {\n const value = ipMappingValue[mid]!;\n const offset = cp - ipMappingFirst[mid]!;\n if (value === 0) {\n return '';\n }\n if (value < 128) {\n return String.fromCharCode(value + offset);\n }\n if (value < 2000) {\n return String(value - 1000 + offset);\n }\n return String.fromCharCode(value >> 8, value & 255);\n }\n }\n return 'g';\n}\n\n/**\n * `isIp` for a host holding non-ASCII characters, read as browsers read it:\n * they first map some characters to digits or dots and delete others, so that\n * `127.0.0.1`, or `127.0.0.1` followed by a zero-width space, is 127.0.0.1\n * for them. The host is mapped the same way, as far as IP detection goes, and\n * checked again.\n */\nfunction isMappedIp(hostname: string): boolean | null {\n // Most such hosts are internationalized domain names, with a character that\n // keeps their last label from being a number: find it first.\n for (let i = hostname.length - 1; i >= 0; i -= 1) {\n let cp = hostname.charCodeAt(i);\n if (cp === 46 /* '.' */) {\n break;\n }\n if (cp < 128) {\n if (hexValue(cp) === 16 && (cp | 32) !== 120 /* 'x' */) {\n return false;\n }\n continue;\n }\n // Most letters are in blocks of 256 code points without any entry.\n if (\n cp < 0xd800 &&\n ((ipMappingBlocks[cp >> 13]! >>> ((cp >> 8) & 31)) & 1) === 0\n ) {\n return false;\n }\n if (cp >= 0xdc00 && cp <= 0xdfff && i > 0) {\n const high = hostname.charCodeAt(i - 1);\n if (high >= 0xd800 && high <= 0xdbff) {\n cp = (high - 0xd800) * 0x400 + (cp - 0xdc00) + 0x10000;\n i -= 1;\n }\n }\n const mapped = mapCodePoint(cp);\n if (mapped === 'g') {\n return false;\n }\n if (mapped === '.') {\n break;\n }\n }\n\n // Browsers read an IPv6 address, between brackets, as written: a host\n // holding non-ASCII characters is never one.\n if (hostname.includes(':')) {\n return false;\n }\n\n let ascii = '';\n for (let i = 0; i < hostname.length; i += 1) {\n const code = hostname.charCodeAt(i);\n if (code < 128) {\n ascii += hostname.charAt(i);\n } else {\n let cp = code;\n if (code >= 0xd800 && code <= 0xdbff) {\n const low = hostname.charCodeAt(i + 1);\n if (low >= 0xdc00 && low <= 0xdfff) {\n cp = (code - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000;\n i += 1;\n }\n }\n ascii += mapCodePoint(cp);\n }\n }\n\n // Trailing dots go, as callers remove them from `hostname`.\n let end = ascii.length;\n while (end > 1 && ascii.charCodeAt(end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n return isIp(ascii.slice(0, end));\n}\n\n/**\n * For a host ending in a number without being an IP address in ASCII: `null`,\n * unless it holds non-ASCII characters, which browsers may map (see\n * `isMappedIp`).\n */\nfunction isNonAsciiIp(hostname: string): boolean | null {\n for (let i = 0; i < hostname.length; i += 1) {\n if (hostname.charCodeAt(i) >= 128) {\n return isMappedIp(hostname);\n }\n }\n return null;\n}\n\n/**\n * Check if `hostname` is an IP address (either IPv4 or IPv6).\n *\n * The answer is `null` for a host ending in a number without being an IPv4\n * address (`1.2.3.4.5`, `example.123`): browsers read such a host as an\n * address and nothing else, so it is not a valid host, and never a domain.\n * `hostname` has no trailing dot: callers strip them.\n */\nexport default function isIp(hostname: string): boolean | null {\n // Go backward over the digits ending `hostname`, decimal ones first, then\n // hexadecimal ones, down to `code`, the character before them (NaN before\n // the start of `hostname`). It tells what `hostname` may be, and most often\n // that it is not an address.\n const last = hostname.length - 1;\n let i = last;\n let code = hostname.charCodeAt(i);\n while (code >= 48 && code <= 57 /* 0-9 */) {\n i -= 1;\n code = hostname.charCodeAt(i);\n }\n const decimal = i;\n while (hexValue(code) !== 16) {\n i -= 1;\n code = hostname.charCodeAt(i);\n }\n\n // An IPv6 address ends with a group, which follows a ':', with \"::\" or\n // with a ']'. Its last label is not a number then.\n if (code === 58 /* ':' */ || code === 93 /* ']' */) {\n return isIpv6(hostname);\n }\n\n // An IPv4 address ends with a number: a last label only made of decimal\n // digits, or of \"0x\" followed by hexadecimal digits. An IPv6 address ending\n // with an IPv4 one ends with a number too.\n // https://url.spec.whatwg.org/#ends-in-a-number-checker\n if (\n (i === decimal && i !== last && (code === 46 /* '.' */ || i === -1)) ||\n ((code | 32) === 120 /* 'x' */ &&\n hostname.charCodeAt(i - 1) === 48 /* '0' */ &&\n (i === 1 || hostname.charCodeAt(i - 2) === 46)) /* '.' */\n ) {\n return isIpv4(hostname) || isIpv6(hostname) ? true : isNonAsciiIp(hostname);\n }\n\n // A non-ASCII character right before the digits ending `hostname`, or one\n // or two characters before their \"x\", may be one that browsers map to a\n // digit or a dot, or delete: `hostname` may end in a number for them.\n return code >= 128 ||\n ((code | 32) === 120 /* 'x' */ &&\n (hostname.charCodeAt(i - 1) >= 128 || hostname.charCodeAt(i - 2) >= 128))\n ? isMappedIp(hostname)\n : false;\n}\n","/**\n * Special-use domain names from the IANA \"Special-Use Domain Names\" registry:\n * the authoritative list, created by RFC 6761 and maintained as new RFCs add to\n * it: https://www.iana.org/assignments/special-use-domain-names/\n * Snapshot: 2026-05-24. (RFC 6761 is not obsoleted; draft-hoffman-rfc6761bis\n * proposes to retire its prose but keep this registry, so the registry is the\n * source of truth; re-sync this list against it.)\n *\n * These names never correspond to a public registration, yet neither\n * `isIcann` nor `isPrivate` marks one as special-use: most are absent from the\n * Public Suffix List (so `a.test` looks like a registrable domain), and the\n * few that are listed (`onion`, `home.arpa`) appear there as ordinary ICANN\n * suffixes. `isSpecialUse` is the single signal that covers them all.\n *\n * Per the registry and RFC 6761 (\"and any names falling within these domains\"),\n * the designation covers each listed name AND all of its sub-domains. DNS labels\n * are case-insensitive (RFC 4343); `hostname` is expected to be already\n * lower-cased and trailing-dot-stripped, as produced by `extractHostname`, the\n * same normalization the Public-Suffix-List lookup relies on.\n *\n * Two groups of registry entries are intentionally excluded: the numeric\n * reverse-DNS delegation zones (`10.in-addr.arpa`, the `*.ip6.arpa` ranges, …),\n * which are reverse-DNS PTR zones rather than hostnames and whose parents\n * (`in-addr.arpa`/`ip6.arpa`) are already in the Public Suffix List; and the\n * deprecated `eap-noob.arpa` entry.\n */\nconst SPECIAL_USE_DOMAINS: readonly string[] = [\n 'test', // RFC 6761\n 'localhost', // RFC 6761\n 'invalid', // RFC 6761\n 'example', // RFC 6761\n 'example.com', // RFC 6761\n 'example.net', // RFC 6761\n 'example.org', // RFC 6761\n 'local', // RFC 6762 (mDNS)\n 'onion', // RFC 7686 (Tor)\n 'alt', // RFC 9476\n 'home.arpa', // RFC 8375\n 'ipv4only.arpa', // RFC 8880\n 'resolver.arpa', // RFC 9462\n 'service.arpa', // RFC 9665\n '6tisch.arpa', // RFC 9031\n 'eap.arpa', // RFC 9965\n];\n\n/**\n * Return `true` if `hostname` is, or is a sub-domain of, a special-use domain\n * (see the registry note above). Expects an already-normalized `hostname`.\n */\nexport default function isSpecialUse(hostname: string): boolean {\n for (const name of SPECIAL_USE_DOMAINS) {\n // Match on a label boundary: `hostname` is either exactly `name` or ends\n // with `.name` (so `latest` is not matched by `test`, nor `myexample.com`\n // by `example.com`).\n if (\n hostname.endsWith(name) &&\n (hostname.length === name.length ||\n hostname.charCodeAt(hostname.length - name.length - 1) === 46) /* '.' */\n ) {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Implements fast shallow verification of hostnames. This does not perform a\n * struct check on the content of labels (classes of Unicode characters, etc.)\n * but instead check that the structure is valid (number of labels, length of\n * labels, etc.).\n *\n * If you need stricter validation, consider using an external library.\n */\n\n// `charCodeAt.call(s, i)`, not `s.charCodeAt(i)`: V8 specializes a\n// `s.charCodeAt` call site for at most four kinds of strings (flat, sliced,\n// concatenated, internalized, of one or two bytes per character...). Past\n// that, it finds the method through a generic cache and no longer inlines it,\n// on every call. Hostnames come here from callers and from URLs, of any kind.\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst charCodeAt = String.prototype.charCodeAt;\n\n// KEEP IN SYNC with `extract-hostname.ts` `isValidHostnameChar` + its inline\n// scan/verdict, which duplicate these structural rules to validate during\n// extraction (a perf fusion). That copy additionally accepts A-Z (the host is\n// not yet lowercased there) and folds in '-' / '_'. Any change to the accepted\n// character set or the label/length rules here must be mirrored there.\nfunction isValidAscii(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || (code >= 48 && code <= 57) || code > 127\n );\n}\n\n/**\n * Check if a hostname string is valid. It's usually a preliminary check before\n * trying to use getDomain or anything else.\n *\n * Beware: it does not check if the TLD exists.\n */\nexport default function (hostname: string): boolean {\n if (hostname.length > 255) {\n return false;\n }\n\n if (hostname.length === 0) {\n return false;\n }\n\n if (\n /*@__INLINE__*/ !isValidAscii(charCodeAt.call(hostname, 0)) &&\n charCodeAt.call(hostname, 0) !== 46 && // '.' (dot)\n charCodeAt.call(hostname, 0) !== 95 // '_' (underscore)\n ) {\n return false;\n }\n\n // Validate hostname according to RFC\n let lastDotIndex = -1;\n let lastCharCode = -1;\n const len = hostname.length;\n\n for (let i = 0; i < len; i += 1) {\n const code = charCodeAt.call(hostname, i);\n if (code === 46 /* '.' */) {\n if (\n // Check that previous label is < 63 bytes long (64 = 63 + '.')\n i - lastDotIndex > 64 ||\n // Check that previous character was not already a '.'\n lastCharCode === 46 ||\n // Check that the previous label does not end with '-' (RFC 1035 §2.3.1 LDH).\n // '_' is intentionally NOT restricted: DNS allows any octet (RFC 2181 §11) and\n // WHATWG URL does not treat '_' as a forbidden host code point.\n lastCharCode === 45\n ) {\n return false;\n }\n\n lastDotIndex = i;\n } else if (\n // A forbidden character in the label...\n // Keep these parens: they scope /*@__INLINE__*/ for terser.\n // prettier-ignore\n !(/*@__INLINE__*/ (isValidAscii(code) || code === 45 || code === 95)) ||\n // ...or a '-' starting a label (the byte right after a '.'). A label must\n // not begin with a hyphen (RFC 1034 §3.5 / RFC 1035 §2.3.1 LDH, as amended\n // by RFC 1123 §2.1; cf. UTS #46 CheckHyphens). The first label is covered by\n // the leading-character guard above; mirrors the trailing-'-' rule below.\n (code === 45 && lastCharCode === 46)\n ) {\n return false;\n }\n\n lastCharCode = code;\n }\n\n return (\n // Check that last label is shorter than 63 chars\n len - lastDotIndex - 1 <= 63 &&\n // Check that the last character is an allowed trailing label character.\n // Since we already checked that the char is a valid hostname character,\n // we only need to check that it's different from '-'.\n lastCharCode !== 45\n );\n}\n","import { shareSameDomainSuffix } from '../domain';\nimport { IOptions } from '../options';\nimport { IPublicSuffix } from './interface';\n\n/**\n * Apply `options.extraSuffixes` to the built-in lookup result in `out`, as if\n * they were part of the list (`isException`: the built-in winner is an\n * exception rule). As in browsers, the longest match prevails and an exception\n * beats a rule of the same length. Remaining ties go to the built-in match\n * (unless it matched no rule: both flags falsy), then to `icann`.\n */\nexport default function extraSuffixLookup(\n hostname: string,\n options: IOptions,\n isException: boolean,\n out: IPublicSuffix,\n): void {\n const suffix = out.publicSuffix;\n if (suffix === null) {\n return;\n }\n\n // Best extra exception and rule, as start indices in `hostname` (smaller is\n // longer; `none` if unmatched), and whether each is ICANN.\n const none = hostname.length + 1;\n let exception = none;\n let exceptionIsIcann = false;\n let rule = none;\n let ruleIsIcann = false;\n const extra = options.extraSuffixes!;\n for (let section = 0; section < 2; section += 1) {\n const isIcann = section === 0;\n const rules = isIcann\n ? options.allowIcannDomains && extra.icann\n : options.allowPrivateDomains && extra.private;\n if (!Array.isArray(rules)) {\n continue;\n }\n for (const r of rules) {\n // Sparse or untyped lists may hold non-strings.\n if (typeof r !== 'string') {\n continue;\n }\n const exceptionRule = r.startsWith('!');\n const wildcard = r.startsWith('*.');\n const body = exceptionRule ? r.slice(1) : wildcard ? r.slice(2) : r;\n // Skip empty rules, and exceptions without a parent ('!p').\n if (\n body === '' ||\n (exceptionRule && !body.includes('.')) ||\n !shareSameDomainSuffix(hostname, body)\n ) {\n continue;\n }\n let start = hostname.length - body.length;\n // Strict `<`: on a tie, the first match (`icann` first) wins.\n if (exceptionRule) {\n if (start < exception) {\n exception = start;\n exceptionIsIcann = isIcann;\n }\n continue;\n }\n // `*.p` also matches `p`, else one more non-empty label.\n if (wildcard && start > 1 && hostname.charCodeAt(start - 2) !== 46) {\n start = hostname.lastIndexOf('.', start - 2) + 1;\n }\n if (start < rule) {\n rule = start;\n ruleIsIcann = isIcann;\n }\n }\n }\n\n // Start of the built-in match: an exception starts one label left of its\n // suffix.\n const suffixStart = hostname.length - suffix.length;\n const builtin = isException\n ? hostname.lastIndexOf('.', suffixStart - 2) + 1\n : suffixStart;\n // An exception wins ties with rules; a built-in exception wins ties with\n // an extra one.\n if (\n exception <= rule &&\n (isException ? exception < builtin : exception <= builtin)\n ) {\n out.publicSuffix = hostname.slice(hostname.indexOf('.', exception) + 1);\n out.isIcann = exceptionIsIcann;\n out.isPrivate = !exceptionIsIcann;\n } else if (\n rule < builtin ||\n (rule === builtin && !out.isIcann && !out.isPrivate)\n ) {\n out.publicSuffix = hostname.slice(rule);\n out.isIcann = ruleIsIcann;\n out.isPrivate = !ruleIsIcann;\n }\n}\n","export interface IOptions {\n allowIcannDomains: boolean;\n allowPrivateDomains: boolean;\n detectIp: boolean;\n // Detect RFC 6761 / IANA special-use domains and expose the result as\n // `isSpecialUse` on `parse()`. Off by default so the common path stays\n // allocation-free with no extra work; enable it to populate the field.\n detectSpecialUse: boolean;\n // Extra public suffix rules, in PSL syntax, per section (default: null)\n extraSuffixes: {\n icann?: readonly string[];\n private?: readonly string[];\n } | null;\n extractHostname: boolean;\n mixedInputs: boolean;\n validHosts: string[] | null;\n validateHostname: boolean;\n}\n\nfunction setDefaultsImpl({\n allowIcannDomains = true,\n allowPrivateDomains = false,\n detectIp = true,\n detectSpecialUse = false,\n extraSuffixes = null,\n extractHostname = true,\n mixedInputs = true,\n validHosts = null,\n validateHostname = true,\n}: Partial<IOptions>): IOptions {\n return {\n allowIcannDomains,\n allowPrivateDomains,\n detectIp,\n detectSpecialUse,\n extraSuffixes,\n extractHostname,\n mixedInputs,\n validHosts,\n validateHostname,\n };\n}\n\nconst DEFAULT_OPTIONS = /*@__INLINE__*/ setDefaultsImpl({});\n\nexport function setDefaults(options?: Partial<IOptions> | null): IOptions {\n // `null` as well: untyped callers pass it to mean \"no options\".\n if (options === undefined || options === null) {\n return DEFAULT_OPTIONS;\n }\n\n return /*@__INLINE__*/ setDefaultsImpl(options);\n}\n","/**\n * Returns the subdomain of a hostname string\n */\nexport default function getSubdomain(hostname: string, domain: string): string {\n // If `hostname` and `domain` are the same, then there is no sub-domain\n if (domain.length === hostname.length) {\n return '';\n }\n\n return hostname.slice(0, -domain.length - 1);\n}\n","/**\n * Implement a factory allowing to plug different implementations of suffix\n * lookup (e.g.: using a trie or the packed hashes datastructures). This is used\n * and exposed in `tldts.ts` and `tldts-experimental.ts` bundle entrypoints.\n */\n\nimport getDomain from './domain';\nimport getDomainWithoutSuffix from './domain-without-suffix';\nimport extractHostname, {\n extractedHostnameValidated,\n extractedBracketedHost,\n} from './extract-hostname';\nimport isIp from './is-ip';\nimport isSpecialUse from './is-special-use';\nimport isValidHostname from './is-valid';\nimport extraSuffixLookup from './lookup/extra-suffixes';\nimport { IPublicSuffix, ISuffixLookupOptions } from './lookup/interface';\nimport { IOptions, setDefaults } from './options';\nimport getSubdomain from './subdomain';\n\nexport interface IResult {\n // `hostname` is either a registered name (including but not limited to a\n // hostname), or an IP address, directly extracted from the input URL. IPv4\n // addresses are not canonicalized (`0x7f.1` stays `0x7f.1`). IPv6 is\n // returned without its surrounding brackets; both bracketed (in URLs, e.g.\n // `http://[::1]/`) and bare unbracketed (e.g. `2a01:e35::1`) IPv6 literals\n // are accepted.\n hostname: string | null;\n\n // Is `hostname` an IP? (IPv4 or IPv6)\n isIp: boolean | null;\n\n // `hostname` split between subdomain, domain and its public suffix (if any)\n subdomain: string | null;\n domain: string | null;\n publicSuffix: string | null;\n domainWithoutSuffix: string | null;\n\n // Specifies if `publicSuffix` comes from the ICANN or PRIVATE section of the list\n isIcann: boolean | null;\n isPrivate: boolean | null;\n\n // Is `hostname` a special-use domain from the IANA registry (RFC 6761 et al.:\n // e.g. `localhost`, `*.test`, `*.local`, `*.onion`, `home.arpa`)? `isIcann`/\n // `isPrivate` do not identify these (most are not in the Public Suffix List;\n // the few that are appear as ordinary ICANN suffixes). `null` unless the\n // `detectSpecialUse` option is enabled (see is-special-use.ts).\n isSpecialUse: boolean | null;\n}\n\nexport function getEmptyResult(): IResult {\n return {\n domain: null,\n domainWithoutSuffix: null,\n hostname: null,\n isIcann: null,\n isIp: null,\n isPrivate: null,\n isSpecialUse: null,\n publicSuffix: null,\n subdomain: null,\n };\n}\n\nexport function resetResult(result: IResult): void {\n result.domain = null;\n result.domainWithoutSuffix = null;\n result.hostname = null;\n result.isIcann = null;\n result.isIp = null;\n result.isPrivate = null;\n result.isSpecialUse = null;\n result.publicSuffix = null;\n result.subdomain = null;\n}\n\n// Flags representing steps in the `parse` function. They are used to implement\n// an early stop mechanism (simulating some form of laziness) to avoid doing\n// more work than necessary to perform a given action (e.g.: we don't need to\n// extract the domain and subdomain if we are only interested in public suffix).\nexport const enum FLAG {\n HOSTNAME,\n IS_VALID,\n PUBLIC_SUFFIX,\n DOMAIN,\n SUB_DOMAIN,\n ALL,\n}\n\nexport function parseImpl(\n url: string,\n step: FLAG,\n suffixLookup: (\n _1: string,\n _2: ISuffixLookupOptions,\n _3: IPublicSuffix,\n ) => unknown,\n partialOptions: Partial<IOptions> | undefined,\n result: IResult,\n): IResult {\n const options: IOptions = /*@__INLINE__*/ setDefaults(partialOptions);\n\n // Very fast approximate check to make sure `url` is a string. This is needed\n // because the library will not necessarily be used in a typed setup and\n // values of arbitrary types might be given as argument.\n if (typeof url !== 'string') {\n return result;\n }\n\n // Extract hostname from `url` only if needed. This can be made optional\n // using `options.extractHostname`. This option will typically be used\n // whenever we are sure the inputs to `parse` are already hostnames and not\n // arbitrary URLs.\n //\n // `mixedInput` allows to specify if we expect a mix of URLs and hostnames\n // as input. If only hostnames are expected then `extractHostname` can be\n // set to `false` to speed-up parsing. If only URLs are expected then\n // `mixedInputs` can be set to `false`. The `mixedInputs` is only a hint\n // and will not change the behavior of the library.\n // Whether `url` itself was already a valid hostname (only computed on the\n // mixedInputs path). Lets us skip the post-extraction validation below when\n // extractHostname returned `url` unchanged (same reference).\n let urlIsValid = false;\n if (!options.extractHostname) {\n // Trim trailing dots as extractHostname does (`new URL()` keeps them).\n let end = url.length;\n while (end > 1 && url.charCodeAt(end - 1) === 46 /* '.' */) {\n end -= 1;\n }\n result.hostname = end === url.length ? url : url.slice(0, end);\n } else if (options.mixedInputs) {\n urlIsValid = isValidHostname(url);\n result.hostname = extractHostname(\n url,\n urlIsValid,\n options.validateHostname,\n );\n } else {\n result.hostname = extractHostname(url, false, options.validateHostname);\n }\n\n // A host in brackets is an IPv6 address, or the URL is invalid, as browsers\n // read it: \"http://[1.2.3.4]/\" and \"http://[a.com]/\" have no hostname. An\n // IPv4 address has no ':', every IPv6 address has one.\n if (\n options.extractHostname &&\n extractedBracketedHost &&\n result.hostname !== null\n ) {\n if (isIp(result.hostname) !== true || !result.hostname.includes(':')) {\n result.hostname = null;\n return result;\n }\n if (options.detectIp) {\n result.isIp = true;\n return result;\n }\n }\n\n // Check if `hostname` is a valid ip address\n if (options.detectIp && result.hostname !== null) {\n const isIpAddress = isIp(result.hostname);\n result.isIp = isIpAddress === true;\n if (result.isIp) {\n return result;\n }\n\n // `null`: the host ends in a number, as an IPv4 address, without being\n // one. It is not a valid host then, and never a domain name.\n if (\n isIpAddress === null &&\n options.validateHostname &&\n options.extractHostname\n ) {\n result.hostname = null;\n return result;\n }\n }\n\n // Perform hostname validation if enabled. If hostname is not valid, no need to\n // go further as there will be no valid domain or sub-domain. This validation\n // is applied before any early returns to ensure consistent behavior across\n // all API methods including getHostname().\n if (\n options.validateHostname &&\n options.extractHostname &&\n result.hostname !== null &&\n // Skip the re-scan when `url` was already validated and extractHostname\n // returned it unchanged (same reference => identical string, still valid).\n !(urlIsValid && result.hostname === url) &&\n // Skip the re-scan when extractHostname already validated the host inline\n // (a confirmed-valid simple authority — see extract-hostname.ts).\n !extractedHostnameValidated &&\n !isValidHostname(result.hostname)\n ) {\n result.hostname = null;\n return result;\n }\n\n if (step === FLAG.HOSTNAME || result.hostname === null) {\n return result;\n }\n\n // Flag special-use domains, only when opted in (`detectSpecialUse`) and only\n // for the full `parse()` result (FLAG.ALL). Computed here, before the\n // public-suffix/domain early-returns below, so single-label names like\n // `localhost` (which have no registrable domain) are still flagged.\n if (step === FLAG.ALL && options.detectSpecialUse) {\n result.isSpecialUse = isSpecialUse(result.hostname);\n }\n\n // Extract public suffix (`isException`: the winner is an exception rule)\n const isException = suffixLookup(result.hostname, options, result);\n if (options.extraSuffixes !== null) {\n extraSuffixLookup(result.hostname, options, isException === true, result);\n }\n if (step === FLAG.PUBLIC_SUFFIX || result.publicSuffix === null) {\n return result;\n }\n\n // Extract domain\n result.domain = getDomain(result.publicSuffix, result.hostname, options);\n if (step === FLAG.DOMAIN || result.domain === null) {\n return result;\n }\n\n // Extract subdomain\n result.subdomain = getSubdomain(result.hostname, result.domain);\n if (step === FLAG.SUB_DOMAIN) {\n return result;\n }\n\n // Extract domain without suffix\n result.domainWithoutSuffix = getDomainWithoutSuffix(\n result.domain,\n result.publicSuffix,\n );\n\n return result;\n}\n","import { IPublicSuffix, ISuffixLookupOptions } from './interface';\n\nexport default function (\n hostname: string,\n options: ISuffixLookupOptions,\n out: IPublicSuffix,\n): boolean {\n // Fast path for very popular suffixes; this allows to by-pass lookup\n // completely as well as any extra allocation or string manipulation.\n if (\n !options.allowPrivateDomains &&\n options.allowIcannDomains &&\n hostname.length > 3\n ) {\n const last: number = hostname.length - 1;\n const c3: number = hostname.charCodeAt(last);\n const c2: number = hostname.charCodeAt(last - 1);\n const c1: number = hostname.charCodeAt(last - 2);\n const c0: number = hostname.charCodeAt(last - 3);\n\n if (\n c3 === 109 /* 'm' */ &&\n c2 === 111 /* 'o' */ &&\n c1 === 99 /* 'c' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'com';\n return true;\n } else if (\n c3 === 103 /* 'g' */ &&\n c2 === 114 /* 'r' */ &&\n c1 === 111 /* 'o' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'org';\n return true;\n } else if (\n c3 === 117 /* 'u' */ &&\n c2 === 100 /* 'd' */ &&\n c1 === 101 /* 'e' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'edu';\n return true;\n } else if (\n c3 === 118 /* 'v' */ &&\n c2 === 111 /* 'o' */ &&\n c1 === 103 /* 'g' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'gov';\n return true;\n } else if (\n c3 === 116 /* 't' */ &&\n c2 === 101 /* 'e' */ &&\n c1 === 110 /* 'n' */ &&\n c0 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'net';\n return true;\n } else if (\n c3 === 101 /* 'e' */ &&\n c2 === 100 /* 'd' */ &&\n c1 === 46 /* '.' */\n ) {\n out.isIcann = true;\n out.isPrivate = false;\n out.publicSuffix = 'de';\n return true;\n }\n }\n\n return false;\n}\n"],"names":["charCodeAt"],"mappings":";;AAEA;;;;;;;;;;AAUG;AACG,SAAU,qBAAqB,CACnC,QAAgB,EAChB,KAAa,EAAA;AAEb,IAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC5B,QAAA,QACE,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAChC,YAAA,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG;IAExD;AAEA,IAAA,OAAO,KAAK;AACd;AAEA;;AAEG;AACH,SAAS,uBAAuB,CAC9B,QAAgB,EAChB,YAAoB,EAAA;;;;;;;;;;;;;;;IAgBpB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC;IACnE,MAAM,wBAAwB,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC;;AAG7E,IAAA,IAAI,wBAAwB,KAAK,EAAE,EAAE;AACnC,QAAA,OAAO,QAAQ;IACjB;;IAGA,OAAO,QAAQ,CAAC,KAAK,CAAC,wBAAwB,GAAG,CAAC,CAAC;AACrD;AAEA;;AAEG;AACW,SAAU,SAAS,CAC/B,MAAc,EACd,QAAgB,EAChB,OAAiB,EAAA;;AAGjB,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