{"version":3,"sources":["../src/client/navigation-url.ts","../src/client/hash-target.ts"],"sourcesContent":["export function isFarmExternalNavigationURL(url: URL, currentOrigin: string): boolean {\n  return (url.protocol !== \"http:\" && url.protocol !== \"https:\") || url.origin !== currentOrigin;\n}\n\n/**\n * Resolve a navigation target the way the platform does.\n *\n * Relative references resolve against the *document's* URL, not the origin.\n * Basing on the origin turns `?tab=2` into `/?tab=2` and `details` into\n * `/details`, discarding the directory the user is actually on, so every\n * navigation entry point has to resolve through here.\n *\n * Absolute paths and absolute URLs are unaffected by the choice of base.\n */\nexport function resolveFarmNavigationURL(href: string, documentUrl: string): URL {\n  return new URL(href, documentUrl);\n}\n","export function getHashTargetElement(hash: string): Element | null {\n  // A fragment is not a CSS selector. Match by decoded id, raw id, then the\n  // legacy anchor name so SPA navigation follows native browser semantics.\n  const fragment = hash.startsWith(\"#\") ? hash.slice(1) : hash;\n  if (!fragment) return null;\n\n  let decoded = fragment;\n  try {\n    decoded = decodeURIComponent(fragment);\n  } catch {\n    // Keep the raw fragment when its percent-encoding is malformed.\n  }\n\n  return (\n    document.getElementById(decoded) ||\n    document.getElementById(fragment) ||\n    document.getElementsByName(decoded)[0] ||\n    null\n  );\n}\n"],"mappings":";;;;;AAAO,SAAS,4BAA4B,KAAU,eAAgC;AACpF,SAAQ,IAAI,aAAa,WAAW,IAAI,aAAa,YAAa,IAAI,WAAW;AACnF;AAFgB;AAcT,SAAS,yBAAyB,MAAc,aAA0B;AAC/E,SAAO,IAAI,IAAI,MAAM,WAAW;AAClC;AAFgB;;;ACdT,SAAS,qBAAqB,MAA8B;AAGjE,QAAM,WAAW,KAAK,WAAW,GAAG,IAAI,KAAK,MAAM,CAAC,IAAI;AACxD,MAAI,CAAC,SAAU,QAAO;AAEtB,MAAI,UAAU;AACd,MAAI;AACF,cAAU,mBAAmB,QAAQ;AAAA,EACvC,QAAQ;AAAA,EAER;AAEA,SACE,SAAS,eAAe,OAAO,KAC/B,SAAS,eAAe,QAAQ,KAChC,SAAS,kBAAkB,OAAO,EAAE,CAAC,KACrC;AAEJ;AAnBgB;","names":[]}