{
  "version": 3,
  "sources": ["safe-next.js"],
  "sourcesContent": ["// Where to send someone after they sign in (?next=, the Google OAuth return,\n// the confirmation-email return). Launch review SEC-17, 2026-09-13.\n//\n// The old rule was a string test: starts with \"/\" and not with \"//\". That lets\n// \"/\\evil.com\" through, and every browser treats a backslash in a URL like a\n// slash, so the \"path\" navigated to https://evil.com. A login page that bounces\n// ad traffic to a look-alike is a phishing kit.\n//\n// The rule now is the browser's own: parse the value against this origin, and\n// keep it only if the result is still on this origin. Then navigate to the\n// PARSED value, never the raw string, so what was checked is what is used.\n// Backslashes and control characters are refused before parsing as well: no\n// legitimate return path carries them.\nexport function safeNext(raw, fallback = \"/account/\", origin = globalThis.location?.origin) {\n  if (typeof raw !== \"string\" || !raw || !origin) return fallback;\n  if (/[\u0000-\u001F\\\\]/.test(raw)) return fallback;\n  if (!raw.startsWith(\"/\") || raw.startsWith(\"//\")) return fallback;\n  let here, u;\n  try { here = new URL(origin); u = new URL(raw, here); } catch { return fallback; }\n  if (u.origin !== here.origin) return fallback;\n  // \"/.//evil.com\" parses to the path \"//evil.com\", which a browser navigates to as https://evil.com (2026-10-31): the\n  // parsed value must not start with two slashes either (or a slash and a backslash).\n  const out = u.pathname + u.search + u.hash;\n  if (out.startsWith(\"//\") || out.startsWith(\"/\\\\\")) return fallback;\n  return out;\n}\n"],
  "mappings": "AAaO,gBAAS,SAASA,EAAKC,EAAW,YAAaC,EAAS,WAAW,UAAU,OAAQ,CAG1F,GAFI,OAAOF,GAAQ,UAAY,CAACA,GAAO,CAACE,GACpC,WAAW,KAAKF,CAAG,GACnB,CAACA,EAAI,WAAW,GAAG,GAAKA,EAAI,WAAW,IAAI,EAAG,OAAOC,EACzD,IAAIE,EAAMC,EACV,GAAI,CAAED,EAAO,IAAI,IAAID,CAAM,EAAGE,EAAI,IAAI,IAAIJ,EAAKG,CAAI,CAAG,MAAQ,CAAE,OAAOF,CAAU,CACjF,GAAIG,EAAE,SAAWD,EAAK,OAAQ,OAAOF,EAGrC,MAAMI,EAAMD,EAAE,SAAWA,EAAE,OAASA,EAAE,KACtC,OAAIC,EAAI,WAAW,IAAI,GAAKA,EAAI,WAAW,KAAK,EAAUJ,EACnDI,CACT",
  "names": ["raw", "fallback", "origin", "here", "u", "out"]
}
