@neurouter/server 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1000) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +10 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/app.d.ts +29 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +79 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/console.d.ts +16 -0
  9. package/dist/console.d.ts.map +1 -0
  10. package/dist/console.js +149 -0
  11. package/dist/console.js.map +1 -0
  12. package/dist/controlplane/api/context.d.ts +64 -0
  13. package/dist/controlplane/api/context.d.ts.map +1 -0
  14. package/dist/controlplane/api/context.js +7 -0
  15. package/dist/controlplane/api/context.js.map +1 -0
  16. package/dist/controlplane/api/plugin.d.ts +8 -0
  17. package/dist/controlplane/api/plugin.d.ts.map +1 -0
  18. package/dist/controlplane/api/plugin.js +36 -0
  19. package/dist/controlplane/api/plugin.js.map +1 -0
  20. package/dist/controlplane/api/ports.d.ts +40 -0
  21. package/dist/controlplane/api/ports.d.ts.map +1 -0
  22. package/dist/controlplane/api/ports.js +2 -0
  23. package/dist/controlplane/api/ports.js.map +1 -0
  24. package/dist/controlplane/api/problem.d.ts +15 -0
  25. package/dist/controlplane/api/problem.d.ts.map +1 -0
  26. package/dist/controlplane/api/problem.js +80 -0
  27. package/dist/controlplane/api/problem.js.map +1 -0
  28. package/dist/controlplane/api/routes/audit.d.ts +6 -0
  29. package/dist/controlplane/api/routes/audit.d.ts.map +1 -0
  30. package/dist/controlplane/api/routes/audit.js +139 -0
  31. package/dist/controlplane/api/routes/audit.js.map +1 -0
  32. package/dist/controlplane/api/routes/auth.d.ts +10 -0
  33. package/dist/controlplane/api/routes/auth.d.ts.map +1 -0
  34. package/dist/controlplane/api/routes/auth.js +125 -0
  35. package/dist/controlplane/api/routes/auth.js.map +1 -0
  36. package/dist/controlplane/api/routes/environments.d.ts +5 -0
  37. package/dist/controlplane/api/routes/environments.d.ts.map +1 -0
  38. package/dist/controlplane/api/routes/environments.js +118 -0
  39. package/dist/controlplane/api/routes/environments.js.map +1 -0
  40. package/dist/controlplane/api/routes/evals.d.ts +5 -0
  41. package/dist/controlplane/api/routes/evals.d.ts.map +1 -0
  42. package/dist/controlplane/api/routes/evals.js +348 -0
  43. package/dist/controlplane/api/routes/evals.js.map +1 -0
  44. package/dist/controlplane/api/routes/inbox.d.ts +5 -0
  45. package/dist/controlplane/api/routes/inbox.d.ts.map +1 -0
  46. package/dist/controlplane/api/routes/inbox.js +226 -0
  47. package/dist/controlplane/api/routes/inbox.js.map +1 -0
  48. package/dist/controlplane/api/routes/keys.d.ts +5 -0
  49. package/dist/controlplane/api/routes/keys.d.ts.map +1 -0
  50. package/dist/controlplane/api/routes/keys.js +176 -0
  51. package/dist/controlplane/api/routes/keys.js.map +1 -0
  52. package/dist/controlplane/api/routes/metrics.d.ts +5 -0
  53. package/dist/controlplane/api/routes/metrics.d.ts.map +1 -0
  54. package/dist/controlplane/api/routes/metrics.js +197 -0
  55. package/dist/controlplane/api/routes/metrics.js.map +1 -0
  56. package/dist/controlplane/api/routes/overlays.d.ts +36 -0
  57. package/dist/controlplane/api/routes/overlays.d.ts.map +1 -0
  58. package/dist/controlplane/api/routes/overlays.js +244 -0
  59. package/dist/controlplane/api/routes/overlays.js.map +1 -0
  60. package/dist/controlplane/api/routes/public.d.ts +7 -0
  61. package/dist/controlplane/api/routes/public.d.ts.map +1 -0
  62. package/dist/controlplane/api/routes/public.js +71 -0
  63. package/dist/controlplane/api/routes/public.js.map +1 -0
  64. package/dist/controlplane/api/routes/servers.d.ts +45 -0
  65. package/dist/controlplane/api/routes/servers.d.ts.map +1 -0
  66. package/dist/controlplane/api/routes/servers.js +423 -0
  67. package/dist/controlplane/api/routes/servers.js.map +1 -0
  68. package/dist/controlplane/api/routes/settings.d.ts +21 -0
  69. package/dist/controlplane/api/routes/settings.d.ts.map +1 -0
  70. package/dist/controlplane/api/routes/settings.js +408 -0
  71. package/dist/controlplane/api/routes/settings.js.map +1 -0
  72. package/dist/controlplane/api/routes/tasks.d.ts +12 -0
  73. package/dist/controlplane/api/routes/tasks.d.ts.map +1 -0
  74. package/dist/controlplane/api/routes/tasks.js +144 -0
  75. package/dist/controlplane/api/routes/tasks.js.map +1 -0
  76. package/dist/controlplane/api/routes/tools.d.ts +14 -0
  77. package/dist/controlplane/api/routes/tools.d.ts.map +1 -0
  78. package/dist/controlplane/api/routes/tools.js +174 -0
  79. package/dist/controlplane/api/routes/tools.js.map +1 -0
  80. package/dist/controlplane/api/routes.d.ts +25 -0
  81. package/dist/controlplane/api/routes.d.ts.map +1 -0
  82. package/dist/controlplane/api/routes.js +43 -0
  83. package/dist/controlplane/api/routes.js.map +1 -0
  84. package/dist/controlplane/api/views.d.ts +53 -0
  85. package/dist/controlplane/api/views.d.ts.map +1 -0
  86. package/dist/controlplane/api/views.js +290 -0
  87. package/dist/controlplane/api/views.js.map +1 -0
  88. package/dist/controlplane/auth/guards.d.ts +40 -0
  89. package/dist/controlplane/auth/guards.d.ts.map +1 -0
  90. package/dist/controlplane/auth/guards.js +87 -0
  91. package/dist/controlplane/auth/guards.js.map +1 -0
  92. package/dist/controlplane/auth/local-link.d.ts +28 -0
  93. package/dist/controlplane/auth/local-link.d.ts.map +1 -0
  94. package/dist/controlplane/auth/local-link.js +41 -0
  95. package/dist/controlplane/auth/local-link.js.map +1 -0
  96. package/dist/controlplane/auth/login.d.ts +51 -0
  97. package/dist/controlplane/auth/login.d.ts.map +1 -0
  98. package/dist/controlplane/auth/login.js +115 -0
  99. package/dist/controlplane/auth/login.js.map +1 -0
  100. package/dist/controlplane/auth/oidc.d.ts +63 -0
  101. package/dist/controlplane/auth/oidc.d.ts.map +1 -0
  102. package/dist/controlplane/auth/oidc.js +76 -0
  103. package/dist/controlplane/auth/oidc.js.map +1 -0
  104. package/dist/controlplane/auth/sessions.d.ts +46 -0
  105. package/dist/controlplane/auth/sessions.d.ts.map +1 -0
  106. package/dist/controlplane/auth/sessions.js +65 -0
  107. package/dist/controlplane/auth/sessions.js.map +1 -0
  108. package/dist/controlplane/config-sync/reconcile.d.ts +88 -0
  109. package/dist/controlplane/config-sync/reconcile.d.ts.map +1 -0
  110. package/dist/controlplane/config-sync/reconcile.js +287 -0
  111. package/dist/controlplane/config-sync/reconcile.js.map +1 -0
  112. package/dist/controlplane/environments/environments.service.d.ts +46 -0
  113. package/dist/controlplane/environments/environments.service.d.ts.map +1 -0
  114. package/dist/controlplane/environments/environments.service.js +209 -0
  115. package/dist/controlplane/environments/environments.service.js.map +1 -0
  116. package/dist/controlplane/evals/evals.service.d.ts +126 -0
  117. package/dist/controlplane/evals/evals.service.d.ts.map +1 -0
  118. package/dist/controlplane/evals/evals.service.js +551 -0
  119. package/dist/controlplane/evals/evals.service.js.map +1 -0
  120. package/dist/controlplane/evals/model-keys.d.ts +37 -0
  121. package/dist/controlplane/evals/model-keys.d.ts.map +1 -0
  122. package/dist/controlplane/evals/model-keys.js +43 -0
  123. package/dist/controlplane/evals/model-keys.js.map +1 -0
  124. package/dist/controlplane/keys/api-key-format.d.ts +19 -0
  125. package/dist/controlplane/keys/api-key-format.d.ts.map +1 -0
  126. package/dist/controlplane/keys/api-key-format.js +39 -0
  127. package/dist/controlplane/keys/api-key-format.js.map +1 -0
  128. package/dist/controlplane/keys/api-keys.service.d.ts +42 -0
  129. package/dist/controlplane/keys/api-keys.service.d.ts.map +1 -0
  130. package/dist/controlplane/keys/api-keys.service.js +91 -0
  131. package/dist/controlplane/keys/api-keys.service.js.map +1 -0
  132. package/dist/controlplane/oauth/authorize.d.ts +101 -0
  133. package/dist/controlplane/oauth/authorize.d.ts.map +1 -0
  134. package/dist/controlplane/oauth/authorize.js +172 -0
  135. package/dist/controlplane/oauth/authorize.js.map +1 -0
  136. package/dist/controlplane/oauth/cimd.d.ts +52 -0
  137. package/dist/controlplane/oauth/cimd.d.ts.map +1 -0
  138. package/dist/controlplane/oauth/cimd.js +173 -0
  139. package/dist/controlplane/oauth/cimd.js.map +1 -0
  140. package/dist/controlplane/oauth/clients.service.d.ts +101 -0
  141. package/dist/controlplane/oauth/clients.service.d.ts.map +1 -0
  142. package/dist/controlplane/oauth/clients.service.js +269 -0
  143. package/dist/controlplane/oauth/clients.service.js.map +1 -0
  144. package/dist/controlplane/oauth/metadata.d.ts +27 -0
  145. package/dist/controlplane/oauth/metadata.d.ts.map +1 -0
  146. package/dist/controlplane/oauth/metadata.js +35 -0
  147. package/dist/controlplane/oauth/metadata.js.map +1 -0
  148. package/dist/controlplane/oauth/pkce.d.ts +8 -0
  149. package/dist/controlplane/oauth/pkce.d.ts.map +1 -0
  150. package/dist/controlplane/oauth/pkce.js +16 -0
  151. package/dist/controlplane/oauth/pkce.js.map +1 -0
  152. package/dist/controlplane/oauth/redirect-uri.d.ts +15 -0
  153. package/dist/controlplane/oauth/redirect-uri.d.ts.map +1 -0
  154. package/dist/controlplane/oauth/redirect-uri.js +61 -0
  155. package/dist/controlplane/oauth/redirect-uri.js.map +1 -0
  156. package/dist/controlplane/oauth/resource.d.ts +28 -0
  157. package/dist/controlplane/oauth/resource.d.ts.map +1 -0
  158. package/dist/controlplane/oauth/resource.js +49 -0
  159. package/dist/controlplane/oauth/resource.js.map +1 -0
  160. package/dist/controlplane/oauth/routes.d.ts +28 -0
  161. package/dist/controlplane/oauth/routes.d.ts.map +1 -0
  162. package/dist/controlplane/oauth/routes.js +191 -0
  163. package/dist/controlplane/oauth/routes.js.map +1 -0
  164. package/dist/controlplane/oauth/session.d.ts +36 -0
  165. package/dist/controlplane/oauth/session.d.ts.map +1 -0
  166. package/dist/controlplane/oauth/session.js +38 -0
  167. package/dist/controlplane/oauth/session.js.map +1 -0
  168. package/dist/controlplane/oauth/tokens.service.d.ts +105 -0
  169. package/dist/controlplane/oauth/tokens.service.d.ts.map +1 -0
  170. package/dist/controlplane/oauth/tokens.service.js +209 -0
  171. package/dist/controlplane/oauth/tokens.service.js.map +1 -0
  172. package/dist/controlplane/servers/builds.service.d.ts +54 -0
  173. package/dist/controlplane/servers/builds.service.d.ts.map +1 -0
  174. package/dist/controlplane/servers/builds.service.js +173 -0
  175. package/dist/controlplane/servers/builds.service.js.map +1 -0
  176. package/dist/controlplane/servers/fetch-spec.d.ts +13 -0
  177. package/dist/controlplane/servers/fetch-spec.d.ts.map +1 -0
  178. package/dist/controlplane/servers/fetch-spec.js +30 -0
  179. package/dist/controlplane/servers/fetch-spec.js.map +1 -0
  180. package/dist/controlplane/servers/servers.service.d.ts +87 -0
  181. package/dist/controlplane/servers/servers.service.d.ts.map +1 -0
  182. package/dist/controlplane/servers/servers.service.js +168 -0
  183. package/dist/controlplane/servers/servers.service.js.map +1 -0
  184. package/dist/controlplane/traces/traces.service.d.ts +38 -0
  185. package/dist/controlplane/traces/traces.service.d.ts.map +1 -0
  186. package/dist/controlplane/traces/traces.service.js +189 -0
  187. package/dist/controlplane/traces/traces.service.js.map +1 -0
  188. package/dist/controlplane/upstream-oauth/upstream-oauth.service.d.ts +70 -0
  189. package/dist/controlplane/upstream-oauth/upstream-oauth.service.d.ts.map +1 -0
  190. package/dist/controlplane/upstream-oauth/upstream-oauth.service.js +208 -0
  191. package/dist/controlplane/upstream-oauth/upstream-oauth.service.js.map +1 -0
  192. package/dist/controlplane/users/users.service.d.ts +33 -0
  193. package/dist/controlplane/users/users.service.d.ts.map +1 -0
  194. package/dist/controlplane/users/users.service.js +68 -0
  195. package/dist/controlplane/users/users.service.js.map +1 -0
  196. package/dist/dataplane/auth/authenticate.d.ts +58 -0
  197. package/dist/dataplane/auth/authenticate.d.ts.map +1 -0
  198. package/dist/dataplane/auth/authenticate.js +152 -0
  199. package/dist/dataplane/auth/authenticate.js.map +1 -0
  200. package/dist/dataplane/auth/external-jwt.d.ts +30 -0
  201. package/dist/dataplane/auth/external-jwt.d.ts.map +1 -0
  202. package/dist/dataplane/auth/external-jwt.js +78 -0
  203. package/dist/dataplane/auth/external-jwt.js.map +1 -0
  204. package/dist/dataplane/code/executor-health.d.ts +24 -0
  205. package/dist/dataplane/code/executor-health.d.ts.map +1 -0
  206. package/dist/dataplane/code/executor-health.js +49 -0
  207. package/dist/dataplane/code/executor-health.js.map +1 -0
  208. package/dist/dataplane/code/run-script.d.ts +90 -0
  209. package/dist/dataplane/code/run-script.d.ts.map +1 -0
  210. package/dist/dataplane/code/run-script.js +320 -0
  211. package/dist/dataplane/code/run-script.js.map +1 -0
  212. package/dist/dataplane/code/tokenize.d.ts +44 -0
  213. package/dist/dataplane/code/tokenize.d.ts.map +1 -0
  214. package/dist/dataplane/code/tokenize.js +267 -0
  215. package/dist/dataplane/code/tokenize.js.map +1 -0
  216. package/dist/dataplane/code/validate.d.ts +30 -0
  217. package/dist/dataplane/code/validate.d.ts.map +1 -0
  218. package/dist/dataplane/code/validate.js +94 -0
  219. package/dist/dataplane/code/validate.js.map +1 -0
  220. package/dist/dataplane/code/wrap.d.ts +20 -0
  221. package/dist/dataplane/code/wrap.d.ts.map +1 -0
  222. package/dist/dataplane/code/wrap.js +108 -0
  223. package/dist/dataplane/code/wrap.js.map +1 -0
  224. package/dist/dataplane/http/circuit-breaker.d.ts +23 -0
  225. package/dist/dataplane/http/circuit-breaker.d.ts.map +1 -0
  226. package/dist/dataplane/http/circuit-breaker.js +53 -0
  227. package/dist/dataplane/http/circuit-breaker.js.map +1 -0
  228. package/dist/dataplane/http/credentials.d.ts +59 -0
  229. package/dist/dataplane/http/credentials.d.ts.map +1 -0
  230. package/dist/dataplane/http/credentials.js +93 -0
  231. package/dist/dataplane/http/credentials.js.map +1 -0
  232. package/dist/dataplane/http/errors.d.ts +16 -0
  233. package/dist/dataplane/http/errors.d.ts.map +1 -0
  234. package/dist/dataplane/http/errors.js +32 -0
  235. package/dist/dataplane/http/errors.js.map +1 -0
  236. package/dist/dataplane/http/invoker.d.ts +56 -0
  237. package/dist/dataplane/http/invoker.d.ts.map +1 -0
  238. package/dist/dataplane/http/invoker.js +114 -0
  239. package/dist/dataplane/http/invoker.js.map +1 -0
  240. package/dist/dataplane/http/request-builder.d.ts +39 -0
  241. package/dist/dataplane/http/request-builder.d.ts.map +1 -0
  242. package/dist/dataplane/http/request-builder.js +162 -0
  243. package/dist/dataplane/http/request-builder.js.map +1 -0
  244. package/dist/dataplane/mcp/challenge.d.ts +14 -0
  245. package/dist/dataplane/mcp/challenge.d.ts.map +1 -0
  246. package/dist/dataplane/mcp/challenge.js +25 -0
  247. package/dist/dataplane/mcp/challenge.js.map +1 -0
  248. package/dist/dataplane/mcp/dispatch.d.ts +64 -0
  249. package/dist/dataplane/mcp/dispatch.d.ts.map +1 -0
  250. package/dist/dataplane/mcp/dispatch.js +165 -0
  251. package/dist/dataplane/mcp/dispatch.js.map +1 -0
  252. package/dist/dataplane/mcp/event-bus.d.ts +19 -0
  253. package/dist/dataplane/mcp/event-bus.d.ts.map +1 -0
  254. package/dist/dataplane/mcp/event-bus.js +39 -0
  255. package/dist/dataplane/mcp/event-bus.js.map +1 -0
  256. package/dist/dataplane/mcp/inflight.d.ts +66 -0
  257. package/dist/dataplane/mcp/inflight.d.ts.map +1 -0
  258. package/dist/dataplane/mcp/inflight.js +135 -0
  259. package/dist/dataplane/mcp/inflight.js.map +1 -0
  260. package/dist/dataplane/mcp/origin.d.ts +7 -0
  261. package/dist/dataplane/mcp/origin.d.ts.map +1 -0
  262. package/dist/dataplane/mcp/origin.js +27 -0
  263. package/dist/dataplane/mcp/origin.js.map +1 -0
  264. package/dist/dataplane/mcp/route.d.ts +43 -0
  265. package/dist/dataplane/mcp/route.d.ts.map +1 -0
  266. package/dist/dataplane/mcp/route.js +280 -0
  267. package/dist/dataplane/mcp/route.js.map +1 -0
  268. package/dist/dataplane/mcp/surface.d.ts +43 -0
  269. package/dist/dataplane/mcp/surface.d.ts.map +1 -0
  270. package/dist/dataplane/mcp/surface.js +133 -0
  271. package/dist/dataplane/mcp/surface.js.map +1 -0
  272. package/dist/dataplane/mcp/translate.d.ts +16 -0
  273. package/dist/dataplane/mcp/translate.d.ts.map +1 -0
  274. package/dist/dataplane/mcp/translate.js +33 -0
  275. package/dist/dataplane/mcp/translate.js.map +1 -0
  276. package/dist/dataplane/mock/mock-upstream.d.ts +23 -0
  277. package/dist/dataplane/mock/mock-upstream.d.ts.map +1 -0
  278. package/dist/dataplane/mock/mock-upstream.js +26 -0
  279. package/dist/dataplane/mock/mock-upstream.js.map +1 -0
  280. package/dist/dataplane/ops/ops.d.ts +66 -0
  281. package/dist/dataplane/ops/ops.d.ts.map +1 -0
  282. package/dist/dataplane/ops/ops.js +315 -0
  283. package/dist/dataplane/ops/ops.js.map +1 -0
  284. package/dist/dataplane/pipeline/arg-validate.d.ts +19 -0
  285. package/dist/dataplane/pipeline/arg-validate.d.ts.map +1 -0
  286. package/dist/dataplane/pipeline/arg-validate.js +61 -0
  287. package/dist/dataplane/pipeline/arg-validate.js.map +1 -0
  288. package/dist/dataplane/pipeline/context.d.ts +78 -0
  289. package/dist/dataplane/pipeline/context.d.ts.map +1 -0
  290. package/dist/dataplane/pipeline/context.js +13 -0
  291. package/dist/dataplane/pipeline/context.js.map +1 -0
  292. package/dist/dataplane/pipeline/errors.d.ts +53 -0
  293. package/dist/dataplane/pipeline/errors.d.ts.map +1 -0
  294. package/dist/dataplane/pipeline/errors.js +61 -0
  295. package/dist/dataplane/pipeline/errors.js.map +1 -0
  296. package/dist/dataplane/pipeline/pipeline.d.ts +128 -0
  297. package/dist/dataplane/pipeline/pipeline.d.ts.map +1 -0
  298. package/dist/dataplane/pipeline/pipeline.js +443 -0
  299. package/dist/dataplane/pipeline/pipeline.js.map +1 -0
  300. package/dist/dataplane/pipeline/policy.d.ts +24 -0
  301. package/dist/dataplane/pipeline/policy.d.ts.map +1 -0
  302. package/dist/dataplane/pipeline/policy.js +93 -0
  303. package/dist/dataplane/pipeline/policy.js.map +1 -0
  304. package/dist/dataplane/rate-limit/limiter.d.ts +42 -0
  305. package/dist/dataplane/rate-limit/limiter.d.ts.map +1 -0
  306. package/dist/dataplane/rate-limit/limiter.js +34 -0
  307. package/dist/dataplane/rate-limit/limiter.js.map +1 -0
  308. package/dist/dataplane/rate-limit/stores.d.ts +56 -0
  309. package/dist/dataplane/rate-limit/stores.d.ts.map +1 -0
  310. package/dist/dataplane/rate-limit/stores.js +95 -0
  311. package/dist/dataplane/rate-limit/stores.js.map +1 -0
  312. package/dist/dataplane/rate-limit/token-bucket.d.ts +19 -0
  313. package/dist/dataplane/rate-limit/token-bucket.d.ts.map +1 -0
  314. package/dist/dataplane/rate-limit/token-bucket.js +16 -0
  315. package/dist/dataplane/rate-limit/token-bucket.js.map +1 -0
  316. package/dist/dataplane/search/document.d.ts +22 -0
  317. package/dist/dataplane/search/document.d.ts.map +1 -0
  318. package/dist/dataplane/search/document.js +45 -0
  319. package/dist/dataplane/search/document.js.map +1 -0
  320. package/dist/dataplane/search/embed-worker.d.ts +2 -0
  321. package/dist/dataplane/search/embed-worker.d.ts.map +1 -0
  322. package/dist/dataplane/search/embed-worker.js +55 -0
  323. package/dist/dataplane/search/embed-worker.js.map +1 -0
  324. package/dist/dataplane/search/embedder.d.ts +113 -0
  325. package/dist/dataplane/search/embedder.d.ts.map +1 -0
  326. package/dist/dataplane/search/embedder.js +216 -0
  327. package/dist/dataplane/search/embedder.js.map +1 -0
  328. package/dist/dataplane/search/hybrid.d.ts +28 -0
  329. package/dist/dataplane/search/hybrid.d.ts.map +1 -0
  330. package/dist/dataplane/search/hybrid.js +45 -0
  331. package/dist/dataplane/search/hybrid.js.map +1 -0
  332. package/dist/dataplane/search/indexer.d.ts +62 -0
  333. package/dist/dataplane/search/indexer.d.ts.map +1 -0
  334. package/dist/dataplane/search/indexer.js +105 -0
  335. package/dist/dataplane/search/indexer.js.map +1 -0
  336. package/dist/dataplane/search/keyword-index.d.ts +26 -0
  337. package/dist/dataplane/search/keyword-index.d.ts.map +1 -0
  338. package/dist/dataplane/search/keyword-index.js +60 -0
  339. package/dist/dataplane/search/keyword-index.js.map +1 -0
  340. package/dist/dataplane/search/model-profiles.d.ts +12 -0
  341. package/dist/dataplane/search/model-profiles.d.ts.map +1 -0
  342. package/dist/dataplane/search/model-profiles.js +12 -0
  343. package/dist/dataplane/search/model-profiles.js.map +1 -0
  344. package/dist/dataplane/search/search.service.d.ts +39 -0
  345. package/dist/dataplane/search/search.service.d.ts.map +1 -0
  346. package/dist/dataplane/search/search.service.js +69 -0
  347. package/dist/dataplane/search/search.service.js.map +1 -0
  348. package/dist/dataplane/search/suggest.d.ts +15 -0
  349. package/dist/dataplane/search/suggest.d.ts.map +1 -0
  350. package/dist/dataplane/search/suggest.js +76 -0
  351. package/dist/dataplane/search/suggest.js.map +1 -0
  352. package/dist/dataplane/search/vector-index.d.ts +49 -0
  353. package/dist/dataplane/search/vector-index.d.ts.map +1 -0
  354. package/dist/dataplane/search/vector-index.js +72 -0
  355. package/dist/dataplane/search/vector-index.js.map +1 -0
  356. package/dist/dataplane/shaping/result-pages.d.ts +19 -0
  357. package/dist/dataplane/shaping/result-pages.d.ts.map +1 -0
  358. package/dist/dataplane/shaping/result-pages.js +37 -0
  359. package/dist/dataplane/shaping/result-pages.js.map +1 -0
  360. package/dist/dataplane/shaping/sanitize.d.ts +6 -0
  361. package/dist/dataplane/shaping/sanitize.d.ts.map +1 -0
  362. package/dist/dataplane/shaping/sanitize.js +31 -0
  363. package/dist/dataplane/shaping/sanitize.js.map +1 -0
  364. package/dist/dataplane/tasks/tracker.d.ts +60 -0
  365. package/dist/dataplane/tasks/tracker.d.ts.map +1 -0
  366. package/dist/dataplane/tasks/tracker.js +178 -0
  367. package/dist/dataplane/tasks/tracker.js.map +1 -0
  368. package/dist/dataplane/tasks/usage.d.ts +8 -0
  369. package/dist/dataplane/tasks/usage.d.ts.map +1 -0
  370. package/dist/dataplane/tasks/usage.js +35 -0
  371. package/dist/dataplane/tasks/usage.js.map +1 -0
  372. package/dist/deps.d.ts +133 -0
  373. package/dist/deps.d.ts.map +1 -0
  374. package/dist/deps.js +356 -0
  375. package/dist/deps.js.map +1 -0
  376. package/dist/health/routes.d.ts +22 -0
  377. package/dist/health/routes.d.ts.map +1 -0
  378. package/dist/health/routes.js +40 -0
  379. package/dist/health/routes.js.map +1 -0
  380. package/dist/index.d.ts +8 -0
  381. package/dist/index.d.ts.map +1 -0
  382. package/dist/index.js +8 -0
  383. package/dist/index.js.map +1 -0
  384. package/dist/instrumentation.d.ts +10 -0
  385. package/dist/instrumentation.d.ts.map +1 -0
  386. package/dist/instrumentation.js +72 -0
  387. package/dist/instrumentation.js.map +1 -0
  388. package/dist/jobs.d.ts +5 -0
  389. package/dist/jobs.d.ts.map +1 -0
  390. package/dist/jobs.js +96 -0
  391. package/dist/jobs.js.map +1 -0
  392. package/dist/kernel/audit/archive/azure.d.ts +42 -0
  393. package/dist/kernel/audit/archive/azure.d.ts.map +1 -0
  394. package/dist/kernel/audit/archive/azure.js +80 -0
  395. package/dist/kernel/audit/archive/azure.js.map +1 -0
  396. package/dist/kernel/audit/archive/gcs.d.ts +27 -0
  397. package/dist/kernel/audit/archive/gcs.d.ts.map +1 -0
  398. package/dist/kernel/audit/archive/gcs.js +42 -0
  399. package/dist/kernel/audit/archive/gcs.js.map +1 -0
  400. package/dist/kernel/audit/archive/index.d.ts +20 -0
  401. package/dist/kernel/audit/archive/index.d.ts.map +1 -0
  402. package/dist/kernel/audit/archive/index.js +90 -0
  403. package/dist/kernel/audit/archive/index.js.map +1 -0
  404. package/dist/kernel/audit/archive/local-fs.d.ts +10 -0
  405. package/dist/kernel/audit/archive/local-fs.d.ts.map +1 -0
  406. package/dist/kernel/audit/archive/local-fs.js +24 -0
  407. package/dist/kernel/audit/archive/local-fs.js.map +1 -0
  408. package/dist/kernel/audit/archive/s3.d.ts +49 -0
  409. package/dist/kernel/audit/archive/s3.d.ts.map +1 -0
  410. package/dist/kernel/audit/archive/s3.js +85 -0
  411. package/dist/kernel/audit/archive/s3.js.map +1 -0
  412. package/dist/kernel/audit/archive/store.d.ts +34 -0
  413. package/dist/kernel/audit/archive/store.d.ts.map +1 -0
  414. package/dist/kernel/audit/archive/store.js +27 -0
  415. package/dist/kernel/audit/archive/store.js.map +1 -0
  416. package/dist/kernel/audit/chain.d.ts +33 -0
  417. package/dist/kernel/audit/chain.d.ts.map +1 -0
  418. package/dist/kernel/audit/chain.js +64 -0
  419. package/dist/kernel/audit/chain.js.map +1 -0
  420. package/dist/kernel/audit/checkpoints.d.ts +30 -0
  421. package/dist/kernel/audit/checkpoints.d.ts.map +1 -0
  422. package/dist/kernel/audit/checkpoints.js +33 -0
  423. package/dist/kernel/audit/checkpoints.js.map +1 -0
  424. package/dist/kernel/audit/export.d.ts +14 -0
  425. package/dist/kernel/audit/export.d.ts.map +1 -0
  426. package/dist/kernel/audit/export.js +88 -0
  427. package/dist/kernel/audit/export.js.map +1 -0
  428. package/dist/kernel/audit/partitions.d.ts +29 -0
  429. package/dist/kernel/audit/partitions.d.ts.map +1 -0
  430. package/dist/kernel/audit/partitions.js +58 -0
  431. package/dist/kernel/audit/partitions.js.map +1 -0
  432. package/dist/kernel/audit/query.d.ts +28 -0
  433. package/dist/kernel/audit/query.d.ts.map +1 -0
  434. package/dist/kernel/audit/query.js +114 -0
  435. package/dist/kernel/audit/query.js.map +1 -0
  436. package/dist/kernel/audit/recorder.d.ts +53 -0
  437. package/dist/kernel/audit/recorder.d.ts.map +1 -0
  438. package/dist/kernel/audit/recorder.js +71 -0
  439. package/dist/kernel/audit/recorder.js.map +1 -0
  440. package/dist/kernel/audit/redact.d.ts +69 -0
  441. package/dist/kernel/audit/redact.d.ts.map +1 -0
  442. package/dist/kernel/audit/redact.js +202 -0
  443. package/dist/kernel/audit/redact.js.map +1 -0
  444. package/dist/kernel/audit/redaction-rules.service.d.ts +34 -0
  445. package/dist/kernel/audit/redaction-rules.service.d.ts.map +1 -0
  446. package/dist/kernel/audit/redaction-rules.service.js +53 -0
  447. package/dist/kernel/audit/redaction-rules.service.js.map +1 -0
  448. package/dist/kernel/audit/retention.d.ts +54 -0
  449. package/dist/kernel/audit/retention.d.ts.map +1 -0
  450. package/dist/kernel/audit/retention.js +119 -0
  451. package/dist/kernel/audit/retention.js.map +1 -0
  452. package/dist/kernel/audit/sinks/dispatcher.d.ts +38 -0
  453. package/dist/kernel/audit/sinks/dispatcher.d.ts.map +1 -0
  454. package/dist/kernel/audit/sinks/dispatcher.js +68 -0
  455. package/dist/kernel/audit/sinks/dispatcher.js.map +1 -0
  456. package/dist/kernel/audit/sinks/otel-logs.d.ts +25 -0
  457. package/dist/kernel/audit/sinks/otel-logs.d.ts.map +1 -0
  458. package/dist/kernel/audit/sinks/otel-logs.js +51 -0
  459. package/dist/kernel/audit/sinks/otel-logs.js.map +1 -0
  460. package/dist/kernel/audit/sinks/sink.d.ts +14 -0
  461. package/dist/kernel/audit/sinks/sink.d.ts.map +1 -0
  462. package/dist/kernel/audit/sinks/sink.js +9 -0
  463. package/dist/kernel/audit/sinks/sink.js.map +1 -0
  464. package/dist/kernel/audit/sinks/webhook.d.ts +29 -0
  465. package/dist/kernel/audit/sinks/webhook.d.ts.map +1 -0
  466. package/dist/kernel/audit/sinks/webhook.js +49 -0
  467. package/dist/kernel/audit/sinks/webhook.js.map +1 -0
  468. package/dist/kernel/audit/store.d.ts +158 -0
  469. package/dist/kernel/audit/store.d.ts.map +1 -0
  470. package/dist/kernel/audit/store.js +155 -0
  471. package/dist/kernel/audit/store.js.map +1 -0
  472. package/dist/kernel/audit/types.d.ts +136 -0
  473. package/dist/kernel/audit/types.d.ts.map +1 -0
  474. package/dist/kernel/audit/types.js +2 -0
  475. package/dist/kernel/audit/types.js.map +1 -0
  476. package/dist/kernel/audit/verify.d.ts +22 -0
  477. package/dist/kernel/audit/verify.d.ts.map +1 -0
  478. package/dist/kernel/audit/verify.js +96 -0
  479. package/dist/kernel/audit/verify.js.map +1 -0
  480. package/dist/kernel/audit/writer.d.ts +85 -0
  481. package/dist/kernel/audit/writer.d.ts.map +1 -0
  482. package/dist/kernel/audit/writer.js +255 -0
  483. package/dist/kernel/audit/writer.js.map +1 -0
  484. package/dist/kernel/config/env.d.ts +119 -0
  485. package/dist/kernel/config/env.d.ts.map +1 -0
  486. package/dist/kernel/config/env.js +173 -0
  487. package/dist/kernel/config/env.js.map +1 -0
  488. package/dist/kernel/config/load.d.ts +51 -0
  489. package/dist/kernel/config/load.d.ts.map +1 -0
  490. package/dist/kernel/config/load.js +102 -0
  491. package/dist/kernel/config/load.js.map +1 -0
  492. package/dist/kernel/coordination/memory.d.ts +20 -0
  493. package/dist/kernel/coordination/memory.d.ts.map +1 -0
  494. package/dist/kernel/coordination/memory.js +92 -0
  495. package/dist/kernel/coordination/memory.js.map +1 -0
  496. package/dist/kernel/coordination/postgres.d.ts +47 -0
  497. package/dist/kernel/coordination/postgres.d.ts.map +1 -0
  498. package/dist/kernel/coordination/postgres.js +111 -0
  499. package/dist/kernel/coordination/postgres.js.map +1 -0
  500. package/dist/kernel/coordination/types.d.ts +37 -0
  501. package/dist/kernel/coordination/types.d.ts.map +1 -0
  502. package/dist/kernel/coordination/types.js +2 -0
  503. package/dist/kernel/coordination/types.js.map +1 -0
  504. package/dist/kernel/coordination/wait.d.ts +4 -0
  505. package/dist/kernel/coordination/wait.d.ts.map +1 -0
  506. package/dist/kernel/coordination/wait.js +38 -0
  507. package/dist/kernel/coordination/wait.js.map +1 -0
  508. package/dist/kernel/db/columns.d.ts +25 -0
  509. package/dist/kernel/db/columns.d.ts.map +1 -0
  510. package/dist/kernel/db/columns.js +32 -0
  511. package/dist/kernel/db/columns.js.map +1 -0
  512. package/dist/kernel/db/empty-in-plugin.d.ts +7 -0
  513. package/dist/kernel/db/empty-in-plugin.d.ts.map +1 -0
  514. package/dist/kernel/db/empty-in-plugin.js +28 -0
  515. package/dist/kernel/db/empty-in-plugin.js.map +1 -0
  516. package/dist/kernel/db/index.d.ts +67 -0
  517. package/dist/kernel/db/index.d.ts.map +1 -0
  518. package/dist/kernel/db/index.js +72 -0
  519. package/dist/kernel/db/index.js.map +1 -0
  520. package/dist/kernel/db/migrations/audit/0006_audit.d.ts +7 -0
  521. package/dist/kernel/db/migrations/audit/0006_audit.d.ts.map +1 -0
  522. package/dist/kernel/db/migrations/audit/0006_audit.js +125 -0
  523. package/dist/kernel/db/migrations/audit/0006_audit.js.map +1 -0
  524. package/dist/kernel/db/migrations/audit/0007_metrics.d.ts +6 -0
  525. package/dist/kernel/db/migrations/audit/0007_metrics.d.ts.map +1 -0
  526. package/dist/kernel/db/migrations/audit/0007_metrics.js +38 -0
  527. package/dist/kernel/db/migrations/audit/0007_metrics.js.map +1 -0
  528. package/dist/kernel/db/migrations/index.d.ts +10 -0
  529. package/dist/kernel/db/migrations/index.d.ts.map +1 -0
  530. package/dist/kernel/db/migrations/index.js +15 -0
  531. package/dist/kernel/db/migrations/index.js.map +1 -0
  532. package/dist/kernel/db/migrations/main/0001_core.d.ts +4 -0
  533. package/dist/kernel/db/migrations/main/0001_core.d.ts.map +1 -0
  534. package/dist/kernel/db/migrations/main/0001_core.js +178 -0
  535. package/dist/kernel/db/migrations/main/0001_core.js.map +1 -0
  536. package/dist/kernel/db/migrations/main/0002_servers.d.ts +4 -0
  537. package/dist/kernel/db/migrations/main/0002_servers.d.ts.map +1 -0
  538. package/dist/kernel/db/migrations/main/0002_servers.js +240 -0
  539. package/dist/kernel/db/migrations/main/0002_servers.js.map +1 -0
  540. package/dist/kernel/db/migrations/main/0003_auth.d.ts +4 -0
  541. package/dist/kernel/db/migrations/main/0003_auth.d.ts.map +1 -0
  542. package/dist/kernel/db/migrations/main/0003_auth.js +125 -0
  543. package/dist/kernel/db/migrations/main/0003_auth.js.map +1 -0
  544. package/dist/kernel/db/migrations/main/0004_ops.d.ts +4 -0
  545. package/dist/kernel/db/migrations/main/0004_ops.d.ts.map +1 -0
  546. package/dist/kernel/db/migrations/main/0004_ops.js +196 -0
  547. package/dist/kernel/db/migrations/main/0004_ops.js.map +1 -0
  548. package/dist/kernel/db/migrations/main/0005_evals.d.ts +4 -0
  549. package/dist/kernel/db/migrations/main/0005_evals.d.ts.map +1 -0
  550. package/dist/kernel/db/migrations/main/0005_evals.js +117 -0
  551. package/dist/kernel/db/migrations/main/0005_evals.js.map +1 -0
  552. package/dist/kernel/db/migrations/types.d.ts +17 -0
  553. package/dist/kernel/db/migrations/types.d.ts.map +1 -0
  554. package/dist/kernel/db/migrations/types.js +7 -0
  555. package/dist/kernel/db/migrations/types.js.map +1 -0
  556. package/dist/kernel/db/migrator.d.ts +29 -0
  557. package/dist/kernel/db/migrator.d.ts.map +1 -0
  558. package/dist/kernel/db/migrator.js +64 -0
  559. package/dist/kernel/db/migrator.js.map +1 -0
  560. package/dist/kernel/db/postgres.d.ts +35 -0
  561. package/dist/kernel/db/postgres.d.ts.map +1 -0
  562. package/dist/kernel/db/postgres.js +44 -0
  563. package/dist/kernel/db/postgres.js.map +1 -0
  564. package/dist/kernel/db/schema.d.ts +936 -0
  565. package/dist/kernel/db/schema.d.ts.map +1 -0
  566. package/dist/kernel/db/schema.js +61 -0
  567. package/dist/kernel/db/schema.js.map +1 -0
  568. package/dist/kernel/db/sqlite.d.ts +20 -0
  569. package/dist/kernel/db/sqlite.d.ts.map +1 -0
  570. package/dist/kernel/db/sqlite.js +31 -0
  571. package/dist/kernel/db/sqlite.js.map +1 -0
  572. package/dist/kernel/db/tools-fts.d.ts +11 -0
  573. package/dist/kernel/db/tools-fts.d.ts.map +1 -0
  574. package/dist/kernel/db/tools-fts.js +17 -0
  575. package/dist/kernel/db/tools-fts.js.map +1 -0
  576. package/dist/kernel/db/url.d.ts +17 -0
  577. package/dist/kernel/db/url.d.ts.map +1 -0
  578. package/dist/kernel/db/url.js +30 -0
  579. package/dist/kernel/db/url.js.map +1 -0
  580. package/dist/kernel/jobs/jobs.service.d.ts +24 -0
  581. package/dist/kernel/jobs/jobs.service.d.ts.map +1 -0
  582. package/dist/kernel/jobs/jobs.service.js +65 -0
  583. package/dist/kernel/jobs/jobs.service.js.map +1 -0
  584. package/dist/kernel/jobs/scheduler.d.ts +34 -0
  585. package/dist/kernel/jobs/scheduler.d.ts.map +1 -0
  586. package/dist/kernel/jobs/scheduler.js +70 -0
  587. package/dist/kernel/jobs/scheduler.js.map +1 -0
  588. package/dist/kernel/lib/clock.d.ts +11 -0
  589. package/dist/kernel/lib/clock.d.ts.map +1 -0
  590. package/dist/kernel/lib/clock.js +15 -0
  591. package/dist/kernel/lib/clock.js.map +1 -0
  592. package/dist/kernel/lib/crypto.d.ts +12 -0
  593. package/dist/kernel/lib/crypto.d.ts.map +1 -0
  594. package/dist/kernel/lib/crypto.js +48 -0
  595. package/dist/kernel/lib/crypto.js.map +1 -0
  596. package/dist/kernel/lib/errors.d.ts +29 -0
  597. package/dist/kernel/lib/errors.d.ts.map +1 -0
  598. package/dist/kernel/lib/errors.js +40 -0
  599. package/dist/kernel/lib/errors.js.map +1 -0
  600. package/dist/kernel/lib/histogram.d.ts +28 -0
  601. package/dist/kernel/lib/histogram.d.ts.map +1 -0
  602. package/dist/kernel/lib/histogram.js +70 -0
  603. package/dist/kernel/lib/histogram.js.map +1 -0
  604. package/dist/kernel/lib/ids.d.ts +3 -0
  605. package/dist/kernel/lib/ids.d.ts.map +1 -0
  606. package/dist/kernel/lib/ids.js +6 -0
  607. package/dist/kernel/lib/ids.js.map +1 -0
  608. package/dist/kernel/lib/jcs.d.ts +5 -0
  609. package/dist/kernel/lib/jcs.d.ts.map +1 -0
  610. package/dist/kernel/lib/jcs.js +14 -0
  611. package/dist/kernel/lib/jcs.js.map +1 -0
  612. package/dist/kernel/lib/json.d.ts +9 -0
  613. package/dist/kernel/lib/json.d.ts.map +1 -0
  614. package/dist/kernel/lib/json.js +21 -0
  615. package/dist/kernel/lib/json.js.map +1 -0
  616. package/dist/kernel/lib/keyset.d.ts +25 -0
  617. package/dist/kernel/lib/keyset.d.ts.map +1 -0
  618. package/dist/kernel/lib/keyset.js +36 -0
  619. package/dist/kernel/lib/keyset.js.map +1 -0
  620. package/dist/kernel/lib/logger.d.ts +12 -0
  621. package/dist/kernel/lib/logger.d.ts.map +1 -0
  622. package/dist/kernel/lib/logger.js +41 -0
  623. package/dist/kernel/lib/logger.js.map +1 -0
  624. package/dist/kernel/lib/net/safe-fetch.d.ts +36 -0
  625. package/dist/kernel/lib/net/safe-fetch.d.ts.map +1 -0
  626. package/dist/kernel/lib/net/safe-fetch.js +106 -0
  627. package/dist/kernel/lib/net/safe-fetch.js.map +1 -0
  628. package/dist/kernel/lib/net/ssrf-guard.d.ts +30 -0
  629. package/dist/kernel/lib/net/ssrf-guard.d.ts.map +1 -0
  630. package/dist/kernel/lib/net/ssrf-guard.js +78 -0
  631. package/dist/kernel/lib/net/ssrf-guard.js.map +1 -0
  632. package/dist/kernel/lib/pagination.d.ts +14 -0
  633. package/dist/kernel/lib/pagination.d.ts.map +1 -0
  634. package/dist/kernel/lib/pagination.js +40 -0
  635. package/dist/kernel/lib/pagination.js.map +1 -0
  636. package/dist/kernel/observability/metrics.d.ts +53 -0
  637. package/dist/kernel/observability/metrics.d.ts.map +1 -0
  638. package/dist/kernel/observability/metrics.js +95 -0
  639. package/dist/kernel/observability/metrics.js.map +1 -0
  640. package/dist/kernel/observability/tracing.d.ts +32 -0
  641. package/dist/kernel/observability/tracing.d.ts.map +1 -0
  642. package/dist/kernel/observability/tracing.js +116 -0
  643. package/dist/kernel/observability/tracing.js.map +1 -0
  644. package/dist/kernel/principal.d.ts +16 -0
  645. package/dist/kernel/principal.d.ts.map +1 -0
  646. package/dist/kernel/principal.js +9 -0
  647. package/dist/kernel/principal.js.map +1 -0
  648. package/dist/kernel/runtime-config.d.ts +194 -0
  649. package/dist/kernel/runtime-config.d.ts.map +1 -0
  650. package/dist/kernel/runtime-config.js +192 -0
  651. package/dist/kernel/runtime-config.js.map +1 -0
  652. package/dist/kernel/secrets/builtin.provider.d.ts +26 -0
  653. package/dist/kernel/secrets/builtin.provider.d.ts.map +1 -0
  654. package/dist/kernel/secrets/builtin.provider.js +65 -0
  655. package/dist/kernel/secrets/builtin.provider.js.map +1 -0
  656. package/dist/kernel/secrets/envelope.d.ts +16 -0
  657. package/dist/kernel/secrets/envelope.d.ts.map +1 -0
  658. package/dist/kernel/secrets/envelope.js +44 -0
  659. package/dist/kernel/secrets/envelope.js.map +1 -0
  660. package/dist/kernel/secrets/envelope.service.d.ts +38 -0
  661. package/dist/kernel/secrets/envelope.service.d.ts.map +1 -0
  662. package/dist/kernel/secrets/envelope.service.js +86 -0
  663. package/dist/kernel/secrets/envelope.service.js.map +1 -0
  664. package/dist/kernel/secrets/keyring.d.ts +30 -0
  665. package/dist/kernel/secrets/keyring.d.ts.map +1 -0
  666. package/dist/kernel/secrets/keyring.js +32 -0
  667. package/dist/kernel/secrets/keyring.js.map +1 -0
  668. package/dist/kernel/secrets/named-secrets.d.ts +33 -0
  669. package/dist/kernel/secrets/named-secrets.d.ts.map +1 -0
  670. package/dist/kernel/secrets/named-secrets.js +63 -0
  671. package/dist/kernel/secrets/named-secrets.js.map +1 -0
  672. package/dist/kernel/secrets/provider.d.ts +17 -0
  673. package/dist/kernel/secrets/provider.d.ts.map +1 -0
  674. package/dist/kernel/secrets/provider.js +2 -0
  675. package/dist/kernel/secrets/provider.js.map +1 -0
  676. package/dist/kernel/secrets/rotation.d.ts +25 -0
  677. package/dist/kernel/secrets/rotation.d.ts.map +1 -0
  678. package/dist/kernel/secrets/rotation.js +32 -0
  679. package/dist/kernel/secrets/rotation.js.map +1 -0
  680. package/dist/kernel/settings/settings.service.d.ts +98 -0
  681. package/dist/kernel/settings/settings.service.d.ts.map +1 -0
  682. package/dist/kernel/settings/settings.service.js +92 -0
  683. package/dist/kernel/settings/settings.service.js.map +1 -0
  684. package/dist/main.d.ts +2 -0
  685. package/dist/main.d.ts.map +1 -0
  686. package/dist/main.js +39 -0
  687. package/dist/main.js.map +1 -0
  688. package/dist/routes.d.ts +5 -0
  689. package/dist/routes.d.ts.map +1 -0
  690. package/dist/routes.js +58 -0
  691. package/dist/routes.js.map +1 -0
  692. package/dist/scripts/fetch-model.d.ts +2 -0
  693. package/dist/scripts/fetch-model.d.ts.map +1 -0
  694. package/dist/scripts/fetch-model.js +34 -0
  695. package/dist/scripts/fetch-model.js.map +1 -0
  696. package/dist/scripts/gen-schema.d.ts +2 -0
  697. package/dist/scripts/gen-schema.d.ts.map +1 -0
  698. package/dist/scripts/gen-schema.js +71 -0
  699. package/dist/scripts/gen-schema.js.map +1 -0
  700. package/dist/scripts/keys.d.ts +2 -0
  701. package/dist/scripts/keys.d.ts.map +1 -0
  702. package/dist/scripts/keys.js +24 -0
  703. package/dist/scripts/keys.js.map +1 -0
  704. package/dist/scripts/migrate.d.ts +2 -0
  705. package/dist/scripts/migrate.d.ts.map +1 -0
  706. package/dist/scripts/migrate.js +45 -0
  707. package/dist/scripts/migrate.js.map +1 -0
  708. package/dist/server.d.ts +30 -0
  709. package/dist/server.d.ts.map +1 -0
  710. package/dist/server.js +129 -0
  711. package/dist/server.js.map +1 -0
  712. package/dist/version.d.ts +3 -0
  713. package/dist/version.d.ts.map +1 -0
  714. package/dist/version.js +13 -0
  715. package/dist/version.js.map +1 -0
  716. package/dist/web/static.d.ts +30 -0
  717. package/dist/web/static.d.ts.map +1 -0
  718. package/dist/web/static.js +65 -0
  719. package/dist/web/static.js.map +1 -0
  720. package/package.json +106 -4
  721. package/web-dist/assets/CompositeItem-B2Bd2eM-.js +2 -0
  722. package/web-dist/assets/CompositeItem-B2Bd2eM-.js.map +1 -0
  723. package/web-dist/assets/DialogRoot-h0udFiba.js +2 -0
  724. package/web-dist/assets/DialogRoot-h0udFiba.js.map +1 -0
  725. package/web-dist/assets/DialogTitle-fTXvJGbH.js +2 -0
  726. package/web-dist/assets/DialogTitle-fTXvJGbH.js.map +1 -0
  727. package/web-dist/assets/DirectionContext-CRBE3EOa.js +2 -0
  728. package/web-dist/assets/DirectionContext-CRBE3EOa.js.map +1 -0
  729. package/web-dist/assets/FieldItemContext-B4r08RkZ.js +2 -0
  730. package/web-dist/assets/FieldItemContext-B4r08RkZ.js.map +1 -0
  731. package/web-dist/assets/FloatingPortal-D_eDEbvZ.js +2 -0
  732. package/web-dist/assets/FloatingPortal-D_eDEbvZ.js.map +1 -0
  733. package/web-dist/assets/FloatingPortalLite-DWlDzoqv.js +2 -0
  734. package/web-dist/assets/FloatingPortalLite-DWlDzoqv.js.map +1 -0
  735. package/web-dist/assets/Separator-DDDyVkeP.js +2 -0
  736. package/web-dist/assets/Separator-DDDyVkeP.js.map +1 -0
  737. package/web-dist/assets/_app-BY6-IpyI.js +2 -0
  738. package/web-dist/assets/_app-BY6-IpyI.js.map +1 -0
  739. package/web-dist/assets/_app-Ba10rJVa.js +2 -0
  740. package/web-dist/assets/_app-Ba10rJVa.js.map +1 -0
  741. package/web-dist/assets/_app-Bv2dBVot.js +2 -0
  742. package/web-dist/assets/_app-Bv2dBVot.js.map +1 -0
  743. package/web-dist/assets/_groupId-ENiG99V5.js +2 -0
  744. package/web-dist/assets/_groupId-ENiG99V5.js.map +1 -0
  745. package/web-dist/assets/_issueId-CAHjIiZ8.js +2 -0
  746. package/web-dist/assets/_issueId-CAHjIiZ8.js.map +1 -0
  747. package/web-dist/assets/_runId-XmmZmpWa.js +4 -0
  748. package/web-dist/assets/_runId-XmmZmpWa.js.map +1 -0
  749. package/web-dist/assets/_serverId-C9y6ztaL.js +2 -0
  750. package/web-dist/assets/_serverId-C9y6ztaL.js.map +1 -0
  751. package/web-dist/assets/_taskId-D8fVBV_H.js +2 -0
  752. package/web-dist/assets/_taskId-D8fVBV_H.js.map +1 -0
  753. package/web-dist/assets/_toolId-CnbF7zls.js +6 -0
  754. package/web-dist/assets/_toolId-CnbF7zls.js.map +1 -0
  755. package/web-dist/assets/alert-OPOFnW2X.js +2 -0
  756. package/web-dist/assets/alert-OPOFnW2X.js.map +1 -0
  757. package/web-dist/assets/api-client-CnTzbAbK.js +56 -0
  758. package/web-dist/assets/api-client-CnTzbAbK.js.map +1 -0
  759. package/web-dist/assets/appearance-D7nZLK7y.js +2 -0
  760. package/web-dist/assets/appearance-D7nZLK7y.js.map +1 -0
  761. package/web-dist/assets/arrow-up-Dop2Zfy9.js +2 -0
  762. package/web-dist/assets/arrow-up-Dop2Zfy9.js.map +1 -0
  763. package/web-dist/assets/audit-Cws4Sb1Z.js +2 -0
  764. package/web-dist/assets/audit-Cws4Sb1Z.js.map +1 -0
  765. package/web-dist/assets/button-0-kx6BS-.js +2 -0
  766. package/web-dist/assets/button-0-kx6BS-.js.map +1 -0
  767. package/web-dist/assets/card-bOMGzWND.js +2 -0
  768. package/web-dist/assets/card-bOMGzWND.js.map +1 -0
  769. package/web-dist/assets/chevron-right-jlmAjiMj.js +2 -0
  770. package/web-dist/assets/chevron-right-jlmAjiMj.js.map +1 -0
  771. package/web-dist/assets/client-snippet-DyzxqQDv.js +2 -0
  772. package/web-dist/assets/client-snippet-DyzxqQDv.js.map +1 -0
  773. package/web-dist/assets/code-view-Dp3S3g6k.js +4 -0
  774. package/web-dist/assets/code-view-Dp3S3g6k.js.map +1 -0
  775. package/web-dist/assets/compare-CHKwYuEP.js +2 -0
  776. package/web-dist/assets/compare-CHKwYuEP.js.map +1 -0
  777. package/web-dist/assets/components-CNkWqS3X.js +2 -0
  778. package/web-dist/assets/components-CNkWqS3X.js.map +1 -0
  779. package/web-dist/assets/components-DYbjYUzw.js +2 -0
  780. package/web-dist/assets/components-DYbjYUzw.js.map +1 -0
  781. package/web-dist/assets/composite-Bfwhy6qy.js +2 -0
  782. package/web-dist/assets/composite-Bfwhy6qy.js.map +1 -0
  783. package/web-dist/assets/confirm-dialog-BY5FJuQC.js +2 -0
  784. package/web-dist/assets/confirm-dialog-BY5FJuQC.js.map +1 -0
  785. package/web-dist/assets/connect-DEWuCUqH.js +2 -0
  786. package/web-dist/assets/connect-DEWuCUqH.js.map +1 -0
  787. package/web-dist/assets/core-CveQFPAO.js +13 -0
  788. package/web-dist/assets/core-CveQFPAO.js.map +1 -0
  789. package/web-dist/assets/create-key-dialog-DbtnDlv9.js +3 -0
  790. package/web-dist/assets/create-key-dialog-DbtnDlv9.js.map +1 -0
  791. package/web-dist/assets/createLucideIcon-4wkYGrAu.js +2 -0
  792. package/web-dist/assets/createLucideIcon-4wkYGrAu.js.map +1 -0
  793. package/web-dist/assets/crumbs-CFOzyevD.js +2 -0
  794. package/web-dist/assets/crumbs-CFOzyevD.js.map +1 -0
  795. package/web-dist/assets/data-table-DL8nsehq.js +2 -0
  796. package/web-dist/assets/data-table-DL8nsehq.js.map +1 -0
  797. package/web-dist/assets/download-BJL2mMMG.js +2 -0
  798. package/web-dist/assets/download-BJL2mMMG.js.map +1 -0
  799. package/web-dist/assets/download-Ct9K1Blk.js +2 -0
  800. package/web-dist/assets/download-Ct9K1Blk.js.map +1 -0
  801. package/web-dist/assets/draft-bar-DQo326FN.js +2 -0
  802. package/web-dist/assets/draft-bar-DQo326FN.js.map +1 -0
  803. package/web-dist/assets/engine-javascript-C30F4iNc.js +142 -0
  804. package/web-dist/assets/engine-javascript-C30F4iNc.js.map +1 -0
  805. package/web-dist/assets/env-summary-C8OSGAi1.js +2 -0
  806. package/web-dist/assets/env-summary-C8OSGAi1.js.map +1 -0
  807. package/web-dist/assets/environments-xDHrvcC0.js +2 -0
  808. package/web-dist/assets/environments-xDHrvcC0.js.map +1 -0
  809. package/web-dist/assets/evals-D103yj9M.js +2 -0
  810. package/web-dist/assets/evals-D103yj9M.js.map +1 -0
  811. package/web-dist/assets/file-drop-BUz7NVu0.js +2 -0
  812. package/web-dist/assets/file-drop-BUz7NVu0.js.map +1 -0
  813. package/web-dist/assets/file-text-BzSWwAXx.js +2 -0
  814. package/web-dist/assets/file-text-BzSWwAXx.js.map +1 -0
  815. package/web-dist/assets/file-up-DhxoycHf.js +2 -0
  816. package/web-dist/assets/file-up-DhxoycHf.js.map +1 -0
  817. package/web-dist/assets/gauge-DB20Sf_v.js +2 -0
  818. package/web-dist/assets/gauge-DB20Sf_v.js.map +1 -0
  819. package/web-dist/assets/github-dark-default-DXG-b-1a.js +2 -0
  820. package/web-dist/assets/github-dark-default-DXG-b-1a.js.map +1 -0
  821. package/web-dist/assets/github-light-default-BXViO-2h.js +2 -0
  822. package/web-dist/assets/github-light-default-BXViO-2h.js.map +1 -0
  823. package/web-dist/assets/graphql-CSsyTQ1B.js +2 -0
  824. package/web-dist/assets/graphql-CSsyTQ1B.js.map +1 -0
  825. package/web-dist/assets/inbox--axfoemS.js +2 -0
  826. package/web-dist/assets/inbox--axfoemS.js.map +1 -0
  827. package/web-dist/assets/inbox-Bg9XxN9I.js +2 -0
  828. package/web-dist/assets/inbox-Bg9XxN9I.js.map +1 -0
  829. package/web-dist/assets/index-CI-LmJP7.css +2 -0
  830. package/web-dist/assets/index-EqRZkjd6.js +17 -0
  831. package/web-dist/assets/index-EqRZkjd6.js.map +1 -0
  832. package/web-dist/assets/inertValue-BEKHztUQ.js +2 -0
  833. package/web-dist/assets/inertValue-BEKHztUQ.js.map +1 -0
  834. package/web-dist/assets/json-qhed-kSA.js +2 -0
  835. package/web-dist/assets/json-qhed-kSA.js.map +1 -0
  836. package/web-dist/assets/json-viewer-DFAY-JaC.js +2 -0
  837. package/web-dist/assets/json-viewer-DFAY-JaC.js.map +1 -0
  838. package/web-dist/assets/key-round-CPrc1zQr.js +2 -0
  839. package/web-dist/assets/key-round-CPrc1zQr.js.map +1 -0
  840. package/web-dist/assets/keys-D2H6bYnB.js +2 -0
  841. package/web-dist/assets/keys-D2H6bYnB.js.map +1 -0
  842. package/web-dist/assets/labels-B8sf8Hg_.js +2 -0
  843. package/web-dist/assets/labels-B8sf8Hg_.js.map +1 -0
  844. package/web-dist/assets/link-CByMaQfX.js +3 -0
  845. package/web-dist/assets/link-CByMaQfX.js.map +1 -0
  846. package/web-dist/assets/link-tabs-C06q3Y1p.js +2 -0
  847. package/web-dist/assets/link-tabs-C06q3Y1p.js.map +1 -0
  848. package/web-dist/assets/link-xDlPECzC.js +2 -0
  849. package/web-dist/assets/link-xDlPECzC.js.map +1 -0
  850. package/web-dist/assets/list-tree-Cq6aoA_B.js +2 -0
  851. package/web-dist/assets/list-tree-Cq6aoA_B.js.map +1 -0
  852. package/web-dist/assets/logged-out-Cia2QO9r.js +2 -0
  853. package/web-dist/assets/logged-out-Cia2QO9r.js.map +1 -0
  854. package/web-dist/assets/login-DgDPuB_V.js +2 -0
  855. package/web-dist/assets/login-DgDPuB_V.js.map +1 -0
  856. package/web-dist/assets/mode-recommendation-DoHGuZUm.js +2 -0
  857. package/web-dist/assets/mode-recommendation-DoHGuZUm.js.map +1 -0
  858. package/web-dist/assets/models-DPi2Bzvy.js +2 -0
  859. package/web-dist/assets/models-DPi2Bzvy.js.map +1 -0
  860. package/web-dist/assets/navigation-Crt8lW1m.js +2 -0
  861. package/web-dist/assets/navigation-Crt8lW1m.js.map +1 -0
  862. package/web-dist/assets/new-Ccw0Hlfl.js +5 -0
  863. package/web-dist/assets/new-Ccw0Hlfl.js.map +1 -0
  864. package/web-dist/assets/overlay-C_UeOJOw.js +2 -0
  865. package/web-dist/assets/overlay-C_UeOJOw.js.map +1 -0
  866. package/web-dist/assets/page-header-CHk7bso7.js +2 -0
  867. package/web-dist/assets/page-header-CHk7bso7.js.map +1 -0
  868. package/web-dist/assets/permissions-Bf3wb1Jv.js +2 -0
  869. package/web-dist/assets/permissions-Bf3wb1Jv.js.map +1 -0
  870. package/web-dist/assets/plug-CrM5MZO2.js +2 -0
  871. package/web-dist/assets/plug-CrM5MZO2.js.map +1 -0
  872. package/web-dist/assets/plus-C6_H380k.js +2 -0
  873. package/web-dist/assets/plus-C6_H380k.js.map +1 -0
  874. package/web-dist/assets/progress-DaZnZarb.js +2 -0
  875. package/web-dist/assets/progress-DaZnZarb.js.map +1 -0
  876. package/web-dist/assets/python-gzcpVVnB.js +2 -0
  877. package/web-dist/assets/python-gzcpVVnB.js.map +1 -0
  878. package/web-dist/assets/queries-3DiENdpp.js +2 -0
  879. package/web-dist/assets/queries-3DiENdpp.js.map +1 -0
  880. package/web-dist/assets/queries-CJD0QpGi.js +2 -0
  881. package/web-dist/assets/queries-CJD0QpGi.js.map +1 -0
  882. package/web-dist/assets/queries-CaU3gifI.js +2 -0
  883. package/web-dist/assets/queries-CaU3gifI.js.map +1 -0
  884. package/web-dist/assets/queries-DOMFJPBg.js +2 -0
  885. package/web-dist/assets/queries-DOMFJPBg.js.map +1 -0
  886. package/web-dist/assets/queries-DzYj_ZKK.js +2 -0
  887. package/web-dist/assets/queries-DzYj_ZKK.js.map +1 -0
  888. package/web-dist/assets/queries-O4X2594T.js +2 -0
  889. package/web-dist/assets/queries-O4X2594T.js.map +1 -0
  890. package/web-dist/assets/queries-iauKjcDt.js +2 -0
  891. package/web-dist/assets/queries-iauKjcDt.js.map +1 -0
  892. package/web-dist/assets/queries-yxFwGLDb.js +2 -0
  893. package/web-dist/assets/queries-yxFwGLDb.js.map +1 -0
  894. package/web-dist/assets/reason-parts-B6nt3n-F.js +2 -0
  895. package/web-dist/assets/reason-parts-B6nt3n-F.js.map +1 -0
  896. package/web-dist/assets/redirect-B4OxYbs2.js +2 -0
  897. package/web-dist/assets/redirect-B4OxYbs2.js.map +1 -0
  898. package/web-dist/assets/refresh-cw-Dk41furN.js +2 -0
  899. package/web-dist/assets/refresh-cw-Dk41furN.js.map +1 -0
  900. package/web-dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  901. package/web-dist/assets/route-Ba10rJVa.js +2 -0
  902. package/web-dist/assets/route-Ba10rJVa.js.map +1 -0
  903. package/web-dist/assets/route-DFvqBlRc.js +2 -0
  904. package/web-dist/assets/route-DFvqBlRc.js.map +1 -0
  905. package/web-dist/assets/score-ring-D3Ff8hXt.js +2 -0
  906. package/web-dist/assets/score-ring-D3Ff8hXt.js.map +1 -0
  907. package/web-dist/assets/section-Bq1blJ9c.js +2 -0
  908. package/web-dist/assets/section-Bq1blJ9c.js.map +1 -0
  909. package/web-dist/assets/segmented-RsFdV9xJ.js +2 -0
  910. package/web-dist/assets/segmented-RsFdV9xJ.js.map +1 -0
  911. package/web-dist/assets/separator-CcxDVEHH.js +2 -0
  912. package/web-dist/assets/separator-CcxDVEHH.js.map +1 -0
  913. package/web-dist/assets/server-BvD6BIlz.js +2 -0
  914. package/web-dist/assets/server-BvD6BIlz.js.map +1 -0
  915. package/web-dist/assets/server-switcher-hOm8Popx.js +2 -0
  916. package/web-dist/assets/server-switcher-hOm8Popx.js.map +1 -0
  917. package/web-dist/assets/servers-DBjU_qiZ.js +2 -0
  918. package/web-dist/assets/servers-DBjU_qiZ.js.map +1 -0
  919. package/web-dist/assets/settings-DCmODejD.js +2 -0
  920. package/web-dist/assets/settings-DCmODejD.js.map +1 -0
  921. package/web-dist/assets/settings-zp4uTZ2u.js +2 -0
  922. package/web-dist/assets/settings-zp4uTZ2u.js.map +1 -0
  923. package/web-dist/assets/sheet-CZ77BIgN.js +2 -0
  924. package/web-dist/assets/sheet-CZ77BIgN.js.map +1 -0
  925. package/web-dist/assets/skeleton-CuU6NqIG.js +2 -0
  926. package/web-dist/assets/skeleton-CuU6NqIG.js.map +1 -0
  927. package/web-dist/assets/sparkles-DMF5S9tx.js +2 -0
  928. package/web-dist/assets/sparkles-DMF5S9tx.js.map +1 -0
  929. package/web-dist/assets/spec-Bhk7L9IF.js +2 -0
  930. package/web-dist/assets/spec-Bhk7L9IF.js.map +1 -0
  931. package/web-dist/assets/spinner-BLf8_Ajk.js +2 -0
  932. package/web-dist/assets/spinner-BLf8_Ajk.js.map +1 -0
  933. package/web-dist/assets/states-Z2xH3pUB.js +2 -0
  934. package/web-dist/assets/states-Z2xH3pUB.js.map +1 -0
  935. package/web-dist/assets/storage-CuUK35fn.js +2 -0
  936. package/web-dist/assets/storage-CuUK35fn.js.map +1 -0
  937. package/web-dist/assets/store-SrwTVjPk.js +2 -0
  938. package/web-dist/assets/store-SrwTVjPk.js.map +1 -0
  939. package/web-dist/assets/switch-C_lbqEIt.js +2 -0
  940. package/web-dist/assets/switch-C_lbqEIt.js.map +1 -0
  941. package/web-dist/assets/tasks-CRKt_Suy.js +2 -0
  942. package/web-dist/assets/tasks-CRKt_Suy.js.map +1 -0
  943. package/web-dist/assets/timeline-Cye1s7g_.js +2 -0
  944. package/web-dist/assets/timeline-Cye1s7g_.js.map +1 -0
  945. package/web-dist/assets/tools-C5I1npEn.js +2 -0
  946. package/web-dist/assets/tools-C5I1npEn.js.map +1 -0
  947. package/web-dist/assets/tooltip--tDonqxM.js +2 -0
  948. package/web-dist/assets/tooltip--tDonqxM.js.map +1 -0
  949. package/web-dist/assets/use-cursor-stack-DIOApcfL.js +2 -0
  950. package/web-dist/assets/use-cursor-stack-DIOApcfL.js.map +1 -0
  951. package/web-dist/assets/use-debounced-value-CSowsQHr.js +2 -0
  952. package/web-dist/assets/use-debounced-value-CSowsQHr.js.map +1 -0
  953. package/web-dist/assets/use-min-width-b55txtG6.js +2 -0
  954. package/web-dist/assets/use-min-width-b55txtG6.js.map +1 -0
  955. package/web-dist/assets/use-mobile-R850ZQZG.js +2 -0
  956. package/web-dist/assets/use-mobile-R850ZQZG.js.map +1 -0
  957. package/web-dist/assets/useAriaLabelledBy-DjHYrmeF.js +2 -0
  958. package/web-dist/assets/useAriaLabelledBy-DjHYrmeF.js.map +1 -0
  959. package/web-dist/assets/useBaseQuery-BoQjiPOp.js +2 -0
  960. package/web-dist/assets/useBaseQuery-BoQjiPOp.js.map +1 -0
  961. package/web-dist/assets/useBaseUiId-BUBV7JiZ.js +2 -0
  962. package/web-dist/assets/useBaseUiId-BUBV7JiZ.js.map +1 -0
  963. package/web-dist/assets/useButton-DQ6Sgg7h.js +2 -0
  964. package/web-dist/assets/useButton-DQ6Sgg7h.js.map +1 -0
  965. package/web-dist/assets/useControlled-B9BFcdfh.js +2 -0
  966. package/web-dist/assets/useControlled-B9BFcdfh.js.map +1 -0
  967. package/web-dist/assets/useNavigate-CrwlTILa.js +2 -0
  968. package/web-dist/assets/useNavigate-CrwlTILa.js.map +1 -0
  969. package/web-dist/assets/useOpenChangeComplete-DUM-_E2z.js +2 -0
  970. package/web-dist/assets/useOpenChangeComplete-DUM-_E2z.js.map +1 -0
  971. package/web-dist/assets/usePositioner-BQnDdcQL.js +2 -0
  972. package/web-dist/assets/usePositioner-BQnDdcQL.js.map +1 -0
  973. package/web-dist/assets/useQuery-BkgWvtTa.js +2 -0
  974. package/web-dist/assets/useQuery-BkgWvtTa.js.map +1 -0
  975. package/web-dist/assets/useRegisterFieldControl-DuodOtnM.js +2 -0
  976. package/web-dist/assets/useRegisterFieldControl-DuodOtnM.js.map +1 -0
  977. package/web-dist/assets/useRouterState-DeGPqG1m.js +2 -0
  978. package/web-dist/assets/useRouterState-DeGPqG1m.js.map +1 -0
  979. package/web-dist/assets/useScrollLock-BWBVawYJ.js +2 -0
  980. package/web-dist/assets/useScrollLock-BWBVawYJ.js.map +1 -0
  981. package/web-dist/assets/useTimeout-SGSgaiy1.js +2 -0
  982. package/web-dist/assets/useTimeout-SGSgaiy1.js.map +1 -0
  983. package/web-dist/assets/useTransitionStatus-Dy_zd4z2.js +2 -0
  984. package/web-dist/assets/useTransitionStatus-Dy_zd4z2.js.map +1 -0
  985. package/web-dist/assets/useTriggerFocusGuards-9VjGYE1p.js +2 -0
  986. package/web-dist/assets/useTriggerFocusGuards-9VjGYE1p.js.map +1 -0
  987. package/web-dist/assets/useValueChanged-BqSvidps.js +2 -0
  988. package/web-dist/assets/useValueChanged-BqSvidps.js.map +1 -0
  989. package/web-dist/assets/utils-BFSetRo1.js +2 -0
  990. package/web-dist/assets/utils-BFSetRo1.js.map +1 -0
  991. package/web-dist/assets/wrench-CIdGHcvJ.js +2 -0
  992. package/web-dist/assets/wrench-CIdGHcvJ.js.map +1 -0
  993. package/web-dist/assets/x-5OcgPlDp.js +2 -0
  994. package/web-dist/assets/x-5OcgPlDp.js.map +1 -0
  995. package/web-dist/assets/yaml-rwi0_p6S.js +2 -0
  996. package/web-dist/assets/yaml-rwi0_p6S.js.map +1 -0
  997. package/web-dist/favicon.svg +1 -0
  998. package/web-dist/index.html +55 -0
  999. package/web-dist/theme-init.js +44 -0
  1000. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-CByMaQfX.js","names":["__toESM","require_react","last","arr","functionalUpdate","updater","previous","hasOwn","hasKeys","key","obj","createNull","nullReplaceEqualDeep","replaceEqualDeep","prev","next","array","isPlainObject","prevKeys","previousCount","nextKeys","length","i","child","_nullProto","_depth","equal","unchanged","incoming","copy","j","o","deepEqual","a","b","l","av","bv","partial","explicitUndefined","k","aCount","isModuleNotFoundError","error","PATH_UNSAFE_RE","sanitizePathSegment","segment","ch","decodeSegment","decoded","match","DEFAULT_PROTOCOL_ALLOWLIST","getUrlScheme","url","protocolRelativePrefixRegex","isDangerousProtocol","scheme","allowlist","decodePath","path","result","re","cursor","encodePathLikeUrl","arraysEqual","invariant","cleanPath","trimPathLeft","trimPathRight","len","trimPath","removeTrailingSlash","value","basepath","resolvePath","to","trailingSlash","isBase","cache","base","cached","baseSegments","toSegments","index","joined","compileDecodeCharMap","charMap","pathParamsAllowedCharacters","char","regex","encoded","isMissingSplat","encodeParam","splat","decoder","interpolatePath","part","segments","kind","prefix","rawSuffix","suffix","paramValue","params","usedParams","isNotFound","getSafeSessionStorage","storageKey","safeSessionStorage","createScrollRestorationCache","scrollRestorationCache","scrollRestorationIdAttribute","defaultGetScrollRestorationKey","location","getScrollRestorationSelector","attrId","element","selector","el","parent","sibling","ignoreScroll","windowScrollTarget","getElement","getScrollToTopElements","elements","scrollToTopSelectors","setupScrollRestoration","shouldSetupScrollRestoration","force","router","scroll","getKey","trackedScrollTargets","snapshotCurrentScrollTargets","keyEntry","restoreKey","target","event","behavior","shouldResetScroll","hashNavigation","scrollToTopElements","cacheKey","fromCacheKey","fromElementEntries","toElementEntries","elementSelector","hash","hashScrollIntoViewOptions","windowRestored","skipWindowRestore","elementEntries","scrollY","scrollX","scrollOptions","encode","val","stringify","toValue","str","decode","searchParams","previousValue","jsonStart","defaultParseSearch","parseSearchWith","defaultStringifySearch","stringifySearchWith","isJsonParser","parser","searchStr","query","stringifyValue","search","rootRouteId","createSieveCache","hand","newest","entry","existing","max","node","SEGMENT_TYPE_INDEX","SEGMENT_TYPE_PATHLESS","getParamNames","data","keys","parseSegment","start","end","open","close","optional","nameStart","parseSegments","route","options","literalEnd","caseSensitive","defaultCaseSensitive","parseParams","interpolation","literalStart","parentInterpolation","tail","nextNode","name","staticChildren","existingNode","createSegmentNode","actuallyCaseSensitive","siblings","s","dynamicListsToSort","segmentData","pathlessNode","isLeaf","indexNode","sortDynamic","processRouteMasks","segmentTree","visit","parentNode","routeList","nodes","findFlatMatch","processedTree","findMatch","findSingleMatch","from","tree","fuzzy","findRouteMatch","err","buildRouteBranch","processRouteTree","routesById","routesByPath","trimmedFullPath","routeTree","parts","leaf","getNodeMatch","rawParams","extractParams","list","buildBranch","names","partIndex","nodeIndex","pathIndex","paramIndex","currentPathIndex","n","pathIsIndex","partsLength","stack","bestFuzzy","bestMatch","frame","isFrameMoreSpecific","validateParseParams","isBeyondPath","lowerPart","indexFrame","indexValid","dynamics","optionals","skipped","isPerfectStaticMatch","statics","suffixPart","nextSkipped","casePart","segmentScore","sliceIndex","state","rewriteBasepath","trimmedBasepath","normalizedBasepath","checkBasepath","checkBasepathWithSlash","basepathRewrite","pathname","rewrite","executeRewriteInput","executeRewriteOutput","res","createNonReactiveMutableStore","initialValue","nextOrUpdater","createNonReactiveReadonlyStore","read","createRouterStores","config","byRoute","status","createMutableStore","initialLocation","resolvedLocation","ids","matches","createReadonlyStore","id","__store","getMatchStore","matchStore","routeId","store","setMatches","previousIds","nextIds","nextMatches","batch","nextMatch","stateIndexKey","popStateEvent","beforeUnloadEvent","protocolRelativePrefix","normalizeProtocolRelative","normalizeHref","href","character","createHistory","opts","subscribers","notify","subscriber","handleIndexChange","action","tryNavigation","blockers","args","blocker","nextLocation","parseHref","cb","currentIndex","assignKeyAndIndex","navigateOpts","createRandomKey","createBrowserHistory","win","originalPushState","originalReplaceState","_getBlockers","_setBlockers","newBlockers","createHref","parseLocation","addedKey","currentLocation","rollbackLocation","nextPopIsGo","ignoreNextPop","skipBlockerNextPop","ignoreNextBeforeUnload","getLocation","flush","queueHistoryAction","destHref","hasPendingAction","isPush","onPushPop","history","onPushPopEvent","delta","isForward","isBack","isGo","onBeforeUnload","shouldBlock","shouldHaveBeforeUnload","ignoreBlocker","sanitizedHref","hashIndex","searchIndex","isExternalUrl","origin","getUrlPath","routeNeedsLoad","getLocationChangeInfo","_getUserHistoryState","_key","_tsrKey","_tsrIndex","_hashScroll","lifecycleEnd","runRouteLifecycle","previousEnd","nextEnd","owner","candidate","RouterCore","fn","prevOptions","newOptions","nextBasepath","nextRewriteOption","rewriteChanged","processRouteTreeResult","listener","routerEvent","parse","parsedSearch","previousLocation","locationToParse","__tempLocation","__tempKey","parsedTempLocation","pathnameOrNext","locationSearchOrOpts","\"__root__\"","usedCurrent","build","dest","parsed","lightweight","current","currentMatch","nextTo","destRoute","isTemplate","destRoutes","matchedRoutes","foundRoute","nextParams","fromParams","resolveNextParams","needsInheritedParams","EMPTY_RECORD","nextPathname","middlewares","getSearchMiddlewares","fromSearch","validatedSearch","validateSearch","nextSearch","applySearchMiddleware","hashStr","nextState","fullPath","publicHref","external","rewrittenUrl","_from","maskParams","maskProps","documentNavigation","historyAction","isSameLocation","previousCommitPromise","resolve","commitPromise","done","nextHistory","maskedLocation","hashScrollIntoView","viewTransition","rest","hrefScheme","reloadDocument","publicLocation","reloadHref","loadClientRoute","shouldViewTransition","startViewTransitionParams","prevLocation","resolvedViewTransitionTypes","committedMatches","filter","preloads","invalidIds","consider","abort","controller","invalidate","d","flight","redirect","discarded","discardedIds","loadRouteChunk","preloadClientRoute","matchLocation","isPending","baseLocation","getStoreConfig","caches","notFoundRoute","initialMatchedRoutes","isGlobalNotFound","_notFoundRouteId","findGlobalNotFoundRouteId","committed","previousAt","strictParams","parentMatch","preMatchSearch","strictMatchSearch","searchError","parentSearch","parentStrictSearch","strictSearch","searchParamError","SearchParamError","loaderDeps","loaderDepsHash","cause","interpolatedPath","matchId","previousMatch","existingMatch","paramsError","extractStrictParams","isRedirect","PathParamError","_notFound","lastRouteId","lastStateMatch","lastStateMatchId","lastRoute","accumulatedSearch","canReuseParams","replace","input","spec","routeOptions","routeValidateSearch","includeValidateSearch","validated","meta","applyNext","currentSearch","collectMeta","nextMeta","newSearch","notFoundMode","fallback","routes","accumulatedParams","preloadComponent","type","loadComponents","component","pending","onPendingReady","afterLazy","componentType","promise","_id","lazyRoute","_getRenderedMatches","_isRouteDeparting","tx","SUCCESS","ERROR","NOT_FOUND","REDIRECTED","CANCELED_OUTCOME","isControl","waitFor","signal","reject","getRoute","normalize","rejected","normalizeError","outcome","onErrorCause","normalizeLaneError","materializeRedirect","lane","contextualize","preload","parentContext","common","routeContext","releaseFlight","validationError","beforeLoad","previousStatus","retainedEnd","setFetching","planSuccessfulLane","releaseOwnedFlight","transferMatchResources","deferSameIdFlight","acquireMatchResources","presented","getLoaderContext","loadResource","loader","parentMatchPromise","settleInto","cacheLoaderMatch","planned","getParentSnapshot","createLoaderTask","plannedCacheMatch","configured","reload","reloadFailure","semanticParent","staleAge","routeLoader","isLoaderFn","preloadable","donor","background","loaded","blocking","onReady","onLazyReady","acceptedFlight","chunkFailure","chunk","candidateIndex","tasks","backgroundOutcome","getNotFoundBoundary","indexed","loading","discardBackground","task","settleTasks","loaderFailure","taskIndex","gate","redirectTasks","nextTask","nextOutcome","serialFailure","redirectOptions","resolved","failed","reduceLane","failure","settlement","redirectLimitExceeded","plannedBoundary","boundaryOf","found","readinessEnd","boundary","install","projectLane","context","head","scripts","executeClientLane","matched","reduced","visible","reduction","foreground","offerPending","session","success","presentedPending","delay","min","tookOver","remaining","offered","ack","rendered","finishPending","awaitPendingMinimum","timer","publishMatches","commitMatches","previousCached","resolvedPrefix","cut","now","superseded","awaitCurrent","followRedirect","runBackground","runClientTransaction","sync","forceStaleReload","follow","toLocation","changeInfo","previousOwner","pendingLocation","redirects","handoff","hydrationController","preflight","previousPreflight","sameHref","settle","run","active","preloadWarning","import_react","routerContext","useRouter","createLinkScope","listeners","source","unsubscribe","update","matchContext","dummyMatchContext","require_jsx_runtime","useStableValues","values","ref","stable","preloadLink","resolveExternalLink","protocolAllowlist","resolveIsActive","currentPath","nextPath","activeOptions","useLinkProps","innerRef","mergedRef","forwardedRef","userPreload","userPreloadDelay","stableSearch","stableParams","stableActiveOptions","scope","getLinkState","getHydrationState","directExternalLink","hydrationState","getHrefOption","disabled","isActive","externalLink","linkDisabled","hasRenderFetched","preloadDelay","enqueuePreload","isIntersecting","cancelPreload","observer","entries","props","collectElementProps","host","handleClick","effectiveTarget","e","handleTouchStart","handleLeave","composeHandlers","onClick","onBlur","onFocus","onMouseEnter","onMouseLeave","onTouchStart","applyLinkState","STATIC_EMPTY_OBJECT","STATIC_ACTIVE_OBJECT","ROUTER_OPTION_KEYS","stateProps","activeProps","inactiveProps","stateStyle","style","stateClassName","className","first","second","Link","linkProps","children","areLinkPropsEqual","extraKeys"],"sources":["../../../../node_modules/@tanstack/router-core/dist/esm/utils.js","../../../../node_modules/@tanstack/router-core/dist/esm/invariant.js","../../../../node_modules/@tanstack/router-core/dist/esm/path.js","../../../../node_modules/@tanstack/router-core/dist/esm/not-found.js","../../../../node_modules/@tanstack/router-core/dist/esm/scroll-restoration.js","../../../../node_modules/@tanstack/router-core/dist/esm/qss.js","../../../../node_modules/@tanstack/router-core/dist/esm/searchParams.js","../../../../node_modules/@tanstack/router-core/dist/esm/root.js","../../../../node_modules/@tanstack/router-core/dist/esm/sieve-cache.js","../../../../node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js","../../../../node_modules/@tanstack/router-core/dist/esm/rewrite.js","../../../../node_modules/@tanstack/router-core/dist/esm/stores.js","../../../../node_modules/@tanstack/history/dist/esm/index.js","../../../../node_modules/@tanstack/router-core/dist/esm/router.js","../../../../node_modules/@tanstack/router-core/dist/esm/load-client.js","../../../../node_modules/@tanstack/router-core/dist/esm/link.js","../../../../node_modules/@tanstack/react-router/dist/esm/routerContext.js","../../../../node_modules/@tanstack/react-router/dist/esm/useRouter.js","../../../../node_modules/@tanstack/react-router/dist/esm/matchContext.js","../../../../node_modules/@tanstack/react-router/dist/esm/link.js"],"sourcesContent":["import { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/utils.ts\n/**\n* Return the last element of an array.\n* Intended for non-empty arrays used within router internals.\n*/\nfunction last(arr) {\n\treturn arr[arr.length - 1];\n}\n/**\n* Apply a value-or-updater to a previous value.\n* Accepts either a literal value or a function of the previous value.\n*/\nfunction functionalUpdate(updater, previous) {\n\tif (typeof updater === \"function\") return updater(previous);\n\treturn updater;\n}\nconst hasOwn = Object.prototype.hasOwnProperty;\nfunction hasKeys(obj) {\n\tfor (const key in obj) if (hasOwn.call(obj, key)) return true;\n\treturn false;\n}\nconst createNull = () => Object.create(null);\nconst nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, true);\nfunction replaceEqualDeep(prev, next, _nullProto, _depth = 0) {\n\tif (isServer) return next;\n\tif (prev === next) return prev;\n\tif (_depth++ > 500) return next;\n\tconst array = Array.isArray(prev) && Array.isArray(next);\n\tif (!array && !(isPlainObject(prev) && isPlainObject(next))) return next;\n\tconst prevKeys = Object.keys(prev);\n\tconst previousCount = prevKeys.length;\n\tconst nextKeys = Object.keys(next);\n\tconst length = nextKeys.length;\n\tif (array ? previousCount !== prev.length || length !== next.length || previousCount && last(prevKeys) !== `${previousCount - 1}` || length && last(nextKeys) !== `${length - 1}` : previousCount !== Object.getOwnPropertyNames(prev).length || length !== Object.getOwnPropertyNames(next).length || Object.getOwnPropertySymbols(next).length) return next;\n\tlet i = 0;\n\tlet child;\n\tlet previous;\n\tlet key;\n\tif (array) {\n\t\tfor (; i < length; i++) {\n\t\t\tkey = i;\n\t\t\tprevious = prev[key];\n\t\t\tchild = next[key];\n\t\t\tchild = previous === child ? previous : typeof previous === \"object\" ? replaceEqualDeep(previous, child, _nullProto, _depth) : child;\n\t\t\tif (child !== previous) break;\n\t\t}\n\t\tif (i === length && previousCount === length) return prev;\n\t} else {\n\t\tlet equal = previousCount === length;\n\t\tlet unchanged = true;\n\t\tfor (; i < length; i++) {\n\t\t\tkey = nextKeys[i];\n\t\t\tprevious = prev[key];\n\t\t\tconst incoming = next[key];\n\t\t\tchild = previous === incoming ? previous : typeof previous === \"object\" ? replaceEqualDeep(previous, incoming, _nullProto, _depth) : incoming;\n\t\t\tequal &&= child === previous && (prevKeys[i] === key || hasOwn.call(prev, key));\n\t\t\tunchanged &&= Object.is(child, incoming);\n\t\t\tprevKeys[i] = child;\n\t\t}\n\t\tif (equal) return Object.getOwnPropertySymbols(prev).length ? next : prev;\n\t\tif (unchanged) return next;\n\t}\n\tconst copy = array ? nextKeys.fill(0) : _nullProto ? createNull() : {};\n\tfor (let j = 0; j < length; j++) {\n\t\tkey = array ? j : nextKeys[j];\n\t\tif (array) {\n\t\t\tprevious = prev[key];\n\t\t\tif (j > i) {\n\t\t\t\tchild = next[key];\n\t\t\t\tchild = previous === child ? previous : typeof previous === \"object\" ? replaceEqualDeep(previous, child, _nullProto, _depth) : child;\n\t\t\t}\n\t\t\tcopy[key] = j < i ? previous : child;\n\t\t} else copy[key] = prevKeys[j];\n\t}\n\treturn copy;\n}\nfunction isPlainObject(o) {\n\tif (!o || typeof o !== \"object\") return false;\n\treturn (Object.getPrototypeOf(o)?.constructor ?? Object) === Object;\n}\n/**\n* Perform a deep equality check optimized for router state comparisons.\n*\n* - `partial`: `b` may omit keys that `a` has (arrays stay length-exact).\n* - `explicitUndefined`: keys holding `undefined` take part in the comparison\n* instead of being ignored.\n*\n* Internal: the flags are positional so hot callers pass no options object.\n*/\nfunction deepEqual(a, b, partial, explicitUndefined) {\n\tif (a === b) return true;\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a.length !== b.length) return false;\n\t\tfor (let i = 0, l = a.length; i < l; i++) {\n\t\t\tconst av = a[i];\n\t\t\tconst bv = b[i];\n\t\t\tif (av !== bv && !deepEqual(av, bv, partial, explicitUndefined)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tif (isPlainObject(a) && isPlainObject(b)) {\n\t\tif (partial) {\n\t\t\tfor (const k in b) if (explicitUndefined || b[k] !== void 0) {\n\t\t\t\tif (!deepEqual(a[k], b[k], partial, explicitUndefined)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tlet aCount = 0;\n\t\tif (explicitUndefined) aCount = Object.keys(a).length;\n\t\telse for (const k in a) if (a[k] !== void 0) aCount++;\n\t\tfor (const k in b) if (explicitUndefined || b[k] !== void 0) {\n\t\t\tif (aCount-- === 0 || !deepEqual(a[k], b[k], partial, explicitUndefined)) return false;\n\t\t}\n\t\treturn aCount === 0;\n\t}\n\treturn false;\n}\n/**\n* Create a promise with exposed resolve/reject and status fields.\n* Useful for coordinating async router lifecycle operations.\n*/\nfunction createControlledPromise(onResolve) {\n\tlet resolveLoadPromise;\n\tlet rejectLoadPromise;\n\tconst controlledPromise = new Promise((resolve, reject) => {\n\t\tresolveLoadPromise = resolve;\n\t\trejectLoadPromise = reject;\n\t});\n\tcontrolledPromise.status = \"pending\";\n\tcontrolledPromise.resolve = (value) => {\n\t\tcontrolledPromise.status = \"resolved\";\n\t\tcontrolledPromise.value = value;\n\t\tresolveLoadPromise(value);\n\t\tonResolve?.(value);\n\t};\n\tcontrolledPromise.reject = (e) => {\n\t\tcontrolledPromise.status = \"rejected\";\n\t\trejectLoadPromise(e);\n\t};\n\treturn controlledPromise;\n}\n/**\n* Heuristically detect dynamic import \"module not found\" errors\n* across major browsers for lazy route component handling.\n*/\nfunction isModuleNotFoundError(error) {\n\tif (typeof error?.message !== \"string\") return false;\n\treturn error.message.startsWith(\"Failed to fetch dynamically imported module\") || error.message.startsWith(\"error loading dynamically imported module\") || error.message.startsWith(\"Importing a module script failed\");\n}\nfunction isPromise(value) {\n\treturn Boolean(value && typeof value === \"object\" && typeof value.then === \"function\");\n}\nfunction findLast(array, predicate) {\n\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\tconst item = array[i];\n\t\tif (predicate(item)) return item;\n\t}\n}\n/**\n* Re-encode characters that are unsafe in URL paths.\n* Includes ASCII control characters (0x00-0x1F, 0x7F) and a subset of the\n* WHATWG URL \"path percent-encode set\" (\", <, >, `, {, }).\n*\n* Space (0x20) is intentionally excluded — decodeURI decodes %20 to space\n* and the router stores decoded spaces in location.pathname. The existing\n* encodePathLikeUrl already handles re-encoding spaces for outgoing URLs.\n*\n* These characters are decoded by decodeURI but must remain percent-encoded\n* in paths to match how upstream layers (CDNs, edge middleware, browsers)\n* interpret the URL, preventing infinite redirect loops and path mismatches.\n*/\nconst PATH_UNSAFE_RE = /[\\x00-\\x1f\\x7f\"<>`{}]/g;\nfunction sanitizePathSegment(segment) {\n\treturn segment.replace(PATH_UNSAFE_RE, (ch) => \"%\" + ch.charCodeAt(0).toString(16).toUpperCase().padStart(2, \"0\"));\n}\nfunction decodeSegment(segment) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = decodeURI(segment);\n\t} catch {\n\t\tdecoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => {\n\t\t\ttry {\n\t\t\t\treturn decodeURI(match);\n\t\t\t} catch {\n\t\t\t\treturn match;\n\t\t\t}\n\t\t});\n\t}\n\treturn sanitizePathSegment(decoded);\n}\n/**\n* Default list of URL protocols to allow in links, redirects, and navigation.\n* Any absolute URL protocol not in this list is treated as dangerous by default.\n*/\nconst DEFAULT_PROTOCOL_ALLOWLIST = [\n\t\"http:\",\n\t\"https:\",\n\t\"mailto:\",\n\t\"tel:\"\n];\n/**\n* Extract the explicit URL scheme, including its colon, using WHATWG\n* normalization rules. This does not validate the rest of the URL.\n*\n* Returning `undefined` means \"no explicit scheme\", not \"safe URL\";\n* protocol-relative URLs such as \"//evil.example\" require a separate check.\n*/\nfunction getUrlScheme(url) {\n\tif (url[0] === \"/\") return;\n\tif (!url.includes(\":\")) return;\n\treturn /^[\\x00-\\x20]*([a-z][a-z\\d+.\\t\\n\\r-]*:)/i.exec(url)?.[1]?.replace(/[\\t\\n\\r]/g, \"\").toLowerCase();\n}\nconst protocolRelativePrefixRegex = /^[\\x00-\\x20]*[\\\\/][\\t\\n\\r]*[\\\\/]/;\n/**\n* Check if a URL string uses a protocol that is not in the allowlist or is\n* protocol-relative (e.g. \"//evil.example\"), which can navigate to another host.\n* Returns true for blocked protocols like javascript:, blob:, and data:, as\n* well as slash/backslash variants of protocol-relative URLs.\n*\n* Scheme parsing normalizes:\n* - Mixed case (JavaScript: → javascript:)\n* - Whitespace/control characters (java\\nscript: → javascript:)\n* - Leading whitespace\n*\n* For relative URLs without a protocol-relative prefix, returns false.\n*\n* @param url - The URL string to check\n* @param allowlist - Set of protocols to allow\n* @returns true if the URL uses a protocol that is not allowed or can escape\n* the current origin through a protocol-relative URL\n*/\nfunction isDangerousProtocol(url, allowlist) {\n\tif (!url) return false;\n\tif (protocolRelativePrefixRegex.test(url)) return true;\n\tconst scheme = getUrlScheme(url);\n\treturn scheme ? !allowlist.has(scheme) : false;\n}\nconst HTML_ESCAPE_LOOKUP = {\n\t\"&\": \"\\\\u0026\",\n\t\">\": \"\\\\u003e\",\n\t\"<\": \"\\\\u003c\",\n\t\"\\u2028\": \"\\\\u2028\",\n\t\"\\u2029\": \"\\\\u2029\"\n};\nconst HTML_ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\n/**\n* Escape HTML special characters in a string to prevent XSS attacks\n* when embedding strings in script tags during SSR.\n*\n* This is essential for preventing XSS vulnerabilities when user-controlled\n* content is embedded in inline scripts.\n*/\nfunction escapeHtml(str) {\n\treturn str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]);\n}\nfunction decodePath(path) {\n\tif (!path) return path;\n\tlet result = path;\n\tif (/[%\\\\\\x00-\\x1f\\x7f]/.test(path)) {\n\t\tconst re = /%25|%5C/gi;\n\t\tlet cursor = 0;\n\t\tlet match;\n\t\tresult = \"\";\n\t\twhile (null !== (match = re.exec(path))) {\n\t\t\tresult += decodeSegment(path.slice(cursor, match.index)) + match[0];\n\t\t\tcursor = re.lastIndex;\n\t\t}\n\t\tresult += decodeSegment(cursor ? path.slice(cursor) : path);\n\t}\n\treturn result;\n}\n/**\n* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.\n*\n* This function encodes:\n* - Whitespace characters (spaces → %20, tabs → %09, etc.)\n* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)\n*\n* It preserves:\n* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)\n* - ASCII special characters valid in URL paths (@, $, &, +, etc.)\n* - Forward slashes as path separators\n*\n* Used to generate proper href values for SSR without constructing URL objects.\n*\n* @example\n* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'\n* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'\n* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)\n*/\nfunction encodePathLikeUrl(path) {\n\tif (!/[\\s\\u0080-\\uFFFF]/.test(path)) return path;\n\treturn path.replace(/\\s|[^\\u0000-\\u007F]/gu, encodeURIComponent);\n}\n/**\n* Builds the dev-mode CSS styles URL for route-scoped CSS collection.\n* Used by HeadContent components in all framework implementations to construct\n* the URL for the `/@tanstack-start/styles.css` endpoint.\n*\n* @param basepath - The router's basepath (may or may not have leading slash)\n* @param routeIds - Array of matched route IDs to include in the CSS collection\n* @returns The full URL path for the dev styles CSS endpoint\n*/\nfunction buildDevStylesUrl(basepath, routeIds) {\n\tconst trimmedBasepath = basepath.replace(/^\\/+|\\/+$/g, \"\");\n\treturn `${trimmedBasepath === \"\" ? \"\" : `/${trimmedBasepath}`}/@tanstack-start/styles.css?routes=${encodeURIComponent(routeIds.join(\",\"))}`;\n}\nfunction arraysEqual(a, b) {\n\tif (a === b) return true;\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\treturn true;\n}\n//#endregion\nexport { DEFAULT_PROTOCOL_ALLOWLIST, arraysEqual, buildDevStylesUrl, createControlledPromise, createNull, decodePath, deepEqual, encodePathLikeUrl, escapeHtml, findLast, functionalUpdate, getUrlScheme, hasKeys, hasOwn, isDangerousProtocol, isModuleNotFoundError, isPlainObject, isPromise, last, nullReplaceEqualDeep, protocolRelativePrefixRegex, replaceEqualDeep };\n\n//# sourceMappingURL=utils.js.map","//#region src/invariant.ts\nfunction invariant() {\n\tthrow new Error(\"Invariant failed\");\n}\n//#endregion\nexport { invariant };\n\n//# sourceMappingURL=invariant.js.map","import { last } from \"./utils.js\";\n//#region src/path.ts\n/** Join path segments, cleaning duplicate slashes between parts. */\nfunction joinPaths(paths) {\n\treturn cleanPath(paths.filter((val) => {\n\t\treturn val !== void 0;\n\t}).join(\"/\"));\n}\n/** Remove repeated slashes from a path string. */\nfunction cleanPath(path) {\n\treturn path.replace(/\\/{2,}/g, \"/\");\n}\n/** Trim leading slashes (except preserving root '/'). */\nfunction trimPathLeft(path) {\n\treturn path === \"/\" ? path : path.replace(/^\\/+/, \"\");\n}\n/** Trim trailing slashes (except preserving root '/'). */\nfunction trimPathRight(path) {\n\tconst len = path.length;\n\treturn len > 1 && path[len - 1] === \"/\" ? path.replace(/\\/+$/, \"\") : path;\n}\n/** Trim both leading and trailing slashes. */\nfunction trimPath(path) {\n\treturn trimPathRight(trimPathLeft(path));\n}\n/** Remove a trailing slash from value when appropriate for comparisons. */\nfunction removeTrailingSlash(value, basepath) {\n\tif (value?.endsWith(\"/\") && value !== \"/\" && value !== `${basepath}/`) return value.slice(0, -1);\n\treturn value;\n}\n/**\n* Compare two pathnames for exact equality after normalizing trailing slashes\n* relative to the provided `basepath`.\n*/\nfunction exactPathTest(pathName1, pathName2, basepath) {\n\treturn removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);\n}\n/**\n* Resolve a destination path against a base, honoring trailing-slash policy\n* and supporting relative segments (`.`/`..`) and absolute `to` values.\n*\n* Internal: parameters are positional so the router's hot callers pass no\n* options object.\n*/\nfunction resolvePath(base, to, trailingSlash = \"never\", cache) {\n\tif (to.includes(\"//\")) to = cleanPath(to);\n\tif (to.startsWith(\"/\")) {\n\t\tif (to.length === 1 || trailingSlash === \"preserve\") return to;\n\t\tif (trailingSlash === \"always\") return to.endsWith(\"/\") ? to : `${to}/`;\n\t\treturn to.endsWith(\"/\") ? to.slice(0, -1) : to;\n\t}\n\tconst isBase = to === \".\";\n\tlet key;\n\tif (cache) {\n\t\tkey = isBase ? base : base + \"\\0\" + to;\n\t\tconst cached = cache.get(key);\n\t\tif (cached) return cached;\n\t}\n\tlet baseSegments;\n\tif (isBase) baseSegments = base.split(\"/\");\n\telse {\n\t\tif (base.includes(\"//\")) base = cleanPath(base);\n\t\tbaseSegments = base.split(\"/\");\n\t\twhile (baseSegments.length > 1 && last(baseSegments) === \"\") baseSegments.pop();\n\t\tconst toSegments = to.split(\"/\");\n\t\tfor (let index = 0, length = toSegments.length; index < length; index++) {\n\t\t\tconst value = toSegments[index];\n\t\t\tif (value === \"\") {\n\t\t\t\tif (!index) baseSegments = [value];\n\t\t\t\telse if (index === length - 1) baseSegments.push(value);\n\t\t\t} else if (value === \"..\") {\n\t\t\t\tif (baseSegments.length > 1) baseSegments.pop();\n\t\t\t\telse baseSegments = [\"\"];\n\t\t\t} else if (value === \".\") {} else baseSegments.push(value);\n\t\t}\n\t}\n\tif (baseSegments.length > 1) {\n\t\tif (last(baseSegments) === \"\") {\n\t\t\tif (trailingSlash === \"never\") baseSegments.pop();\n\t\t} else if (trailingSlash === \"always\") baseSegments.push(\"\");\n\t}\n\tconst joined = baseSegments.join(\"/\");\n\tconst result = (isBase ? cleanPath(joined) : joined) || \"/\";\n\tif (key && cache) cache.set(key, result);\n\treturn result;\n}\n/**\n* Create a pre-compiled decode config from allowed characters.\n* Created once for the router's fixed encoding configuration.\n*/\nfunction compileDecodeCharMap(pathParamsAllowedCharacters) {\n\tconst charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]));\n\tconst regex = new RegExp([...charMap.keys()].join(\"|\").replace(/[.*()]/g, \"\\\\$&\"), \"g\");\n\treturn (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match);\n}\nfunction getRouteSegments(route) {\n\treturn route._interpolation;\n}\n/** A splat is missing when it has no value; `0` and `false` are stringified like any other param. */\nfunction isMissingSplat(value) {\n\treturn value == null || value === \"\";\n}\n/** Devtools checks navigation availability separately from the hot formatter. */\nfunction hasMissingPathParams(segments, params) {\n\treturn segments.some((part) => {\n\t\tif (typeof part === \"string\") return false;\n\t\tconst [kind, key] = part;\n\t\treturn kind === 2 ? isMissingSplat(params[key]) : kind === 1 && !(key in params);\n\t});\n}\nfunction encodeParam(key, value, decoder) {\n\tif (typeof value !== \"string\") return \"\" + (value ?? void 0);\n\tconst splat = key === \"_splat\";\n\tif (splat && (!value || /^[a-zA-Z0-9\\-._~!/]*$/.test(value))) return value;\n\tlet encoded = encodeURIComponent(value);\n\tif (splat) encoded = encoded.replaceAll(\"%2F\", \"/\");\n\treturn decoder ? decoder(encoded) : encoded;\n}\n/** Substitute current values into parsed segments, optionally collecting raw params. */\nfunction interpolatePath(path, segments, params, decoder, usedParams) {\n\tconst trailingSlash = path.endsWith(\"/\") ? \"/\" : \"\";\n\tlet joined = \"\";\n\tfor (const part of segments) {\n\t\tif (typeof part === \"string\") {\n\t\t\tjoined += part;\n\t\t\tcontinue;\n\t\t}\n\t\tconst [kind, key, prefix, rawSuffix] = part;\n\t\tconst splat = kind === 2;\n\t\tconst suffix = splat && rawSuffix !== void 0 ? rawSuffix + trailingSlash : rawSuffix;\n\t\tlet paramValue = params[key];\n\t\tif (kind === 3 && paramValue == null) continue;\n\t\tif (usedParams) {\n\t\t\tusedParams[key] = paramValue;\n\t\t\tif (splat) usedParams[\"*\"] = paramValue;\n\t\t}\n\t\tif (splat && isMissingSplat(paramValue)) {\n\t\t\tif (prefix === \"/\" && !suffix) continue;\n\t\t\tparamValue = \"\";\n\t\t}\n\t\tjoined += prefix + encodeParam(key, paramValue, decoder) + (suffix || \"\");\n\t}\n\treturn joined + trailingSlash || \"/\";\n}\n//#endregion\nexport { cleanPath, compileDecodeCharMap, exactPathTest, getRouteSegments, hasMissingPathParams, interpolatePath, joinPaths, removeTrailingSlash, resolvePath, trimPath, trimPathLeft, trimPathRight };\n\n//# sourceMappingURL=path.js.map","//#region src/not-found.ts\n/**\n* Create a not-found error object recognized by TanStack Router.\n*\n* Throw this from loaders/actions to trigger the nearest `notFoundComponent`.\n* Use `routeId` to target a specific route's not-found boundary. If `throw`\n* is true, the error is thrown instead of returned.\n*\n* @param options Optional settings including `routeId`, `headers`, and `throw`.\n* @returns A not-found error object that can be thrown or returned.\n* @link https://tanstack.com/router/latest/docs/router/framework/react/api/router/notFoundFunction\n*/\nfunction notFound(options = {}) {\n\toptions.isNotFound = true;\n\tif (options.throw) throw options;\n\treturn options;\n}\n/** Determine if a value is a TanStack Router not-found error. */\nfunction isNotFound(obj) {\n\treturn obj?.isNotFound === true;\n}\n//#endregion\nexport { isNotFound, notFound };\n\n//# sourceMappingURL=not-found.js.map","import { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/scroll-restoration.ts\nfunction getSafeSessionStorage() {\n\ttry {\n\t\treturn sessionStorage;\n\t} catch {\n\t\treturn;\n\t}\n}\nconst storageKey = \"tsr-scroll-restoration-v1_3\";\nconst safeSessionStorage = getSafeSessionStorage();\nfunction createScrollRestorationCache() {\n\ttry {\n\t\treturn JSON.parse(safeSessionStorage?.getItem(\"tsr-scroll-restoration-v1_3\") || \"{}\");\n\t} catch {\n\t\treturn {};\n\t}\n}\nconst scrollRestorationCache = /* @__PURE__ */ createScrollRestorationCache();\nconst scrollRestorationIdAttribute = \"data-scroll-restoration-id\";\n/**\n* The default `getKey` function for `useScrollRestoration`.\n* It returns the `key` from the location state or the `href` of the location.\n*\n* The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.\n*/\nconst defaultGetScrollRestorationKey = (location) => {\n\treturn location.state.__TSR_key || location.href;\n};\nfunction getScrollRestorationSelector(element) {\n\tconst attrId = element.getAttribute(scrollRestorationIdAttribute);\n\tif (attrId) return `[${scrollRestorationIdAttribute}=\"${attrId}\"]`;\n\tlet selector = \"\";\n\tlet el = element;\n\tlet parent;\n\twhile (parent = el.parentNode) {\n\t\tlet index = 1;\n\t\tlet sibling = el;\n\t\twhile (sibling = sibling.previousElementSibling) index++;\n\t\tconst part = `${el.localName}:nth-child(${index})`;\n\t\tselector = selector ? `${part} > ${selector}` : part;\n\t\tel = parent;\n\t}\n\treturn selector;\n}\nfunction getElementScrollRestorationEntry(router, options) {\n\tconst restoreKey = (options.getKey || defaultGetScrollRestorationKey)(router.latestLocation);\n\tconst entries = scrollRestorationCache[restoreKey];\n\tif (!entries) return;\n\tif (options.id) return entries[`[${scrollRestorationIdAttribute}=\"${options.id}\"]`];\n\tconst element = options.getElement?.();\n\tif (!element) return;\n\treturn entries[element === window ? windowScrollTarget : getScrollRestorationSelector(element)];\n}\nlet ignoreScroll = false;\nconst windowScrollTarget = \"window\";\nfunction getElement(selector) {\n\ttry {\n\t\treturn typeof selector === \"function\" ? selector() : document.querySelector(selector);\n\t} catch {}\n}\nfunction getScrollToTopElements(scrollToTopSelectors) {\n\tconst elements = /* @__PURE__ */ new Set();\n\tfor (const selector of scrollToTopSelectors) {\n\t\tif (selector === windowScrollTarget) continue;\n\t\tconst element = getElement(selector);\n\t\tif (element) elements.add(element);\n\t}\n\treturn elements;\n}\nfunction setupScrollRestoration(router, force) {\n\tconst shouldSetupScrollRestoration = force ?? router.options.scrollRestoration;\n\tconst scroll = router._scroll;\n\tif (shouldSetupScrollRestoration) scroll.e = true;\n\tif (isServer ?? router.isServer) return;\n\tconst getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;\n\tconst trackedScrollTargets = /* @__PURE__ */ new Set();\n\tconst snapshotCurrentScrollTargets = (restoreKey) => {\n\t\tconst keyEntry = scrollRestorationCache[restoreKey] ||= {};\n\t\tfor (const target of trackedScrollTargets) if (target === document) keyEntry[windowScrollTarget] = {\n\t\t\tscrollX,\n\t\t\tscrollY\n\t\t};\n\t\telse if (target.isConnected) keyEntry[getScrollRestorationSelector(target)] = {\n\t\t\tscrollX: target.scrollLeft,\n\t\t\tscrollY: target.scrollTop\n\t\t};\n\t};\n\tif (shouldSetupScrollRestoration && !scroll.s) {\n\t\tscroll.s = true;\n\t\tignoreScroll = false;\n\t\thistory.scrollRestoration = \"manual\";\n\t\tdocument.addEventListener(\"scroll\", (event) => {\n\t\t\tif (ignoreScroll) return;\n\t\t\ttrackedScrollTargets.add(event.target);\n\t\t}, true);\n\t\trouter.subscribe(\"onBeforeLoad\", (event) => {\n\t\t\tif (event.fromLocation) snapshotCurrentScrollTargets(getKey(event.fromLocation));\n\t\t\ttrackedScrollTargets.clear();\n\t\t});\n\t\taddEventListener(\"pagehide\", () => {\n\t\t\thistory.scrollRestoration = \"auto\";\n\t\t\tsnapshotCurrentScrollTargets(getKey(router.stores.resolvedLocation.get() ?? router.stores.location.get()));\n\t\t\ttry {\n\t\t\t\tsafeSessionStorage?.setItem(storageKey, JSON.stringify(scrollRestorationCache));\n\t\t\t} catch {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(\"[ts-router] Could not persist scroll restoration state to sessionStorage.\");\n\t\t\t}\n\t\t});\n\t\taddEventListener(\"pageshow\", (event) => {\n\t\t\tif (event.persisted) history.scrollRestoration = \"manual\";\n\t\t});\n\t}\n\tif (scroll.r) return;\n\tscroll.r = true;\n\trouter.subscribe(\"onRendered\", (event) => {\n\t\tconst behavior = router.options.scrollRestorationBehavior;\n\t\tconst scrollToTopSelectors = router.options.scrollToTopSelectors;\n\t\tconst shouldResetScroll = scroll.n;\n\t\tconst hashNavigation = scroll.h;\n\t\tlet scrollToTopElements;\n\t\ttrackedScrollTargets.clear();\n\t\tscroll.n = true;\n\t\tscroll.h = false;\n\t\tif (typeof router.options.scrollRestoration === \"function\" && !router.options.scrollRestoration({ location: router.latestLocation })) return;\n\t\tconst cacheKey = getKey(event.toLocation);\n\t\tconst fromCacheKey = event.fromLocation && getKey(event.fromLocation);\n\t\tif (scroll.e && fromCacheKey && fromCacheKey !== cacheKey) {\n\t\t\tconst fromElementEntries = scrollRestorationCache[fromCacheKey];\n\t\t\tif (fromElementEntries) {\n\t\t\t\tlet toElementEntries = scrollRestorationCache[cacheKey];\n\t\t\t\tfor (const elementSelector in fromElementEntries) {\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (shouldResetScroll) continue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (!element) continue;\n\t\t\t\t\t\tif (shouldResetScroll && scrollToTopSelectors) {\n\t\t\t\t\t\t\tscrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\t\t\t\tif (scrollToTopElements.has(element)) continue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!toElementEntries) toElementEntries = scrollRestorationCache[cacheKey] = {};\n\t\t\t\t\ttoElementEntries[elementSelector] ??= fromElementEntries[elementSelector];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tignoreScroll = true;\n\t\ttry {\n\t\t\tconst hash = event.toLocation.hash;\n\t\t\tconst hashScrollIntoViewOptions = event.toLocation.state.__hashScrollIntoViewOptions ?? true;\n\t\t\tlet windowRestored = false;\n\t\t\tif (shouldResetScroll) {\n\t\t\t\tif (!hash && scrollToTopSelectors) scrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\tconst skipWindowRestore = hash && hashScrollIntoViewOptions && hashNavigation;\n\t\t\t\tconst elementEntries = scroll.e ? scrollRestorationCache[cacheKey] : void 0;\n\t\t\t\tif (elementEntries) for (const elementSelector in elementEntries) {\n\t\t\t\t\tconst { scrollX, scrollY } = elementEntries[elementSelector];\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (skipWindowRestore) continue;\n\t\t\t\t\t\tscrollTo({\n\t\t\t\t\t\t\ttop: scrollY,\n\t\t\t\t\t\t\tleft: scrollX,\n\t\t\t\t\t\t\tbehavior\n\t\t\t\t\t\t});\n\t\t\t\t\t\twindowRestored = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (element) {\n\t\t\t\t\t\t\telement.scrollLeft = scrollX;\n\t\t\t\t\t\t\telement.scrollTop = scrollY;\n\t\t\t\t\t\t\tscrollToTopElements?.delete(element);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!hash) {\n\t\t\t\t\tconst scrollOptions = {\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tbehavior\n\t\t\t\t\t};\n\t\t\t\t\tif (!windowRestored) scrollTo(scrollOptions);\n\t\t\t\t\tif (scrollToTopElements) for (const element of scrollToTopElements) element.scrollTo(scrollOptions);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!windowRestored && hash && hashScrollIntoViewOptions) document.getElementById(hash)?.scrollIntoView(hashScrollIntoViewOptions);\n\t\t} finally {\n\t\t\tignoreScroll = false;\n\t\t}\n\t});\n}\n//#endregion\nexport { defaultGetScrollRestorationKey, getElementScrollRestorationEntry, setupScrollRestoration, storageKey };\n\n//# sourceMappingURL=scroll-restoration.js.map","//#region src/qss.ts\n/**\n* Program is a reimplementation of the `qss` package:\n* Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License\n* https://github.com/lukeed/qss/blob/master/license.md\n*\n* This reimplementation uses modern browser APIs\n* (namely URLSearchParams) and TypeScript while still\n* maintaining the original functionality and interface.\n*\n* Update: this implementation has also been mangled to\n* fit exactly our use-case (single value per key in encoding).\n*/\n/**\n* Encodes an object into a query string.\n* @param obj - The object to encode into a query string.\n* @param stringify - An optional custom stringify function.\n* @returns The encoded query string.\n* @example\n* ```\n* // Example input: encode({ token: 'foo', key: 'value' })\n* // Expected output: \"token=foo&key=value\"\n* ```\n*/\nfunction encode(obj, stringify = String) {\n\tlet result;\n\tfor (const key in obj) {\n\t\tconst val = obj[key];\n\t\tif (val !== void 0) (result ||= new URLSearchParams()).set(key, stringify(val));\n\t}\n\treturn result ? result.toString() : \"\";\n}\n/**\n* Converts a string value to its appropriate type (string, number, boolean).\n* @param mix - The string value to convert.\n* @returns The converted value.\n* @example\n* // Example input: toValue(\"123\")\n* // Expected output: 123\n*/\nfunction toValue(str) {\n\tif (!str) return \"\";\n\tif (str === \"false\") return false;\n\tif (str === \"true\") return true;\n\treturn +str * 0 === 0 && +str + \"\" === str ? +str : str;\n}\n/**\n* Decodes a query string into an object.\n* @param str - The query string to decode.\n* @returns The decoded key-value pairs in an object format.\n* @example\n* // Example input: decode(\"token=foo&key=value\")\n* // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n*/\nfunction decode(str) {\n\tconst searchParams = new URLSearchParams(str);\n\tconst result = Object.create(null);\n\tfor (const [key, value] of searchParams.entries()) {\n\t\tconst previousValue = result[key];\n\t\tif (previousValue == null) result[key] = toValue(value);\n\t\telse if (Array.isArray(previousValue)) previousValue.push(toValue(value));\n\t\telse result[key] = [previousValue, toValue(value)];\n\t}\n\treturn result;\n}\n//#endregion\nexport { decode, encode };\n\n//# sourceMappingURL=qss.js.map","import { decode, encode } from \"./qss.js\";\n//#region src/searchParams.ts\nconst jsonStart = /^(?:\\s|[\"[{\\d-]|fa|nu|tr)/;\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\nconst defaultParseSearch = parseSearchWith(JSON.parse);\n/** Default `stringifySearch` using JSON.stringify for complex values. */\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify, JSON.parse);\n/**\n* Build a `parseSearch` function using a provided JSON-like parser.\n*\n* The returned function strips a leading `?`, decodes values, and attempts to\n* JSON-parse string values using the given `parser`.\n*\n* @param parser Function to parse a string value (e.g. `JSON.parse`).\n* @returns A `parseSearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction parseSearchWith(parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\treturn (searchStr) => {\n\t\tif (searchStr[0] === \"?\") searchStr = searchStr.slice(1);\n\t\tconst query = decode(searchStr);\n\t\tfor (const key in query) {\n\t\t\tconst value = query[key];\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tif (isJsonParser && !jsonStart.test(value)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tquery[key] = parser(value);\n\t\t\t\t} catch (_err) {}\n\t\t\t}\n\t\t}\n\t\treturn query;\n\t};\n}\n/**\n* Build a `stringifySearch` function using a provided serializer.\n*\n* Non-primitive values are serialized with `stringify`. If a `parser` is\n* supplied, string values that are parseable are re-serialized to ensure\n* symmetry with `parseSearch`.\n*\n* @param stringify Function to serialize a value (e.g. `JSON.stringify`).\n* @param parser Optional parser to detect parseable strings.\n* @returns A `stringifySearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction stringifySearchWith(stringify, parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\tfunction stringifyValue(val) {\n\t\tif (val && typeof val === \"object\") try {\n\t\t\treturn stringify(val);\n\t\t} catch (_err) {}\n\t\telse if (parser && typeof val === \"string\") {\n\t\t\tif (isJsonParser && !jsonStart.test(val)) return val;\n\t\t\ttry {\n\t\t\t\tparser(val);\n\t\t\t\treturn stringify(val);\n\t\t\t} catch (_err) {}\n\t\t}\n\t\treturn val;\n\t}\n\treturn (search) => {\n\t\tconst searchStr = encode(search, stringifyValue);\n\t\treturn searchStr ? `?${searchStr}` : \"\";\n\t};\n}\n//#endregion\nexport { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith };\n\n//# sourceMappingURL=searchParams.js.map","//#region src/root.ts\n/** Stable identifier used for the root route in a route tree. */\nconst rootRouteId = \"__root__\";\n//#endregion\nexport { rootRouteId };\n\n//# sourceMappingURL=root.js.map","//#region src/sieve-cache.ts\n/**\n* A fixed-capacity cache using the SIEVE eviction algorithm\n* (https://cachemon.github.io/SIEVE-website/).\n*\n* Entries live in the Map's FIFO insertion order; a hit only flips a `visited`\n* bit instead of relinking the entry, which makes `get` (by far the hottest\n* operation here) one `Map.get` plus a boolean store. Eviction sweeps a `hand`\n* from the oldest entry towards the newest, clearing `visited` bits until it\n* finds an unvisited entry to drop, so entries touched since the last sweep\n* survive one more round. This keeps LRU-like hit ratios while being\n* scan-resistant.\n*/\nfunction createSieveCache(max) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tlet hand;\n\tlet newest;\n\treturn {\n\t\tget(key) {\n\t\t\tconst entry = cache.get(key);\n\t\t\tif (!entry) return;\n\t\t\tentry.visited = true;\n\t\t\treturn entry.value;\n\t\t},\n\t\tset(key, value) {\n\t\t\tconst existing = cache.get(key);\n\t\t\tif (existing) {\n\t\t\t\texisting.value = value;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cache.size >= max) {\n\t\t\t\tlet node = hand?.next().value;\n\t\t\t\twhile (!node || node.visited) {\n\t\t\t\t\tif (node) node.visited = false;\n\t\t\t\t\telse hand = cache.values();\n\t\t\t\t\tnode = hand.next().value;\n\t\t\t\t}\n\t\t\t\tif (node === newest) hand = void 0;\n\t\t\t\tcache.delete(node.key);\n\t\t\t}\n\t\t\tconst entry = {\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\tvisited: false\n\t\t\t};\n\t\t\tnewest = entry;\n\t\t\tcache.set(key, entry);\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\thand = void 0;\n\t\t\tnewest = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { createSieveCache };\n\n//# sourceMappingURL=sieve-cache.js.map","import { last } from \"./utils.js\";\nimport { invariant } from \"./invariant.js\";\nimport { trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nconst SEGMENT_TYPE_INDEX = 4;\nconst SEGMENT_TYPE_PATHLESS = 5;\nfunction getParamNames(data) {\n\tconst cached = data.names;\n\tif (cached) return cached;\n\tconst keys = [];\n\tfor (const segment of data) if (typeof segment !== \"string\") keys.push(segment[1]);\n\treturn data.names = keys;\n}\n/** Parse one segment for matching and retain the same record for interpolation. */\nfunction parseSegment(path, start, end) {\n\tconst part = path.slice(start, end);\n\tif (part.charCodeAt(0) === 36) return part.length === 1 ? [\n\t\t2,\n\t\t\"_splat\",\n\t\t\"\",\n\t\tvoid 0\n\t] : [\n\t\t1,\n\t\tpart.slice(1),\n\t\t\"\",\n\t\t\"\"\n\t];\n\tconst open = part.indexOf(\"{\");\n\tif (open >= 0) {\n\t\tconst close = part.indexOf(\"}\", open);\n\t\tconst optional = part.charCodeAt(open + 1) === 45;\n\t\tconst nameStart = open + (optional ? 3 : 2);\n\t\tif (close >= 0 && part.charCodeAt(nameStart - 1) === 36 && (!optional || nameStart < close)) {\n\t\t\tconst key = part.slice(nameStart, close);\n\t\t\treturn [\n\t\t\t\toptional ? 3 : key ? 1 : 2,\n\t\t\t\tkey || \"_splat\",\n\t\t\t\tpart.slice(0, open),\n\t\t\t\tpath.slice(start + close + 1, key ? end : path.length)\n\t\t\t];\n\t\t}\n\t}\n\treturn part;\n}\nfunction parseSegments(defaultCaseSensitive, route, start, node, dynamicListsToSort, parentInterpolation) {\n\tlet cursor = start;\n\tconst path = route.fullPath ?? route.from;\n\tconst options = route.options;\n\tconst length = path.length;\n\tconst literalEnd = path.endsWith(\"/\") ? length - 1 : length;\n\tconst caseSensitive = options?.caseSensitive ?? defaultCaseSensitive;\n\tconst parseParams = options?.params?.parse ?? options?.parseParams;\n\tlet interpolation;\n\tlet literalStart = parentInterpolation ? start - 1 : 0;\n\tif (!node || path.includes(\"$\")) {\n\t\tinterpolation = parentInterpolation?.slice() ?? [];\n\t\tconst tail = last(interpolation);\n\t\tif (tail && typeof tail !== \"string\" && tail[0] === 2) {\n\t\t\tinterpolation[interpolation.length - 1] = [\n\t\t\t\ttail[0],\n\t\t\t\ttail[1],\n\t\t\t\ttail[2],\n\t\t\t\ttail[3] === void 0 ? void 0 : tail[3] + path.substring(start - (path[start - 2] === \"/\" ? 2 : 1), literalEnd)\n\t\t\t];\n\t\t\tliteralStart = length;\n\t\t}\n\t}\n\twhile (cursor < length) {\n\t\tconst start = cursor;\n\t\tconst next = path.indexOf(\"/\", start);\n\t\tlet end = next === -1 ? length : next;\n\t\tconst segment = parseSegment(path, start, end);\n\t\tcursor = end + 1;\n\t\tlet nextNode;\n\t\tif (typeof segment === \"string\") {\n\t\t\tif (!node) continue;\n\t\t\tlet name = segment;\n\t\t\tlet staticChildren;\n\t\t\tif (caseSensitive) staticChildren = node.static ??= /* @__PURE__ */ new Map();\n\t\t\telse {\n\t\t\t\tname = segment.toLowerCase();\n\t\t\t\tstaticChildren = node.staticInsensitive ??= /* @__PURE__ */ new Map();\n\t\t\t}\n\t\t\tconst existingNode = staticChildren.get(name);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node);\n\t\t\t\tnextNode = next;\n\t\t\t\tstaticChildren.set(name, next);\n\t\t\t}\n\t\t} else {\n\t\t\tconst kind = segment[0];\n\t\t\tlet prefix = segment[2];\n\t\t\tlet suffix = segment[3] ?? \"\";\n\t\t\tif (kind === 2) {\n\t\t\t\tend = length;\n\t\t\t\tcursor = end + 1;\n\t\t\t}\n\t\t\tif (interpolation && literalStart < end) {\n\t\t\t\tif (literalStart < start - 1) interpolation.push(path.slice(literalStart, start - 1));\n\t\t\t\tsegment[2] = \"/\" + prefix;\n\t\t\t\tif (kind === 2 && segment[3] !== void 0 && literalEnd < length) segment[3] = suffix.slice(0, -1);\n\t\t\t\tinterpolation.push(segment);\n\t\t\t\tliteralStart = end;\n\t\t\t}\n\t\t\tif (!node) continue;\n\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix || suffix);\n\t\t\tif (!caseSensitive) {\n\t\t\t\tprefix = prefix.toLowerCase();\n\t\t\t\tsuffix = suffix.toLowerCase();\n\t\t\t}\n\t\t\tconst siblings = kind === 1 ? node.dynamic ??= [] : kind === 3 ? node.optional ??= [] : node.wildcard ??= [];\n\t\t\tconst existingNode = kind !== 2 && !parseParams && siblings.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node, kind, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\tnextNode = next;\n\t\t\t\tsiblings.push(next);\n\t\t\t\tif (siblings.length === 2) dynamicListsToSort?.push(siblings);\n\t\t\t}\n\t\t}\n\t\tnode = nextNode;\n\t}\n\tif (interpolation && literalStart < literalEnd) interpolation.push(path.slice(literalStart, literalEnd));\n\tconst segmentData = interpolation?.slice();\n\tif (!node) return segmentData;\n\tif (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf(\"/\") + 1) === 95) {\n\t\tconst pathlessNode = createSegmentNode(node, SEGMENT_TYPE_PATHLESS);\n\t\t(node.pathless ??= []).push(pathlessNode);\n\t\tnode = pathlessNode;\n\t}\n\tconst isLeaf = (route.path || !route.children) && !route.isRoot;\n\tif (isLeaf && literalEnd < length) {\n\t\tconst indexNode = createSegmentNode(node, SEGMENT_TYPE_INDEX);\n\t\tnode.index = indexNode;\n\t\tnode = indexNode;\n\t}\n\tnode.parse = parseParams ?? null;\n\tnode.priority = options?.params?.priority ?? 0;\n\tif (!node.route) {\n\t\tnode.data = segmentData;\n\t\tif (isLeaf) node.route = route;\n\t}\n\treturn [\n\t\tnode,\n\t\tcursor,\n\t\tsegmentData\n\t];\n}\nfunction sortDynamic(a, b) {\n\tif (a.parse && !b.parse) return -1;\n\tif (!a.parse && b.parse) return 1;\n\tif (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;\n\tif (a.prefix && b.prefix && a.prefix !== b.prefix) {\n\t\tif (a.prefix.startsWith(b.prefix)) return -1;\n\t\tif (b.prefix.startsWith(a.prefix)) return 1;\n\t}\n\tif (a.suffix && b.suffix && a.suffix !== b.suffix) {\n\t\tif (a.suffix.endsWith(b.suffix)) return -1;\n\t\tif (b.suffix.endsWith(a.suffix)) return 1;\n\t}\n\tif (a.prefix && !b.prefix) return -1;\n\tif (!a.prefix && b.prefix) return 1;\n\tif (a.suffix && !b.suffix) return -1;\n\tif (!a.suffix && b.suffix) return 1;\n\tif (a.caseSensitive && !b.caseSensitive) return -1;\n\tif (!a.caseSensitive && b.caseSensitive) return 1;\n\treturn 0;\n}\nfunction createSegmentNode(parent, kind = 0, caseSensitive, prefix, suffix) {\n\treturn {\n\t\tkind,\n\t\tdepth: parent ? parent.depth + 1 : 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tdata: void 0,\n\t\tparent,\n\t\tparse: null,\n\t\tpriority: 0,\n\t\tcaseSensitive,\n\t\tprefix,\n\t\tsuffix\n\t};\n}\nfunction processRouteMasks(routeList, processedTree) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\tconst [node, cursor, segments] = parseSegments(false, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tfor (const route of routeList) visit(route, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\tprocessedTree.masksTree = segmentTree;\n\tprocessedTree.flatCache = createSieveCache(1e3);\n}\n/**\n* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.\n*/\nfunction findFlatMatch(path, processedTree) {\n\tpath ||= \"/\";\n\tconst cached = processedTree.flatCache.get(path);\n\tif (cached !== void 0) return cached;\n\tconst result = findMatch(path, processedTree.masksTree);\n\tprocessedTree.flatCache.set(path, result);\n\treturn result;\n}\n/**\n* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree\n*/\nfunction findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {\n\tfrom ||= \"/\";\n\tpath ||= \"/\";\n\tconst key = caseSensitive ? `case\\0${from}` : from;\n\tlet tree = processedTree.singleCache.get(key);\n\tif (!tree) {\n\t\ttree = createSegmentNode();\n\t\tparseSegments(caseSensitive, { from }, 1, tree);\n\t\tprocessedTree.singleCache.set(key, tree);\n\t}\n\treturn findMatch(path, tree, fuzzy);\n}\nfunction findRouteMatch(path, processedTree, fuzzy = false) {\n\tconst key = fuzzy ? path : `nofuzz\\0${path}`;\n\tconst cached = processedTree.matchCache.get(key);\n\tif (cached !== void 0) return cached;\n\tpath ||= \"/\";\n\tlet result;\n\ttry {\n\t\tresult = findMatch(path, processedTree.segmentTree, fuzzy);\n\t} catch (err) {\n\t\tif (err instanceof URIError) result = null;\n\t\telse throw err;\n\t}\n\tif (result) result.branch = buildRouteBranch(result.route);\n\tprocessedTree.matchCache.set(key, result);\n\treturn result;\n}\n/**\n* Processes a route tree into a segment trie for efficient path matching.\n* Also builds lookup maps for routes by ID and by trimmed full path.\n*/\nfunction processRouteTree(routeTree, caseSensitive = false) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tconst routesById = {};\n\tconst routesByPath = {};\n\tlet index = 0;\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\troute.init(index);\n\t\tif (route.id in routesById) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);\n\t\t\tinvariant();\n\t\t}\n\t\troutesById[route.id] = route;\n\t\tif (index !== 0 && route.path) {\n\t\t\tconst trimmedFullPath = trimPathRight(route.fullPath);\n\t\t\tif (!routesByPath[trimmedFullPath] || route.fullPath.endsWith(\"/\")) routesByPath[trimmedFullPath] = route;\n\t\t}\n\t\tindex++;\n\t\tconst [node, cursor, segments] = parseSegments(caseSensitive, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\troute._interpolation = segments;\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tvisit(routeTree, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\treturn {\n\t\tprocessedTree: {\n\t\t\tsegmentTree,\n\t\t\tsingleCache: createSieveCache(1e3),\n\t\t\tmatchCache: createSieveCache(1e3),\n\t\t\tflatCache: null,\n\t\t\tmasksTree: null\n\t\t},\n\t\troutesById,\n\t\troutesByPath\n\t};\n}\nfunction findMatch(path, segmentTree, fuzzy = false) {\n\tconst parts = path.split(\"/\");\n\tconst leaf = getNodeMatch(path, parts, segmentTree, fuzzy);\n\tif (!leaf) return null;\n\tconst [rawParams] = extractParams(path, parts, leaf);\n\treturn {\n\t\troute: leaf.node.route,\n\t\trawParams\n\t};\n}\n/**\n* This function is \"resumable\":\n* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call\n* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off\n*\n* Inputs are *not* mutated.\n*/\nfunction extractParams(path, parts, leaf) {\n\tconst list = buildBranch(leaf.node);\n\tconst names = leaf.node.data && getParamNames(leaf.node.data);\n\tconst rawParams = Object.create(null);\n\t/** which segment of the path we're currently processing */\n\tlet partIndex = leaf.extract?.part ?? 0;\n\t/** which node of the route tree branch we're currently processing */\n\tlet nodeIndex = leaf.extract?.node ?? 0;\n\t/** index of the 1st character of the segment we're processing in the path string */\n\tlet pathIndex = leaf.extract?.path ?? 0;\n\t/** Next original parameter name, independent of pathless/static nodes. */\n\tlet paramIndex = leaf.extract?.param ?? 0;\n\tfor (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++) {\n\t\tconst node = list[nodeIndex];\n\t\tif (node.kind === SEGMENT_TYPE_INDEX) break;\n\t\tif (node.kind === SEGMENT_TYPE_PATHLESS) {\n\t\t\tpartIndex--;\n\t\t\tpathIndex--;\n\t\t\tcontinue;\n\t\t}\n\t\tconst part = parts[partIndex];\n\t\tconst currentPathIndex = pathIndex;\n\t\tif (part) pathIndex += part.length;\n\t\tif (node.kind === 1 || node.kind === 3) {\n\t\t\tconst name = names[paramIndex++];\n\t\t\tif (node.kind === 3 && leaf.skipped & 1 << nodeIndex) {\n\t\t\t\tpartIndex--;\n\t\t\t\tpathIndex = currentPathIndex - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = node.suffix || node.prefix ? part.substring(node.prefix.length, part.length - node.suffix.length) : part;\n\t\t\tif (value || node.kind === 1) rawParams[name] = decodeURIComponent(value);\n\t\t} else if (node.kind === 2) {\n\t\t\tconst n = node;\n\t\t\tconst value = path.substring(currentPathIndex + n.prefix.length, path.length - n.suffix.length);\n\t\t\tconst splat = decodeURIComponent(value);\n\t\t\trawParams[\"*\"] = splat;\n\t\t\trawParams._splat = splat;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);\n\treturn [rawParams, {\n\t\tpart: partIndex,\n\t\tnode: nodeIndex,\n\t\tpath: pathIndex,\n\t\tparam: paramIndex\n\t}];\n}\nfunction buildRouteBranch(route) {\n\tconst list = [route];\n\twhile (route.parentRoute) {\n\t\troute = route.parentRoute;\n\t\tlist.push(route);\n\t}\n\tlist.reverse();\n\treturn list;\n}\nfunction buildBranch(node) {\n\tconst list = Array(node.depth + 1);\n\tdo {\n\t\tlist[node.depth] = node;\n\t\tnode = node.parent;\n\t} while (node);\n\treturn list;\n}\nfunction getNodeMatch(path, parts, segmentTree, fuzzy) {\n\tif (path === \"/\" && segmentTree.index) return {\n\t\tnode: segmentTree.index,\n\t\tskipped: 0\n\t};\n\tconst trailingSlash = !last(parts);\n\tconst pathIsIndex = trailingSlash && path !== \"/\";\n\tconst partsLength = parts.length - (trailingSlash ? 1 : 0);\n\tconst stack = [{\n\t\tnode: segmentTree,\n\t\tindex: 1,\n\t\tskipped: 0,\n\t\tstatics: 0,\n\t\tdynamics: 0,\n\t\toptionals: 0\n\t}];\n\tlet bestFuzzy = null;\n\tlet bestMatch = null;\n\twhile (stack.length) {\n\t\tconst frame = stack.pop();\n\t\tconst { node, index, skipped, statics, dynamics, optionals } = frame;\n\t\tlet { extract, rawParams } = frame;\n\t\tif (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;\n\t\tif (node.parse) {\n\t\t\tif (!validateParseParams(path, parts, frame)) continue;\n\t\t\trawParams = frame.rawParams;\n\t\t\textract = frame.extract;\n\t\t}\n\t\tif (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;\n\t\tconst isBeyondPath = index === partsLength;\n\t\tif (isBeyondPath) {\n\t\t\tif (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;\n\t\t\tif (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;\n\t\t}\n\t\tconst part = isBeyondPath ? void 0 : parts[index];\n\t\tlet lowerPart;\n\t\tif (isBeyondPath && node.index) {\n\t\t\tconst indexFrame = {\n\t\t\t\tnode: node.index,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t};\n\t\t\tlet indexValid = true;\n\t\t\tif (node.index.parse) {\n\t\t\t\tif (!validateParseParams(path, parts, indexFrame)) indexValid = false;\n\t\t\t}\n\t\t\tif (indexValid) {\n\t\t\t\tif (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;\n\t\t\t\tif (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.wildcard[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tif (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;\n\t\t\t}\n\t\t\tif (suffix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tconst end = parts.slice(index).join(\"/\");\n\t\t\t\tconst suffixPart = end.slice(-suffix.length);\n\t\t\t\tif ((segment.caseSensitive ? suffixPart : suffixPart.toLowerCase()) !== suffix || end.length - suffix.length < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: partsLength,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.optional) {\n\t\t\tconst nextSkipped = skipped | 1 << node.depth + 1;\n\t\t\tfor (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped: nextSkipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tconst { prefix, suffix } = segment;\n\t\t\t\tif (prefix || suffix) {\n\t\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t\t}\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex: index + 1,\n\t\t\t\t\tskipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals: optionals + segmentScore(partsLength, index),\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.dynamic[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix || suffix) {\n\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics: dynamics + segmentScore(partsLength, index),\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.staticInsensitive) {\n\t\t\tconst match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.static) {\n\t\t\tconst match = node.static.get(part);\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.pathless) for (let i = node.pathless.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.pathless[i];\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t}\n\tif (bestMatch) return bestMatch;\n\tif (fuzzy && bestFuzzy) {\n\t\tlet sliceIndex = bestFuzzy.index;\n\t\tfor (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;\n\t\tconst splat = sliceIndex === path.length ? \"/\" : path.slice(sliceIndex);\n\t\tbestFuzzy.rawParams ??= Object.create(null);\n\t\tbestFuzzy.rawParams[\"**\"] = decodeURIComponent(splat);\n\t\treturn bestFuzzy;\n\t}\n\treturn null;\n}\nfunction segmentScore(partsLength, index) {\n\treturn 2 ** (partsLength - index - 1);\n}\nfunction isPerfectStaticMatch(statics, partsLength) {\n\treturn statics === 2 ** (partsLength - 1) - 1;\n}\nfunction validateParseParams(path, parts, frame) {\n\tlet rawParams;\n\tlet state;\n\ttry {\n\t\t[rawParams, state] = extractParams(path, parts, frame);\n\t} catch {\n\t\treturn null;\n\t}\n\tframe.rawParams = rawParams;\n\tframe.extract = state;\n\tif (!frame.node.parse) return true;\n\ttry {\n\t\tif (frame.node.parse(rawParams) === false) return null;\n\t} catch {}\n\treturn true;\n}\nfunction isFrameMoreSpecific(prev, next) {\n\tif (!prev) return true;\n\treturn next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.node.depth > prev.node.depth)));\n}\n//#endregion\nexport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, getParamNames, parseSegment, parseSegments, processRouteMasks, processRouteTree };\n\n//# sourceMappingURL=new-process-route-tree.js.map","import { cleanPath, trimPath } from \"./path.js\";\n//#region src/rewrite.ts\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nfunction composeRewrites(rewrites) {\n\treturn {\n\t\tinput: ({ url }) => {\n\t\t\tfor (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\tfor (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);\n\t\t\treturn url;\n\t\t}\n\t};\n}\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nfunction rewriteBasepath(basepath, caseSensitive, rewrite) {\n\tconst trimmedBasepath = trimPath(basepath);\n\tconst normalizedBasepath = `/${trimmedBasepath}`;\n\tconst checkBasepath = caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();\n\tconst checkBasepathWithSlash = `${checkBasepath}/`;\n\tconst basepathRewrite = {\n\t\tinput: ({ url }) => {\n\t\t\tconst pathname = caseSensitive ? url.pathname : url.pathname.toLowerCase();\n\t\t\tif (pathname === checkBasepath) url.pathname = \"/\";\n\t\t\telse if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\turl.pathname = cleanPath(`/${trimmedBasepath}${url.pathname}`);\n\t\t\treturn url;\n\t\t}\n\t};\n\treturn rewrite ? {\n\t\tinput: ({ url }) => executeRewriteInput(rewrite, basepathRewrite.input({ url })),\n\t\toutput: ({ url }) => basepathRewrite.output({ url: executeRewriteOutput(rewrite, url) })\n\t} : basepathRewrite;\n}\n/** Execute a location input rewrite if provided. */\nfunction executeRewriteInput(rewrite, url) {\n\tconst res = rewrite?.input?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n/** Execute a location output rewrite if provided. */\nfunction executeRewriteOutput(rewrite, url) {\n\tconst res = rewrite?.output?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n//#endregion\nexport { composeRewrites, executeRewriteInput, executeRewriteOutput, rewriteBasepath };\n\n//# sourceMappingURL=rewrite.js.map","import { arraysEqual, functionalUpdate } from \"./utils.js\";\n//#region src/stores.ts\n/** SSR non-reactive createMutableStore */\nfunction createNonReactiveMutableStore(initialValue) {\n\tlet value = initialValue;\n\treturn {\n\t\tget() {\n\t\t\treturn value;\n\t\t},\n\t\tset(nextOrUpdater) {\n\t\t\tvalue = functionalUpdate(nextOrUpdater, value);\n\t\t}\n\t};\n}\n/** SSR non-reactive createReadonlyStore */\nfunction createNonReactiveReadonlyStore(read) {\n\treturn { get() {\n\t\treturn read();\n\t} };\n}\nfunction createRouterStores(initialLocation, config) {\n\tconst { createMutableStore, createReadonlyStore, batch } = config;\n\tconst byRoute = /* @__PURE__ */ new Map();\n\tconst status = createMutableStore(\"idle\");\n\tconst location = createMutableStore(initialLocation);\n\tconst resolvedLocation = createMutableStore(void 0);\n\tconst ids = createMutableStore([]);\n\tconst matches = createReadonlyStore(() => ids.get().map((id) => byRoute.get(id).get()));\n\tconst __store = createReadonlyStore(() => ({\n\t\tstatus: status.get(),\n\t\tisLoading: status.get() === \"pending\",\n\t\tmatches: matches.get(),\n\t\tlocation: location.get(),\n\t\tresolvedLocation: resolvedLocation.get()\n\t}));\n\tfunction getMatchStore(routeId) {\n\t\tlet matchStore = byRoute.get(routeId);\n\t\tif (!matchStore) {\n\t\t\tmatchStore = createMutableStore(void 0);\n\t\t\tbyRoute.set(routeId, matchStore);\n\t\t}\n\t\treturn matchStore;\n\t}\n\tconst store = {\n\t\tstatus,\n\t\tlocation,\n\t\tresolvedLocation,\n\t\tids,\n\t\tmatches,\n\t\tbyRoute,\n\t\t__store,\n\t\tgetMatchStore,\n\t\tsetMatches\n\t};\n\tfunction setMatches(nextMatches) {\n\t\tconst previousIds = ids.get();\n\t\tconst nextIds = nextMatches.map((match) => match.routeId);\n\t\tbatch(() => {\n\t\t\tif (!arraysEqual(previousIds, nextIds)) ids.set(nextIds);\n\t\t\tfor (const id of previousIds) if (!nextIds.includes(id)) byRoute.get(id).set(() => void 0);\n\t\t\tfor (const nextMatch of nextMatches) {\n\t\t\t\tconst matchStore = getMatchStore(nextMatch.routeId);\n\t\t\t\tif (matchStore.get() !== nextMatch) matchStore.set(nextMatch);\n\t\t\t}\n\t\t});\n\t}\n\treturn store;\n}\n//#endregion\nexport { createNonReactiveMutableStore, createNonReactiveReadonlyStore, createRouterStores };\n\n//# sourceMappingURL=stores.js.map","//#region src/index.ts\nvar stateIndexKey = \"__TSR_index\";\nvar popStateEvent = \"popstate\";\nvar beforeUnloadEvent = \"beforeunload\";\n/**\n* Turn protocol-relative inputs such as \"//evil.example\" into paths\n* such as \"/evil.example\", keeping navigation on the current origin.\n*\n* For HTTP(S) URLs, WHATWG parsing ignores leading C0 controls and spaces,\n* removes tabs/newlines, and treats backslashes as slashes, so inputs like\n* \"/\\evil.example\" also need normalization. This only allocates when those\n* rules would make the input protocol-relative.\n*/\nvar protocolRelativePrefix = /^[\\x00-\\x20]*(?:[\\\\/][\\t\\n\\r]*){2,}/;\nfunction normalizeProtocolRelative(url) {\n\tconst match = protocolRelativePrefix.exec(url);\n\treturn match ? \"/\" + url.slice(match[0].length) : url;\n}\nfunction normalizeHref(href) {\n\tif (/[\\x00-\\x1f\\x7f]/.test(href)) href = href.replace(/[\\x00-\\x1f\\x7f]/g, (character) => \"\t\\n\\r\".includes(character) ? \"\" : encodeURIComponent(character));\n\treturn normalizeProtocolRelative(href);\n}\nfunction createHistory(opts) {\n\tlet location = opts.getLocation();\n\tconst subscribers = /* @__PURE__ */ new Set();\n\tconst notify = (action) => {\n\t\tlocation = opts.getLocation();\n\t\tsubscribers.forEach((subscriber) => subscriber({\n\t\t\tlocation,\n\t\t\taction\n\t\t}));\n\t};\n\tconst handleIndexChange = (action) => {\n\t\tif (opts.notifyOnIndexChange ?? true) notify(action);\n\t\telse location = opts.getLocation();\n\t};\n\tconst tryNavigation = async (args) => {\n\t\tconst blockers = args.navigateOpts?.ignoreBlocker ? void 0 : opts.getBlockers?.();\n\t\tif (typeof document !== \"undefined\" && blockers?.length && (args.type === \"PUSH\" || args.type === \"REPLACE\")) for (const blocker of blockers) {\n\t\t\tconst nextLocation = parseHref(args.path, args.state);\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: location,\n\t\t\t\tnextLocation,\n\t\t\t\taction: args.type\n\t\t\t})) {\n\t\t\t\topts.onBlocked?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\targs.task();\n\t};\n\treturn {\n\t\tget location() {\n\t\t\treturn location;\n\t\t},\n\t\tget length() {\n\t\t\treturn opts.getLength();\n\t\t},\n\t\tsubscribers,\n\t\tsubscribe: (cb) => {\n\t\t\tsubscribers.add(cb);\n\t\t\treturn () => {\n\t\t\t\tsubscribers.delete(cb);\n\t\t\t};\n\t\t},\n\t\tpush: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex + 1, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.pushState(path, state);\n\t\t\t\t\tnotify({ type: \"PUSH\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"PUSH\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\treplace: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.replaceState(path, state);\n\t\t\t\t\tnotify({ type: \"REPLACE\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"REPLACE\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\tgo: (index, navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.go(index, navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({\n\t\t\t\t\t\ttype: \"GO\",\n\t\t\t\t\t\tindex\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"GO\"\n\t\t\t});\n\t\t},\n\t\tback: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.back(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"BACK\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"BACK\"\n\t\t\t});\n\t\t},\n\t\tforward: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.forward(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"FORWARD\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"FORWARD\"\n\t\t\t});\n\t\t},\n\t\tcanGoBack: () => location.state[stateIndexKey] !== 0,\n\t\tcreateHref: (str) => opts.createHref(str),\n\t\tblock: (blocker) => {\n\t\t\tif (!opts.setBlockers) return () => {};\n\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\topts.setBlockers([...blockers, blocker]);\n\t\t\treturn () => {\n\t\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\t\topts.setBlockers?.(blockers.filter((b) => b !== blocker));\n\t\t\t};\n\t\t},\n\t\tflush: () => opts.flush?.(),\n\t\tdestroy: () => opts.destroy?.(),\n\t\tnotify,\n\t\t_getBlockers: () => opts.getBlockers?.() ?? []\n\t};\n}\nfunction assignKeyAndIndex(index, state) {\n\tconst key = createRandomKey();\n\treturn {\n\t\t...state,\n\t\tkey,\n\t\t__TSR_key: key,\n\t\t[stateIndexKey]: index\n\t};\n}\n/**\n* Creates a history object that can be used to interact with the browser's\n* navigation. This is a lightweight API wrapping the browser's native methods.\n* It is designed to work with TanStack Router, but could be used as a standalone API as well.\n* IMPORTANT: This API implements history throttling via a microtask to prevent\n* excessive calls to the history API. In some browsers, calling history.pushState or\n* history.replaceState in quick succession can cause the browser to ignore subsequent\n* calls. This API smooths out those differences and ensures that your application\n* state will *eventually* match the browser state. In most cases, this is not a problem,\n* but if you need to ensure that the browser state is up to date, you can use the\n* `history.flush` method to immediately flush all pending state changes to the browser URL.\n* @param opts\n* @param opts.getHref A function that returns the current href (path + search + hash)\n* @param opts.createHref A function that takes a path and returns a href (path + search + hash)\n* @returns A history instance\n*/\nfunction createBrowserHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\tconst originalPushState = win.history.pushState;\n\tconst originalReplaceState = win.history.replaceState;\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\tconst createHref = (path) => normalizeHref(opts?.createHref ? opts.createHref(path) : path);\n\tconst parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));\n\tif (!win.history.state?.__TSR_key && !win.history.state?.key) {\n\t\tconst addedKey = createRandomKey();\n\t\twin.history.replaceState({\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey: addedKey,\n\t\t\t__TSR_key: addedKey\n\t\t}, \"\");\n\t}\n\tlet currentLocation = parseLocation();\n\tlet rollbackLocation;\n\tlet nextPopIsGo = false;\n\tlet ignoreNextPop = false;\n\tlet skipBlockerNextPop = false;\n\tlet ignoreNextBeforeUnload = false;\n\tconst getLocation = () => currentLocation;\n\tlet next;\n\tconst flush = () => {\n\t\tif (!next) return;\n\t\thistory._ignoreSubscribers = true;\n\t\t(next[2] ? win.history.pushState : win.history.replaceState)(next[1], \"\", next[0]);\n\t\thistory._ignoreSubscribers = false;\n\t\tnext = void 0;\n\t\trollbackLocation = void 0;\n\t};\n\tconst queueHistoryAction = (isPush, destHref, state) => {\n\t\tconst href = opts?.createHref ? createHref(destHref) : void 0;\n\t\tconst hasPendingAction = !!next;\n\t\tif (!hasPendingAction) rollbackLocation = currentLocation;\n\t\tcurrentLocation = parseHref(destHref, state);\n\t\tnext = [\n\t\t\thref ?? currentLocation.href,\n\t\t\tstate,\n\t\t\tnext?.[2] || isPush\n\t\t];\n\t\tif (!hasPendingAction) queueMicrotask(() => flush());\n\t};\n\tconst onPushPop = (type) => {\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify({ type });\n\t};\n\tconst onPushPopEvent = async () => {\n\t\tignoreNextBeforeUnload = false;\n\t\tif (ignoreNextPop) {\n\t\t\tignoreNextPop = false;\n\t\t\treturn;\n\t\t}\n\t\tconst nextLocation = parseLocation();\n\t\tconst delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];\n\t\tconst isForward = delta === 1;\n\t\tconst isBack = delta === -1;\n\t\tconst isGo = !isForward && !isBack || nextPopIsGo;\n\t\tnextPopIsGo = false;\n\t\tconst action = isGo ? \"GO\" : isBack ? \"BACK\" : \"FORWARD\";\n\t\tconst notify = isGo ? {\n\t\t\ttype: \"GO\",\n\t\t\tindex: delta\n\t\t} : { type: isBack ? \"BACK\" : \"FORWARD\" };\n\t\tif (skipBlockerNextPop) skipBlockerNextPop = false;\n\t\telse {\n\t\t\tconst blockers = _getBlockers();\n\t\t\tif (typeof document !== \"undefined\" && blockers.length) {\n\t\t\t\tfor (const blocker of blockers) if (await blocker.blockerFn({\n\t\t\t\t\tcurrentLocation,\n\t\t\t\t\tnextLocation,\n\t\t\t\t\taction\n\t\t\t\t})) {\n\t\t\t\t\tignoreNextPop = true;\n\t\t\t\t\twin.history.go(-delta);\n\t\t\t\t\thistory.notify(notify);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify(notify);\n\t};\n\tconst onBeforeUnload = (e) => {\n\t\tif (ignoreNextBeforeUnload) {\n\t\t\tignoreNextBeforeUnload = false;\n\t\t\treturn;\n\t\t}\n\t\tlet shouldBlock = false;\n\t\tconst blockers = _getBlockers();\n\t\tif (typeof document !== \"undefined\" && blockers.length) for (const blocker of blockers) {\n\t\t\tconst shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;\n\t\t\tif (shouldHaveBeforeUnload === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (typeof shouldHaveBeforeUnload === \"function\" && shouldHaveBeforeUnload() === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (shouldBlock) {\n\t\t\te.preventDefault();\n\t\t\treturn e.returnValue = \"\";\n\t\t}\n\t};\n\tconst history = createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => win.history.length,\n\t\tpushState: (href, state) => queueHistoryAction(true, href, state),\n\t\treplaceState: (href, state) => queueHistoryAction(false, href, state),\n\t\tback: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\treturn win.history.back();\n\t\t},\n\t\tforward: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.forward();\n\t\t},\n\t\tgo: (n, ignoreBlocker) => {\n\t\t\tnextPopIsGo = true;\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.go(n);\n\t\t},\n\t\tcreateHref,\n\t\tflush,\n\t\tdestroy: () => {\n\t\t\twin.history.pushState = originalPushState;\n\t\t\twin.history.replaceState = originalReplaceState;\n\t\t\twin.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\t\t\twin.removeEventListener(popStateEvent, onPushPopEvent);\n\t\t},\n\t\tonBlocked: () => {\n\t\t\tif (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;\n\t\t},\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers,\n\t\tnotifyOnIndexChange: false\n\t});\n\thistory._ignoreNextBeforeUnload = (href) => {\n\t\tignoreNextBeforeUnload = false;\n\t\ttry {\n\t\t\thref = new URL(href, win.document.baseURI).href;\n\t\t\tignoreNextBeforeUnload = /^https?:/.test(href) && (!href.includes(\"#\") || href.split(\"#\")[0] !== win.location.href.split(\"#\")[0]);\n\t\t} catch {}\n\t};\n\twin.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\twin.addEventListener(popStateEvent, onPushPopEvent);\n\twin.history.pushState = function(...args) {\n\t\tconst res = originalPushState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"PUSH\");\n\t\treturn res;\n\t};\n\twin.history.replaceState = function(...args) {\n\t\tconst res = originalReplaceState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"REPLACE\");\n\t\treturn res;\n\t};\n\treturn history;\n}\n/**\n* Create a hash-based history implementation.\n* Useful for static hosts or environments without server URL rewriting.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createHashHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\treturn createBrowserHistory({\n\t\twindow: win,\n\t\tparseLocation: () => {\n\t\t\tconst hash = win.location.hash;\n\t\t\tlet hashIndex = hash.indexOf(\"#\", 1);\n\t\t\tif (hashIndex < 0) hashIndex = hash.length;\n\t\t\treturn parseHref(`${hash ? hash.slice(1, hashIndex) : \"/\"}${win.location.search}${hash.slice(hashIndex)}`, win.history.state);\n\t\t},\n\t\tcreateHref: (href) => `${win.location.pathname}${win.location.search}#${href}`\n\t});\n}\n/**\n* Create an in-memory history implementation.\n* Ideal for server rendering, tests, and non-DOM environments.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createMemoryHistory(opts = { initialEntries: [\"/\"] }) {\n\tconst entries = opts.initialEntries;\n\tlet index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;\n\tconst states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));\n\tconst getLocation = () => parseHref(entries[index], states[index]);\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\treturn createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => entries.length,\n\t\tpushState: (path, state) => {\n\t\t\tindex = index < entries.length - 1 ? index + 1 : entries.length;\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t\tif (index < entries.length - 1) {\n\t\t\t\tentries.length = index + 1;\n\t\t\t\tstates.length = index + 1;\n\t\t\t}\n\t\t},\n\t\treplaceState: (path, state) => {\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t},\n\t\tback: () => {\n\t\t\tindex = Math.max(index - 1, 0);\n\t\t},\n\t\tforward: () => {\n\t\t\tindex = Math.min(index + 1, entries.length - 1);\n\t\t},\n\t\tgo: (n) => {\n\t\t\tindex = Math.min(Math.max(index + n, 0), entries.length - 1);\n\t\t},\n\t\tcreateHref: normalizeHref,\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers\n\t});\n}\nvar noop = () => {};\nvar ServerHistory = class {\n\tconstructor(location) {\n\t\tthis.location = location;\n\t}\n\tget length() {\n\t\treturn 1;\n\t}\n\tget subscribers() {\n\t\treturn this._subscribers ??= /* @__PURE__ */ new Set();\n\t}\n\tsubscribe() {\n\t\treturn noop;\n\t}\n\tpush() {}\n\treplace() {}\n\tgo() {}\n\tback() {}\n\tforward() {}\n\tcanGoBack() {\n\t\treturn false;\n\t}\n\tcreateHref(href) {\n\t\treturn normalizeHref(href);\n\t}\n\tblock() {\n\t\treturn noop;\n\t}\n\tflush() {}\n\tdestroy() {}\n\tnotify() {}\n\t_getBlockers() {\n\t\treturn [];\n\t}\n};\n/** A fixed request location; server navigation is a no-op. */\nfunction createServerHistory(href) {\n\treturn new ServerHistory(parseHref(href, void 0));\n}\nfunction parseHref(href, state) {\n\tconst sanitizedHref = normalizeHref(href);\n\tconst hashIndex = sanitizedHref.indexOf(\"#\");\n\tconst searchIndex = sanitizedHref.indexOf(\"?\");\n\tif (!state) {\n\t\tconst key = createRandomKey();\n\t\tstate = {\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey,\n\t\t\t__TSR_key: key\n\t\t};\n\t}\n\treturn {\n\t\thref: sanitizedHref,\n\t\tpathname: sanitizedHref.slice(0, hashIndex > -1 ? searchIndex > -1 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > -1 ? searchIndex : sanitizedHref.length),\n\t\thash: hashIndex > -1 ? sanitizedHref.slice(hashIndex) : \"\",\n\t\tsearch: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : \"\",\n\t\tstate\n\t};\n}\nfunction createRandomKey() {\n\treturn (Math.random() + 1).toString(36).slice(7);\n}\n//#endregion\nexport { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory, createServerHistory, normalizeProtocolRelative, parseHref };\n\n//# sourceMappingURL=index.js.map","import { DEFAULT_PROTOCOL_ALLOWLIST, createNull, decodePath, deepEqual, encodePathLikeUrl, findLast, functionalUpdate, getUrlScheme, hasKeys, hasOwn, isDangerousProtocol, last, nullReplaceEqualDeep, protocolRelativePrefixRegex, replaceEqualDeep } from \"./utils.js\";\nimport { compileDecodeCharMap, interpolatePath, resolvePath, trimPath, trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nimport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegments, processRouteMasks, processRouteTree } from \"./new-process-route-tree.js\";\nimport { isNotFound } from \"./not-found.js\";\nimport { setupScrollRestoration } from \"./scroll-restoration.js\";\nimport { defaultParseSearch, defaultStringifySearch } from \"./searchParams.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk } from \"./load-client.js\";\nimport { executeRewriteInput, executeRewriteOutput, rewriteBasepath } from \"./rewrite.js\";\nimport { createRouterStores } from \"./stores.js\";\nimport { createBrowserHistory, normalizeProtocolRelative, parseHref } from \"@tanstack/history\";\nimport { isServer, loadServerRoute } from \"@tanstack/router-core/isServer\";\n//#region src/router.ts\nfunction isExternalUrl(url, origin) {\n\treturn url.protocol !== \"http:\" && url.protocol !== \"https:\" || url.origin !== origin || !!url.username || !!url.password;\n}\nfunction getUrlPath(url) {\n\treturn url.pathname + url.search + url.hash;\n}\nfunction routeNeedsLoad(route) {\n\treturn route.options.loader || route.options.beforeLoad || route.lazyFn || route.options.component?.preload || route.options.pendingComponent?.preload;\n}\n/**\n* Convert an unknown error into a minimal, serializable object.\n* Includes name and message (and stack in development).\n*/\nfunction defaultSerializeError(err) {\n\tif (err instanceof Error) {\n\t\tconst obj = {\n\t\t\tname: err.name,\n\t\t\tmessage: err.message\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") obj.stack = err.stack;\n\t\treturn obj;\n\t}\n\treturn { data: err };\n}\n/** Options for configuring trailing-slash behavior. */\nconst trailingSlashOptions = {\n\talways: \"always\",\n\tnever: \"never\",\n\tpreserve: \"preserve\"\n};\n/**\n* Compute whether path, href or hash changed between previous and current\n* resolved locations.\n*/\nfunction getLocationChangeInfo(location, resolvedLocation) {\n\treturn {\n\t\tfromLocation: resolvedLocation,\n\t\ttoLocation: location,\n\t\tpathChanged: resolvedLocation?.pathname !== location.pathname,\n\t\threfChanged: resolvedLocation?.href !== location.href,\n\t\thashChanged: resolvedLocation?.hash !== location.hash\n\t};\n}\n/**\n* Return only state owned by the application, excluding volatile history\n* bookkeeping. Mask payloads (`__tempLocation`/`__tempKey`) are kept: they\n* distinguish otherwise-identical locations.\n*/\nfunction _getUserHistoryState({ key: _key, __TSR_key: _tsrKey, __TSR_index: _tsrIndex, __hashScrollIntoViewOptions: _hashScroll, ...state }) {\n\treturn state;\n}\nfunction lifecycleEnd(matches) {\n\treturn matches.findIndex((match) => match.status === \"error\" || match.status === \"notFound\" || match._notFound) + 1;\n}\n/** Run route lifecycle callbacks in leave/enter/stay phases. */\nfunction runRouteLifecycle(router, previous, matches, previousEnd, nextEnd, owner) {\n\tif (previousEnd) previous = previous.slice(0, previousEnd);\n\tif (nextEnd) matches = matches.slice(0, nextEnd);\n\tfor (const match of previous) {\n\t\tif (owner && router._tx !== owner) return;\n\t\tif (!matches.some((candidate) => candidate.routeId === match.routeId)) router.routesById[match.routeId].options.onLeave?.(match);\n\t}\n\tfor (const match of matches) {\n\t\tif (owner && router._tx !== owner) return;\n\t\trouter.routesById[match.routeId].options[previous.some((candidate) => candidate.routeId === match.routeId) ? \"onStay\" : \"onEnter\"]?.(match);\n\t}\n}\n/**\n* Core, framework-agnostic router engine that powers TanStack Router.\n*\n* Provides navigation, matching, loading, preloading, caching and event APIs\n* used by framework adapters (React/Solid). Prefer framework helpers like\n* `createRouter` in app code.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType\n*/\nvar RouterCore = class {\n\t/**\n\t* @deprecated Use the `createRouter` function instead\n\t*/\n\tconstructor(options, getStoreConfig) {\n\t\tthis.tempLocationKey = `${Math.round(Math.random() * 1e7)}`;\n\t\tthis._scroll = { n: true };\n\t\tthis.subscribers = /* @__PURE__ */ new Set();\n\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\tthis._committed = [];\n\t\tthis.startTransition = async (fn) => {\n\t\t\tfn();\n\t\t\treturn false;\n\t\t};\n\t\tthis.update = (newOptions) => {\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tif (newOptions.notFoundRoute) console.warn(\"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.\");\n\t\t\t}\n\t\t\tconst prevOptions = this.options;\n\t\t\tthis.options = {\n\t\t\t\t...prevOptions,\n\t\t\t\t...newOptions\n\t\t\t};\n\t\t\tthis.isServer = this.options.isServer ?? isServer ?? typeof document === \"undefined\";\n\t\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\t\tthis.protocolAllowlist = new Set(this.options.protocolAllowlist);\n\t\t\tif (!this.history || this.options.history && this.options.history !== this.history) {\n\t\t\t\tif (!this.options.history) {\n\t\t\t\t\tif (!(isServer ?? this.isServer)) this.history = createBrowserHistory();\n\t\t\t\t} else this.history = this.options.history;\n\t\t\t}\n\t\t\tthis.origin = this.options.origin;\n\t\t\tif (!this.origin) {\n\t\t\t\tif (!(isServer ?? this.isServer) && window?.origin && window.origin !== \"null\") this.origin = window.origin;\n\t\t\t\telse this.origin = \"http://localhost\";\n\t\t\t}\n\t\t\tconst nextBasepath = this.options.basepath ?? \"/\";\n\t\t\tconst nextRewriteOption = this.options.rewrite;\n\t\t\tconst rewriteChanged = this.basepath !== nextBasepath || prevOptions?.rewrite !== nextRewriteOption || prevOptions?.caseSensitive !== this.options.caseSensitive;\n\t\t\tif (rewriteChanged) {\n\t\t\t\tthis.basepath = nextBasepath;\n\t\t\t\tthis.rewrite = nextBasepath !== \"/\" && trimPath(nextBasepath) ? rewriteBasepath(nextBasepath, this.options.caseSensitive, nextRewriteOption) : nextRewriteOption;\n\t\t\t}\n\t\t\tif (this.history) this.updateLatestLocation();\n\t\t\tif (this.options.routeTree !== this.routeTree || (isServer ?? this.isServer) && prevOptions?.caseSensitive !== this.options.caseSensitive) {\n\t\t\t\tthis.routeTree = this.options.routeTree;\n\t\t\t\tlet processRouteTreeResult;\n\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree && globalThis.__TSR_CACHE__.caseSensitive === this.options.caseSensitive) processRouteTreeResult = globalThis.__TSR_CACHE__.processRouteTreeResult;\n\t\t\t\telse {\n\t\t\t\t\tprocessRouteTreeResult = this.buildRouteTree();\n\t\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ === void 0) globalThis.__TSR_CACHE__ = {\n\t\t\t\t\t\trouteTree: this.routeTree,\n\t\t\t\t\t\tcaseSensitive: this.options.caseSensitive,\n\t\t\t\t\t\tprocessRouteTreeResult\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.setRoutes(processRouteTreeResult);\n\t\t\t}\n\t\t\tif (!this.stores) {\n\t\t\t\tif (this.latestLocation) {\n\t\t\t\t\tconst config = this.getStoreConfig(this);\n\t\t\t\t\tthis.batch = config.batch;\n\t\t\t\t\tthis.stores = createRouterStores(this.latestLocation, config);\n\t\t\t\t\tif (!(isServer ?? this.isServer)) setupScrollRestoration(this);\n\t\t\t\t}\n\t\t\t} else if (rewriteChanged) this.stores.location.set(this.latestLocation);\n\t\t};\n\t\tthis.updateLatestLocation = () => {\n\t\t\tthis.latestLocation = this.parseLocation(this.history.location, this.latestLocation);\n\t\t};\n\t\tthis.buildRouteTree = () => {\n\t\t\tconst result = processRouteTree(this.routeTree, this.options.caseSensitive);\n\t\t\tif (this.options.routeMasks) processRouteMasks(this.options.routeMasks, result.processedTree);\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tresolvePathCache: createSieveCache(1e3)\n\t\t\t};\n\t\t};\n\t\tthis.subscribe = (eventType, fn) => {\n\t\t\tconst listener = {\n\t\t\t\teventType,\n\t\t\t\tfn\n\t\t\t};\n\t\t\tthis.subscribers.add(listener);\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete(listener);\n\t\t\t};\n\t\t};\n\t\tthis.emit = (routerEvent) => {\n\t\t\tfor (const listener of this.subscribers) if (listener.eventType === routerEvent.type) try {\n\t\t\t\tlistener.fn(routerEvent);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t};\n\t\tthis.parseLocation = (locationToParse, previousLocation) => {\n\t\t\tconst parse = ({ pathname, search, hash, href }, state) => {\n\t\t\t\tif (!this.rewrite && !/[ \\x00-\\x1f\\x7f\\u0080-\\uffff]/.test(pathname)) {\n\t\t\t\t\tconst parsedSearch = this.options.parseSearch(search);\n\t\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\t\treturn {\n\t\t\t\t\t\thref: pathname + searchStr + hash,\n\t\t\t\t\t\tpublicHref: pathname + searchStr + hash,\n\t\t\t\t\t\tpathname: decodePath(pathname),\n\t\t\t\t\t\texternal: false,\n\t\t\t\t\t\tsearchStr,\n\t\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\t\thash: decodePath(hash.slice(1)),\n\t\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst url = executeRewriteInput(this.rewrite, new URL(href, this.origin));\n\t\t\t\tconst parsedSearch = this.options.parseSearch(url.search);\n\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\turl.search = searchStr;\n\t\t\t\treturn {\n\t\t\t\t\thref: url.href.replace(url.origin, \"\"),\n\t\t\t\t\tpublicHref: href,\n\t\t\t\t\tpathname: decodePath(normalizeProtocolRelative(url.pathname)),\n\t\t\t\t\texternal: !!this.rewrite && isExternalUrl(url, this.origin),\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\thash: decodePath(url.hash.slice(1)),\n\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst location = parse(locationToParse, locationToParse.state);\n\t\t\tconst { __tempLocation, __tempKey } = location.state;\n\t\t\tif (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n\t\t\t\tconst parsedTempLocation = parse(__tempLocation, {\n\t\t\t\t\t...__tempLocation.state,\n\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\tkey: location.state.key,\n\t\t\t\t\t__TSR_key: location.state.__TSR_key\n\t\t\t\t});\n\t\t\t\tparsedTempLocation.maskedLocation = location;\n\t\t\t\treturn parsedTempLocation;\n\t\t\t}\n\t\t\treturn location;\n\t\t};\n\t\tthis.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => {\n\t\t\tif (typeof pathnameOrNext === \"string\") return this.matchRoutesInternal({\n\t\t\t\tpathname: pathnameOrNext,\n\t\t\t\tsearch: locationSearchOrOpts\n\t\t\t}, opts);\n\t\t\treturn this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts);\n\t\t};\n\t\tthis.getMatchedRoutes = (pathname) => {\n\t\t\tconst rawParams = Object.create(null);\n\t\t\tconst match = findRouteMatch(trimPathRight(pathname), this.processedTree, true);\n\t\t\tif (match) Object.assign(rawParams, match.rawParams);\n\t\t\treturn [\n\t\t\t\tmatch?.branch || [this.routesById[\"__root__\"]],\n\t\t\t\trawParams,\n\t\t\t\tmatch?.route\n\t\t\t];\n\t\t};\n\t\tthis.buildLocation = (opts) => {\n\t\t\tif (!(isServer ?? this.isServer)) {\n\t\t\t\tconst cached = this.staticLocations.get(opts);\n\t\t\t\tif (cached) return cached;\n\t\t\t}\n\t\t\tlet usedCurrent = false;\n\t\t\tconst build = (dest = {}) => {\n\t\t\t\tif (dest.href) {\n\t\t\t\t\tconst parsed = parseHref(dest.href, {});\n\t\t\t\t\tdest = {\n\t\t\t\t\t\t...dest,\n\t\t\t\t\t\tto: executeRewriteInput(this.rewrite, new URL(parsed.pathname, this.origin)).pathname,\n\t\t\t\t\t\tsearch: this.options.parseSearch(parsed.search),\n\t\t\t\t\t\thash: parsed.hash.slice(1)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst currentLocation = opts._fromLocation || this._pendingLocation || this.latestLocation;\n\t\t\t\tlet lightweight;\n\t\t\t\tconst current = () => {\n\t\t\t\t\tusedCurrent = true;\n\t\t\t\t\treturn currentLocation;\n\t\t\t\t};\n\t\t\t\tconst currentMatch = () => lightweight ??= this.matchRoutesLightweight(current());\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && dest.from && dest._isNavigate) {\n\t\t\t\t\tconst [allFromMatches] = this.getMatchedRoutes(dest.from);\n\t\t\t\t\tconst [matchedRoutes, fullPath] = currentMatch();\n\t\t\t\t\tconst matchedFrom = findLast(matchedRoutes, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, dest.from);\n\t\t\t\t\t});\n\t\t\t\t\tconst matchedCurrent = findLast(allFromMatches, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, fullPath);\n\t\t\t\t\t});\n\t\t\t\t\tif (!matchedFrom && !matchedCurrent) console.warn(`Could not find match for from: ${dest.from}`);\n\t\t\t\t}\n\t\t\t\tconst to = dest.to ? `${dest.to}` : \".\";\n\t\t\t\tconst nextTo = resolvePath(to[0] === \"/\" ? \"\" : dest.unsafeRelative === \"path\" ? current().pathname : dest.from ?? currentMatch()[1], to, this.options.trailingSlash, this.resolvePathCache);\n\t\t\t\tconst destRoute = this.routesByPath[trimPathRight(nextTo)];\n\t\t\t\tconst isTemplate = nextTo.includes(\"$\");\n\t\t\t\tlet destRoutes;\n\t\t\t\tif (destRoute) destRoutes = destRoute._branch ??= buildRouteBranch(destRoute);\n\t\t\t\telse if (isTemplate) destRoutes = [];\n\t\t\t\telse {\n\t\t\t\t\tconst [matchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(nextTo);\n\t\t\t\t\tdestRoutes = matchedRoutes;\n\t\t\t\t\tif (this.options.notFoundRoute && (!foundRoute || foundRoute.path !== \"/\" && rawParams[\"**\"])) destRoutes = [...destRoutes, this.options.notFoundRoute];\n\t\t\t\t}\n\t\t\t\tconst interpolation = isTemplate ? destRoute?._interpolation ?? parseSegments(false, { fullPath: nextTo }, 0) : void 0;\n\t\t\t\tlet nextParams;\n\t\t\t\tfor (const route of destRoutes) {\n\t\t\t\t\tconst fn = route.options.params?.stringify ?? route.options.stringifyParams;\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\tconst fromParams = currentMatch()[3];\n\t\t\t\t\t\tnextParams ??= resolveNextParams(dest.params, fromParams);\n\t\t\t\t\t\tif (!hasKeys(nextParams)) break;\n\t\t\t\t\t\tif (nextParams === fromParams) nextParams = Object.assign(createNull(), nextParams);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tObject.assign(nextParams, fn(nextParams));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextParams ??= resolveNextParams(dest.params, needsInheritedParams(dest.params, interpolation) ? currentMatch()[3] : EMPTY_RECORD);\n\t\t\t\tconst nextPathname = opts.leaveParams ? nextTo : normalizeProtocolRelative(decodePath(interpolation ? interpolatePath(nextTo, interpolation, nextParams, this.pathParamsDecoder) : nextTo));\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && destRoute && !opts.leaveParams) try {\n\t\t\t\t\tconst foundRoute = this.getMatchedRoutes(nextPathname)[2];\n\t\t\t\t\tif (foundRoute?.id !== destRoute.id) console.warn(`Generated path \"${nextPathname}\" for route \"${destRoute.id}\" matched route \"${foundRoute?.id}\" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`);\n\t\t\t\t} catch {}\n\t\t\t\tconst middlewares = getSearchMiddlewares(destRoutes, opts._includeValidateSearch);\n\t\t\t\tconst fromSearch = () => {\n\t\t\t\t\tlet search = currentMatch()[2];\n\t\t\t\t\tif (opts._includeValidateSearch && this.options.search?.strict) {\n\t\t\t\t\t\tconst validatedSearch = {};\n\t\t\t\t\t\tdestRoutes.forEach((route) => {\n\t\t\t\t\t\t\tif (route.options.validateSearch) try {\n\t\t\t\t\t\t\t\tObject.assign(validatedSearch, validateSearch(route.options.validateSearch, {\n\t\t\t\t\t\t\t\t\t...validatedSearch,\n\t\t\t\t\t\t\t\t\t...search\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsearch = validatedSearch;\n\t\t\t\t\t}\n\t\t\t\t\treturn search;\n\t\t\t\t};\n\t\t\t\tconst nextSearch = middlewares.length ? applySearchMiddleware(middlewares, fromSearch(), dest) : dest.search === true ? fromSearch() : typeof dest.search === \"function\" ? dest.search(fromSearch()) : dest.search || EMPTY_RECORD;\n\t\t\t\tconst searchStr = this.options.stringifySearch(nextSearch);\n\t\t\t\tconst hash = dest.hash === true ? current().hash : typeof dest.hash === \"function\" ? dest.hash(current().hash) : dest.hash || void 0;\n\t\t\t\tconst hashStr = hash ? `#${hash}` : \"\";\n\t\t\t\tconst nextState = !dest.state ? EMPTY_RECORD : dest.state === true ? current().state : typeof dest.state === \"function\" ? dest.state(current().state) : dest.state;\n\t\t\t\tconst fullPath = `${nextPathname}${searchStr}${hashStr}`;\n\t\t\t\tlet href;\n\t\t\t\tlet publicHref;\n\t\t\t\tlet external = false;\n\t\t\t\tif (this.rewrite) {\n\t\t\t\t\tconst url = new URL(fullPath, this.origin);\n\t\t\t\t\tconst origin = url.origin;\n\t\t\t\t\tconst rewrittenUrl = executeRewriteOutput(this.rewrite, url);\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tif (isExternalUrl(rewrittenUrl, origin)) {\n\t\t\t\t\t\tpublicHref = rewrittenUrl.href;\n\t\t\t\t\t\texternal = true;\n\t\t\t\t\t} else publicHref = normalizeProtocolRelative(getUrlPath(rewrittenUrl));\n\t\t\t\t} else {\n\t\t\t\t\thref = encodePathLikeUrl(fullPath);\n\t\t\t\t\tpublicHref = href;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tpublicHref,\n\t\t\t\t\thref,\n\t\t\t\t\tpathname: nextPathname,\n\t\t\t\t\tsearch: nextSearch,\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tstate: nextState,\n\t\t\t\t\thash: hash ?? \"\",\n\t\t\t\t\texternal,\n\t\t\t\t\tunmaskOnReload: dest.unmaskOnReload\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst next = build(opts);\n\t\t\tif (opts.mask) next.maskedLocation = build({\n\t\t\t\tfrom: opts.from,\n\t\t\t\t...opts.mask\n\t\t\t});\n\t\t\telse if (this.options.routeMasks) {\n\t\t\t\tconst match = findFlatMatch(next.pathname, this.processedTree);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst params = Object.assign(createNull(), match.rawParams);\n\t\t\t\t\tconst { from: _from, params: maskParams, ...maskProps } = match.route;\n\t\t\t\t\tconst nextParams = resolveNextParams(maskParams, params);\n\t\t\t\t\tnext.maskedLocation = build({\n\t\t\t\t\t\tfrom: opts.from,\n\t\t\t\t\t\t...maskProps,\n\t\t\t\t\t\tparams: nextParams\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!(isServer ?? this.isServer) && !usedCurrent && opts._fromLocation) this.staticLocations.set(opts, next);\n\t\t\treturn next;\n\t\t};\n\t\tthis.commitLocation = async ({ viewTransition, ignoreBlocker, ...next }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst nextLocation = next.maskedLocation ?? next;\n\t\t\tif (nextLocation.external && !(isServer ?? this.isServer)) return documentNavigation(this, nextLocation.publicHref, {\n\t\t\t\treplace: next.replace,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tlet historyAction;\n\t\t\tconst isSameLocation = trimPathRight(this.latestLocation.href) === trimPathRight(next.href) && deepEqual(_getUserHistoryState(next.state), _getUserHistoryState(this.latestLocation.state));\n\t\t\tconst previousCommitPromise = this._commitPromise;\n\t\t\tlet resolve;\n\t\t\tconst commitPromise = new Promise((done) => {\n\t\t\t\tresolve = done;\n\t\t\t});\n\t\t\tcommitPromise.resolve = () => {\n\t\t\t\tresolve();\n\t\t\t\tpreviousCommitPromise?.resolve();\n\t\t\t};\n\t\t\tthis._commitPromise = commitPromise;\n\t\t\tif (isSameLocation) this.load();\n\t\t\telse {\n\t\t\t\tlet { maskedLocation, hashScrollIntoView, ...nextHistory } = next;\n\t\t\t\tif (maskedLocation) {\n\t\t\t\t\tnextHistory = {\n\t\t\t\t\t\t...maskedLocation,\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t...maskedLocation.state,\n\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t__tempLocation: {\n\t\t\t\t\t\t\t\t...nextHistory,\n\t\t\t\t\t\t\t\tsearch: nextHistory.searchStr,\n\t\t\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\t\t\t\t\t__TSR_key: void 0,\n\t\t\t\t\t\t\t\t\tkey: void 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) nextHistory.state.__tempKey = this.tempLocationKey;\n\t\t\t\t}\n\t\t\t\tnextHistory.state = {\n\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t__hashScrollIntoViewOptions: hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true\n\t\t\t\t};\n\t\t\t\tthis.shouldViewTransition = viewTransition;\n\t\t\t\thistoryAction = next.replace ? \"REPLACE\" : \"PUSH\";\n\t\t\t\tthis.history[historyAction === \"REPLACE\" ? \"replace\" : \"push\"](nextHistory.publicHref, nextHistory.state, { ignoreBlocker });\n\t\t\t\tif (!this.history.subscribers.size) this.load({ action: { type: historyAction } });\n\t\t\t}\n\t\t\tthis._scroll.n = next.resetScroll ?? true;\n\t\t\treturn this._commitPromise;\n\t\t};\n\t\tthis.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest } = {}) => {\n\t\t\tif (isServer ?? this.isServer) return Promise.resolve();\n\t\t\tconst location = this.buildLocation({\n\t\t\t\t...rest,\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tthis._pendingLocation = location;\n\t\t\tconst commitPromise = this.commitLocation({\n\t\t\t\t...location,\n\t\t\t\tviewTransition,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this._pendingLocation === location) this._pendingLocation = void 0;\n\t\t\t});\n\t\t\treturn commitPromise;\n\t\t};\n\t\tthis.navigate = async ({ to, reloadDocument, href, publicHref, ...rest }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst hrefScheme = href ? getUrlScheme(href) : void 0;\n\t\t\tif (hrefScheme || reloadDocument) {\n\t\t\t\tif (to !== void 0 || !href) {\n\t\t\t\t\tconst location = this.buildLocation({\n\t\t\t\t\t\tto,\n\t\t\t\t\t\t...rest\n\t\t\t\t\t});\n\t\t\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\t\t\thref ??= publicLocation.publicHref;\n\t\t\t\t\tpublicHref ??= publicLocation.publicHref;\n\t\t\t\t}\n\t\t\t\tconst reloadHref = !hrefScheme && publicHref ? publicHref : href;\n\t\t\t\treturn documentNavigation(this, reloadHref, rest);\n\t\t\t}\n\t\t\treturn this.buildAndCommitLocation({\n\t\t\t\t...rest,\n\t\t\t\thref,\n\t\t\t\tto,\n\t\t\t\t_isNavigate: true\n\t\t\t});\n\t\t};\n\t\tthis.load = async (opts) => {\n\t\t\tif (isServer ?? this.isServer) return loadServerRoute(this, opts);\n\t\t\tthis.updateLatestLocation();\n\t\t\tif (opts?.action) this._scroll.h = opts.action.type === \"PUSH\" || opts.action.type === \"REPLACE\";\n\t\t\tawait loadClientRoute(this, opts);\n\t\t};\n\t\tthis.startViewTransition = (fn) => {\n\t\t\tconst shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;\n\t\t\tthis.shouldViewTransition = void 0;\n\t\t\tif (shouldViewTransition && !(isServer ?? typeof document === \"undefined\") && typeof document.startViewTransition === \"function\") {\n\t\t\t\tlet startViewTransitionParams;\n\t\t\t\tif (typeof shouldViewTransition === \"object\" && window.CSS?.supports?.(\"selector(:active-view-transition-type(a))\")) {\n\t\t\t\t\tconst next = this.latestLocation;\n\t\t\t\t\tconst prevLocation = this.stores.resolvedLocation.get();\n\t\t\t\t\tconst resolvedViewTransitionTypes = typeof shouldViewTransition.types === \"function\" ? shouldViewTransition.types(getLocationChangeInfo(next, prevLocation)) : shouldViewTransition.types;\n\t\t\t\t\tif (resolvedViewTransitionTypes === false) return fn();\n\t\t\t\t\tstartViewTransitionParams = {\n\t\t\t\t\t\tupdate: fn,\n\t\t\t\t\t\ttypes: resolvedViewTransitionTypes\n\t\t\t\t\t};\n\t\t\t\t} else startViewTransitionParams = fn;\n\t\t\t\treturn document.startViewTransition(startViewTransitionParams).updateCallbackDone;\n\t\t\t}\n\t\t\treturn fn();\n\t\t};\n\t\tthis.invalidate = (opts) => {\n\t\t\tconst committedMatches = this._committed;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst invalidIds = /* @__PURE__ */ new Set();\n\t\t\tconst consider = (match) => {\n\t\t\t\tif (!filter || filter(match)) invalidIds.add(match.id);\n\t\t\t};\n\t\t\tcommittedMatches.forEach(consider);\n\t\t\tthis._cache.forEach(consider);\n\t\t\tpreloads?.forEach((matches) => matches.forEach(consider));\n\t\t\tthis._tx?.[3].forEach(consider);\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (matches.some((match) => invalidIds.has(match.id))) {\n\t\t\t\tpreloads.delete(controller);\n\t\t\t\tabort.push(controller);\n\t\t\t}\n\t\t\tconst invalidate = (d) => {\n\t\t\t\tif (invalidIds.has(d.id)) {\n\t\t\t\t\tconst route = this.routesById[d.routeId];\n\t\t\t\t\tconst next = {\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tinvalid: true,\n\t\t\t\t\t\t...(opts?.forcePending || d.status === \"error\" || d.status === \"notFound\") && routeNeedsLoad(route) ? {\n\t\t\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\t\t\terror: void 0\n\t\t\t\t\t\t} : void 0\n\t\t\t\t\t};\n\t\t\t\t\td._flight = void 0;\n\t\t\t\t\treturn next;\n\t\t\t\t}\n\t\t\t\treturn d;\n\t\t\t};\n\t\t\tthis._committed = committedMatches.map(invalidate);\n\t\t\tfor (const [id, match] of this._cache) if (invalidIds.has(id)) {\n\t\t\t\tmatch.invalid = true;\n\t\t\t\tif (opts?.forcePending) match.status = \"pending\";\n\t\t\t}\n\t\t\tfor (const id of invalidIds) {\n\t\t\t\tconst flight = this._flights?.get(id);\n\t\t\t\tthis._flights?.delete(id);\n\t\t\t\tif (flight && !flight[2]) abort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t\tthis.shouldViewTransition = false;\n\t\t\treturn this.load({ sync: opts?.sync });\n\t\t};\n\t\tthis.resolveRedirect = (redirect) => {\n\t\t\tconst options = redirect.options;\n\t\t\tlet href = redirect.headers.get(\"Location\") || options.href;\n\t\t\tif (!href) {\n\t\t\t\tconst location = this.buildLocation(options);\n\t\t\t\thref = (location.maskedLocation ?? location).publicHref || \"/\";\n\t\t\t}\n\t\t\tlet scheme;\n\t\t\tif (protocolRelativePrefixRegex.test(href) || (scheme = getUrlScheme(href)) && !this.protocolAllowlist.has(scheme)) throw new Error(process.env.NODE_ENV !== \"production\" ? `Redirect blocked: unsafe protocol in href \"${href}\". Allowed protocols: ${Array.from(this.protocolAllowlist).join(\", \")}.` : \"Redirect blocked: unsafe protocol\");\n\t\t\tif (scheme === \"http:\" || scheme === \"https:\") {\n\t\t\t\tconst url = new URL(href);\n\t\t\t\tif (url.pathname.startsWith(\"//\")) href = url.href;\n\t\t\t\telse if (!isExternalUrl(url, this.origin)) {\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tscheme = void 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scheme) options.reloadDocument = true;\n\t\t\toptions.href = href;\n\t\t\tredirect.headers.set(\"Location\", href);\n\t\t\treturn redirect;\n\t\t};\n\t\tthis.clearCache = (opts) => {\n\t\t\tconst cached = this._cache;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst discarded = [];\n\t\t\tconst discardedIds = [];\n\t\t\tfor (const [id, match] of cached) if (!filter || filter(match)) {\n\t\t\t\tdiscardedIds.push(id);\n\t\t\t\tdiscarded.push(match);\n\t\t\t}\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (!filter || matches.some(filter)) {\n\t\t\t\tabort.push(controller);\n\t\t\t\tdiscarded.push(...matches);\n\t\t\t}\n\t\t\tfor (const id of discardedIds) cached.delete(id);\n\t\t\tfor (const controller of abort) preloads.delete(controller);\n\t\t\tfor (const match of discarded) {\n\t\t\t\tconst flight = match._flight;\n\t\t\t\tmatch._flight = void 0;\n\t\t\t\tif (flight && !--flight[2]) {\n\t\t\t\t\tif (this._flights?.get(match.id) === flight) this._flights.delete(match.id);\n\t\t\t\t\tabort.push(flight[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t};\n\t\tthis.loadRouteChunk = loadRouteChunk;\n\t\tthis.preloadRoute = (opts) => preloadClientRoute(this, opts);\n\t\tthis.matchRoute = (location, opts) => {\n\t\t\tconst matchLocation = {\n\t\t\t\t...location,\n\t\t\t\tto: location.to ? resolvePath(location.from || \"\", location.to, this.options.trailingSlash, this.resolvePathCache) : void 0,\n\t\t\t\tparams: location.params || {},\n\t\t\t\tleaveParams: true\n\t\t\t};\n\t\t\tconst next = this.buildLocation(matchLocation);\n\t\t\tconst isPending = this.stores.status.get() === \"pending\";\n\t\t\tif (opts?.pending && !isPending) return false;\n\t\t\tconst baseLocation = opts?.pending ?? !isPending ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get();\n\t\t\tconst match = findSingleMatch(next.pathname, opts?.caseSensitive ?? false, opts?.fuzzy ?? false, baseLocation.pathname, this.processedTree);\n\t\t\tif (!match) return false;\n\t\t\tif (location.params) {\n\t\t\t\tif (!deepEqual(match.rawParams, location.params, true)) return false;\n\t\t\t}\n\t\t\tif (opts?.includeSearch ?? true) return deepEqual(baseLocation.search, next.search, true) ? match.rawParams : false;\n\t\t\treturn match.rawParams;\n\t\t};\n\t\tthis.getStoreConfig = getStoreConfig;\n\t\tif (options.pathParamsAllowedCharacters?.length) this.pathParamsDecoder = compileDecodeCharMap(options.pathParamsAllowedCharacters);\n\t\tthis.update({\n\t\t\tdefaultPreloadDelay: 50,\n\t\t\tdefaultPendingMs: 1e3,\n\t\t\tdefaultPendingMinMs: 500,\n\t\t\tcontext: void 0,\n\t\t\t...options,\n\t\t\tcaseSensitive: options.caseSensitive ?? false,\n\t\t\tnotFoundMode: options.notFoundMode ?? \"fuzzy\",\n\t\t\tstringifySearch: options.stringifySearch ?? defaultStringifySearch,\n\t\t\tparseSearch: options.parseSearch ?? defaultParseSearch,\n\t\t\tprotocolAllowlist: options.protocolAllowlist ?? DEFAULT_PROTOCOL_ALLOWLIST\n\t\t});\n\t\tif (!(isServer ?? typeof document === \"undefined\")) self.__TSR_ROUTER__ = this;\n\t}\n\tisShell() {\n\t\treturn !!this.options.isShell;\n\t}\n\tget state() {\n\t\treturn this.stores.__store.get();\n\t}\n\tsetRoutes(caches) {\n\t\tObject.assign(this, caches);\n\t\tthis.lightweightCache = /* @__PURE__ */ new WeakMap();\n\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\tconst notFoundRoute = this.options.notFoundRoute;\n\t\tif (notFoundRoute) {\n\t\t\tnotFoundRoute.init(99999999999);\n\t\t\tif (this.routesById[notFoundRoute.id] !== notFoundRoute) notFoundRoute._interpolation = parseSegments(false, notFoundRoute, 0);\n\t\t\tthis.routesById[notFoundRoute.id] = notFoundRoute;\n\t\t}\n\t}\n\tmatchRoutesInternal(next, opts) {\n\t\tconst [initialMatchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(next.pathname);\n\t\tlet matchedRoutes = initialMatchedRoutes;\n\t\tlet isGlobalNotFound = false;\n\t\tif (foundRoute ? foundRoute.path !== \"/\" && rawParams[\"**\"] : trimPathRight(next.pathname)) {\n\t\t\tif (this.options.notFoundRoute) matchedRoutes = [...matchedRoutes, this.options.notFoundRoute];\n\t\t\telse isGlobalNotFound = true;\n\t\t}\n\t\tconst _notFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0;\n\t\tconst matches = new Array(matchedRoutes.length);\n\t\tconst committed = this._committed;\n\t\tconst previousAt = (route, index) => {\n\t\t\tconst match = committed[index];\n\t\t\treturn match?.routeId === route.id ? match : route === this.options.notFoundRoute ? committed.find((candidate) => candidate.routeId === route.id) : void 0;\n\t\t};\n\t\tlet strictParams;\n\t\tfor (let index = 0; index < matchedRoutes.length; index++) {\n\t\t\tconst route = matchedRoutes[index];\n\t\t\tconst parentMatch = matches[index - 1];\n\t\t\tlet preMatchSearch;\n\t\t\tlet strictMatchSearch;\n\t\t\tlet searchError;\n\t\t\t{\n\t\t\t\tconst parentSearch = parentMatch?.search ?? next.search;\n\t\t\t\tconst parentStrictSearch = parentMatch?._strictSearch ?? void 0;\n\t\t\t\ttry {\n\t\t\t\t\tconst strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0;\n\t\t\t\t\tpreMatchSearch = {\n\t\t\t\t\t\t...parentSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t\tstrictMatchSearch = {\n\t\t\t\t\t\t...parentStrictSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlet searchParamError = err;\n\t\t\t\t\tif (!(err instanceof SearchParamError)) searchParamError = new SearchParamError(err.message, { cause: err });\n\t\t\t\t\tif (opts?.throwOnError) throw searchParamError;\n\t\t\t\t\tpreMatchSearch = parentSearch;\n\t\t\t\t\tstrictMatchSearch = {};\n\t\t\t\t\tsearchError = searchParamError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet loaderDeps = \"\";\n\t\t\tlet loaderDepsHash = \"\";\n\t\t\ttry {\n\t\t\t\tloaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? \"\";\n\t\t\t\tloaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) || \"\" : \"\";\n\t\t\t} catch (cause) {\n\t\t\t\tif (opts?.throwOnError) throw cause;\n\t\t\t\tsearchError ??= cause;\n\t\t\t}\n\t\t\tconst usedParams = createNull();\n\t\t\tconst interpolatedPath = route._interpolation ? interpolatePath(route.fullPath, route._interpolation, rawParams, this.pathParamsDecoder, usedParams) : route.fullPath;\n\t\t\tconst matchId = route.id + interpolatedPath + loaderDepsHash;\n\t\t\tconst previousMatch = previousAt(route, index);\n\t\t\tconst existingMatch = process.env.NODE_ENV !== \"production\" && opts?._rematerialize ? void 0 : this._cache.get(matchId) ?? (previousMatch?.id === matchId ? previousMatch : void 0);\n\t\t\tstrictParams = existingMatch?._strictParams ?? Object.assign(usedParams, strictParams);\n\t\t\tlet paramsError;\n\t\t\tif (!existingMatch) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch (err) {\n\t\t\t\tif (isNotFound(err) || isRedirect(err)) paramsError = err;\n\t\t\t\telse paramsError = new PathParamError(err.message, { cause: err });\n\t\t\t\tif (opts?.throwOnError) throw paramsError;\n\t\t\t}\n\t\t\tconst cause = previousMatch ? \"stay\" : \"enter\";\n\t\t\tlet match;\n\t\t\tif (existingMatch) match = {\n\t\t\t\t...existingMatch,\n\t\t\t\tcause,\n\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : nullReplaceEqualDeep(existingMatch.search, preMatchSearch),\n\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\tsearchError\n\t\t\t};\n\t\t\telse {\n\t\t\t\tconst status = routeNeedsLoad(route) ? \"pending\" : \"success\";\n\t\t\t\tmatch = {\n\t\t\t\t\tid: matchId,\n\t\t\t\t\tssr: isServer ?? this.isServer ? void 0 : route.options.ssr,\n\t\t\t\t\tindex,\n\t\t\t\t\trouteId: route.id,\n\t\t\t\t\tparams: previousMatch?.params ?? strictParams,\n\t\t\t\t\t_strictParams: strictParams,\n\t\t\t\t\tpathname: interpolatedPath,\n\t\t\t\t\tupdatedAt: Date.now(),\n\t\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch,\n\t\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\t\tsearchError,\n\t\t\t\t\tstatus,\n\t\t\t\t\tisFetching: false,\n\t\t\t\t\terror: void 0,\n\t\t\t\t\tparamsError,\n\t\t\t\t\tcontext: {},\n\t\t\t\t\tabortController: opts?._controller ?? new AbortController(),\n\t\t\t\t\tcause,\n\t\t\t\t\tloaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps,\n\t\t\t\t\tinvalid: false,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tstaticData: route.options.staticData || {},\n\t\t\t\t\tfullPath: route.fullPath\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst _notFound = _notFoundRouteId === route.id;\n\t\t\tif (match._notFound && !_notFound) match.error = void 0;\n\t\t\tmatch._notFound = _notFound;\n\t\t\tmatches[index] = match;\n\t\t}\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tmatch.params = match.cause === \"stay\" ? nullReplaceEqualDeep(match.params, strictParams) : strictParams;\n\t\t\tif (opts?._controller) match.context = {};\n\t\t}\n\t\treturn matches;\n\t}\n\t/**\n\t* Lightweight route matching for buildLocation.\n\t* Only computes fullPath, accumulated search, and params - skipping expensive\n\t* operations like AbortController, loaderDeps, and full match objects.\n\t*/\n\tmatchRoutesLightweight(location) {\n\t\tconst lastRouteId = last(this.stores.ids.get());\n\t\tconst lastStateMatch = lastRouteId ? this.stores.byRoute.get(lastRouteId).get() : void 0;\n\t\tconst lastStateMatchId = lastStateMatch?.id;\n\t\tconst cached = this.lightweightCache.get(location);\n\t\tif (cached && cached[0] === lastStateMatchId) return cached[1];\n\t\tconst [matchedRoutes, rawParams] = this.getMatchedRoutes(location.pathname);\n\t\tconst lastRoute = last(matchedRoutes);\n\t\tconst accumulatedSearch = { ...location.search };\n\t\tfor (const route of matchedRoutes) try {\n\t\t\tObject.assign(accumulatedSearch, validateSearch(route.options.validateSearch, accumulatedSearch));\n\t\t} catch {}\n\t\tconst canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && lastStateMatch.pathname === location.pathname;\n\t\tlet params;\n\t\tif (canReuseParams) params = lastStateMatch.params;\n\t\telse {\n\t\t\tconst strictParams = rawParams;\n\t\t\tfor (const route of matchedRoutes) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch {}\n\t\t\tparams = strictParams;\n\t\t}\n\t\tconst result = [\n\t\t\tmatchedRoutes,\n\t\t\tlastRoute.fullPath,\n\t\t\taccumulatedSearch,\n\t\t\tparams\n\t\t];\n\t\tthis.lightweightCache.set(location, [lastStateMatchId, result]);\n\t\treturn result;\n\t}\n};\nasync function documentNavigation(router, href, { replace, ignoreBlocker }) {\n\tif (isDangerousProtocol(href, router.protocolAllowlist)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked navigation to dangerous protocol: ${href}`);\n\t\treturn;\n\t}\n\tif (!ignoreBlocker) {\n\t\tconst blockers = router.history._getBlockers();\n\t\tfor (const blocker of blockers) if (blocker?.blockerFn) {\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: router.history.location,\n\t\t\t\tnextLocation: router.history.location,\n\t\t\t\taction: replace ? \"REPLACE\" : \"PUSH\"\n\t\t\t})) return;\n\t\t}\n\t}\n\trouter.history._ignoreNextBeforeUnload?.(href);\n\tif (replace) window.location.replace(href);\n\telse window.location.href = href;\n}\n/**\n* In non-production environments,\n* augment the RouterCore class with a `_refreshRoute` method\n* dedicated to HMR.\n*/\nif (process.env.NODE_ENV !== \"production\") {\n\tRouterCore.prototype._replaceRouteChunk = replaceRouteChunk;\n\tRouterCore.prototype._refreshRoute = async function() {\n\t\tthis._serverResult = void 0;\n\t\tthis.updateLatestLocation();\n\t\tawait refreshClientRoute(this);\n\t};\n}\n/** Error thrown when search parameter validation fails. */\nvar SearchParamError = class extends Error {};\n/** Error thrown when path parameter parsing/validation fails. */\nvar PathParamError = class extends Error {};\nconst normalize = (str) => str.endsWith(\"/\") && str.length > 1 ? str.slice(0, -1) : str;\nfunction comparePaths(a, b) {\n\treturn normalize(a) === normalize(b);\n}\n/**\n* Lazily import a module function and forward arguments to it, retaining\n* parameter and return types for the selected export key.\n*/\nfunction lazyFn(fn, key) {\n\treturn async (...args) => {\n\t\treturn (await fn())[key || \"default\"](...args);\n\t};\n}\n/** Create an initial RouterState from a parsed location. */\nfunction getInitialRouterState(location) {\n\treturn {\n\t\tisLoading: false,\n\t\tstatus: \"idle\",\n\t\tresolvedLocation: void 0,\n\t\tlocation,\n\t\tmatches: []\n\t};\n}\nfunction validateSearch(validateSearch, input) {\n\tif (validateSearch == null) return {};\n\tif (\"~standard\" in validateSearch) {\n\t\tconst result = validateSearch[\"~standard\"].validate(input);\n\t\tif (result instanceof Promise) throw new SearchParamError(\"Async validation not supported\");\n\t\tif (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result });\n\t\treturn result.value;\n\t}\n\tif (\"parse\" in validateSearch) return validateSearch.parse(input);\n\tif (typeof validateSearch === \"function\") return validateSearch(input);\n\treturn {};\n}\nfunction resolveNextParams(spec, base) {\n\tif (spec === void 0 || spec === true) return base;\n\tconst next = Object.create(null);\n\tif (spec === false || spec === null) return next;\n\tif (typeof spec === \"function\") {\n\t\tObject.assign(next, base);\n\t\treturn Object.assign(next, spec(next));\n\t}\n\treturn Object.assign(next, base, spec);\n}\nfunction needsInheritedParams(spec, interpolation) {\n\tif (typeof spec === \"function\") return true;\n\tif (!interpolation || spec === false || spec === null) return false;\n\treturn spec === void 0 || spec === true || interpolation.some((part) => typeof part !== \"string\" && !hasOwn.call(spec, part[1]));\n}\nconst EMPTY_RECORD = Object.freeze({});\nfunction getSearchMiddlewares(destRoutes, includeValidateSearch) {\n\tconst middlewares = [];\n\tfor (let i = 0; i < destRoutes.length; i++) {\n\t\tconst routeOptions = destRoutes[i].options;\n\t\tif (\"search\" in routeOptions) {\n\t\t\tif (routeOptions.search?.middlewares) middlewares.push(...routeOptions.search.middlewares);\n\t\t} else if (routeOptions.preSearchFilters || routeOptions.postSearchFilters) {\n\t\t\tconst legacyMiddleware = ({ search, next }) => {\n\t\t\t\tconst result = next(routeOptions.preSearchFilters ? routeOptions.preSearchFilters.reduce((prev, next) => next(prev), search) : search);\n\t\t\t\treturn routeOptions.postSearchFilters ? routeOptions.postSearchFilters.reduce((prev, next) => next(prev), result) : result;\n\t\t\t};\n\t\t\tmiddlewares.push(legacyMiddleware);\n\t\t}\n\t\tconst routeValidateSearch = routeOptions.validateSearch;\n\t\tif (includeValidateSearch && routeValidateSearch) {\n\t\t\tconst validate = ({ search, next, meta }) => {\n\t\t\t\tconst result = next(search);\n\t\t\t\ttry {\n\t\t\t\t\tconst validated = validateSearch(routeValidateSearch, result);\n\t\t\t\t\tif (meta && validated) {\n\t\t\t\t\t\tfor (const key in validated) if (!(key in result)) (meta.defaulted ||= /* @__PURE__ */ new Map()).set(key, validated[key]);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\t...validated\n\t\t\t\t\t};\n\t\t\t\t} catch {}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tmiddlewares.push(validate);\n\t\t}\n\t}\n\treturn middlewares;\n}\nfunction applySearchMiddleware(middlewares, search, dest) {\n\tconst applyNext = (index, currentSearch, meta) => {\n\t\tif (index >= middlewares.length) {\n\t\t\tif (!dest.search) return {};\n\t\t\tif (dest.search === true) return currentSearch;\n\t\t\tconst result = functionalUpdate(dest.search, currentSearch);\n\t\t\tif (meta) meta.explicit = result;\n\t\t\treturn result;\n\t\t}\n\t\tconst next = (newSearch, collectMeta) => {\n\t\t\tif (collectMeta) {\n\t\t\t\tconst nextMeta = meta || {};\n\t\t\t\treturn {\n\t\t\t\t\tsearch: applyNext(index + 1, newSearch, nextMeta),\n\t\t\t\t\tmeta: nextMeta\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn applyNext(index + 1, newSearch, meta);\n\t\t};\n\t\treturn middlewares[index]({\n\t\t\tsearch: currentSearch,\n\t\t\tnext,\n\t\t\tmeta\n\t\t});\n\t};\n\treturn applyNext(0, search);\n}\nfunction findGlobalNotFoundRouteId(notFoundMode, routes) {\n\tif (notFoundMode !== \"root\") {\n\t\tlet fallback;\n\t\tfor (let i = routes.length - 1; i >= 0; i--) {\n\t\t\tconst route = routes[i];\n\t\t\tif (route.options.notFoundComponent) return route.id;\n\t\t\tfallback ||= route.children && route.id;\n\t\t}\n\t\tif (fallback) return fallback;\n\t}\n\treturn rootRouteId;\n}\nfunction extractStrictParams(route, accumulatedParams) {\n\tconst parseParams = route.options.params?.parse ?? route.options.parseParams;\n\tif (parseParams) Object.assign(accumulatedParams, parseParams(accumulatedParams));\n}\n//#endregion\nexport { PathParamError, RouterCore, SearchParamError, _getUserHistoryState, defaultSerializeError, getInitialRouterState, getLocationChangeInfo, lazyFn, lifecycleEnd, runRouteLifecycle, trailingSlashOptions };\n\n//# sourceMappingURL=router.js.map","import { isNotFound } from \"./not-found.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { dehydrateSsrMatchId } from \"./ssr/ssr-match-id.js\";\nimport { getLocationChangeInfo, lifecycleEnd, runRouteLifecycle } from \"./router.js\";\n//#region src/load-client.ts\nfunction replaceRouteChunk(route, lazyFn) {\n\troute.lazyFn = lazyFn ?? route.lazyFn;\n\troute._lazy = void 0;\n}\nfunction preloadComponent(route, type) {\n\treturn route.options[type]?.preload?.();\n}\nfunction loadComponents(route, onPendingReady) {\n\tconst component = preloadComponent(route, \"component\");\n\tlet pending = preloadComponent(route, \"pendingComponent\");\n\tif (onPendingReady) {\n\t\tif (pending) pending = pending.then(onPendingReady);\n\t\telse onPendingReady();\n\t}\n\tif (component && pending) return Promise.all([component, pending]).then(() => {});\n\treturn component ?? pending;\n}\nfunction loadRouteChunk(route, componentType, onPendingReady) {\n\tconst afterLazy = () => componentType === false ? void 0 : componentType ? preloadComponent(route, componentType) : loadComponents(route, onPendingReady);\n\tconst current = route._lazy;\n\tif (current) return current === true ? afterLazy() : current.then(afterLazy);\n\tif (!route.lazyFn) return afterLazy();\n\tconst promise = route.lazyFn().then((lazyRoute) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) {\n\t\t\tconst { id: _id, ...options } = lazyRoute.options;\n\t\t\tObject.assign(route.options, options);\n\t\t\troute._lazy = true;\n\t\t}\n\t}, (error) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) route._lazy = void 0;\n\t\tthrow error;\n\t});\n\troute._lazy = promise;\n\treturn promise.then(afterLazy);\n}\n/** Return the structural lane through the first terminal render boundary. */\nfunction _getRenderedMatches(matches) {\n\tconst end = matches.findIndex((match) => match.status !== \"success\" || match._notFound) + 1;\n\treturn end && end < matches.length ? matches.slice(0, end) : matches;\n}\n/**\n* Truthy when the transaction publishing `location` leaves `routeId` out of its\n* matches, so subscribers scoped to that route can skip the publication: the\n* route unmounts when the transaction commits, and a transaction that ends\n* otherwise is superseded or redirected by a newer publication. Only valid\n* synchronously inside the publication: the transaction's matches are emptied\n* at commit and before following a redirect. Publications without a matching\n* transaction (hydration) and scopes without a route never depart.\n*/\nfunction _isRouteDeparting(router, routeId, location) {\n\tconst tx = router._tx;\n\treturn routeId && tx?.[2] === location && !tx[3].some((match) => match.routeId === routeId);\n}\n/** Return the lane whose document assets belong to the current presentation. */\nfunction _getAssetMatches(matches) {\n\tlet end = matches.length;\n\tfor (let index = 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tif (match._assetEnd !== void 0) {\n\t\t\tend = Math.min(end, Math.max(index + 1, match._assetEnd));\n\t\t\tcontinue;\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) {\n\t\t\tend = index + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn end < matches.length ? matches.slice(0, end) : matches;\n}\nconst SUCCESS = 0;\nconst ERROR = 1;\nconst NOT_FOUND = 2;\nconst REDIRECTED = 3;\nconst CANCELED_OUTCOME = [4];\nfunction isControl(result) {\n\treturn typeof result[0] === \"number\";\n}\nfunction waitFor(value, signal) {\n\tif (signal.aborted) return Promise.race([Promise.reject(signal), value]);\n\treturn new Promise((resolve, reject) => {\n\t\tconst abort = () => reject(signal);\n\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\tPromise.resolve(value).then(resolve, reject).then(() => signal.removeEventListener(\"abort\", abort));\n\t});\n}\nfunction getRoute(router, match) {\n\treturn router.routesById[match.routeId];\n}\nfunction normalize(value, rejected, routeId) {\n\tif (isRedirect(value)) return [REDIRECTED, value];\n\tif (isNotFound(value)) {\n\t\tvalue.routeId ||= routeId;\n\t\treturn [NOT_FOUND, value];\n\t}\n\tif (!rejected) return [SUCCESS, value];\n\tif (typeof value?.then === \"function\") value = new Error(\"A Promise was thrown\", { cause: value });\n\treturn [ERROR, value];\n}\nfunction normalizeError(route, cause) {\n\tlet outcome = normalize(cause, true, route.id);\n\tif (outcome[0] !== ERROR) return outcome;\n\ttry {\n\t\troute.options.onError?.(outcome[1]);\n\t} catch (onErrorCause) {\n\t\toutcome = normalize(onErrorCause, true, route.id);\n\t}\n\treturn outcome;\n}\nfunction normalizeLaneError(router, lane, route, cause, options) {\n\tif (options[0].signal.aborted) return CANCELED_OUTCOME;\n\treturn materializeRedirect(router, lane, route, normalizeError(route, cause), options);\n}\nasync function contextualize(router, lane, options, end, planSuccessfulLane, retainedEnd) {\n\tconst [location, matches] = lane;\n\tconst signal = options[0].signal;\n\tconst preload = !!options[3];\n\tfor (let index = options[6] ?? 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst route = getRoute(router, match);\n\t\tmatch.abortController = options[0];\n\t\tconst parentContext = matches[index - 1]?.context ?? router.options.context ?? {};\n\t\tconst common = {\n\t\t\tparams: match.params,\n\t\t\tlocation,\n\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t...opts,\n\t\t\t\t_fromLocation: location\n\t\t\t}),\n\t\t\tbuildLocation: router.buildLocation,\n\t\t\tcause: preload ? \"preload\" : match.cause,\n\t\t\tabortController: options[0],\n\t\t\tpreload,\n\t\t\tmatches,\n\t\t\trouteId: route.id\n\t\t};\n\t\ttry {\n\t\t\tconst routeContext = match._ctx ||= route.options.context ? route.options.context({\n\t\t\t\t...common,\n\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\tcontext: parentContext\n\t\t\t}) || {} : void 0;\n\t\t\tmatch.context = {\n\t\t\t\t...parentContext,\n\t\t\t\t...routeContext\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\tconst validationError = match.paramsError ?? match.searchError;\n\t\tif (validationError !== void 0) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, validationError, options)];\n\t\t}\n\t\tconst beforeLoad = route.options.beforeLoad;\n\t\tif (!beforeLoad) continue;\n\t\tconst previousStatus = match.status;\n\t\tif (index >= retainedEnd) {\n\t\t\tmatch.status = \"pending\";\n\t\t\toptions[7]?.();\n\t\t}\n\t\ttry {\n\t\t\tsetFetching(router, match, \"beforeLoad\", options[0]);\n\t\t\tconst value = beforeLoad({\n\t\t\t\t...common,\n\t\t\t\tsearch: match.search,\n\t\t\t\tcontext: match.context,\n\t\t\t\t...router.options.additionalContext\n\t\t\t});\n\t\t\tconst result = await (typeof value?.then === \"function\" ? waitFor(value, signal) : value);\n\t\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\t\tconst outcome = materializeRedirect(router, lane, route, normalize(result, false, route.id), options);\n\t\t\tif (outcome[0] !== SUCCESS) {\n\t\t\t\treleaseFlight(router, match);\n\t\t\t\treturn [index, outcome];\n\t\t\t}\n\t\t\tmatch.context = {\n\t\t\t\t...match.context,\n\t\t\t\t...result\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t} finally {\n\t\t\tmatch.status = previousStatus;\n\t\t\tsetFetching(router, match, false, options[0]);\n\t\t}\n\t}\n\tplanSuccessfulLane();\n}\nfunction releaseOwnedFlight(router, match, flight) {\n\tif (!flight || --flight[2]) return;\n\tif (router._flights?.get(match.id) === flight) {\n\t\tconst current = router._tx;\n\t\tif (current && !current[0].signal.aborted && !current[3].includes(match) && current[3].some((candidate) => candidate.id === match.id) && current[3].some((candidate) => candidate.isFetching === \"beforeLoad\")) return;\n\t\trouter._flights.delete(match.id);\n\t}\n\treturn flight[1];\n}\nfunction releaseFlight(router, match) {\n\tconst flight = match._flight;\n\tmatch._flight = void 0;\n\treleaseOwnedFlight(router, match, flight)?.abort();\n}\n/**\n* Not passing in a `next` ownership recipient\n* is equivalent to discarding the match resources\n*/\nfunction transferMatchResources(router, previous, next, deferSameIdFlight) {\n\tconst abort = [];\n\tfor (const match of previous) if (!next?.includes(match)) {\n\t\tconst flight = match._flight;\n\t\tmatch._flight = void 0;\n\t\tif (deferSameIdFlight && flight?.[2] === 1 && router._flights?.get(match.id) === flight && next?.some((candidate) => candidate.id === match.id)) flight[2] = 0;\n\t\telse {\n\t\t\tconst controller = releaseOwnedFlight(router, match, flight);\n\t\t\tif (controller) abort.push(controller);\n\t\t}\n\t}\n\tfor (const controller of abort) controller.abort();\n}\nfunction acquireMatchResources(matches) {\n\tfor (const match of matches) {\n\t\tconst flight = match._flight;\n\t\tif (flight) flight[2]++;\n\t}\n}\nfunction setFetching(router, match, value, owner) {\n\tmatch.isFetching = value;\n\tif (owner && router._tx?.[0] !== owner) return;\n\tconst store = router.stores.byRoute.get(match.routeId);\n\tconst presented = store?.get();\n\tif (presented?.id === match.id) store.set({\n\t\t...presented,\n\t\tisFetching: value\n\t});\n}\nfunction getLoaderContext(router, lane, match, route, controller, parentMatchPromise, preload) {\n\tconst location = lane[0];\n\treturn {\n\t\tparams: match.params,\n\t\tlocation,\n\t\tnavigate: (opts) => router.navigate({\n\t\t\t...opts,\n\t\t\t_fromLocation: location\n\t\t}),\n\t\tcause: preload ? \"preload\" : match.cause,\n\t\tabortController: controller,\n\t\tpreload,\n\t\tdeps: match.loaderDeps,\n\t\tparentMatchPromise,\n\t\tcontext: match.context,\n\t\troute,\n\t\t...router.options.additionalContext\n\t};\n}\nasync function loadResource(router, lane, match, route, loader, parentMatchPromise, options) {\n\tconst owner = options[0];\n\tconst signal = owner.signal;\n\tif (signal.aborted) return CANCELED_OUTCOME;\n\tif (!loader) return [SUCCESS, void 0];\n\tlet flight = match._flight;\n\tsetFetching(router, match, \"loader\", owner);\n\ttry {\n\t\tif (!flight) {\n\t\t\tconst controller = new AbortController();\n\t\t\tflight = [\n\t\t\t\tPromise.resolve().then(() => loader(getLoaderContext(router, lane, match, route, controller, parentMatchPromise, !!options[3]))).then((value) => normalize(value, false, route.id), (cause) => normalize(cause, true, route.id)).then((result) => {\n\t\t\t\t\tif (result[0] !== SUCCESS && router._flights?.get(match.id) === flight) {\n\t\t\t\t\t\trouter._flights.delete(match.id);\n\t\t\t\t\t\tif (!flight[2]) controller.abort();\n\t\t\t\t\t}\n\t\t\t\t\treturn result[0] === ERROR && flight[2] ? normalizeError(route, result[1]) : result;\n\t\t\t\t}),\n\t\t\t\tcontroller,\n\t\t\t\t1\n\t\t\t];\n\t\t\t(router._flights ??= /* @__PURE__ */ new Map()).set(match.id, flight);\n\t\t}\n\t\tmatch._flight = flight;\n\t\tmatch.abortController = flight[1];\n\t\treturn materializeRedirect(router, lane, route, await waitFor(flight[0], signal), options);\n\t} catch (cause) {\n\t\tif (cause !== signal || !signal.aborted) throw cause;\n\t\treleaseFlight(router, match);\n\t\treturn CANCELED_OUTCOME;\n\t} finally {\n\t\tsetFetching(router, match, false, owner);\n\t}\n}\nfunction settleInto(match, result, preload) {\n\tif (result[0] === REDIRECTED) return;\n\tmatch.status = \"success\";\n\tmatch.error = void 0;\n\tif (result[0] === SUCCESS) {\n\t\tmatch.loaderData = result[1];\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t\tmatch.preload = preload;\n\t} else match.invalid = true;\n}\nfunction cacheLoaderMatch(router, match, planned) {\n\tconst current = router._cache.get(match.id);\n\tif (current !== planned || router._committed.some((candidate) => candidate.id === match.id && candidate._flight === match._flight)) return;\n\tconst cached = {\n\t\t...match,\n\t\t_notFound: void 0,\n\t\tcontext: {}\n\t};\n\tif (cached._flight) cached._flight[2]++;\n\trouter._cache.set(match.id, cached);\n\tif (current) releaseFlight(router, current);\n}\nfunction getParentSnapshot(match, outcome) {\n\tif (outcome[0] === ERROR || outcome[0] === NOT_FOUND) return {\n\t\t...match,\n\t\tstatus: outcome[0] === ERROR ? \"error\" : \"notFound\",\n\t\terror: outcome[1],\n\t\t_flight: void 0\n\t};\n\treturn match;\n}\nfunction createLoaderTask(router, lane, index, tasks, semanticParent, options, retainedEnd) {\n\tconst match = lane[1][index];\n\tconst route = getRoute(router, match);\n\tconst preload = !!options[3];\n\tconst plannedCacheMatch = router._cache.get(match.id);\n\tlet configured;\n\tlet reload = false;\n\tlet reloadFailure;\n\ttry {\n\t\tif (match.status === \"success\") {\n\t\t\tconfigured = route.options.shouldReload;\n\t\t\tif (typeof configured === \"function\") configured = configured(getLoaderContext(router, lane, match, route, options[0], semanticParent, preload));\n\t\t\tif (options[0].signal.aborted) reloadFailure = CANCELED_OUTCOME;\n\t\t}\n\t\tif (!reloadFailure) {\n\t\t\tif (match.status !== \"success\") reload = true;\n\t\t\telse {\n\t\t\t\tconst staleAge = preload || match.preload ? route.options.preloadStaleTime ?? router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? router.options.defaultStaleTime ?? 0;\n\t\t\t\treload = !!(match.invalid || configured || configured === void 0 && Date.now() - match.updatedAt >= staleAge && (options[5] || match.cause === \"enter\" || options[2].some((candidate) => candidate.routeId === match.routeId && candidate.id !== match.id)));\n\t\t\t}\n\t\t}\n\t} catch (cause) {\n\t\tmatch.invalid = true;\n\t\treleaseFlight(router, match);\n\t\treloadFailure = normalizeLaneError(router, lane, route, cause, options);\n\t}\n\tconst routeLoader = route.options.loader;\n\tconst isLoaderFn = typeof routeLoader === \"function\";\n\tconst loader = isLoaderFn ? routeLoader : routeLoader?.handler;\n\tconst preloadable = !preload || route.options.preload !== false;\n\tlet donor = preloadable && routeLoader && !(process.env.NODE_ENV !== \"production\" && router._tx?.[6]) ? router._flights?.get(match.id) : void 0;\n\tif (donor === match._flight || reloadFailure) donor = void 0;\n\telse if (donor && !reload && !preload && configured === void 0) reload = true;\n\telse if (!reload) donor = void 0;\n\tconst background = !!(routeLoader && reload && match.status === \"success\" && !preload && !options[4] && ((isLoaderFn ? void 0 : routeLoader.staleReloadMode) ?? router.options.defaultStaleReloadMode) !== \"blocking\");\n\tconst loaded = reload && preloadable;\n\tconst blocking = loaded && !background && (match.status !== \"success\" || !!routeLoader);\n\tconst onReady = index >= retainedEnd ? options[7] : void 0;\n\tconst onLazyReady = route.lazyFn && route._lazy !== true ? onReady : void 0;\n\tif (loaded && !routeLoader) {\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t}\n\tif (donor) donor[2]++;\n\tif (blocking) {\n\t\tconst acceptedFlight = match._flight;\n\t\tmatch._flight = donor;\n\t\treleaseOwnedFlight(router, match, acceptedFlight)?.abort();\n\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\tonReady?.();\n\t}\n\tif (!loaded) match.isFetching = false;\n\tconst outcome = !reloadFailure && blocking ? loadResource(router, lane, match, route, loader, semanticParent, options).then((result) => {\n\t\tsettleInto(match, result, preload);\n\t\tif (result[0] === SUCCESS) {\n\t\t\tif (routeLoader && !options[0].signal.aborted) cacheLoaderMatch(router, match, plannedCacheMatch);\n\t\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\t}\n\t\treturn result;\n\t}) : Promise.resolve(reloadFailure ?? [SUCCESS, match.loaderData]);\n\tconst chunkFailure = (async () => {\n\t\ttry {\n\t\t\tconst chunk = loadRouteChunk(route, void 0, onLazyReady);\n\t\t\tif (chunk) await waitFor(chunk, options[0].signal);\n\t\t} catch (cause) {\n\t\t\tif (!lane[1].some((candidate, candidateIndex) => candidateIndex <= index && (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound))) return [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tconst result = await outcome;\n\t\tif (blocking && result[0] === SUCCESS && match.status === \"pending\" && !options[0].signal.aborted) {\n\t\t\tmatch.status = \"success\";\n\t\t\tonReady?.();\n\t\t}\n\t})();\n\ttasks.push([\n\t\tindex,\n\t\toutcome,\n\t\tchunkFailure\n\t]);\n\tif (!background) return outcome.then((result) => getParentSnapshot(match, result));\n\tconst candidate = {\n\t\t...match,\n\t\tstatus: \"pending\",\n\t\tpreload: false,\n\t\t_flight: donor\n\t};\n\tmatch.invalid = false;\n\tmatch.isFetching = \"loader\";\n\tconst backgroundOutcome = loadResource(router, lane, candidate, route, loader, semanticParent, options).then((result) => {\n\t\tmatch.isFetching = false;\n\t\tsettleInto(candidate, result, false);\n\t\treturn result;\n\t});\n\t(lane[2] ??= []).push([\n\t\tindex,\n\t\tbackgroundOutcome,\n\t\tchunkFailure,\n\t\tcandidate\n\t]);\n\treturn backgroundOutcome.then((result) => getParentSnapshot(candidate, result));\n}\nasync function getNotFoundBoundary(router, matches, indexed, signal, fallback = 0) {\n\tconst cause = indexed?.[1][1];\n\tlet index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : indexed?.[0] ?? matches.length - 1;\n\tif (index < 0) index = 0;\n\tfor (let i = index; i >= 0; i--) {\n\t\tconst route = getRoute(router, matches[i]);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route, false);\n\t\t\tif (loading) await waitFor(loading, signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) throw cause;\n\t\t}\n\t\tif (route.options.notFoundComponent) return i;\n\t}\n\treturn cause?.routeId ? index : fallback;\n}\nfunction discardBackground(router, lane) {\n\tif (lane[2]) {\n\t\ttransferMatchResources(router, lane[2].map((task) => task[3]));\n\t\tlane[2] = void 0;\n\t}\n}\nasync function settleTasks(tasks, serialFailure, redirectTasks, gate) {\n\tlet loaderFailure;\n\ttry {\n\t\tawait Promise.all(tasks.map((task) => task[1].then(async (outcome) => {\n\t\t\tconst taskIndex = task[0];\n\t\t\tif (gate && taskIndex >= await gate) return;\n\t\t\tif (outcome[0] >= REDIRECTED) throw [taskIndex, outcome];\n\t\t\tif (!loaderFailure && outcome[0] !== SUCCESS) {\n\t\t\t\tloaderFailure = [taskIndex, outcome];\n\t\t\t\tawait Promise.all((redirectTasks ?? []).map((nextTask) => {\n\t\t\t\t\tif (nextTask[0] <= taskIndex) return;\n\t\t\t\t\treturn nextTask[1].then((nextOutcome) => {\n\t\t\t\t\t\tif (nextOutcome[0] === REDIRECTED) throw [nextTask[0], nextOutcome];\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t}\n\t\t})));\n\t} catch (cause) {\n\t\treturn cause;\n\t}\n\treturn serialFailure ?? loaderFailure;\n}\nfunction materializeRedirect(router, lane, route, outcome, options, failed) {\n\twhile (outcome[0] === REDIRECTED) {\n\t\tconst redirect = outcome[1];\n\t\tconst redirectOptions = redirect.options;\n\t\ttry {\n\t\t\tif (redirectOptions.href || redirect.headers.has(\"Location\")) {\n\t\t\t\trouter.resolveRedirect(redirect);\n\t\t\t\tif (redirectOptions.reloadDocument) return outcome;\n\t\t\t}\n\t\t\tif (redirectOptions.reloadDocument ? options[3] : options[1] >= 20) return outcome;\n\t\t\tconst location = router.buildLocation({\n\t\t\t\t...redirectOptions,\n\t\t\t\t_fromLocation: lane[0],\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\tif (publicLocation.external) {\n\t\t\t\tconst resolved = redirect.clone();\n\t\t\t\tresolved.options = { ...redirectOptions };\n\t\t\t\tresolved.headers.set(\"Location\", publicLocation.publicHref);\n\t\t\t\trouter.resolveRedirect(resolved);\n\t\t\t\treturn options[3] ? [REDIRECTED, resolved] : [\n\t\t\t\t\tREDIRECTED,\n\t\t\t\t\tresolved,\n\t\t\t\t\tpublicLocation\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tREDIRECTED,\n\t\t\t\tredirect,\n\t\t\t\tlocation\n\t\t\t];\n\t\t} catch (cause) {\n\t\t\toutcome = failed ? [ERROR, cause] : normalizeError(route, cause);\n\t\t\tfailed = true;\n\t\t}\n\t}\n\treturn outcome;\n}\nasync function reduceLane(router, lane, tasks, controller, settlement, onReady) {\n\tconst matches = lane[1];\n\tlet failure = await settlement;\n\tlet redirectLimitExceeded = false;\n\tconst plannedBoundary = matches.findIndex((match) => match._notFound);\n\tconst boundaryOf = (found) => found[1][0] === NOT_FOUND ? getNotFoundBoundary(router, matches, found, controller.signal) : found[0];\n\tlet readinessEnd = plannedBoundary < 0 ? matches.length : plannedBoundary;\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) readinessEnd = 0;\n\telse if (failure) {\n\t\treadinessEnd = failure[2] ??= await boundaryOf(failure);\n\t\tfor (const task of tasks) {\n\t\t\tif (task[0] >= readinessEnd) break;\n\t\t\tconst outcome = await task[1];\n\t\t\tif (outcome[0] !== SUCCESS && outcome[0] < REDIRECTED && !(\"loaderData\" in matches[task[0]])) {\n\t\t\t\tfailure = [task[0], outcome];\n\t\t\t\treadinessEnd = failure[2] = await boundaryOf(failure);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const task of tasks) {\n\t\tif (task[0] >= readinessEnd) break;\n\t\tconst chunkFailure = await task[2];\n\t\tif (!chunkFailure) continue;\n\t\tfailure = chunkFailure;\n\t\tbreak;\n\t}\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) {\n\t\tconst outcome = failure[1];\n\t\tif (outcome[0] !== REDIRECTED || outcome[1].options.reloadDocument || outcome[2]) {\n\t\t\tdiscardBackground(router, lane);\n\t\t\treturn outcome;\n\t\t}\n\t\tredirectLimitExceeded = true;\n\t\tfailure = [0, [ERROR, /* @__PURE__ */ new Error(\"Too many redirects\")]];\n\t}\n\tconst boundary = failure ? failure[2] ?? await boundaryOf(failure) : plannedBoundary;\n\tif (boundary >= 0) {\n\t\tconst outcome = failure?.[1];\n\t\tconst kind = outcome?.[0];\n\t\tconst match = matches[boundary];\n\t\tconst cause = outcome?.[1];\n\t\tconst install = () => {\n\t\t\tif (outcome) {\n\t\t\t\tmatch._notFound = void 0;\n\t\t\t\tif (kind === ERROR) match.status = \"error\";\n\t\t\t\telse {\n\t\t\t\t\tcause.routeId = match.routeId;\n\t\t\t\t\tif (match.routeId === router.routeTree.id) {\n\t\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\t\tmatch._notFound = true;\n\t\t\t\t\t} else match.status = \"notFound\";\n\t\t\t\t}\n\t\t\t\tmatch.error = cause;\n\t\t\t\tmatch.isFetching = false;\n\t\t\t}\n\t\t};\n\t\tinstall();\n\t\tif (!outcome) onReady?.();\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tawait waitFor(outcome ? Promise.resolve().then(() => loadRouteChunk(route, kind === ERROR ? \"errorComponent\" : \"notFoundComponent\")) : Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]), controller.signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === controller.signal && controller.signal.aborted) {\n\t\t\t\tdiscardBackground(router, lane);\n\t\t\t\treturn CANCELED_OUTCOME;\n\t\t\t}\n\t\t}\n\t\tif (!outcome) match.status = \"success\";\n\t\telse if (redirectLimitExceeded) {\n\t\t\tcontroller.abort();\n\t\t\tawait Promise.all([\n\t\t\t\t...tasks.map((task) => task[1]),\n\t\t\t\t...tasks.map((task) => task[2]),\n\t\t\t\t...(lane[2] ?? []).map((task) => task[1])\n\t\t\t]);\n\t\t\tdiscardBackground(router, lane);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tinstall();\n\t\t}\n\t}\n\treturn lane;\n}\nasync function projectLane(router, lane, signal, start = 0, end = lane[1].length) {\n\tconst matches = lane[1];\n\tfor (let index = start; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst routeOptions = getRoute(router, match).options;\n\t\tif (routeOptions.head || routeOptions.scripts) try {\n\t\t\tconst context = {\n\t\t\t\tssr: router.options.ssr,\n\t\t\t\tmatches,\n\t\t\t\tmatch,\n\t\t\t\tparams: match.params,\n\t\t\t\tloaderData: match.loaderData\n\t\t\t};\n\t\t\tconst [head, scripts] = await waitFor(Promise.all([routeOptions.head?.(context), routeOptions.scripts?.(context)]), signal);\n\t\t\tmatch.meta = head?.meta;\n\t\t\tmatch.links = head?.links;\n\t\t\tmatch.headScripts = head?.scripts;\n\t\t\tmatch.styles = head?.styles;\n\t\t\tmatch.scripts = scripts;\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) break;\n\t\t\tconsole.error(cause);\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) break;\n\t}\n\treturn lane;\n}\nasync function executeClientLane(router, location, matches, options) {\n\tconst matched = [location, matches];\n\tconst signal = options[0].signal;\n\tlet reduced;\n\ttry {\n\t\tconst presented = router.stores.matches.get();\n\t\tlet plannedBoundary = matches.findIndex((match) => match._notFound);\n\t\tif (router.options.notFoundMode !== \"root\" && plannedBoundary >= 0) {\n\t\t\tconst boundary = await getNotFoundBoundary(router, matches, void 0, signal, plannedBoundary);\n\t\t\tmatches[plannedBoundary]._notFound = void 0;\n\t\t\tmatches[boundary]._notFound = true;\n\t\t\tplannedBoundary = boundary;\n\t\t}\n\t\tlet end = plannedBoundary < 0 ? matches.length : plannedBoundary + 1;\n\t\tlet retainedEnd = 0;\n\t\twhile (retainedEnd < end && retainedEnd !== plannedBoundary) {\n\t\t\tconst match = matches[retainedEnd];\n\t\t\tconst committed = options[2][retainedEnd];\n\t\t\tconst visible = presented[retainedEnd];\n\t\t\tif (committed?.id !== match.id || committed.status !== \"success\" || match.preload || visible?.id !== match.id || visible.status !== \"success\") break;\n\t\t\tretainedEnd++;\n\t\t\tif (committed._notFound || visible._notFound) break;\n\t\t}\n\t\tconst tasks = [];\n\t\tconst start = options[6] ?? 0;\n\t\tlet semanticParent = start ? Promise.resolve(matches[start - 1]) : void 0;\n\t\tconst planSuccessfulLane = () => {\n\t\t\tfor (let index = start; index < end; index++) {\n\t\t\t\tif (signal.aborted) break;\n\t\t\t\tsemanticParent = createLoaderTask(router, matched, index, tasks, semanticParent, options, retainedEnd);\n\t\t\t}\n\t\t};\n\t\tconst failure = await contextualize(router, matched, options, end, planSuccessfulLane, retainedEnd);\n\t\tif (failure) {\n\t\t\toptions[4] = true;\n\t\t\tend = failure[0];\n\t\t\tif (failure[1][0] === NOT_FOUND) {\n\t\t\t\tconst boundary = await getNotFoundBoundary(router, matches, failure, signal);\n\t\t\t\tfailure[2] = boundary;\n\t\t\t\tend = Math.min(end, boundary + 1);\n\t\t\t} else if (failure[1][0] >= REDIRECTED) end = 0;\n\t\t\tplanSuccessfulLane();\n\t\t}\n\t\tif (!signal.aborted && !options[3]) {\n\t\t\tconst abort = [];\n\t\t\tfor (const [id, flight] of router._flights ?? []) if (!flight[2]) {\n\t\t\t\trouter._flights.delete(id);\n\t\t\t\tabort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t}\n\t\tconst reduction = reduceLane(router, matched, tasks, options[0], settleTasks(tasks, failure, matched[2]), options[7]);\n\t\tif (matched[2]?.length) matched[3] = settleTasks(matched[2], void 0, void 0, reduction.then((foreground) => isControl(foreground) ? 0 : _getRenderedMatches(matches).length, () => 0));\n\t\treduced = await reduction;\n\t} catch (cause) {\n\t\tdiscardBackground(router, matched);\n\t\tif (cause === signal && signal.aborted) return CANCELED_OUTCOME;\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) return reduced;\n\treturn projectLane(router, reduced, signal, options[6] === matches.length ? options[6] : 0);\n}\n/**\n* Waits for `pendingMs`, then presents the complete lane. Rendering applies the\n* selected boundary cutoff while retaining every match's structural state.\n* A replacement load for the same match keeps the timer; choosing a different\n* match resets it. `pendingMinMs` starts after the fallback renders.\n*/\nfunction offerPending(router, tx) {\n\tif (router._tx !== tx) return;\n\tconst matches = tx[3];\n\tconst presented = router.stores.matches.get();\n\tlet session = router._pending;\n\tfor (let index = 0; index < matches.length; index++) {\n\t\tconst match = matches[index];\n\t\tconst success = match.status === \"success\" && !match._notFound;\n\t\tconst presentedPending = presented[index]?.id === match.id && presented[index]?.status === \"pending\";\n\t\tif (success && !presentedPending) continue;\n\t\tconst route = getRoute(router, match);\n\t\tconst delay = success || match.invalid ? 0 : route.options.pendingMs ?? router.options.defaultPendingMs;\n\t\tconst component = route.options.pendingComponent ?? router.options.defaultPendingComponent;\n\t\tif (!component || typeof delay !== \"number\" || delay === Infinity) {\n\t\t\tif (session) {\n\t\t\t\tsession[0] = tx;\n\t\t\t\tsession[2] = 0;\n\t\t\t\tsession[4] = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst min = route.options.pendingMinMs ?? router.options.defaultPendingMinMs ?? 0;\n\t\tlet tookOver = false;\n\t\tif (session?.[1] === match.id) {\n\t\t\ttookOver = session[0] !== tx;\n\t\t\tsession[0] = tx;\n\t\t} else {\n\t\t\tclearTimeout(session?.[3]);\n\t\t\trouter._pending = session = void 0;\n\t\t}\n\t\tif (!session) router._pending = session = [\n\t\t\ttx,\n\t\t\tmatch.id,\n\t\t\tpresentedPending ? Date.now() + min : tx[4] + delay,\n\t\t\tvoid 0,\n\t\t\tpresentedPending || void 0,\n\t\t\tcomponent\n\t\t];\n\t\tif (session[4] && !tookOver && session[5] === component) return;\n\t\tsession[5] = component;\n\t\tif (!session[4]) {\n\t\t\tclearTimeout(session[3]);\n\t\t\tconst remaining = session[2] - Date.now();\n\t\t\tif (remaining > 0) {\n\t\t\t\tsession[3] = setTimeout(() => offerPending(router, tx), remaining);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsession[2] = 0;\n\t\t}\n\t\tconst offered = matches.map((match) => ({\n\t\t\t...match,\n\t\t\t_flight: void 0\n\t\t}));\n\t\toffered[index].status = \"pending\";\n\t\tconst ack = session[4] = router.startTransition(() => router.stores.setMatches(offered), offered).then((rendered) => {\n\t\t\tif (rendered && router._pending === session && session[4] === ack && !session[2]) session[2] = Date.now() + min;\n\t\t\treturn rendered;\n\t\t});\n\t\treturn;\n\t}\n}\n/**\n* Cancels pending UI timing unless the current successor can take over the\n* same boundary that remains painted.\n*/\nfunction finishPending(router, tx) {\n\tconst session = router._pending;\n\tif (router._tx === tx || !router._tx?.[3].some((match) => match.id === session?.[1])) {\n\t\tclearTimeout(session?.[3]);\n\t\trouter._pending = void 0;\n\t}\n}\nasync function awaitPendingMinimum(router, tx) {\n\tconst session = router._pending;\n\tif (!session) return;\n\tclearTimeout(session[3]);\n\tconst remaining = session[2] - Date.now();\n\tif (!session[4] || remaining <= 0 || !_getRenderedMatches(tx[3]).some((match) => match.id === session[1])) return;\n\tlet timer;\n\ttry {\n\t\tawait waitFor(new Promise((resolve) => {\n\t\t\ttimer = setTimeout(resolve, remaining);\n\t\t}), tx[0].signal);\n\t} catch {}\n\tclearTimeout(timer);\n}\nfunction publishMatches(router, matches) {\n\trouter._committed = matches;\n\trouter.stores.setMatches(matches);\n}\nfunction commitMatches(router, tx, matches, resolvedPrefix) {\n\tconst previous = router._committed;\n\tconst previousEnd = router._lifecycleEnd;\n\tconst previousCached = router._cache;\n\tfor (const match of matches) {\n\t\tmatch.preload = false;\n\t\tif (resolvedPrefix) match._assetEnd = void 0;\n\t}\n\tconst cut = _getRenderedMatches(matches).length;\n\tconst cached = /* @__PURE__ */ new Map();\n\tif (process.env.NODE_ENV === \"production\" || !tx[6]) {\n\t\tconst now = Date.now();\n\t\tconst superseded = /* @__PURE__ */ new Set();\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tif (index < cut || match.status === \"success\") superseded.add(match.id);\n\t\t}\n\t\tfor (const match of [...previous, ...previousCached.values()]) {\n\t\t\tif (match.status !== \"success\" || superseded.has(match.id)) continue;\n\t\t\tconst route = getRoute(router, match);\n\t\t\tif (!route.options.loader || now - match.updatedAt >= (match.preload ? route.options.preloadGcTime ?? router.options.defaultPreloadGcTime ?? 3e5 : route.options.gcTime ?? router.options.defaultGcTime ?? 3e5)) continue;\n\t\t\tcached.set(match.id, previousCached.get(match.id) === match ? match : {\n\t\t\t\t...match,\n\t\t\t\t_flight: void 0,\n\t\t\t\tisFetching: false,\n\t\t\t\tcontext: {}\n\t\t\t});\n\t\t}\n\t}\n\ttx[3] = [];\n\trouter._cache = cached;\n\tconst nextEnd = router._lifecycleEnd = lifecycleEnd(matches);\n\tpublishMatches(router, matches);\n\ttransferMatchResources(router, [...previousCached.values(), ...previous].filter((match) => match._flight && cached.get(match.id) !== match), matches);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst handoff = tx[6]?.[0];\n\t\tif (handoff && router._handoff === handoff) handoff[1]();\n\t}\n\trunRouteLifecycle(router, previous, matches, previousEnd, nextEnd, tx);\n}\n/**\n* Resolve once the router has settled on a transaction other than `owner`.\n* Each transaction's completion follows its current successor, so all waiters\n* share the same chain instead of polling every successor independently.\n*/\nasync function awaitCurrent(router, owner) {\n\tlet current = router._tx;\n\twhile (current && current !== owner) {\n\t\towner = current;\n\t\tawait current[5];\n\t\tcurrent = router._tx;\n\t}\n}\nfunction followRedirect(router, tx, outcome) {\n\tconst options = outcome[1].options;\n\tconst location = outcome[2];\n\tif (!location) return router.navigate({\n\t\t...options,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tif (options.reloadDocument) return router.navigate({\n\t\thref: (location.maskedLocation ?? location).publicHref,\n\t\treloadDocument: true,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tlocation._redirects = tx[1] + 1;\n\trouter._pendingLocation = location;\n\tconst committed = router.commitLocation({\n\t\t...location,\n\t\tviewTransition: options.viewTransition,\n\t\treplace: true,\n\t\tresetScroll: options.resetScroll,\n\t\thashScrollIntoView: options.hashScrollIntoView,\n\t\tignoreBlocker: true\n\t});\n\tqueueMicrotask(() => {\n\t\tif (router._pendingLocation === location) router._pendingLocation = void 0;\n\t});\n\treturn committed;\n}\nasync function runBackground(router, tx, base, tasks, settlement) {\n\tconst next = base.map((match) => ({ ...match }));\n\tacquireMatchResources(next);\n\tfor (const task of tasks) {\n\t\treleaseFlight(router, next[task[0]]);\n\t\tnext[task[0]] = task[3];\n\t}\n\tconst lane = [tx[2], next];\n\tlet reduced;\n\ttry {\n\t\treduced = await reduceLane(router, lane, tasks, tx[0], settlement);\n\t} catch (cause) {\n\t\ttransferMatchResources(router, next);\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) {\n\t\ttransferMatchResources(router, next);\n\t\tif (reduced[0] === REDIRECTED && router._tx === tx && router._committed === base) await followRedirect(router, tx, reduced);\n\t\treturn;\n\t}\n\tawait projectLane(router, reduced, tx[0].signal);\n\tif (router._tx !== tx || router._committed !== base) {\n\t\ttransferMatchResources(router, next);\n\t\treturn;\n\t}\n\tfor (const match of next) {\n\t\tconst cached = router._cache.get(match.id);\n\t\tif (cached?._flight && cached._flight === match._flight) {\n\t\t\trouter._cache.delete(match.id);\n\t\t\treleaseFlight(router, cached);\n\t\t}\n\t}\n\tpublishMatches(router, next);\n\ttransferMatchResources(router, base, next);\n}\nasync function runClientTransaction(router, tx, forceStaleReload, onReady, sync, resolvedPrefix) {\n\tconst result = await executeClientLane(router, tx[2], tx[3], [\n\t\ttx[0],\n\t\ttx[1],\n\t\trouter._committed,\n\t\tvoid 0,\n\t\tsync,\n\t\tforceStaleReload,\n\t\tresolvedPrefix,\n\t\tonReady\n\t]);\n\tif (isControl(result)) {\n\t\tconst follow = result[0] === REDIRECTED && router._tx === tx;\n\t\tif (!follow || result[1].options.reloadDocument) finishPending(router, tx);\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tif (!follow) return;\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) router._refreshNextLoad = true;\n\t\tawait followRedirect(router, tx, result);\n\t\treturn;\n\t}\n\tconst matches = result[1];\n\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\tif (router._tx !== tx) {\n\t\tfinishPending(router, tx);\n\t\ttransferMatchResources(router, matches);\n\t\tdiscardBackground(router, result);\n\t\treturn;\n\t}\n\tconst toLocation = tx[2];\n\tconst changeInfo = getLocationChangeInfo(toLocation, router.stores.resolvedLocation.get());\n\tconst background = result[2];\n\tawait router.startViewTransition(async () => {\n\t\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tconst commit = () => {\n\t\t\tfinishPending(router, tx);\n\t\t\tcommitMatches(router, tx, matches, resolvedPrefix);\n\t\t\tif (router._tx !== tx) return;\n\t\t\trouter.emit({\n\t\t\t\ttype: \"onLoad\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onBeforeRouteMount\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t};\n\t\tconst rendered = await router.startTransition(commit, matches);\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) tx[6] = void 0;\n\t\tif (router._tx !== tx) {\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tif (background?.length) runBackground(router, tx, matches, background, result[3]).catch(console.error);\n\t\trouter.batch(() => {\n\t\t\trouter.stores.resolvedLocation.set(toLocation);\n\t\t\trouter.stores.status.set(\"idle\");\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onResolved\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (rendered && router._tx === tx) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t});\n\t\tif (router._tx !== tx) return;\n\t\trouter._commitPromise?.resolve();\n\t\trouter._commitPromise = void 0;\n\t});\n}\nasync function loadClientRoute(router, opts) {\n\tlet rematerialize = false;\n\tif (process.env.NODE_ENV !== \"production\") rematerialize = !!router._refreshNextLoad || !!router._tx?.[6];\n\tconst previousOwner = router._tx;\n\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\tconst previousLocation = resolvedLocation ?? router.stores.location.get();\n\tconst location = router.latestLocation;\n\tconst pendingLocation = router._pendingLocation;\n\tconst redirects = pendingLocation?.href === location.href ? pendingLocation._redirects ?? 0 : 0;\n\tconst handoff = router._handoff;\n\tconst hydrationController = rematerialize ? void 0 : handoff?.[0]();\n\tconst preflight = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = preflight;\n\tif (!rematerialize && !hydrationController) handoff?.[1]();\n\tpreviousPreflight?.abort();\n\tif (!preflight.signal.aborted) {\n\t\tconst changeInfo = getLocationChangeInfo(location, resolvedLocation);\n\t\trouter.emit({\n\t\t\ttype: \"onBeforeNavigate\",\n\t\t\t...changeInfo\n\t\t});\n\t\tif (!preflight.signal.aborted) router.emit({\n\t\t\ttype: \"onBeforeLoad\",\n\t\t\t...changeInfo\n\t\t});\n\t}\n\tif (preflight.signal.aborted) {\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\tconst sameHref = previousLocation.href === location.href;\n\tlet controller = preflight;\n\tconst matches = process.env.NODE_ENV !== \"production\" && rematerialize ? router.matchRoutes(location, {\n\t\t_controller: preflight,\n\t\t_rematerialize: true\n\t}) : router.matchRoutes(location, { _controller: preflight });\n\tacquireMatchResources(matches);\n\tconst resolvedPrefix = hydrationController ? handoff[1](matches) : void 0;\n\tif (resolvedPrefix) controller = hydrationController;\n\telse hydrationController?.abort();\n\tif (preflight.signal.aborted) {\n\t\ttransferMatchResources(router, matches);\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\trouter._preflight = void 0;\n\tlet settle;\n\tconst run = () => runClientTransaction(router, tx, sameHref, () => offerPending(router, tx), opts?.sync, resolvedPrefix);\n\tconst done = opts?.sync ? new Promise((resolve) => settle = resolve) : Promise.resolve().then(run);\n\tconst tx = [\n\t\tcontroller,\n\t\tredirects,\n\t\tlocation,\n\t\tmatches,\n\t\tDate.now(),\n\t\tdone.then(() => awaitCurrent(router, tx))\n\t];\n\tif (process.env.NODE_ENV !== \"production\" && rematerialize) {\n\t\ttx[6] = [handoff];\n\t\trouter._refreshNextLoad = void 0;\n\t}\n\trouter._tx = tx;\n\tif (previousOwner) {\n\t\tfor (const match of router.stores.matches.get()) {\n\t\t\tif (router._tx !== tx) break;\n\t\t\tif (match.isFetching) setFetching(router, match, false);\n\t\t}\n\t\tpreviousOwner[0].abort();\n\t\ttransferMatchResources(router, previousOwner[3], tx[3], true);\n\t}\n\tif (router._tx !== tx) {\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tsettle?.();\n\t\tawait awaitCurrent(router, tx);\n\t\treturn;\n\t}\n\trouter.batch(() => {\n\t\trouter.stores.status.set(\"pending\");\n\t\trouter.stores.location.set(location);\n\t});\n\tif (resolvedPrefix || !router._committed.length && matches[0]?.status !== \"success\" && !matches.some((match) => match._notFound)) offerPending(router, tx);\n\tsettle?.(run());\n\tawait tx[5];\n}\nasync function refreshClientRoute(router) {\n\tconst pending = router._tx;\n\tif (pending && !pending[6] && router.stores.status.get() === \"pending\") {\n\t\tawait pending[5];\n\t\tif (router._tx !== pending) await awaitCurrent(router, pending);\n\t}\n\trouter._flights?.clear();\n\trouter.clearCache();\n\trouter._refreshNextLoad = true;\n\tawait loadClientRoute(router, { sync: true });\n}\nasync function preloadClientRoute(router, opts) {\n\tif (process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\tlet location = router.buildLocation(opts);\n\tfor (let redirects = 0;; redirects++) {\n\t\tconst base = router._committed;\n\t\tconst controller = new AbortController();\n\t\tlet matches;\n\t\tlet active;\n\t\tlet result;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tmatches = router.matchRoutes(location, { _controller: controller });\n\t\t\t\tacquireMatchResources(matches);\n\t\t\t\tactive = (router._preloads ??= /* @__PURE__ */ new Map()).set(controller, matches);\n\t\t\t\tresult = await executeClientLane(router, location, matches, [\n\t\t\t\t\tcontroller,\n\t\t\t\t\tredirects,\n\t\t\t\t\tbase,\n\t\t\t\t\ttrue\n\t\t\t\t]);\n\t\t\t} finally {\n\t\t\t\tif (active) {\n\t\t\t\t\tactive = active.delete(controller);\n\t\t\t\t\ttransferMatchResources(router, matches);\n\t\t\t\t}\n\t\t\t\tcontroller.abort();\n\t\t\t}\n\t\t\tif (!isControl(result)) return result[1];\n\t\t\tif (!active || result.length < 3 || process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\t\t\tlocation = result[2];\n\t\t} catch (cause) {\n\t\t\tif (!isNotFound(cause)) console.error(cause);\n\t\t\treturn;\n\t\t}\n\t}\n}\nasync function hydrate(router) {\n\tif (process.env.NODE_ENV !== \"production\" && !window.$_TSR) throw new Error(\"Invariant failed: Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!\");\n\tconst tsr = window.$_TSR;\n\tconst adapters = router.options.serializationAdapters;\n\tif (adapters?.length) {\n\t\ttsr.t = new Map(adapters.map((adapter) => [adapter.key, adapter.fromSerializable]));\n\t\ttsr.buffer.forEach((script) => script());\n\t}\n\ttsr.initialized = true;\n\tconst dehydratedRouter = tsr.router;\n\tif (process.env.NODE_ENV !== \"production\" && !dehydratedRouter) throw new Error(\"Invariant failed: Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!\");\n\trouter.ssr = { manifest: dehydratedRouter.manifest };\n\trouter.options.ssr = { nonce: document.querySelector(\"meta[property=\\\"csp-nonce\\\"]\")?.content };\n\tconst dehydratedMatches = dehydratedRouter.matches;\n\tconst controller = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = controller;\n\tpreviousPreflight?.abort();\n\tconst isCurrent = () => router._preflight === controller;\n\tlet location;\n\tlet candidates;\n\tlet handoffHistoryHref;\n\tlet handoffHistoryState;\n\ttry {\n\t\tawait waitFor(router.options.hydrate?.(dehydratedRouter.dehydratedData), controller.signal);\n\t\tif (!isCurrent()) return;\n\t\tconst historyLocation = router.history.location;\n\t\thandoffHistoryHref = historyLocation.href;\n\t\thandoffHistoryState = historyLocation.state;\n\t\trouter.updateLatestLocation();\n\t\tlocation = router.latestLocation;\n\t\trouter.stores.location.set(location);\n\t\tcandidates = router.matchRoutes(location, { _controller: controller });\n\t} catch (cause) {\n\t\tif (isCurrent()) router._preflight = void 0;\n\t\tcontroller.abort(cause);\n\t\tif (cause !== controller.signal) throw cause;\n\t}\n\tif (!isCurrent()) return;\n\tconst committed = [];\n\tlet pendingBoundary;\n\tlet verifiedAssetEnd = 0;\n\tconst retryFrom = (index) => {\n\t\tverifiedAssetEnd = Math.min(verifiedAssetEnd, index + 1);\n\t\tconst removed = committed.splice(index);\n\t\tfor (const match of removed) if (getRoute(router, match).options.loader && (match.status === \"success\" || !match.invalid && \"loaderData\" in match)) cacheLoaderMatch(router, {\n\t\t\t...match,\n\t\t\tstatus: \"success\",\n\t\t\terror: void 0,\n\t\t\tpreload: true\n\t\t}, router._cache.get(match.id));\n\t\ttransferMatchResources(router, removed);\n\t};\n\tconst shared = dehydratedMatches.length > candidates.length ? candidates.findIndex((match) => match._notFound) + 1 : dehydratedMatches.length;\n\tlet isTerminal = false;\n\tfor (let index = 0; index < shared; index++) {\n\t\tconst candidate = candidates[index];\n\t\tconst dehydrated = dehydratedMatches[index];\n\t\tif (dehydrated.i !== dehydrateSsrMatchId(candidate.id)) {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tverifiedAssetEnd = index + 1;\n\t\tconst route = getRoute(router, candidate);\n\t\tif (\"l\" in dehydrated || dehydrated.s === \"success\" && dehydrated.e === void 0 && route.options.loader) candidate.loaderData = dehydrated.l;\n\t\tcandidate.status = dehydrated.s;\n\t\tcandidate.ssr = dehydrated.ssr;\n\t\troute.options.ssr = candidate.ssr;\n\t\tcandidate.updatedAt = dehydrated.u;\n\t\tcandidate.error = dehydrated.e;\n\t\tcandidate._notFound ||= dehydrated.g;\n\t\tif (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound) {\n\t\t\tisTerminal = true;\n\t\t\tcommitted.push(candidate);\n\t\t\tif (candidate.ssr === false || candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tif (candidate.status === \"pending\") {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tcommitted.push(candidate);\n\t\tif (candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t}\n\tif (!isTerminal && committed.length === shared && shared < candidates.length) pendingBoundary = shared;\n\tconst chunks = committed.map(async (match) => {\n\t\ttry {\n\t\t\tconst route = getRoute(router, match);\n\t\t\tawait (match._notFound ? Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]) : loadRouteChunk(route, match.status === \"error\" ? \"errorComponent\" : match.status === \"notFound\" ? \"notFoundComponent\" : void 0));\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t});\n\tlet chunkFailure = 0;\n\ttry {\n\t\twhile (chunkFailure < chunks.length && await waitFor(chunks[chunkFailure], controller.signal)) chunkFailure++;\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isCurrent()) return;\n\tif (chunkFailure < committed.length) retryFrom(chunkFailure);\n\tconst contextEnd = Math.max(pendingBoundary === committed.length ? committed.length + 1 : committed.length, chunkFailure < chunks.length ? chunkFailure : verifiedAssetEnd);\n\tfor (let index = 0; index < contextEnd; index++) {\n\t\tconst match = candidates[index];\n\t\tconst route = getRoute(router, match);\n\t\tconst parentContext = candidates[index - 1]?.context ?? router.options.context ?? {};\n\t\tlet routeContext;\n\t\tif (route.options.context) {\n\t\t\ttry {\n\t\t\t\trouteContext = match._ctx = route.options.context({\n\t\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\t\tparams: match.params,\n\t\t\t\t\tcontext: parentContext,\n\t\t\t\t\tlocation,\n\t\t\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t\t\t...opts,\n\t\t\t\t\t\t_fromLocation: location\n\t\t\t\t\t}),\n\t\t\t\t\tbuildLocation: router.buildLocation,\n\t\t\t\t\tcause: match.cause,\n\t\t\t\t\tabortController: controller,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tmatches: candidates,\n\t\t\t\t\trouteId: route.id\n\t\t\t\t}) || {};\n\t\t\t} catch {\n\t\t\t\tif (!isCurrent()) return;\n\t\t\t\tif (match.status !== \"error\" && match.status !== \"notFound\" && !match._notFound) {\n\t\t\t\t\tpendingBoundary = Math.min(pendingBoundary ?? index, index);\n\t\t\t\t\tretryFrom(index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isCurrent()) return;\n\t\t}\n\t\tmatch.context = {\n\t\t\t...parentContext,\n\t\t\t...routeContext,\n\t\t\t...committed[index] && dehydratedMatches[index].b\n\t\t};\n\t}\n\tawait projectLane(router, [location, candidates], controller.signal, 0, verifiedAssetEnd);\n\tif (!isCurrent()) return;\n\tconst needsClientLoad = pendingBoundary !== void 0 || committed.length < shared;\n\tconst committedMatches = isTerminal && committed.length === shared ? candidates : committed;\n\tlet presented = needsClientLoad ? candidates : committedMatches;\n\tlet dataOnlyAssetEnd;\n\tif (needsClientLoad && pendingBoundary !== void 0) {\n\t\tconst boundary = presented[pendingBoundary];\n\t\tdataOnlyAssetEnd = boundary.ssr === \"data-only\" && verifiedAssetEnd > pendingBoundary + 1 ? verifiedAssetEnd : void 0;\n\t\tpresented = presented.slice();\n\t\tpresented[pendingBoundary] = {\n\t\t\t...boundary,\n\t\t\tstatus: \"pending\",\n\t\t\tssr: boundary.ssr === \"data-only\" ? \"data-only\" : false,\n\t\t\t_assetEnd: dataOnlyAssetEnd\n\t\t};\n\t}\n\tconst claim = () => {\n\t\tconst historyLocation = router.history.location;\n\t\treturn needsClientLoad && !router._tx && historyLocation.href === handoffHistoryHref && historyLocation.state === handoffHistoryState && router._committed === committedMatches && committedMatches.length && !controller.signal.aborted ? controller : void 0;\n\t};\n\tconst handoff = [claim, (matches) => {\n\t\tif (router._handoff !== handoff) return;\n\t\trouter._handoff = void 0;\n\t\tconst prefix = committedMatches.length;\n\t\tif (!matches || !claim() || committedMatches.some((match, index) => match.id !== matches[index]?.id)) {\n\t\t\tcontroller.abort();\n\t\t\treturn;\n\t\t}\n\t\tlet handoffAssetEnd = dataOnlyAssetEnd;\n\t\tif (handoffAssetEnd !== void 0) {\n\t\t\tfor (let index = prefix; index < handoffAssetEnd; index++) if (candidates[index]?.id !== matches[index]?.id) {\n\t\t\t\thandoffAssetEnd = index > pendingBoundary + 1 ? index : void 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst clones = committedMatches.map((match) => ({ ...match }));\n\t\tif (handoffAssetEnd !== void 0) clones[pendingBoundary]._assetEnd = handoffAssetEnd;\n\t\ttransferMatchResources(router, matches.splice(0, prefix, ...clones));\n\t\tfor (let index = prefix; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tconst hydrated = candidates[index];\n\t\t\tif (hydrated?.id === match.id && hydrated._ctx) match._ctx = hydrated._ctx;\n\t\t\tmatch.abortController = controller;\n\t\t}\n\t\treturn prefix;\n\t}];\n\trouter._committed = committedMatches;\n\trouter._lifecycleEnd = lifecycleEnd(committedMatches);\n\trouter._handoff = handoff;\n\trouter._preflight = void 0;\n\trouter.batch(() => {\n\t\trouter.stores.setMatches(presented);\n\t\trouter.stores.status.set(\"idle\");\n\t\tif (!needsClientLoad) router.stores.resolvedLocation.set(router.stores.location.get());\n\t});\n}\n//#endregion\nexport { _getAssetMatches, _getRenderedMatches, _isRouteDeparting, cacheLoaderMatch, commitMatches, getRoute, hydrate, loadClientRoute, loadRouteChunk, preloadClientRoute, projectLane, refreshClientRoute, replaceRouteChunk, waitFor };\n\n//# sourceMappingURL=load-client.js.map","//#region src/link.ts\nconst preloadWarning = \"Error preloading route! ☝️\";\n//#endregion\nexport { preloadWarning };\n\n//# sourceMappingURL=link.js.map","\"use client\";\nimport * as React$1 from \"react\";\n//#region src/routerContext.tsx\nvar routerContext = React$1.createContext(null);\n//#endregion\nexport { routerContext };\n\n//# sourceMappingURL=routerContext.js.map","\"use client\";\nimport { routerContext } from \"./routerContext.js\";\nimport * as React$1 from \"react\";\n//#region src/useRouter.tsx\n/**\n* Access the current TanStack Router instance from React context.\n* Must be used within a `RouterProvider`.\n*\n* Options:\n* - `warn`: Log a warning if no router context is found (default: true).\n*\n* @returns The registered router instance.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n*/\nfunction useRouter(opts) {\n\tconst value = React$1.useContext(routerContext);\n\tif (!value) warnMissingRouter(opts);\n\treturn value;\n}\nfunction warnMissingRouter(opts) {\n\tif (process.env.NODE_ENV !== \"production\" && (opts?.warn ?? true)) console.warn(\"Warning: useRouter must be used inside a <RouterProvider> component!\");\n}\n//#endregion\nexport { useRouter };\n\n//# sourceMappingURL=useRouter.js.map","\"use client\";\nimport { _isRouteDeparting } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\n//#region src/matchContext.tsx\nfunction createLinkScope(router, routeId) {\n\tconst store = router.stores.location;\n\tconst listeners = /* @__PURE__ */ new Set();\n\tlet source;\n\tlet unsubscribe;\n\tconst update = (location) => {\n\t\tif (!_isRouteDeparting(router, routeId, location)) {\n\t\t\tsource = location;\n\t\t\tlisteners.forEach((listener) => listener());\n\t\t}\n\t};\n\treturn [() => source ?? store.get(), (listener) => {\n\t\tif (!listeners.size) {\n\t\t\tsource = store.get();\n\t\t\tunsubscribe = store.subscribe(update).unsubscribe;\n\t\t}\n\t\tlisteners.add(listener);\n\t\treturn () => {\n\t\t\tlisteners.delete(listener);\n\t\t\tif (!listeners.size) {\n\t\t\t\tunsubscribe();\n\t\t\t\tsource = void 0;\n\t\t\t}\n\t\t};\n\t}];\n}\nvar matchContext = React$1.createContext(void 0);\nvar dummyMatchContext = React$1.createContext(void 0);\n//#endregion\nexport { createLinkScope, dummyMatchContext, matchContext };\n\n//# sourceMappingURL=matchContext.js.map","\"use client\";\nimport { createLinkScope, matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { deepEqual, functionalUpdate, getUrlScheme, isDangerousProtocol, preloadWarning, removeTrailingSlash } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/link.tsx\nfunction useStableValues(...values) {\n\tconst ref = React$1.useRef(values);\n\tconst stable = ref.current;\n\tvalues.forEach((value, index) => {\n\t\tif (!deepEqual(stable[index], value, false, true)) stable[index] = value;\n\t});\n\treturn ref.current;\n}\nfunction preloadLink(router, options) {\n\trouter.preloadRoute(options).catch((err) => {\n\t\tconsole.warn(err);\n\t\tconsole.warn(preloadWarning);\n\t});\n}\nfunction resolveExternalLink(to, protocolAllowlist) {\n\tconst scheme = typeof to === \"string\" && getUrlScheme(to);\n\tif (!scheme) return;\n\tif (!protocolAllowlist.has(scheme)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\treturn null;\n\t}\n\treturn to;\n}\nfunction resolveIsActive(location, next, activeOptions, basepath) {\n\tconst currentPath = removeTrailingSlash(location.pathname, basepath);\n\tconst nextPath = removeTrailingSlash(next.pathname, basepath);\n\tif (activeOptions?.exact ? currentPath !== nextPath : !(currentPath.startsWith(nextPath) && (currentPath.length === nextPath.length || currentPath[nextPath.length] === \"/\"))) return false;\n\tif (activeOptions?.includeSearch ?? true) {\n\t\tif (!deepEqual(location.search, next.search, !activeOptions?.exact, activeOptions?.explicitUndefined)) return false;\n\t}\n\treturn !activeOptions?.includeHash || location.hash === next.hash;\n}\nfunction useLinkProps(options, forwardedRef, host) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) return getServerLinkProps(router, options, forwardedRef, host);\n\tconst innerRef = React$1.useRef(null);\n\tconst mergedRef = React$1.useCallback((element) => {\n\t\tinnerRef.current = element;\n\t\tif (typeof forwardedRef === \"function\") return forwardedRef(element);\n\t\tif (forwardedRef) forwardedRef.current = element;\n\t}, [forwardedRef]);\n\tconst { activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, disabled, target, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart } = options;\n\tconst [stableSearch, stableParams, stableActiveOptions] = useStableValues(options.search, options.params, activeOptions);\n\tconst routeId = React$1.useContext(matchContext);\n\tconst scope = (router.stores._linkScopes ??= {})[routeId] ??= createLinkScope(router, routeId);\n\tconst [dest, getLinkState, getHydrationState] = React$1.useMemo(() => {\n\t\tconst directExternalLink = resolveExternalLink(to, router.protocolAllowlist);\n\t\tif (directExternalLink !== void 0) {\n\t\t\tconst state = [directExternalLink ?? void 0];\n\t\t\treturn [options, () => state];\n\t\t}\n\t\tconst dest = { ...options };\n\t\tlet source;\n\t\tlet state;\n\t\tlet hydrationState;\n\t\tconst getLinkState = () => {\n\t\t\tconst location = scope[0]();\n\t\t\tif (location !== source) {\n\t\t\t\tdest._fromLocation = location;\n\t\t\t\tconst next = router.buildLocation(dest);\n\t\t\t\tconst href = getHrefOption(next, router, disabled);\n\t\t\t\tconst isActive = disabled || href && !getUrlScheme(href) ? resolveIsActive(location, next, stableActiveOptions, router.basepath) : void 0;\n\t\t\t\tif (!state || state[0] !== href || state[1] !== isActive) state = [href, isActive];\n\t\t\t\tsource = location;\n\t\t\t}\n\t\t\treturn state;\n\t\t};\n\t\treturn [\n\t\t\tdest,\n\t\t\tgetLinkState,\n\t\t\tstableActiveOptions?.includeHash && (() => {\n\t\t\t\tconst state = getLinkState();\n\t\t\t\treturn state[1] ? hydrationState ??= [state[0], false] : state;\n\t\t\t})\n\t\t];\n\t}, [\n\t\trouter,\n\t\tscope,\n\t\toptions.from,\n\t\toptions.hash,\n\t\toptions.href,\n\t\tto,\n\t\tstableSearch,\n\t\tstableParams,\n\t\toptions.state,\n\t\toptions.mask,\n\t\toptions.unsafeRelative,\n\t\tstableActiveOptions,\n\t\tdisabled\n\t]);\n\tconst [href, isActive] = React$1.useSyncExternalStore(scope[1], getLinkState, getHydrationState || getLinkState);\n\tconst externalLink = isActive === void 0 && href;\n\tconst linkDisabled = disabled || href === void 0;\n\tconst hasRenderFetched = React$1.useRef(false);\n\tconst preload = options.reloadDocument || externalLink || linkDisabled ? false : userPreload ?? router.options.defaultPreload;\n\tconst preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;\n\tconst enqueuePreload = React$1.useCallback((e) => {\n\t\tconst isIntersecting = e?.isIntersecting;\n\t\tif (!(isIntersecting ?? preload === \"intent\")) {\n\t\t\tif (isIntersecting === false) cancelPreload(innerRef);\n\t\t\treturn;\n\t\t}\n\t\tif (!preloadDelay) {\n\t\t\tpreloadLink(router, dest);\n\t\t\treturn;\n\t\t}\n\t\tinnerRef.t ??= setTimeout(() => {\n\t\t\tinnerRef.t = void 0;\n\t\t\tpreloadLink(router, dest);\n\t\t}, preloadDelay);\n\t}, [\n\t\trouter,\n\t\tdest,\n\t\tinnerRef,\n\t\tpreload,\n\t\tpreloadDelay\n\t]);\n\tReact$1.useEffect(() => {\n\t\tif (!preload) return;\n\t\tif (preload === \"render\" && !hasRenderFetched.current) {\n\t\t\thasRenderFetched.current = true;\n\t\t\tpreloadLink(router, dest);\n\t\t}\n\t\tlet active = true;\n\t\tlet observer;\n\t\tif (preload === \"viewport\" && innerRef.current && typeof IntersectionObserver === \"function\") {\n\t\t\tobserver = new IntersectionObserver((entries) => {\n\t\t\t\tif (active) enqueuePreload(entries.pop());\n\t\t\t}, { rootMargin: \"100px\" });\n\t\t\tobserver.observe(innerRef.current);\n\t\t}\n\t\treturn () => {\n\t\t\tactive = false;\n\t\t\tobserver?.disconnect();\n\t\t\tcancelPreload(innerRef);\n\t\t};\n\t}, [\n\t\trouter,\n\t\tdest,\n\t\tpreload,\n\t\tenqueuePreload,\n\t\tinnerRef\n\t]);\n\tconst props = collectElementProps(options, host);\n\tprops.ref = forwardedRef ? mergedRef : innerRef;\n\tif (externalLink) {\n\t\tprops.href = externalLink;\n\t\treturn props;\n\t}\n\tconst handleClick = (e) => {\n\t\tconst effectiveTarget = target ?? e.currentTarget.getAttribute(\"target\");\n\t\tif (!linkDisabled && !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === \"_self\") && e.button === 0) {\n\t\t\te.preventDefault();\n\t\t\tcancelPreload(innerRef);\n\t\t\trouter.navigate({\n\t\t\t\t...options,\n\t\t\t\t_fromLocation: dest._fromLocation\n\t\t\t});\n\t\t}\n\t};\n\tconst handleTouchStart = () => {\n\t\tif (preload === \"intent\") preloadLink(router, dest);\n\t};\n\tconst handleLeave = () => {\n\t\tif (preload === \"intent\") cancelPreload(innerRef);\n\t};\n\tprops.onClick = composeHandlers(onClick, handleClick);\n\tprops.onBlur = composeHandlers(onBlur, handleLeave);\n\tprops.onFocus = composeHandlers(onFocus, enqueuePreload);\n\tprops.onMouseEnter = composeHandlers(onMouseEnter, enqueuePreload);\n\tprops.onMouseLeave = composeHandlers(onMouseLeave, handleLeave);\n\tprops.onTouchStart = composeHandlers(onTouchStart, handleTouchStart);\n\treturn applyLinkState(props, options, isActive, href, linkDisabled, host);\n}\nvar STATIC_EMPTY_OBJECT = {};\nvar STATIC_ACTIVE_OBJECT = { className: \"active\" };\nvar ROUTER_OPTION_KEYS = /* @__PURE__ */ new Set([\n\t\"to\",\n\t\"params\",\n\t\"search\",\n\t\"hash\",\n\t\"state\",\n\t\"mask\",\n\t\"from\",\n\t\"unsafeRelative\",\n\t\"reloadDocument\",\n\t\"preload\",\n\t\"preloadDelay\",\n\t\"preloadIntentProximity\",\n\t\"hashScrollIntoView\",\n\t\"replace\",\n\t\"startTransition\",\n\t\"resetScroll\",\n\t\"viewTransition\",\n\t\"ignoreBlocker\",\n\t\"activeProps\",\n\t\"inactiveProps\",\n\t\"activeOptions\",\n\t\"_asChild\"\n]);\nfunction collectElementProps(options, host) {\n\tconst props = {};\n\tfor (const key in options) {\n\t\tif (ROUTER_OPTION_KEYS.has(key) || key === \"type\" && host !== void 0 || key === \"disabled\" && host === \"a\") continue;\n\t\tprops[key] = options[key];\n\t}\n\treturn props;\n}\nfunction applyLinkState(props, options, isActive, href, linkDisabled, host) {\n\tconst { activeProps, inactiveProps, className, style, target } = options;\n\tconst stateProps = functionalUpdate(isActive ? activeProps : inactiveProps, {}) ?? (isActive ? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT);\n\tObject.assign(props, stateProps);\n\tprops.href = href;\n\tif (host !== \"a\") props.disabled = linkDisabled;\n\tprops.target = target;\n\tconst stateStyle = stateProps.style;\n\tif (style || stateStyle) props.style = style && stateStyle ? {\n\t\t...style,\n\t\t...stateStyle\n\t} : style || stateStyle;\n\tconst stateClassName = stateProps.className;\n\tif (className || stateClassName) props.className = className ? stateClassName ? `${className} ${stateClassName}` : className : stateClassName;\n\tif (linkDisabled) {\n\t\tprops.role = \"link\";\n\t\tprops[\"aria-disabled\"] = true;\n\t}\n\tif (isActive) {\n\t\tprops[\"data-status\"] = \"active\";\n\t\tprops[\"aria-current\"] = \"page\";\n\t}\n\treturn props;\n}\nfunction getServerLinkProps(router, options, forwardedRef, host) {\n\tconst { to, disabled, activeOptions } = options;\n\tconst directExternalLink = resolveExternalLink(to, router.protocolAllowlist);\n\tconst next = directExternalLink === void 0 ? router.buildLocation(options) : void 0;\n\tconst hrefOption = next ? getHrefOption(next, router, disabled) : directExternalLink ?? void 0;\n\tconst linkDisabled = disabled || !hrefOption;\n\tconst externalLink = directExternalLink ?? (hrefOption && getUrlScheme(hrefOption) ? hrefOption : void 0);\n\tconst props = collectElementProps(options, host);\n\tprops.ref = forwardedRef;\n\tif (externalLink) {\n\t\tprops.href = externalLink;\n\t\treturn props;\n\t}\n\treturn applyLinkState(props, options, !!next && !(!disabled && !hrefOption) && !activeOptions?.includeHash && resolveIsActive(router.stores.location.get(), next, activeOptions, router.basepath), hrefOption, linkDisabled, host);\n}\nvar cancelPreload = (ref) => {\n\tclearTimeout(ref.t);\n\tref.t = void 0;\n};\nvar composeHandlers = (first, second) => {\n\tif (!first) return second;\n\treturn (event) => event.defaultPrevented || (first(event), event.defaultPrevented || second(event));\n};\nfunction getHrefOption(next, router, disabled) {\n\tif (disabled) return;\n\tconst location = next.maskedLocation ?? next;\n\tconst href = location.external ? location.publicHref : router.history.createHref(location.publicHref) || \"/\";\n\tif ((location.external || href !== location.publicHref) && isDangerousProtocol(href, router.protocolAllowlist)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${href}`);\n\t\treturn;\n\t}\n\treturn href;\n}\n/**\n* Creates a typed Link-like component that preserves TanStack Router's\n* navigation semantics and type-safety while delegating rendering to the\n* provided host component.\n*\n* Useful for integrating design system anchors/buttons while keeping\n* router-aware props (eg. `to`, `params`, `search`, `preload`).\n*\n* @param Comp The host component to render (eg. a design-system Link/Button)\n* @returns A router-aware component with the same API as `Link`.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n*/\nfunction createLink(Comp) {\n\treturn React$1.forwardRef(function CreatedLink(props, ref) {\n\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t...props,\n\t\t\t_asChild: Comp,\n\t\t\tref\n\t\t});\n\t});\n}\n/**\n* A strongly-typed anchor component for declarative navigation.\n* Handles path, search, hash and state updates with optional route preloading\n* and active-state styling.\n*\n* Props:\n* - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n* - `preloadDelay`: Delay in ms before preloading on focus, hover, or viewport entry\n* - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n* - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n* - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n* - `ignoreBlocker`: Bypass registered blockers\n*\n* @returns An anchor-like element that navigates without full page reloads.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n*/\nvar Link = React$1.memo(React$1.forwardRef((props, ref) => {\n\tconst host = props._asChild || \"a\";\n\tconst linkProps = useLinkProps(props, ref, host);\n\tconst children = typeof props.children === \"function\" ? props.children({ isActive: linkProps[\"data-status\"] === \"active\" }) : props.children;\n\treturn React$1.createElement(host, linkProps, children);\n}), areLinkPropsEqual);\nfunction areLinkPropsEqual(prev, next) {\n\tlet extraKeys = 0;\n\tfor (const key in next) {\n\t\textraKeys++;\n\t\tif (prev[key] === next[key]) continue;\n\t\tif (!ROUTER_OPTION_KEYS.has(key) || !deepEqual(prev[key], next[key], false, true)) return false;\n\t}\n\tfor (const _key in prev) extraKeys--;\n\treturn extraKeys === 0;\n}\n/**\n* Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n* Accepts a literal options object and returns it typed for later spreading.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\nvar linkOptions = (options) => {\n\treturn options;\n};\n/**\n* Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n* Use to validate and reuse navigation options across your app.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\n//#endregion\nexport { Link, composeHandlers, createLink, linkOptions, useLinkProps };\n\n//# sourceMappingURL=link.js.map"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":"A,mIAMA,SAASE,EAAK,EAAK,CAClB,OAAOC,EAAIA,EAAI,OAAS,EACzB,CAKA,SAASC,EAAiB,EAAS,EAAU,CAE5C,OADI,OAAOC,GAAY,WAAmBA,EAAQC,CAAQ,EACnDD,CACR,CACA,IAAME,EAAS,OAAO,UAAU,eAChC,SAASC,EAAQ,EAAK,CACrB,IAAK,IAAMC,KAAOC,EAAK,GAAIH,EAAO,KAAKG,EAAKD,CAAG,EAAG,MAAO,GACzD,MAAO,EACR,CACA,IAAME,MAAmB,OAAO,OAAO,IAAI,EACrCC,GAAwB,EAAM,IAASC,EAAiBC,EAAMC,EAAM,EAAI,EAC9E,SAASF,EAAiB,EAAM,EAAM,EAAY,EAAS,EAAG,CAE7D,GAAIC,IAASC,EAAM,OAAOD,EAC1B,GAAI,IAAW,IAAK,OAAOC,EAC3B,IAAMC,EAAQ,MAAM,QAAQF,CAAI,GAAK,MAAM,QAAQC,CAAI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