claude-mux 0.30.2 → 0.30.3

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 (112) hide show
  1. package/dist/hooks/claude-mux-hook.js +6 -0
  2. package/dist/hooks/claude-mux-hook.js.map +1 -1
  3. package/dist/utils/version.d.ts +1 -1
  4. package/dist/utils/version.js +1 -1
  5. package/dist/web/client/_app/immutable/chunks/{BRwgrbZi.js → 00FvOOKA.js} +2 -2
  6. package/{web/.svelte-kit/output/client/_app/immutable/chunks/BRwgrbZi.js.map → dist/web/client/_app/immutable/chunks/00FvOOKA.js.map} +1 -1
  7. package/dist/web/client/_app/immutable/chunks/BdVIGZmZ.js +3 -0
  8. package/dist/web/client/_app/immutable/chunks/{Cb0yiQIh.js.map → BdVIGZmZ.js.map} +1 -1
  9. package/dist/web/client/_app/immutable/chunks/{CJ5X49p2.js → BhoZKsDR.js} +2 -2
  10. package/dist/web/client/_app/immutable/chunks/{CJ5X49p2.js.map → BhoZKsDR.js.map} +1 -1
  11. package/dist/web/client/_app/immutable/chunks/{DiCsJZkB.js → Bw38FtNy.js} +2 -2
  12. package/dist/web/client/_app/immutable/chunks/{DiCsJZkB.js.map → Bw38FtNy.js.map} +1 -1
  13. package/{web/.svelte-kit/output/client/_app/immutable/chunks/CmDdyjOR.js → dist/web/client/_app/immutable/chunks/CTufiwsi.js} +2 -2
  14. package/dist/web/client/_app/immutable/chunks/{CmDdyjOR.js.map → CTufiwsi.js.map} +1 -1
  15. package/dist/web/client/_app/immutable/chunks/{BR0j6UP_.js → D1gqZkA9.js} +2 -2
  16. package/dist/web/client/_app/immutable/chunks/{BR0j6UP_.js.map → D1gqZkA9.js.map} +1 -1
  17. package/{web/.svelte-kit/output/client/_app/immutable/chunks/juU6kBhv.js → dist/web/client/_app/immutable/chunks/DHy5T1Hk.js} +2 -2
  18. package/{web/.svelte-kit/output/client/_app/immutable/chunks/juU6kBhv.js.map → dist/web/client/_app/immutable/chunks/DHy5T1Hk.js.map} +1 -1
  19. package/dist/web/client/_app/immutable/chunks/DcmZFcR0.js +2 -0
  20. package/{web/.svelte-kit/output/client/_app/immutable/chunks/Dmt0dCmj.js.map → dist/web/client/_app/immutable/chunks/DcmZFcR0.js.map} +1 -1
  21. package/dist/web/client/_app/immutable/entry/{app.BNsXYIeZ.js → app.BK_lbV7p.js} +3 -3
  22. package/dist/web/client/_app/immutable/entry/{app.BNsXYIeZ.js.map → app.BK_lbV7p.js.map} +1 -1
  23. package/dist/web/client/_app/immutable/entry/start.qpCcTOMC.js +2 -0
  24. package/dist/web/client/_app/immutable/entry/start.qpCcTOMC.js.map +1 -0
  25. package/dist/web/client/_app/immutable/nodes/{0.Cga09Vlt.js → 0.xEgEKB6j.js} +2 -2
  26. package/dist/web/client/_app/immutable/nodes/{0.Cga09Vlt.js.map → 0.xEgEKB6j.js.map} +1 -1
  27. package/dist/web/client/_app/immutable/nodes/{1.C5UTjGXy.js → 1.Dk98RShc.js} +2 -2
  28. package/dist/web/client/_app/immutable/nodes/{1.C5UTjGXy.js.map → 1.Dk98RShc.js.map} +1 -1
  29. package/dist/web/client/_app/immutable/nodes/{2.C76yPG3X.js → 2.CwBR9Tlg.js} +2 -2
  30. package/dist/web/client/_app/immutable/nodes/{2.C76yPG3X.js.map → 2.CwBR9Tlg.js.map} +1 -1
  31. package/dist/web/client/_app/immutable/nodes/{3.Tbj29aAW.js → 3.BR6uyLke.js} +2 -2
  32. package/{web/.svelte-kit/output/client/_app/immutable/nodes/3.Tbj29aAW.js.map → dist/web/client/_app/immutable/nodes/3.BR6uyLke.js.map} +1 -1
  33. package/dist/web/client/_app/immutable/nodes/{4.D0z9Wo_G.js → 4.CQHttK08.js} +2 -2
  34. package/{web/.svelte-kit/output/client/_app/immutable/nodes/4.D0z9Wo_G.js.map → dist/web/client/_app/immutable/nodes/4.CQHttK08.js.map} +1 -1
  35. package/dist/web/client/_app/version.json +1 -1
  36. package/dist/web/server/chunks/{0-BZ0-GFAV.js → 0-DxrW6bx9.js} +9 -9
  37. package/dist/web/server/chunks/{0-BZ0-GFAV.js.map → 0-DxrW6bx9.js.map} +1 -1
  38. package/dist/web/server/chunks/{1-DoI2jsEL.js → 1-Cqg4tTSB.js} +3 -3
  39. package/dist/web/server/chunks/{1-DoI2jsEL.js.map → 1-Cqg4tTSB.js.map} +1 -1
  40. package/dist/web/server/chunks/{2-6BGBaYuT.js → 2-Cv_7yOc9.js} +7 -7
  41. package/dist/web/server/chunks/{2-6BGBaYuT.js.map → 2-Cv_7yOc9.js.map} +1 -1
  42. package/dist/web/server/chunks/{3-B9fgRoyO.js → 3-38whb5GG.js} +9 -9
  43. package/dist/web/server/chunks/{3-B9fgRoyO.js.map → 3-38whb5GG.js.map} +1 -1
  44. package/dist/web/server/chunks/{4-CIa0l25T.js → 4-B0al20p9.js} +7 -7
  45. package/dist/web/server/chunks/{4-CIa0l25T.js.map → 4-B0al20p9.js.map} +1 -1
  46. package/dist/web/server/index.js +1 -1
  47. package/dist/web/server/index.js.map +1 -1
  48. package/dist/web/server/manifest.js +11 -11
  49. package/dist/web/server/manifest.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/hooks/claude-mux-hook.ts +6 -0
  52. package/src/utils/version.ts +1 -1
  53. package/tests/hooks/subagents.test.ts +12 -0
  54. package/web/.svelte-kit/adapter-bun/chunks/internal2.js +1 -1
  55. package/web/.svelte-kit/adapter-bun/chunks/internal2.js.map +1 -1
  56. package/web/.svelte-kit/adapter-bun/manifest-full.js +1 -1
  57. package/web/.svelte-kit/adapter-bun/manifest.js +1 -1
  58. package/web/.svelte-kit/adapter-bun/nodes/0.js +1 -1
  59. package/web/.svelte-kit/adapter-bun/nodes/1.js +1 -1
  60. package/web/.svelte-kit/adapter-bun/nodes/2.js +1 -1
  61. package/web/.svelte-kit/adapter-bun/nodes/3.js +1 -1
  62. package/web/.svelte-kit/adapter-bun/nodes/4.js +1 -1
  63. package/web/.svelte-kit/generated/server/internal.js +1 -1
  64. package/web/.svelte-kit/output/client/.vite/manifest.json +93 -93
  65. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BRwgrbZi.js → 00FvOOKA.js} +2 -2
  66. package/{dist/web/client/_app/immutable/chunks/BRwgrbZi.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/00FvOOKA.js.map} +1 -1
  67. package/web/.svelte-kit/output/client/_app/immutable/chunks/BdVIGZmZ.js +3 -0
  68. package/web/.svelte-kit/output/client/_app/immutable/chunks/{Cb0yiQIh.js.map → BdVIGZmZ.js.map} +1 -1
  69. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CJ5X49p2.js → BhoZKsDR.js} +2 -2
  70. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CJ5X49p2.js.map → BhoZKsDR.js.map} +1 -1
  71. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DiCsJZkB.js → Bw38FtNy.js} +2 -2
  72. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DiCsJZkB.js.map → Bw38FtNy.js.map} +1 -1
  73. package/{dist/web/client/_app/immutable/chunks/CmDdyjOR.js → web/.svelte-kit/output/client/_app/immutable/chunks/CTufiwsi.js} +2 -2
  74. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CmDdyjOR.js.map → CTufiwsi.js.map} +1 -1
  75. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BR0j6UP_.js → D1gqZkA9.js} +2 -2
  76. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BR0j6UP_.js.map → D1gqZkA9.js.map} +1 -1
  77. package/{dist/web/client/_app/immutable/chunks/juU6kBhv.js → web/.svelte-kit/output/client/_app/immutable/chunks/DHy5T1Hk.js} +2 -2
  78. package/{dist/web/client/_app/immutable/chunks/juU6kBhv.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/DHy5T1Hk.js.map} +1 -1
  79. package/web/.svelte-kit/output/client/_app/immutable/chunks/DcmZFcR0.js +2 -0
  80. package/{dist/web/client/_app/immutable/chunks/Dmt0dCmj.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/DcmZFcR0.js.map} +1 -1
  81. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.BNsXYIeZ.js → app.BK_lbV7p.js} +3 -3
  82. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.BNsXYIeZ.js.map → app.BK_lbV7p.js.map} +1 -1
  83. package/web/.svelte-kit/output/client/_app/immutable/entry/start.qpCcTOMC.js +2 -0
  84. package/web/.svelte-kit/output/client/_app/immutable/entry/start.qpCcTOMC.js.map +1 -0
  85. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.Cga09Vlt.js → 0.xEgEKB6j.js} +2 -2
  86. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.Cga09Vlt.js.map → 0.xEgEKB6j.js.map} +1 -1
  87. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.C5UTjGXy.js → 1.Dk98RShc.js} +2 -2
  88. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.C5UTjGXy.js.map → 1.Dk98RShc.js.map} +1 -1
  89. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.C76yPG3X.js → 2.CwBR9Tlg.js} +2 -2
  90. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.C76yPG3X.js.map → 2.CwBR9Tlg.js.map} +1 -1
  91. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.Tbj29aAW.js → 3.BR6uyLke.js} +2 -2
  92. package/{dist/web/client/_app/immutable/nodes/3.Tbj29aAW.js.map → web/.svelte-kit/output/client/_app/immutable/nodes/3.BR6uyLke.js.map} +1 -1
  93. package/web/.svelte-kit/output/client/_app/immutable/nodes/{4.D0z9Wo_G.js → 4.CQHttK08.js} +2 -2
  94. package/{dist/web/client/_app/immutable/nodes/4.D0z9Wo_G.js.map → web/.svelte-kit/output/client/_app/immutable/nodes/4.CQHttK08.js.map} +1 -1
  95. package/web/.svelte-kit/output/client/_app/version.json +1 -1
  96. package/web/.svelte-kit/output/server/chunks/internal2.js +1 -1
  97. package/web/.svelte-kit/output/server/chunks/internal2.js.map +1 -1
  98. package/web/.svelte-kit/output/server/manifest-full.js +1 -1
  99. package/web/.svelte-kit/output/server/manifest.js +1 -1
  100. package/web/.svelte-kit/output/server/nodes/0.js +1 -1
  101. package/web/.svelte-kit/output/server/nodes/1.js +1 -1
  102. package/web/.svelte-kit/output/server/nodes/2.js +1 -1
  103. package/web/.svelte-kit/output/server/nodes/3.js +1 -1
  104. package/web/.svelte-kit/output/server/nodes/4.js +1 -1
  105. package/dist/web/client/_app/immutable/chunks/Cb0yiQIh.js +0 -3
  106. package/dist/web/client/_app/immutable/chunks/Dmt0dCmj.js +0 -2
  107. package/dist/web/client/_app/immutable/entry/start.BAAC0OQy.js +0 -2
  108. package/dist/web/client/_app/immutable/entry/start.BAAC0OQy.js.map +0 -1
  109. package/web/.svelte-kit/output/client/_app/immutable/chunks/Cb0yiQIh.js +0 -3
  110. package/web/.svelte-kit/output/client/_app/immutable/chunks/Dmt0dCmj.js +0 -2
  111. package/web/.svelte-kit/output/client/_app/immutable/entry/start.BAAC0OQy.js +0 -2
  112. package/web/.svelte-kit/output/client/_app/immutable/entry/start.BAAC0OQy.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Cb0yiQIh.js","sources":["../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/exports/internal/index.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/routing.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/parse.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/session-storage.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/constants.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/utils.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/base64.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/operations.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/parse.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/array.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/shared.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/error.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/pathname.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/telemetry/noop.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/stream.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/ndjson.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/client.js"],"sourcesContent":["/** @import { StandardSchemaV1 } from '@standard-schema/spec' */\n\nexport class HttpError {\n\t/**\n\t * @param {number} status\n\t * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body\n\t */\n\tconstructor(status, body) {\n\t\tthis.status = status;\n\t\tif (typeof body === 'string') {\n\t\t\tthis.body = { message: body };\n\t\t} else if (body) {\n\t\t\tthis.body = body;\n\t\t} else {\n\t\t\tthis.body = { message: `Error: ${status}` };\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this.body);\n\t}\n}\n\nexport class Redirect {\n\t/**\n\t * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status\n\t * @param {string} location\n\t */\n\tconstructor(status, location) {\n\t\ttry {\n\t\t\tnew Headers({ location });\n\t\t} catch {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid redirect location ${JSON.stringify(location)}: ` +\n\t\t\t\t\t'this string contains characters that cannot be used in HTTP headers'\n\t\t\t);\n\t\t}\n\n\t\tthis.status = status;\n\t\tthis.location = location;\n\t}\n}\n\n/**\n * An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404.\n * `SvelteKitError` goes through `handleError`.\n * @extends Error\n */\nexport class SvelteKitError extends Error {\n\t/**\n\t * @param {number} status\n\t * @param {string} text\n\t * @param {string} message\n\t */\n\tconstructor(status, text, message) {\n\t\tsuper(message);\n\t\tthis.status = status;\n\t\tthis.text = text;\n\t}\n}\n\n/**\n * @template [T=undefined]\n */\nexport class ActionFailure {\n\t/**\n\t * @param {number} status\n\t * @param {T} data\n\t */\n\tconstructor(status, data) {\n\t\tthis.status = status;\n\t\tthis.data = data;\n\t}\n}\n\n/**\n * Error thrown when form validation fails imperatively\n */\nexport class ValidationError extends Error {\n\t/**\n\t * @param {StandardSchemaV1.Issue[]} issues\n\t */\n\tconstructor(issues) {\n\t\tsuper('Validation failed');\n\t\tthis.name = 'ValidationError';\n\t\tthis.issues = issues;\n\t}\n}\n\nexport { init_remote_functions } from './remote-functions.js';\n","import { BROWSER } from 'esm-env';\nimport { decode_params } from './url.js';\n\nconst param_pattern = /^(\\[)?(\\.\\.\\.)?(\\w+)(?:=(\\w+))?(\\])?$/;\n\nconst root_group_pattern = /^\\/\\((?:[^)]+)\\)$/;\n\n/**\n * Creates the regex pattern, extracts parameter names, and generates types for a route\n * @param {string} id\n */\nexport function parse_route_id(id) {\n\t/** @type {import('types').RouteParam[]} */\n\tconst params = [];\n\n\tconst pattern =\n\t\tid === '/' || root_group_pattern.test(id)\n\t\t\t? /^\\/$/\n\t\t\t: new RegExp(\n\t\t\t\t\t`^${get_route_segments(id)\n\t\t\t\t\t\t.map((segment) => {\n\t\t\t\t\t\t\t// special case — /[...rest]/ could contain zero segments\n\t\t\t\t\t\t\tconst rest_match = /^\\[\\.\\.\\.(\\w+)(?:=(\\w+))?\\]$/.exec(segment);\n\t\t\t\t\t\t\tif (rest_match) {\n\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\tname: rest_match[1],\n\t\t\t\t\t\t\t\t\tmatcher: rest_match[2],\n\t\t\t\t\t\t\t\t\toptional: false,\n\t\t\t\t\t\t\t\t\trest: true,\n\t\t\t\t\t\t\t\t\tchained: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn '(?:/([^]*))?';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// special case — /[[optional]]/ could contain zero segments\n\t\t\t\t\t\t\tconst optional_match = /^\\[\\[(\\w+)(?:=(\\w+))?\\]\\]$/.exec(segment);\n\t\t\t\t\t\t\tif (optional_match) {\n\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\tname: optional_match[1],\n\t\t\t\t\t\t\t\t\tmatcher: optional_match[2],\n\t\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\t\trest: false,\n\t\t\t\t\t\t\t\t\tchained: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn '(?:/([^/]+))?';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!segment) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst parts = segment.split(/\\[(.+?)\\](?!\\])/);\n\t\t\t\t\t\t\tconst result = parts\n\t\t\t\t\t\t\t\t.map((content, i) => {\n\t\t\t\t\t\t\t\t\tif (i % 2) {\n\t\t\t\t\t\t\t\t\t\tif (content.startsWith('x+')) {\n\t\t\t\t\t\t\t\t\t\t\treturn escape(String.fromCharCode(parseInt(content.slice(2), 16)));\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif (content.startsWith('u+')) {\n\t\t\t\t\t\t\t\t\t\t\treturn escape(\n\t\t\t\t\t\t\t\t\t\t\t\tString.fromCharCode(\n\t\t\t\t\t\t\t\t\t\t\t\t\t...content\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.slice(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.split('-')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.map((code) => parseInt(code, 16))\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// We know the match cannot be null in the browser because manifest generation\n\t\t\t\t\t\t\t\t\t\t// would have invoked this during build and failed if we hit an invalid\n\t\t\t\t\t\t\t\t\t\t// param/matcher name with non-alphanumeric character.\n\t\t\t\t\t\t\t\t\t\tconst match = /** @type {RegExpExecArray} */ (param_pattern.exec(content));\n\t\t\t\t\t\t\t\t\t\tif (!BROWSER && !match) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t\t\t`Invalid param: ${content}. Params and matcher names can only have underscores and alphanumeric characters.`\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconst [, is_optional, is_rest, name, matcher] = match;\n\t\t\t\t\t\t\t\t\t\t// It's assumed that the following invalid route id cases are already checked\n\t\t\t\t\t\t\t\t\t\t// - unbalanced brackets\n\t\t\t\t\t\t\t\t\t\t// - optional param following rest param\n\n\t\t\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tmatcher,\n\t\t\t\t\t\t\t\t\t\t\toptional: !!is_optional,\n\t\t\t\t\t\t\t\t\t\t\trest: !!is_rest,\n\t\t\t\t\t\t\t\t\t\t\tchained: is_rest ? i === 1 && parts[0] === '' : false\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\treturn is_rest ? '([^]*?)' : is_optional ? '([^/]*)?' : '([^/]+?)';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn escape(content);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.join('');\n\n\t\t\t\t\t\t\treturn '/' + result;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join('')}/?$`\n\t\t\t\t);\n\n\treturn { pattern, params };\n}\n\nconst optional_param_regex = /\\/\\[\\[\\w+?(?:=\\w+)?\\]\\]/;\n\n/**\n * Removes optional params from a route ID.\n * @param {string} id\n * @returns The route id with optional params removed\n */\nexport function remove_optional_params(id) {\n\treturn id.replace(optional_param_regex, '');\n}\n\n/**\n * Returns `false` for `(group)` segments\n * @param {string} segment\n */\nfunction affects_path(segment) {\n\treturn segment !== '' && !/^\\([^)]+\\)$/.test(segment);\n}\n\n/**\n * Splits a route id into its segments, removing segments that\n * don't affect the path (i.e. groups). The root route is represented by `/`\n * and will be returned as `['']`.\n * @param {string} route\n * @returns string[]\n */\nexport function get_route_segments(route) {\n\treturn route.slice(1).split('/').filter(affects_path);\n}\n\n/**\n * @param {RegExpMatchArray} match\n * @param {import('types').RouteParam[]} params\n * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers\n */\nexport function exec(match, params, matchers) {\n\t/** @type {Record<string, string>} */\n\tconst result = {};\n\n\tconst values = match.slice(1);\n\tconst values_needing_match = values.filter((value) => value !== undefined);\n\n\tlet buffered = 0;\n\n\tfor (let i = 0; i < params.length; i += 1) {\n\t\tconst param = params[i];\n\t\tlet value = values[i - buffered];\n\n\t\t// in the `[[a=b]]/.../[...rest]` case, if one or more optional parameters\n\t\t// weren't matched, roll the skipped values into the rest\n\t\tif (param.chained && param.rest && buffered) {\n\t\t\tvalue = values\n\t\t\t\t.slice(i - buffered, i + 1)\n\t\t\t\t.filter((s) => s)\n\t\t\t\t.join('/');\n\n\t\t\tbuffered = 0;\n\t\t}\n\n\t\t// if `value` is undefined, it means this is an optional or rest parameter\n\t\tif (value === undefined) {\n\t\t\tif (param.rest) {\n\t\t\t\t// We need to allow the matcher to run so that it can decide if this optional rest param should be allowed to match\n\t\t\t\tvalue = '';\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!param.matcher || matchers[param.matcher](value)) {\n\t\t\tresult[param.name] = value;\n\n\t\t\t// Now that the params match, reset the buffer if the next param isn't the [...rest]\n\t\t\t// and the next value is defined, otherwise the buffer will cause us to skip values\n\t\t\tconst next_param = params[i + 1];\n\t\t\tconst next_value = values[i + 1];\n\t\t\tif (next_param && !next_param.rest && next_param.optional && next_value && param.chained) {\n\t\t\t\tbuffered = 0;\n\t\t\t}\n\n\t\t\t// There are no more params and no more values, but all non-empty values have been matched\n\t\t\tif (\n\t\t\t\t!next_param &&\n\t\t\t\t!next_value &&\n\t\t\t\tObject.keys(result).length === values_needing_match.length\n\t\t\t) {\n\t\t\t\tbuffered = 0;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\t// in the `/[[a=b]]/...` case, if the value didn't satisfy the matcher,\n\t\t// keep track of the number of skipped optional parameters and continue\n\t\tif (param.optional && param.chained) {\n\t\t\tbuffered++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// otherwise, if the matcher returns `false`, the route did not match\n\t\treturn;\n\t}\n\n\tif (buffered) return;\n\treturn result;\n}\n\n/** @param {string} str */\nfunction escape(str) {\n\treturn (\n\t\tstr\n\t\t\t.normalize()\n\t\t\t// escape [ and ] before escaping other characters, since they are used in the replacements\n\t\t\t.replace(/[[\\]]/g, '\\\\$&')\n\t\t\t// replace %, /, ? and # with their encoded versions because decode_pathname leaves them untouched\n\t\t\t.replace(/%/g, '%25')\n\t\t\t.replace(/\\//g, '%2[Ff]')\n\t\t\t.replace(/\\?/g, '%3[Ff]')\n\t\t\t.replace(/#/g, '%23')\n\t\t\t// escape characters that have special meaning in regex\n\t\t\t.replace(/[.*+?^${}()|\\\\]/g, '\\\\$&')\n\t);\n}\n\nconst basic_param_pattern = /\\[(\\[)?(\\.\\.\\.)?(\\w+?)(?:=(\\w+))?\\]\\]?/g;\n\n/**\n * Populate a route ID with params to resolve a pathname.\n * @example\n * ```js\n * resolveRoute(\n * `/blog/[slug]/[...somethingElse]`,\n * {\n * slug: 'hello-world',\n * somethingElse: 'something/else'\n * }\n * ); // `/blog/hello-world/something/else`\n * ```\n * @param {string} id\n * @param {Record<string, string | undefined>} params\n * @returns {string}\n */\nexport function resolve_route(id, params) {\n\tconst segments = get_route_segments(id);\n\tconst has_id_trailing_slash = id != '/' && id.endsWith('/');\n\n\treturn (\n\t\t'/' +\n\t\tsegments\n\t\t\t.map((segment) =>\n\t\t\t\tsegment.replace(basic_param_pattern, (_, optional, rest, name) => {\n\t\t\t\t\tconst param_value = params[name];\n\n\t\t\t\t\t// This is nested so TS correctly narrows the type\n\t\t\t\t\tif (!param_value) {\n\t\t\t\t\t\tif (optional) return '';\n\t\t\t\t\t\tif (rest && param_value !== undefined) return '';\n\t\t\t\t\t\tthrow new Error(`Missing parameter '${name}' in route ${id}`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (param_value.startsWith('/') || param_value.endsWith('/'))\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Parameter '${name}' in route ${id} cannot start or end with a slash -- this would cause an invalid route like foo//bar`\n\t\t\t\t\t\t);\n\t\t\t\t\treturn param_value;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.filter(Boolean)\n\t\t\t.join('/') +\n\t\t(has_id_trailing_slash ? '/' : '')\n\t);\n}\n\n/**\n * @param {import('types').SSRNode} node\n * @returns {boolean}\n */\nexport function has_server_load(node) {\n\treturn node.server?.load !== undefined || node.server?.trailingSlash !== undefined;\n}\n\n/**\n * Find the first route that matches the given path\n * @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route\n * @param {string} path - The decoded pathname to match\n * @param {Route[]} routes\n * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers\n * @returns {{ route: Route, params: Record<string, string> } | null}\n */\nexport function find_route(path, routes, matchers) {\n\tfor (const route of routes) {\n\t\tconst match = route.pattern.exec(path);\n\t\tif (!match) continue;\n\n\t\tconst matched = exec(match, route.params, matchers);\n\t\tif (matched) {\n\t\t\treturn {\n\t\t\t\troute,\n\t\t\t\tparams: decode_params(matched)\n\t\t\t};\n\t\t}\n\t}\n\treturn null;\n}\n","import { exec, parse_route_id } from '../../utils/routing.js';\n\n/**\n * @param {import('./types.js').SvelteKitApp} app\n * @returns {import('types').CSRRoute[]}\n */\nexport function parse({ nodes, server_loads, dictionary, matchers }) {\n\tconst layouts_with_server_load = new Set(server_loads);\n\n\treturn Object.entries(dictionary).map(([id, [leaf, layouts, errors]]) => {\n\t\tconst { pattern, params } = parse_route_id(id);\n\n\t\t/** @type {import('types').CSRRoute} */\n\t\tconst route = {\n\t\t\tid,\n\t\t\t/** @param {string} path */\n\t\t\texec: (path) => {\n\t\t\t\tconst match = pattern.exec(path);\n\t\t\t\tif (match) return exec(match, params, matchers);\n\t\t\t},\n\t\t\terrors: [1, ...(errors || [])].map((n) => nodes[n]),\n\t\t\tlayouts: [0, ...(layouts || [])].map(create_layout_loader),\n\t\t\tleaf: create_leaf_loader(leaf)\n\t\t};\n\n\t\t// bit of a hack, but ensures that layout/error node lists are the same\n\t\t// length, without which the wrong data will be applied if the route\n\t\t// manifest looks like `[[a, b], [c,], d]`\n\t\troute.errors.length = route.layouts.length = Math.max(\n\t\t\troute.errors.length,\n\t\t\troute.layouts.length\n\t\t);\n\n\t\treturn route;\n\t});\n\n\t/**\n\t * @param {number} id\n\t * @returns {[boolean, import('types').CSRPageNodeLoader]}\n\t */\n\tfunction create_leaf_loader(id) {\n\t\t// whether or not the route uses the server data is\n\t\t// encoded using the ones' complement, to save space\n\t\tconst uses_server_data = id < 0;\n\t\tif (uses_server_data) id = ~id;\n\t\treturn [uses_server_data, nodes[id]];\n\t}\n\n\t/**\n\t * @param {number | undefined} id\n\t * @returns {[boolean, import('types').CSRPageNodeLoader] | undefined}\n\t */\n\tfunction create_layout_loader(id) {\n\t\t// whether or not the layout uses the server data is\n\t\t// encoded in the layouts array, to save space\n\t\treturn id === undefined ? id : [layouts_with_server_load.has(id), nodes[id]];\n\t}\n}\n\n/**\n * @param {import('types').CSRRouteServer} input\n * @param {import('types').CSRPageNodeLoader[]} app_nodes Will be modified if a new node is loaded that's not already in the array\n * @returns {import('types').CSRRoute}\n */\nexport function parse_server_route({ nodes, id, leaf, layouts, errors }, app_nodes) {\n\treturn {\n\t\tid,\n\t\texec: () => ({}), // dummy function; exec already happened on the server\n\t\t// By writing to app_nodes only when a loader at that index is not already defined,\n\t\t// we ensure that loaders have referential equality when they load the same node.\n\t\t// Code elsewhere in client.js relies on this referential equality to determine\n\t\t// if a loader is different and should therefore (re-)run.\n\t\terrors: errors.map((n) => (n ? (app_nodes[n] ||= nodes[n]) : undefined)),\n\t\tlayouts: layouts.map((n) => (n ? [n[0], (app_nodes[n[1]] ||= nodes[n[1]])] : undefined)),\n\t\tleaf: [leaf[0], (app_nodes[leaf[1]] ||= nodes[leaf[1]])]\n\t};\n}\n","/**\n * Read a value from `sessionStorage`\n * @param {string} key\n * @param {(value: string) => any} parse\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get(key, parse = JSON.parse) {\n\ttry {\n\t\treturn parse(sessionStorage[key]);\n\t} catch {\n\t\t// do nothing\n\t}\n}\n\n/**\n * Write a value to `sessionStorage`\n * @param {string} key\n * @param {any} value\n * @param {(value: any) => string} stringify\n */\nexport function set(key, value, stringify = JSON.stringify) {\n\tconst data = stringify(value);\n\ttry {\n\t\tsessionStorage[key] = data;\n\t} catch {\n\t\t// do nothing\n\t}\n}\n","export const UNDEFINED = -1;\nexport const HOLE = -2;\nexport const NAN = -3;\nexport const POSITIVE_INFINITY = -4;\nexport const NEGATIVE_INFINITY = -5;\nexport const NEGATIVE_ZERO = -6;\nexport const SPARSE = -7;\n\n// The largest valid value for a JavaScript array's `length` property,\n// and the largest valid array index (one less than the max length).\nexport const MAX_ARRAY_LEN = 2 ** 32 - 1;\nexport const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;\n","import { MAX_ARRAY_INDEX, MAX_ARRAY_LEN } from './constants.js';\n\n/** @type {Record<string, string>} */\nexport const escaped = {\n\t'<': '\\\\u003C',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029'\n};\n\nexport class DevalueError extends Error {\n\t/**\n\t * @param {string} message\n\t * @param {string[]} keys\n\t * @param {any} [value] - The value that failed to be serialized\n\t * @param {any} [root] - The root value being serialized\n\t */\n\tconstructor(message, keys, value, root) {\n\t\tsuper(message);\n\t\tthis.name = 'DevalueError';\n\t\tthis.path = keys.join('');\n\t\tthis.value = value;\n\t\tthis.root = root;\n\t}\n}\n\n/** @param {any} thing */\nexport function is_primitive(thing) {\n\treturn thing === null || (typeof thing !== 'object' && typeof thing !== 'function');\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)\n\t.sort()\n\t.join('\\0');\n\n/** @param {any} thing */\nexport function is_plain_object(thing) {\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/** @param {any} thing */\nexport function get_type(thing) {\n\treturn Object.prototype.toString.call(thing).slice(8, -1);\n}\n\n/** @param {any} thing */\nexport function is_buffer(thing) {\n\treturn typeof Buffer !== 'undefined' && Buffer.isBuffer(thing);\n}\n\n/** @param {string} char */\nfunction get_escaped_char(char) {\n\tswitch (char) {\n\t\tcase '\"':\n\t\t\treturn '\\\\\"';\n\t\tcase '<':\n\t\t\treturn '\\\\u003C';\n\t\tcase '\\\\':\n\t\t\treturn '\\\\\\\\';\n\t\tcase '\\n':\n\t\t\treturn '\\\\n';\n\t\tcase '\\r':\n\t\t\treturn '\\\\r';\n\t\tcase '\\t':\n\t\t\treturn '\\\\t';\n\t\tcase '\\b':\n\t\t\treturn '\\\\b';\n\t\tcase '\\f':\n\t\t\treturn '\\\\f';\n\t\tcase '\\u2028':\n\t\t\treturn '\\\\u2028';\n\t\tcase '\\u2029':\n\t\t\treturn '\\\\u2029';\n\t\tdefault:\n\t\t\treturn char < ' ' ? `\\\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}` : '';\n\t}\n}\n\n/** @param {string} str */\nexport function stringify_string(str) {\n\tlet result = '';\n\tlet last_pos = 0;\n\tconst len = str.length;\n\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst char = str[i];\n\t\tconst replacement = get_escaped_char(char);\n\t\tif (replacement) {\n\t\t\tresult += str.slice(last_pos, i) + replacement;\n\t\t\tlast_pos = i + 1;\n\t\t}\n\t}\n\n\treturn `\"${last_pos === 0 ? str : result + str.slice(last_pos)}\"`;\n}\n\n/** @param {Record<string | symbol, any>} object */\nexport function enumerable_symbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter(\n\t\t(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable\n\t);\n}\n\nconst is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/** @param {string} key */\nexport function stringify_key(key) {\n\treturn is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';\n}\n\n/** @param {number} n */\nexport function is_valid_array_index(n) {\n\tif (!Number.isInteger(n)) return false;\n\tif (n < 0) return false;\n\tif (n > MAX_ARRAY_INDEX) return false;\n\treturn true;\n}\n\n/** @param {number} n */\nexport function is_valid_array_len(n) {\n\tif (!Number.isInteger(n)) return false;\n\tif (n < 0) return false;\n\tif (n > MAX_ARRAY_LEN) return false;\n\treturn true;\n}\n\n/** @param {string} s */\nfunction is_valid_array_index_string(s) {\n\tif (s.length === 0) return false;\n\tif (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero\n\tfor (let i = 0; i < s.length; i++) {\n\t\tconst c = s.charCodeAt(i);\n\t\tif (c < 48 || c > 57) return false;\n\t}\n\t// by this point we know it's a string of digits, but it has to be within\n\t// the range of valid array indices\n\treturn is_valid_array_index(+s);\n}\n\n/**\n * Returns the length of the leading run of valid array indices in `keys`.\n * @param {readonly string[]} keys\n */\nfunction array_index_cut(keys) {\n\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\tif (is_valid_array_index_string(keys[i])) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn i + 1;\n}\n\n/**\n * Finds the populated indices of an array.\n * @param {unknown[]} array\n */\nexport function valid_array_indices(array) {\n\tconst keys = Object.keys(array);\n\tkeys.length = array_index_cut(keys);\n\treturn keys;\n}\n\n/**\n * Given the own enumerable string keys of an array-like value, in property\n * order, returns the leading run of them that are valid array indices.\n *\n * This is the filtering half of the `indicesOf` stringify operation,\n * exposed so that custom operations — which typically already have the keys\n * in hand, e.g. from a foreign runtime — don't have to reimplement it.\n *\n * Does not modify `keys`.\n *\n * @param {readonly string[]} keys\n * @returns {string[]}\n */\nexport function filter_array_indices(keys) {\n\treturn keys.slice(0, array_index_cut(keys));\n}\n","/* Baseline 2025 runtimes */\n\n/**\t@type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_native(array_buffer) {\n\treturn new Uint8Array(array_buffer).toBase64();\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_native(base64) {\n\treturn Uint8Array.fromBase64(base64).buffer;\n}\n\n/* Node-compatible runtimes */\n\n/** @type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_buffer(array_buffer) {\n\treturn Buffer.from(array_buffer).toString('base64');\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_buffer(base64) {\n\treturn Uint8Array.from(Buffer.from(base64, 'base64')).buffer;\n}\n\n/* Legacy runtimes */\n\n/** @type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_legacy(array_buffer) {\n\tconst array = new Uint8Array(array_buffer);\n\tlet binary = '';\n\n\t// the maximum number of arguments to String.fromCharCode.apply\n\t// should be around 0xFFFF in modern engines\n\tconst chunk_size = 0x8000;\n\tfor (let i = 0; i < array.length; i += chunk_size) {\n\t\tconst chunk = array.subarray(i, i + chunk_size);\n\t\tbinary += String.fromCharCode.apply(null, chunk);\n\t}\n\n\treturn btoa(binary);\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_legacy(base64) {\n\tconst binary_string = atob(base64);\n\tconst len = binary_string.length;\n\tconst array = new Uint8Array(len);\n\n\tfor (let i = 0; i < len; i++) {\n\t\tarray[i] = binary_string.charCodeAt(i);\n\t}\n\n\treturn array.buffer;\n}\n\nconst native = typeof Uint8Array.fromBase64 === 'function';\nconst buffer = typeof process === 'object' && process.versions?.node !== undefined;\n\nexport const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;\nexport const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;\n","import { MAX_ARRAY_INDEX } from './constants.js';\nimport {\n\tenumerable_symbols,\n\tget_type,\n\tis_buffer,\n\tis_plain_object,\n\tvalid_array_indices\n} from './utils.js';\n\n/**\n * Merges caller-provided operation overrides over the defaults. Iterating the\n * default keys (rather than the override's own keys) means nullish members\n * fall back to the default, and inherited members — e.g. from a class\n * instance — are picked up.\n *\n * @template {Record<string, any>} T\n * @param {T} defaults\n * @param {Partial<T> | undefined} overrides\n * @returns {T}\n */\nexport function merge_operations(defaults, overrides) {\n\tif (!overrides) return defaults;\n\n\tconst merged = /** @type {T} */ ({});\n\n\tfor (const key of /** @type {(keyof T)[]} */ (Object.keys(defaults))) {\n\t\tmerged[key] = overrides[key] ?? defaults[key];\n\t}\n\n\treturn merged;\n}\n\n/** @type {{ kind: 'not-plain' }} */\nconst NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: 'not-plain' });\n\n/** @type {{ kind: 'symbol-keys' }} */\nconst SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: 'symbol-keys' });\n\n/**\n * The default implementations of every introspection/extraction operation\n * `stringify` performs on the value being serialized. Each one uses native\n * JavaScript semantics (property access, iteration, prototype methods, etc).\n *\n * Pass overrides via the `operations` option of `stringify`/`stringifyAsync`\n * to customize how values are inspected — e.g. to serialize values without\n * triggering getters, proxy traps, or patched prototype methods, or to\n * serialize values that live in a different JavaScript runtime (a `node:vm`\n * context, a WASM-hosted engine, a remote process) through handle objects.\n *\n * The object is frozen — it is shared by every `stringify` call that does\n * not override a given operation.\n *\n */\n/** @type {import('./types.js').DefaultStringifyOperations} */\nconst stringify_operations = {\n\tidentify: (value) => value,\n\n\ttypeOf: (value) => (value === null ? 'null' : typeof value),\n\n\ttoPrimitive: (value) => value,\n\n\ttagOf: (value) => get_type(value),\n\n\tisThenable: (value) => typeof value.then === 'function',\n\n\ttoPromise: (thenable) => Promise.resolve(thenable),\n\n\tunbox: (boxed) => boxed.valueOf(),\n\n\ttoISOString: (date) => (isNaN(date.getDate()) ? '' : date.toISOString()),\n\n\ttoStringValue: (value) => value.toString(),\n\n\tregExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),\n\n\tvaluesOf: (set) => set,\n\n\tentriesOf: (map) => map,\n\n\tviewInfo: (view) => {\n\t\t// Node Buffers may share a pool containing unrelated, sensitive data.\n\t\t// Copy only the visible bytes, without using Buffer's pooling or slice.\n\t\tif (is_buffer(view)) view = new Uint8Array(view);\n\n\t\treturn {\n\t\t\tbuffer: view.buffer,\n\t\t\tbyteOffset: view.byteOffset,\n\t\t\tbyteLength: view.byteLength,\n\t\t\tlength: view.length,\n\t\t\tbufferByteLength: view.buffer.byteLength\n\t\t};\n\t},\n\n\ttoArrayBuffer: (buffer) => buffer,\n\n\tlengthOf: (array) => array.length,\n\n\thasOwn: (value, key) => Object.hasOwn(value, key),\n\n\tindicesOf: (array) => valid_array_indices(array),\n\n\tshapeOf: (value) => {\n\t\tif (!is_plain_object(value)) return NOT_PLAIN;\n\t\tif (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;\n\n\t\treturn {\n\t\t\tkind: Object.getPrototypeOf(value) === null ? 'null-proto' : 'plain',\n\t\t\tkeys: Object.keys(value)\n\t\t};\n\t},\n\n\tget: (value, key) => value[key]\n};\n\nexport const default_stringify_operations = /* @__PURE__ */ Object.freeze(stringify_operations);\n\nconst array_buffer_byte_length = Object.getOwnPropertyDescriptor(\n\tArrayBuffer.prototype,\n\t'byteLength'\n).get;\n\nconst shared_array_buffer_byte_length =\n\ttypeof SharedArrayBuffer === 'undefined'\n\t\t? undefined\n\t\t: Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get;\n\n/**\n * The default implementations of every construction operation `parse` and\n * `unflatten` perform while reviving a value. Each one uses native\n * JavaScript semantics (built-in constructors, property assignment, etc).\n *\n * Pass overrides via the `operations` option of `parse`/`unflatten` to\n * customize how values are built — e.g. to construct them from the\n * intrinsics of a different realm (a `node:vm` context), or to build up\n * values inside another JavaScript runtime (a WASM-hosted engine, a remote\n * process) through handle objects.\n *\n * The object is frozen — it is shared by every `parse` call that does not\n * override a given operation.\n *\n */\n/** @type {import('./types.js').DefaultParseOperations} */\nconst parse_operations = {\n\tfromPrimitive: (primitive) => primitive,\n\n\tfromISOString: (iso) => new Date(iso),\n\n\tfromStringValue: (tag, text) => {\n\t\tif (tag === 'URL') return new URL(text);\n\t\tif (tag === 'URLSearchParams') return new URLSearchParams(text);\n\t\t// 'Temporal.Instant', 'Temporal.PlainDate', ...\n\t\t// @ts-expect-error TS doesn't know about Temporal yet\n\t\treturn Temporal[tag.slice(9)].from(text);\n\t},\n\n\tfromArrayBuffer: (buffer) => buffer,\n\n\tfromRegExpInfo: (source, flags) => new RegExp(source, flags),\n\n\tfromViewInfo: (tag, buffer, byteOffset, length) => {\n\t\t// A reviver can replace an ArrayBuffer with a length or array-like value,\n\t\t// which a typed array constructor would use to allocate a new buffer.\n\t\t// The native getters check internal slots, so they work across realms\n\t\t// and cannot be fooled by a forged prototype or Symbol.toStringTag.\n\t\ttry {\n\t\t\tarray_buffer_byte_length.call(buffer);\n\t\t} catch (error) {\n\t\t\tif (!shared_array_buffer_byte_length) throw error;\n\t\t\tshared_array_buffer_byte_length.call(buffer);\n\t\t}\n\n\t\tconst Constructor = /** @type {any} */ (globalThis)[tag];\n\t\treturn byteOffset !== undefined\n\t\t\t? new Constructor(buffer, byteOffset, length)\n\t\t\t: new Constructor(buffer);\n\t},\n\n\tbox: (value) => Object(value),\n\n\tcreateArray: (length) => new Array(length),\n\n\tcreateSparseArray: (length) => {\n\t\t/** @type {any[]} */\n\t\tconst array = [];\n\n\t\t// Setting `array.length = length` (or equivalently calling\n\t\t// `new Array(length)`) on an untrusted length is a DoS vector: V8\n\t\t// eagerly allocates a contiguous backing store for array lengths below\n\t\t// ~10^8, so a small payload with a huge declared length can force\n\t\t// arbitrary memory allocation. Touching the largest-possible index\n\t\t// first forces V8 into dictionary-elements mode, where `length` is\n\t\t// just a number and no contiguous allocation occurs.\n\t\tarray[MAX_ARRAY_INDEX] = undefined;\n\t\tdelete array[MAX_ARRAY_INDEX];\n\t\tarray.length = length;\n\n\t\treturn array;\n\t},\n\n\tcreateObject: () => ({}),\n\n\tcreateNullPrototypeObject: () => Object.create(null),\n\n\tcreateSet: () => new Set(),\n\n\tcreateMap: () => new Map(),\n\n\tset: (target, key, value) => {\n\t\ttarget[key] = value;\n\t},\n\n\taddValue: (set, value) => {\n\t\tset.add(value);\n\t},\n\n\taddEntry: (map, key, value) => {\n\t\tmap.set(key, value);\n\t}\n};\n\nexport const default_parse_operations = /* @__PURE__ */ Object.freeze(parse_operations);\n","import { decode64 } from './base64.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\nimport { default_parse_operations, merge_operations } from './operations.js';\nimport { is_valid_array_index, is_valid_array_len } from './utils.js';\n\n/**\n * Revive a value serialized with `devalue.stringify`\n * @param {string} serialized\n * @param {Record<string, (value: any) => any>} [revivers]\n * @param {import('./types.js').ParseOptions} [options]\n */\nexport function parse(serialized, revivers, options) {\n\treturn unflatten(JSON.parse(serialized), revivers, options);\n}\n\n/**\n * Revive a value flattened with `devalue.stringify`\n * @param {number | any[]} parsed\n * @param {Record<string, (value: any) => any>} [revivers]\n * @param {import('./types.js').ParseOptions} [options]\n */\nexport function unflatten(parsed, revivers, options) {\n\t/** @type {import('./types.js').ParseOperations} */\n\tconst ops = merge_operations(default_parse_operations, options?.operations);\n\n\tif (typeof parsed === 'number') return hydrate(parsed, true);\n\n\tif (!Array.isArray(parsed) || parsed.length === 0) {\n\t\tthrow new Error('Invalid input');\n\t}\n\n\tconst values = /** @type {any[]} */ (parsed);\n\n\tconst hydrated = Array(values.length);\n\n\t/**\n\t * A set of values currently being hydrated with custom revivers,\n\t * used to detect invalid cyclical dependencies\n\t * @type {Set<number> | null}\n\t */\n\tlet hydrating = null;\n\n\t/**\n\t * @param {number} index\n\t * @returns {any}\n\t */\n\tfunction hydrate(index, standalone = false) {\n\t\tif (index === UNDEFINED) return ops.fromPrimitive(undefined);\n\t\tif (index === NAN) return ops.fromPrimitive(NaN);\n\t\tif (index === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);\n\t\tif (index === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);\n\t\tif (index === NEGATIVE_ZERO) return ops.fromPrimitive(-0);\n\n\t\tif (standalone || typeof index !== 'number') {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tif (index in hydrated) return hydrated[index];\n\n\t\tif (index >= values.length) {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tconst value = values[index];\n\n\t\tif (!value || typeof value !== 'object') {\n\t\t\thydrated[index] = ops.fromPrimitive(value);\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (typeof value[0] === 'string') {\n\t\t\t\tconst type = value[0];\n\n\t\t\t\tconst reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined;\n\n\t\t\t\tif (reviver) {\n\t\t\t\t\tlet i = value[1];\n\t\t\t\t\tif (typeof i !== 'number') {\n\t\t\t\t\t\t// if it's not a number, it was serialized by a builtin reviver\n\t\t\t\t\t\t// so we need to munge it into the format expected by a custom reviver\n\t\t\t\t\t\ti = values.push(value[1]) - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the payload is already hydrated, its recursion has already\n\t\t\t\t\t// terminated (e.g. a self-referential object cached itself before\n\t\t\t\t\t// following its own back-reference), so revive it directly. Falling\n\t\t\t\t\t// through to the `hydrating` guard here would wrongly reject a valid\n\t\t\t\t\t// cycle. An actually infinite payload (e.g. `[[\"Custom\", 0]]`) is never\n\t\t\t\t\t// cached, so it still hits the guard below.\n\t\t\t\t\tif (Object.hasOwn(hydrated, i)) {\n\t\t\t\t\t\treturn (hydrated[index] = reviver(hydrated[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating ??= new Set();\n\n\t\t\t\t\tif (hydrating.has(i)) {\n\t\t\t\t\t\tthrow new Error('Invalid circular reference');\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating.add(i);\n\t\t\t\t\thydrated[index] = reviver(hydrate(i));\n\t\t\t\t\thydrating.delete(i);\n\n\t\t\t\t\treturn hydrated[index];\n\t\t\t\t}\n\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'Date':\n\t\t\t\t\t\thydrated[index] = ops.fromISOString(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Set':\n\t\t\t\t\t\tconst set = ops.createSet();\n\t\t\t\t\t\thydrated[index] = set;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 1) {\n\t\t\t\t\t\t\tops.addValue(set, hydrate(value[i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Map':\n\t\t\t\t\t\tconst map = ops.createMap();\n\t\t\t\t\t\thydrated[index] = map;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RegExp':\n\t\t\t\t\t\thydrated[index] = ops.fromRegExpInfo(value[1], value[2]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Object': {\n\t\t\t\t\t\tconst wrapped_index = value[1];\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof values[wrapped_index] === 'object' &&\n\t\t\t\t\t\t\tvalues[wrapped_index][0] !== 'BigInt'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// avoid infinite recusion in case of malformed input\n\t\t\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thydrated[index] = ops.box(hydrate(wrapped_index));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'BigInt':\n\t\t\t\t\t\thydrated[index] = ops.fromPrimitive(BigInt(value[1]));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'null':\n\t\t\t\t\t\tconst obj = ops.createNullPrototypeObject();\n\t\t\t\t\t\thydrated[index] = obj;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tconst key = value[i];\n\t\t\t\t\t\t\tif (typeof key !== 'string') {\n\t\t\t\t\t\t\t\tthrow new Error('Cannot parse an object with a non-string key');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tops.set(obj, key, hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Int8Array':\n\t\t\t\t\tcase 'Uint8Array':\n\t\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\t\tcase 'Int16Array':\n\t\t\t\t\tcase 'Uint16Array':\n\t\t\t\t\tcase 'Float16Array':\n\t\t\t\t\tcase 'Int32Array':\n\t\t\t\t\tcase 'Uint32Array':\n\t\t\t\t\tcase 'Float32Array':\n\t\t\t\t\tcase 'Float64Array':\n\t\t\t\t\tcase 'BigInt64Array':\n\t\t\t\t\tcase 'BigUint64Array':\n\t\t\t\t\tcase 'DataView': {\n\t\t\t\t\t\tif (values[value[1]][0] !== 'ArrayBuffer') {\n\t\t\t\t\t\t\t// without this, if we receive malformed input we could\n\t\t\t\t\t\t\t// end up trying to hydrate in a circle or allocate\n\t\t\t\t\t\t\t// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`\n\t\t\t\t\t\t\tthrow new Error('Invalid data');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst buffer = hydrate(value[1]);\n\n\t\t\t\t\t\thydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t\tconst base64 = value[1];\n\t\t\t\t\t\tif (typeof base64 !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('Invalid ArrayBuffer encoding');\n\t\t\t\t\t\t}\n\t\t\t\t\t\thydrated[index] = ops.fromArrayBuffer(decode64(base64));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URL':\n\t\t\t\t\tcase 'URLSearchParams':\n\t\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\t\tcase 'Temporal.ZonedDateTime': {\n\t\t\t\t\t\t// the same tags `toStringValue` serializes on the stringify side\n\t\t\t\t\t\thydrated[index] = ops.fromStringValue(type, value[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(`Unknown type ${type}`);\n\t\t\t\t}\n\t\t\t} else if (value[0] === SPARSE) {\n\t\t\t\t// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]\n\t\t\t\tconst len = value[1];\n\n\t\t\t\tif (!is_valid_array_len(len)) {\n\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t}\n\n\t\t\t\t// `len` comes from the input rather than being bounded by it, so\n\t\t\t\t// `createSparseArray` is responsible for not allocating storage\n\t\t\t\t// proportional to it.\n\t\t\t\tconst array = ops.createSparseArray(len);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 2; i < value.length; i += 2) {\n\t\t\t\t\tconst idx = value[i];\n\n\t\t\t\t\tif (!is_valid_array_index(idx) || idx >= len) {\n\t\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t\t}\n\n\t\t\t\t\tops.set(array, idx, hydrate(value[i + 1]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = ops.createArray(value.length);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\tconst n = value[i];\n\t\t\t\t\tif (n === HOLE) continue;\n\n\t\t\t\t\tops.set(array, i, hydrate(n));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst object = ops.createObject();\n\t\t\thydrated[index] = object;\n\n\t\t\tfor (const key of Object.keys(value)) {\n\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t}\n\n\t\t\t\tops.set(object, key, hydrate(value[key]));\n\t\t\t}\n\t\t}\n\n\t\treturn hydrated[index];\n\t}\n\n\treturn hydrate(0);\n}\n","/**\n * Removes nullish values from an array.\n *\n * @template T\n * @param {Array<T>} arr\n */\nexport function compact(arr) {\n\treturn arr.filter(/** @returns {val is NonNullable<T>} */ (val) => val != null);\n}\n","/** @import { Transport } from '@sveltejs/kit' */\nimport * as devalue from 'devalue';\nimport { base64_decode, base64_encode, text_encoder } from './utils.js';\n\n/**\n * @param {string} route_id\n * @param {string} dep\n */\nexport function validate_depends(route_id, dep) {\n\tconst match = /^(moz-icon|view-source|jar):/.exec(dep);\n\tif (match) {\n\t\tconsole.warn(\n\t\t\t`${route_id}: Calling \\`depends('${dep}')\\` will throw an error in Firefox because \\`${match[1]}\\` is a special URI scheme`\n\t\t);\n\t}\n}\n\nexport const INVALIDATED_PARAM = 'x-sveltekit-invalidated';\n\nexport const TRAILING_SLASH_PARAM = 'x-sveltekit-trailing-slash';\n\n/**\n * @param {any} data\n * @param {string} [location_description]\n */\nexport function validate_load_response(data, location_description) {\n\tif (data != null && Object.getPrototypeOf(data) !== Object.prototype) {\n\t\tthrow new Error(\n\t\t\t`a load function ${location_description} returned ${\n\t\t\t\ttypeof data !== 'object'\n\t\t\t\t\t? `a ${typeof data}`\n\t\t\t\t\t: data instanceof Response\n\t\t\t\t\t\t? 'a Response object'\n\t\t\t\t\t\t: Array.isArray(data)\n\t\t\t\t\t\t\t? 'an array'\n\t\t\t\t\t\t\t: 'a non-plain object'\n\t\t\t}, but must return a plain object at the top level (i.e. \\`return {...}\\`)`\n\t\t);\n\t}\n}\n\n/**\n * Try to `devalue.stringify` the data object using the provided transport encoders.\n * @param {any} data\n * @param {Transport} transport\n */\nexport function stringify(data, transport) {\n\tconst encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));\n\n\treturn devalue.stringify(data, encoders);\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)\n\t.sort()\n\t.join('\\0');\n\n/**\n * @param {unknown} thing\n * @returns {thing is Record<PropertyKey, unknown>}\n */\nfunction is_plain_object(thing) {\n\tif (typeof thing !== 'object' || thing === null) return false;\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/**\n * @param {Record<string, any>} value\n * @param {Map<object, any>} clones\n */\nfunction to_sorted(value, clones) {\n\tconst clone = Object.getPrototypeOf(value) === null ? Object.create(null) : {};\n\tclones.set(value, clone);\n\tObject.defineProperty(clone, remote_arg_marker, { value: true });\n\n\tfor (const key of Object.keys(value).sort()) {\n\t\tconst property = value[key];\n\t\tObject.defineProperty(clone, key, {\n\t\t\tvalue: clones.get(property) ?? property,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t}\n\n\treturn clone;\n}\n\n// \"sveltekit remote arg\"\nconst remote_object = '__skrao';\nconst remote_map = '__skram';\nconst remote_set = '__skras';\nconst remote_file = '__skraf';\nconst remote_promise_guard = '__skrap';\nconst remote_regex_guard = '__skrag';\nconst remote_arg_marker = Symbol(remote_object);\n\n/**\n * @param {Transport} transport\n * @param {boolean} sort\n * @param {Map<any, any>} remote_arg_clones\n */\nfunction create_remote_arg_reducers(transport, sort, remote_arg_clones) {\n\t/** @type {Record<string, (value: unknown) => unknown>} */\n\tconst remote_fns_reducers = {\n\t\t/** @param {unknown} value */\n\t\t[remote_regex_guard]: (value) => {\n\t\t\tif (value instanceof RegExp) {\n\t\t\t\tthrow new Error('Regular expressions are not valid remote function arguments');\n\t\t\t}\n\t\t}\n\t};\n\n\tif (sort) {\n\t\t/** @type {(value: unknown) => Array<[unknown, unknown]> | undefined} */\n\t\tremote_fns_reducers[remote_map] = (value) => {\n\t\t\tif (!(value instanceof Map)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** @type {Array<[string, string]>} */\n\t\t\tconst entries = [];\n\n\t\t\tfor (const [key, val] of value) {\n\t\t\t\tentries.push([stringify(key), stringify(val)]);\n\t\t\t}\n\n\t\t\treturn entries.sort(([a1, a2], [b1, b2]) => {\n\t\t\t\tif (a1 < b1) return -1;\n\t\t\t\tif (a1 > b1) return 1;\n\t\t\t\tif (a2 < b2) return -1;\n\t\t\t\tif (a2 > b2) return 1;\n\t\t\t\treturn 0;\n\t\t\t});\n\t\t};\n\n\t\t/** @type {(value: unknown) => unknown[] | undefined} */\n\t\tremote_fns_reducers[remote_set] = (value) => {\n\t\t\tif (!(value instanceof Set)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** @type {string[]} */\n\t\t\tconst items = [];\n\n\t\t\tfor (const item of value) {\n\t\t\t\titems.push(stringify(item));\n\t\t\t}\n\n\t\t\titems.sort();\n\t\t\treturn items;\n\t\t};\n\n\t\t/** @type {(value: unknown) => Record<PropertyKey, unknown> | undefined} */\n\t\tremote_fns_reducers[remote_object] = (value) => {\n\t\t\tif (!is_plain_object(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Object.hasOwn(value, remote_arg_marker)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (remote_arg_clones.has(value)) {\n\t\t\t\treturn remote_arg_clones.get(value);\n\t\t\t}\n\n\t\t\treturn to_sorted(value, remote_arg_clones);\n\t\t};\n\t}\n\n\tconst user_reducers = Object.fromEntries(\n\t\tObject.entries(transport).map(([k, v]) => [k, v.encode])\n\t);\n\tconst all_reducers = { ...user_reducers, ...remote_fns_reducers };\n\n\t/** @type {(value: unknown) => string} */\n\tconst stringify = (value) => devalue.stringify(value, all_reducers);\n\n\treturn all_reducers;\n}\n\n/** @param {Transport} transport */\nfunction create_remote_arg_revivers(transport) {\n\tconst remote_fns_revivers = {\n\t\t/** @type {(value: unknown) => unknown} */\n\t\t[remote_object]: (value) => value,\n\t\t/** @type {(value: unknown) => Map<unknown, unknown>} */\n\t\t[remote_map]: (value) => {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new Error('Invalid data for Map reviver');\n\t\t\t}\n\n\t\t\tconst map = new Map();\n\n\t\t\tfor (const item of value) {\n\t\t\t\tif (\n\t\t\t\t\t!Array.isArray(item) ||\n\t\t\t\t\titem.length !== 2 ||\n\t\t\t\t\ttypeof item[0] !== 'string' ||\n\t\t\t\t\ttypeof item[1] !== 'string'\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error('Invalid data for Map reviver');\n\t\t\t\t}\n\t\t\t\tconst [key, val] = item;\n\t\t\t\tmap.set(parse(key), parse(val));\n\t\t\t}\n\n\t\t\treturn map;\n\t\t},\n\t\t/** @type {(value: unknown) => Set<unknown>} */\n\t\t[remote_set]: (value) => {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new Error('Invalid data for Set reviver');\n\t\t\t}\n\n\t\t\tconst set = new Set();\n\n\t\t\tfor (const item of value) {\n\t\t\t\tif (typeof item !== 'string') {\n\t\t\t\t\tthrow new Error('Invalid data for Set reviver');\n\t\t\t\t}\n\t\t\t\tset.add(parse(item));\n\t\t\t}\n\n\t\t\treturn set;\n\t\t},\n\t\t/** @type {(value: any) => File} */\n\t\t[remote_file]: (value) => {\n\t\t\tif (\n\t\t\t\t!value ||\n\t\t\t\ttypeof value !== 'object' ||\n\t\t\t\ttypeof value.name !== 'string' ||\n\t\t\t\ttypeof value.type !== 'string' ||\n\t\t\t\ttypeof value.size !== 'number' ||\n\t\t\t\ttypeof value.lastModified !== 'number' ||\n\t\t\t\t!(value.data instanceof ArrayBuffer)\n\t\t\t) {\n\t\t\t\tthrow new Error('Invalid data for File reviver');\n\t\t\t}\n\n\t\t\tconst { data, name, ...meta } = value;\n\n\t\t\treturn new File([data], name, meta);\n\t\t}\n\t};\n\n\tconst user_revivers = Object.fromEntries(\n\t\tObject.entries(transport).map(([k, v]) => [k, v.decode])\n\t);\n\n\tconst all_revivers = { ...user_revivers, ...remote_fns_revivers };\n\n\t/** @type {(data: string) => unknown} */\n\tconst parse = (data) => devalue.parse(data, all_revivers);\n\n\treturn all_revivers;\n}\n\n/**\n * Stringifies the argument (if any) for a remote function in such a way that\n * it is both a valid URL and a valid file name (necessary for prerendering).\n * @param {any} value\n * @param {Transport} transport\n */\nexport function stringify_remote_arg(value, transport) {\n\tif (value === undefined) return '';\n\n\t// If people hit file/url size limits, we can look into using something like compress_and_encode_text from svelte.dev beyond a certain size\n\tconst json = devalue.stringify(value, create_remote_arg_reducers(transport, true, new Map()));\n\n\treturn url_friendly_base64_encode(json);\n}\n\n/**\n * Stringifies command arguments, including `File` objects.\n * @param {any} value\n * @param {Transport} transport\n */\nexport async function stringify_command_arg(value, transport) {\n\tif (value === undefined) return '';\n\n\tconst reducers = create_remote_arg_reducers(transport, false, new Map());\n\n\t/** @type {Set<Promise<any>>} */\n\tconst allowed_promises = new Set();\n\n\t/** @param {any} value */\n\treducers[remote_file] = (value) => {\n\t\tif (value instanceof File) {\n\t\t\tconst promise = value.arrayBuffer().then((data) => ({\n\t\t\t\tdata,\n\t\t\t\tlastModified: value.lastModified,\n\t\t\t\tname: value.name,\n\t\t\t\tsize: value.size,\n\t\t\t\ttype: value.type\n\t\t\t}));\n\n\t\t\tallowed_promises.add(promise);\n\n\t\t\treturn promise;\n\t\t}\n\t};\n\n\t// we don't want to allow arbitrary promises, because they won't\n\t// show up as promises on the other side. this is something\n\t// we could potentially change in future. stringifyAsync\n\t// will await them, so we need to explicitly deny them\n\t/** @param {unknown} value */\n\treducers[remote_promise_guard] = (value) => {\n\t\tif (value instanceof Promise && !allowed_promises.has(value)) {\n\t\t\tthrow new Error('Promises are not valid remote function arguments');\n\t\t}\n\t};\n\n\tconst json = await devalue.stringifyAsync(value, reducers);\n\n\treturn url_friendly_base64_encode(json);\n}\n\n/**\n * Base64-encodes `string` in such a way that the result is safe to use\n * as both a URI component and a filename\n * @param {string} string\n */\nfunction url_friendly_base64_encode(string) {\n\tconst bytes = text_encoder.encode(string);\n\treturn base64_encode(bytes).replaceAll('=', '').replaceAll('+', '-').replaceAll('/', '_');\n}\n\n/**\n * Parses the argument (if any) for a remote function\n * @param {string} string\n * @param {Transport} transport\n */\nexport function parse_remote_arg(string, transport) {\n\tif (!string) return undefined;\n\n\tconst json_string = new TextDecoder().decode(\n\t\t// no need to add back `=` characters, atob can handle it\n\t\tbase64_decode(string.replaceAll('-', '+').replaceAll('_', '/'))\n\t);\n\n\treturn devalue.parse(json_string, create_remote_arg_revivers(transport));\n}\n\n/**\n * @param {string} id\n * @param {string} payload\n */\nexport function create_remote_key(id, payload) {\n\treturn id + '/' + payload;\n}\n\n/**\n * @param {string} key\n * @returns {{ id: string; payload: string }}\n */\nexport function split_remote_key(key) {\n\tconst i = key.lastIndexOf('/');\n\n\tif (i === -1) {\n\t\tthrow new Error(`Invalid remote key: ${key}`);\n\t}\n\n\treturn {\n\t\tid: key.slice(0, i),\n\t\tpayload: key.slice(i + 1)\n\t};\n}\n","import { HttpError, SvelteKitError } from '@sveltejs/kit/internal';\n\n/**\n * For times when you need to throw an error, but without\n * displaying a useless stack trace (since the developer\n * can't do anything useful with it)\n * @param {string} message\n */\nexport function stackless(message) {\n\tconst error = new Error(message);\n\terror.stack = '';\n\treturn error;\n}\n\n/**\n * @param {unknown} err\n * @return {Error}\n */\nexport function coalesce_to_error(err) {\n\treturn err instanceof Error ||\n\t\t(err && /** @type {any} */ (err).name && /** @type {any} */ (err).message)\n\t\t? /** @type {Error} */ (err)\n\t\t: new Error(JSON.stringify(err));\n}\n\n/**\n * This is an identity function that exists to make TypeScript less\n * paranoid about people throwing things that aren't errors, which\n * frankly is not something we should care about\n * @param {unknown} error\n */\nexport function normalize_error(error) {\n\treturn /** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */ (\n\t\terror\n\t);\n}\n\n/**\n * @param {unknown} error\n */\nexport function get_status(error) {\n\treturn error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;\n}\n\n/**\n * @param {unknown} error\n */\nexport function get_message(error) {\n\treturn error instanceof SvelteKitError ? error.text : 'Internal Error';\n}\n","const DATA_SUFFIX = '/__data.json';\nconst HTML_DATA_SUFFIX = '.html__data.json';\n\n/** @param {string} pathname */\nexport function has_data_suffix(pathname) {\n\treturn pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);\n}\n\n/** @param {string} pathname */\nexport function add_data_suffix(pathname) {\n\tif (pathname.endsWith('.html')) return pathname.replace(/\\.html$/, HTML_DATA_SUFFIX);\n\treturn pathname.replace(/\\/$/, '') + DATA_SUFFIX;\n}\n\n/** @param {string} pathname */\nexport function strip_data_suffix(pathname) {\n\tif (pathname.endsWith(HTML_DATA_SUFFIX)) {\n\t\treturn pathname.slice(0, -HTML_DATA_SUFFIX.length) + '.html';\n\t}\n\n\treturn pathname.slice(0, -DATA_SUFFIX.length);\n}\n\nconst ROUTE_SUFFIX = '/__route.js';\n\n/**\n * @param {string} pathname\n * @returns {boolean}\n */\nexport function has_resolution_suffix(pathname) {\n\treturn pathname.endsWith(ROUTE_SUFFIX);\n}\n\n/**\n * Convert a regular URL to a route to send to SvelteKit's server-side route resolution endpoint\n * @param {string} pathname\n * @returns {string}\n */\nexport function add_resolution_suffix(pathname) {\n\treturn pathname.replace(/\\/$/, '') + ROUTE_SUFFIX;\n}\n\n/**\n * @param {string} pathname\n * @returns {string}\n */\nexport function strip_resolution_suffix(pathname) {\n\treturn pathname.slice(0, -ROUTE_SUFFIX.length);\n}\n","/** @import { Tracer, Span, SpanContext } from '@opentelemetry/api' */\n\n/**\n * Tracer implementation that does nothing (null object).\n * @type {Tracer}\n */\nexport const noop_tracer = {\n\t/**\n\t * @returns {Span}\n\t */\n\tstartSpan() {\n\t\treturn noop_span;\n\t},\n\n\t/**\n\t * @param {unknown} _name\n\t * @param {unknown} arg_1\n\t * @param {unknown} [arg_2]\n\t * @param {Function} [arg_3]\n\t * @returns {unknown}\n\t */\n\tstartActiveSpan(_name, arg_1, arg_2, arg_3) {\n\t\tif (typeof arg_1 === 'function') {\n\t\t\treturn arg_1(noop_span);\n\t\t}\n\t\tif (typeof arg_2 === 'function') {\n\t\t\treturn arg_2(noop_span);\n\t\t}\n\t\tif (typeof arg_3 === 'function') {\n\t\t\treturn arg_3(noop_span);\n\t\t}\n\t}\n};\n\n/**\n * @type {Span}\n */\nexport const noop_span = {\n\tspanContext() {\n\t\treturn noop_span_context;\n\t},\n\tsetAttribute() {\n\t\treturn this;\n\t},\n\tsetAttributes() {\n\t\treturn this;\n\t},\n\taddEvent() {\n\t\treturn this;\n\t},\n\tsetStatus() {\n\t\treturn this;\n\t},\n\tupdateName() {\n\t\treturn this;\n\t},\n\tend() {\n\t\treturn this;\n\t},\n\tisRecording() {\n\t\treturn false;\n\t},\n\trecordException() {\n\t\treturn this;\n\t},\n\taddLink() {\n\t\treturn this;\n\t},\n\taddLinks() {\n\t\treturn this;\n\t}\n};\n\n/**\n * @type {SpanContext}\n */\nconst noop_span_context = {\n\ttraceId: '',\n\tspanId: '',\n\ttraceFlags: 0\n};\n","/**\n * Reads from a stream, decoding it as text and yielding each block of content\n * separated by `delimiter`. The trailing block (if any) is yielded once the\n * stream closes.\n * @param {ReadableStreamDefaultReader<Uint8Array>} reader\n * @param {string} delimiter\n */\nexport async function* read_stream(reader, delimiter) {\n\tlet done = false;\n\tlet buffer = '';\n\tconst decoder = new TextDecoder();\n\n\twhile (true) {\n\t\tlet split = buffer.indexOf(delimiter);\n\t\twhile (split !== -1) {\n\t\t\tyield buffer.slice(0, split);\n\t\t\tbuffer = buffer.slice(split + delimiter.length);\n\t\t\tsplit = buffer.indexOf(delimiter);\n\t\t}\n\n\t\tif (done) {\n\t\t\tif (buffer) {\n\t\t\t\tyield buffer;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst chunk = await reader.read();\n\t\tdone = chunk.done;\n\t\tif (chunk.value) {\n\t\t\tbuffer += decoder.decode(chunk.value, { stream: true });\n\t\t}\n\n\t\tif (done) {\n\t\t\tbuffer += decoder.decode();\n\t\t}\n\t}\n}\n","import { read_stream } from './stream.js';\n\n/**\n * Yields parsed JSON objects from a ReadableStream of newline-delimited JSON.\n * Each yielded value is the raw `JSON.parse`'d object — callers handle deserialization.\n * @param {ReadableStreamDefaultReader<Uint8Array>} reader\n */\nexport async function* read_ndjson(reader) {\n\tfor await (const block of read_stream(reader, '\\n')) {\n\t\tconst line = block.trim();\n\t\tif (line) {\n\t\t\tyield JSON.parse(line);\n\t\t}\n\t}\n}\n","/** @import { RemoteFunctionDataNode, ServerNodesResponse, ServerRedirectNode } from 'types' */\n/** @import { CacheEntry } from './remote-functions/cache.svelte.js' */\n/** @import { Query } from './remote-functions/query/instance.svelte.js' */\n/** @import { LiveQuery } from './remote-functions/query-live/instance.svelte.js' */\nimport { BROWSER, DEV } from 'esm-env';\nimport * as svelte from 'svelte';\nimport { HttpError, Redirect, SvelteKitError } from '@sveltejs/kit/internal';\nconst { onMount, tick } = svelte;\n// Svelte 4 and under don't have `untrack`, so we have to fallback if `untrack` is not exported\nconst untrack = svelte.untrack ?? ((value) => value());\nimport {\n\tdecode_params,\n\tdecode_pathname,\n\tstrip_hash,\n\tmake_trackable,\n\tnormalize_path\n} from '../../utils/url.js';\nimport { dev_fetch, initial_fetch, lock_fetch, subsequent_fetch, unlock_fetch } from './fetcher.js';\nimport { parse, parse_server_route } from './parse.js';\nimport * as storage from './session-storage.js';\nimport {\n\tfind_anchor,\n\tresolve_url,\n\tget_link_info,\n\tget_router_options,\n\tis_external_url,\n\torigin,\n\tscroll_state,\n\tnotifiable_store,\n\tcreate_updated_store,\n\tload_css\n} from './utils.js';\nimport { base } from '$app/paths';\nimport * as devalue from 'devalue';\nimport {\n\tHISTORY_INDEX,\n\tNAVIGATION_INDEX,\n\tPRELOAD_PRIORITIES,\n\tSCROLL_KEY,\n\tSTATES_KEY,\n\tSNAPSHOT_KEY,\n\tPAGE_URL_KEY\n} from './constants.js';\nimport { validate_page_exports } from '../../utils/exports.js';\nimport { noop } from '../../utils/functions.js';\nimport { compact } from '../../utils/array.js';\nimport {\n\tINVALIDATED_PARAM,\n\tTRAILING_SLASH_PARAM,\n\tcreate_remote_key,\n\tvalidate_depends,\n\tvalidate_load_response\n} from '../shared.js';\nimport { get_message, get_status } from '../../utils/error.js';\nimport { writable } from 'svelte/store';\nimport { page, update, navigating } from './state.svelte.js';\nimport { add_data_suffix, add_resolution_suffix } from '../pathname.js';\nimport { noop_span } from '../telemetry/noop.js';\nimport { read_ndjson } from './ndjson.js';\n\nexport { load_css };\nconst ICON_REL_ATTRIBUTES = new Set(['icon', 'shortcut icon', 'apple-touch-icon']);\n\nlet errored = false;\n/**\n * Set via transformError, reset and read at the end of navigate.\n * Necessary because a navigation might succeed loading but during rendering\n * an error occurs, at which point the navigation result needs to be overridden with the error result.\n * TODO this is all very hacky, rethink for SvelteKit 3 where we can assume Svelte 5 and do an overhaul of client.js\n * @type {{ error: App.Error, status: number } | null}\n */\nlet rendering_error = null;\n\n// We track the scroll position associated with each history entry in sessionStorage,\n// rather than on history.state itself, because when navigation is driven by\n// popstate it's too late to update the scroll position associated with the\n// state we're navigating from\n/**\n * history index -> { x, y }\n * @type {Record<number, { x: number; y: number }>}\n */\nconst scroll_positions = storage.get(SCROLL_KEY) ?? {};\n\n/**\n * navigation index -> any\n * @type {Record<string, any[]>}\n */\nconst snapshots = storage.get(SNAPSHOT_KEY) ?? {};\n\nif (DEV && BROWSER) {\n\tlet warned = false;\n\n\tconst warn = () => {\n\t\tif (warned) return;\n\n\t\t// Rather than saving a pointer to the original history methods, which would prevent monkeypatching by other libs,\n\t\t// inspect the stack trace to see if we're being called from within SvelteKit.\n\t\tlet stack = new Error().stack?.split('\\n');\n\t\tif (!stack) return;\n\t\tif (!stack[0].includes('https:') && !stack[0].includes('http:')) stack = stack.slice(1); // Chrome includes the error message in the stack\n\n\t\t// skip over `warn` and the place where `warn` was called\n\t\tconst frame = stack[2];\n\n\t\t// ignore calls that happen inside dependencies, including SvelteKit.\n\t\t// `frame` can be falsy if we came from an anonymous function\n\t\tif (frame?.includes('node_modules')) return;\n\n\t\twarned = true;\n\n\t\tconsole.warn(\n\t\t\t\"Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead.\"\n\t\t);\n\t};\n\n\tconst push_state = history.pushState;\n\thistory.pushState = (...args) => {\n\t\twarn();\n\t\treturn push_state.apply(history, args);\n\t};\n\n\tconst replace_state = history.replaceState;\n\thistory.replaceState = (...args) => {\n\t\twarn();\n\t\treturn replace_state.apply(history, args);\n\t};\n}\n\nexport const stores = {\n\turl: /* @__PURE__ */ notifiable_store({}),\n\tpage: /* @__PURE__ */ notifiable_store({}),\n\tnavigating: /* @__PURE__ */ writable(\n\t\t/** @type {import('@sveltejs/kit').Navigation | null} */ (null)\n\t),\n\tupdated: /* @__PURE__ */ create_updated_store()\n};\n\n/** @param {number} index */\nfunction update_scroll_positions(index) {\n\tscroll_positions[index] = scroll_state();\n}\n\n/**\n * @param {number} current_history_index\n * @param {number} current_navigation_index\n */\nfunction clear_onward_history(current_history_index, current_navigation_index) {\n\t// if we navigated back, then pushed a new state, we can\n\t// release memory by pruning the scroll/snapshot lookup\n\tlet i = current_history_index + 1;\n\twhile (scroll_positions[i]) {\n\t\tdelete scroll_positions[i];\n\t\ti += 1;\n\t}\n\n\ti = current_navigation_index + 1;\n\twhile (snapshots[i]) {\n\t\tdelete snapshots[i];\n\t\ti += 1;\n\t}\n}\n\n/**\n * Loads `href` the old-fashioned way, with a full page reload.\n * Returns a `Promise` that never resolves (to prevent any\n * subsequent work, e.g. history manipulation, from happening)\n * @param {URL} url\n * @param {boolean} [replace] if `true`, will replace the current `history` entry rather than creating a new one with `pushState`\n * @returns {Promise<any>} a promise that never resolves\n */\nfunction native_navigation(url, replace = false) {\n\tif (replace) {\n\t\tlocation.replace(url.href);\n\t} else {\n\t\tlocation.href = url.href;\n\t}\n\treturn new Promise(noop);\n}\n\n/**\n * Checks whether a service worker is registered, and if it is,\n * tries to update it.\n */\nasync function update_service_worker() {\n\tif ('serviceWorker' in navigator) {\n\t\tconst registration = await navigator.serviceWorker.getRegistration(base || '/');\n\t\tif (registration) {\n\t\t\tawait registration.update();\n\t\t}\n\t}\n}\n\n/** @type {import('types').CSRRoute[]} All routes of the app. Only available when kit.router.resolution=client */\nlet routes;\n/** @type {import('types').CSRPageNodeLoader} */\nlet default_layout_loader;\n/** @type {import('types').CSRPageNodeLoader} */\nlet default_error_loader;\n/** @type {HTMLElement} */\nlet container;\n/** @type {HTMLElement} */\nlet target;\n\n/** @type {import('./types.js').SvelteKitApp} */\nexport let app;\n\n/**\n * Data that was serialized during SSR for queries/forms/commands, stored as\n * `{ v }` (value) or `{ e }` (error) nodes so that failed states survive hydration.\n * Entries are deleted as they are consumed (when the corresponding resource is created).\n * @type {Record<string, RemoteFunctionDataNode>}\n */\nexport const query_responses = {};\n\n/**\n * Data that was serialized during SSR for prerender functions, stored as\n * `{ v }` (value) or `{ e }` (error) nodes.\n * This persists across client-side navigations.\n * @type {Record<string, RemoteFunctionDataNode>}\n */\nexport const prerender_responses = {};\n\n/** @type {Array<((url: URL) => boolean)>} */\nconst invalidated = [];\n\n/**\n * An array of the `+layout.svelte` and `+page.svelte` component instances\n * that currently live on the page — used for capturing and restoring snapshots.\n * It's updated/manipulated through `bind:this` in `Root.svelte`.\n * @type {import('svelte').SvelteComponent[]}\n */\nconst components = [];\n\n/** @type {{id: string, token: {}, promise: Promise<import('./types.js').NavigationResult>, fork: Promise<import('svelte').Fork | null> | null} | null} */\nlet load_cache = null;\n\nfunction discard_load_cache() {\n\tvoid load_cache?.fork?.then((f) => f?.discard());\n\tload_cache = null;\n\tcurrent_a = { element: undefined, href: undefined };\n}\n\n/**\n * @type {Map<string, Promise<URL>>}\n * Cache for client-side rerouting, since it could contain async calls which we want to\n * avoid running multiple times which would slow down navigations (e.g. else preloading\n * wouldn't help because on navigation it would be called again). Since `reroute` should be\n * a pure function (i.e. always return the same) value it's safe to cache across navigations.\n * The server reroute calls don't need to be cached because they are called using `import(...)`\n * which is cached per the JS spec.\n */\nconst reroute_cache = new Map();\n\n/**\n * Note on before_navigate_callbacks, on_navigate_callbacks and after_navigate_callbacks:\n * do not re-assign as some closures keep references to these Sets\n */\n/** @type {Set<(navigation: import('@sveltejs/kit').BeforeNavigate) => void>} */\nconst before_navigate_callbacks = new Set();\n\n/** @type {Set<(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>>} */\nconst on_navigate_callbacks = new Set();\n\n/** @type {Set<(navigation: import('@sveltejs/kit').AfterNavigate) => void>} */\nconst after_navigate_callbacks = new Set();\n\n/** @type {import('./types.js').NavigationState & { nav: import('@sveltejs/kit').NavigationEvent }} */\nlet current = {\n\tbranch: [],\n\terror: null,\n\t// @ts-ignore - we need the initial value to be null\n\turl: null,\n\t// @ts-ignore - we need the initial value to be null\n\tnav: null\n};\n\n/** this being true means we SSR'd */\nlet hydrated = false;\nlet started = false;\nlet autoscroll = true;\nlet updating = false;\nlet is_navigating = false;\nlet hash_navigating = false;\n/** True as soon as there happened one client-side navigation (excluding the SvelteKit-initialized initial one when in SPA mode) */\nlet has_navigated = false;\n\nlet force_invalidation = false;\n\n/** @type {import('svelte').SvelteComponent} */\nlet root;\n\n/** @type {number} keeping track of the history index in order to prevent popstate navigation events if needed */\nlet current_history_index;\n\n/** @type {number} */\nlet current_navigation_index;\n\n/** @type {{}} */\nlet token;\n\n/**\n * A set of tokens which are associated to current preloads.\n * If a preload becomes a real navigation, it's removed from the set.\n * If a preload token is in the set and the preload errors, the error\n * handling logic (for example reloading) is skipped.\n */\n/** @type {Set<{}>} */\nconst preload_tokens = new Set();\n\n/** @type {Promise<void> | null} */\nexport let pending_invalidate;\n\n/**\n * @type {Map<string, Map<string, CacheEntry<Query<any>>>>}\n * A map of query id -> payload -> query internals for all active queries.\n */\nexport const query_map = new Map();\n\n/**\n * @type {Map<string, Map<string, CacheEntry<LiveQuery<any>>>>}\n * A map of id -> payload -> live query internals for all active queries.\n */\nexport const live_query_map = new Map();\n\n/**\n * @param {import('./types.js').SvelteKitApp} _app\n * @param {HTMLElement} _target\n * @param {Parameters<typeof _hydrate>[1]} [hydrate]\n */\nexport async function start(_app, _target, hydrate) {\n\tif (DEV && _target === document.body) {\n\t\tconsole.warn(\n\t\t\t'Placing %sveltekit.body% directly inside <body> is not recommended, as your app may break for users who have certain browser extensions installed.\\n\\nConsider wrapping it in an element:\\n\\n<div style=\"display: contents\">\\n %sveltekit.body%\\n</div>'\n\t\t);\n\t}\n\n\tif (__SVELTEKIT_PAYLOAD__.data) {\n\t\tconst { q = {}, p = {}, l = {}, f = {} } = __SVELTEKIT_PAYLOAD__.data;\n\n\t\t// store the whole nodes — error records seed the corresponding\n\t\t// resources in a failed state when they are created during hydration\n\t\tfor (const k in q) query_responses[k] = q[k];\n\t\tfor (const k in l) query_responses[k] = l[k];\n\t\tfor (const k in f) query_responses[k] = f[k];\n\t\tfor (const k in p) prerender_responses[k] = p[k];\n\t}\n\n\t// detect basic auth credentials in the current URL\n\t// https://github.com/sveltejs/kit/pull/11179\n\t// if so, refresh the page without credentials\n\tif (document.URL !== location.href) {\n\t\t// eslint-disable-next-line no-self-assign\n\t\tlocation.href = location.href;\n\t}\n\n\tapp = _app;\n\n\tawait _app.hooks.init?.();\n\n\troutes = __SVELTEKIT_CLIENT_ROUTING__ ? parse(_app) : [];\n\tcontainer = __SVELTEKIT_EMBEDDED__ ? _target : document.documentElement;\n\ttarget = _target;\n\n\t// we import the root layout/error nodes eagerly, so that\n\t// connectivity errors after initialisation don't nuke the app\n\tdefault_layout_loader = _app.nodes[0];\n\tdefault_error_loader = _app.nodes[1];\n\tvoid default_layout_loader();\n\tvoid default_error_loader();\n\n\tcurrent_history_index = history.state?.[HISTORY_INDEX];\n\tcurrent_navigation_index = history.state?.[NAVIGATION_INDEX];\n\n\tif (!current_history_index) {\n\t\t// we use Date.now() as an offset so that cross-document navigations\n\t\t// within the app don't result in data loss\n\t\tcurrent_history_index = current_navigation_index = Date.now();\n\n\t\t// create initial history entry, so we can return here\n\t\thistory.replaceState(\n\t\t\t{\n\t\t\t\t...history.state,\n\t\t\t\t[HISTORY_INDEX]: current_history_index,\n\t\t\t\t[NAVIGATION_INDEX]: current_navigation_index\n\t\t\t},\n\t\t\t''\n\t\t);\n\t}\n\n\t// if we reload the page, or Cmd-Shift-T back to it,\n\t// recover scroll position\n\tconst scroll = scroll_positions[current_history_index];\n\tfunction restore_scroll() {\n\t\tif (scroll) {\n\t\t\thistory.scrollRestoration = 'manual';\n\t\t\tscrollTo(scroll.x, scroll.y);\n\t\t}\n\t}\n\n\tif (hydrate) {\n\t\trestore_scroll();\n\n\t\tawait _hydrate(target, hydrate);\n\t} else {\n\t\tawait navigate({\n\t\t\ttype: 'enter',\n\t\t\turl: resolve_url(app.hash ? decode_hash(new URL(location.href)) : location.href),\n\t\t\treplace_state: true\n\t\t});\n\n\t\trestore_scroll();\n\t}\n\n\t_start_router();\n}\n\nasync function _invalidate(include_load_functions = true, reset_page_state = true) {\n\t// Accept all invalidations as they come, don't swallow any while another invalidation\n\t// is running because subsequent invalidations may make earlier ones outdated,\n\t// but batch multiple synchronous invalidations.\n\tawait (pending_invalidate ||= Promise.resolve());\n\tif (!pending_invalidate) return;\n\tpending_invalidate = null;\n\n\tconst nav_token = (token = {});\n\tconst intent = await get_navigation_intent(current.url, true);\n\n\t// Clear preload, it might be affected by the invalidation.\n\t// Also solves an edge case where a preload is triggered, the navigation for it\n\t// was then triggered and is still running while the invalidation kicks in,\n\t// at which point the invalidation should take over and \"win\".\n\tdiscard_load_cache();\n\n\t// Rerun queries\n\t/** @type {Map<string, Promise<void>>} */\n\tconst live_query_reconnects = new Map();\n\tif (force_invalidation) {\n\t\tfor (const entries of query_map.values()) {\n\t\t\tfor (const { resource } of entries.values()) {\n\t\t\t\tvoid resource.refresh();\n\t\t\t}\n\t\t}\n\n\t\tfor (const [query_id, entries] of live_query_map) {\n\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\tconst key = create_remote_key(query_id, payload);\n\t\t\t\tconst promise = resource.reconnect();\n\t\t\t\tpromise.catch(noop);\n\t\t\t\tlive_query_reconnects.set(key, promise);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (include_load_functions) {\n\t\tconst prev_state = page.state;\n\t\tconst navigation_result = intent && (await load_route(intent));\n\t\tif (!navigation_result || nav_token !== token) return;\n\n\t\tif (navigation_result.type === 'redirect') {\n\t\t\treturn _goto(\n\t\t\t\tnew URL(navigation_result.location, current.url).href,\n\t\t\t\t{ replaceState: true },\n\t\t\t\t1,\n\t\t\t\tnav_token\n\t\t\t);\n\t\t}\n\n\t\t// This is a bit hacky but allows us not having to pass that boolean around, making things harder to reason about\n\t\tif (!reset_page_state) {\n\t\t\tnavigation_result.props.page.state = prev_state;\n\t\t}\n\t\tupdate(navigation_result.props.page);\n\t\tcurrent = { ...navigation_result.state, nav: current.nav };\n\t\treset_invalidation();\n\t\troot.$set(navigation_result.props);\n\t} else {\n\t\treset_invalidation();\n\t}\n\n\t// only wait for promises that are connected to queries that still exist\n\t/** @type {Promise<any>[]} */\n\tconst promises = [];\n\tfor (const entries of query_map.values()) {\n\t\tfor (const { resource } of entries.values()) {\n\t\t\tpromises.push(resource);\n\t\t}\n\t}\n\tfor (const [query_id, entries] of live_query_map) {\n\t\tfor (const payload of entries.keys()) {\n\t\t\tconst key = create_remote_key(query_id, payload);\n\t\t\tconst promise = live_query_reconnects.get(key);\n\t\t\tif (promise) {\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Don't use allSettled yet because it's too new\n\tawait Promise.all(promises).catch(noop);\n}\n\nfunction reset_invalidation() {\n\tinvalidated.length = 0;\n\tforce_invalidation = false;\n}\n\n/** @param {number} index */\nfunction capture_snapshot(index) {\n\tif (components.some((c) => c?.snapshot)) {\n\t\tsnapshots[index] = components.map((c) => c?.snapshot?.capture());\n\t}\n}\n\n/** @param {number} index */\nfunction restore_snapshot(index) {\n\tsnapshots[index]?.forEach((value, i) => {\n\t\tcomponents[i]?.snapshot?.restore(value);\n\t});\n}\n\nfunction persist_state() {\n\tupdate_scroll_positions(current_history_index);\n\tstorage.set(SCROLL_KEY, scroll_positions);\n\n\tcapture_snapshot(current_navigation_index);\n\tstorage.set(SNAPSHOT_KEY, snapshots);\n}\n\n/**\n * @param {string | URL} url\n * @param {{ replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; invalidate?: Array<string | URL | ((url: URL) => boolean)>; state?: Record<string, any> }} options\n * @param {number} redirect_count\n * @param {{}} [nav_token]\n * @returns {Promise<void>}\n */\nexport async function _goto(url, options, redirect_count, nav_token) {\n\t/** @type {Set<string>} */\n\tlet query_keys;\n\t/** @type {Set<string>} */\n\tlet live_query_keys;\n\n\t// Clear preload cache when invalidateAll is true to ensure fresh data\n\t// after form submissions or explicit invalidations\n\tif (options.invalidateAll) {\n\t\tdiscard_load_cache();\n\t}\n\n\tawait navigate({\n\t\ttype: 'goto',\n\t\turl: resolve_url(url),\n\t\tkeepfocus: options.keepFocus,\n\t\tnoscroll: options.noScroll,\n\t\treplace_state: options.replaceState,\n\t\tstate: options.state,\n\t\tredirect_count,\n\t\tnav_token,\n\t\taccept: () => {\n\t\t\tif (options.invalidateAll) {\n\t\t\t\tforce_invalidation = true;\n\t\t\t\tquery_keys = new Set();\n\t\t\t\tfor (const [id, entries] of query_map) {\n\t\t\t\t\tfor (const [payload, entry] of entries) {\n\t\t\t\t\t\t// don't refresh yet, as some queries will be unrendered,\n\t\t\t\t\t\t// but clear caches so that newly rendered queries\n\t\t\t\t\t\t// don't use stale data. TODO same for `live_query_map`\n\t\t\t\t\t\tentry.resource?.reset();\n\t\t\t\t\t\tquery_keys.add(create_remote_key(id, payload));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlive_query_keys = new Set();\n\t\t\t\tfor (const [id, entries] of live_query_map) {\n\t\t\t\t\tfor (const payload of entries.keys()) {\n\t\t\t\t\t\tlive_query_keys.add(create_remote_key(id, payload));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.invalidate) {\n\t\t\t\toptions.invalidate.forEach(push_invalidated);\n\t\t\t}\n\t\t}\n\t});\n\n\tif (options.invalidateAll) {\n\t\t// TODO the ticks shouldn't be necessary, something inside Svelte itself is buggy\n\t\t// when a query in a layout that still exists after page change is refreshed earlier than this\n\t\tvoid svelte\n\t\t\t.tick()\n\t\t\t.then(svelte.tick)\n\t\t\t.then(() => {\n\t\t\t\tfor (const [id, entries] of query_map) {\n\t\t\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\t\t\tif (query_keys?.has(create_remote_key(id, payload))) {\n\t\t\t\t\t\t\tvoid resource.start();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const [id, entries] of live_query_map) {\n\t\t\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\t\t\tif (live_query_keys?.has(create_remote_key(id, payload))) {\n\t\t\t\t\t\t\tvoid resource.reconnect();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t}\n}\n\n/** @param {import('./types.js').NavigationIntent} intent */\nasync function _preload_data(intent) {\n\t// Reuse the existing pending preload if it's for the same navigation.\n\t// Prevents an edge case where same preload is triggered multiple times,\n\t// then a later one is becoming the real navigation and the preload tokens\n\t// get out of sync.\n\tif (intent.id !== load_cache?.id) {\n\t\tdiscard_load_cache();\n\n\t\tconst preload = {};\n\t\tpreload_tokens.add(preload);\n\t\tload_cache = {\n\t\t\tid: intent.id,\n\t\t\ttoken: preload,\n\t\t\tpromise: load_route({ ...intent, preload }).then((result) => {\n\t\t\t\tpreload_tokens.delete(preload);\n\t\t\t\tif (result.type === 'loaded' && result.state.error) {\n\t\t\t\t\t// Don't cache errors, because they might be transient\n\t\t\t\t\tdiscard_load_cache();\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}),\n\t\t\tfork: null\n\t\t};\n\n\t\tif (__SVELTEKIT_FORK_PRELOADS__ && svelte.fork) {\n\t\t\tconst lc = load_cache;\n\n\t\t\tlc.fork = lc.promise.then((result) => {\n\t\t\t\t// if load_cache was discarded before load_cache.promise could\n\t\t\t\t// resolve, bail rather than creating an orphan fork\n\t\t\t\tif (lc === load_cache && result.type === 'loaded') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn svelte.fork(() => {\n\t\t\t\t\t\t\troot.$set(result.props);\n\t\t\t\t\t\t\tupdate(result.props.page);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// if it errors, it's because the experimental flag isn't enabled in Svelte\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t});\n\t\t}\n\t}\n\n\treturn load_cache.promise;\n}\n\n/**\n * @param {URL} url\n * @returns {Promise<void>}\n */\nasync function _preload_code(url) {\n\tconst route = (await get_navigation_intent(url, false))?.route;\n\n\tif (route) {\n\t\tawait Promise.all(\n\t\t\t/** @type {[has_server_load: boolean, node_loader: import('types').CSRPageNodeLoader][]} */ (\n\t\t\t\t[...route.layouts, route.leaf].filter(Boolean)\n\t\t\t).map((load) => load[1]())\n\t\t);\n\t}\n}\n\n/**\n * @param {import('./types.js').NavigationFinished} result\n * @param {HTMLElement} target\n * @param {boolean} hydrate\n */\nasync function initialize(result, target, hydrate) {\n\tif (__SVELTEKIT_DEV__ && result.state.error && document.querySelector('vite-error-overlay'))\n\t\treturn;\n\n\t/** @type {import('@sveltejs/kit').NavigationEvent} */\n\tconst nav = {\n\t\tparams: current.params,\n\t\troute: { id: current.route?.id ?? null },\n\t\turl: new URL(location.href)\n\t};\n\n\tcurrent = {\n\t\t...result.state,\n\t\tnav\n\t};\n\n\t// Removes the style node we used to avoid FOUC during development\n\tif (__SVELTEKIT_DEV__) {\n\t\tconst style = document.querySelector('style[data-sveltekit]');\n\t\tif (style) style.remove();\n\t}\n\n\tupdate(/** @type {import('@sveltejs/kit').Page} */ (result.props.page));\n\n\troot = new app.root({\n\t\ttarget,\n\t\tprops: { ...result.props, stores, components },\n\t\thydrate,\n\t\t// @ts-ignore Svelte 5 specific: asynchronously instantiate the component, i.e. don't call flushSync\n\t\tsync: false,\n\t\t// @ts-ignore Svelte 5 specific: transformError allows to transform errors before they are passed to boundaries\n\t\ttransformError: __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__\n\t\t\t? /** @param {unknown} e */ async (e) => {\n\t\t\t\t\tconst error = await handle_error(e, current.nav);\n\t\t\t\t\trendering_error = { error, status: get_status(e) };\n\t\t\t\t\tpage.error = error;\n\t\t\t\t\tpage.status = rendering_error.status;\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t: undefined\n\t});\n\n\t// Wait for a microtask in case svelte experimental async is enabled,\n\t// which causes component script blocks to run asynchronously\n\tvoid (await Promise.resolve());\n\n\tif (hydrate) {\n\t\t/** @type {import('@sveltejs/kit').AfterNavigate} */\n\t\tconst navigation = {\n\t\t\tfrom: null,\n\t\t\tto: {\n\t\t\t\t...nav,\n\t\t\t\tscroll: scroll_positions[current_history_index] ?? scroll_state()\n\t\t\t},\n\t\t\twillUnload: false,\n\t\t\ttype: 'enter',\n\t\t\tcomplete: Promise.resolve()\n\t\t};\n\n\t\tafter_navigate_callbacks.forEach((fn) => fn(navigation));\n\t}\n\n\trestore_snapshot(current_navigation_index);\n\n\tstarted = true;\n}\n\n/**\n *\n * @param {{\n * url: URL;\n * params: Record<string, string>;\n * branch: Array<import('./types.js').BranchNode | undefined>;\n * errors?: Array<import('types').CSRPageNodeLoader | undefined>;\n * status: number;\n * error: App.Error | null;\n * route: import('types').CSRRoute | null;\n * form?: Record<string, any> | null;\n * }} opts\n */\nasync function get_navigation_result_from_branch({\n\turl,\n\tparams,\n\tbranch,\n\terrors,\n\tstatus,\n\terror,\n\troute,\n\tform\n}) {\n\t/** @type {import('types').TrailingSlash} */\n\tlet slash = 'never';\n\n\t// if `paths.base === '/a/b/c`, then the root route is always `/a/b/c/`, regardless of\n\t// the `trailingSlash` route option, so that relative paths to JS and CSS work\n\tif (base && (url.pathname === base || url.pathname === base + '/')) {\n\t\tslash = 'always';\n\t} else {\n\t\tfor (const node of branch) {\n\t\t\tif (node?.slash !== undefined) slash = node.slash;\n\t\t}\n\t}\n\n\turl.pathname = normalize_path(url.pathname, slash);\n\t// eslint-disable-next-line no-self-assign\n\turl.search = url.search; // turn `/?` into `/`\n\n\t/** @type {import('./types.js').NavigationFinished} */\n\tconst result = {\n\t\ttype: 'loaded',\n\t\tstate: {\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch,\n\t\t\terror,\n\t\t\troute\n\t\t},\n\t\tprops: {\n\t\t\t// @ts-ignore Somehow it's getting SvelteComponent and SvelteComponentDev mixed up\n\t\t\tconstructors: compact(branch).map((branch_node) => branch_node.node.component),\n\t\t\tpage: clone_page(page)\n\t\t}\n\t};\n\n\tif (errors && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) {\n\t\tlet last_idx = -1;\n\t\tresult.props.errors = await Promise.all(\n\t\t\t// eslint-disable-next-line @typescript-eslint/await-thenable\n\t\t\tbranch\n\t\t\t\t.map((b, i) => {\n\t\t\t\t\tif (i === 0) return undefined; // root layout wraps root error component, not the other way around\n\t\t\t\t\tif (!b) return null;\n\n\t\t\t\t\ti--;\n\t\t\t\t\t// Find the closest error component up to the previous branch\n\t\t\t\t\twhile (i > last_idx + 1 && !errors[i]) i -= 1;\n\t\t\t\t\tlast_idx = i;\n\t\t\t\t\treturn errors[i]?.()\n\t\t\t\t\t\t.then((e) => e.component)\n\t\t\t\t\t\t.catch(() => undefined);\n\t\t\t\t})\n\t\t\t\t// filter out indexes where there was no branch, but keep indexes where there was a branch but no error component\n\t\t\t\t.filter((e) => e !== null)\n\t\t);\n\t}\n\n\tif (error && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) {\n\t\tresult.props.error = error;\n\t}\n\n\tif (form !== undefined) {\n\t\tresult.props.form = form;\n\t}\n\n\tlet data = {};\n\tlet data_changed = !page;\n\n\tlet p = 0;\n\n\tfor (let i = 0; i < Math.max(branch.length, current.branch.length); i += 1) {\n\t\tconst node = branch[i];\n\t\tconst prev = current.branch[i];\n\n\t\tif (node?.data !== prev?.data) data_changed = true;\n\t\tif (!node) continue;\n\n\t\tdata = { ...data, ...node.data };\n\n\t\t// Only set props if the node actually updated. This prevents needless rerenders.\n\t\tif (data_changed) {\n\t\t\tresult.props[`data_${p}`] = data;\n\t\t}\n\n\t\tp += 1;\n\t}\n\n\tconst page_changed =\n\t\t!current.url ||\n\t\turl.href !== current.url.href ||\n\t\tcurrent.error !== error ||\n\t\t(form !== undefined && form !== page.form) ||\n\t\tdata_changed;\n\n\tif (page_changed) {\n\t\tresult.props.page = {\n\t\t\terror,\n\t\t\tparams,\n\t\t\troute: {\n\t\t\t\tid: route?.id ?? null\n\t\t\t},\n\t\t\tstate: {},\n\t\t\tstatus,\n\t\t\turl: new URL(url),\n\t\t\tform: form ?? null,\n\t\t\t// The whole page store is updated, but this way the object reference stays the same\n\t\t\tdata: data_changed ? data : page.data\n\t\t};\n\t}\n\n\treturn result;\n}\n\n/**\n * Call the universal load function of the given node, if it exists.\n *\n * @param {{\n * loader: import('types').CSRPageNodeLoader;\n * \t parent: () => Promise<Record<string, any>>;\n * url: URL;\n * params: Record<string, string>;\n * route: { id: string | null };\n * \t server_data_node: import('./types.js').DataNode | null;\n * }} options\n * @returns {Promise<import('./types.js').BranchNode>}\n */\nasync function load_node({ loader, parent, url, params, route, server_data_node }) {\n\t/** @type {Record<string, any> | null} */\n\tlet data = null;\n\n\tlet is_tracking = true;\n\n\t/** @type {import('types').Uses} */\n\tconst uses = {\n\t\tdependencies: new Set(),\n\t\tparams: new Set(),\n\t\tparent: false,\n\t\troute: false,\n\t\turl: false,\n\t\tsearch_params: new Set()\n\t};\n\n\tconst node = await loader();\n\n\tif (DEV) {\n\t\tvalidate_page_exports(node.universal);\n\n\t\tif (node.universal && app.hash) {\n\t\t\tconst options = Object.keys(node.universal).filter((o) => o !== 'load');\n\n\t\t\tif (options.length > 0) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Page options are ignored when \\`router.type === 'hash'\\` (${route.id} has ${options\n\t\t\t\t\t\t.filter((o) => o !== 'load')\n\t\t\t\t\t\t.map((o) => `'${o}'`)\n\t\t\t\t\t\t.join(', ')})`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (__SVELTEKIT_HAS_UNIVERSAL_LOAD__ && node.universal?.load) {\n\t\t/** @param {string[]} deps */\n\t\tfunction depends(...deps) {\n\t\t\tfor (const dep of deps) {\n\t\t\t\tif (DEV) validate_depends(/** @type {string} */ (route.id), dep);\n\n\t\t\t\tconst { href } = new URL(dep, url);\n\t\t\t\tuses.dependencies.add(href);\n\t\t\t}\n\t\t}\n\n\t\t/** @type {import('@sveltejs/kit').LoadEvent} */\n\t\tconst load_input = {\n\t\t\ttracing: { enabled: false, root: noop_span, current: noop_span },\n\t\t\troute: new Proxy(route, {\n\t\t\t\tget: (target, key) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.route = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn target[/** @type {'id'} */ (key)];\n\t\t\t\t}\n\t\t\t}),\n\t\t\tparams: new Proxy(params, {\n\t\t\t\tget: (target, key) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.params.add(/** @type {string} */ (key));\n\t\t\t\t\t}\n\t\t\t\t\treturn target[/** @type {string} */ (key)];\n\t\t\t\t}\n\t\t\t}),\n\t\t\tdata: server_data_node?.data ?? null,\n\t\t\turl: make_trackable(\n\t\t\t\turl,\n\t\t\t\t() => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.url = true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t(param) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.search_params.add(param);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tapp.hash\n\t\t\t),\n\t\t\tasync fetch(resource, init) {\n\t\t\t\tif (resource instanceof Request) {\n\t\t\t\t\t// we're not allowed to modify the received `Request` object, so in order\n\t\t\t\t\t// to fixup relative urls we create a new equivalent `init` object instead\n\t\t\t\t\tinit = {\n\t\t\t\t\t\t// the request body must be consumed in memory until browsers\n\t\t\t\t\t\t// implement streaming request bodies and/or the body getter\n\t\t\t\t\t\tbody:\n\t\t\t\t\t\t\tresource.method === 'GET' || resource.method === 'HEAD'\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: await resource.blob(),\n\t\t\t\t\t\tcache: resource.cache,\n\t\t\t\t\t\tcredentials: resource.credentials,\n\t\t\t\t\t\t// the server sets headers to `undefined` if there are no headers but\n\t\t\t\t\t\t// the client defaults to an empty Headers object in the Request object.\n\t\t\t\t\t\t// To keep the two values in sync, we explicitly set the headers to `undefined`.\n\t\t\t\t\t\t// Also, not sure why, but sometimes 0 is evaluated as truthy so we need to\n\t\t\t\t\t\t// explicitly compare the headers length to a number here\n\t\t\t\t\t\theaders: [...resource.headers].length > 0 ? resource?.headers : undefined,\n\t\t\t\t\t\tintegrity: resource.integrity,\n\t\t\t\t\t\tkeepalive: resource.keepalive,\n\t\t\t\t\t\tmethod: resource.method,\n\t\t\t\t\t\tmode: resource.mode,\n\t\t\t\t\t\tredirect: resource.redirect,\n\t\t\t\t\t\treferrer: resource.referrer,\n\t\t\t\t\t\treferrerPolicy: resource.referrerPolicy,\n\t\t\t\t\t\tsignal: resource.signal,\n\t\t\t\t\t\t...init\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst { resolved, promise } = resolve_fetch_url(resource, init, url);\n\n\t\t\t\tif (is_tracking) {\n\t\t\t\t\tdepends(resolved.href);\n\t\t\t\t}\n\n\t\t\t\treturn promise;\n\t\t\t},\n\t\t\tsetHeaders: noop,\n\t\t\tdepends,\n\t\t\tparent() {\n\t\t\t\tif (is_tracking) {\n\t\t\t\t\tuses.parent = true;\n\t\t\t\t}\n\t\t\t\treturn parent();\n\t\t\t},\n\t\t\tuntrack(fn) {\n\t\t\t\tis_tracking = false;\n\t\t\t\ttry {\n\t\t\t\t\treturn fn();\n\t\t\t\t} finally {\n\t\t\t\t\tis_tracking = true;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tif (DEV) {\n\t\t\ttry {\n\t\t\t\tlock_fetch();\n\t\t\t\tdata = (await node.universal.load.call(null, load_input)) ?? null;\n\t\t\t\tvalidate_load_response(data, `related to route '${route.id}'`);\n\t\t\t} finally {\n\t\t\t\tunlock_fetch();\n\t\t\t}\n\t\t} else {\n\t\t\tdata = (await node.universal.load.call(null, load_input)) ?? null;\n\t\t}\n\t}\n\n\treturn {\n\t\tnode,\n\t\tloader,\n\t\tserver: server_data_node,\n\t\tuniversal: node.universal?.load ? { type: 'data', data, uses } : null,\n\t\tdata: data ?? server_data_node?.data ?? null,\n\t\tslash: node.universal?.trailingSlash ?? server_data_node?.slash\n\t};\n}\n\n/**\n * @param {Request | string | URL} input\n * @param {RequestInit | undefined} init\n * @param {URL} url\n */\nfunction resolve_fetch_url(input, init, url) {\n\tlet requested = input instanceof Request ? input.url : input;\n\n\t// we must fixup relative urls so they are resolved from the target page\n\tconst resolved = new URL(requested, url);\n\n\t// match ssr serialized data url, which is important to find cached responses\n\tif (resolved.origin === url.origin) {\n\t\trequested = resolved.href.slice(url.origin.length);\n\t}\n\n\t// prerendered pages may be served from any origin, so `initial_fetch` urls shouldn't be resolved\n\tconst promise = started\n\t\t? subsequent_fetch(requested, resolved.href, init)\n\t\t: initial_fetch(requested, init);\n\n\treturn { resolved, promise };\n}\n\n/**\n * @param {boolean} parent_changed\n * @param {boolean} route_changed\n * @param {boolean} url_changed\n * @param {Set<string>} search_params_changed\n * @param {import('types').Uses | undefined} uses\n * @param {Record<string, string>} params\n */\nfunction has_changed(\n\tparent_changed,\n\troute_changed,\n\turl_changed,\n\tsearch_params_changed,\n\tuses,\n\tparams\n) {\n\tif (force_invalidation) return true;\n\n\tif (!uses) return false;\n\n\tif (uses.parent && parent_changed) return true;\n\tif (uses.route && route_changed) return true;\n\tif (uses.url && url_changed) return true;\n\n\tfor (const tracked_params of uses.search_params) {\n\t\tif (search_params_changed.has(tracked_params)) return true;\n\t}\n\n\tfor (const param of uses.params) {\n\t\tif (params[param] !== current.params[param]) return true;\n\t}\n\n\tfor (const href of uses.dependencies) {\n\t\tif (invalidated.some((fn) => fn(new URL(href)))) return true;\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node\n * @param {import('./types.js').DataNode | null} [previous]\n * @returns {import('./types.js').DataNode | null}\n */\nfunction create_data_node(node, previous) {\n\tif (node?.type === 'data') return node;\n\tif (node?.type === 'skip') return previous ?? null;\n\treturn null;\n}\n\n/**\n * @param {URL | null} old_url\n * @param {URL} new_url\n */\nfunction diff_search_params(old_url, new_url) {\n\tif (!old_url) return new Set(new_url.searchParams.keys());\n\n\tconst changed = new Set([...old_url.searchParams.keys(), ...new_url.searchParams.keys()]);\n\n\tfor (const key of changed) {\n\t\tconst old_values = old_url.searchParams.getAll(key);\n\t\tconst new_values = new_url.searchParams.getAll(key);\n\n\t\tif (\n\t\t\told_values.every((value) => new_values.includes(value)) &&\n\t\t\tnew_values.every((value) => old_values.includes(value))\n\t\t) {\n\t\t\tchanged.delete(key);\n\t\t}\n\t}\n\n\treturn changed;\n}\n\n/**\n * @param {Omit<import('./types.js').NavigationFinished['state'], 'branch'> & { error: App.Error }} opts\n * @returns {import('./types.js').NavigationFinished}\n */\nfunction preload_error({ error, url, route, params }) {\n\treturn {\n\t\ttype: 'loaded',\n\t\tstate: {\n\t\t\terror,\n\t\t\turl,\n\t\t\troute,\n\t\t\tparams,\n\t\t\tbranch: []\n\t\t},\n\t\tprops: {\n\t\t\tpage: clone_page(page),\n\t\t\tconstructors: []\n\t\t}\n\t};\n}\n\n/**\n * @overload\n * @param {import('./types.js').NavigationIntent} intent\n * @returns {Promise<import('./types.js').NavigationResult | undefined>}\n */\n/**\n * @overload\n * @param {import('./types.js').NavigationIntent & { preload: {} }} intent\n * @returns {Promise<import('./types.js').NavigationResult>}\n */\n/**\n * @param {import('./types.js').NavigationIntent & { preload?: {} }} intent\n * @returns {Promise<import('./types.js').NavigationResult | undefined>}\n */\nasync function load_route({ id, invalidating, url, params, route, preload }) {\n\tif (load_cache?.id === id) {\n\t\t// the preload becomes the real navigation\n\t\tpreload_tokens.delete(load_cache.token);\n\t\treturn load_cache.promise;\n\t}\n\n\tconst { errors, layouts, leaf } = route;\n\n\tconst loaders = [...layouts, leaf];\n\n\t// preload modules to avoid waterfall, but handle rejections\n\t// so they don't get reported to Sentry et al (we don't need\n\t// to act on the failures at this point)\n\terrors.forEach((loader) => loader?.().catch(noop));\n\tloaders.forEach((loader) => loader?.[1]().catch(noop));\n\n\t/** @type {import('types').ServerNodesResponse | import('types').ServerRedirectNode | null} */\n\tlet server_data = null;\n\tconst url_changed = current.url ? id !== get_page_key(current.url) : false;\n\tconst route_changed = current.route ? route.id !== current.route.id : false;\n\tconst search_params_changed = diff_search_params(current.url, url);\n\n\tlet parent_invalid = false;\n\n\tif (__SVELTEKIT_HAS_SERVER_LOAD__) {\n\t\tconst invalid_server_nodes = loaders.map((loader, i) => {\n\t\t\tconst previous = current.branch[i];\n\n\t\t\tconst invalid =\n\t\t\t\t!!loader?.[0] &&\n\t\t\t\t(previous?.loader !== loader[1] ||\n\t\t\t\t\thas_changed(\n\t\t\t\t\t\tparent_invalid,\n\t\t\t\t\t\troute_changed,\n\t\t\t\t\t\turl_changed,\n\t\t\t\t\t\tsearch_params_changed,\n\t\t\t\t\t\tprevious.server?.uses,\n\t\t\t\t\t\tparams\n\t\t\t\t\t));\n\n\t\t\tif (invalid) {\n\t\t\t\t// For the next one\n\t\t\t\tparent_invalid = true;\n\t\t\t}\n\n\t\t\treturn invalid;\n\t\t});\n\n\t\tif (invalid_server_nodes.some(Boolean)) {\n\t\t\ttry {\n\t\t\t\tserver_data = await load_data(url, invalid_server_nodes);\n\t\t\t} catch (error) {\n\t\t\t\tconst handled_error = await handle_error(error, { url, params, route: { id } });\n\n\t\t\t\tif (preload && preload_tokens.has(preload)) {\n\t\t\t\t\treturn preload_error({ error: handled_error, url, params, route });\n\t\t\t\t}\n\n\t\t\t\treturn load_root_error_page({\n\t\t\t\t\tstatus: get_status(error),\n\t\t\t\t\terror: handled_error,\n\t\t\t\t\turl,\n\t\t\t\t\troute\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (server_data.type === 'redirect') {\n\t\t\t\treturn server_data;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst server_data_nodes = server_data?.nodes;\n\n\tlet parent_changed = false;\n\n\tconst branch_promises = loaders.map(async (loader, i) => {\n\t\tif (!loader) return;\n\n\t\t/** @type {import('./types.js').BranchNode | undefined} */\n\t\tconst previous = current.branch[i];\n\n\t\tconst server_data_node = server_data_nodes?.[i];\n\n\t\t// reuse data from previous load if it's still valid\n\t\tconst valid =\n\t\t\t(!server_data_node || server_data_node.type === 'skip') &&\n\t\t\tloader[1] === previous?.loader &&\n\t\t\t!has_changed(\n\t\t\t\tparent_changed,\n\t\t\t\troute_changed,\n\t\t\t\turl_changed,\n\t\t\t\tsearch_params_changed,\n\t\t\t\tprevious.universal?.uses,\n\t\t\t\tparams\n\t\t\t);\n\t\tif (valid) return previous;\n\n\t\tparent_changed = true;\n\n\t\tif (server_data_node?.type === 'error') {\n\t\t\t// rethrow and catch below\n\t\t\tthrow server_data_node;\n\t\t}\n\n\t\treturn load_node({\n\t\t\tloader: loader[1],\n\t\t\turl,\n\t\t\tparams,\n\t\t\troute,\n\t\t\tparent: async () => {\n\t\t\t\tconst data = {};\n\t\t\t\tfor (let j = 0; j < i; j += 1) {\n\t\t\t\t\tObject.assign(data, (await branch_promises[j])?.data);\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\tserver_data_node: create_data_node(\n\t\t\t\t// server_data_node is undefined if it wasn't reloaded from the server;\n\t\t\t\t// and if current loader uses server data, we want to reuse previous data.\n\t\t\t\tserver_data_node === undefined && loader[0] ? { type: 'skip' } : (server_data_node ?? null),\n\t\t\t\tloader[0] ? previous?.server : undefined\n\t\t\t)\n\t\t});\n\t});\n\n\t// if we don't do this, rejections will be unhandled\n\tfor (const p of branch_promises) p.catch(noop);\n\n\t/** @type {Array<import('./types.js').BranchNode | undefined>} */\n\tconst branch = [];\n\n\tfor (let i = 0; i < loaders.length; i += 1) {\n\t\tif (loaders[i]) {\n\t\t\ttry {\n\t\t\t\tbranch.push(await branch_promises[i]);\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof Redirect) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'redirect',\n\t\t\t\t\t\tlocation: err.location\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (preload && preload_tokens.has(preload)) {\n\t\t\t\t\treturn preload_error({\n\t\t\t\t\t\terror: await handle_error(err, { params, url, route: { id: route.id } }),\n\t\t\t\t\t\turl,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t\troute\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlet status = get_status(err);\n\t\t\t\t/** @type {App.Error} */\n\t\t\t\tlet error;\n\n\t\t\t\tif (server_data_nodes?.includes(/** @type {import('types').ServerErrorNode} */ (err))) {\n\t\t\t\t\t// this is the server error rethrown above, reconstruct but don't invoke\n\t\t\t\t\t// the client error handler; it should've already been handled on the server\n\t\t\t\t\tstatus = /** @type {import('types').ServerErrorNode} */ (err).status ?? status;\n\t\t\t\t\terror = /** @type {import('types').ServerErrorNode} */ (err).error;\n\t\t\t\t} else if (err instanceof HttpError) {\n\t\t\t\t\terror = err.body;\n\t\t\t\t} else {\n\t\t\t\t\t// Referenced node could have been removed due to redeploy, check\n\t\t\t\t\tconst updated = await stores.updated.check();\n\t\t\t\t\tif (updated) {\n\t\t\t\t\t\t// Before reloading, try to update the service worker if it exists\n\t\t\t\t\t\tawait update_service_worker();\n\t\t\t\t\t\treturn await native_navigation(url);\n\t\t\t\t\t}\n\n\t\t\t\t\terror = await handle_error(err, { params, url, route: { id: route.id } });\n\t\t\t\t}\n\n\t\t\t\tconst error_load = await load_nearest_error_page(i, branch, errors);\n\t\t\t\tif (error_load) {\n\t\t\t\t\treturn get_navigation_result_from_branch({\n\t\t\t\t\t\turl,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t\tbranch: branch.slice(0, error_load.idx).concat(error_load.node),\n\t\t\t\t\t\terrors,\n\t\t\t\t\t\tstatus,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\troute\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturn await server_fallback(url, { id: route.id }, error, status);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// push an empty slot so we can rewind past gaps to the\n\t\t\t// layout that corresponds with an +error.svelte page\n\t\t\tbranch.push(undefined);\n\t\t}\n\t}\n\n\treturn get_navigation_result_from_branch({\n\t\turl,\n\t\tparams,\n\t\tbranch,\n\t\terrors,\n\t\tstatus: 200,\n\t\terror: null,\n\t\troute,\n\t\t// Reset `form` on navigation, but not invalidation\n\t\tform: invalidating ? undefined : null\n\t});\n}\n\n/**\n * @param {number} i Start index to backtrack from\n * @param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack\n * @param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch\n * @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>}\n */\nasync function load_nearest_error_page(i, branch, errors) {\n\twhile (i--) {\n\t\tif (errors[i]) {\n\t\t\tlet j = i;\n\t\t\twhile (!branch[j]) j -= 1;\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tidx: j + 1,\n\t\t\t\t\tnode: {\n\t\t\t\t\t\tnode: await /** @type {import('types').CSRPageNodeLoader } */ (errors[i])(),\n\t\t\t\t\t\tloader: /** @type {import('types').CSRPageNodeLoader } */ (errors[i]),\n\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\tserver: null,\n\t\t\t\t\t\tuniversal: null\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {{\n * status: number;\n * error: App.Error;\n * url: URL;\n * route: { id: string | null }\n * }} opts\n * @returns {Promise<import('./types.js').NavigationFinished | undefined>} returns `undefined` in case of a redirect\n */\nasync function load_root_error_page({ status, error, url, route }) {\n\t/** @type {Record<string, string>} */\n\tconst params = {}; // error page does not have params\n\n\t/** @type {import('types').ServerDataNode | null} */\n\tlet server_data_node = null;\n\n\tif (__SVELTEKIT_HAS_SERVER_LOAD__) {\n\t\tconst default_layout_has_server_load = app.server_loads[0] === 0;\n\n\t\tif (default_layout_has_server_load) {\n\t\t\t// TODO post-https://github.com/sveltejs/kit/discussions/6124 we can use\n\t\t\t// existing root layout data\n\t\t\ttry {\n\t\t\t\tconst server_data = await load_data(url, [true]);\n\n\t\t\t\tif (\n\t\t\t\t\tserver_data.type !== 'data' ||\n\t\t\t\t\t(server_data.nodes[0] && server_data.nodes[0].type !== 'data')\n\t\t\t\t) {\n\t\t\t\t\tthrow 0;\n\t\t\t\t}\n\n\t\t\t\tserver_data_node = server_data.nodes[0] ?? null;\n\t\t\t} catch (e) {\n\t\t\t\t// at this point we have no choice but to fall back to the server, if it wouldn't\n\t\t\t\t// bring us right back here, turning this into an endless loop.\n\t\t\t\t// if __data.json returned 404, the route doesn't exist — don't reload or we loop\n\t\t\t\tif (\n\t\t\t\t\t!(e instanceof HttpError && e.status === 404) &&\n\t\t\t\t\t(url.origin !== origin || url.pathname !== location.pathname || hydrated)\n\t\t\t\t) {\n\t\t\t\t\treturn await native_navigation(url);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ttry {\n\t\tconst root_layout = await load_node({\n\t\t\tloader: default_layout_loader,\n\t\t\turl,\n\t\t\tparams,\n\t\t\troute,\n\t\t\tparent: () => Promise.resolve({}),\n\t\t\tserver_data_node: create_data_node(server_data_node)\n\t\t});\n\n\t\t/** @type {import('./types.js').BranchNode} */\n\t\tconst root_error = {\n\t\t\tnode: await default_error_loader(),\n\t\t\tloader: default_error_loader,\n\t\t\tuniversal: null,\n\t\t\tserver: null,\n\t\t\tdata: null\n\t\t};\n\n\t\treturn get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch: [root_layout, root_error],\n\t\t\tstatus,\n\t\t\terror,\n\t\t\terrors: [],\n\t\t\troute: null\n\t\t});\n\t} catch (error) {\n\t\t// client-side navigation if the root layout loader throws a redirect while\n\t\t// rendering the default error page\n\t\tif (error instanceof Redirect) {\n\t\t\tawait _goto(new URL(error.location, location.href), {}, 0);\n\t\t\treturn;\n\t\t}\n\n\t\t// otherwise, render the static error page\n\t\tconst error_template = await app.get_error_template();\n\t\tconst handled = await handle_error(error, { url, params, route });\n\t\tconst message = String(handled?.message ?? '')\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;');\n\t\tconst html = error_template({ status, message });\n\t\tconst parsed = new DOMParser().parseFromString(html, 'text/html');\n\t\tdocument.documentElement.replaceChild(document.adoptNode(parsed.head), document.head);\n\t\tdocument.documentElement.replaceChild(document.adoptNode(parsed.body), document.body);\n\n\t\tthrow error;\n\t}\n}\n\n/**\n * Resolve the relative rerouted URL for a client-side navigation\n * @param {URL} url\n * @returns {Promise<URL | undefined>}\n */\nasync function get_rerouted_url(url) {\n\tconst href = url.href;\n\n\tif (reroute_cache.has(href)) {\n\t\treturn reroute_cache.get(href);\n\t}\n\n\tlet rerouted;\n\n\ttry {\n\t\tconst promise = (async () => {\n\t\t\t// reroute could alter the given URL, so we pass a copy\n\t\t\tlet rerouted =\n\t\t\t\t(await app.hooks.reroute({\n\t\t\t\t\turl: new URL(url),\n\t\t\t\t\tfetch: async (input, init) => {\n\t\t\t\t\t\treturn resolve_fetch_url(input, init, url).promise;\n\t\t\t\t\t}\n\t\t\t\t})) ?? url;\n\n\t\t\tif (typeof rerouted === 'string') {\n\t\t\t\tconst tmp = new URL(url); // do not mutate the incoming URL\n\n\t\t\t\tif (app.hash) {\n\t\t\t\t\ttmp.hash = rerouted;\n\t\t\t\t} else {\n\t\t\t\t\ttmp.pathname = rerouted;\n\t\t\t\t}\n\n\t\t\t\trerouted = tmp;\n\t\t\t}\n\n\t\t\treturn rerouted;\n\t\t})();\n\n\t\treroute_cache.set(href, promise);\n\t\trerouted = await promise;\n\t} catch (e) {\n\t\treroute_cache.delete(href);\n\t\tif (DEV) {\n\t\t\t// in development, print the error...\n\t\t\tconsole.error(e);\n\n\t\t\t// ...and pause execution, since otherwise we will immediately reload the page\n\t\t\tdebugger; // eslint-disable-line\n\t\t}\n\n\t\t// fall back to native navigation\n\t\treturn;\n\t}\n\n\treturn rerouted;\n}\n\n/**\n * Resolve the full info (which route, params, etc.) for a client-side navigation from the URL,\n * taking the reroute hook into account. If this isn't a client-side-navigation (or the URL is undefined),\n * returns undefined.\n * @param {URL | undefined} url\n * @param {boolean} invalidating\n * @returns {Promise<import('./types.js').NavigationIntent | undefined>}\n */\nexport async function get_navigation_intent(url, invalidating) {\n\tif (!url) return;\n\tif (is_external_url(url, base, app.hash)) return;\n\n\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\tconst rerouted = await get_rerouted_url(url);\n\t\tif (!rerouted) return;\n\n\t\tconst path = get_url_path(rerouted);\n\n\t\tfor (const route of routes) {\n\t\t\tconst params = route.exec(path);\n\n\t\t\tif (params) {\n\t\t\t\treturn {\n\t\t\t\t\tid: get_page_key(url),\n\t\t\t\t\tinvalidating,\n\t\t\t\t\troute,\n\t\t\t\t\tparams: decode_params(params),\n\t\t\t\t\turl\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/** @type {{ route?: import('types').CSRRouteServer, params: Record<string, string>}} */\n\t\tconst { route, params } = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tadd_resolution_suffix(url.pathname)\n\t\t);\n\n\t\tif (!route) return;\n\n\t\treturn {\n\t\t\tid: get_page_key(url),\n\t\t\tinvalidating,\n\t\t\troute: parse_server_route(route, app.nodes),\n\t\t\tparams,\n\t\t\turl\n\t\t};\n\t}\n}\n\n/** @param {URL} url */\nfunction get_url_path(url) {\n\treturn (\n\t\tdecode_pathname(\n\t\t\tapp.hash ? url.hash.replace(/^#/, '').replace(/[?#].+/, '') : url.pathname.slice(base.length)\n\t\t) || '/'\n\t);\n}\n\n/** @param {URL} url */\nfunction get_page_key(url) {\n\treturn (app.hash ? url.hash.replace(/^#/, '') : url.pathname) + url.search;\n}\n\n/**\n * @param {{\n * url: URL;\n * type: import('@sveltejs/kit').Navigation[\"type\"];\n * intent?: import('./types.js').NavigationIntent;\n * delta?: number;\n * event?: PopStateEvent | MouseEvent;\n * scroll?: { x: number, y: number };\n * }} opts\n */\nfunction _before_navigate({ url, type, intent, delta, event, scroll }) {\n\tlet should_block = false;\n\n\tconst nav = create_navigation(current, intent, url, type, scroll ?? null);\n\n\tif (delta !== undefined) {\n\t\tnav.navigation.delta = delta;\n\t}\n\n\tif (event !== undefined) {\n\t\t// @ts-ignore\n\t\tnav.navigation.event = event;\n\t}\n\n\tconst cancellable = {\n\t\t...nav.navigation,\n\t\tcancel: () => {\n\t\t\tshould_block = true;\n\t\t\tnav.reject(new Error('navigation cancelled'));\n\t\t}\n\t};\n\n\tif (!is_navigating) {\n\t\t// Don't run the event during redirects\n\t\tbefore_navigate_callbacks.forEach((fn) => fn(cancellable));\n\t}\n\n\treturn should_block ? null : nav;\n}\n\n/**\n * @param {{\n * type: import('@sveltejs/kit').NavigationType;\n * url: URL;\n * popped?: {\n * state: Record<string, any>;\n * scroll: { x: number, y: number };\n * delta: number;\n * };\n * keepfocus?: boolean;\n * noscroll?: boolean;\n * replace_state?: boolean;\n * state?: Record<string, any>;\n * redirect_count?: number;\n * nav_token?: {};\n * accept?: () => void;\n * block?: () => void;\n * event?: Event\n * }} opts\n * @returns {Promise<void>}\n */\nasync function navigate({\n\ttype,\n\turl,\n\tpopped,\n\tkeepfocus,\n\tnoscroll,\n\treplace_state,\n\tstate = {},\n\tredirect_count = 0,\n\tnav_token = {},\n\taccept = noop,\n\tblock = noop,\n\tevent\n}) {\n\tconst prev_token = token;\n\ttoken = nav_token;\n\n\tconst intent = await get_navigation_intent(url, false);\n\tconst nav =\n\t\ttype === 'enter'\n\t\t\t? create_navigation(current, intent, url, type)\n\t\t\t: _before_navigate({\n\t\t\t\t\turl,\n\t\t\t\t\ttype,\n\t\t\t\t\tdelta: popped?.delta,\n\t\t\t\t\tintent,\n\t\t\t\t\tscroll: popped?.scroll,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tevent\n\t\t\t\t});\n\n\tif (!nav) {\n\t\tblock();\n\t\tif (token === nav_token) token = prev_token;\n\t\treturn;\n\t}\n\n\t// store this before calling `accept()`, which may change the index\n\tconst previous_history_index = current_history_index;\n\tconst previous_navigation_index = current_navigation_index;\n\n\taccept();\n\n\tis_navigating = true;\n\n\tif (started && nav.navigation.type !== 'enter') {\n\t\tstores.navigating.set((navigating.current = nav.navigation));\n\t}\n\n\tlet navigation_result = intent && (await load_route(intent));\n\n\tif (!navigation_result) {\n\t\tif (is_external_url(url, base, app.hash)) {\n\t\t\tif (DEV && app.hash) {\n\t\t\t\t// Special case for hash mode during DEV: If someone accidentally forgets to use a hash for the link,\n\t\t\t\t// they would end up here in an endless loop. Fall back to error page in that case\n\t\t\t\tnavigation_result = await server_fallback(\n\t\t\t\t\turl,\n\t\t\t\t\t{ id: null },\n\t\t\t\t\tawait handle_error(\n\t\t\t\t\t\tnew SvelteKitError(\n\t\t\t\t\t\t\t404,\n\t\t\t\t\t\t\t'Not Found',\n\t\t\t\t\t\t\t`Not found: ${url.pathname} (did you forget the hash?)`\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\tparams: {},\n\t\t\t\t\t\t\troute: { id: null }\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t404,\n\t\t\t\t\treplace_state\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn await native_navigation(url, replace_state);\n\t\t\t}\n\t\t} else {\n\t\t\tnavigation_result = await server_fallback(\n\t\t\t\turl,\n\t\t\t\t{ id: null },\n\t\t\t\tawait handle_error(new SvelteKitError(404, 'Not Found', `Not found: ${url.pathname}`), {\n\t\t\t\t\turl,\n\t\t\t\t\tparams: {},\n\t\t\t\t\troute: { id: null }\n\t\t\t\t}),\n\t\t\t\t404,\n\t\t\t\treplace_state\n\t\t\t);\n\t\t}\n\t}\n\n\t// if this is an internal navigation intent, use the normalized\n\t// URL for the rest of the function\n\turl = intent?.url || url;\n\n\t// abort if user navigated during update\n\tif (token !== nav_token) {\n\t\tnav.reject(new Error('navigation aborted'));\n\t\treturn;\n\t}\n\n\tif (!navigation_result) return;\n\n\tif (navigation_result.type === 'redirect') {\n\t\t// whatwg fetch spec https://fetch.spec.whatwg.org/#http-redirect-fetch says to error after 20 redirects\n\t\tif (redirect_count < 20) {\n\t\t\tawait navigate({\n\t\t\t\ttype,\n\t\t\t\turl: new URL(navigation_result.location, url),\n\t\t\t\tpopped,\n\t\t\t\tkeepfocus,\n\t\t\t\tnoscroll,\n\t\t\t\treplace_state,\n\t\t\t\tstate,\n\t\t\t\tredirect_count: redirect_count + 1,\n\t\t\t\tnav_token\n\t\t\t});\n\n\t\t\tnav.fulfil(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tnavigation_result = await load_root_error_page({\n\t\t\tstatus: 500,\n\t\t\terror: await handle_error(new Error('Redirect loop'), {\n\t\t\t\turl,\n\t\t\t\tparams: {},\n\t\t\t\troute: { id: null }\n\t\t\t}),\n\t\t\turl,\n\t\t\troute: { id: null }\n\t\t});\n\n\t\tif (!navigation_result) return;\n\t} else if (/** @type {number} */ (navigation_result.props.page.status) >= 400) {\n\t\tconst updated = await stores.updated.check();\n\t\tif (updated) {\n\t\t\t// Before reloading, try to update the service worker if it exists\n\t\t\tawait update_service_worker();\n\t\t\treturn await native_navigation(url, replace_state);\n\t\t}\n\t}\n\n\t// reset invalidation only after a finished navigation. If there are redirects or\n\t// additional invalidations, they should get the same invalidation treatment\n\treset_invalidation();\n\n\tupdating = true;\n\n\tupdate_scroll_positions(previous_history_index);\n\tcapture_snapshot(previous_navigation_index);\n\n\t// ensure the url pathname matches the page's trailing slash option\n\tif (navigation_result.props.page.url.pathname !== url.pathname) {\n\t\turl.pathname = navigation_result.props.page.url.pathname;\n\t}\n\n\tstate = popped ? popped.state : state;\n\n\tif (!popped) {\n\t\t// this is a new navigation, rather than a popstate\n\t\tconst change = replace_state ? 0 : 1;\n\n\t\tconst entry = {\n\t\t\t[HISTORY_INDEX]: (current_history_index += change),\n\t\t\t[NAVIGATION_INDEX]: (current_navigation_index += change),\n\t\t\t[STATES_KEY]: state\n\t\t};\n\n\t\tconst fn = replace_state ? history.replaceState : history.pushState;\n\t\tfn.call(history, entry, '', url);\n\n\t\tif (!replace_state) {\n\t\t\tclear_onward_history(current_history_index, current_navigation_index);\n\t\t}\n\t}\n\n\t// also compare ids to avoid using wrong fork (e.g. a new one could've been added while navigating)\n\tconst load_cache_fork = intent && load_cache?.id === intent.id ? load_cache.fork : null;\n\t// reset preload synchronously after the history state has been set to avoid race conditions\n\tif (load_cache?.fork && !load_cache_fork) {\n\t\t// discard fork of different route\n\t\tdiscard_load_cache();\n\t} else {\n\t\tload_cache = null;\n\t\tcurrent_a = { element: undefined, href: undefined };\n\t}\n\n\tnavigation_result.props.page.state = state;\n\n\t/**\n\t * @type {Promise<void> | undefined}\n\t */\n\tlet commit_promise;\n\tif (started) {\n\t\tconst after_navigate = (\n\t\t\tawait Promise.all(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/await-thenable -- we need to await because they can be asynchronous\n\t\t\t\tArray.from(on_navigate_callbacks, (fn) =>\n\t\t\t\t\tfn(/** @type {import('@sveltejs/kit').OnNavigate} */ (nav.navigation))\n\t\t\t\t)\n\t\t\t)\n\t\t).filter(/** @returns {value is () => void} */ (value) => typeof value === 'function');\n\n\t\tif (after_navigate.length > 0) {\n\t\t\tfunction cleanup() {\n\t\t\t\tafter_navigate.forEach((fn) => {\n\t\t\t\t\tafter_navigate_callbacks.delete(fn);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tafter_navigate.push(cleanup);\n\n\t\t\tafter_navigate.forEach((fn) => {\n\t\t\t\tafter_navigate_callbacks.add(fn);\n\t\t\t});\n\t\t}\n\n\t\t// Type-casts are save because we know this resolved a proper SvelteKit route\n\t\tconst target = /** @type {import('@sveltejs/kit').NavigationTarget} */ (nav.navigation.to);\n\t\tcurrent = {\n\t\t\t...navigation_result.state,\n\t\t\tnav: {\n\t\t\t\tparams: /** @type {Record<string, any>} */ (target.params),\n\t\t\t\troute: target.route,\n\t\t\t\turl: target.url\n\t\t\t}\n\t\t};\n\n\t\t// reset url before updating page store\n\t\tif (navigation_result.props.page) {\n\t\t\tnavigation_result.props.page.url = url;\n\t\t}\n\n\t\t// Remove focus before updating the component tree, so that blur/focusout\n\t\t// handlers fire while the old component's data is still valid (#14575)\n\t\tif (\n\t\t\t!keepfocus &&\n\t\t\tdocument.activeElement instanceof HTMLElement &&\n\t\t\tdocument.activeElement !== document.body\n\t\t) {\n\t\t\tdocument.activeElement.blur();\n\t\t}\n\n\t\tconst fork = load_cache_fork && (await load_cache_fork);\n\n\t\tif (fork) {\n\t\t\tcommit_promise = fork.commit();\n\t\t} else {\n\t\t\trendering_error = null; // TODO this can break with forks, rethink for SvelteKit 3 where we can assume Svelte 5\n\t\t\troot.$set(navigation_result.props);\n\t\t\t// Check for sync rendering error\n\t\t\tif (rendering_error) {\n\t\t\t\tObject.assign(navigation_result.props.page, rendering_error);\n\t\t\t}\n\t\t\tupdate(navigation_result.props.page);\n\n\t\t\tcommit_promise = svelte.settled?.();\n\t\t}\n\n\t\thas_navigated = true;\n\t} else {\n\t\tawait initialize(navigation_result, target, false);\n\t}\n\n\tconst { activeElement } = document;\n\n\tawait commit_promise;\n\n\t// TODO 3.0 remote — the double tick is probably necessary because\n\t// of some store shenanigans. `settled()` and `f.commit()`\n\t// should resolve after DOM updates in newer versions\n\tawait svelte.tick();\n\tawait svelte.tick();\n\n\tif (token !== nav_token) {\n\t\t// a new navigation happened while we were waiting for the DOM to update, so abort\n\t\tnav.reject(new Error('navigation aborted'));\n\t\treturn;\n\t}\n\n\t// Check for async rendering error\n\tif (navigation_result.props.page && rendering_error) {\n\t\tObject.assign(navigation_result.props.page, rendering_error);\n\t}\n\n\t// we reset scroll before dealing with focus, to avoid a flash of unscrolled content\n\t/** @type {Element | null | ''} */\n\tlet deep_linked = null;\n\n\tif (autoscroll) {\n\t\tconst scroll = popped ? popped.scroll : noscroll ? scroll_state() : null;\n\t\tif (scroll) {\n\t\t\tscrollTo(scroll.x, scroll.y);\n\t\t} else if ((deep_linked = url.hash && document.getElementById(get_id(url)))) {\n\t\t\t// Here we use `scrollIntoView` on the element instead of `scrollTo`\n\t\t\t// because it natively supports the `scroll-margin` and `scroll-behavior`\n\t\t\t// CSS properties.\n\t\t\tdeep_linked.scrollIntoView();\n\t\t} else {\n\t\t\tscrollTo(0, 0);\n\t\t}\n\t}\n\n\tconst changed_focus =\n\t\t// reset focus only if any manual focus management didn't override it\n\t\tdocument.activeElement !== activeElement &&\n\t\t// also refocus when activeElement is body already because the\n\t\t// focus event might not have been fired on it yet\n\t\tdocument.activeElement !== document.body;\n\n\tif (!keepfocus && !changed_focus) {\n\t\t// We don't need to manually restore the scroll position if we're navigating\n\t\t// to a fragment identifier. It is automatically done for us when we set the\n\t\t// sequential navigation starting point with `location.replace`\n\t\treset_focus(url, !deep_linked);\n\t}\n\n\tautoscroll = true;\n\n\tis_navigating = false;\n\n\tnav.fulfil(undefined);\n\n\t// Update to.scroll to the actual scroll position after navigation completed\n\tif (nav.navigation.to) {\n\t\tnav.navigation.to.scroll = scroll_state();\n\t}\n\n\tafter_navigate_callbacks.forEach((fn) =>\n\t\tfn(/** @type {import('@sveltejs/kit').AfterNavigate} */ (nav.navigation))\n\t);\n\n\tif (type === 'popstate') {\n\t\trestore_snapshot(current_navigation_index);\n\t}\n\n\tstores.navigating.set((navigating.current = null));\n\n\tupdating = false;\n}\n\n/**\n * Does a full page reload if it wouldn't result in an endless loop in the SPA case\n * @param {URL} url\n * @param {{ id: string | null }} route\n * @param {App.Error} error\n * @param {number} status\n * @param {boolean} [replace_state]\n * @returns {Promise<import('./types.js').NavigationFinished | undefined>}\n */\nasync function server_fallback(url, route, error, status, replace_state) {\n\tif (url.origin === origin && url.pathname === location.pathname && !hydrated) {\n\t\t// We would reload the same page we're currently on, which isn't hydrated,\n\t\t// which means no SSR, which means we would end up in an endless loop\n\t\treturn await load_root_error_page({\n\t\t\tstatus,\n\t\t\terror,\n\t\t\turl,\n\t\t\troute\n\t\t});\n\t}\n\n\tif (DEV && status !== 404) {\n\t\tconsole.error(\n\t\t\t'An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)'\n\t\t);\n\n\t\tdebugger; // eslint-disable-line\n\t}\n\n\treturn await native_navigation(url, replace_state);\n}\n\nif (import.meta.hot) {\n\timport.meta.hot.on('vite:beforeUpdate', () => {\n\t\tif (current.error) location.reload();\n\t});\n}\n\n/** @typedef {(typeof PRELOAD_PRIORITIES)['hover'] | (typeof PRELOAD_PRIORITIES)['tap']} PreloadDataPriority */\n\n/**\n * The anchor element whose href is being preloaded. It is reset after navigation\n * or changes when a different anchor element is being preloaded.\n * @type {{ element: Element | SVGAElement | undefined; href: string | SVGAnimatedString | undefined }}\n */\nlet current_a = { element: undefined, href: undefined };\n\nfunction setup_preload() {\n\t/** @type {NodeJS.Timeout} */\n\tlet mousemove_timeout;\n\t/** @type {PreloadDataPriority} */\n\tlet current_priority;\n\n\tcontainer.addEventListener('mousemove', (event) => {\n\t\tconst target = /** @type {Element} */ (event.target);\n\n\t\tclearTimeout(mousemove_timeout);\n\t\tmousemove_timeout = setTimeout(() => {\n\t\t\tvoid preload(target, PRELOAD_PRIORITIES.hover);\n\t\t}, 20);\n\t});\n\n\t/** @param {Event} event */\n\tfunction tap(event) {\n\t\tif (event.defaultPrevented) return;\n\t\tvoid preload(/** @type {Element} */ (event.composedPath()[0]), PRELOAD_PRIORITIES.tap);\n\t}\n\n\tcontainer.addEventListener('mousedown', tap);\n\tcontainer.addEventListener('touchstart', tap, { passive: true });\n\n\tconst observer = new IntersectionObserver(\n\t\t(entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tvoid _preload_code(new URL(/** @type {HTMLAnchorElement} */ (entry.target).href));\n\t\t\t\t\tobserver.unobserve(entry.target);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ threshold: 0 }\n\t);\n\n\t/**\n\t * @param {Element} element\n\t * @param {PreloadDataPriority} priority\n\t */\n\tasync function preload(element, priority) {\n\t\tconst a = find_anchor(element, container);\n\n\t\t// we don't want to preload data again if the user has already hovered/tapped\n\t\tconst interacted =\n\t\t\ta === current_a.element && a?.href === current_a.href && priority >= current_priority;\n\t\tif (!a || interacted) return;\n\n\t\tconst { url, external, download } = get_link_info(a, base, app.hash);\n\t\tif (external || download) return;\n\n\t\tconst options = get_router_options(a);\n\n\t\t// we don't want to preload data for a page we're already on\n\t\tconst same_url = url && get_page_key(current.url) === get_page_key(url);\n\t\tif (options.reload || same_url) return;\n\n\t\tif (priority <= options.preload_data) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\t// we don't want to preload data again on tap if we've already preloaded it on hover\n\t\t\tcurrent_priority = PRELOAD_PRIORITIES.tap;\n\n\t\t\tconst intent = await get_navigation_intent(url, false);\n\t\t\tif (!intent) return;\n\n\t\t\tif (DEV) {\n\t\t\t\tvoid _preload_data(intent).then((result) => {\n\t\t\t\t\tif (result.type === 'loaded' && result.state.error) {\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\\n` +\n\t\t\t\t\t\t\t\t'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +\n\t\t\t\t\t\t\t\t'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +\n\t\t\t\t\t\t\t\t'See https://svelte.dev/docs/kit/link-options for more info'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tvoid _preload_data(intent);\n\t\t\t}\n\t\t} else if (priority <= options.preload_code) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\tcurrent_priority = priority;\n\t\t\tvoid _preload_code(/** @type {URL} */ (url));\n\t\t}\n\t}\n\n\tfunction after_navigate() {\n\t\tobserver.disconnect();\n\n\t\tfor (const a of container.querySelectorAll('a')) {\n\t\t\tconst { url, external, download } = get_link_info(a, base, app.hash);\n\t\t\tif (external || download) continue;\n\n\t\t\tconst options = get_router_options(a);\n\t\t\tif (options.reload) continue;\n\n\t\t\tif (options.preload_code === PRELOAD_PRIORITIES.viewport) {\n\t\t\t\tobserver.observe(a);\n\t\t\t}\n\n\t\t\tif (options.preload_code === PRELOAD_PRIORITIES.eager) {\n\t\t\t\tvoid _preload_code(/** @type {URL} */ (url));\n\t\t\t}\n\t\t}\n\t}\n\n\tafter_navigate_callbacks.add(after_navigate);\n\tafter_navigate();\n}\n\n/**\n * @param {unknown} error\n * @param {import('@sveltejs/kit').NavigationEvent} event\n * @returns {import('types').MaybePromise<App.Error>}\n */\nfunction handle_error(error, event) {\n\tif (error instanceof HttpError) {\n\t\treturn error.body;\n\t}\n\n\tif (DEV) {\n\t\terrored = true;\n\t\tconsole.warn('The next HMR update will cause the page to reload');\n\t}\n\n\tconst status = get_status(error);\n\tconst message = get_message(error);\n\n\treturn (\n\t\tapp.hooks.handleError({ error, event, status, message }) ?? /** @type {any} */ ({ message })\n\t);\n}\n\n/**\n * @template {Function} T\n * @param {Set<T>} callbacks\n * @param {T} callback\n */\nfunction add_navigation_callback(callbacks, callback) {\n\tonMount(() => {\n\t\tcallbacks.add(callback);\n\n\t\treturn () => {\n\t\t\tcallbacks.delete(callback);\n\t\t};\n\t});\n}\n\n/**\n * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL.\n *\n * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').AfterNavigate) => void} callback\n * @returns {void}\n */\nexport function afterNavigate(callback) {\n\tadd_navigation_callback(after_navigate_callbacks, callback);\n}\n\n/**\n * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls.\n *\n * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response.\n *\n * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`.\n *\n * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`.\n *\n * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').BeforeNavigate) => void} callback\n * @returns {void}\n */\nexport function beforeNavigate(callback) {\n\tadd_navigation_callback(before_navigate_callbacks, callback);\n}\n\n/**\n * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations.\n *\n * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user.\n *\n * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated.\n *\n * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>} callback\n * @returns {void}\n */\nexport function onNavigate(callback) {\n\tadd_navigation_callback(on_navigate_callbacks, callback);\n}\n\n/**\n * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling.\n * This is generally discouraged, since it breaks user expectations.\n * @returns {void}\n */\nexport function disableScrollHandling() {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call disableScrollHandling() on the server');\n\t}\n\n\tif (DEV && started && !updating) {\n\t\tthrow new Error('Can only disable scroll handling during navigation');\n\t}\n\n\tif (updating || !started) {\n\t\tautoscroll = false;\n\t}\n}\n\n/**\n * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused.\n * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.\n *\n * For external URLs, use `window.location = url` instead of calling `goto(url)`.\n *\n * @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.\n * @param {Object} [opts] Options related to the navigation\n * @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState`\n * @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation\n * @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body\n * @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation.\n * @param {Array<string | URL | ((url: URL) => boolean)>} [opts.invalidate] Causes any load functions to re-run if they depend on one of the urls\n * @param {App.PageState} [opts.state] An optional object that will be available as `page.state`\n * @returns {Promise<void>}\n */\nexport function goto(url, opts = {}) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call goto(...) on the server');\n\t}\n\n\turl = new URL(resolve_url(url));\n\n\tif (url.origin !== origin) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\tDEV\n\t\t\t\t\t? `Cannot use \\`goto\\` with an external URL. Use \\`window.location = \"${url}\"\\` instead`\n\t\t\t\t\t: 'goto: invalid URL'\n\t\t\t)\n\t\t);\n\t}\n\n\treturn _goto(url, opts, 0);\n}\n\n/**\n * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated.\n *\n * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters).\n * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL.\n *\n * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned.\n * This can be useful if you want to invalidate based on a pattern instead of a exact match.\n *\n * ```ts\n * // Example: Match '/path' regardless of the query parameters\n * import { invalidate } from '$app/navigation';\n *\n * invalidate((url) => url.pathname === '/path');\n * ```\n * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL\n * @returns {Promise<void>}\n */\nexport function invalidate(resource) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call invalidate(...) on the server');\n\t}\n\n\tpush_invalidated(resource);\n\n\treturn _invalidate();\n}\n\n/**\n * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL\n */\nfunction push_invalidated(resource) {\n\tif (typeof resource === 'function') {\n\t\tinvalidated.push(resource);\n\t} else {\n\t\tconst { href } = new URL(resource, location.href);\n\t\tinvalidated.push((url) => url.href === href);\n\t}\n}\n\n/**\n * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated.\n * @returns {Promise<void>}\n */\nexport function invalidateAll() {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call invalidateAll() on the server');\n\t}\n\n\tforce_invalidation = true;\n\treturn _invalidate();\n}\n\n/**\n * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument).\n * Returns a `Promise` that resolves when the page is subsequently updated.\n * @param {{ includeLoadFunctions?: boolean }} [options]\n * @returns {Promise<void>}\n */\nexport function refreshAll({ includeLoadFunctions = true } = {}) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call refreshAll() on the server');\n\t}\n\n\tforce_invalidation = true;\n\treturn _invalidate(includeLoadFunctions, false);\n}\n\n/**\n * Programmatically preloads the given page, which means\n * 1. ensuring that the code for the page is loaded, and\n * 2. calling the page's load function with the appropriate options.\n *\n * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `<a>` element with `data-sveltekit-preload-data`.\n * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous.\n * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete.\n *\n * @param {string} href Page to preload\n * @returns {Promise<{ type: 'loaded'; status: number; data: Record<string, any> } | { type: 'redirect'; location: string }>}\n */\nexport async function preloadData(href) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call preloadData(...) on the server');\n\t}\n\n\tconst url = resolve_url(href);\n\tconst intent = await get_navigation_intent(url, false);\n\n\tif (!intent) {\n\t\tthrow new Error(`Attempted to preload a URL that does not belong to this app: ${url}`);\n\t}\n\n\tconst result = await _preload_data(intent);\n\tif (result.type === 'redirect') {\n\t\treturn {\n\t\t\ttype: result.type,\n\t\t\tlocation: result.location\n\t\t};\n\t}\n\n\tconst { status, data } = result.props.page ?? page;\n\treturn { type: result.type, status, data };\n}\n\n/**\n * Programmatically imports the code for routes that haven't yet been fetched.\n * Typically, you might call this to speed up subsequent navigation.\n *\n * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`).\n *\n * Unlike `preloadData`, this won't call `load` functions.\n * Returns a Promise that resolves when the modules have been imported.\n *\n * @param {string} pathname\n * @returns {Promise<void>}\n */\nexport async function preloadCode(pathname) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call preloadCode(...) on the server');\n\t}\n\n\t// `current.url` is null until the first navigation/hydration completes, so fall back\n\t// to `location` to support calling `preloadCode` during initial page load (#13297)\n\tconst url = new URL(pathname, current.url ?? location.href);\n\n\tif (DEV) {\n\t\tif (!pathname.startsWith('/')) {\n\t\t\tthrow new Error(\n\t\t\t\t'argument passed to preloadCode must be a pathname (i.e. \"/about\" rather than \"http://example.com/about\"'\n\t\t\t);\n\t\t}\n\n\t\tif (!pathname.startsWith(base)) {\n\t\t\tthrow new Error(\n\t\t\t\t`pathname passed to preloadCode must start with \\`paths.base\\` (i.e. \"${base}${pathname}\" rather than \"${pathname}\")`\n\t\t\t);\n\t\t}\n\n\t\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\t\tconst rerouted = await get_rerouted_url(url);\n\t\t\tif (!rerouted || !routes.find((route) => route.exec(get_url_path(rerouted)))) {\n\t\t\t\tthrow new Error(`'${pathname}' did not match any routes`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn _preload_code(url);\n}\n\n/**\n * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).\n *\n * @param {string | URL} url\n * @param {App.PageState} state\n * @returns {void}\n */\nexport function pushState(url, state) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call pushState(...) on the server');\n\t}\n\n\tif (DEV) {\n\t\tif (!started) {\n\t\t\tthrow new Error('Cannot call pushState(...) before router is initialized');\n\t\t}\n\n\t\ttry {\n\t\t\t// use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances\n\t\t\tdevalue.stringify(state);\n\t\t} catch (error) {\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Could not serialize state${error.path}`, { cause: error });\n\t\t}\n\t}\n\n\tupdate_scroll_positions(current_history_index);\n\n\tconst opts = {\n\t\t[HISTORY_INDEX]: (current_history_index += 1),\n\t\t[NAVIGATION_INDEX]: current_navigation_index,\n\t\t[PAGE_URL_KEY]: page.url.href,\n\t\t[STATES_KEY]: state\n\t};\n\n\thistory.pushState(opts, '', resolve_url(url));\n\thas_navigated = true;\n\n\tpage.state = state;\n\troot.$set({\n\t\t// we need to assign a new page object so that subscribers are correctly notified\n\t\tpage: untrack(() => clone_page(page))\n\t});\n\n\tclear_onward_history(current_history_index, current_navigation_index);\n}\n\n/**\n * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).\n *\n * @param {string | URL} url\n * @param {App.PageState} state\n * @returns {void}\n */\nexport function replaceState(url, state) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call replaceState(...) on the server');\n\t}\n\n\tif (DEV) {\n\t\tif (!started) {\n\t\t\tthrow new Error('Cannot call replaceState(...) before router is initialized');\n\t\t}\n\n\t\ttry {\n\t\t\t// use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances\n\t\t\tdevalue.stringify(state);\n\t\t} catch (error) {\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Could not serialize state${error.path}`, { cause: error });\n\t\t}\n\t}\n\n\tconst opts = {\n\t\t[HISTORY_INDEX]: current_history_index,\n\t\t[NAVIGATION_INDEX]: current_navigation_index,\n\t\t[PAGE_URL_KEY]: page.url.href,\n\t\t[STATES_KEY]: state\n\t};\n\n\thistory.replaceState(opts, '', resolve_url(url));\n\n\tpage.state = state;\n\troot.$set({\n\t\tpage: untrack(() => clone_page(page))\n\t});\n}\n\n/**\n * This action updates the `form` property of the current page with the given data and updates `page.status`.\n * In case of an error, it redirects to the nearest error page.\n * @template {Record<string, unknown> | undefined} Success\n * @template {Record<string, unknown> | undefined} Failure\n * @param {import('@sveltejs/kit').ActionResult<Success, Failure>} result\n * @returns {Promise<void>}\n */\nexport async function applyAction(result) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call applyAction(...) on the server');\n\t}\n\n\tif (result.type === 'error') {\n\t\tawait set_nearest_error_page(result.error, result.status);\n\t} else if (result.type === 'redirect') {\n\t\tawait _goto(result.location, { invalidateAll: true }, 0);\n\t} else {\n\t\tpage.form = result.data;\n\t\tpage.status = result.status;\n\n\t\t/** @type {Record<string, any>} */\n\t\troot.$set({\n\t\t\t// this brings Svelte's view of the world in line with SvelteKit's\n\t\t\t// after use:enhance reset the form....\n\t\t\tform: null,\n\t\t\tpage: clone_page(page)\n\t\t});\n\n\t\t// ...so that setting the `form` prop takes effect and isn't ignored\n\t\tawait tick();\n\t\troot.$set({ form: result.data });\n\n\t\tif (result.type === 'success') {\n\t\t\treset_focus(page.url);\n\t\t}\n\t}\n}\n\n/**\n * @param {App.Error} error\n * @param {number} status\n */\nexport async function set_nearest_error_page(error, status = 500) {\n\tconst url = new URL(location.href);\n\n\tconst { branch, route } = current;\n\tif (!route) return;\n\n\tconst error_load = await load_nearest_error_page(current.branch.length, branch, route.errors);\n\tif (error_load) {\n\t\tconst navigation_result = await get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams: current.params,\n\t\t\tbranch: branch.slice(0, error_load.idx).concat(error_load.node),\n\t\t\tstatus,\n\t\t\terror,\n\t\t\t// do not set errors, we haven't changed the page so the previous ones are still current\n\t\t\troute\n\t\t});\n\n\t\tcurrent = { ...navigation_result.state, nav: current.nav };\n\n\t\troot.$set(navigation_result.props);\n\t\tupdate(navigation_result.props.page);\n\n\t\tvoid tick().then(() => reset_focus(current.url));\n\t}\n}\n\nfunction _start_router() {\n\thistory.scrollRestoration = 'manual';\n\n\t// Adopted from Nuxt.js\n\t// Reset scrollRestoration to auto when leaving page, allowing page reload\n\t// and back-navigation from other pages to use the browser to restore the\n\t// scrolling position.\n\taddEventListener('beforeunload', (e) => {\n\t\tlet should_block = false;\n\n\t\tpersist_state();\n\n\t\tif (!is_navigating) {\n\t\t\tconst nav = create_navigation(current, undefined, null, 'leave');\n\n\t\t\t// If we're navigating, beforeNavigate was already called. If we end up in here during navigation,\n\t\t\t// it's due to an external or full-page-reload link, for which we don't want to call the hook again.\n\t\t\t/** @type {import('@sveltejs/kit').BeforeNavigate} */\n\t\t\tconst navigation = {\n\t\t\t\t...nav.navigation,\n\t\t\t\tcancel: () => {\n\t\t\t\t\tshould_block = true;\n\t\t\t\t\tnav.reject(new Error('navigation cancelled'));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tbefore_navigate_callbacks.forEach((fn) => fn(navigation));\n\t\t}\n\n\t\tif (should_block) {\n\t\t\te.preventDefault();\n\t\t\te.returnValue = '';\n\t\t} else {\n\t\t\thistory.scrollRestoration = 'auto';\n\t\t}\n\t});\n\n\taddEventListener('visibilitychange', () => {\n\t\tif (document.visibilityState === 'hidden') {\n\t\t\tpersist_state();\n\t\t}\n\t});\n\n\t// @ts-expect-error this isn't supported everywhere yet\n\tif (!navigator.connection?.saveData) {\n\t\tsetup_preload();\n\t}\n\n\t/** @param {MouseEvent} event */\n\tcontainer.addEventListener('click', async (event) => {\n\t\t// Adapted from https://github.com/visionmedia/page.js\n\t\t// MIT license https://github.com/visionmedia/page.js#license\n\t\tif (event.button || event.which !== 1) return;\n\t\tif (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\t\tif (event.defaultPrevented) return;\n\n\t\tconst a = find_anchor(/** @type {Element} */ (event.composedPath()[0]), container);\n\t\tif (!a) return;\n\n\t\tconst { url, external, target, download } = get_link_info(a, base, app.hash);\n\t\tif (!url) return;\n\n\t\t// bail out before `beforeNavigate` if link opens in a different tab\n\t\tif (target === '_parent' || target === '_top') {\n\t\t\tif (window.parent !== window) return;\n\t\t} else if (target && target !== '_self') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst options = get_router_options(a);\n\t\tconst is_svg_a_element = a instanceof SVGAElement;\n\n\t\t// Ignore URL protocols that differ to the current one and are not http(s) (e.g. `mailto:`, `tel:`, `myapp:`, etc.)\n\t\t// This may be wrong when the protocol is x: and the link goes to y:.. which should be treated as an external\n\t\t// navigation, but it's not clear how to handle that case and it's not likely to come up in practice.\n\t\t// MEMO: Without this condition, firefox will open mailer twice.\n\t\t// See:\n\t\t// - https://github.com/sveltejs/kit/issues/4045\n\t\t// - https://github.com/sveltejs/kit/issues/5725\n\t\t// - https://github.com/sveltejs/kit/issues/6496\n\t\tif (\n\t\t\t!is_svg_a_element &&\n\t\t\turl.protocol !== location.protocol &&\n\t\t\t!(url.protocol === 'https:' || url.protocol === 'http:')\n\t\t)\n\t\t\treturn;\n\n\t\tif (download) return;\n\n\t\tconst [nonhash, hash] = (app.hash ? url.hash.replace(/^#/, '') : url.href).split('#');\n\t\tconst same_pathname = nonhash === strip_hash(location);\n\n\t\t// Ignore the following but fire beforeNavigate\n\t\tif (external || (options.reload && (!same_pathname || !hash))) {\n\t\t\tif (_before_navigate({ url, type: 'link', event })) {\n\t\t\t\t// set `navigating` to `true` to prevent `beforeNavigate` callbacks\n\t\t\t\t// being called when the page unloads\n\t\t\t\tis_navigating = true;\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if new url only differs by hash and use the browser default behavior in that case\n\t\t// This will ensure the `hashchange` event is fired\n\t\t// Removing the hash does a full page navigation in the browser, so make sure a hash is present\n\t\tif (hash !== undefined && same_pathname) {\n\t\t\t// If we are trying to navigate to the same hash, we should only\n\t\t\t// attempt to scroll to that element and avoid any history changes.\n\t\t\t// Otherwise, this can cause Firefox to incorrectly assign a null\n\t\t\t// history state value without any signal that we can detect.\n\t\t\tconst [, current_hash] = current.url.href.split('#');\n\t\t\tif (current_hash === hash) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// We're already on /# and click on a link that goes to /#, or we're on\n\t\t\t\t// /#top and click on a link that goes to /#top. In those cases just go to\n\t\t\t\t// the top of the page, and avoid a history change.\n\t\t\t\tif (hash === '' || (hash === 'top' && a.ownerDocument.getElementById('top') === null)) {\n\t\t\t\t\tscrollTo({ top: 0 });\n\t\t\t\t} else {\n\t\t\t\t\tconst element = a.ownerDocument.getElementById(decodeURIComponent(hash));\n\t\t\t\t\tif (element) {\n\t\t\t\t\t\telement.scrollIntoView();\n\t\t\t\t\t\telement.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// set this flag to distinguish between navigations triggered by\n\t\t\t// clicking a hash link and those triggered by popstate\n\t\t\thash_navigating = true;\n\n\t\t\tupdate_scroll_positions(current_history_index);\n\n\t\t\tupdate_url(url);\n\n\t\t\tif (!options.replace_state) return;\n\n\t\t\t// hashchange event shouldn't occur if the router is replacing state.\n\t\t\thash_navigating = false;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\t// allow the browser to repaint before navigating —\n\t\t// this prevents INP scores being penalised\n\t\tawait new Promise((fulfil) => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tsetTimeout(fulfil, 0);\n\t\t\t});\n\n\t\t\tsetTimeout(fulfil, 100); // fallback for edge case where rAF doesn't fire because e.g. tab was backgrounded\n\t\t});\n\n\t\tawait navigate({\n\t\t\ttype: 'link',\n\t\t\turl,\n\t\t\tkeepfocus: options.keepfocus,\n\t\t\tnoscroll: options.noscroll,\n\t\t\treplace_state: options.replace_state ?? url.href === location.href,\n\t\t\tevent\n\t\t});\n\t});\n\n\tcontainer.addEventListener('submit', (event) => {\n\t\tif (event.defaultPrevented) return;\n\n\t\tconst form = /** @type {HTMLFormElement} */ (\n\t\t\tHTMLFormElement.prototype.cloneNode.call(event.target)\n\t\t);\n\n\t\tconst submitter = /** @type {HTMLButtonElement | HTMLInputElement | null} */ (event.submitter);\n\n\t\tconst target = submitter?.formTarget || form.target;\n\n\t\tif (target === '_blank') return;\n\n\t\tconst method = submitter?.formMethod || form.method;\n\n\t\tif (method !== 'get') return;\n\n\t\t// It is impossible to use form actions with hash router, so we just ignore handling them here\n\t\tconst url = new URL(\n\t\t\t(submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action\n\t\t);\n\n\t\tif (is_external_url(url, base, false)) return;\n\n\t\tconst event_form = /** @type {HTMLFormElement} */ (event.target);\n\n\t\tconst options = get_router_options(event_form);\n\t\tif (options.reload) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst data = new FormData(event_form, submitter);\n\n\t\t// @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that\n\t\turl.search = new URLSearchParams(data).toString();\n\n\t\tvoid navigate({\n\t\t\ttype: 'form',\n\t\t\turl,\n\t\t\tkeepfocus: options.keepfocus,\n\t\t\tnoscroll: options.noscroll,\n\t\t\treplace_state: options.replace_state ?? url.href === location.href,\n\t\t\tevent\n\t\t});\n\t});\n\n\taddEventListener('popstate', async (event) => {\n\t\tif (resetting_focus) return;\n\n\t\tif (event.state?.[HISTORY_INDEX]) {\n\t\t\tconst history_index = event.state[HISTORY_INDEX];\n\t\t\ttoken = {};\n\n\t\t\t// if a popstate-driven navigation is cancelled, we need to counteract it\n\t\t\t// with history.go, which means we end up back here, hence this check\n\t\t\tif (history_index === current_history_index) return;\n\n\t\t\tconst scroll = scroll_positions[history_index];\n\t\t\tconst state = event.state[STATES_KEY] ?? {};\n\t\t\tconst url = new URL(event.state[PAGE_URL_KEY] ?? location.href);\n\t\t\tconst navigation_index = event.state[NAVIGATION_INDEX];\n\t\t\tconst is_hash_change = current.url ? strip_hash(location) === strip_hash(current.url) : false;\n\t\t\tconst shallow =\n\t\t\t\tnavigation_index === current_navigation_index && (has_navigated || is_hash_change);\n\n\t\t\tif (shallow) {\n\t\t\t\t// We don't need to navigate, we just need to update scroll and/or state.\n\t\t\t\t// This happens with hash links and `pushState`/`replaceState`. The\n\t\t\t\t// exception is if we haven't navigated yet, since we could have\n\t\t\t\t// got here after a modal navigation then a reload\n\t\t\t\tif (state !== page.state) {\n\t\t\t\t\tpage.state = state;\n\t\t\t\t}\n\n\t\t\t\tupdate_url(url);\n\n\t\t\t\tscroll_positions[current_history_index] = scroll_state();\n\t\t\t\tif (scroll) scrollTo(scroll.x, scroll.y);\n\n\t\t\t\tcurrent_history_index = history_index;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst delta = history_index - current_history_index;\n\n\t\t\tawait navigate({\n\t\t\t\ttype: 'popstate',\n\t\t\t\turl,\n\t\t\t\tpopped: {\n\t\t\t\t\tstate,\n\t\t\t\t\tscroll,\n\t\t\t\t\tdelta\n\t\t\t\t},\n\t\t\t\taccept: () => {\n\t\t\t\t\tcurrent_history_index = history_index;\n\t\t\t\t\tcurrent_navigation_index = navigation_index;\n\t\t\t\t},\n\t\t\t\tblock: () => {\n\t\t\t\t\thistory.go(-delta);\n\t\t\t\t},\n\t\t\t\tnav_token: token,\n\t\t\t\tevent\n\t\t\t});\n\t\t} else {\n\t\t\t// since popstate event is also emitted when an anchor referencing the same\n\t\t\t// document is clicked, we have to check that the router isn't already handling\n\t\t\t// the navigation. otherwise we would be updating the page store twice.\n\t\t\tif (!hash_navigating) {\n\t\t\t\tconst url = new URL(location.href);\n\t\t\t\tupdate_url(url);\n\n\t\t\t\t// if the user edits the hash via the browser URL bar, trigger a full-page\n\t\t\t\t// reload to align with pathname router behavior\n\t\t\t\tif (app.hash) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\taddEventListener('hashchange', () => {\n\t\t// if the hashchange happened as a result of clicking on a link,\n\t\t// we need to update history, otherwise we have to leave it alone\n\t\tif (hash_navigating) {\n\t\t\thash_navigating = false;\n\t\t\thistory.replaceState(\n\t\t\t\t{\n\t\t\t\t\t...history.state,\n\t\t\t\t\t[HISTORY_INDEX]: ++current_history_index,\n\t\t\t\t\t[NAVIGATION_INDEX]: current_navigation_index\n\t\t\t\t},\n\t\t\t\t'',\n\t\t\t\tlocation.href\n\t\t\t);\n\t\t}\n\t});\n\n\t// fix link[rel=icon], because browsers will occasionally try to load relative\n\t// URLs after a pushState/replaceState, resulting in a 404 — see\n\t// https://github.com/sveltejs/kit/issues/3748#issuecomment-1125980897\n\tfor (const link of document.querySelectorAll('link')) {\n\t\tif (ICON_REL_ATTRIBUTES.has(link.rel)) {\n\t\t\tlink.href = link.href; // eslint-disable-line\n\t\t}\n\t}\n\n\taddEventListener('pageshow', (event) => {\n\t\t// If the user navigates to another site and then uses the back button and\n\t\t// bfcache hits, we need to set navigating to null, the site doesn't know\n\t\t// the navigation away from it was successful.\n\t\t// Info about bfcache here: https://web.dev/bfcache\n\t\tif (event.persisted) {\n\t\t\tstores.navigating.set((navigating.current = null));\n\t\t}\n\t});\n\n\t/**\n\t * @param {URL} url\n\t */\n\tfunction update_url(url) {\n\t\tcurrent.url = page.url = url;\n\t\tstores.page.set(clone_page(page));\n\t\tstores.page.notify();\n\t}\n}\n\n/**\n * @param {HTMLElement} target\n * @param {import('./types.js').HydrateOptions} opts\n * @returns {Promise<void>}\n */\nasync function _hydrate(\n\ttarget,\n\t{ status = 200, error, node_ids, params, route, server_route, data: server_data_nodes, form }\n) {\n\thydrated = true;\n\n\tconst url = new URL(location.href);\n\n\t/** @type {import('types').CSRRoute | undefined} */\n\tlet parsed_route;\n\n\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\tif (!__SVELTEKIT_EMBEDDED__) {\n\t\t\t// See https://github.com/sveltejs/kit/pull/4935#issuecomment-1328093358 for one motivation\n\t\t\t// of determining the params on the client side.\n\t\t\t({ params = {}, route = { id: null } } = (await get_navigation_intent(url, false)) || {});\n\t\t}\n\n\t\tparsed_route = routes.find(({ id }) => id === route.id);\n\t} else {\n\t\t// undefined in case of 404\n\t\tif (server_route) {\n\t\t\tparsed_route = route = parse_server_route(server_route, app.nodes);\n\t\t} else {\n\t\t\troute = { id: null };\n\t\t\tparams = {};\n\t\t}\n\t}\n\n\t/** @type {import('./types.js').NavigationFinished | undefined} */\n\tlet result;\n\tlet hydrate = true;\n\n\ttry {\n\t\tconst branch_promises = node_ids.map(async (n, i) => {\n\t\t\tconst server_data_node = server_data_nodes[i];\n\t\t\t// Type isn't completely accurate, we still need to deserialize uses\n\t\t\tif (server_data_node?.uses) {\n\t\t\t\tserver_data_node.uses = deserialize_uses(server_data_node.uses);\n\t\t\t}\n\n\t\t\treturn load_node({\n\t\t\t\tloader: app.nodes[n],\n\t\t\t\turl,\n\t\t\t\tparams,\n\t\t\t\troute,\n\t\t\t\tparent: async () => {\n\t\t\t\t\tconst data = {};\n\t\t\t\t\tfor (let j = 0; j < i; j += 1) {\n\t\t\t\t\t\tObject.assign(data, (await branch_promises[j]).data);\n\t\t\t\t\t}\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tserver_data_node: create_data_node(server_data_node)\n\t\t\t});\n\t\t});\n\n\t\t/** @type {Array<import('./types.js').BranchNode | undefined>} */\n\t\tconst branch = await Promise.all(branch_promises);\n\n\t\t// server-side will have compacted the branch, reinstate empty slots\n\t\t// so that error boundaries can be lined up correctly\n\t\tif (parsed_route) {\n\t\t\tconst layouts = parsed_route.layouts;\n\t\t\tfor (let i = 0; i < layouts.length; i++) {\n\t\t\t\tif (!layouts[i]) {\n\t\t\t\t\tbranch.splice(i, 0, undefined);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult = await get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch,\n\t\t\tstatus,\n\t\t\terror,\n\t\t\terrors: parsed_route?.errors, // TODO load earlier?\n\t\t\tform,\n\t\t\troute: parsed_route ?? null\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Redirect) {\n\t\t\t// this is a real edge case — `load` would need to return\n\t\t\t// a redirect but only in the browser\n\t\t\treturn await native_navigation(new URL(error.location, location.href));\n\t\t}\n\n\t\tresult = await load_root_error_page({\n\t\t\tstatus: get_status(error),\n\t\t\terror: await handle_error(error, { url, params, route }),\n\t\t\turl,\n\t\t\troute\n\t\t});\n\n\t\ttarget.textContent = '';\n\t\thydrate = false;\n\t}\n\n\t// Exit early when we encounter a redirect while loading the root error page.\n\t// In this case, `initialize` will be called later on\n\tif (!result) return;\n\n\tif (result.props.page) {\n\t\tresult.props.page.state = {};\n\t}\n\n\tawait initialize(result, target, hydrate);\n}\n\n/**\n * @param {URL} url\n * @param {boolean[]} invalid\n * @returns {Promise<import('types').ServerNodesResponse | import('types').ServerRedirectNode>}\n */\nasync function load_data(url, invalid) {\n\tconst data_url = new URL(url);\n\tdata_url.pathname = add_data_suffix(url.pathname);\n\tif (url.pathname.endsWith('/')) {\n\t\tdata_url.searchParams.append(TRAILING_SLASH_PARAM, '1');\n\t}\n\tif (DEV && url.searchParams.has(INVALIDATED_PARAM)) {\n\t\tthrow new Error(`Cannot used reserved query parameter \"${INVALIDATED_PARAM}\"`);\n\t}\n\tdata_url.searchParams.append(INVALIDATED_PARAM, invalid.map((i) => (i ? '1' : '0')).join(''));\n\n\t// use window.fetch directly to allow using a 3rd party-patched fetch implementation\n\tconst fetcher = DEV ? dev_fetch : window.fetch;\n\tconst res = await fetcher(data_url.href, {});\n\n\tif (!res.ok) {\n\t\t// error message is a JSON-stringified string which devalue can't handle at the top level\n\t\t// turn it into a HttpError to not call handleError on the client again (was already handled on the server)\n\t\t// if `__data.json` doesn't exist or the server has an internal error,\n\t\t// avoid parsing the HTML error page as a JSON\n\t\t/** @type {string | undefined} */\n\t\tlet message;\n\t\tif (res.headers.get('content-type')?.includes('application/json')) {\n\t\t\tmessage = await res.json();\n\t\t} else if (res.status === 404) {\n\t\t\tmessage = 'Not Found';\n\t\t} else if (res.status === 500) {\n\t\t\tmessage = 'Internal Error';\n\t\t}\n\t\tthrow new HttpError(res.status, message);\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tprocess_stream(resolve, res).catch(reject);\n\t});\n\n\t// TODO edge case handling necessary? stream() read fails?\n}\n\n/**\n * @param {(value: ServerNodesResponse | ServerRedirectNode) => void} resolve\n * @param {Response} res\n * @returns {Promise<void>}\n */\nasync function process_stream(resolve, res) {\n\tconst reader = /** @type {ReadableStream<Uint8Array>} */ (res.body).getReader();\n\n\t/**\n\t * Map of deferred promises that will be resolved by a subsequent chunk of data\n\t * @type {Map<string, import('types').Deferred>}\n\t */\n\tconst deferreds = new Map();\n\n\t/**\n\t * @param {any} data\n\t */\n\tfunction deserialize(data) {\n\t\treturn devalue.unflatten(data, {\n\t\t\t...app.decoders,\n\t\t\tPromise: (id) => {\n\t\t\t\treturn new Promise((fulfil, reject) => {\n\t\t\t\t\tdeferreds.set(id, { fulfil, reject });\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tfor await (const node of read_ndjson(reader)) {\n\t\tif (node.type === 'redirect') {\n\t\t\treturn resolve(node);\n\t\t}\n\n\t\tif (node.type === 'data') {\n\t\t\t// This is the first (and possibly only, if no pending promises) chunk\n\t\t\tnode.nodes?.forEach((/** @type {any} */ node) => {\n\t\t\t\tif (node?.type === 'data') {\n\t\t\t\t\tnode.uses = deserialize_uses(node.uses);\n\t\t\t\t\tnode.data = deserialize(node.data);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tresolve(node);\n\t\t} else if (node.type === 'chunk') {\n\t\t\t// This is a subsequent chunk containing deferred data\n\t\t\tconst { id, data, error } = node;\n\t\t\tconst deferred = /** @type {import('types').Deferred} */ (deferreds.get(id));\n\t\t\tdeferreds.delete(id);\n\n\t\t\tif (error) {\n\t\t\t\tdeferred.reject(deserialize(error));\n\t\t\t} else {\n\t\t\t\tdeferred.fulfil(deserialize(data));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {any} uses\n * @return {import('types').Uses}\n */\nfunction deserialize_uses(uses) {\n\treturn {\n\t\tdependencies: new Set(uses?.dependencies ?? []),\n\t\tparams: new Set(uses?.params ?? []),\n\t\tparent: !!uses?.parent,\n\t\troute: !!uses?.route,\n\t\turl: !!uses?.url,\n\t\tsearch_params: new Set(uses?.search_params ?? [])\n\t};\n}\n\n/**\n * This flag is used to avoid client-side navigation when we're only using\n * `location.replace()` to set focus.\n */\nlet resetting_focus = false;\n\n/**\n * @param {URL} url\n * @param {boolean} [scroll]\n */\nfunction reset_focus(url, scroll = true) {\n\tconst autofocus = document.querySelector('[autofocus]');\n\tif (autofocus) {\n\t\t// @ts-ignore\n\t\tautofocus.focus();\n\t} else {\n\t\t// Reset page selection and focus\n\n\t\t// Mimic the browsers' behaviour and set the sequential focus navigation\n\t\t// starting point to the fragment identifier.\n\t\tconst id = get_id(url);\n\t\tif (id && document.getElementById(id)) {\n\t\t\tconst { x, y } = scroll_state();\n\n\t\t\t// `element.focus()` doesn't work on Safari and Firefox Ubuntu so we need\n\t\t\t// to use this hack with `location.replace()` instead.\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst history_state = history.state;\n\n\t\t\t\tresetting_focus = true;\n\t\t\t\tlocation.replace(new URL(`#${id}`, location.href));\n\n\t\t\t\t// Firefox has a bug that sets the history state to `null` so we need to\n\t\t\t\t// restore it after. See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924\n\t\t\t\t// This is also needed to restore the original hash if we're using hash routing\n\t\t\t\thistory.replaceState(history_state, '', url);\n\n\t\t\t\t// If scroll management has already happened earlier, we need to restore\n\t\t\t\t// the scroll position after setting the sequential focus navigation starting point\n\t\t\t\tif (scroll) scrollTo(x, y);\n\t\t\t\tresetting_focus = false;\n\t\t\t});\n\t\t} else {\n\t\t\t// If the ID doesn't exist, we try to mimic browsers' behaviour as closely\n\t\t\t// as possible by targeting the first scrollable region. Unfortunately, it's\n\t\t\t// not a perfect match — e.g. shift-tabbing won't immediately cycle up from\n\t\t\t// the end of the page on Chromium\n\t\t\t// See https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area\n\t\t\tconst root = document.body;\n\t\t\tconst tabindex = root.getAttribute('tabindex');\n\n\t\t\troot.tabIndex = -1;\n\t\t\t// TODO: remove this when we switch to TypeScript 6\n\t\t\t// @ts-ignore options.focusVisible is only typed in TypeScript 6\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility\n\t\t\troot.focus({ preventScroll: true, focusVisible: false });\n\n\t\t\t// restore `tabindex` as to prevent `root` from stealing input from elements\n\t\t\tif (tabindex !== null) {\n\t\t\t\troot.setAttribute('tabindex', tabindex);\n\t\t\t} else {\n\t\t\t\troot.removeAttribute('tabindex');\n\t\t\t}\n\t\t}\n\n\t\t// capture current selection, so we can compare the state after\n\t\t// snapshot restoration and afterNavigate callbacks have run\n\t\tconst selection = getSelection();\n\n\t\tif (selection && selection.type !== 'None') {\n\t\t\t/** @type {Range[]} */\n\t\t\tconst ranges = [];\n\n\t\t\tfor (let i = 0; i < selection.rangeCount; i += 1) {\n\t\t\t\tranges.push(selection.getRangeAt(i));\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (selection.rangeCount !== ranges.length) return;\n\n\t\t\t\tfor (let i = 0; i < selection.rangeCount; i += 1) {\n\t\t\t\t\tconst a = ranges[i];\n\t\t\t\t\tconst b = selection.getRangeAt(i);\n\n\t\t\t\t\t// we need to do a deep comparison rather than just `a !== b` because\n\t\t\t\t\t// Safari behaves differently to other browsers\n\t\t\t\t\tif (\n\t\t\t\t\t\ta.commonAncestorContainer !== b.commonAncestorContainer ||\n\t\t\t\t\t\ta.startContainer !== b.startContainer ||\n\t\t\t\t\t\ta.endContainer !== b.endContainer ||\n\t\t\t\t\t\ta.startOffset !== b.startOffset ||\n\t\t\t\t\t\ta.endOffset !== b.endOffset\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if the selection hasn't changed (as a result of an element being (auto)focused,\n\t\t\t\t// or a programmatic selection, we reset everything as part of the navigation)\n\t\t\t\t// fixes https://github.com/sveltejs/kit/issues/8439\n\t\t\t\tselection.removeAllRanges();\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n * @template {import('@sveltejs/kit').NavigationType} T\n * @param {import('./types.js').NavigationState} current\n * @param {import('./types.js').NavigationIntent | undefined} intent\n * @param {URL | null} url\n * @param {T} type\n * @param {{ x: number, y: number } | null} [target_scroll] The scroll position for the target (for popstate navigations)\n */\nfunction create_navigation(current, intent, url, type, target_scroll = null) {\n\t/** @type {(value: any) => void} */\n\tlet fulfil;\n\n\t/** @type {(error: any) => void} */\n\tlet reject;\n\n\tconst complete = new Promise((f, r) => {\n\t\tfulfil = f;\n\t\treject = r;\n\t});\n\n\t// Handle any errors off-chain so that it doesn't show up as an unhandled rejection\n\tcomplete.catch(noop);\n\n\t/** @type {(import('@sveltejs/kit').Navigation | import('@sveltejs/kit').AfterNavigate) & { type: T }} */\n\tconst navigation = /** @type {any} */ ({\n\t\tfrom: {\n\t\t\tparams: current.params,\n\t\t\troute: { id: current.route?.id ?? null },\n\t\t\turl: current.url,\n\t\t\tscroll: scroll_state()\n\t\t},\n\t\tto: url && {\n\t\t\tparams: intent?.params ?? null,\n\t\t\troute: { id: intent?.route?.id ?? null },\n\t\t\turl,\n\t\t\tscroll: target_scroll\n\t\t},\n\t\twillUnload: !intent,\n\t\ttype,\n\t\tcomplete\n\t});\n\n\treturn {\n\t\tnavigation,\n\t\t// @ts-expect-error\n\t\tfulfil,\n\t\t// @ts-expect-error\n\t\treject\n\t};\n}\n\n/**\n * TODO: remove this in 3.0 when the page store is also removed\n *\n * We need to assign a new page object so that subscribers are correctly notified.\n * However, spreading `{ ...page }` returns an empty object so we manually\n * assign to each property instead.\n *\n * @param {import('@sveltejs/kit').Page} page\n */\nfunction clone_page(page) {\n\treturn {\n\t\tdata: page.data,\n\t\terror: page.error,\n\t\tform: page.form,\n\t\tparams: page.params,\n\t\troute: page.route,\n\t\tstate: page.state,\n\t\tstatus: page.status,\n\t\turl: page.url\n\t};\n}\n\n/**\n * @param {URL} url\n * @returns {URL}\n */\nfunction decode_hash(url) {\n\tconst new_url = new URL(url);\n\t// Safari, for some reason, does change # to %23, when entered through the address bar\n\tnew_url.hash = decodeURIComponent(url.hash);\n\treturn new_url;\n}\n\n/**\n * @param {URL} url\n * @returns {string}\n */\nfunction get_id(url) {\n\tlet id;\n\n\tif (app.hash) {\n\t\tconst [, , second] = url.hash.split('#', 3);\n\t\tid = second ?? '';\n\t} else {\n\t\tid = url.hash.slice(1);\n\t}\n\n\treturn decodeURIComponent(id);\n}\n\nif (DEV) {\n\t// Nasty hack to silence harmless warnings the user can do nothing about\n\tconst console_warn = console.warn;\n\tconsole.warn = function warn(...args) {\n\t\tif (\n\t\t\targs.length === 1 &&\n\t\t\t/<(Layout|Page|Error)(_[\\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test(\n\t\t\t\targs[0]\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconsole_warn(...args);\n\t};\n\n\tif (import.meta.hot) {\n\t\timport.meta.hot.on('vite:beforeUpdate', () => {\n\t\t\tif (errored) {\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t});\n\t}\n}\n"],"names":["HttpError","status","body","Redirect","location","SvelteKitError","text","message","param_pattern","root_group_pattern","parse_route_id","id","params","get_route_segments","segment","rest_match","optional_match","parts","content","i","escape","code","match","is_optional","is_rest","name","matcher","affects_path","route","exec","matchers","result","values","values_needing_match","value","buffered","param","s","next_param","next_value","str","parse","nodes","server_loads","dictionary","layouts_with_server_load","leaf","layouts","errors","pattern","path","n","create_layout_loader","create_leaf_loader","uses_server_data","get","key","set","stringify","data","UNDEFINED","HOLE","NAN","POSITIVE_INFINITY","NEGATIVE_INFINITY","NEGATIVE_ZERO","SPARSE","MAX_ARRAY_LEN","MAX_ARRAY_INDEX","is_valid_array_index","is_valid_array_len","decode_native","base64","decode_buffer","decode_legacy","binary_string","len","array","native","buffer","decode64","merge_operations","defaults","overrides","array_buffer_byte_length","shared_array_buffer_byte_length","parse_operations","primitive","iso","tag","source","flags","byteOffset","length","error","Constructor","target","map","default_parse_operations","unflatten","parsed","revivers","options","ops","hydrate","hydrated","hydrating","index","standalone","type","reviver","wrapped_index","obj","idx","object","compact","arr","val","INVALIDATED_PARAM","TRAILING_SLASH_PARAM","create_remote_key","payload","get_status","get_message","DATA_SUFFIX","HTML_DATA_SUFFIX","add_data_suffix","pathname","noop_span","noop_span_context","read_stream","reader","delimiter","done","decoder","split","chunk","read_ndjson","block","line","onMount","svelte","ICON_REL_ATTRIBUTES","rendering_error","scroll_positions","storage.get","SCROLL_KEY","snapshots","SNAPSHOT_KEY","stores","notifiable_store","writable","create_updated_store","update_scroll_positions","scroll_state","clear_onward_history","current_history_index","current_navigation_index","native_navigation","url","replace","noop","update_service_worker","registration","base","routes","default_layout_loader","default_error_loader","container","app","invalidated","components","load_cache","discard_load_cache","f","current_a","reroute_cache","before_navigate_callbacks","on_navigate_callbacks","after_navigate_callbacks","current","started","autoscroll","is_navigating","hash_navigating","has_navigated","force_invalidation","root","token","preload_tokens","query_map","live_query_map","start","_app","_target","q","p","l","k","HISTORY_INDEX","NAVIGATION_INDEX","scroll","restore_scroll","_hydrate","navigate","resolve_url","decode_hash","_start_router","reset_invalidation","capture_snapshot","c","restore_snapshot","persist_state","storage.set","_goto","redirect_count","nav_token","query_keys","live_query_keys","entries","entry","push_invalidated","svelte.tick","resource","_preload_data","intent","preload","load_route","_preload_code","get_navigation_intent","load","initialize","nav","update","navigation","fn","get_navigation_result_from_branch","branch","form","slash","node","normalize_path","branch_node","clone_page","page","data_changed","prev","load_node","loader","parent","server_data_node","is_tracking","uses","depends","deps","dep","href","load_input","make_trackable","init","resolved","promise","resolve_fetch_url","input","requested","subsequent_fetch","initial_fetch","has_changed","parent_changed","route_changed","url_changed","search_params_changed","tracked_params","create_data_node","previous","diff_search_params","old_url","new_url","changed","old_values","new_values","preload_error","invalidating","loaders","server_data","get_page_key","parent_invalid","invalid_server_nodes","invalid","load_data","handled_error","handle_error","load_root_error_page","server_data_nodes","branch_promises","j","err","error_load","load_nearest_error_page","server_fallback","e","origin","root_layout","root_error","error_template","handled","html","get_rerouted_url","rerouted","tmp","is_external_url","get_url_path","decode_params","decode_pathname","_before_navigate","delta","event","should_block","create_navigation","cancellable","popped","keepfocus","noscroll","replace_state","state","accept","prev_token","previous_history_index","previous_navigation_index","navigating","navigation_result","change","STATES_KEY","load_cache_fork","commit_promise","after_navigate","cleanup","fork","svelte.settled","activeElement","deep_linked","get_id","changed_focus","reset_focus","setup_preload","mousemove_timeout","current_priority","PRELOAD_PRIORITIES","tap","observer","element","priority","a","find_anchor","interacted","external","download","get_link_info","get_router_options","same_url","add_navigation_callback","callbacks","callback","afterNavigate","goto","opts","nonhash","hash","same_pathname","strip_hash","current_hash","update_url","fulfil","submitter","event_form","resetting_focus","history_index","PAGE_URL_KEY","navigation_index","is_hash_change","link","node_ids","server_route","parsed_route","deserialize_uses","data_url","fetcher","res","resolve","reject","process_stream","deferreds","deserialize","devalue.unflatten","deferred","autofocus","x","y","history_state","tabindex","selection","ranges","b","target_scroll","complete","r","second"],"mappings":"kTAEO,MAAMA,CAAU,CAKtB,YAAYC,EAAQC,EAAM,CACzB,KAAK,OAASD,EACV,OAAOC,GAAS,SACnB,KAAK,KAAO,CAAE,QAASA,CAAI,EACjBA,EACV,KAAK,KAAOA,EAEZ,KAAK,KAAO,CAAE,QAAS,UAAUD,CAAM,EAAE,CAE3C,CAEA,UAAW,CACV,OAAO,KAAK,UAAU,KAAK,IAAI,CAChC,CACD,CAEO,MAAME,EAAS,CAKrB,YAAYF,EAAQG,EAAU,CAC7B,GAAI,CACH,IAAI,QAAQ,CAAE,SAAAA,EAAU,CACzB,MAAQ,CACP,MAAM,IAAI,MACT,6BAA6B,KAAK,UAAUA,CAAQ,CAAC,uEAEzD,CACE,CAEA,KAAK,OAASH,EACd,KAAK,SAAWG,CACjB,CACD,CAOO,MAAMC,WAAuB,KAAM,CAMzC,YAAYJ,EAAQK,EAAMC,EAAS,CAClC,MAAMA,CAAO,EACb,KAAK,OAASN,EACd,KAAK,KAAOK,CACb,CACD,CCxDA,MAAME,GAA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9,10,11,12,13,14,15,16]}
1
+ {"version":3,"file":"BdVIGZmZ.js","sources":["../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/exports/internal/index.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/routing.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/parse.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/session-storage.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/constants.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/utils.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/base64.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/operations.js","../../../../../../../node_modules/.bun/devalue@5.9.4/node_modules/devalue/src/parse.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/array.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/shared.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/utils/error.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/pathname.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/telemetry/noop.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/stream.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/ndjson.js","../../../../../../../node_modules/.bun/@sveltejs+kit@2.70.3+3ffe4465391527f6/node_modules/@sveltejs/kit/src/runtime/client/client.js"],"sourcesContent":["/** @import { StandardSchemaV1 } from '@standard-schema/spec' */\n\nexport class HttpError {\n\t/**\n\t * @param {number} status\n\t * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body\n\t */\n\tconstructor(status, body) {\n\t\tthis.status = status;\n\t\tif (typeof body === 'string') {\n\t\t\tthis.body = { message: body };\n\t\t} else if (body) {\n\t\t\tthis.body = body;\n\t\t} else {\n\t\t\tthis.body = { message: `Error: ${status}` };\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this.body);\n\t}\n}\n\nexport class Redirect {\n\t/**\n\t * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status\n\t * @param {string} location\n\t */\n\tconstructor(status, location) {\n\t\ttry {\n\t\t\tnew Headers({ location });\n\t\t} catch {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid redirect location ${JSON.stringify(location)}: ` +\n\t\t\t\t\t'this string contains characters that cannot be used in HTTP headers'\n\t\t\t);\n\t\t}\n\n\t\tthis.status = status;\n\t\tthis.location = location;\n\t}\n}\n\n/**\n * An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404.\n * `SvelteKitError` goes through `handleError`.\n * @extends Error\n */\nexport class SvelteKitError extends Error {\n\t/**\n\t * @param {number} status\n\t * @param {string} text\n\t * @param {string} message\n\t */\n\tconstructor(status, text, message) {\n\t\tsuper(message);\n\t\tthis.status = status;\n\t\tthis.text = text;\n\t}\n}\n\n/**\n * @template [T=undefined]\n */\nexport class ActionFailure {\n\t/**\n\t * @param {number} status\n\t * @param {T} data\n\t */\n\tconstructor(status, data) {\n\t\tthis.status = status;\n\t\tthis.data = data;\n\t}\n}\n\n/**\n * Error thrown when form validation fails imperatively\n */\nexport class ValidationError extends Error {\n\t/**\n\t * @param {StandardSchemaV1.Issue[]} issues\n\t */\n\tconstructor(issues) {\n\t\tsuper('Validation failed');\n\t\tthis.name = 'ValidationError';\n\t\tthis.issues = issues;\n\t}\n}\n\nexport { init_remote_functions } from './remote-functions.js';\n","import { BROWSER } from 'esm-env';\nimport { decode_params } from './url.js';\n\nconst param_pattern = /^(\\[)?(\\.\\.\\.)?(\\w+)(?:=(\\w+))?(\\])?$/;\n\nconst root_group_pattern = /^\\/\\((?:[^)]+)\\)$/;\n\n/**\n * Creates the regex pattern, extracts parameter names, and generates types for a route\n * @param {string} id\n */\nexport function parse_route_id(id) {\n\t/** @type {import('types').RouteParam[]} */\n\tconst params = [];\n\n\tconst pattern =\n\t\tid === '/' || root_group_pattern.test(id)\n\t\t\t? /^\\/$/\n\t\t\t: new RegExp(\n\t\t\t\t\t`^${get_route_segments(id)\n\t\t\t\t\t\t.map((segment) => {\n\t\t\t\t\t\t\t// special case — /[...rest]/ could contain zero segments\n\t\t\t\t\t\t\tconst rest_match = /^\\[\\.\\.\\.(\\w+)(?:=(\\w+))?\\]$/.exec(segment);\n\t\t\t\t\t\t\tif (rest_match) {\n\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\tname: rest_match[1],\n\t\t\t\t\t\t\t\t\tmatcher: rest_match[2],\n\t\t\t\t\t\t\t\t\toptional: false,\n\t\t\t\t\t\t\t\t\trest: true,\n\t\t\t\t\t\t\t\t\tchained: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn '(?:/([^]*))?';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// special case — /[[optional]]/ could contain zero segments\n\t\t\t\t\t\t\tconst optional_match = /^\\[\\[(\\w+)(?:=(\\w+))?\\]\\]$/.exec(segment);\n\t\t\t\t\t\t\tif (optional_match) {\n\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\tname: optional_match[1],\n\t\t\t\t\t\t\t\t\tmatcher: optional_match[2],\n\t\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\t\trest: false,\n\t\t\t\t\t\t\t\t\tchained: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn '(?:/([^/]+))?';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!segment) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst parts = segment.split(/\\[(.+?)\\](?!\\])/);\n\t\t\t\t\t\t\tconst result = parts\n\t\t\t\t\t\t\t\t.map((content, i) => {\n\t\t\t\t\t\t\t\t\tif (i % 2) {\n\t\t\t\t\t\t\t\t\t\tif (content.startsWith('x+')) {\n\t\t\t\t\t\t\t\t\t\t\treturn escape(String.fromCharCode(parseInt(content.slice(2), 16)));\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif (content.startsWith('u+')) {\n\t\t\t\t\t\t\t\t\t\t\treturn escape(\n\t\t\t\t\t\t\t\t\t\t\t\tString.fromCharCode(\n\t\t\t\t\t\t\t\t\t\t\t\t\t...content\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.slice(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.split('-')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.map((code) => parseInt(code, 16))\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// We know the match cannot be null in the browser because manifest generation\n\t\t\t\t\t\t\t\t\t\t// would have invoked this during build and failed if we hit an invalid\n\t\t\t\t\t\t\t\t\t\t// param/matcher name with non-alphanumeric character.\n\t\t\t\t\t\t\t\t\t\tconst match = /** @type {RegExpExecArray} */ (param_pattern.exec(content));\n\t\t\t\t\t\t\t\t\t\tif (!BROWSER && !match) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t\t\t`Invalid param: ${content}. Params and matcher names can only have underscores and alphanumeric characters.`\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconst [, is_optional, is_rest, name, matcher] = match;\n\t\t\t\t\t\t\t\t\t\t// It's assumed that the following invalid route id cases are already checked\n\t\t\t\t\t\t\t\t\t\t// - unbalanced brackets\n\t\t\t\t\t\t\t\t\t\t// - optional param following rest param\n\n\t\t\t\t\t\t\t\t\t\tparams.push({\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tmatcher,\n\t\t\t\t\t\t\t\t\t\t\toptional: !!is_optional,\n\t\t\t\t\t\t\t\t\t\t\trest: !!is_rest,\n\t\t\t\t\t\t\t\t\t\t\tchained: is_rest ? i === 1 && parts[0] === '' : false\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\treturn is_rest ? '([^]*?)' : is_optional ? '([^/]*)?' : '([^/]+?)';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn escape(content);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.join('');\n\n\t\t\t\t\t\t\treturn '/' + result;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join('')}/?$`\n\t\t\t\t);\n\n\treturn { pattern, params };\n}\n\nconst optional_param_regex = /\\/\\[\\[\\w+?(?:=\\w+)?\\]\\]/;\n\n/**\n * Removes optional params from a route ID.\n * @param {string} id\n * @returns The route id with optional params removed\n */\nexport function remove_optional_params(id) {\n\treturn id.replace(optional_param_regex, '');\n}\n\n/**\n * Returns `false` for `(group)` segments\n * @param {string} segment\n */\nfunction affects_path(segment) {\n\treturn segment !== '' && !/^\\([^)]+\\)$/.test(segment);\n}\n\n/**\n * Splits a route id into its segments, removing segments that\n * don't affect the path (i.e. groups). The root route is represented by `/`\n * and will be returned as `['']`.\n * @param {string} route\n * @returns string[]\n */\nexport function get_route_segments(route) {\n\treturn route.slice(1).split('/').filter(affects_path);\n}\n\n/**\n * @param {RegExpMatchArray} match\n * @param {import('types').RouteParam[]} params\n * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers\n */\nexport function exec(match, params, matchers) {\n\t/** @type {Record<string, string>} */\n\tconst result = {};\n\n\tconst values = match.slice(1);\n\tconst values_needing_match = values.filter((value) => value !== undefined);\n\n\tlet buffered = 0;\n\n\tfor (let i = 0; i < params.length; i += 1) {\n\t\tconst param = params[i];\n\t\tlet value = values[i - buffered];\n\n\t\t// in the `[[a=b]]/.../[...rest]` case, if one or more optional parameters\n\t\t// weren't matched, roll the skipped values into the rest\n\t\tif (param.chained && param.rest && buffered) {\n\t\t\tvalue = values\n\t\t\t\t.slice(i - buffered, i + 1)\n\t\t\t\t.filter((s) => s)\n\t\t\t\t.join('/');\n\n\t\t\tbuffered = 0;\n\t\t}\n\n\t\t// if `value` is undefined, it means this is an optional or rest parameter\n\t\tif (value === undefined) {\n\t\t\tif (param.rest) {\n\t\t\t\t// We need to allow the matcher to run so that it can decide if this optional rest param should be allowed to match\n\t\t\t\tvalue = '';\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!param.matcher || matchers[param.matcher](value)) {\n\t\t\tresult[param.name] = value;\n\n\t\t\t// Now that the params match, reset the buffer if the next param isn't the [...rest]\n\t\t\t// and the next value is defined, otherwise the buffer will cause us to skip values\n\t\t\tconst next_param = params[i + 1];\n\t\t\tconst next_value = values[i + 1];\n\t\t\tif (next_param && !next_param.rest && next_param.optional && next_value && param.chained) {\n\t\t\t\tbuffered = 0;\n\t\t\t}\n\n\t\t\t// There are no more params and no more values, but all non-empty values have been matched\n\t\t\tif (\n\t\t\t\t!next_param &&\n\t\t\t\t!next_value &&\n\t\t\t\tObject.keys(result).length === values_needing_match.length\n\t\t\t) {\n\t\t\t\tbuffered = 0;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\t// in the `/[[a=b]]/...` case, if the value didn't satisfy the matcher,\n\t\t// keep track of the number of skipped optional parameters and continue\n\t\tif (param.optional && param.chained) {\n\t\t\tbuffered++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// otherwise, if the matcher returns `false`, the route did not match\n\t\treturn;\n\t}\n\n\tif (buffered) return;\n\treturn result;\n}\n\n/** @param {string} str */\nfunction escape(str) {\n\treturn (\n\t\tstr\n\t\t\t.normalize()\n\t\t\t// escape [ and ] before escaping other characters, since they are used in the replacements\n\t\t\t.replace(/[[\\]]/g, '\\\\$&')\n\t\t\t// replace %, /, ? and # with their encoded versions because decode_pathname leaves them untouched\n\t\t\t.replace(/%/g, '%25')\n\t\t\t.replace(/\\//g, '%2[Ff]')\n\t\t\t.replace(/\\?/g, '%3[Ff]')\n\t\t\t.replace(/#/g, '%23')\n\t\t\t// escape characters that have special meaning in regex\n\t\t\t.replace(/[.*+?^${}()|\\\\]/g, '\\\\$&')\n\t);\n}\n\nconst basic_param_pattern = /\\[(\\[)?(\\.\\.\\.)?(\\w+?)(?:=(\\w+))?\\]\\]?/g;\n\n/**\n * Populate a route ID with params to resolve a pathname.\n * @example\n * ```js\n * resolveRoute(\n * `/blog/[slug]/[...somethingElse]`,\n * {\n * slug: 'hello-world',\n * somethingElse: 'something/else'\n * }\n * ); // `/blog/hello-world/something/else`\n * ```\n * @param {string} id\n * @param {Record<string, string | undefined>} params\n * @returns {string}\n */\nexport function resolve_route(id, params) {\n\tconst segments = get_route_segments(id);\n\tconst has_id_trailing_slash = id != '/' && id.endsWith('/');\n\n\treturn (\n\t\t'/' +\n\t\tsegments\n\t\t\t.map((segment) =>\n\t\t\t\tsegment.replace(basic_param_pattern, (_, optional, rest, name) => {\n\t\t\t\t\tconst param_value = params[name];\n\n\t\t\t\t\t// This is nested so TS correctly narrows the type\n\t\t\t\t\tif (!param_value) {\n\t\t\t\t\t\tif (optional) return '';\n\t\t\t\t\t\tif (rest && param_value !== undefined) return '';\n\t\t\t\t\t\tthrow new Error(`Missing parameter '${name}' in route ${id}`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (param_value.startsWith('/') || param_value.endsWith('/'))\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Parameter '${name}' in route ${id} cannot start or end with a slash -- this would cause an invalid route like foo//bar`\n\t\t\t\t\t\t);\n\t\t\t\t\treturn param_value;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.filter(Boolean)\n\t\t\t.join('/') +\n\t\t(has_id_trailing_slash ? '/' : '')\n\t);\n}\n\n/**\n * @param {import('types').SSRNode} node\n * @returns {boolean}\n */\nexport function has_server_load(node) {\n\treturn node.server?.load !== undefined || node.server?.trailingSlash !== undefined;\n}\n\n/**\n * Find the first route that matches the given path\n * @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route\n * @param {string} path - The decoded pathname to match\n * @param {Route[]} routes\n * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers\n * @returns {{ route: Route, params: Record<string, string> } | null}\n */\nexport function find_route(path, routes, matchers) {\n\tfor (const route of routes) {\n\t\tconst match = route.pattern.exec(path);\n\t\tif (!match) continue;\n\n\t\tconst matched = exec(match, route.params, matchers);\n\t\tif (matched) {\n\t\t\treturn {\n\t\t\t\troute,\n\t\t\t\tparams: decode_params(matched)\n\t\t\t};\n\t\t}\n\t}\n\treturn null;\n}\n","import { exec, parse_route_id } from '../../utils/routing.js';\n\n/**\n * @param {import('./types.js').SvelteKitApp} app\n * @returns {import('types').CSRRoute[]}\n */\nexport function parse({ nodes, server_loads, dictionary, matchers }) {\n\tconst layouts_with_server_load = new Set(server_loads);\n\n\treturn Object.entries(dictionary).map(([id, [leaf, layouts, errors]]) => {\n\t\tconst { pattern, params } = parse_route_id(id);\n\n\t\t/** @type {import('types').CSRRoute} */\n\t\tconst route = {\n\t\t\tid,\n\t\t\t/** @param {string} path */\n\t\t\texec: (path) => {\n\t\t\t\tconst match = pattern.exec(path);\n\t\t\t\tif (match) return exec(match, params, matchers);\n\t\t\t},\n\t\t\terrors: [1, ...(errors || [])].map((n) => nodes[n]),\n\t\t\tlayouts: [0, ...(layouts || [])].map(create_layout_loader),\n\t\t\tleaf: create_leaf_loader(leaf)\n\t\t};\n\n\t\t// bit of a hack, but ensures that layout/error node lists are the same\n\t\t// length, without which the wrong data will be applied if the route\n\t\t// manifest looks like `[[a, b], [c,], d]`\n\t\troute.errors.length = route.layouts.length = Math.max(\n\t\t\troute.errors.length,\n\t\t\troute.layouts.length\n\t\t);\n\n\t\treturn route;\n\t});\n\n\t/**\n\t * @param {number} id\n\t * @returns {[boolean, import('types').CSRPageNodeLoader]}\n\t */\n\tfunction create_leaf_loader(id) {\n\t\t// whether or not the route uses the server data is\n\t\t// encoded using the ones' complement, to save space\n\t\tconst uses_server_data = id < 0;\n\t\tif (uses_server_data) id = ~id;\n\t\treturn [uses_server_data, nodes[id]];\n\t}\n\n\t/**\n\t * @param {number | undefined} id\n\t * @returns {[boolean, import('types').CSRPageNodeLoader] | undefined}\n\t */\n\tfunction create_layout_loader(id) {\n\t\t// whether or not the layout uses the server data is\n\t\t// encoded in the layouts array, to save space\n\t\treturn id === undefined ? id : [layouts_with_server_load.has(id), nodes[id]];\n\t}\n}\n\n/**\n * @param {import('types').CSRRouteServer} input\n * @param {import('types').CSRPageNodeLoader[]} app_nodes Will be modified if a new node is loaded that's not already in the array\n * @returns {import('types').CSRRoute}\n */\nexport function parse_server_route({ nodes, id, leaf, layouts, errors }, app_nodes) {\n\treturn {\n\t\tid,\n\t\texec: () => ({}), // dummy function; exec already happened on the server\n\t\t// By writing to app_nodes only when a loader at that index is not already defined,\n\t\t// we ensure that loaders have referential equality when they load the same node.\n\t\t// Code elsewhere in client.js relies on this referential equality to determine\n\t\t// if a loader is different and should therefore (re-)run.\n\t\terrors: errors.map((n) => (n ? (app_nodes[n] ||= nodes[n]) : undefined)),\n\t\tlayouts: layouts.map((n) => (n ? [n[0], (app_nodes[n[1]] ||= nodes[n[1]])] : undefined)),\n\t\tleaf: [leaf[0], (app_nodes[leaf[1]] ||= nodes[leaf[1]])]\n\t};\n}\n","/**\n * Read a value from `sessionStorage`\n * @param {string} key\n * @param {(value: string) => any} parse\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get(key, parse = JSON.parse) {\n\ttry {\n\t\treturn parse(sessionStorage[key]);\n\t} catch {\n\t\t// do nothing\n\t}\n}\n\n/**\n * Write a value to `sessionStorage`\n * @param {string} key\n * @param {any} value\n * @param {(value: any) => string} stringify\n */\nexport function set(key, value, stringify = JSON.stringify) {\n\tconst data = stringify(value);\n\ttry {\n\t\tsessionStorage[key] = data;\n\t} catch {\n\t\t// do nothing\n\t}\n}\n","export const UNDEFINED = -1;\nexport const HOLE = -2;\nexport const NAN = -3;\nexport const POSITIVE_INFINITY = -4;\nexport const NEGATIVE_INFINITY = -5;\nexport const NEGATIVE_ZERO = -6;\nexport const SPARSE = -7;\n\n// The largest valid value for a JavaScript array's `length` property,\n// and the largest valid array index (one less than the max length).\nexport const MAX_ARRAY_LEN = 2 ** 32 - 1;\nexport const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;\n","import { MAX_ARRAY_INDEX, MAX_ARRAY_LEN } from './constants.js';\n\n/** @type {Record<string, string>} */\nexport const escaped = {\n\t'<': '\\\\u003C',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029'\n};\n\nexport class DevalueError extends Error {\n\t/**\n\t * @param {string} message\n\t * @param {string[]} keys\n\t * @param {any} [value] - The value that failed to be serialized\n\t * @param {any} [root] - The root value being serialized\n\t */\n\tconstructor(message, keys, value, root) {\n\t\tsuper(message);\n\t\tthis.name = 'DevalueError';\n\t\tthis.path = keys.join('');\n\t\tthis.value = value;\n\t\tthis.root = root;\n\t}\n}\n\n/** @param {any} thing */\nexport function is_primitive(thing) {\n\treturn thing === null || (typeof thing !== 'object' && typeof thing !== 'function');\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)\n\t.sort()\n\t.join('\\0');\n\n/** @param {any} thing */\nexport function is_plain_object(thing) {\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/** @param {any} thing */\nexport function get_type(thing) {\n\treturn Object.prototype.toString.call(thing).slice(8, -1);\n}\n\n/** @param {any} thing */\nexport function is_buffer(thing) {\n\treturn typeof Buffer !== 'undefined' && Buffer.isBuffer(thing);\n}\n\n/** @param {string} char */\nfunction get_escaped_char(char) {\n\tswitch (char) {\n\t\tcase '\"':\n\t\t\treturn '\\\\\"';\n\t\tcase '<':\n\t\t\treturn '\\\\u003C';\n\t\tcase '\\\\':\n\t\t\treturn '\\\\\\\\';\n\t\tcase '\\n':\n\t\t\treturn '\\\\n';\n\t\tcase '\\r':\n\t\t\treturn '\\\\r';\n\t\tcase '\\t':\n\t\t\treturn '\\\\t';\n\t\tcase '\\b':\n\t\t\treturn '\\\\b';\n\t\tcase '\\f':\n\t\t\treturn '\\\\f';\n\t\tcase '\\u2028':\n\t\t\treturn '\\\\u2028';\n\t\tcase '\\u2029':\n\t\t\treturn '\\\\u2029';\n\t\tdefault:\n\t\t\treturn char < ' ' ? `\\\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}` : '';\n\t}\n}\n\n/** @param {string} str */\nexport function stringify_string(str) {\n\tlet result = '';\n\tlet last_pos = 0;\n\tconst len = str.length;\n\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst char = str[i];\n\t\tconst replacement = get_escaped_char(char);\n\t\tif (replacement) {\n\t\t\tresult += str.slice(last_pos, i) + replacement;\n\t\t\tlast_pos = i + 1;\n\t\t}\n\t}\n\n\treturn `\"${last_pos === 0 ? str : result + str.slice(last_pos)}\"`;\n}\n\n/** @param {Record<string | symbol, any>} object */\nexport function enumerable_symbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter(\n\t\t(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable\n\t);\n}\n\nconst is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/** @param {string} key */\nexport function stringify_key(key) {\n\treturn is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';\n}\n\n/** @param {number} n */\nexport function is_valid_array_index(n) {\n\tif (!Number.isInteger(n)) return false;\n\tif (n < 0) return false;\n\tif (n > MAX_ARRAY_INDEX) return false;\n\treturn true;\n}\n\n/** @param {number} n */\nexport function is_valid_array_len(n) {\n\tif (!Number.isInteger(n)) return false;\n\tif (n < 0) return false;\n\tif (n > MAX_ARRAY_LEN) return false;\n\treturn true;\n}\n\n/** @param {string} s */\nfunction is_valid_array_index_string(s) {\n\tif (s.length === 0) return false;\n\tif (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero\n\tfor (let i = 0; i < s.length; i++) {\n\t\tconst c = s.charCodeAt(i);\n\t\tif (c < 48 || c > 57) return false;\n\t}\n\t// by this point we know it's a string of digits, but it has to be within\n\t// the range of valid array indices\n\treturn is_valid_array_index(+s);\n}\n\n/**\n * Returns the length of the leading run of valid array indices in `keys`.\n * @param {readonly string[]} keys\n */\nfunction array_index_cut(keys) {\n\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\tif (is_valid_array_index_string(keys[i])) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn i + 1;\n}\n\n/**\n * Finds the populated indices of an array.\n * @param {unknown[]} array\n */\nexport function valid_array_indices(array) {\n\tconst keys = Object.keys(array);\n\tkeys.length = array_index_cut(keys);\n\treturn keys;\n}\n\n/**\n * Given the own enumerable string keys of an array-like value, in property\n * order, returns the leading run of them that are valid array indices.\n *\n * This is the filtering half of the `indicesOf` stringify operation,\n * exposed so that custom operations — which typically already have the keys\n * in hand, e.g. from a foreign runtime — don't have to reimplement it.\n *\n * Does not modify `keys`.\n *\n * @param {readonly string[]} keys\n * @returns {string[]}\n */\nexport function filter_array_indices(keys) {\n\treturn keys.slice(0, array_index_cut(keys));\n}\n","/* Baseline 2025 runtimes */\n\n/**\t@type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_native(array_buffer) {\n\treturn new Uint8Array(array_buffer).toBase64();\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_native(base64) {\n\treturn Uint8Array.fromBase64(base64).buffer;\n}\n\n/* Node-compatible runtimes */\n\n/** @type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_buffer(array_buffer) {\n\treturn Buffer.from(array_buffer).toString('base64');\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_buffer(base64) {\n\treturn Uint8Array.from(Buffer.from(base64, 'base64')).buffer;\n}\n\n/* Legacy runtimes */\n\n/** @type {(array_buffer: ArrayBuffer) => string} */\nexport function encode_legacy(array_buffer) {\n\tconst array = new Uint8Array(array_buffer);\n\tlet binary = '';\n\n\t// the maximum number of arguments to String.fromCharCode.apply\n\t// should be around 0xFFFF in modern engines\n\tconst chunk_size = 0x8000;\n\tfor (let i = 0; i < array.length; i += chunk_size) {\n\t\tconst chunk = array.subarray(i, i + chunk_size);\n\t\tbinary += String.fromCharCode.apply(null, chunk);\n\t}\n\n\treturn btoa(binary);\n}\n\n/**\t@type {(base64: string) => ArrayBuffer} */\nexport function decode_legacy(base64) {\n\tconst binary_string = atob(base64);\n\tconst len = binary_string.length;\n\tconst array = new Uint8Array(len);\n\n\tfor (let i = 0; i < len; i++) {\n\t\tarray[i] = binary_string.charCodeAt(i);\n\t}\n\n\treturn array.buffer;\n}\n\nconst native = typeof Uint8Array.fromBase64 === 'function';\nconst buffer = typeof process === 'object' && process.versions?.node !== undefined;\n\nexport const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;\nexport const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;\n","import { MAX_ARRAY_INDEX } from './constants.js';\nimport {\n\tenumerable_symbols,\n\tget_type,\n\tis_buffer,\n\tis_plain_object,\n\tvalid_array_indices\n} from './utils.js';\n\n/**\n * Merges caller-provided operation overrides over the defaults. Iterating the\n * default keys (rather than the override's own keys) means nullish members\n * fall back to the default, and inherited members — e.g. from a class\n * instance — are picked up.\n *\n * @template {Record<string, any>} T\n * @param {T} defaults\n * @param {Partial<T> | undefined} overrides\n * @returns {T}\n */\nexport function merge_operations(defaults, overrides) {\n\tif (!overrides) return defaults;\n\n\tconst merged = /** @type {T} */ ({});\n\n\tfor (const key of /** @type {(keyof T)[]} */ (Object.keys(defaults))) {\n\t\tmerged[key] = overrides[key] ?? defaults[key];\n\t}\n\n\treturn merged;\n}\n\n/** @type {{ kind: 'not-plain' }} */\nconst NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: 'not-plain' });\n\n/** @type {{ kind: 'symbol-keys' }} */\nconst SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: 'symbol-keys' });\n\n/**\n * The default implementations of every introspection/extraction operation\n * `stringify` performs on the value being serialized. Each one uses native\n * JavaScript semantics (property access, iteration, prototype methods, etc).\n *\n * Pass overrides via the `operations` option of `stringify`/`stringifyAsync`\n * to customize how values are inspected — e.g. to serialize values without\n * triggering getters, proxy traps, or patched prototype methods, or to\n * serialize values that live in a different JavaScript runtime (a `node:vm`\n * context, a WASM-hosted engine, a remote process) through handle objects.\n *\n * The object is frozen — it is shared by every `stringify` call that does\n * not override a given operation.\n *\n */\n/** @type {import('./types.js').DefaultStringifyOperations} */\nconst stringify_operations = {\n\tidentify: (value) => value,\n\n\ttypeOf: (value) => (value === null ? 'null' : typeof value),\n\n\ttoPrimitive: (value) => value,\n\n\ttagOf: (value) => get_type(value),\n\n\tisThenable: (value) => typeof value.then === 'function',\n\n\ttoPromise: (thenable) => Promise.resolve(thenable),\n\n\tunbox: (boxed) => boxed.valueOf(),\n\n\ttoISOString: (date) => (isNaN(date.getDate()) ? '' : date.toISOString()),\n\n\ttoStringValue: (value) => value.toString(),\n\n\tregExpInfo: (regexp) => ({ source: regexp.source, flags: regexp.flags }),\n\n\tvaluesOf: (set) => set,\n\n\tentriesOf: (map) => map,\n\n\tviewInfo: (view) => {\n\t\t// Node Buffers may share a pool containing unrelated, sensitive data.\n\t\t// Copy only the visible bytes, without using Buffer's pooling or slice.\n\t\tif (is_buffer(view)) view = new Uint8Array(view);\n\n\t\treturn {\n\t\t\tbuffer: view.buffer,\n\t\t\tbyteOffset: view.byteOffset,\n\t\t\tbyteLength: view.byteLength,\n\t\t\tlength: view.length,\n\t\t\tbufferByteLength: view.buffer.byteLength\n\t\t};\n\t},\n\n\ttoArrayBuffer: (buffer) => buffer,\n\n\tlengthOf: (array) => array.length,\n\n\thasOwn: (value, key) => Object.hasOwn(value, key),\n\n\tindicesOf: (array) => valid_array_indices(array),\n\n\tshapeOf: (value) => {\n\t\tif (!is_plain_object(value)) return NOT_PLAIN;\n\t\tif (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;\n\n\t\treturn {\n\t\t\tkind: Object.getPrototypeOf(value) === null ? 'null-proto' : 'plain',\n\t\t\tkeys: Object.keys(value)\n\t\t};\n\t},\n\n\tget: (value, key) => value[key]\n};\n\nexport const default_stringify_operations = /* @__PURE__ */ Object.freeze(stringify_operations);\n\nconst array_buffer_byte_length = Object.getOwnPropertyDescriptor(\n\tArrayBuffer.prototype,\n\t'byteLength'\n).get;\n\nconst shared_array_buffer_byte_length =\n\ttypeof SharedArrayBuffer === 'undefined'\n\t\t? undefined\n\t\t: Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get;\n\n/**\n * The default implementations of every construction operation `parse` and\n * `unflatten` perform while reviving a value. Each one uses native\n * JavaScript semantics (built-in constructors, property assignment, etc).\n *\n * Pass overrides via the `operations` option of `parse`/`unflatten` to\n * customize how values are built — e.g. to construct them from the\n * intrinsics of a different realm (a `node:vm` context), or to build up\n * values inside another JavaScript runtime (a WASM-hosted engine, a remote\n * process) through handle objects.\n *\n * The object is frozen — it is shared by every `parse` call that does not\n * override a given operation.\n *\n */\n/** @type {import('./types.js').DefaultParseOperations} */\nconst parse_operations = {\n\tfromPrimitive: (primitive) => primitive,\n\n\tfromISOString: (iso) => new Date(iso),\n\n\tfromStringValue: (tag, text) => {\n\t\tif (tag === 'URL') return new URL(text);\n\t\tif (tag === 'URLSearchParams') return new URLSearchParams(text);\n\t\t// 'Temporal.Instant', 'Temporal.PlainDate', ...\n\t\t// @ts-expect-error TS doesn't know about Temporal yet\n\t\treturn Temporal[tag.slice(9)].from(text);\n\t},\n\n\tfromArrayBuffer: (buffer) => buffer,\n\n\tfromRegExpInfo: (source, flags) => new RegExp(source, flags),\n\n\tfromViewInfo: (tag, buffer, byteOffset, length) => {\n\t\t// A reviver can replace an ArrayBuffer with a length or array-like value,\n\t\t// which a typed array constructor would use to allocate a new buffer.\n\t\t// The native getters check internal slots, so they work across realms\n\t\t// and cannot be fooled by a forged prototype or Symbol.toStringTag.\n\t\ttry {\n\t\t\tarray_buffer_byte_length.call(buffer);\n\t\t} catch (error) {\n\t\t\tif (!shared_array_buffer_byte_length) throw error;\n\t\t\tshared_array_buffer_byte_length.call(buffer);\n\t\t}\n\n\t\tconst Constructor = /** @type {any} */ (globalThis)[tag];\n\t\treturn byteOffset !== undefined\n\t\t\t? new Constructor(buffer, byteOffset, length)\n\t\t\t: new Constructor(buffer);\n\t},\n\n\tbox: (value) => Object(value),\n\n\tcreateArray: (length) => new Array(length),\n\n\tcreateSparseArray: (length) => {\n\t\t/** @type {any[]} */\n\t\tconst array = [];\n\n\t\t// Setting `array.length = length` (or equivalently calling\n\t\t// `new Array(length)`) on an untrusted length is a DoS vector: V8\n\t\t// eagerly allocates a contiguous backing store for array lengths below\n\t\t// ~10^8, so a small payload with a huge declared length can force\n\t\t// arbitrary memory allocation. Touching the largest-possible index\n\t\t// first forces V8 into dictionary-elements mode, where `length` is\n\t\t// just a number and no contiguous allocation occurs.\n\t\tarray[MAX_ARRAY_INDEX] = undefined;\n\t\tdelete array[MAX_ARRAY_INDEX];\n\t\tarray.length = length;\n\n\t\treturn array;\n\t},\n\n\tcreateObject: () => ({}),\n\n\tcreateNullPrototypeObject: () => Object.create(null),\n\n\tcreateSet: () => new Set(),\n\n\tcreateMap: () => new Map(),\n\n\tset: (target, key, value) => {\n\t\ttarget[key] = value;\n\t},\n\n\taddValue: (set, value) => {\n\t\tset.add(value);\n\t},\n\n\taddEntry: (map, key, value) => {\n\t\tmap.set(key, value);\n\t}\n};\n\nexport const default_parse_operations = /* @__PURE__ */ Object.freeze(parse_operations);\n","import { decode64 } from './base64.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\nimport { default_parse_operations, merge_operations } from './operations.js';\nimport { is_valid_array_index, is_valid_array_len } from './utils.js';\n\n/**\n * Revive a value serialized with `devalue.stringify`\n * @param {string} serialized\n * @param {Record<string, (value: any) => any>} [revivers]\n * @param {import('./types.js').ParseOptions} [options]\n */\nexport function parse(serialized, revivers, options) {\n\treturn unflatten(JSON.parse(serialized), revivers, options);\n}\n\n/**\n * Revive a value flattened with `devalue.stringify`\n * @param {number | any[]} parsed\n * @param {Record<string, (value: any) => any>} [revivers]\n * @param {import('./types.js').ParseOptions} [options]\n */\nexport function unflatten(parsed, revivers, options) {\n\t/** @type {import('./types.js').ParseOperations} */\n\tconst ops = merge_operations(default_parse_operations, options?.operations);\n\n\tif (typeof parsed === 'number') return hydrate(parsed, true);\n\n\tif (!Array.isArray(parsed) || parsed.length === 0) {\n\t\tthrow new Error('Invalid input');\n\t}\n\n\tconst values = /** @type {any[]} */ (parsed);\n\n\tconst hydrated = Array(values.length);\n\n\t/**\n\t * A set of values currently being hydrated with custom revivers,\n\t * used to detect invalid cyclical dependencies\n\t * @type {Set<number> | null}\n\t */\n\tlet hydrating = null;\n\n\t/**\n\t * @param {number} index\n\t * @returns {any}\n\t */\n\tfunction hydrate(index, standalone = false) {\n\t\tif (index === UNDEFINED) return ops.fromPrimitive(undefined);\n\t\tif (index === NAN) return ops.fromPrimitive(NaN);\n\t\tif (index === POSITIVE_INFINITY) return ops.fromPrimitive(Infinity);\n\t\tif (index === NEGATIVE_INFINITY) return ops.fromPrimitive(-Infinity);\n\t\tif (index === NEGATIVE_ZERO) return ops.fromPrimitive(-0);\n\n\t\tif (standalone || typeof index !== 'number') {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tif (index in hydrated) return hydrated[index];\n\n\t\tif (index >= values.length) {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tconst value = values[index];\n\n\t\tif (!value || typeof value !== 'object') {\n\t\t\thydrated[index] = ops.fromPrimitive(value);\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (typeof value[0] === 'string') {\n\t\t\t\tconst type = value[0];\n\n\t\t\t\tconst reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined;\n\n\t\t\t\tif (reviver) {\n\t\t\t\t\tlet i = value[1];\n\t\t\t\t\tif (typeof i !== 'number') {\n\t\t\t\t\t\t// if it's not a number, it was serialized by a builtin reviver\n\t\t\t\t\t\t// so we need to munge it into the format expected by a custom reviver\n\t\t\t\t\t\ti = values.push(value[1]) - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the payload is already hydrated, its recursion has already\n\t\t\t\t\t// terminated (e.g. a self-referential object cached itself before\n\t\t\t\t\t// following its own back-reference), so revive it directly. Falling\n\t\t\t\t\t// through to the `hydrating` guard here would wrongly reject a valid\n\t\t\t\t\t// cycle. An actually infinite payload (e.g. `[[\"Custom\", 0]]`) is never\n\t\t\t\t\t// cached, so it still hits the guard below.\n\t\t\t\t\tif (Object.hasOwn(hydrated, i)) {\n\t\t\t\t\t\treturn (hydrated[index] = reviver(hydrated[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating ??= new Set();\n\n\t\t\t\t\tif (hydrating.has(i)) {\n\t\t\t\t\t\tthrow new Error('Invalid circular reference');\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating.add(i);\n\t\t\t\t\thydrated[index] = reviver(hydrate(i));\n\t\t\t\t\thydrating.delete(i);\n\n\t\t\t\t\treturn hydrated[index];\n\t\t\t\t}\n\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'Date':\n\t\t\t\t\t\thydrated[index] = ops.fromISOString(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Set':\n\t\t\t\t\t\tconst set = ops.createSet();\n\t\t\t\t\t\thydrated[index] = set;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 1) {\n\t\t\t\t\t\t\tops.addValue(set, hydrate(value[i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Map':\n\t\t\t\t\t\tconst map = ops.createMap();\n\t\t\t\t\t\thydrated[index] = map;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RegExp':\n\t\t\t\t\t\thydrated[index] = ops.fromRegExpInfo(value[1], value[2]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Object': {\n\t\t\t\t\t\tconst wrapped_index = value[1];\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof values[wrapped_index] === 'object' &&\n\t\t\t\t\t\t\tvalues[wrapped_index][0] !== 'BigInt'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// avoid infinite recusion in case of malformed input\n\t\t\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thydrated[index] = ops.box(hydrate(wrapped_index));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'BigInt':\n\t\t\t\t\t\thydrated[index] = ops.fromPrimitive(BigInt(value[1]));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'null':\n\t\t\t\t\t\tconst obj = ops.createNullPrototypeObject();\n\t\t\t\t\t\thydrated[index] = obj;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tconst key = value[i];\n\t\t\t\t\t\t\tif (typeof key !== 'string') {\n\t\t\t\t\t\t\t\tthrow new Error('Cannot parse an object with a non-string key');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tops.set(obj, key, hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Int8Array':\n\t\t\t\t\tcase 'Uint8Array':\n\t\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\t\tcase 'Int16Array':\n\t\t\t\t\tcase 'Uint16Array':\n\t\t\t\t\tcase 'Float16Array':\n\t\t\t\t\tcase 'Int32Array':\n\t\t\t\t\tcase 'Uint32Array':\n\t\t\t\t\tcase 'Float32Array':\n\t\t\t\t\tcase 'Float64Array':\n\t\t\t\t\tcase 'BigInt64Array':\n\t\t\t\t\tcase 'BigUint64Array':\n\t\t\t\t\tcase 'DataView': {\n\t\t\t\t\t\tif (values[value[1]][0] !== 'ArrayBuffer') {\n\t\t\t\t\t\t\t// without this, if we receive malformed input we could\n\t\t\t\t\t\t\t// end up trying to hydrate in a circle or allocate\n\t\t\t\t\t\t\t// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`\n\t\t\t\t\t\t\tthrow new Error('Invalid data');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst buffer = hydrate(value[1]);\n\n\t\t\t\t\t\thydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t\tconst base64 = value[1];\n\t\t\t\t\t\tif (typeof base64 !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('Invalid ArrayBuffer encoding');\n\t\t\t\t\t\t}\n\t\t\t\t\t\thydrated[index] = ops.fromArrayBuffer(decode64(base64));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URL':\n\t\t\t\t\tcase 'URLSearchParams':\n\t\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\t\tcase 'Temporal.ZonedDateTime': {\n\t\t\t\t\t\t// the same tags `toStringValue` serializes on the stringify side\n\t\t\t\t\t\thydrated[index] = ops.fromStringValue(type, value[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(`Unknown type ${type}`);\n\t\t\t\t}\n\t\t\t} else if (value[0] === SPARSE) {\n\t\t\t\t// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]\n\t\t\t\tconst len = value[1];\n\n\t\t\t\tif (!is_valid_array_len(len)) {\n\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t}\n\n\t\t\t\t// `len` comes from the input rather than being bounded by it, so\n\t\t\t\t// `createSparseArray` is responsible for not allocating storage\n\t\t\t\t// proportional to it.\n\t\t\t\tconst array = ops.createSparseArray(len);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 2; i < value.length; i += 2) {\n\t\t\t\t\tconst idx = value[i];\n\n\t\t\t\t\tif (!is_valid_array_index(idx) || idx >= len) {\n\t\t\t\t\t\tthrow new Error('Invalid input');\n\t\t\t\t\t}\n\n\t\t\t\t\tops.set(array, idx, hydrate(value[i + 1]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = ops.createArray(value.length);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\tconst n = value[i];\n\t\t\t\t\tif (n === HOLE) continue;\n\n\t\t\t\t\tops.set(array, i, hydrate(n));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst object = ops.createObject();\n\t\t\thydrated[index] = object;\n\n\t\t\tfor (const key of Object.keys(value)) {\n\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t}\n\n\t\t\t\tops.set(object, key, hydrate(value[key]));\n\t\t\t}\n\t\t}\n\n\t\treturn hydrated[index];\n\t}\n\n\treturn hydrate(0);\n}\n","/**\n * Removes nullish values from an array.\n *\n * @template T\n * @param {Array<T>} arr\n */\nexport function compact(arr) {\n\treturn arr.filter(/** @returns {val is NonNullable<T>} */ (val) => val != null);\n}\n","/** @import { Transport } from '@sveltejs/kit' */\nimport * as devalue from 'devalue';\nimport { base64_decode, base64_encode, text_encoder } from './utils.js';\n\n/**\n * @param {string} route_id\n * @param {string} dep\n */\nexport function validate_depends(route_id, dep) {\n\tconst match = /^(moz-icon|view-source|jar):/.exec(dep);\n\tif (match) {\n\t\tconsole.warn(\n\t\t\t`${route_id}: Calling \\`depends('${dep}')\\` will throw an error in Firefox because \\`${match[1]}\\` is a special URI scheme`\n\t\t);\n\t}\n}\n\nexport const INVALIDATED_PARAM = 'x-sveltekit-invalidated';\n\nexport const TRAILING_SLASH_PARAM = 'x-sveltekit-trailing-slash';\n\n/**\n * @param {any} data\n * @param {string} [location_description]\n */\nexport function validate_load_response(data, location_description) {\n\tif (data != null && Object.getPrototypeOf(data) !== Object.prototype) {\n\t\tthrow new Error(\n\t\t\t`a load function ${location_description} returned ${\n\t\t\t\ttypeof data !== 'object'\n\t\t\t\t\t? `a ${typeof data}`\n\t\t\t\t\t: data instanceof Response\n\t\t\t\t\t\t? 'a Response object'\n\t\t\t\t\t\t: Array.isArray(data)\n\t\t\t\t\t\t\t? 'an array'\n\t\t\t\t\t\t\t: 'a non-plain object'\n\t\t\t}, but must return a plain object at the top level (i.e. \\`return {...}\\`)`\n\t\t);\n\t}\n}\n\n/**\n * Try to `devalue.stringify` the data object using the provided transport encoders.\n * @param {any} data\n * @param {Transport} transport\n */\nexport function stringify(data, transport) {\n\tconst encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));\n\n\treturn devalue.stringify(data, encoders);\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype)\n\t.sort()\n\t.join('\\0');\n\n/**\n * @param {unknown} thing\n * @returns {thing is Record<PropertyKey, unknown>}\n */\nfunction is_plain_object(thing) {\n\tif (typeof thing !== 'object' || thing === null) return false;\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/**\n * @param {Record<string, any>} value\n * @param {Map<object, any>} clones\n */\nfunction to_sorted(value, clones) {\n\tconst clone = Object.getPrototypeOf(value) === null ? Object.create(null) : {};\n\tclones.set(value, clone);\n\tObject.defineProperty(clone, remote_arg_marker, { value: true });\n\n\tfor (const key of Object.keys(value).sort()) {\n\t\tconst property = value[key];\n\t\tObject.defineProperty(clone, key, {\n\t\t\tvalue: clones.get(property) ?? property,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t}\n\n\treturn clone;\n}\n\n// \"sveltekit remote arg\"\nconst remote_object = '__skrao';\nconst remote_map = '__skram';\nconst remote_set = '__skras';\nconst remote_file = '__skraf';\nconst remote_promise_guard = '__skrap';\nconst remote_regex_guard = '__skrag';\nconst remote_arg_marker = Symbol(remote_object);\n\n/**\n * @param {Transport} transport\n * @param {boolean} sort\n * @param {Map<any, any>} remote_arg_clones\n */\nfunction create_remote_arg_reducers(transport, sort, remote_arg_clones) {\n\t/** @type {Record<string, (value: unknown) => unknown>} */\n\tconst remote_fns_reducers = {\n\t\t/** @param {unknown} value */\n\t\t[remote_regex_guard]: (value) => {\n\t\t\tif (value instanceof RegExp) {\n\t\t\t\tthrow new Error('Regular expressions are not valid remote function arguments');\n\t\t\t}\n\t\t}\n\t};\n\n\tif (sort) {\n\t\t/** @type {(value: unknown) => Array<[unknown, unknown]> | undefined} */\n\t\tremote_fns_reducers[remote_map] = (value) => {\n\t\t\tif (!(value instanceof Map)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** @type {Array<[string, string]>} */\n\t\t\tconst entries = [];\n\n\t\t\tfor (const [key, val] of value) {\n\t\t\t\tentries.push([stringify(key), stringify(val)]);\n\t\t\t}\n\n\t\t\treturn entries.sort(([a1, a2], [b1, b2]) => {\n\t\t\t\tif (a1 < b1) return -1;\n\t\t\t\tif (a1 > b1) return 1;\n\t\t\t\tif (a2 < b2) return -1;\n\t\t\t\tif (a2 > b2) return 1;\n\t\t\t\treturn 0;\n\t\t\t});\n\t\t};\n\n\t\t/** @type {(value: unknown) => unknown[] | undefined} */\n\t\tremote_fns_reducers[remote_set] = (value) => {\n\t\t\tif (!(value instanceof Set)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** @type {string[]} */\n\t\t\tconst items = [];\n\n\t\t\tfor (const item of value) {\n\t\t\t\titems.push(stringify(item));\n\t\t\t}\n\n\t\t\titems.sort();\n\t\t\treturn items;\n\t\t};\n\n\t\t/** @type {(value: unknown) => Record<PropertyKey, unknown> | undefined} */\n\t\tremote_fns_reducers[remote_object] = (value) => {\n\t\t\tif (!is_plain_object(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Object.hasOwn(value, remote_arg_marker)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (remote_arg_clones.has(value)) {\n\t\t\t\treturn remote_arg_clones.get(value);\n\t\t\t}\n\n\t\t\treturn to_sorted(value, remote_arg_clones);\n\t\t};\n\t}\n\n\tconst user_reducers = Object.fromEntries(\n\t\tObject.entries(transport).map(([k, v]) => [k, v.encode])\n\t);\n\tconst all_reducers = { ...user_reducers, ...remote_fns_reducers };\n\n\t/** @type {(value: unknown) => string} */\n\tconst stringify = (value) => devalue.stringify(value, all_reducers);\n\n\treturn all_reducers;\n}\n\n/** @param {Transport} transport */\nfunction create_remote_arg_revivers(transport) {\n\tconst remote_fns_revivers = {\n\t\t/** @type {(value: unknown) => unknown} */\n\t\t[remote_object]: (value) => value,\n\t\t/** @type {(value: unknown) => Map<unknown, unknown>} */\n\t\t[remote_map]: (value) => {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new Error('Invalid data for Map reviver');\n\t\t\t}\n\n\t\t\tconst map = new Map();\n\n\t\t\tfor (const item of value) {\n\t\t\t\tif (\n\t\t\t\t\t!Array.isArray(item) ||\n\t\t\t\t\titem.length !== 2 ||\n\t\t\t\t\ttypeof item[0] !== 'string' ||\n\t\t\t\t\ttypeof item[1] !== 'string'\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error('Invalid data for Map reviver');\n\t\t\t\t}\n\t\t\t\tconst [key, val] = item;\n\t\t\t\tmap.set(parse(key), parse(val));\n\t\t\t}\n\n\t\t\treturn map;\n\t\t},\n\t\t/** @type {(value: unknown) => Set<unknown>} */\n\t\t[remote_set]: (value) => {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new Error('Invalid data for Set reviver');\n\t\t\t}\n\n\t\t\tconst set = new Set();\n\n\t\t\tfor (const item of value) {\n\t\t\t\tif (typeof item !== 'string') {\n\t\t\t\t\tthrow new Error('Invalid data for Set reviver');\n\t\t\t\t}\n\t\t\t\tset.add(parse(item));\n\t\t\t}\n\n\t\t\treturn set;\n\t\t},\n\t\t/** @type {(value: any) => File} */\n\t\t[remote_file]: (value) => {\n\t\t\tif (\n\t\t\t\t!value ||\n\t\t\t\ttypeof value !== 'object' ||\n\t\t\t\ttypeof value.name !== 'string' ||\n\t\t\t\ttypeof value.type !== 'string' ||\n\t\t\t\ttypeof value.size !== 'number' ||\n\t\t\t\ttypeof value.lastModified !== 'number' ||\n\t\t\t\t!(value.data instanceof ArrayBuffer)\n\t\t\t) {\n\t\t\t\tthrow new Error('Invalid data for File reviver');\n\t\t\t}\n\n\t\t\tconst { data, name, ...meta } = value;\n\n\t\t\treturn new File([data], name, meta);\n\t\t}\n\t};\n\n\tconst user_revivers = Object.fromEntries(\n\t\tObject.entries(transport).map(([k, v]) => [k, v.decode])\n\t);\n\n\tconst all_revivers = { ...user_revivers, ...remote_fns_revivers };\n\n\t/** @type {(data: string) => unknown} */\n\tconst parse = (data) => devalue.parse(data, all_revivers);\n\n\treturn all_revivers;\n}\n\n/**\n * Stringifies the argument (if any) for a remote function in such a way that\n * it is both a valid URL and a valid file name (necessary for prerendering).\n * @param {any} value\n * @param {Transport} transport\n */\nexport function stringify_remote_arg(value, transport) {\n\tif (value === undefined) return '';\n\n\t// If people hit file/url size limits, we can look into using something like compress_and_encode_text from svelte.dev beyond a certain size\n\tconst json = devalue.stringify(value, create_remote_arg_reducers(transport, true, new Map()));\n\n\treturn url_friendly_base64_encode(json);\n}\n\n/**\n * Stringifies command arguments, including `File` objects.\n * @param {any} value\n * @param {Transport} transport\n */\nexport async function stringify_command_arg(value, transport) {\n\tif (value === undefined) return '';\n\n\tconst reducers = create_remote_arg_reducers(transport, false, new Map());\n\n\t/** @type {Set<Promise<any>>} */\n\tconst allowed_promises = new Set();\n\n\t/** @param {any} value */\n\treducers[remote_file] = (value) => {\n\t\tif (value instanceof File) {\n\t\t\tconst promise = value.arrayBuffer().then((data) => ({\n\t\t\t\tdata,\n\t\t\t\tlastModified: value.lastModified,\n\t\t\t\tname: value.name,\n\t\t\t\tsize: value.size,\n\t\t\t\ttype: value.type\n\t\t\t}));\n\n\t\t\tallowed_promises.add(promise);\n\n\t\t\treturn promise;\n\t\t}\n\t};\n\n\t// we don't want to allow arbitrary promises, because they won't\n\t// show up as promises on the other side. this is something\n\t// we could potentially change in future. stringifyAsync\n\t// will await them, so we need to explicitly deny them\n\t/** @param {unknown} value */\n\treducers[remote_promise_guard] = (value) => {\n\t\tif (value instanceof Promise && !allowed_promises.has(value)) {\n\t\t\tthrow new Error('Promises are not valid remote function arguments');\n\t\t}\n\t};\n\n\tconst json = await devalue.stringifyAsync(value, reducers);\n\n\treturn url_friendly_base64_encode(json);\n}\n\n/**\n * Base64-encodes `string` in such a way that the result is safe to use\n * as both a URI component and a filename\n * @param {string} string\n */\nfunction url_friendly_base64_encode(string) {\n\tconst bytes = text_encoder.encode(string);\n\treturn base64_encode(bytes).replaceAll('=', '').replaceAll('+', '-').replaceAll('/', '_');\n}\n\n/**\n * Parses the argument (if any) for a remote function\n * @param {string} string\n * @param {Transport} transport\n */\nexport function parse_remote_arg(string, transport) {\n\tif (!string) return undefined;\n\n\tconst json_string = new TextDecoder().decode(\n\t\t// no need to add back `=` characters, atob can handle it\n\t\tbase64_decode(string.replaceAll('-', '+').replaceAll('_', '/'))\n\t);\n\n\treturn devalue.parse(json_string, create_remote_arg_revivers(transport));\n}\n\n/**\n * @param {string} id\n * @param {string} payload\n */\nexport function create_remote_key(id, payload) {\n\treturn id + '/' + payload;\n}\n\n/**\n * @param {string} key\n * @returns {{ id: string; payload: string }}\n */\nexport function split_remote_key(key) {\n\tconst i = key.lastIndexOf('/');\n\n\tif (i === -1) {\n\t\tthrow new Error(`Invalid remote key: ${key}`);\n\t}\n\n\treturn {\n\t\tid: key.slice(0, i),\n\t\tpayload: key.slice(i + 1)\n\t};\n}\n","import { HttpError, SvelteKitError } from '@sveltejs/kit/internal';\n\n/**\n * For times when you need to throw an error, but without\n * displaying a useless stack trace (since the developer\n * can't do anything useful with it)\n * @param {string} message\n */\nexport function stackless(message) {\n\tconst error = new Error(message);\n\terror.stack = '';\n\treturn error;\n}\n\n/**\n * @param {unknown} err\n * @return {Error}\n */\nexport function coalesce_to_error(err) {\n\treturn err instanceof Error ||\n\t\t(err && /** @type {any} */ (err).name && /** @type {any} */ (err).message)\n\t\t? /** @type {Error} */ (err)\n\t\t: new Error(JSON.stringify(err));\n}\n\n/**\n * This is an identity function that exists to make TypeScript less\n * paranoid about people throwing things that aren't errors, which\n * frankly is not something we should care about\n * @param {unknown} error\n */\nexport function normalize_error(error) {\n\treturn /** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */ (\n\t\terror\n\t);\n}\n\n/**\n * @param {unknown} error\n */\nexport function get_status(error) {\n\treturn error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;\n}\n\n/**\n * @param {unknown} error\n */\nexport function get_message(error) {\n\treturn error instanceof SvelteKitError ? error.text : 'Internal Error';\n}\n","const DATA_SUFFIX = '/__data.json';\nconst HTML_DATA_SUFFIX = '.html__data.json';\n\n/** @param {string} pathname */\nexport function has_data_suffix(pathname) {\n\treturn pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);\n}\n\n/** @param {string} pathname */\nexport function add_data_suffix(pathname) {\n\tif (pathname.endsWith('.html')) return pathname.replace(/\\.html$/, HTML_DATA_SUFFIX);\n\treturn pathname.replace(/\\/$/, '') + DATA_SUFFIX;\n}\n\n/** @param {string} pathname */\nexport function strip_data_suffix(pathname) {\n\tif (pathname.endsWith(HTML_DATA_SUFFIX)) {\n\t\treturn pathname.slice(0, -HTML_DATA_SUFFIX.length) + '.html';\n\t}\n\n\treturn pathname.slice(0, -DATA_SUFFIX.length);\n}\n\nconst ROUTE_SUFFIX = '/__route.js';\n\n/**\n * @param {string} pathname\n * @returns {boolean}\n */\nexport function has_resolution_suffix(pathname) {\n\treturn pathname.endsWith(ROUTE_SUFFIX);\n}\n\n/**\n * Convert a regular URL to a route to send to SvelteKit's server-side route resolution endpoint\n * @param {string} pathname\n * @returns {string}\n */\nexport function add_resolution_suffix(pathname) {\n\treturn pathname.replace(/\\/$/, '') + ROUTE_SUFFIX;\n}\n\n/**\n * @param {string} pathname\n * @returns {string}\n */\nexport function strip_resolution_suffix(pathname) {\n\treturn pathname.slice(0, -ROUTE_SUFFIX.length);\n}\n","/** @import { Tracer, Span, SpanContext } from '@opentelemetry/api' */\n\n/**\n * Tracer implementation that does nothing (null object).\n * @type {Tracer}\n */\nexport const noop_tracer = {\n\t/**\n\t * @returns {Span}\n\t */\n\tstartSpan() {\n\t\treturn noop_span;\n\t},\n\n\t/**\n\t * @param {unknown} _name\n\t * @param {unknown} arg_1\n\t * @param {unknown} [arg_2]\n\t * @param {Function} [arg_3]\n\t * @returns {unknown}\n\t */\n\tstartActiveSpan(_name, arg_1, arg_2, arg_3) {\n\t\tif (typeof arg_1 === 'function') {\n\t\t\treturn arg_1(noop_span);\n\t\t}\n\t\tif (typeof arg_2 === 'function') {\n\t\t\treturn arg_2(noop_span);\n\t\t}\n\t\tif (typeof arg_3 === 'function') {\n\t\t\treturn arg_3(noop_span);\n\t\t}\n\t}\n};\n\n/**\n * @type {Span}\n */\nexport const noop_span = {\n\tspanContext() {\n\t\treturn noop_span_context;\n\t},\n\tsetAttribute() {\n\t\treturn this;\n\t},\n\tsetAttributes() {\n\t\treturn this;\n\t},\n\taddEvent() {\n\t\treturn this;\n\t},\n\tsetStatus() {\n\t\treturn this;\n\t},\n\tupdateName() {\n\t\treturn this;\n\t},\n\tend() {\n\t\treturn this;\n\t},\n\tisRecording() {\n\t\treturn false;\n\t},\n\trecordException() {\n\t\treturn this;\n\t},\n\taddLink() {\n\t\treturn this;\n\t},\n\taddLinks() {\n\t\treturn this;\n\t}\n};\n\n/**\n * @type {SpanContext}\n */\nconst noop_span_context = {\n\ttraceId: '',\n\tspanId: '',\n\ttraceFlags: 0\n};\n","/**\n * Reads from a stream, decoding it as text and yielding each block of content\n * separated by `delimiter`. The trailing block (if any) is yielded once the\n * stream closes.\n * @param {ReadableStreamDefaultReader<Uint8Array>} reader\n * @param {string} delimiter\n */\nexport async function* read_stream(reader, delimiter) {\n\tlet done = false;\n\tlet buffer = '';\n\tconst decoder = new TextDecoder();\n\n\twhile (true) {\n\t\tlet split = buffer.indexOf(delimiter);\n\t\twhile (split !== -1) {\n\t\t\tyield buffer.slice(0, split);\n\t\t\tbuffer = buffer.slice(split + delimiter.length);\n\t\t\tsplit = buffer.indexOf(delimiter);\n\t\t}\n\n\t\tif (done) {\n\t\t\tif (buffer) {\n\t\t\t\tyield buffer;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst chunk = await reader.read();\n\t\tdone = chunk.done;\n\t\tif (chunk.value) {\n\t\t\tbuffer += decoder.decode(chunk.value, { stream: true });\n\t\t}\n\n\t\tif (done) {\n\t\t\tbuffer += decoder.decode();\n\t\t}\n\t}\n}\n","import { read_stream } from './stream.js';\n\n/**\n * Yields parsed JSON objects from a ReadableStream of newline-delimited JSON.\n * Each yielded value is the raw `JSON.parse`'d object — callers handle deserialization.\n * @param {ReadableStreamDefaultReader<Uint8Array>} reader\n */\nexport async function* read_ndjson(reader) {\n\tfor await (const block of read_stream(reader, '\\n')) {\n\t\tconst line = block.trim();\n\t\tif (line) {\n\t\t\tyield JSON.parse(line);\n\t\t}\n\t}\n}\n","/** @import { RemoteFunctionDataNode, ServerNodesResponse, ServerRedirectNode } from 'types' */\n/** @import { CacheEntry } from './remote-functions/cache.svelte.js' */\n/** @import { Query } from './remote-functions/query/instance.svelte.js' */\n/** @import { LiveQuery } from './remote-functions/query-live/instance.svelte.js' */\nimport { BROWSER, DEV } from 'esm-env';\nimport * as svelte from 'svelte';\nimport { HttpError, Redirect, SvelteKitError } from '@sveltejs/kit/internal';\nconst { onMount, tick } = svelte;\n// Svelte 4 and under don't have `untrack`, so we have to fallback if `untrack` is not exported\nconst untrack = svelte.untrack ?? ((value) => value());\nimport {\n\tdecode_params,\n\tdecode_pathname,\n\tstrip_hash,\n\tmake_trackable,\n\tnormalize_path\n} from '../../utils/url.js';\nimport { dev_fetch, initial_fetch, lock_fetch, subsequent_fetch, unlock_fetch } from './fetcher.js';\nimport { parse, parse_server_route } from './parse.js';\nimport * as storage from './session-storage.js';\nimport {\n\tfind_anchor,\n\tresolve_url,\n\tget_link_info,\n\tget_router_options,\n\tis_external_url,\n\torigin,\n\tscroll_state,\n\tnotifiable_store,\n\tcreate_updated_store,\n\tload_css\n} from './utils.js';\nimport { base } from '$app/paths';\nimport * as devalue from 'devalue';\nimport {\n\tHISTORY_INDEX,\n\tNAVIGATION_INDEX,\n\tPRELOAD_PRIORITIES,\n\tSCROLL_KEY,\n\tSTATES_KEY,\n\tSNAPSHOT_KEY,\n\tPAGE_URL_KEY\n} from './constants.js';\nimport { validate_page_exports } from '../../utils/exports.js';\nimport { noop } from '../../utils/functions.js';\nimport { compact } from '../../utils/array.js';\nimport {\n\tINVALIDATED_PARAM,\n\tTRAILING_SLASH_PARAM,\n\tcreate_remote_key,\n\tvalidate_depends,\n\tvalidate_load_response\n} from '../shared.js';\nimport { get_message, get_status } from '../../utils/error.js';\nimport { writable } from 'svelte/store';\nimport { page, update, navigating } from './state.svelte.js';\nimport { add_data_suffix, add_resolution_suffix } from '../pathname.js';\nimport { noop_span } from '../telemetry/noop.js';\nimport { read_ndjson } from './ndjson.js';\n\nexport { load_css };\nconst ICON_REL_ATTRIBUTES = new Set(['icon', 'shortcut icon', 'apple-touch-icon']);\n\nlet errored = false;\n/**\n * Set via transformError, reset and read at the end of navigate.\n * Necessary because a navigation might succeed loading but during rendering\n * an error occurs, at which point the navigation result needs to be overridden with the error result.\n * TODO this is all very hacky, rethink for SvelteKit 3 where we can assume Svelte 5 and do an overhaul of client.js\n * @type {{ error: App.Error, status: number } | null}\n */\nlet rendering_error = null;\n\n// We track the scroll position associated with each history entry in sessionStorage,\n// rather than on history.state itself, because when navigation is driven by\n// popstate it's too late to update the scroll position associated with the\n// state we're navigating from\n/**\n * history index -> { x, y }\n * @type {Record<number, { x: number; y: number }>}\n */\nconst scroll_positions = storage.get(SCROLL_KEY) ?? {};\n\n/**\n * navigation index -> any\n * @type {Record<string, any[]>}\n */\nconst snapshots = storage.get(SNAPSHOT_KEY) ?? {};\n\nif (DEV && BROWSER) {\n\tlet warned = false;\n\n\tconst warn = () => {\n\t\tif (warned) return;\n\n\t\t// Rather than saving a pointer to the original history methods, which would prevent monkeypatching by other libs,\n\t\t// inspect the stack trace to see if we're being called from within SvelteKit.\n\t\tlet stack = new Error().stack?.split('\\n');\n\t\tif (!stack) return;\n\t\tif (!stack[0].includes('https:') && !stack[0].includes('http:')) stack = stack.slice(1); // Chrome includes the error message in the stack\n\n\t\t// skip over `warn` and the place where `warn` was called\n\t\tconst frame = stack[2];\n\n\t\t// ignore calls that happen inside dependencies, including SvelteKit.\n\t\t// `frame` can be falsy if we came from an anonymous function\n\t\tif (frame?.includes('node_modules')) return;\n\n\t\twarned = true;\n\n\t\tconsole.warn(\n\t\t\t\"Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead.\"\n\t\t);\n\t};\n\n\tconst push_state = history.pushState;\n\thistory.pushState = (...args) => {\n\t\twarn();\n\t\treturn push_state.apply(history, args);\n\t};\n\n\tconst replace_state = history.replaceState;\n\thistory.replaceState = (...args) => {\n\t\twarn();\n\t\treturn replace_state.apply(history, args);\n\t};\n}\n\nexport const stores = {\n\turl: /* @__PURE__ */ notifiable_store({}),\n\tpage: /* @__PURE__ */ notifiable_store({}),\n\tnavigating: /* @__PURE__ */ writable(\n\t\t/** @type {import('@sveltejs/kit').Navigation | null} */ (null)\n\t),\n\tupdated: /* @__PURE__ */ create_updated_store()\n};\n\n/** @param {number} index */\nfunction update_scroll_positions(index) {\n\tscroll_positions[index] = scroll_state();\n}\n\n/**\n * @param {number} current_history_index\n * @param {number} current_navigation_index\n */\nfunction clear_onward_history(current_history_index, current_navigation_index) {\n\t// if we navigated back, then pushed a new state, we can\n\t// release memory by pruning the scroll/snapshot lookup\n\tlet i = current_history_index + 1;\n\twhile (scroll_positions[i]) {\n\t\tdelete scroll_positions[i];\n\t\ti += 1;\n\t}\n\n\ti = current_navigation_index + 1;\n\twhile (snapshots[i]) {\n\t\tdelete snapshots[i];\n\t\ti += 1;\n\t}\n}\n\n/**\n * Loads `href` the old-fashioned way, with a full page reload.\n * Returns a `Promise` that never resolves (to prevent any\n * subsequent work, e.g. history manipulation, from happening)\n * @param {URL} url\n * @param {boolean} [replace] if `true`, will replace the current `history` entry rather than creating a new one with `pushState`\n * @returns {Promise<any>} a promise that never resolves\n */\nfunction native_navigation(url, replace = false) {\n\tif (replace) {\n\t\tlocation.replace(url.href);\n\t} else {\n\t\tlocation.href = url.href;\n\t}\n\treturn new Promise(noop);\n}\n\n/**\n * Checks whether a service worker is registered, and if it is,\n * tries to update it.\n */\nasync function update_service_worker() {\n\tif ('serviceWorker' in navigator) {\n\t\tconst registration = await navigator.serviceWorker.getRegistration(base || '/');\n\t\tif (registration) {\n\t\t\tawait registration.update();\n\t\t}\n\t}\n}\n\n/** @type {import('types').CSRRoute[]} All routes of the app. Only available when kit.router.resolution=client */\nlet routes;\n/** @type {import('types').CSRPageNodeLoader} */\nlet default_layout_loader;\n/** @type {import('types').CSRPageNodeLoader} */\nlet default_error_loader;\n/** @type {HTMLElement} */\nlet container;\n/** @type {HTMLElement} */\nlet target;\n\n/** @type {import('./types.js').SvelteKitApp} */\nexport let app;\n\n/**\n * Data that was serialized during SSR for queries/forms/commands, stored as\n * `{ v }` (value) or `{ e }` (error) nodes so that failed states survive hydration.\n * Entries are deleted as they are consumed (when the corresponding resource is created).\n * @type {Record<string, RemoteFunctionDataNode>}\n */\nexport const query_responses = {};\n\n/**\n * Data that was serialized during SSR for prerender functions, stored as\n * `{ v }` (value) or `{ e }` (error) nodes.\n * This persists across client-side navigations.\n * @type {Record<string, RemoteFunctionDataNode>}\n */\nexport const prerender_responses = {};\n\n/** @type {Array<((url: URL) => boolean)>} */\nconst invalidated = [];\n\n/**\n * An array of the `+layout.svelte` and `+page.svelte` component instances\n * that currently live on the page — used for capturing and restoring snapshots.\n * It's updated/manipulated through `bind:this` in `Root.svelte`.\n * @type {import('svelte').SvelteComponent[]}\n */\nconst components = [];\n\n/** @type {{id: string, token: {}, promise: Promise<import('./types.js').NavigationResult>, fork: Promise<import('svelte').Fork | null> | null} | null} */\nlet load_cache = null;\n\nfunction discard_load_cache() {\n\tvoid load_cache?.fork?.then((f) => f?.discard());\n\tload_cache = null;\n\tcurrent_a = { element: undefined, href: undefined };\n}\n\n/**\n * @type {Map<string, Promise<URL>>}\n * Cache for client-side rerouting, since it could contain async calls which we want to\n * avoid running multiple times which would slow down navigations (e.g. else preloading\n * wouldn't help because on navigation it would be called again). Since `reroute` should be\n * a pure function (i.e. always return the same) value it's safe to cache across navigations.\n * The server reroute calls don't need to be cached because they are called using `import(...)`\n * which is cached per the JS spec.\n */\nconst reroute_cache = new Map();\n\n/**\n * Note on before_navigate_callbacks, on_navigate_callbacks and after_navigate_callbacks:\n * do not re-assign as some closures keep references to these Sets\n */\n/** @type {Set<(navigation: import('@sveltejs/kit').BeforeNavigate) => void>} */\nconst before_navigate_callbacks = new Set();\n\n/** @type {Set<(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>>} */\nconst on_navigate_callbacks = new Set();\n\n/** @type {Set<(navigation: import('@sveltejs/kit').AfterNavigate) => void>} */\nconst after_navigate_callbacks = new Set();\n\n/** @type {import('./types.js').NavigationState & { nav: import('@sveltejs/kit').NavigationEvent }} */\nlet current = {\n\tbranch: [],\n\terror: null,\n\t// @ts-ignore - we need the initial value to be null\n\turl: null,\n\t// @ts-ignore - we need the initial value to be null\n\tnav: null\n};\n\n/** this being true means we SSR'd */\nlet hydrated = false;\nlet started = false;\nlet autoscroll = true;\nlet updating = false;\nlet is_navigating = false;\nlet hash_navigating = false;\n/** True as soon as there happened one client-side navigation (excluding the SvelteKit-initialized initial one when in SPA mode) */\nlet has_navigated = false;\n\nlet force_invalidation = false;\n\n/** @type {import('svelte').SvelteComponent} */\nlet root;\n\n/** @type {number} keeping track of the history index in order to prevent popstate navigation events if needed */\nlet current_history_index;\n\n/** @type {number} */\nlet current_navigation_index;\n\n/** @type {{}} */\nlet token;\n\n/**\n * A set of tokens which are associated to current preloads.\n * If a preload becomes a real navigation, it's removed from the set.\n * If a preload token is in the set and the preload errors, the error\n * handling logic (for example reloading) is skipped.\n */\n/** @type {Set<{}>} */\nconst preload_tokens = new Set();\n\n/** @type {Promise<void> | null} */\nexport let pending_invalidate;\n\n/**\n * @type {Map<string, Map<string, CacheEntry<Query<any>>>>}\n * A map of query id -> payload -> query internals for all active queries.\n */\nexport const query_map = new Map();\n\n/**\n * @type {Map<string, Map<string, CacheEntry<LiveQuery<any>>>>}\n * A map of id -> payload -> live query internals for all active queries.\n */\nexport const live_query_map = new Map();\n\n/**\n * @param {import('./types.js').SvelteKitApp} _app\n * @param {HTMLElement} _target\n * @param {Parameters<typeof _hydrate>[1]} [hydrate]\n */\nexport async function start(_app, _target, hydrate) {\n\tif (DEV && _target === document.body) {\n\t\tconsole.warn(\n\t\t\t'Placing %sveltekit.body% directly inside <body> is not recommended, as your app may break for users who have certain browser extensions installed.\\n\\nConsider wrapping it in an element:\\n\\n<div style=\"display: contents\">\\n %sveltekit.body%\\n</div>'\n\t\t);\n\t}\n\n\tif (__SVELTEKIT_PAYLOAD__.data) {\n\t\tconst { q = {}, p = {}, l = {}, f = {} } = __SVELTEKIT_PAYLOAD__.data;\n\n\t\t// store the whole nodes — error records seed the corresponding\n\t\t// resources in a failed state when they are created during hydration\n\t\tfor (const k in q) query_responses[k] = q[k];\n\t\tfor (const k in l) query_responses[k] = l[k];\n\t\tfor (const k in f) query_responses[k] = f[k];\n\t\tfor (const k in p) prerender_responses[k] = p[k];\n\t}\n\n\t// detect basic auth credentials in the current URL\n\t// https://github.com/sveltejs/kit/pull/11179\n\t// if so, refresh the page without credentials\n\tif (document.URL !== location.href) {\n\t\t// eslint-disable-next-line no-self-assign\n\t\tlocation.href = location.href;\n\t}\n\n\tapp = _app;\n\n\tawait _app.hooks.init?.();\n\n\troutes = __SVELTEKIT_CLIENT_ROUTING__ ? parse(_app) : [];\n\tcontainer = __SVELTEKIT_EMBEDDED__ ? _target : document.documentElement;\n\ttarget = _target;\n\n\t// we import the root layout/error nodes eagerly, so that\n\t// connectivity errors after initialisation don't nuke the app\n\tdefault_layout_loader = _app.nodes[0];\n\tdefault_error_loader = _app.nodes[1];\n\tvoid default_layout_loader();\n\tvoid default_error_loader();\n\n\tcurrent_history_index = history.state?.[HISTORY_INDEX];\n\tcurrent_navigation_index = history.state?.[NAVIGATION_INDEX];\n\n\tif (!current_history_index) {\n\t\t// we use Date.now() as an offset so that cross-document navigations\n\t\t// within the app don't result in data loss\n\t\tcurrent_history_index = current_navigation_index = Date.now();\n\n\t\t// create initial history entry, so we can return here\n\t\thistory.replaceState(\n\t\t\t{\n\t\t\t\t...history.state,\n\t\t\t\t[HISTORY_INDEX]: current_history_index,\n\t\t\t\t[NAVIGATION_INDEX]: current_navigation_index\n\t\t\t},\n\t\t\t''\n\t\t);\n\t}\n\n\t// if we reload the page, or Cmd-Shift-T back to it,\n\t// recover scroll position\n\tconst scroll = scroll_positions[current_history_index];\n\tfunction restore_scroll() {\n\t\tif (scroll) {\n\t\t\thistory.scrollRestoration = 'manual';\n\t\t\tscrollTo(scroll.x, scroll.y);\n\t\t}\n\t}\n\n\tif (hydrate) {\n\t\trestore_scroll();\n\n\t\tawait _hydrate(target, hydrate);\n\t} else {\n\t\tawait navigate({\n\t\t\ttype: 'enter',\n\t\t\turl: resolve_url(app.hash ? decode_hash(new URL(location.href)) : location.href),\n\t\t\treplace_state: true\n\t\t});\n\n\t\trestore_scroll();\n\t}\n\n\t_start_router();\n}\n\nasync function _invalidate(include_load_functions = true, reset_page_state = true) {\n\t// Accept all invalidations as they come, don't swallow any while another invalidation\n\t// is running because subsequent invalidations may make earlier ones outdated,\n\t// but batch multiple synchronous invalidations.\n\tawait (pending_invalidate ||= Promise.resolve());\n\tif (!pending_invalidate) return;\n\tpending_invalidate = null;\n\n\tconst nav_token = (token = {});\n\tconst intent = await get_navigation_intent(current.url, true);\n\n\t// Clear preload, it might be affected by the invalidation.\n\t// Also solves an edge case where a preload is triggered, the navigation for it\n\t// was then triggered and is still running while the invalidation kicks in,\n\t// at which point the invalidation should take over and \"win\".\n\tdiscard_load_cache();\n\n\t// Rerun queries\n\t/** @type {Map<string, Promise<void>>} */\n\tconst live_query_reconnects = new Map();\n\tif (force_invalidation) {\n\t\tfor (const entries of query_map.values()) {\n\t\t\tfor (const { resource } of entries.values()) {\n\t\t\t\tvoid resource.refresh();\n\t\t\t}\n\t\t}\n\n\t\tfor (const [query_id, entries] of live_query_map) {\n\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\tconst key = create_remote_key(query_id, payload);\n\t\t\t\tconst promise = resource.reconnect();\n\t\t\t\tpromise.catch(noop);\n\t\t\t\tlive_query_reconnects.set(key, promise);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (include_load_functions) {\n\t\tconst prev_state = page.state;\n\t\tconst navigation_result = intent && (await load_route(intent));\n\t\tif (!navigation_result || nav_token !== token) return;\n\n\t\tif (navigation_result.type === 'redirect') {\n\t\t\treturn _goto(\n\t\t\t\tnew URL(navigation_result.location, current.url).href,\n\t\t\t\t{ replaceState: true },\n\t\t\t\t1,\n\t\t\t\tnav_token\n\t\t\t);\n\t\t}\n\n\t\t// This is a bit hacky but allows us not having to pass that boolean around, making things harder to reason about\n\t\tif (!reset_page_state) {\n\t\t\tnavigation_result.props.page.state = prev_state;\n\t\t}\n\t\tupdate(navigation_result.props.page);\n\t\tcurrent = { ...navigation_result.state, nav: current.nav };\n\t\treset_invalidation();\n\t\troot.$set(navigation_result.props);\n\t} else {\n\t\treset_invalidation();\n\t}\n\n\t// only wait for promises that are connected to queries that still exist\n\t/** @type {Promise<any>[]} */\n\tconst promises = [];\n\tfor (const entries of query_map.values()) {\n\t\tfor (const { resource } of entries.values()) {\n\t\t\tpromises.push(resource);\n\t\t}\n\t}\n\tfor (const [query_id, entries] of live_query_map) {\n\t\tfor (const payload of entries.keys()) {\n\t\t\tconst key = create_remote_key(query_id, payload);\n\t\t\tconst promise = live_query_reconnects.get(key);\n\t\t\tif (promise) {\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Don't use allSettled yet because it's too new\n\tawait Promise.all(promises).catch(noop);\n}\n\nfunction reset_invalidation() {\n\tinvalidated.length = 0;\n\tforce_invalidation = false;\n}\n\n/** @param {number} index */\nfunction capture_snapshot(index) {\n\tif (components.some((c) => c?.snapshot)) {\n\t\tsnapshots[index] = components.map((c) => c?.snapshot?.capture());\n\t}\n}\n\n/** @param {number} index */\nfunction restore_snapshot(index) {\n\tsnapshots[index]?.forEach((value, i) => {\n\t\tcomponents[i]?.snapshot?.restore(value);\n\t});\n}\n\nfunction persist_state() {\n\tupdate_scroll_positions(current_history_index);\n\tstorage.set(SCROLL_KEY, scroll_positions);\n\n\tcapture_snapshot(current_navigation_index);\n\tstorage.set(SNAPSHOT_KEY, snapshots);\n}\n\n/**\n * @param {string | URL} url\n * @param {{ replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; invalidate?: Array<string | URL | ((url: URL) => boolean)>; state?: Record<string, any> }} options\n * @param {number} redirect_count\n * @param {{}} [nav_token]\n * @returns {Promise<void>}\n */\nexport async function _goto(url, options, redirect_count, nav_token) {\n\t/** @type {Set<string>} */\n\tlet query_keys;\n\t/** @type {Set<string>} */\n\tlet live_query_keys;\n\n\t// Clear preload cache when invalidateAll is true to ensure fresh data\n\t// after form submissions or explicit invalidations\n\tif (options.invalidateAll) {\n\t\tdiscard_load_cache();\n\t}\n\n\tawait navigate({\n\t\ttype: 'goto',\n\t\turl: resolve_url(url),\n\t\tkeepfocus: options.keepFocus,\n\t\tnoscroll: options.noScroll,\n\t\treplace_state: options.replaceState,\n\t\tstate: options.state,\n\t\tredirect_count,\n\t\tnav_token,\n\t\taccept: () => {\n\t\t\tif (options.invalidateAll) {\n\t\t\t\tforce_invalidation = true;\n\t\t\t\tquery_keys = new Set();\n\t\t\t\tfor (const [id, entries] of query_map) {\n\t\t\t\t\tfor (const [payload, entry] of entries) {\n\t\t\t\t\t\t// don't refresh yet, as some queries will be unrendered,\n\t\t\t\t\t\t// but clear caches so that newly rendered queries\n\t\t\t\t\t\t// don't use stale data. TODO same for `live_query_map`\n\t\t\t\t\t\tentry.resource?.reset();\n\t\t\t\t\t\tquery_keys.add(create_remote_key(id, payload));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlive_query_keys = new Set();\n\t\t\t\tfor (const [id, entries] of live_query_map) {\n\t\t\t\t\tfor (const payload of entries.keys()) {\n\t\t\t\t\t\tlive_query_keys.add(create_remote_key(id, payload));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.invalidate) {\n\t\t\t\toptions.invalidate.forEach(push_invalidated);\n\t\t\t}\n\t\t}\n\t});\n\n\tif (options.invalidateAll) {\n\t\t// TODO the ticks shouldn't be necessary, something inside Svelte itself is buggy\n\t\t// when a query in a layout that still exists after page change is refreshed earlier than this\n\t\tvoid svelte\n\t\t\t.tick()\n\t\t\t.then(svelte.tick)\n\t\t\t.then(() => {\n\t\t\t\tfor (const [id, entries] of query_map) {\n\t\t\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\t\t\tif (query_keys?.has(create_remote_key(id, payload))) {\n\t\t\t\t\t\t\tvoid resource.start();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const [id, entries] of live_query_map) {\n\t\t\t\t\tfor (const [payload, { resource }] of entries) {\n\t\t\t\t\t\tif (live_query_keys?.has(create_remote_key(id, payload))) {\n\t\t\t\t\t\t\tvoid resource.reconnect();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t}\n}\n\n/** @param {import('./types.js').NavigationIntent} intent */\nasync function _preload_data(intent) {\n\t// Reuse the existing pending preload if it's for the same navigation.\n\t// Prevents an edge case where same preload is triggered multiple times,\n\t// then a later one is becoming the real navigation and the preload tokens\n\t// get out of sync.\n\tif (intent.id !== load_cache?.id) {\n\t\tdiscard_load_cache();\n\n\t\tconst preload = {};\n\t\tpreload_tokens.add(preload);\n\t\tload_cache = {\n\t\t\tid: intent.id,\n\t\t\ttoken: preload,\n\t\t\tpromise: load_route({ ...intent, preload }).then((result) => {\n\t\t\t\tpreload_tokens.delete(preload);\n\t\t\t\tif (result.type === 'loaded' && result.state.error) {\n\t\t\t\t\t// Don't cache errors, because they might be transient\n\t\t\t\t\tdiscard_load_cache();\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}),\n\t\t\tfork: null\n\t\t};\n\n\t\tif (__SVELTEKIT_FORK_PRELOADS__ && svelte.fork) {\n\t\t\tconst lc = load_cache;\n\n\t\t\tlc.fork = lc.promise.then((result) => {\n\t\t\t\t// if load_cache was discarded before load_cache.promise could\n\t\t\t\t// resolve, bail rather than creating an orphan fork\n\t\t\t\tif (lc === load_cache && result.type === 'loaded') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn svelte.fork(() => {\n\t\t\t\t\t\t\troot.$set(result.props);\n\t\t\t\t\t\t\tupdate(result.props.page);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// if it errors, it's because the experimental flag isn't enabled in Svelte\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t});\n\t\t}\n\t}\n\n\treturn load_cache.promise;\n}\n\n/**\n * @param {URL} url\n * @returns {Promise<void>}\n */\nasync function _preload_code(url) {\n\tconst route = (await get_navigation_intent(url, false))?.route;\n\n\tif (route) {\n\t\tawait Promise.all(\n\t\t\t/** @type {[has_server_load: boolean, node_loader: import('types').CSRPageNodeLoader][]} */ (\n\t\t\t\t[...route.layouts, route.leaf].filter(Boolean)\n\t\t\t).map((load) => load[1]())\n\t\t);\n\t}\n}\n\n/**\n * @param {import('./types.js').NavigationFinished} result\n * @param {HTMLElement} target\n * @param {boolean} hydrate\n */\nasync function initialize(result, target, hydrate) {\n\tif (__SVELTEKIT_DEV__ && result.state.error && document.querySelector('vite-error-overlay'))\n\t\treturn;\n\n\t/** @type {import('@sveltejs/kit').NavigationEvent} */\n\tconst nav = {\n\t\tparams: current.params,\n\t\troute: { id: current.route?.id ?? null },\n\t\turl: new URL(location.href)\n\t};\n\n\tcurrent = {\n\t\t...result.state,\n\t\tnav\n\t};\n\n\t// Removes the style node we used to avoid FOUC during development\n\tif (__SVELTEKIT_DEV__) {\n\t\tconst style = document.querySelector('style[data-sveltekit]');\n\t\tif (style) style.remove();\n\t}\n\n\tupdate(/** @type {import('@sveltejs/kit').Page} */ (result.props.page));\n\n\troot = new app.root({\n\t\ttarget,\n\t\tprops: { ...result.props, stores, components },\n\t\thydrate,\n\t\t// @ts-ignore Svelte 5 specific: asynchronously instantiate the component, i.e. don't call flushSync\n\t\tsync: false,\n\t\t// @ts-ignore Svelte 5 specific: transformError allows to transform errors before they are passed to boundaries\n\t\ttransformError: __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__\n\t\t\t? /** @param {unknown} e */ async (e) => {\n\t\t\t\t\tconst error = await handle_error(e, current.nav);\n\t\t\t\t\trendering_error = { error, status: get_status(e) };\n\t\t\t\t\tpage.error = error;\n\t\t\t\t\tpage.status = rendering_error.status;\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t: undefined\n\t});\n\n\t// Wait for a microtask in case svelte experimental async is enabled,\n\t// which causes component script blocks to run asynchronously\n\tvoid (await Promise.resolve());\n\n\tif (hydrate) {\n\t\t/** @type {import('@sveltejs/kit').AfterNavigate} */\n\t\tconst navigation = {\n\t\t\tfrom: null,\n\t\t\tto: {\n\t\t\t\t...nav,\n\t\t\t\tscroll: scroll_positions[current_history_index] ?? scroll_state()\n\t\t\t},\n\t\t\twillUnload: false,\n\t\t\ttype: 'enter',\n\t\t\tcomplete: Promise.resolve()\n\t\t};\n\n\t\tafter_navigate_callbacks.forEach((fn) => fn(navigation));\n\t}\n\n\trestore_snapshot(current_navigation_index);\n\n\tstarted = true;\n}\n\n/**\n *\n * @param {{\n * url: URL;\n * params: Record<string, string>;\n * branch: Array<import('./types.js').BranchNode | undefined>;\n * errors?: Array<import('types').CSRPageNodeLoader | undefined>;\n * status: number;\n * error: App.Error | null;\n * route: import('types').CSRRoute | null;\n * form?: Record<string, any> | null;\n * }} opts\n */\nasync function get_navigation_result_from_branch({\n\turl,\n\tparams,\n\tbranch,\n\terrors,\n\tstatus,\n\terror,\n\troute,\n\tform\n}) {\n\t/** @type {import('types').TrailingSlash} */\n\tlet slash = 'never';\n\n\t// if `paths.base === '/a/b/c`, then the root route is always `/a/b/c/`, regardless of\n\t// the `trailingSlash` route option, so that relative paths to JS and CSS work\n\tif (base && (url.pathname === base || url.pathname === base + '/')) {\n\t\tslash = 'always';\n\t} else {\n\t\tfor (const node of branch) {\n\t\t\tif (node?.slash !== undefined) slash = node.slash;\n\t\t}\n\t}\n\n\turl.pathname = normalize_path(url.pathname, slash);\n\t// eslint-disable-next-line no-self-assign\n\turl.search = url.search; // turn `/?` into `/`\n\n\t/** @type {import('./types.js').NavigationFinished} */\n\tconst result = {\n\t\ttype: 'loaded',\n\t\tstate: {\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch,\n\t\t\terror,\n\t\t\troute\n\t\t},\n\t\tprops: {\n\t\t\t// @ts-ignore Somehow it's getting SvelteComponent and SvelteComponentDev mixed up\n\t\t\tconstructors: compact(branch).map((branch_node) => branch_node.node.component),\n\t\t\tpage: clone_page(page)\n\t\t}\n\t};\n\n\tif (errors && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) {\n\t\tlet last_idx = -1;\n\t\tresult.props.errors = await Promise.all(\n\t\t\t// eslint-disable-next-line @typescript-eslint/await-thenable\n\t\t\tbranch\n\t\t\t\t.map((b, i) => {\n\t\t\t\t\tif (i === 0) return undefined; // root layout wraps root error component, not the other way around\n\t\t\t\t\tif (!b) return null;\n\n\t\t\t\t\ti--;\n\t\t\t\t\t// Find the closest error component up to the previous branch\n\t\t\t\t\twhile (i > last_idx + 1 && !errors[i]) i -= 1;\n\t\t\t\t\tlast_idx = i;\n\t\t\t\t\treturn errors[i]?.()\n\t\t\t\t\t\t.then((e) => e.component)\n\t\t\t\t\t\t.catch(() => undefined);\n\t\t\t\t})\n\t\t\t\t// filter out indexes where there was no branch, but keep indexes where there was a branch but no error component\n\t\t\t\t.filter((e) => e !== null)\n\t\t);\n\t}\n\n\tif (error && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) {\n\t\tresult.props.error = error;\n\t}\n\n\tif (form !== undefined) {\n\t\tresult.props.form = form;\n\t}\n\n\tlet data = {};\n\tlet data_changed = !page;\n\n\tlet p = 0;\n\n\tfor (let i = 0; i < Math.max(branch.length, current.branch.length); i += 1) {\n\t\tconst node = branch[i];\n\t\tconst prev = current.branch[i];\n\n\t\tif (node?.data !== prev?.data) data_changed = true;\n\t\tif (!node) continue;\n\n\t\tdata = { ...data, ...node.data };\n\n\t\t// Only set props if the node actually updated. This prevents needless rerenders.\n\t\tif (data_changed) {\n\t\t\tresult.props[`data_${p}`] = data;\n\t\t}\n\n\t\tp += 1;\n\t}\n\n\tconst page_changed =\n\t\t!current.url ||\n\t\turl.href !== current.url.href ||\n\t\tcurrent.error !== error ||\n\t\t(form !== undefined && form !== page.form) ||\n\t\tdata_changed;\n\n\tif (page_changed) {\n\t\tresult.props.page = {\n\t\t\terror,\n\t\t\tparams,\n\t\t\troute: {\n\t\t\t\tid: route?.id ?? null\n\t\t\t},\n\t\t\tstate: {},\n\t\t\tstatus,\n\t\t\turl: new URL(url),\n\t\t\tform: form ?? null,\n\t\t\t// The whole page store is updated, but this way the object reference stays the same\n\t\t\tdata: data_changed ? data : page.data\n\t\t};\n\t}\n\n\treturn result;\n}\n\n/**\n * Call the universal load function of the given node, if it exists.\n *\n * @param {{\n * loader: import('types').CSRPageNodeLoader;\n * \t parent: () => Promise<Record<string, any>>;\n * url: URL;\n * params: Record<string, string>;\n * route: { id: string | null };\n * \t server_data_node: import('./types.js').DataNode | null;\n * }} options\n * @returns {Promise<import('./types.js').BranchNode>}\n */\nasync function load_node({ loader, parent, url, params, route, server_data_node }) {\n\t/** @type {Record<string, any> | null} */\n\tlet data = null;\n\n\tlet is_tracking = true;\n\n\t/** @type {import('types').Uses} */\n\tconst uses = {\n\t\tdependencies: new Set(),\n\t\tparams: new Set(),\n\t\tparent: false,\n\t\troute: false,\n\t\turl: false,\n\t\tsearch_params: new Set()\n\t};\n\n\tconst node = await loader();\n\n\tif (DEV) {\n\t\tvalidate_page_exports(node.universal);\n\n\t\tif (node.universal && app.hash) {\n\t\t\tconst options = Object.keys(node.universal).filter((o) => o !== 'load');\n\n\t\t\tif (options.length > 0) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Page options are ignored when \\`router.type === 'hash'\\` (${route.id} has ${options\n\t\t\t\t\t\t.filter((o) => o !== 'load')\n\t\t\t\t\t\t.map((o) => `'${o}'`)\n\t\t\t\t\t\t.join(', ')})`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (__SVELTEKIT_HAS_UNIVERSAL_LOAD__ && node.universal?.load) {\n\t\t/** @param {string[]} deps */\n\t\tfunction depends(...deps) {\n\t\t\tfor (const dep of deps) {\n\t\t\t\tif (DEV) validate_depends(/** @type {string} */ (route.id), dep);\n\n\t\t\t\tconst { href } = new URL(dep, url);\n\t\t\t\tuses.dependencies.add(href);\n\t\t\t}\n\t\t}\n\n\t\t/** @type {import('@sveltejs/kit').LoadEvent} */\n\t\tconst load_input = {\n\t\t\ttracing: { enabled: false, root: noop_span, current: noop_span },\n\t\t\troute: new Proxy(route, {\n\t\t\t\tget: (target, key) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.route = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn target[/** @type {'id'} */ (key)];\n\t\t\t\t}\n\t\t\t}),\n\t\t\tparams: new Proxy(params, {\n\t\t\t\tget: (target, key) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.params.add(/** @type {string} */ (key));\n\t\t\t\t\t}\n\t\t\t\t\treturn target[/** @type {string} */ (key)];\n\t\t\t\t}\n\t\t\t}),\n\t\t\tdata: server_data_node?.data ?? null,\n\t\t\turl: make_trackable(\n\t\t\t\turl,\n\t\t\t\t() => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.url = true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t(param) => {\n\t\t\t\t\tif (is_tracking) {\n\t\t\t\t\t\tuses.search_params.add(param);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tapp.hash\n\t\t\t),\n\t\t\tasync fetch(resource, init) {\n\t\t\t\tif (resource instanceof Request) {\n\t\t\t\t\t// we're not allowed to modify the received `Request` object, so in order\n\t\t\t\t\t// to fixup relative urls we create a new equivalent `init` object instead\n\t\t\t\t\tinit = {\n\t\t\t\t\t\t// the request body must be consumed in memory until browsers\n\t\t\t\t\t\t// implement streaming request bodies and/or the body getter\n\t\t\t\t\t\tbody:\n\t\t\t\t\t\t\tresource.method === 'GET' || resource.method === 'HEAD'\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: await resource.blob(),\n\t\t\t\t\t\tcache: resource.cache,\n\t\t\t\t\t\tcredentials: resource.credentials,\n\t\t\t\t\t\t// the server sets headers to `undefined` if there are no headers but\n\t\t\t\t\t\t// the client defaults to an empty Headers object in the Request object.\n\t\t\t\t\t\t// To keep the two values in sync, we explicitly set the headers to `undefined`.\n\t\t\t\t\t\t// Also, not sure why, but sometimes 0 is evaluated as truthy so we need to\n\t\t\t\t\t\t// explicitly compare the headers length to a number here\n\t\t\t\t\t\theaders: [...resource.headers].length > 0 ? resource?.headers : undefined,\n\t\t\t\t\t\tintegrity: resource.integrity,\n\t\t\t\t\t\tkeepalive: resource.keepalive,\n\t\t\t\t\t\tmethod: resource.method,\n\t\t\t\t\t\tmode: resource.mode,\n\t\t\t\t\t\tredirect: resource.redirect,\n\t\t\t\t\t\treferrer: resource.referrer,\n\t\t\t\t\t\treferrerPolicy: resource.referrerPolicy,\n\t\t\t\t\t\tsignal: resource.signal,\n\t\t\t\t\t\t...init\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst { resolved, promise } = resolve_fetch_url(resource, init, url);\n\n\t\t\t\tif (is_tracking) {\n\t\t\t\t\tdepends(resolved.href);\n\t\t\t\t}\n\n\t\t\t\treturn promise;\n\t\t\t},\n\t\t\tsetHeaders: noop,\n\t\t\tdepends,\n\t\t\tparent() {\n\t\t\t\tif (is_tracking) {\n\t\t\t\t\tuses.parent = true;\n\t\t\t\t}\n\t\t\t\treturn parent();\n\t\t\t},\n\t\t\tuntrack(fn) {\n\t\t\t\tis_tracking = false;\n\t\t\t\ttry {\n\t\t\t\t\treturn fn();\n\t\t\t\t} finally {\n\t\t\t\t\tis_tracking = true;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tif (DEV) {\n\t\t\ttry {\n\t\t\t\tlock_fetch();\n\t\t\t\tdata = (await node.universal.load.call(null, load_input)) ?? null;\n\t\t\t\tvalidate_load_response(data, `related to route '${route.id}'`);\n\t\t\t} finally {\n\t\t\t\tunlock_fetch();\n\t\t\t}\n\t\t} else {\n\t\t\tdata = (await node.universal.load.call(null, load_input)) ?? null;\n\t\t}\n\t}\n\n\treturn {\n\t\tnode,\n\t\tloader,\n\t\tserver: server_data_node,\n\t\tuniversal: node.universal?.load ? { type: 'data', data, uses } : null,\n\t\tdata: data ?? server_data_node?.data ?? null,\n\t\tslash: node.universal?.trailingSlash ?? server_data_node?.slash\n\t};\n}\n\n/**\n * @param {Request | string | URL} input\n * @param {RequestInit | undefined} init\n * @param {URL} url\n */\nfunction resolve_fetch_url(input, init, url) {\n\tlet requested = input instanceof Request ? input.url : input;\n\n\t// we must fixup relative urls so they are resolved from the target page\n\tconst resolved = new URL(requested, url);\n\n\t// match ssr serialized data url, which is important to find cached responses\n\tif (resolved.origin === url.origin) {\n\t\trequested = resolved.href.slice(url.origin.length);\n\t}\n\n\t// prerendered pages may be served from any origin, so `initial_fetch` urls shouldn't be resolved\n\tconst promise = started\n\t\t? subsequent_fetch(requested, resolved.href, init)\n\t\t: initial_fetch(requested, init);\n\n\treturn { resolved, promise };\n}\n\n/**\n * @param {boolean} parent_changed\n * @param {boolean} route_changed\n * @param {boolean} url_changed\n * @param {Set<string>} search_params_changed\n * @param {import('types').Uses | undefined} uses\n * @param {Record<string, string>} params\n */\nfunction has_changed(\n\tparent_changed,\n\troute_changed,\n\turl_changed,\n\tsearch_params_changed,\n\tuses,\n\tparams\n) {\n\tif (force_invalidation) return true;\n\n\tif (!uses) return false;\n\n\tif (uses.parent && parent_changed) return true;\n\tif (uses.route && route_changed) return true;\n\tif (uses.url && url_changed) return true;\n\n\tfor (const tracked_params of uses.search_params) {\n\t\tif (search_params_changed.has(tracked_params)) return true;\n\t}\n\n\tfor (const param of uses.params) {\n\t\tif (params[param] !== current.params[param]) return true;\n\t}\n\n\tfor (const href of uses.dependencies) {\n\t\tif (invalidated.some((fn) => fn(new URL(href)))) return true;\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node\n * @param {import('./types.js').DataNode | null} [previous]\n * @returns {import('./types.js').DataNode | null}\n */\nfunction create_data_node(node, previous) {\n\tif (node?.type === 'data') return node;\n\tif (node?.type === 'skip') return previous ?? null;\n\treturn null;\n}\n\n/**\n * @param {URL | null} old_url\n * @param {URL} new_url\n */\nfunction diff_search_params(old_url, new_url) {\n\tif (!old_url) return new Set(new_url.searchParams.keys());\n\n\tconst changed = new Set([...old_url.searchParams.keys(), ...new_url.searchParams.keys()]);\n\n\tfor (const key of changed) {\n\t\tconst old_values = old_url.searchParams.getAll(key);\n\t\tconst new_values = new_url.searchParams.getAll(key);\n\n\t\tif (\n\t\t\told_values.every((value) => new_values.includes(value)) &&\n\t\t\tnew_values.every((value) => old_values.includes(value))\n\t\t) {\n\t\t\tchanged.delete(key);\n\t\t}\n\t}\n\n\treturn changed;\n}\n\n/**\n * @param {Omit<import('./types.js').NavigationFinished['state'], 'branch'> & { error: App.Error }} opts\n * @returns {import('./types.js').NavigationFinished}\n */\nfunction preload_error({ error, url, route, params }) {\n\treturn {\n\t\ttype: 'loaded',\n\t\tstate: {\n\t\t\terror,\n\t\t\turl,\n\t\t\troute,\n\t\t\tparams,\n\t\t\tbranch: []\n\t\t},\n\t\tprops: {\n\t\t\tpage: clone_page(page),\n\t\t\tconstructors: []\n\t\t}\n\t};\n}\n\n/**\n * @overload\n * @param {import('./types.js').NavigationIntent} intent\n * @returns {Promise<import('./types.js').NavigationResult | undefined>}\n */\n/**\n * @overload\n * @param {import('./types.js').NavigationIntent & { preload: {} }} intent\n * @returns {Promise<import('./types.js').NavigationResult>}\n */\n/**\n * @param {import('./types.js').NavigationIntent & { preload?: {} }} intent\n * @returns {Promise<import('./types.js').NavigationResult | undefined>}\n */\nasync function load_route({ id, invalidating, url, params, route, preload }) {\n\tif (load_cache?.id === id) {\n\t\t// the preload becomes the real navigation\n\t\tpreload_tokens.delete(load_cache.token);\n\t\treturn load_cache.promise;\n\t}\n\n\tconst { errors, layouts, leaf } = route;\n\n\tconst loaders = [...layouts, leaf];\n\n\t// preload modules to avoid waterfall, but handle rejections\n\t// so they don't get reported to Sentry et al (we don't need\n\t// to act on the failures at this point)\n\terrors.forEach((loader) => loader?.().catch(noop));\n\tloaders.forEach((loader) => loader?.[1]().catch(noop));\n\n\t/** @type {import('types').ServerNodesResponse | import('types').ServerRedirectNode | null} */\n\tlet server_data = null;\n\tconst url_changed = current.url ? id !== get_page_key(current.url) : false;\n\tconst route_changed = current.route ? route.id !== current.route.id : false;\n\tconst search_params_changed = diff_search_params(current.url, url);\n\n\tlet parent_invalid = false;\n\n\tif (__SVELTEKIT_HAS_SERVER_LOAD__) {\n\t\tconst invalid_server_nodes = loaders.map((loader, i) => {\n\t\t\tconst previous = current.branch[i];\n\n\t\t\tconst invalid =\n\t\t\t\t!!loader?.[0] &&\n\t\t\t\t(previous?.loader !== loader[1] ||\n\t\t\t\t\thas_changed(\n\t\t\t\t\t\tparent_invalid,\n\t\t\t\t\t\troute_changed,\n\t\t\t\t\t\turl_changed,\n\t\t\t\t\t\tsearch_params_changed,\n\t\t\t\t\t\tprevious.server?.uses,\n\t\t\t\t\t\tparams\n\t\t\t\t\t));\n\n\t\t\tif (invalid) {\n\t\t\t\t// For the next one\n\t\t\t\tparent_invalid = true;\n\t\t\t}\n\n\t\t\treturn invalid;\n\t\t});\n\n\t\tif (invalid_server_nodes.some(Boolean)) {\n\t\t\ttry {\n\t\t\t\tserver_data = await load_data(url, invalid_server_nodes);\n\t\t\t} catch (error) {\n\t\t\t\tconst handled_error = await handle_error(error, { url, params, route: { id } });\n\n\t\t\t\tif (preload && preload_tokens.has(preload)) {\n\t\t\t\t\treturn preload_error({ error: handled_error, url, params, route });\n\t\t\t\t}\n\n\t\t\t\treturn load_root_error_page({\n\t\t\t\t\tstatus: get_status(error),\n\t\t\t\t\terror: handled_error,\n\t\t\t\t\turl,\n\t\t\t\t\troute\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (server_data.type === 'redirect') {\n\t\t\t\treturn server_data;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst server_data_nodes = server_data?.nodes;\n\n\tlet parent_changed = false;\n\n\tconst branch_promises = loaders.map(async (loader, i) => {\n\t\tif (!loader) return;\n\n\t\t/** @type {import('./types.js').BranchNode | undefined} */\n\t\tconst previous = current.branch[i];\n\n\t\tconst server_data_node = server_data_nodes?.[i];\n\n\t\t// reuse data from previous load if it's still valid\n\t\tconst valid =\n\t\t\t(!server_data_node || server_data_node.type === 'skip') &&\n\t\t\tloader[1] === previous?.loader &&\n\t\t\t!has_changed(\n\t\t\t\tparent_changed,\n\t\t\t\troute_changed,\n\t\t\t\turl_changed,\n\t\t\t\tsearch_params_changed,\n\t\t\t\tprevious.universal?.uses,\n\t\t\t\tparams\n\t\t\t);\n\t\tif (valid) return previous;\n\n\t\tparent_changed = true;\n\n\t\tif (server_data_node?.type === 'error') {\n\t\t\t// rethrow and catch below\n\t\t\tthrow server_data_node;\n\t\t}\n\n\t\treturn load_node({\n\t\t\tloader: loader[1],\n\t\t\turl,\n\t\t\tparams,\n\t\t\troute,\n\t\t\tparent: async () => {\n\t\t\t\tconst data = {};\n\t\t\t\tfor (let j = 0; j < i; j += 1) {\n\t\t\t\t\tObject.assign(data, (await branch_promises[j])?.data);\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\tserver_data_node: create_data_node(\n\t\t\t\t// server_data_node is undefined if it wasn't reloaded from the server;\n\t\t\t\t// and if current loader uses server data, we want to reuse previous data.\n\t\t\t\tserver_data_node === undefined && loader[0] ? { type: 'skip' } : (server_data_node ?? null),\n\t\t\t\tloader[0] ? previous?.server : undefined\n\t\t\t)\n\t\t});\n\t});\n\n\t// if we don't do this, rejections will be unhandled\n\tfor (const p of branch_promises) p.catch(noop);\n\n\t/** @type {Array<import('./types.js').BranchNode | undefined>} */\n\tconst branch = [];\n\n\tfor (let i = 0; i < loaders.length; i += 1) {\n\t\tif (loaders[i]) {\n\t\t\ttry {\n\t\t\t\tbranch.push(await branch_promises[i]);\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof Redirect) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'redirect',\n\t\t\t\t\t\tlocation: err.location\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (preload && preload_tokens.has(preload)) {\n\t\t\t\t\treturn preload_error({\n\t\t\t\t\t\terror: await handle_error(err, { params, url, route: { id: route.id } }),\n\t\t\t\t\t\turl,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t\troute\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlet status = get_status(err);\n\t\t\t\t/** @type {App.Error} */\n\t\t\t\tlet error;\n\n\t\t\t\tif (server_data_nodes?.includes(/** @type {import('types').ServerErrorNode} */ (err))) {\n\t\t\t\t\t// this is the server error rethrown above, reconstruct but don't invoke\n\t\t\t\t\t// the client error handler; it should've already been handled on the server\n\t\t\t\t\tstatus = /** @type {import('types').ServerErrorNode} */ (err).status ?? status;\n\t\t\t\t\terror = /** @type {import('types').ServerErrorNode} */ (err).error;\n\t\t\t\t} else if (err instanceof HttpError) {\n\t\t\t\t\terror = err.body;\n\t\t\t\t} else {\n\t\t\t\t\t// Referenced node could have been removed due to redeploy, check\n\t\t\t\t\tconst updated = await stores.updated.check();\n\t\t\t\t\tif (updated) {\n\t\t\t\t\t\t// Before reloading, try to update the service worker if it exists\n\t\t\t\t\t\tawait update_service_worker();\n\t\t\t\t\t\treturn await native_navigation(url);\n\t\t\t\t\t}\n\n\t\t\t\t\terror = await handle_error(err, { params, url, route: { id: route.id } });\n\t\t\t\t}\n\n\t\t\t\tconst error_load = await load_nearest_error_page(i, branch, errors);\n\t\t\t\tif (error_load) {\n\t\t\t\t\treturn get_navigation_result_from_branch({\n\t\t\t\t\t\turl,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t\tbranch: branch.slice(0, error_load.idx).concat(error_load.node),\n\t\t\t\t\t\terrors,\n\t\t\t\t\t\tstatus,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\troute\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturn await server_fallback(url, { id: route.id }, error, status);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// push an empty slot so we can rewind past gaps to the\n\t\t\t// layout that corresponds with an +error.svelte page\n\t\t\tbranch.push(undefined);\n\t\t}\n\t}\n\n\treturn get_navigation_result_from_branch({\n\t\turl,\n\t\tparams,\n\t\tbranch,\n\t\terrors,\n\t\tstatus: 200,\n\t\terror: null,\n\t\troute,\n\t\t// Reset `form` on navigation, but not invalidation\n\t\tform: invalidating ? undefined : null\n\t});\n}\n\n/**\n * @param {number} i Start index to backtrack from\n * @param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack\n * @param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch\n * @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>}\n */\nasync function load_nearest_error_page(i, branch, errors) {\n\twhile (i--) {\n\t\tif (errors[i]) {\n\t\t\tlet j = i;\n\t\t\twhile (!branch[j]) j -= 1;\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tidx: j + 1,\n\t\t\t\t\tnode: {\n\t\t\t\t\t\tnode: await /** @type {import('types').CSRPageNodeLoader } */ (errors[i])(),\n\t\t\t\t\t\tloader: /** @type {import('types').CSRPageNodeLoader } */ (errors[i]),\n\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\tserver: null,\n\t\t\t\t\t\tuniversal: null\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {{\n * status: number;\n * error: App.Error;\n * url: URL;\n * route: { id: string | null }\n * }} opts\n * @returns {Promise<import('./types.js').NavigationFinished | undefined>} returns `undefined` in case of a redirect\n */\nasync function load_root_error_page({ status, error, url, route }) {\n\t/** @type {Record<string, string>} */\n\tconst params = {}; // error page does not have params\n\n\t/** @type {import('types').ServerDataNode | null} */\n\tlet server_data_node = null;\n\n\tif (__SVELTEKIT_HAS_SERVER_LOAD__) {\n\t\tconst default_layout_has_server_load = app.server_loads[0] === 0;\n\n\t\tif (default_layout_has_server_load) {\n\t\t\t// TODO post-https://github.com/sveltejs/kit/discussions/6124 we can use\n\t\t\t// existing root layout data\n\t\t\ttry {\n\t\t\t\tconst server_data = await load_data(url, [true]);\n\n\t\t\t\tif (\n\t\t\t\t\tserver_data.type !== 'data' ||\n\t\t\t\t\t(server_data.nodes[0] && server_data.nodes[0].type !== 'data')\n\t\t\t\t) {\n\t\t\t\t\tthrow 0;\n\t\t\t\t}\n\n\t\t\t\tserver_data_node = server_data.nodes[0] ?? null;\n\t\t\t} catch (e) {\n\t\t\t\t// at this point we have no choice but to fall back to the server, if it wouldn't\n\t\t\t\t// bring us right back here, turning this into an endless loop.\n\t\t\t\t// if __data.json returned 404, the route doesn't exist — don't reload or we loop\n\t\t\t\tif (\n\t\t\t\t\t!(e instanceof HttpError && e.status === 404) &&\n\t\t\t\t\t(url.origin !== origin || url.pathname !== location.pathname || hydrated)\n\t\t\t\t) {\n\t\t\t\t\treturn await native_navigation(url);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ttry {\n\t\tconst root_layout = await load_node({\n\t\t\tloader: default_layout_loader,\n\t\t\turl,\n\t\t\tparams,\n\t\t\troute,\n\t\t\tparent: () => Promise.resolve({}),\n\t\t\tserver_data_node: create_data_node(server_data_node)\n\t\t});\n\n\t\t/** @type {import('./types.js').BranchNode} */\n\t\tconst root_error = {\n\t\t\tnode: await default_error_loader(),\n\t\t\tloader: default_error_loader,\n\t\t\tuniversal: null,\n\t\t\tserver: null,\n\t\t\tdata: null\n\t\t};\n\n\t\treturn get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch: [root_layout, root_error],\n\t\t\tstatus,\n\t\t\terror,\n\t\t\terrors: [],\n\t\t\troute: null\n\t\t});\n\t} catch (error) {\n\t\t// client-side navigation if the root layout loader throws a redirect while\n\t\t// rendering the default error page\n\t\tif (error instanceof Redirect) {\n\t\t\tawait _goto(new URL(error.location, location.href), {}, 0);\n\t\t\treturn;\n\t\t}\n\n\t\t// otherwise, render the static error page\n\t\tconst error_template = await app.get_error_template();\n\t\tconst handled = await handle_error(error, { url, params, route });\n\t\tconst message = String(handled?.message ?? '')\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;');\n\t\tconst html = error_template({ status, message });\n\t\tconst parsed = new DOMParser().parseFromString(html, 'text/html');\n\t\tdocument.documentElement.replaceChild(document.adoptNode(parsed.head), document.head);\n\t\tdocument.documentElement.replaceChild(document.adoptNode(parsed.body), document.body);\n\n\t\tthrow error;\n\t}\n}\n\n/**\n * Resolve the relative rerouted URL for a client-side navigation\n * @param {URL} url\n * @returns {Promise<URL | undefined>}\n */\nasync function get_rerouted_url(url) {\n\tconst href = url.href;\n\n\tif (reroute_cache.has(href)) {\n\t\treturn reroute_cache.get(href);\n\t}\n\n\tlet rerouted;\n\n\ttry {\n\t\tconst promise = (async () => {\n\t\t\t// reroute could alter the given URL, so we pass a copy\n\t\t\tlet rerouted =\n\t\t\t\t(await app.hooks.reroute({\n\t\t\t\t\turl: new URL(url),\n\t\t\t\t\tfetch: async (input, init) => {\n\t\t\t\t\t\treturn resolve_fetch_url(input, init, url).promise;\n\t\t\t\t\t}\n\t\t\t\t})) ?? url;\n\n\t\t\tif (typeof rerouted === 'string') {\n\t\t\t\tconst tmp = new URL(url); // do not mutate the incoming URL\n\n\t\t\t\tif (app.hash) {\n\t\t\t\t\ttmp.hash = rerouted;\n\t\t\t\t} else {\n\t\t\t\t\ttmp.pathname = rerouted;\n\t\t\t\t}\n\n\t\t\t\trerouted = tmp;\n\t\t\t}\n\n\t\t\treturn rerouted;\n\t\t})();\n\n\t\treroute_cache.set(href, promise);\n\t\trerouted = await promise;\n\t} catch (e) {\n\t\treroute_cache.delete(href);\n\t\tif (DEV) {\n\t\t\t// in development, print the error...\n\t\t\tconsole.error(e);\n\n\t\t\t// ...and pause execution, since otherwise we will immediately reload the page\n\t\t\tdebugger; // eslint-disable-line\n\t\t}\n\n\t\t// fall back to native navigation\n\t\treturn;\n\t}\n\n\treturn rerouted;\n}\n\n/**\n * Resolve the full info (which route, params, etc.) for a client-side navigation from the URL,\n * taking the reroute hook into account. If this isn't a client-side-navigation (or the URL is undefined),\n * returns undefined.\n * @param {URL | undefined} url\n * @param {boolean} invalidating\n * @returns {Promise<import('./types.js').NavigationIntent | undefined>}\n */\nexport async function get_navigation_intent(url, invalidating) {\n\tif (!url) return;\n\tif (is_external_url(url, base, app.hash)) return;\n\n\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\tconst rerouted = await get_rerouted_url(url);\n\t\tif (!rerouted) return;\n\n\t\tconst path = get_url_path(rerouted);\n\n\t\tfor (const route of routes) {\n\t\t\tconst params = route.exec(path);\n\n\t\t\tif (params) {\n\t\t\t\treturn {\n\t\t\t\t\tid: get_page_key(url),\n\t\t\t\t\tinvalidating,\n\t\t\t\t\troute,\n\t\t\t\t\tparams: decode_params(params),\n\t\t\t\t\turl\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/** @type {{ route?: import('types').CSRRouteServer, params: Record<string, string>}} */\n\t\tconst { route, params } = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tadd_resolution_suffix(url.pathname)\n\t\t);\n\n\t\tif (!route) return;\n\n\t\treturn {\n\t\t\tid: get_page_key(url),\n\t\t\tinvalidating,\n\t\t\troute: parse_server_route(route, app.nodes),\n\t\t\tparams,\n\t\t\turl\n\t\t};\n\t}\n}\n\n/** @param {URL} url */\nfunction get_url_path(url) {\n\treturn (\n\t\tdecode_pathname(\n\t\t\tapp.hash ? url.hash.replace(/^#/, '').replace(/[?#].+/, '') : url.pathname.slice(base.length)\n\t\t) || '/'\n\t);\n}\n\n/** @param {URL} url */\nfunction get_page_key(url) {\n\treturn (app.hash ? url.hash.replace(/^#/, '') : url.pathname) + url.search;\n}\n\n/**\n * @param {{\n * url: URL;\n * type: import('@sveltejs/kit').Navigation[\"type\"];\n * intent?: import('./types.js').NavigationIntent;\n * delta?: number;\n * event?: PopStateEvent | MouseEvent;\n * scroll?: { x: number, y: number };\n * }} opts\n */\nfunction _before_navigate({ url, type, intent, delta, event, scroll }) {\n\tlet should_block = false;\n\n\tconst nav = create_navigation(current, intent, url, type, scroll ?? null);\n\n\tif (delta !== undefined) {\n\t\tnav.navigation.delta = delta;\n\t}\n\n\tif (event !== undefined) {\n\t\t// @ts-ignore\n\t\tnav.navigation.event = event;\n\t}\n\n\tconst cancellable = {\n\t\t...nav.navigation,\n\t\tcancel: () => {\n\t\t\tshould_block = true;\n\t\t\tnav.reject(new Error('navigation cancelled'));\n\t\t}\n\t};\n\n\tif (!is_navigating) {\n\t\t// Don't run the event during redirects\n\t\tbefore_navigate_callbacks.forEach((fn) => fn(cancellable));\n\t}\n\n\treturn should_block ? null : nav;\n}\n\n/**\n * @param {{\n * type: import('@sveltejs/kit').NavigationType;\n * url: URL;\n * popped?: {\n * state: Record<string, any>;\n * scroll: { x: number, y: number };\n * delta: number;\n * };\n * keepfocus?: boolean;\n * noscroll?: boolean;\n * replace_state?: boolean;\n * state?: Record<string, any>;\n * redirect_count?: number;\n * nav_token?: {};\n * accept?: () => void;\n * block?: () => void;\n * event?: Event\n * }} opts\n * @returns {Promise<void>}\n */\nasync function navigate({\n\ttype,\n\turl,\n\tpopped,\n\tkeepfocus,\n\tnoscroll,\n\treplace_state,\n\tstate = {},\n\tredirect_count = 0,\n\tnav_token = {},\n\taccept = noop,\n\tblock = noop,\n\tevent\n}) {\n\tconst prev_token = token;\n\ttoken = nav_token;\n\n\tconst intent = await get_navigation_intent(url, false);\n\tconst nav =\n\t\ttype === 'enter'\n\t\t\t? create_navigation(current, intent, url, type)\n\t\t\t: _before_navigate({\n\t\t\t\t\turl,\n\t\t\t\t\ttype,\n\t\t\t\t\tdelta: popped?.delta,\n\t\t\t\t\tintent,\n\t\t\t\t\tscroll: popped?.scroll,\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tevent\n\t\t\t\t});\n\n\tif (!nav) {\n\t\tblock();\n\t\tif (token === nav_token) token = prev_token;\n\t\treturn;\n\t}\n\n\t// store this before calling `accept()`, which may change the index\n\tconst previous_history_index = current_history_index;\n\tconst previous_navigation_index = current_navigation_index;\n\n\taccept();\n\n\tis_navigating = true;\n\n\tif (started && nav.navigation.type !== 'enter') {\n\t\tstores.navigating.set((navigating.current = nav.navigation));\n\t}\n\n\tlet navigation_result = intent && (await load_route(intent));\n\n\tif (!navigation_result) {\n\t\tif (is_external_url(url, base, app.hash)) {\n\t\t\tif (DEV && app.hash) {\n\t\t\t\t// Special case for hash mode during DEV: If someone accidentally forgets to use a hash for the link,\n\t\t\t\t// they would end up here in an endless loop. Fall back to error page in that case\n\t\t\t\tnavigation_result = await server_fallback(\n\t\t\t\t\turl,\n\t\t\t\t\t{ id: null },\n\t\t\t\t\tawait handle_error(\n\t\t\t\t\t\tnew SvelteKitError(\n\t\t\t\t\t\t\t404,\n\t\t\t\t\t\t\t'Not Found',\n\t\t\t\t\t\t\t`Not found: ${url.pathname} (did you forget the hash?)`\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\tparams: {},\n\t\t\t\t\t\t\troute: { id: null }\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t404,\n\t\t\t\t\treplace_state\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn await native_navigation(url, replace_state);\n\t\t\t}\n\t\t} else {\n\t\t\tnavigation_result = await server_fallback(\n\t\t\t\turl,\n\t\t\t\t{ id: null },\n\t\t\t\tawait handle_error(new SvelteKitError(404, 'Not Found', `Not found: ${url.pathname}`), {\n\t\t\t\t\turl,\n\t\t\t\t\tparams: {},\n\t\t\t\t\troute: { id: null }\n\t\t\t\t}),\n\t\t\t\t404,\n\t\t\t\treplace_state\n\t\t\t);\n\t\t}\n\t}\n\n\t// if this is an internal navigation intent, use the normalized\n\t// URL for the rest of the function\n\turl = intent?.url || url;\n\n\t// abort if user navigated during update\n\tif (token !== nav_token) {\n\t\tnav.reject(new Error('navigation aborted'));\n\t\treturn;\n\t}\n\n\tif (!navigation_result) return;\n\n\tif (navigation_result.type === 'redirect') {\n\t\t// whatwg fetch spec https://fetch.spec.whatwg.org/#http-redirect-fetch says to error after 20 redirects\n\t\tif (redirect_count < 20) {\n\t\t\tawait navigate({\n\t\t\t\ttype,\n\t\t\t\turl: new URL(navigation_result.location, url),\n\t\t\t\tpopped,\n\t\t\t\tkeepfocus,\n\t\t\t\tnoscroll,\n\t\t\t\treplace_state,\n\t\t\t\tstate,\n\t\t\t\tredirect_count: redirect_count + 1,\n\t\t\t\tnav_token\n\t\t\t});\n\n\t\t\tnav.fulfil(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tnavigation_result = await load_root_error_page({\n\t\t\tstatus: 500,\n\t\t\terror: await handle_error(new Error('Redirect loop'), {\n\t\t\t\turl,\n\t\t\t\tparams: {},\n\t\t\t\troute: { id: null }\n\t\t\t}),\n\t\t\turl,\n\t\t\troute: { id: null }\n\t\t});\n\n\t\tif (!navigation_result) return;\n\t} else if (/** @type {number} */ (navigation_result.props.page.status) >= 400) {\n\t\tconst updated = await stores.updated.check();\n\t\tif (updated) {\n\t\t\t// Before reloading, try to update the service worker if it exists\n\t\t\tawait update_service_worker();\n\t\t\treturn await native_navigation(url, replace_state);\n\t\t}\n\t}\n\n\t// reset invalidation only after a finished navigation. If there are redirects or\n\t// additional invalidations, they should get the same invalidation treatment\n\treset_invalidation();\n\n\tupdating = true;\n\n\tupdate_scroll_positions(previous_history_index);\n\tcapture_snapshot(previous_navigation_index);\n\n\t// ensure the url pathname matches the page's trailing slash option\n\tif (navigation_result.props.page.url.pathname !== url.pathname) {\n\t\turl.pathname = navigation_result.props.page.url.pathname;\n\t}\n\n\tstate = popped ? popped.state : state;\n\n\tif (!popped) {\n\t\t// this is a new navigation, rather than a popstate\n\t\tconst change = replace_state ? 0 : 1;\n\n\t\tconst entry = {\n\t\t\t[HISTORY_INDEX]: (current_history_index += change),\n\t\t\t[NAVIGATION_INDEX]: (current_navigation_index += change),\n\t\t\t[STATES_KEY]: state\n\t\t};\n\n\t\tconst fn = replace_state ? history.replaceState : history.pushState;\n\t\tfn.call(history, entry, '', url);\n\n\t\tif (!replace_state) {\n\t\t\tclear_onward_history(current_history_index, current_navigation_index);\n\t\t}\n\t}\n\n\t// also compare ids to avoid using wrong fork (e.g. a new one could've been added while navigating)\n\tconst load_cache_fork = intent && load_cache?.id === intent.id ? load_cache.fork : null;\n\t// reset preload synchronously after the history state has been set to avoid race conditions\n\tif (load_cache?.fork && !load_cache_fork) {\n\t\t// discard fork of different route\n\t\tdiscard_load_cache();\n\t} else {\n\t\tload_cache = null;\n\t\tcurrent_a = { element: undefined, href: undefined };\n\t}\n\n\tnavigation_result.props.page.state = state;\n\n\t/**\n\t * @type {Promise<void> | undefined}\n\t */\n\tlet commit_promise;\n\tif (started) {\n\t\tconst after_navigate = (\n\t\t\tawait Promise.all(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/await-thenable -- we need to await because they can be asynchronous\n\t\t\t\tArray.from(on_navigate_callbacks, (fn) =>\n\t\t\t\t\tfn(/** @type {import('@sveltejs/kit').OnNavigate} */ (nav.navigation))\n\t\t\t\t)\n\t\t\t)\n\t\t).filter(/** @returns {value is () => void} */ (value) => typeof value === 'function');\n\n\t\tif (after_navigate.length > 0) {\n\t\t\tfunction cleanup() {\n\t\t\t\tafter_navigate.forEach((fn) => {\n\t\t\t\t\tafter_navigate_callbacks.delete(fn);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tafter_navigate.push(cleanup);\n\n\t\t\tafter_navigate.forEach((fn) => {\n\t\t\t\tafter_navigate_callbacks.add(fn);\n\t\t\t});\n\t\t}\n\n\t\t// Type-casts are save because we know this resolved a proper SvelteKit route\n\t\tconst target = /** @type {import('@sveltejs/kit').NavigationTarget} */ (nav.navigation.to);\n\t\tcurrent = {\n\t\t\t...navigation_result.state,\n\t\t\tnav: {\n\t\t\t\tparams: /** @type {Record<string, any>} */ (target.params),\n\t\t\t\troute: target.route,\n\t\t\t\turl: target.url\n\t\t\t}\n\t\t};\n\n\t\t// reset url before updating page store\n\t\tif (navigation_result.props.page) {\n\t\t\tnavigation_result.props.page.url = url;\n\t\t}\n\n\t\t// Remove focus before updating the component tree, so that blur/focusout\n\t\t// handlers fire while the old component's data is still valid (#14575)\n\t\tif (\n\t\t\t!keepfocus &&\n\t\t\tdocument.activeElement instanceof HTMLElement &&\n\t\t\tdocument.activeElement !== document.body\n\t\t) {\n\t\t\tdocument.activeElement.blur();\n\t\t}\n\n\t\tconst fork = load_cache_fork && (await load_cache_fork);\n\n\t\tif (fork) {\n\t\t\tcommit_promise = fork.commit();\n\t\t} else {\n\t\t\trendering_error = null; // TODO this can break with forks, rethink for SvelteKit 3 where we can assume Svelte 5\n\t\t\troot.$set(navigation_result.props);\n\t\t\t// Check for sync rendering error\n\t\t\tif (rendering_error) {\n\t\t\t\tObject.assign(navigation_result.props.page, rendering_error);\n\t\t\t}\n\t\t\tupdate(navigation_result.props.page);\n\n\t\t\tcommit_promise = svelte.settled?.();\n\t\t}\n\n\t\thas_navigated = true;\n\t} else {\n\t\tawait initialize(navigation_result, target, false);\n\t}\n\n\tconst { activeElement } = document;\n\n\tawait commit_promise;\n\n\t// TODO 3.0 remote — the double tick is probably necessary because\n\t// of some store shenanigans. `settled()` and `f.commit()`\n\t// should resolve after DOM updates in newer versions\n\tawait svelte.tick();\n\tawait svelte.tick();\n\n\tif (token !== nav_token) {\n\t\t// a new navigation happened while we were waiting for the DOM to update, so abort\n\t\tnav.reject(new Error('navigation aborted'));\n\t\treturn;\n\t}\n\n\t// Check for async rendering error\n\tif (navigation_result.props.page && rendering_error) {\n\t\tObject.assign(navigation_result.props.page, rendering_error);\n\t}\n\n\t// we reset scroll before dealing with focus, to avoid a flash of unscrolled content\n\t/** @type {Element | null | ''} */\n\tlet deep_linked = null;\n\n\tif (autoscroll) {\n\t\tconst scroll = popped ? popped.scroll : noscroll ? scroll_state() : null;\n\t\tif (scroll) {\n\t\t\tscrollTo(scroll.x, scroll.y);\n\t\t} else if ((deep_linked = url.hash && document.getElementById(get_id(url)))) {\n\t\t\t// Here we use `scrollIntoView` on the element instead of `scrollTo`\n\t\t\t// because it natively supports the `scroll-margin` and `scroll-behavior`\n\t\t\t// CSS properties.\n\t\t\tdeep_linked.scrollIntoView();\n\t\t} else {\n\t\t\tscrollTo(0, 0);\n\t\t}\n\t}\n\n\tconst changed_focus =\n\t\t// reset focus only if any manual focus management didn't override it\n\t\tdocument.activeElement !== activeElement &&\n\t\t// also refocus when activeElement is body already because the\n\t\t// focus event might not have been fired on it yet\n\t\tdocument.activeElement !== document.body;\n\n\tif (!keepfocus && !changed_focus) {\n\t\t// We don't need to manually restore the scroll position if we're navigating\n\t\t// to a fragment identifier. It is automatically done for us when we set the\n\t\t// sequential navigation starting point with `location.replace`\n\t\treset_focus(url, !deep_linked);\n\t}\n\n\tautoscroll = true;\n\n\tis_navigating = false;\n\n\tnav.fulfil(undefined);\n\n\t// Update to.scroll to the actual scroll position after navigation completed\n\tif (nav.navigation.to) {\n\t\tnav.navigation.to.scroll = scroll_state();\n\t}\n\n\tafter_navigate_callbacks.forEach((fn) =>\n\t\tfn(/** @type {import('@sveltejs/kit').AfterNavigate} */ (nav.navigation))\n\t);\n\n\tif (type === 'popstate') {\n\t\trestore_snapshot(current_navigation_index);\n\t}\n\n\tstores.navigating.set((navigating.current = null));\n\n\tupdating = false;\n}\n\n/**\n * Does a full page reload if it wouldn't result in an endless loop in the SPA case\n * @param {URL} url\n * @param {{ id: string | null }} route\n * @param {App.Error} error\n * @param {number} status\n * @param {boolean} [replace_state]\n * @returns {Promise<import('./types.js').NavigationFinished | undefined>}\n */\nasync function server_fallback(url, route, error, status, replace_state) {\n\tif (url.origin === origin && url.pathname === location.pathname && !hydrated) {\n\t\t// We would reload the same page we're currently on, which isn't hydrated,\n\t\t// which means no SSR, which means we would end up in an endless loop\n\t\treturn await load_root_error_page({\n\t\t\tstatus,\n\t\t\terror,\n\t\t\turl,\n\t\t\troute\n\t\t});\n\t}\n\n\tif (DEV && status !== 404) {\n\t\tconsole.error(\n\t\t\t'An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)'\n\t\t);\n\n\t\tdebugger; // eslint-disable-line\n\t}\n\n\treturn await native_navigation(url, replace_state);\n}\n\nif (import.meta.hot) {\n\timport.meta.hot.on('vite:beforeUpdate', () => {\n\t\tif (current.error) location.reload();\n\t});\n}\n\n/** @typedef {(typeof PRELOAD_PRIORITIES)['hover'] | (typeof PRELOAD_PRIORITIES)['tap']} PreloadDataPriority */\n\n/**\n * The anchor element whose href is being preloaded. It is reset after navigation\n * or changes when a different anchor element is being preloaded.\n * @type {{ element: Element | SVGAElement | undefined; href: string | SVGAnimatedString | undefined }}\n */\nlet current_a = { element: undefined, href: undefined };\n\nfunction setup_preload() {\n\t/** @type {NodeJS.Timeout} */\n\tlet mousemove_timeout;\n\t/** @type {PreloadDataPriority} */\n\tlet current_priority;\n\n\tcontainer.addEventListener('mousemove', (event) => {\n\t\tconst target = /** @type {Element} */ (event.target);\n\n\t\tclearTimeout(mousemove_timeout);\n\t\tmousemove_timeout = setTimeout(() => {\n\t\t\tvoid preload(target, PRELOAD_PRIORITIES.hover);\n\t\t}, 20);\n\t});\n\n\t/** @param {Event} event */\n\tfunction tap(event) {\n\t\tif (event.defaultPrevented) return;\n\t\tvoid preload(/** @type {Element} */ (event.composedPath()[0]), PRELOAD_PRIORITIES.tap);\n\t}\n\n\tcontainer.addEventListener('mousedown', tap);\n\tcontainer.addEventListener('touchstart', tap, { passive: true });\n\n\tconst observer = new IntersectionObserver(\n\t\t(entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tvoid _preload_code(new URL(/** @type {HTMLAnchorElement} */ (entry.target).href));\n\t\t\t\t\tobserver.unobserve(entry.target);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ threshold: 0 }\n\t);\n\n\t/**\n\t * @param {Element} element\n\t * @param {PreloadDataPriority} priority\n\t */\n\tasync function preload(element, priority) {\n\t\tconst a = find_anchor(element, container);\n\n\t\t// we don't want to preload data again if the user has already hovered/tapped\n\t\tconst interacted =\n\t\t\ta === current_a.element && a?.href === current_a.href && priority >= current_priority;\n\t\tif (!a || interacted) return;\n\n\t\tconst { url, external, download } = get_link_info(a, base, app.hash);\n\t\tif (external || download) return;\n\n\t\tconst options = get_router_options(a);\n\n\t\t// we don't want to preload data for a page we're already on\n\t\tconst same_url = url && get_page_key(current.url) === get_page_key(url);\n\t\tif (options.reload || same_url) return;\n\n\t\tif (priority <= options.preload_data) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\t// we don't want to preload data again on tap if we've already preloaded it on hover\n\t\t\tcurrent_priority = PRELOAD_PRIORITIES.tap;\n\n\t\t\tconst intent = await get_navigation_intent(url, false);\n\t\t\tif (!intent) return;\n\n\t\t\tif (DEV) {\n\t\t\t\tvoid _preload_data(intent).then((result) => {\n\t\t\t\t\tif (result.type === 'loaded' && result.state.error) {\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\\n` +\n\t\t\t\t\t\t\t\t'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +\n\t\t\t\t\t\t\t\t'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +\n\t\t\t\t\t\t\t\t'See https://svelte.dev/docs/kit/link-options for more info'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tvoid _preload_data(intent);\n\t\t\t}\n\t\t} else if (priority <= options.preload_code) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\tcurrent_priority = priority;\n\t\t\tvoid _preload_code(/** @type {URL} */ (url));\n\t\t}\n\t}\n\n\tfunction after_navigate() {\n\t\tobserver.disconnect();\n\n\t\tfor (const a of container.querySelectorAll('a')) {\n\t\t\tconst { url, external, download } = get_link_info(a, base, app.hash);\n\t\t\tif (external || download) continue;\n\n\t\t\tconst options = get_router_options(a);\n\t\t\tif (options.reload) continue;\n\n\t\t\tif (options.preload_code === PRELOAD_PRIORITIES.viewport) {\n\t\t\t\tobserver.observe(a);\n\t\t\t}\n\n\t\t\tif (options.preload_code === PRELOAD_PRIORITIES.eager) {\n\t\t\t\tvoid _preload_code(/** @type {URL} */ (url));\n\t\t\t}\n\t\t}\n\t}\n\n\tafter_navigate_callbacks.add(after_navigate);\n\tafter_navigate();\n}\n\n/**\n * @param {unknown} error\n * @param {import('@sveltejs/kit').NavigationEvent} event\n * @returns {import('types').MaybePromise<App.Error>}\n */\nfunction handle_error(error, event) {\n\tif (error instanceof HttpError) {\n\t\treturn error.body;\n\t}\n\n\tif (DEV) {\n\t\terrored = true;\n\t\tconsole.warn('The next HMR update will cause the page to reload');\n\t}\n\n\tconst status = get_status(error);\n\tconst message = get_message(error);\n\n\treturn (\n\t\tapp.hooks.handleError({ error, event, status, message }) ?? /** @type {any} */ ({ message })\n\t);\n}\n\n/**\n * @template {Function} T\n * @param {Set<T>} callbacks\n * @param {T} callback\n */\nfunction add_navigation_callback(callbacks, callback) {\n\tonMount(() => {\n\t\tcallbacks.add(callback);\n\n\t\treturn () => {\n\t\t\tcallbacks.delete(callback);\n\t\t};\n\t});\n}\n\n/**\n * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL.\n *\n * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').AfterNavigate) => void} callback\n * @returns {void}\n */\nexport function afterNavigate(callback) {\n\tadd_navigation_callback(after_navigate_callbacks, callback);\n}\n\n/**\n * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls.\n *\n * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response.\n *\n * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`.\n *\n * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`.\n *\n * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').BeforeNavigate) => void} callback\n * @returns {void}\n */\nexport function beforeNavigate(callback) {\n\tadd_navigation_callback(before_navigate_callbacks, callback);\n}\n\n/**\n * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations.\n *\n * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user.\n *\n * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated.\n *\n * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted.\n * @param {(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>} callback\n * @returns {void}\n */\nexport function onNavigate(callback) {\n\tadd_navigation_callback(on_navigate_callbacks, callback);\n}\n\n/**\n * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling.\n * This is generally discouraged, since it breaks user expectations.\n * @returns {void}\n */\nexport function disableScrollHandling() {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call disableScrollHandling() on the server');\n\t}\n\n\tif (DEV && started && !updating) {\n\t\tthrow new Error('Can only disable scroll handling during navigation');\n\t}\n\n\tif (updating || !started) {\n\t\tautoscroll = false;\n\t}\n}\n\n/**\n * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused.\n * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.\n *\n * For external URLs, use `window.location = url` instead of calling `goto(url)`.\n *\n * @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.\n * @param {Object} [opts] Options related to the navigation\n * @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState`\n * @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation\n * @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body\n * @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation.\n * @param {Array<string | URL | ((url: URL) => boolean)>} [opts.invalidate] Causes any load functions to re-run if they depend on one of the urls\n * @param {App.PageState} [opts.state] An optional object that will be available as `page.state`\n * @returns {Promise<void>}\n */\nexport function goto(url, opts = {}) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call goto(...) on the server');\n\t}\n\n\turl = new URL(resolve_url(url));\n\n\tif (url.origin !== origin) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\tDEV\n\t\t\t\t\t? `Cannot use \\`goto\\` with an external URL. Use \\`window.location = \"${url}\"\\` instead`\n\t\t\t\t\t: 'goto: invalid URL'\n\t\t\t)\n\t\t);\n\t}\n\n\treturn _goto(url, opts, 0);\n}\n\n/**\n * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated.\n *\n * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters).\n * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL.\n *\n * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned.\n * This can be useful if you want to invalidate based on a pattern instead of a exact match.\n *\n * ```ts\n * // Example: Match '/path' regardless of the query parameters\n * import { invalidate } from '$app/navigation';\n *\n * invalidate((url) => url.pathname === '/path');\n * ```\n * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL\n * @returns {Promise<void>}\n */\nexport function invalidate(resource) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call invalidate(...) on the server');\n\t}\n\n\tpush_invalidated(resource);\n\n\treturn _invalidate();\n}\n\n/**\n * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL\n */\nfunction push_invalidated(resource) {\n\tif (typeof resource === 'function') {\n\t\tinvalidated.push(resource);\n\t} else {\n\t\tconst { href } = new URL(resource, location.href);\n\t\tinvalidated.push((url) => url.href === href);\n\t}\n}\n\n/**\n * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated.\n * @returns {Promise<void>}\n */\nexport function invalidateAll() {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call invalidateAll() on the server');\n\t}\n\n\tforce_invalidation = true;\n\treturn _invalidate();\n}\n\n/**\n * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument).\n * Returns a `Promise` that resolves when the page is subsequently updated.\n * @param {{ includeLoadFunctions?: boolean }} [options]\n * @returns {Promise<void>}\n */\nexport function refreshAll({ includeLoadFunctions = true } = {}) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call refreshAll() on the server');\n\t}\n\n\tforce_invalidation = true;\n\treturn _invalidate(includeLoadFunctions, false);\n}\n\n/**\n * Programmatically preloads the given page, which means\n * 1. ensuring that the code for the page is loaded, and\n * 2. calling the page's load function with the appropriate options.\n *\n * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `<a>` element with `data-sveltekit-preload-data`.\n * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous.\n * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete.\n *\n * @param {string} href Page to preload\n * @returns {Promise<{ type: 'loaded'; status: number; data: Record<string, any> } | { type: 'redirect'; location: string }>}\n */\nexport async function preloadData(href) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call preloadData(...) on the server');\n\t}\n\n\tconst url = resolve_url(href);\n\tconst intent = await get_navigation_intent(url, false);\n\n\tif (!intent) {\n\t\tthrow new Error(`Attempted to preload a URL that does not belong to this app: ${url}`);\n\t}\n\n\tconst result = await _preload_data(intent);\n\tif (result.type === 'redirect') {\n\t\treturn {\n\t\t\ttype: result.type,\n\t\t\tlocation: result.location\n\t\t};\n\t}\n\n\tconst { status, data } = result.props.page ?? page;\n\treturn { type: result.type, status, data };\n}\n\n/**\n * Programmatically imports the code for routes that haven't yet been fetched.\n * Typically, you might call this to speed up subsequent navigation.\n *\n * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`).\n *\n * Unlike `preloadData`, this won't call `load` functions.\n * Returns a Promise that resolves when the modules have been imported.\n *\n * @param {string} pathname\n * @returns {Promise<void>}\n */\nexport async function preloadCode(pathname) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call preloadCode(...) on the server');\n\t}\n\n\t// `current.url` is null until the first navigation/hydration completes, so fall back\n\t// to `location` to support calling `preloadCode` during initial page load (#13297)\n\tconst url = new URL(pathname, current.url ?? location.href);\n\n\tif (DEV) {\n\t\tif (!pathname.startsWith('/')) {\n\t\t\tthrow new Error(\n\t\t\t\t'argument passed to preloadCode must be a pathname (i.e. \"/about\" rather than \"http://example.com/about\"'\n\t\t\t);\n\t\t}\n\n\t\tif (!pathname.startsWith(base)) {\n\t\t\tthrow new Error(\n\t\t\t\t`pathname passed to preloadCode must start with \\`paths.base\\` (i.e. \"${base}${pathname}\" rather than \"${pathname}\")`\n\t\t\t);\n\t\t}\n\n\t\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\t\tconst rerouted = await get_rerouted_url(url);\n\t\t\tif (!rerouted || !routes.find((route) => route.exec(get_url_path(rerouted)))) {\n\t\t\t\tthrow new Error(`'${pathname}' did not match any routes`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn _preload_code(url);\n}\n\n/**\n * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).\n *\n * @param {string | URL} url\n * @param {App.PageState} state\n * @returns {void}\n */\nexport function pushState(url, state) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call pushState(...) on the server');\n\t}\n\n\tif (DEV) {\n\t\tif (!started) {\n\t\t\tthrow new Error('Cannot call pushState(...) before router is initialized');\n\t\t}\n\n\t\ttry {\n\t\t\t// use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances\n\t\t\tdevalue.stringify(state);\n\t\t} catch (error) {\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Could not serialize state${error.path}`, { cause: error });\n\t\t}\n\t}\n\n\tupdate_scroll_positions(current_history_index);\n\n\tconst opts = {\n\t\t[HISTORY_INDEX]: (current_history_index += 1),\n\t\t[NAVIGATION_INDEX]: current_navigation_index,\n\t\t[PAGE_URL_KEY]: page.url.href,\n\t\t[STATES_KEY]: state\n\t};\n\n\thistory.pushState(opts, '', resolve_url(url));\n\thas_navigated = true;\n\n\tpage.state = state;\n\troot.$set({\n\t\t// we need to assign a new page object so that subscribers are correctly notified\n\t\tpage: untrack(() => clone_page(page))\n\t});\n\n\tclear_onward_history(current_history_index, current_navigation_index);\n}\n\n/**\n * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).\n *\n * @param {string | URL} url\n * @param {App.PageState} state\n * @returns {void}\n */\nexport function replaceState(url, state) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call replaceState(...) on the server');\n\t}\n\n\tif (DEV) {\n\t\tif (!started) {\n\t\t\tthrow new Error('Cannot call replaceState(...) before router is initialized');\n\t\t}\n\n\t\ttry {\n\t\t\t// use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances\n\t\t\tdevalue.stringify(state);\n\t\t} catch (error) {\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Could not serialize state${error.path}`, { cause: error });\n\t\t}\n\t}\n\n\tconst opts = {\n\t\t[HISTORY_INDEX]: current_history_index,\n\t\t[NAVIGATION_INDEX]: current_navigation_index,\n\t\t[PAGE_URL_KEY]: page.url.href,\n\t\t[STATES_KEY]: state\n\t};\n\n\thistory.replaceState(opts, '', resolve_url(url));\n\n\tpage.state = state;\n\troot.$set({\n\t\tpage: untrack(() => clone_page(page))\n\t});\n}\n\n/**\n * This action updates the `form` property of the current page with the given data and updates `page.status`.\n * In case of an error, it redirects to the nearest error page.\n * @template {Record<string, unknown> | undefined} Success\n * @template {Record<string, unknown> | undefined} Failure\n * @param {import('@sveltejs/kit').ActionResult<Success, Failure>} result\n * @returns {Promise<void>}\n */\nexport async function applyAction(result) {\n\tif (!BROWSER) {\n\t\tthrow new Error('Cannot call applyAction(...) on the server');\n\t}\n\n\tif (result.type === 'error') {\n\t\tawait set_nearest_error_page(result.error, result.status);\n\t} else if (result.type === 'redirect') {\n\t\tawait _goto(result.location, { invalidateAll: true }, 0);\n\t} else {\n\t\tpage.form = result.data;\n\t\tpage.status = result.status;\n\n\t\t/** @type {Record<string, any>} */\n\t\troot.$set({\n\t\t\t// this brings Svelte's view of the world in line with SvelteKit's\n\t\t\t// after use:enhance reset the form....\n\t\t\tform: null,\n\t\t\tpage: clone_page(page)\n\t\t});\n\n\t\t// ...so that setting the `form` prop takes effect and isn't ignored\n\t\tawait tick();\n\t\troot.$set({ form: result.data });\n\n\t\tif (result.type === 'success') {\n\t\t\treset_focus(page.url);\n\t\t}\n\t}\n}\n\n/**\n * @param {App.Error} error\n * @param {number} status\n */\nexport async function set_nearest_error_page(error, status = 500) {\n\tconst url = new URL(location.href);\n\n\tconst { branch, route } = current;\n\tif (!route) return;\n\n\tconst error_load = await load_nearest_error_page(current.branch.length, branch, route.errors);\n\tif (error_load) {\n\t\tconst navigation_result = await get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams: current.params,\n\t\t\tbranch: branch.slice(0, error_load.idx).concat(error_load.node),\n\t\t\tstatus,\n\t\t\terror,\n\t\t\t// do not set errors, we haven't changed the page so the previous ones are still current\n\t\t\troute\n\t\t});\n\n\t\tcurrent = { ...navigation_result.state, nav: current.nav };\n\n\t\troot.$set(navigation_result.props);\n\t\tupdate(navigation_result.props.page);\n\n\t\tvoid tick().then(() => reset_focus(current.url));\n\t}\n}\n\nfunction _start_router() {\n\thistory.scrollRestoration = 'manual';\n\n\t// Adopted from Nuxt.js\n\t// Reset scrollRestoration to auto when leaving page, allowing page reload\n\t// and back-navigation from other pages to use the browser to restore the\n\t// scrolling position.\n\taddEventListener('beforeunload', (e) => {\n\t\tlet should_block = false;\n\n\t\tpersist_state();\n\n\t\tif (!is_navigating) {\n\t\t\tconst nav = create_navigation(current, undefined, null, 'leave');\n\n\t\t\t// If we're navigating, beforeNavigate was already called. If we end up in here during navigation,\n\t\t\t// it's due to an external or full-page-reload link, for which we don't want to call the hook again.\n\t\t\t/** @type {import('@sveltejs/kit').BeforeNavigate} */\n\t\t\tconst navigation = {\n\t\t\t\t...nav.navigation,\n\t\t\t\tcancel: () => {\n\t\t\t\t\tshould_block = true;\n\t\t\t\t\tnav.reject(new Error('navigation cancelled'));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tbefore_navigate_callbacks.forEach((fn) => fn(navigation));\n\t\t}\n\n\t\tif (should_block) {\n\t\t\te.preventDefault();\n\t\t\te.returnValue = '';\n\t\t} else {\n\t\t\thistory.scrollRestoration = 'auto';\n\t\t}\n\t});\n\n\taddEventListener('visibilitychange', () => {\n\t\tif (document.visibilityState === 'hidden') {\n\t\t\tpersist_state();\n\t\t}\n\t});\n\n\t// @ts-expect-error this isn't supported everywhere yet\n\tif (!navigator.connection?.saveData) {\n\t\tsetup_preload();\n\t}\n\n\t/** @param {MouseEvent} event */\n\tcontainer.addEventListener('click', async (event) => {\n\t\t// Adapted from https://github.com/visionmedia/page.js\n\t\t// MIT license https://github.com/visionmedia/page.js#license\n\t\tif (event.button || event.which !== 1) return;\n\t\tif (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\t\tif (event.defaultPrevented) return;\n\n\t\tconst a = find_anchor(/** @type {Element} */ (event.composedPath()[0]), container);\n\t\tif (!a) return;\n\n\t\tconst { url, external, target, download } = get_link_info(a, base, app.hash);\n\t\tif (!url) return;\n\n\t\t// bail out before `beforeNavigate` if link opens in a different tab\n\t\tif (target === '_parent' || target === '_top') {\n\t\t\tif (window.parent !== window) return;\n\t\t} else if (target && target !== '_self') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst options = get_router_options(a);\n\t\tconst is_svg_a_element = a instanceof SVGAElement;\n\n\t\t// Ignore URL protocols that differ to the current one and are not http(s) (e.g. `mailto:`, `tel:`, `myapp:`, etc.)\n\t\t// This may be wrong when the protocol is x: and the link goes to y:.. which should be treated as an external\n\t\t// navigation, but it's not clear how to handle that case and it's not likely to come up in practice.\n\t\t// MEMO: Without this condition, firefox will open mailer twice.\n\t\t// See:\n\t\t// - https://github.com/sveltejs/kit/issues/4045\n\t\t// - https://github.com/sveltejs/kit/issues/5725\n\t\t// - https://github.com/sveltejs/kit/issues/6496\n\t\tif (\n\t\t\t!is_svg_a_element &&\n\t\t\turl.protocol !== location.protocol &&\n\t\t\t!(url.protocol === 'https:' || url.protocol === 'http:')\n\t\t)\n\t\t\treturn;\n\n\t\tif (download) return;\n\n\t\tconst [nonhash, hash] = (app.hash ? url.hash.replace(/^#/, '') : url.href).split('#');\n\t\tconst same_pathname = nonhash === strip_hash(location);\n\n\t\t// Ignore the following but fire beforeNavigate\n\t\tif (external || (options.reload && (!same_pathname || !hash))) {\n\t\t\tif (_before_navigate({ url, type: 'link', event })) {\n\t\t\t\t// set `navigating` to `true` to prevent `beforeNavigate` callbacks\n\t\t\t\t// being called when the page unloads\n\t\t\t\tis_navigating = true;\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if new url only differs by hash and use the browser default behavior in that case\n\t\t// This will ensure the `hashchange` event is fired\n\t\t// Removing the hash does a full page navigation in the browser, so make sure a hash is present\n\t\tif (hash !== undefined && same_pathname) {\n\t\t\t// If we are trying to navigate to the same hash, we should only\n\t\t\t// attempt to scroll to that element and avoid any history changes.\n\t\t\t// Otherwise, this can cause Firefox to incorrectly assign a null\n\t\t\t// history state value without any signal that we can detect.\n\t\t\tconst [, current_hash] = current.url.href.split('#');\n\t\t\tif (current_hash === hash) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// We're already on /# and click on a link that goes to /#, or we're on\n\t\t\t\t// /#top and click on a link that goes to /#top. In those cases just go to\n\t\t\t\t// the top of the page, and avoid a history change.\n\t\t\t\tif (hash === '' || (hash === 'top' && a.ownerDocument.getElementById('top') === null)) {\n\t\t\t\t\tscrollTo({ top: 0 });\n\t\t\t\t} else {\n\t\t\t\t\tconst element = a.ownerDocument.getElementById(decodeURIComponent(hash));\n\t\t\t\t\tif (element) {\n\t\t\t\t\t\telement.scrollIntoView();\n\t\t\t\t\t\telement.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// set this flag to distinguish between navigations triggered by\n\t\t\t// clicking a hash link and those triggered by popstate\n\t\t\thash_navigating = true;\n\n\t\t\tupdate_scroll_positions(current_history_index);\n\n\t\t\tupdate_url(url);\n\n\t\t\tif (!options.replace_state) return;\n\n\t\t\t// hashchange event shouldn't occur if the router is replacing state.\n\t\t\thash_navigating = false;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\t// allow the browser to repaint before navigating —\n\t\t// this prevents INP scores being penalised\n\t\tawait new Promise((fulfil) => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tsetTimeout(fulfil, 0);\n\t\t\t});\n\n\t\t\tsetTimeout(fulfil, 100); // fallback for edge case where rAF doesn't fire because e.g. tab was backgrounded\n\t\t});\n\n\t\tawait navigate({\n\t\t\ttype: 'link',\n\t\t\turl,\n\t\t\tkeepfocus: options.keepfocus,\n\t\t\tnoscroll: options.noscroll,\n\t\t\treplace_state: options.replace_state ?? url.href === location.href,\n\t\t\tevent\n\t\t});\n\t});\n\n\tcontainer.addEventListener('submit', (event) => {\n\t\tif (event.defaultPrevented) return;\n\n\t\tconst form = /** @type {HTMLFormElement} */ (\n\t\t\tHTMLFormElement.prototype.cloneNode.call(event.target)\n\t\t);\n\n\t\tconst submitter = /** @type {HTMLButtonElement | HTMLInputElement | null} */ (event.submitter);\n\n\t\tconst target = submitter?.formTarget || form.target;\n\n\t\tif (target === '_blank') return;\n\n\t\tconst method = submitter?.formMethod || form.method;\n\n\t\tif (method !== 'get') return;\n\n\t\t// It is impossible to use form actions with hash router, so we just ignore handling them here\n\t\tconst url = new URL(\n\t\t\t(submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action\n\t\t);\n\n\t\tif (is_external_url(url, base, false)) return;\n\n\t\tconst event_form = /** @type {HTMLFormElement} */ (event.target);\n\n\t\tconst options = get_router_options(event_form);\n\t\tif (options.reload) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst data = new FormData(event_form, submitter);\n\n\t\t// @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that\n\t\turl.search = new URLSearchParams(data).toString();\n\n\t\tvoid navigate({\n\t\t\ttype: 'form',\n\t\t\turl,\n\t\t\tkeepfocus: options.keepfocus,\n\t\t\tnoscroll: options.noscroll,\n\t\t\treplace_state: options.replace_state ?? url.href === location.href,\n\t\t\tevent\n\t\t});\n\t});\n\n\taddEventListener('popstate', async (event) => {\n\t\tif (resetting_focus) return;\n\n\t\tif (event.state?.[HISTORY_INDEX]) {\n\t\t\tconst history_index = event.state[HISTORY_INDEX];\n\t\t\ttoken = {};\n\n\t\t\t// if a popstate-driven navigation is cancelled, we need to counteract it\n\t\t\t// with history.go, which means we end up back here, hence this check\n\t\t\tif (history_index === current_history_index) return;\n\n\t\t\tconst scroll = scroll_positions[history_index];\n\t\t\tconst state = event.state[STATES_KEY] ?? {};\n\t\t\tconst url = new URL(event.state[PAGE_URL_KEY] ?? location.href);\n\t\t\tconst navigation_index = event.state[NAVIGATION_INDEX];\n\t\t\tconst is_hash_change = current.url ? strip_hash(location) === strip_hash(current.url) : false;\n\t\t\tconst shallow =\n\t\t\t\tnavigation_index === current_navigation_index && (has_navigated || is_hash_change);\n\n\t\t\tif (shallow) {\n\t\t\t\t// We don't need to navigate, we just need to update scroll and/or state.\n\t\t\t\t// This happens with hash links and `pushState`/`replaceState`. The\n\t\t\t\t// exception is if we haven't navigated yet, since we could have\n\t\t\t\t// got here after a modal navigation then a reload\n\t\t\t\tif (state !== page.state) {\n\t\t\t\t\tpage.state = state;\n\t\t\t\t}\n\n\t\t\t\tupdate_url(url);\n\n\t\t\t\tscroll_positions[current_history_index] = scroll_state();\n\t\t\t\tif (scroll) scrollTo(scroll.x, scroll.y);\n\n\t\t\t\tcurrent_history_index = history_index;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst delta = history_index - current_history_index;\n\n\t\t\tawait navigate({\n\t\t\t\ttype: 'popstate',\n\t\t\t\turl,\n\t\t\t\tpopped: {\n\t\t\t\t\tstate,\n\t\t\t\t\tscroll,\n\t\t\t\t\tdelta\n\t\t\t\t},\n\t\t\t\taccept: () => {\n\t\t\t\t\tcurrent_history_index = history_index;\n\t\t\t\t\tcurrent_navigation_index = navigation_index;\n\t\t\t\t},\n\t\t\t\tblock: () => {\n\t\t\t\t\thistory.go(-delta);\n\t\t\t\t},\n\t\t\t\tnav_token: token,\n\t\t\t\tevent\n\t\t\t});\n\t\t} else {\n\t\t\t// since popstate event is also emitted when an anchor referencing the same\n\t\t\t// document is clicked, we have to check that the router isn't already handling\n\t\t\t// the navigation. otherwise we would be updating the page store twice.\n\t\t\tif (!hash_navigating) {\n\t\t\t\tconst url = new URL(location.href);\n\t\t\t\tupdate_url(url);\n\n\t\t\t\t// if the user edits the hash via the browser URL bar, trigger a full-page\n\t\t\t\t// reload to align with pathname router behavior\n\t\t\t\tif (app.hash) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\taddEventListener('hashchange', () => {\n\t\t// if the hashchange happened as a result of clicking on a link,\n\t\t// we need to update history, otherwise we have to leave it alone\n\t\tif (hash_navigating) {\n\t\t\thash_navigating = false;\n\t\t\thistory.replaceState(\n\t\t\t\t{\n\t\t\t\t\t...history.state,\n\t\t\t\t\t[HISTORY_INDEX]: ++current_history_index,\n\t\t\t\t\t[NAVIGATION_INDEX]: current_navigation_index\n\t\t\t\t},\n\t\t\t\t'',\n\t\t\t\tlocation.href\n\t\t\t);\n\t\t}\n\t});\n\n\t// fix link[rel=icon], because browsers will occasionally try to load relative\n\t// URLs after a pushState/replaceState, resulting in a 404 — see\n\t// https://github.com/sveltejs/kit/issues/3748#issuecomment-1125980897\n\tfor (const link of document.querySelectorAll('link')) {\n\t\tif (ICON_REL_ATTRIBUTES.has(link.rel)) {\n\t\t\tlink.href = link.href; // eslint-disable-line\n\t\t}\n\t}\n\n\taddEventListener('pageshow', (event) => {\n\t\t// If the user navigates to another site and then uses the back button and\n\t\t// bfcache hits, we need to set navigating to null, the site doesn't know\n\t\t// the navigation away from it was successful.\n\t\t// Info about bfcache here: https://web.dev/bfcache\n\t\tif (event.persisted) {\n\t\t\tstores.navigating.set((navigating.current = null));\n\t\t}\n\t});\n\n\t/**\n\t * @param {URL} url\n\t */\n\tfunction update_url(url) {\n\t\tcurrent.url = page.url = url;\n\t\tstores.page.set(clone_page(page));\n\t\tstores.page.notify();\n\t}\n}\n\n/**\n * @param {HTMLElement} target\n * @param {import('./types.js').HydrateOptions} opts\n * @returns {Promise<void>}\n */\nasync function _hydrate(\n\ttarget,\n\t{ status = 200, error, node_ids, params, route, server_route, data: server_data_nodes, form }\n) {\n\thydrated = true;\n\n\tconst url = new URL(location.href);\n\n\t/** @type {import('types').CSRRoute | undefined} */\n\tlet parsed_route;\n\n\tif (__SVELTEKIT_CLIENT_ROUTING__) {\n\t\tif (!__SVELTEKIT_EMBEDDED__) {\n\t\t\t// See https://github.com/sveltejs/kit/pull/4935#issuecomment-1328093358 for one motivation\n\t\t\t// of determining the params on the client side.\n\t\t\t({ params = {}, route = { id: null } } = (await get_navigation_intent(url, false)) || {});\n\t\t}\n\n\t\tparsed_route = routes.find(({ id }) => id === route.id);\n\t} else {\n\t\t// undefined in case of 404\n\t\tif (server_route) {\n\t\t\tparsed_route = route = parse_server_route(server_route, app.nodes);\n\t\t} else {\n\t\t\troute = { id: null };\n\t\t\tparams = {};\n\t\t}\n\t}\n\n\t/** @type {import('./types.js').NavigationFinished | undefined} */\n\tlet result;\n\tlet hydrate = true;\n\n\ttry {\n\t\tconst branch_promises = node_ids.map(async (n, i) => {\n\t\t\tconst server_data_node = server_data_nodes[i];\n\t\t\t// Type isn't completely accurate, we still need to deserialize uses\n\t\t\tif (server_data_node?.uses) {\n\t\t\t\tserver_data_node.uses = deserialize_uses(server_data_node.uses);\n\t\t\t}\n\n\t\t\treturn load_node({\n\t\t\t\tloader: app.nodes[n],\n\t\t\t\turl,\n\t\t\t\tparams,\n\t\t\t\troute,\n\t\t\t\tparent: async () => {\n\t\t\t\t\tconst data = {};\n\t\t\t\t\tfor (let j = 0; j < i; j += 1) {\n\t\t\t\t\t\tObject.assign(data, (await branch_promises[j]).data);\n\t\t\t\t\t}\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tserver_data_node: create_data_node(server_data_node)\n\t\t\t});\n\t\t});\n\n\t\t/** @type {Array<import('./types.js').BranchNode | undefined>} */\n\t\tconst branch = await Promise.all(branch_promises);\n\n\t\t// server-side will have compacted the branch, reinstate empty slots\n\t\t// so that error boundaries can be lined up correctly\n\t\tif (parsed_route) {\n\t\t\tconst layouts = parsed_route.layouts;\n\t\t\tfor (let i = 0; i < layouts.length; i++) {\n\t\t\t\tif (!layouts[i]) {\n\t\t\t\t\tbranch.splice(i, 0, undefined);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult = await get_navigation_result_from_branch({\n\t\t\turl,\n\t\t\tparams,\n\t\t\tbranch,\n\t\t\tstatus,\n\t\t\terror,\n\t\t\terrors: parsed_route?.errors, // TODO load earlier?\n\t\t\tform,\n\t\t\troute: parsed_route ?? null\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Redirect) {\n\t\t\t// this is a real edge case — `load` would need to return\n\t\t\t// a redirect but only in the browser\n\t\t\treturn await native_navigation(new URL(error.location, location.href));\n\t\t}\n\n\t\tresult = await load_root_error_page({\n\t\t\tstatus: get_status(error),\n\t\t\terror: await handle_error(error, { url, params, route }),\n\t\t\turl,\n\t\t\troute\n\t\t});\n\n\t\ttarget.textContent = '';\n\t\thydrate = false;\n\t}\n\n\t// Exit early when we encounter a redirect while loading the root error page.\n\t// In this case, `initialize` will be called later on\n\tif (!result) return;\n\n\tif (result.props.page) {\n\t\tresult.props.page.state = {};\n\t}\n\n\tawait initialize(result, target, hydrate);\n}\n\n/**\n * @param {URL} url\n * @param {boolean[]} invalid\n * @returns {Promise<import('types').ServerNodesResponse | import('types').ServerRedirectNode>}\n */\nasync function load_data(url, invalid) {\n\tconst data_url = new URL(url);\n\tdata_url.pathname = add_data_suffix(url.pathname);\n\tif (url.pathname.endsWith('/')) {\n\t\tdata_url.searchParams.append(TRAILING_SLASH_PARAM, '1');\n\t}\n\tif (DEV && url.searchParams.has(INVALIDATED_PARAM)) {\n\t\tthrow new Error(`Cannot used reserved query parameter \"${INVALIDATED_PARAM}\"`);\n\t}\n\tdata_url.searchParams.append(INVALIDATED_PARAM, invalid.map((i) => (i ? '1' : '0')).join(''));\n\n\t// use window.fetch directly to allow using a 3rd party-patched fetch implementation\n\tconst fetcher = DEV ? dev_fetch : window.fetch;\n\tconst res = await fetcher(data_url.href, {});\n\n\tif (!res.ok) {\n\t\t// error message is a JSON-stringified string which devalue can't handle at the top level\n\t\t// turn it into a HttpError to not call handleError on the client again (was already handled on the server)\n\t\t// if `__data.json` doesn't exist or the server has an internal error,\n\t\t// avoid parsing the HTML error page as a JSON\n\t\t/** @type {string | undefined} */\n\t\tlet message;\n\t\tif (res.headers.get('content-type')?.includes('application/json')) {\n\t\t\tmessage = await res.json();\n\t\t} else if (res.status === 404) {\n\t\t\tmessage = 'Not Found';\n\t\t} else if (res.status === 500) {\n\t\t\tmessage = 'Internal Error';\n\t\t}\n\t\tthrow new HttpError(res.status, message);\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tprocess_stream(resolve, res).catch(reject);\n\t});\n\n\t// TODO edge case handling necessary? stream() read fails?\n}\n\n/**\n * @param {(value: ServerNodesResponse | ServerRedirectNode) => void} resolve\n * @param {Response} res\n * @returns {Promise<void>}\n */\nasync function process_stream(resolve, res) {\n\tconst reader = /** @type {ReadableStream<Uint8Array>} */ (res.body).getReader();\n\n\t/**\n\t * Map of deferred promises that will be resolved by a subsequent chunk of data\n\t * @type {Map<string, import('types').Deferred>}\n\t */\n\tconst deferreds = new Map();\n\n\t/**\n\t * @param {any} data\n\t */\n\tfunction deserialize(data) {\n\t\treturn devalue.unflatten(data, {\n\t\t\t...app.decoders,\n\t\t\tPromise: (id) => {\n\t\t\t\treturn new Promise((fulfil, reject) => {\n\t\t\t\t\tdeferreds.set(id, { fulfil, reject });\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tfor await (const node of read_ndjson(reader)) {\n\t\tif (node.type === 'redirect') {\n\t\t\treturn resolve(node);\n\t\t}\n\n\t\tif (node.type === 'data') {\n\t\t\t// This is the first (and possibly only, if no pending promises) chunk\n\t\t\tnode.nodes?.forEach((/** @type {any} */ node) => {\n\t\t\t\tif (node?.type === 'data') {\n\t\t\t\t\tnode.uses = deserialize_uses(node.uses);\n\t\t\t\t\tnode.data = deserialize(node.data);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tresolve(node);\n\t\t} else if (node.type === 'chunk') {\n\t\t\t// This is a subsequent chunk containing deferred data\n\t\t\tconst { id, data, error } = node;\n\t\t\tconst deferred = /** @type {import('types').Deferred} */ (deferreds.get(id));\n\t\t\tdeferreds.delete(id);\n\n\t\t\tif (error) {\n\t\t\t\tdeferred.reject(deserialize(error));\n\t\t\t} else {\n\t\t\t\tdeferred.fulfil(deserialize(data));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {any} uses\n * @return {import('types').Uses}\n */\nfunction deserialize_uses(uses) {\n\treturn {\n\t\tdependencies: new Set(uses?.dependencies ?? []),\n\t\tparams: new Set(uses?.params ?? []),\n\t\tparent: !!uses?.parent,\n\t\troute: !!uses?.route,\n\t\turl: !!uses?.url,\n\t\tsearch_params: new Set(uses?.search_params ?? [])\n\t};\n}\n\n/**\n * This flag is used to avoid client-side navigation when we're only using\n * `location.replace()` to set focus.\n */\nlet resetting_focus = false;\n\n/**\n * @param {URL} url\n * @param {boolean} [scroll]\n */\nfunction reset_focus(url, scroll = true) {\n\tconst autofocus = document.querySelector('[autofocus]');\n\tif (autofocus) {\n\t\t// @ts-ignore\n\t\tautofocus.focus();\n\t} else {\n\t\t// Reset page selection and focus\n\n\t\t// Mimic the browsers' behaviour and set the sequential focus navigation\n\t\t// starting point to the fragment identifier.\n\t\tconst id = get_id(url);\n\t\tif (id && document.getElementById(id)) {\n\t\t\tconst { x, y } = scroll_state();\n\n\t\t\t// `element.focus()` doesn't work on Safari and Firefox Ubuntu so we need\n\t\t\t// to use this hack with `location.replace()` instead.\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst history_state = history.state;\n\n\t\t\t\tresetting_focus = true;\n\t\t\t\tlocation.replace(new URL(`#${id}`, location.href));\n\n\t\t\t\t// Firefox has a bug that sets the history state to `null` so we need to\n\t\t\t\t// restore it after. See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924\n\t\t\t\t// This is also needed to restore the original hash if we're using hash routing\n\t\t\t\thistory.replaceState(history_state, '', url);\n\n\t\t\t\t// If scroll management has already happened earlier, we need to restore\n\t\t\t\t// the scroll position after setting the sequential focus navigation starting point\n\t\t\t\tif (scroll) scrollTo(x, y);\n\t\t\t\tresetting_focus = false;\n\t\t\t});\n\t\t} else {\n\t\t\t// If the ID doesn't exist, we try to mimic browsers' behaviour as closely\n\t\t\t// as possible by targeting the first scrollable region. Unfortunately, it's\n\t\t\t// not a perfect match — e.g. shift-tabbing won't immediately cycle up from\n\t\t\t// the end of the page on Chromium\n\t\t\t// See https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area\n\t\t\tconst root = document.body;\n\t\t\tconst tabindex = root.getAttribute('tabindex');\n\n\t\t\troot.tabIndex = -1;\n\t\t\t// TODO: remove this when we switch to TypeScript 6\n\t\t\t// @ts-ignore options.focusVisible is only typed in TypeScript 6\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility\n\t\t\troot.focus({ preventScroll: true, focusVisible: false });\n\n\t\t\t// restore `tabindex` as to prevent `root` from stealing input from elements\n\t\t\tif (tabindex !== null) {\n\t\t\t\troot.setAttribute('tabindex', tabindex);\n\t\t\t} else {\n\t\t\t\troot.removeAttribute('tabindex');\n\t\t\t}\n\t\t}\n\n\t\t// capture current selection, so we can compare the state after\n\t\t// snapshot restoration and afterNavigate callbacks have run\n\t\tconst selection = getSelection();\n\n\t\tif (selection && selection.type !== 'None') {\n\t\t\t/** @type {Range[]} */\n\t\t\tconst ranges = [];\n\n\t\t\tfor (let i = 0; i < selection.rangeCount; i += 1) {\n\t\t\t\tranges.push(selection.getRangeAt(i));\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (selection.rangeCount !== ranges.length) return;\n\n\t\t\t\tfor (let i = 0; i < selection.rangeCount; i += 1) {\n\t\t\t\t\tconst a = ranges[i];\n\t\t\t\t\tconst b = selection.getRangeAt(i);\n\n\t\t\t\t\t// we need to do a deep comparison rather than just `a !== b` because\n\t\t\t\t\t// Safari behaves differently to other browsers\n\t\t\t\t\tif (\n\t\t\t\t\t\ta.commonAncestorContainer !== b.commonAncestorContainer ||\n\t\t\t\t\t\ta.startContainer !== b.startContainer ||\n\t\t\t\t\t\ta.endContainer !== b.endContainer ||\n\t\t\t\t\t\ta.startOffset !== b.startOffset ||\n\t\t\t\t\t\ta.endOffset !== b.endOffset\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if the selection hasn't changed (as a result of an element being (auto)focused,\n\t\t\t\t// or a programmatic selection, we reset everything as part of the navigation)\n\t\t\t\t// fixes https://github.com/sveltejs/kit/issues/8439\n\t\t\t\tselection.removeAllRanges();\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n * @template {import('@sveltejs/kit').NavigationType} T\n * @param {import('./types.js').NavigationState} current\n * @param {import('./types.js').NavigationIntent | undefined} intent\n * @param {URL | null} url\n * @param {T} type\n * @param {{ x: number, y: number } | null} [target_scroll] The scroll position for the target (for popstate navigations)\n */\nfunction create_navigation(current, intent, url, type, target_scroll = null) {\n\t/** @type {(value: any) => void} */\n\tlet fulfil;\n\n\t/** @type {(error: any) => void} */\n\tlet reject;\n\n\tconst complete = new Promise((f, r) => {\n\t\tfulfil = f;\n\t\treject = r;\n\t});\n\n\t// Handle any errors off-chain so that it doesn't show up as an unhandled rejection\n\tcomplete.catch(noop);\n\n\t/** @type {(import('@sveltejs/kit').Navigation | import('@sveltejs/kit').AfterNavigate) & { type: T }} */\n\tconst navigation = /** @type {any} */ ({\n\t\tfrom: {\n\t\t\tparams: current.params,\n\t\t\troute: { id: current.route?.id ?? null },\n\t\t\turl: current.url,\n\t\t\tscroll: scroll_state()\n\t\t},\n\t\tto: url && {\n\t\t\tparams: intent?.params ?? null,\n\t\t\troute: { id: intent?.route?.id ?? null },\n\t\t\turl,\n\t\t\tscroll: target_scroll\n\t\t},\n\t\twillUnload: !intent,\n\t\ttype,\n\t\tcomplete\n\t});\n\n\treturn {\n\t\tnavigation,\n\t\t// @ts-expect-error\n\t\tfulfil,\n\t\t// @ts-expect-error\n\t\treject\n\t};\n}\n\n/**\n * TODO: remove this in 3.0 when the page store is also removed\n *\n * We need to assign a new page object so that subscribers are correctly notified.\n * However, spreading `{ ...page }` returns an empty object so we manually\n * assign to each property instead.\n *\n * @param {import('@sveltejs/kit').Page} page\n */\nfunction clone_page(page) {\n\treturn {\n\t\tdata: page.data,\n\t\terror: page.error,\n\t\tform: page.form,\n\t\tparams: page.params,\n\t\troute: page.route,\n\t\tstate: page.state,\n\t\tstatus: page.status,\n\t\turl: page.url\n\t};\n}\n\n/**\n * @param {URL} url\n * @returns {URL}\n */\nfunction decode_hash(url) {\n\tconst new_url = new URL(url);\n\t// Safari, for some reason, does change # to %23, when entered through the address bar\n\tnew_url.hash = decodeURIComponent(url.hash);\n\treturn new_url;\n}\n\n/**\n * @param {URL} url\n * @returns {string}\n */\nfunction get_id(url) {\n\tlet id;\n\n\tif (app.hash) {\n\t\tconst [, , second] = url.hash.split('#', 3);\n\t\tid = second ?? '';\n\t} else {\n\t\tid = url.hash.slice(1);\n\t}\n\n\treturn decodeURIComponent(id);\n}\n\nif (DEV) {\n\t// Nasty hack to silence harmless warnings the user can do nothing about\n\tconst console_warn = console.warn;\n\tconsole.warn = function warn(...args) {\n\t\tif (\n\t\t\targs.length === 1 &&\n\t\t\t/<(Layout|Page|Error)(_[\\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test(\n\t\t\t\targs[0]\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconsole_warn(...args);\n\t};\n\n\tif (import.meta.hot) {\n\t\timport.meta.hot.on('vite:beforeUpdate', () => {\n\t\t\tif (errored) {\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t});\n\t}\n}\n"],"names":["HttpError","status","body","Redirect","location","SvelteKitError","text","message","param_pattern","root_group_pattern","parse_route_id","id","params","get_route_segments","segment","rest_match","optional_match","parts","content","i","escape","code","match","is_optional","is_rest","name","matcher","affects_path","route","exec","matchers","result","values","values_needing_match","value","buffered","param","s","next_param","next_value","str","parse","nodes","server_loads","dictionary","layouts_with_server_load","leaf","layouts","errors","pattern","path","n","create_layout_loader","create_leaf_loader","uses_server_data","get","key","set","stringify","data","UNDEFINED","HOLE","NAN","POSITIVE_INFINITY","NEGATIVE_INFINITY","NEGATIVE_ZERO","SPARSE","MAX_ARRAY_LEN","MAX_ARRAY_INDEX","is_valid_array_index","is_valid_array_len","decode_native","base64","decode_buffer","decode_legacy","binary_string","len","array","native","buffer","decode64","merge_operations","defaults","overrides","array_buffer_byte_length","shared_array_buffer_byte_length","parse_operations","primitive","iso","tag","source","flags","byteOffset","length","error","Constructor","target","map","default_parse_operations","unflatten","parsed","revivers","options","ops","hydrate","hydrated","hydrating","index","standalone","type","reviver","wrapped_index","obj","idx","object","compact","arr","val","INVALIDATED_PARAM","TRAILING_SLASH_PARAM","create_remote_key","payload","get_status","get_message","DATA_SUFFIX","HTML_DATA_SUFFIX","add_data_suffix","pathname","noop_span","noop_span_context","read_stream","reader","delimiter","done","decoder","split","chunk","read_ndjson","block","line","onMount","svelte","ICON_REL_ATTRIBUTES","rendering_error","scroll_positions","storage.get","SCROLL_KEY","snapshots","SNAPSHOT_KEY","stores","notifiable_store","writable","create_updated_store","update_scroll_positions","scroll_state","clear_onward_history","current_history_index","current_navigation_index","native_navigation","url","replace","noop","update_service_worker","registration","base","routes","default_layout_loader","default_error_loader","container","app","invalidated","components","load_cache","discard_load_cache","f","current_a","reroute_cache","before_navigate_callbacks","on_navigate_callbacks","after_navigate_callbacks","current","started","autoscroll","is_navigating","hash_navigating","has_navigated","force_invalidation","root","token","preload_tokens","query_map","live_query_map","start","_app","_target","q","p","l","k","HISTORY_INDEX","NAVIGATION_INDEX","scroll","restore_scroll","_hydrate","navigate","resolve_url","decode_hash","_start_router","reset_invalidation","capture_snapshot","c","restore_snapshot","persist_state","storage.set","_goto","redirect_count","nav_token","query_keys","live_query_keys","entries","entry","push_invalidated","svelte.tick","resource","_preload_data","intent","preload","load_route","_preload_code","get_navigation_intent","load","initialize","nav","update","navigation","fn","get_navigation_result_from_branch","branch","form","slash","node","normalize_path","branch_node","clone_page","page","data_changed","prev","load_node","loader","parent","server_data_node","is_tracking","uses","depends","deps","dep","href","load_input","make_trackable","init","resolved","promise","resolve_fetch_url","input","requested","subsequent_fetch","initial_fetch","has_changed","parent_changed","route_changed","url_changed","search_params_changed","tracked_params","create_data_node","previous","diff_search_params","old_url","new_url","changed","old_values","new_values","preload_error","invalidating","loaders","server_data","get_page_key","parent_invalid","invalid_server_nodes","invalid","load_data","handled_error","handle_error","load_root_error_page","server_data_nodes","branch_promises","j","err","error_load","load_nearest_error_page","server_fallback","e","origin","root_layout","root_error","error_template","handled","html","get_rerouted_url","rerouted","tmp","is_external_url","get_url_path","decode_params","decode_pathname","_before_navigate","delta","event","should_block","create_navigation","cancellable","popped","keepfocus","noscroll","replace_state","state","accept","prev_token","previous_history_index","previous_navigation_index","navigating","navigation_result","change","STATES_KEY","load_cache_fork","commit_promise","after_navigate","cleanup","fork","svelte.settled","activeElement","deep_linked","get_id","changed_focus","reset_focus","setup_preload","mousemove_timeout","current_priority","PRELOAD_PRIORITIES","tap","observer","element","priority","a","find_anchor","interacted","external","download","get_link_info","get_router_options","same_url","add_navigation_callback","callbacks","callback","afterNavigate","goto","opts","nonhash","hash","same_pathname","strip_hash","current_hash","update_url","fulfil","submitter","event_form","resetting_focus","history_index","PAGE_URL_KEY","navigation_index","is_hash_change","link","node_ids","server_route","parsed_route","deserialize_uses","data_url","fetcher","res","resolve","reject","process_stream","deferreds","deserialize","devalue.unflatten","deferred","autofocus","x","y","history_state","tabindex","selection","ranges","b","target_scroll","complete","r","second"],"mappings":"kTAEO,MAAMA,CAAU,CAKtB,YAAYC,EAAQC,EAAM,CACzB,KAAK,OAASD,EACV,OAAOC,GAAS,SACnB,KAAK,KAAO,CAAE,QAASA,CAAI,E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