likec4 1.6.1 → 1.7.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 (1003) hide show
  1. package/dist/__app__/index.html +1 -1
  2. package/dist/__app__/react/likec4.tsx +6 -2
  3. package/dist/__app__/src/chunks/IconCopy-BoSoNPZ_.js +21 -0
  4. package/dist/__app__/src/chunks/LikeC4Diagram-DytrE8GE.js +9769 -0
  5. package/dist/__app__/src/chunks/StaticLikeC4Diagram-DdbjVDqf.js +32 -0
  6. package/dist/__app__/src/chunks/chunk-RAAYCPUM-CpeCcSnm.js +13 -0
  7. package/dist/__app__/src/chunks/chunk-SGAFZVQH-F2W_It6h.js +8 -0
  8. package/dist/__app__/src/chunks/const-DiwrD95Q.js +6 -0
  9. package/dist/__app__/src/chunks/createReactComponent-BWheWDGL.js +64 -0
  10. package/dist/__app__/src/chunks/index-BxglQLE6.js +10 -0
  11. package/dist/__app__/src/chunks/index-fBIC0lf6.js +12 -0
  12. package/dist/__app__/src/{index-Wk755r9n.js → chunks/index-nxRBtTOQ.js} +1 -2
  13. package/dist/__app__/src/chunks/likec4-DiOy4PZ9.js +6451 -0
  14. package/dist/__app__/src/chunks/mantine-u17mT9KZ.js +12251 -0
  15. package/dist/__app__/src/chunks/react-resizable-panels.browser.esm-BaxT8im_.js +1528 -0
  16. package/dist/__app__/src/chunks/tanstack-router-Cg36mbgZ.js +2484 -0
  17. package/dist/__app__/src/components/ColorSchemeToggle.js +38 -0
  18. package/dist/__app__/src/components/CopyToClipboard.js +17 -0
  19. package/dist/__app__/src/components/NotFound.js +40 -0
  20. package/dist/__app__/src/components/RenderIcon.js +9 -0
  21. package/dist/__app__/src/components/sidebar/Drawer.js +186 -0
  22. package/dist/__app__/src/components/view-page/Header.js +416 -0
  23. package/dist/__app__/src/hooks.js +16 -0
  24. package/dist/__app__/src/main.js +5 -33875
  25. package/dist/__app__/src/routeTree.gen.js +57 -0
  26. package/dist/__app__/src/router.js +26 -0
  27. package/dist/__app__/src/routes/__root.js +42 -0
  28. package/dist/__app__/src/routes/embed._viewId.js +45 -0
  29. package/dist/__app__/src/routes/export._viewId.js +60 -0
  30. package/dist/__app__/src/routes/index.css.js +7 -0
  31. package/dist/__app__/src/routes/index.js +89 -0
  32. package/dist/__app__/src/routes/view._viewId.d2.js +53 -0
  33. package/dist/__app__/src/routes/view._viewId.dot.js +58 -0
  34. package/dist/__app__/src/routes/view._viewId.editor.js +43 -0
  35. package/dist/__app__/src/routes/view._viewId.index.js +39 -0
  36. package/dist/__app__/src/routes/view._viewId.js +173 -0
  37. package/dist/__app__/src/routes/view._viewId.mmd.js +102 -0
  38. package/dist/__app__/src/routes/view.css.js +12 -0
  39. package/dist/__app__/src/routes/view_viewId_.css.js +7 -0
  40. package/dist/__app__/src/routes/webcomponent._.js +61 -0
  41. package/dist/__app__/src/style.css +1 -1
  42. package/dist/__app__/src/theme.js +21 -0
  43. package/dist/__app__/tsconfig.tsbuildinfo +1 -1
  44. package/dist/__app__/webcomponent/webcomponent.js +831 -846
  45. package/dist/cli/index.mjs +296 -354
  46. package/icons/all.d.ts +957 -0
  47. package/icons/all.js +1902 -0
  48. package/icons/aws/activate.js +21 -8
  49. package/icons/aws/alexa-for-business.js +21 -8
  50. package/icons/aws/amplify.js +21 -8
  51. package/icons/aws/apache-mxnet-on-aws.js +21 -8
  52. package/icons/aws/api-gateway.js +21 -8
  53. package/icons/aws/app-config.js +21 -8
  54. package/icons/aws/app-flow.js +21 -8
  55. package/icons/aws/app-mesh.js +21 -8
  56. package/icons/aws/app-runner.js +21 -8
  57. package/icons/aws/app-stream.js +21 -8
  58. package/icons/aws/app-sync.js +21 -8
  59. package/icons/aws/application-auto-scaling.js +21 -8
  60. package/icons/aws/application-composer.js +21 -8
  61. package/icons/aws/application-cost-profiler.js +21 -8
  62. package/icons/aws/application-discovery-service.js +21 -8
  63. package/icons/aws/application-migration-service.js +21 -8
  64. package/icons/aws/artifact.js +21 -8
  65. package/icons/aws/athena.js +21 -8
  66. package/icons/aws/audit-manager.js +21 -8
  67. package/icons/aws/augmented-ai-a2i.js +21 -8
  68. package/icons/aws/aurora.js +21 -8
  69. package/icons/aws/auto-scaling.js +21 -8
  70. package/icons/aws/backint-agent.js +21 -8
  71. package/icons/aws/backup.js +21 -8
  72. package/icons/aws/batch.js +21 -8
  73. package/icons/aws/billing-conductor.js +21 -8
  74. package/icons/aws/bottlerocket.js +21 -8
  75. package/icons/aws/braket.js +21 -8
  76. package/icons/aws/budgets.js +21 -8
  77. package/icons/aws/certificate-manager.js +21 -8
  78. package/icons/aws/chatbot.js +21 -8
  79. package/icons/aws/chime-sdk.js +21 -8
  80. package/icons/aws/chime-voice-connector.js +21 -8
  81. package/icons/aws/chime.js +21 -8
  82. package/icons/aws/clean-rooms.js +21 -8
  83. package/icons/aws/client-vpn.js +21 -8
  84. package/icons/aws/cloud-control-api.js +21 -8
  85. package/icons/aws/cloud-development-kit.js +21 -8
  86. package/icons/aws/cloud-directory.js +21 -8
  87. package/icons/aws/cloud-formation.js +21 -8
  88. package/icons/aws/cloud-front.js +21 -8
  89. package/icons/aws/cloud-hsm.js +21 -8
  90. package/icons/aws/cloud-map.js +21 -8
  91. package/icons/aws/cloud-search.js +21 -8
  92. package/icons/aws/cloud-shell.js +21 -8
  93. package/icons/aws/cloud-trail.js +21 -8
  94. package/icons/aws/cloud-wan.js +21 -8
  95. package/icons/aws/cloud-watch.js +21 -8
  96. package/icons/aws/cloud9.js +21 -8
  97. package/icons/aws/code-artifact.js +21 -8
  98. package/icons/aws/code-build.js +21 -8
  99. package/icons/aws/code-catalyst.js +21 -8
  100. package/icons/aws/code-commit.js +21 -8
  101. package/icons/aws/code-deploy.js +21 -8
  102. package/icons/aws/code-guru.js +21 -8
  103. package/icons/aws/code-pipeline.js +21 -8
  104. package/icons/aws/code-star.js +21 -8
  105. package/icons/aws/code-whisperer.js +21 -8
  106. package/icons/aws/cognito.js +21 -8
  107. package/icons/aws/command-line-interface.js +21 -8
  108. package/icons/aws/comprehend-medical.js +21 -8
  109. package/icons/aws/comprehend.js +21 -8
  110. package/icons/aws/compute-optimizer.js +21 -8
  111. package/icons/aws/config.js +21 -8
  112. package/icons/aws/connect.js +21 -8
  113. package/icons/aws/console-mobile-application.js +21 -8
  114. package/icons/aws/control-tower.js +21 -8
  115. package/icons/aws/corretto.js +21 -8
  116. package/icons/aws/cost-and-usage-report.js +21 -8
  117. package/icons/aws/cost-explorer.js +21 -8
  118. package/icons/aws/data-exchange.js +21 -8
  119. package/icons/aws/data-pipeline.js +21 -8
  120. package/icons/aws/data-sync.js +21 -8
  121. package/icons/aws/data-zone.js +21 -8
  122. package/icons/aws/database-migration-service.js +21 -8
  123. package/icons/aws/deep-composer.js +21 -8
  124. package/icons/aws/deep-learning-amis.js +21 -8
  125. package/icons/aws/deep-learning-containers.js +21 -8
  126. package/icons/aws/deep-lens.js +21 -8
  127. package/icons/aws/deep-racer.js +21 -8
  128. package/icons/aws/detective.js +21 -8
  129. package/icons/aws/dev-ops-guru.js +21 -8
  130. package/icons/aws/device-farm.js +21 -8
  131. package/icons/aws/direct-connect.js +21 -8
  132. package/icons/aws/directory-service.js +21 -8
  133. package/icons/aws/distro-for-open-telemetry.js +21 -8
  134. package/icons/aws/document-db.js +21 -8
  135. package/icons/aws/dynamo-db.js +21 -8
  136. package/icons/aws/ec2-auto-scaling.js +21 -8
  137. package/icons/aws/ec2-image-builder.js +21 -8
  138. package/icons/aws/ec2.js +21 -8
  139. package/icons/aws/ecs-anywhere.js +21 -8
  140. package/icons/aws/efs.js +21 -8
  141. package/icons/aws/eks-anywhere.js +21 -8
  142. package/icons/aws/eks-cloud.js +21 -8
  143. package/icons/aws/eks-distro.js +21 -8
  144. package/icons/aws/elasti-cache.js +21 -8
  145. package/icons/aws/elastic-beanstalk.js +21 -8
  146. package/icons/aws/elastic-block-store.js +21 -8
  147. package/icons/aws/elastic-container-registry.js +21 -8
  148. package/icons/aws/elastic-container-service.js +21 -8
  149. package/icons/aws/elastic-disaster-recovery.js +21 -8
  150. package/icons/aws/elastic-fabric-adapter.js +21 -8
  151. package/icons/aws/elastic-inference.js +21 -8
  152. package/icons/aws/elastic-kubernetes-service.js +21 -8
  153. package/icons/aws/elastic-load-balancing.js +21 -8
  154. package/icons/aws/elastic-transcoder.js +21 -8
  155. package/icons/aws/elemental-appliances-software.js +21 -8
  156. package/icons/aws/elemental-conductor.js +21 -8
  157. package/icons/aws/elemental-delta.js +21 -8
  158. package/icons/aws/elemental-link.js +21 -8
  159. package/icons/aws/elemental-live.js +21 -8
  160. package/icons/aws/elemental-media-connect.js +21 -8
  161. package/icons/aws/elemental-media-convert.js +21 -8
  162. package/icons/aws/elemental-media-live.js +21 -8
  163. package/icons/aws/elemental-media-package.js +21 -8
  164. package/icons/aws/elemental-media-store.js +21 -8
  165. package/icons/aws/elemental-media-tailor.js +21 -8
  166. package/icons/aws/elemental-server.js +21 -8
  167. package/icons/aws/emr.js +21 -8
  168. package/icons/aws/event-bridge.js +21 -8
  169. package/icons/aws/express-workflows.js +21 -8
  170. package/icons/aws/fargate.js +21 -8
  171. package/icons/aws/fault-injection-simulator.js +21 -8
  172. package/icons/aws/file-cache.js +21 -8
  173. package/icons/aws/fin-space.js +21 -8
  174. package/icons/aws/firewall-manager.js +21 -8
  175. package/icons/aws/forecast.js +21 -8
  176. package/icons/aws/fraud-detector.js +21 -8
  177. package/icons/aws/free-rtos.js +21 -8
  178. package/icons/aws/fsx-for-lustre.js +21 -8
  179. package/icons/aws/fsx-for-net-app-ontap.js +21 -8
  180. package/icons/aws/fsx-for-open-zfs.js +21 -8
  181. package/icons/aws/fsx-for-wfs.js +21 -8
  182. package/icons/aws/fsx.js +21 -8
  183. package/icons/aws/game-kit.js +21 -8
  184. package/icons/aws/game-lift.js +21 -8
  185. package/icons/aws/game-sparks.js +21 -8
  186. package/icons/aws/genomics-cli.js +21 -8
  187. package/icons/aws/global-accelerator.js +21 -8
  188. package/icons/aws/glue-data-brew.js +21 -8
  189. package/icons/aws/glue-elastic-views.js +21 -8
  190. package/icons/aws/glue.js +21 -8
  191. package/icons/aws/ground-station.js +21 -8
  192. package/icons/aws/guard-duty.js +21 -8
  193. package/icons/aws/health-lake.js +21 -8
  194. package/icons/aws/honeycode.js +21 -8
  195. package/icons/aws/iam-identity-center.js +21 -8
  196. package/icons/aws/identity-and-access-management.js +21 -8
  197. package/icons/aws/inspector.js +21 -8
  198. package/icons/aws/interactive-video-service.js +21 -8
  199. package/icons/aws/io-t-1-click.js +21 -8
  200. package/icons/aws/io-t-analytics.js +21 -8
  201. package/icons/aws/io-t-button.js +21 -8
  202. package/icons/aws/io-t-core.js +21 -8
  203. package/icons/aws/io-t-device-defender.js +21 -8
  204. package/icons/aws/io-t-device-management.js +21 -8
  205. package/icons/aws/io-t-edu-kit.js +21 -8
  206. package/icons/aws/io-t-events.js +21 -8
  207. package/icons/aws/io-t-express-link.js +21 -8
  208. package/icons/aws/io-t-fleet-wise.js +21 -8
  209. package/icons/aws/io-t-greengrass.js +21 -8
  210. package/icons/aws/io-t-robo-runner.js +21 -8
  211. package/icons/aws/io-t-site-wise.js +21 -8
  212. package/icons/aws/io-t-things-graph.js +21 -8
  213. package/icons/aws/io-t-twin-maker.js +30 -8
  214. package/icons/aws/iq.js +21 -8
  215. package/icons/aws/kendra.js +21 -8
  216. package/icons/aws/key-management-service.js +21 -8
  217. package/icons/aws/keyspaces.js +21 -8
  218. package/icons/aws/kinesis-data-analytics.js +21 -8
  219. package/icons/aws/kinesis-data-streams.js +21 -8
  220. package/icons/aws/kinesis-firehose.js +21 -8
  221. package/icons/aws/kinesis-video-streams.js +21 -8
  222. package/icons/aws/kinesis.js +21 -8
  223. package/icons/aws/lake-formation.js +21 -8
  224. package/icons/aws/lambda.js +21 -8
  225. package/icons/aws/launch-wizard.js +21 -8
  226. package/icons/aws/lex.js +21 -8
  227. package/icons/aws/license-manager.js +21 -8
  228. package/icons/aws/lightsail.js +21 -8
  229. package/icons/aws/local-zones.js +21 -8
  230. package/icons/aws/location-service.js +21 -8
  231. package/icons/aws/lookout-for-equipment.js +21 -8
  232. package/icons/aws/lookout-for-metrics.js +21 -8
  233. package/icons/aws/lookout-for-vision.js +21 -8
  234. package/icons/aws/lumberyard.js +21 -8
  235. package/icons/aws/macie.js +21 -8
  236. package/icons/aws/mainframe-modernization.js +21 -8
  237. package/icons/aws/managed-blockchain.js +21 -8
  238. package/icons/aws/managed-grafana.js +21 -8
  239. package/icons/aws/managed-service-for-prometheus.js +21 -8
  240. package/icons/aws/managed-services.js +21 -8
  241. package/icons/aws/managed-streaming-for-apache-kafka.js +21 -8
  242. package/icons/aws/managed-workflows-for-apache-airflow.js +21 -8
  243. package/icons/aws/management-console.js +21 -8
  244. package/icons/aws/marketplace-dark.js +15 -8
  245. package/icons/aws/marketplace-light.js +15 -8
  246. package/icons/aws/memory-db-for-redis.js +21 -8
  247. package/icons/aws/migration-evaluator.js +21 -8
  248. package/icons/aws/migration-hub.js +21 -8
  249. package/icons/aws/monitron.js +21 -8
  250. package/icons/aws/mq.js +21 -8
  251. package/icons/aws/neptune.js +21 -8
  252. package/icons/aws/network-firewall.js +21 -8
  253. package/icons/aws/neuron.js +21 -8
  254. package/icons/aws/nice-dcv.js +21 -8
  255. package/icons/aws/nice-engin-frame.js +21 -8
  256. package/icons/aws/nimble-studio.js +21 -8
  257. package/icons/aws/nitro-enclaves.js +21 -8
  258. package/icons/aws/omics.js +21 -8
  259. package/icons/aws/open-3d-engine.js +21 -8
  260. package/icons/aws/open-search-service.js +21 -8
  261. package/icons/aws/ops-works.js +21 -8
  262. package/icons/aws/organizations.js +21 -8
  263. package/icons/aws/outposts-family.js +21 -8
  264. package/icons/aws/outposts-rack.js +21 -8
  265. package/icons/aws/outposts-servers.js +21 -8
  266. package/icons/aws/panorama.js +21 -8
  267. package/icons/aws/parallel-cluster.js +21 -8
  268. package/icons/aws/personal-health-dashboard.js +21 -8
  269. package/icons/aws/personalize.js +21 -8
  270. package/icons/aws/pinpoint-apis.js +21 -8
  271. package/icons/aws/pinpoint.js +21 -8
  272. package/icons/aws/polly.js +21 -8
  273. package/icons/aws/private-5g.js +21 -8
  274. package/icons/aws/private-certificate-authority.js +17 -8
  275. package/icons/aws/private-link.js +21 -8
  276. package/icons/aws/professional-services.js +21 -8
  277. package/icons/aws/proton.js +21 -8
  278. package/icons/aws/quantum-ledger-database.js +21 -8
  279. package/icons/aws/quick-sight.js +21 -8
  280. package/icons/aws/rds-on-vmware.js +21 -8
  281. package/icons/aws/rds.js +21 -8
  282. package/icons/aws/re-post.js +21 -8
  283. package/icons/aws/red-hat-open-shift-service-on-aws.js +21 -8
  284. package/icons/aws/redshift.js +21 -8
  285. package/icons/aws/rekognition.js +21 -8
  286. package/icons/aws/reserved-instance-reporting.js +21 -8
  287. package/icons/aws/resilience-hub.js +21 -8
  288. package/icons/aws/resource-access-manager.js +21 -8
  289. package/icons/aws/resource-explorer.js +21 -8
  290. package/icons/aws/robo-maker.js +21 -8
  291. package/icons/aws/route-53.js +21 -8
  292. package/icons/aws/s3-on-outposts.js +21 -8
  293. package/icons/aws/sage-maker-ground-truth.js +21 -8
  294. package/icons/aws/sage-maker-studio-lab.js +21 -8
  295. package/icons/aws/sage-maker.js +21 -8
  296. package/icons/aws/savings-plans.js +21 -8
  297. package/icons/aws/secrets-manager.js +21 -8
  298. package/icons/aws/security-hub.js +21 -8
  299. package/icons/aws/security-lake.js +21 -8
  300. package/icons/aws/server-migration-service.js +21 -8
  301. package/icons/aws/serverless-application-repository.js +21 -8
  302. package/icons/aws/service-catalog.js +21 -8
  303. package/icons/aws/service-management-connector.js +17 -8
  304. package/icons/aws/shield.js +21 -8
  305. package/icons/aws/signer.js +21 -8
  306. package/icons/aws/sim-space-weaver.js +21 -8
  307. package/icons/aws/simple-email-service.js +21 -8
  308. package/icons/aws/simple-notification-service.js +21 -8
  309. package/icons/aws/simple-queue-service.js +21 -8
  310. package/icons/aws/simple-storage-service-glacier.js +21 -8
  311. package/icons/aws/simple-storage-service.js +21 -8
  312. package/icons/aws/site-to-site-vpn.js +21 -8
  313. package/icons/aws/snowball-edge.js +21 -8
  314. package/icons/aws/snowball.js +21 -8
  315. package/icons/aws/snowcone.js +21 -8
  316. package/icons/aws/snowmobile.js +21 -8
  317. package/icons/aws/step-functions.js +21 -8
  318. package/icons/aws/storage-gateway.js +21 -8
  319. package/icons/aws/sumerian.js +21 -8
  320. package/icons/aws/supply-chain.js +21 -8
  321. package/icons/aws/support.js +21 -8
  322. package/icons/aws/systems-manager.js +21 -8
  323. package/icons/aws/tensor-flow-on-aws.js +21 -8
  324. package/icons/aws/textract.js +21 -8
  325. package/icons/aws/thinkbox-deadline.js +21 -8
  326. package/icons/aws/thinkbox-frost.js +21 -8
  327. package/icons/aws/thinkbox-krakatoa.js +21 -8
  328. package/icons/aws/thinkbox-sequoia.js +21 -8
  329. package/icons/aws/thinkbox-stoke.js +21 -8
  330. package/icons/aws/thinkbox-xmesh.js +21 -8
  331. package/icons/aws/timestream.js +21 -8
  332. package/icons/aws/tools-and-sdks.js +21 -8
  333. package/icons/aws/torch-serve.js +21 -8
  334. package/icons/aws/training-certification.js +21 -8
  335. package/icons/aws/transcribe.js +21 -8
  336. package/icons/aws/transfer-family.js +21 -8
  337. package/icons/aws/transit-gateway.js +21 -8
  338. package/icons/aws/translate.js +21 -8
  339. package/icons/aws/trusted-advisor.js +21 -8
  340. package/icons/aws/verified-access.js +21 -8
  341. package/icons/aws/verified-permissions.js +21 -8
  342. package/icons/aws/virtual-private-cloud.js +21 -8
  343. package/icons/aws/vmware-cloud-on-aws.js +21 -8
  344. package/icons/aws/vpc-lattice.js +21 -8
  345. package/icons/aws/waf.js +21 -8
  346. package/icons/aws/wavelength.js +21 -8
  347. package/icons/aws/well-architected-tool.js +21 -8
  348. package/icons/aws/wickr.js +21 -8
  349. package/icons/aws/work-docs-sdk.js +21 -8
  350. package/icons/aws/work-docs.js +21 -8
  351. package/icons/aws/work-link.js +21 -8
  352. package/icons/aws/work-mail.js +21 -8
  353. package/icons/aws/work-spaces-family.js +21 -8
  354. package/icons/aws/x-ray.js +21 -8
  355. package/icons/gcp/access-context-manager.js +17 -8
  356. package/icons/gcp/administration.js +46 -8
  357. package/icons/gcp/advanced-agent-modeling.js +31 -8
  358. package/icons/gcp/advanced-solutions-lab.js +48 -8
  359. package/icons/gcp/agent-assist.js +12 -8
  360. package/icons/gcp/ai-hub.js +23 -8
  361. package/icons/gcp/ai-platform-unified.js +40 -8
  362. package/icons/gcp/ai-platform.js +23 -8
  363. package/icons/gcp/analytics-hub.js +28 -8
  364. package/icons/gcp/anthos-config-management.js +28 -8
  365. package/icons/gcp/anthos-service-mesh.js +13 -8
  366. package/icons/gcp/anthos.js +11 -8
  367. package/icons/gcp/api-analytics.js +26 -8
  368. package/icons/gcp/api-monetization.js +23 -8
  369. package/icons/gcp/api.js +29 -8
  370. package/icons/gcp/apigee-api-platform.js +35 -8
  371. package/icons/gcp/apigee-sense.js +28 -8
  372. package/icons/gcp/app-engine.js +39 -8
  373. package/icons/gcp/artifact-registry.js +33 -8
  374. package/icons/gcp/asset-inventory.js +19 -8
  375. package/icons/gcp/assured-workloads.js +32 -8
  376. package/icons/gcp/auto-ml-natural-language.js +9 -8
  377. package/icons/gcp/auto-ml-tables.js +19 -8
  378. package/icons/gcp/auto-ml-translation.js +25 -8
  379. package/icons/gcp/auto-ml-video-intelligence.js +25 -8
  380. package/icons/gcp/auto-ml-vision.js +18 -8
  381. package/icons/gcp/auto-ml.js +14 -8
  382. package/icons/gcp/bare-metal-solutions.js +10 -8
  383. package/icons/gcp/batch.js +12 -8
  384. package/icons/gcp/beyondcorp.js +13 -8
  385. package/icons/gcp/big-query.js +28 -8
  386. package/icons/gcp/bigtable.js +116 -8
  387. package/icons/gcp/billing.js +34 -8
  388. package/icons/gcp/binary-authorization.js +22 -8
  389. package/icons/gcp/catalog.js +29 -8
  390. package/icons/gcp/certificate-authority-service.js +33 -8
  391. package/icons/gcp/certificate-manager.js +24 -8
  392. package/icons/gcp/cloud-api-gateway.js +13 -8
  393. package/icons/gcp/cloud-apis.js +18 -8
  394. package/icons/gcp/cloud-armor.js +27 -8
  395. package/icons/gcp/cloud-asset-inventory.js +10 -8
  396. package/icons/gcp/cloud-audit-logs.js +45 -8
  397. package/icons/gcp/cloud-build.js +19 -8
  398. package/icons/gcp/cloud-cdn.js +22 -8
  399. package/icons/gcp/cloud-code.js +16 -8
  400. package/icons/gcp/cloud-composer.js +13 -8
  401. package/icons/gcp/cloud-data-fusion.js +15 -8
  402. package/icons/gcp/cloud-deploy.js +10 -8
  403. package/icons/gcp/cloud-deployment-manager.js +24 -8
  404. package/icons/gcp/cloud-dns.js +21 -8
  405. package/icons/gcp/cloud-domains.js +26 -8
  406. package/icons/gcp/cloud-ekm.js +13 -8
  407. package/icons/gcp/cloud-endpoints.js +18 -8
  408. package/icons/gcp/cloud-external-ip-addresses.js +21 -8
  409. package/icons/gcp/cloud-firewall-rules.js +15 -8
  410. package/icons/gcp/cloud-for-marketing.js +13 -8
  411. package/icons/gcp/cloud-functions.js +25 -8
  412. package/icons/gcp/cloud-generic.js +13 -8
  413. package/icons/gcp/cloud-gpu.js +18 -8
  414. package/icons/gcp/cloud-healthcare-api.js +32 -8
  415. package/icons/gcp/cloud-healthcare-marketplace.js +10 -8
  416. package/icons/gcp/cloud-hsm.js +37 -8
  417. package/icons/gcp/cloud-ids.js +42 -8
  418. package/icons/gcp/cloud-inference-api.js +27 -8
  419. package/icons/gcp/cloud-interconnect.js +15 -8
  420. package/icons/gcp/cloud-jobs-api.js +37 -8
  421. package/icons/gcp/cloud-load-balancing.js +20 -8
  422. package/icons/gcp/cloud-logging.js +19 -8
  423. package/icons/gcp/cloud-media-edge.js +23 -8
  424. package/icons/gcp/cloud-monitoring.js +26 -8
  425. package/icons/gcp/cloud-nat.js +31 -8
  426. package/icons/gcp/cloud-natural-language-api.js +17 -8
  427. package/icons/gcp/cloud-network.js +17 -8
  428. package/icons/gcp/cloud-ops.js +32 -8
  429. package/icons/gcp/cloud-optimization-ai-fleet-routing-api.js +22 -8
  430. package/icons/gcp/cloud-optimization-ai.js +28 -8
  431. package/icons/gcp/cloud-router.js +13 -8
  432. package/icons/gcp/cloud-routes.js +18 -8
  433. package/icons/gcp/cloud-run-for-anthos.js +21 -8
  434. package/icons/gcp/cloud-run.js +13 -8
  435. package/icons/gcp/cloud-scheduler.js +36 -8
  436. package/icons/gcp/cloud-security-scanner.js +21 -8
  437. package/icons/gcp/cloud-shell.js +16 -8
  438. package/icons/gcp/cloud-spanner.js +42 -8
  439. package/icons/gcp/cloud-sql.js +16 -8
  440. package/icons/gcp/cloud-storage.js +22 -8
  441. package/icons/gcp/cloud-tasks.js +29 -8
  442. package/icons/gcp/cloud-test-lab.js +39 -8
  443. package/icons/gcp/cloud-tpu.js +103 -8
  444. package/icons/gcp/cloud-translation-api.js +16 -8
  445. package/icons/gcp/cloud-vision-api.js +16 -8
  446. package/icons/gcp/cloud-vpn.js +23 -8
  447. package/icons/gcp/compute-engine.js +17 -8
  448. package/icons/gcp/configuration-management.js +22 -8
  449. package/icons/gcp/connectivity-test.js +6 -8
  450. package/icons/gcp/connectors.js +13 -8
  451. package/icons/gcp/contact-center-ai.js +6 -8
  452. package/icons/gcp/container-optimized-os.js +13 -8
  453. package/icons/gcp/container-registry.js +27 -8
  454. package/icons/gcp/data-catalog.js +25 -8
  455. package/icons/gcp/data-labeling.js +19 -8
  456. package/icons/gcp/data-layers.js +11 -8
  457. package/icons/gcp/data-loss-prevention-api.js +54 -8
  458. package/icons/gcp/data-qn-a.js +24 -8
  459. package/icons/gcp/data-studio.js +16 -8
  460. package/icons/gcp/data-transfer.js +17 -8
  461. package/icons/gcp/database-migration-service.js +24 -8
  462. package/icons/gcp/dataflow.js +44 -8
  463. package/icons/gcp/datalab.js +13 -8
  464. package/icons/gcp/dataplex.js +15 -8
  465. package/icons/gcp/datapol.js +49 -8
  466. package/icons/gcp/dataprep.js +25 -8
  467. package/icons/gcp/dataproc-metastore.js +12 -8
  468. package/icons/gcp/dataproc.js +43 -8
  469. package/icons/gcp/datashare.js +37 -8
  470. package/icons/gcp/datastore.js +39 -8
  471. package/icons/gcp/datastream.js +35 -8
  472. package/icons/gcp/debugger.js +31 -8
  473. package/icons/gcp/developer-portal.js +24 -8
  474. package/icons/gcp/dialogflow-cx.js +28 -8
  475. package/icons/gcp/dialogflow-insights.js +33 -8
  476. package/icons/gcp/dialogflow.js +16 -8
  477. package/icons/gcp/document-ai.js +27 -8
  478. package/icons/gcp/early-access-center.js +12 -8
  479. package/icons/gcp/error-reporting.js +14 -8
  480. package/icons/gcp/eventarc.js +24 -8
  481. package/icons/gcp/filestore.js +14 -8
  482. package/icons/gcp/financial-services-marketplace.js +21 -8
  483. package/icons/gcp/firestore.js +14 -8
  484. package/icons/gcp/fleet-engine.js +10 -8
  485. package/icons/gcp/free-trial.js +36 -8
  486. package/icons/gcp/game-servers.js +32 -8
  487. package/icons/gcp/gce-systems-management.js +13 -8
  488. package/icons/gcp/genomics.js +23 -8
  489. package/icons/gcp/gke-on-prem.js +31 -8
  490. package/icons/gcp/google-cloud-marketplace.js +29 -8
  491. package/icons/gcp/google-kubernetes-engine.js +23 -8
  492. package/icons/gcp/google-maps-platform.js +47 -8
  493. package/icons/gcp/healthcare-nlp-api.js +13 -8
  494. package/icons/gcp/home.js +25 -8
  495. package/icons/gcp/identity-and-access-management.js +23 -8
  496. package/icons/gcp/identity-aware-proxy.js +32 -8
  497. package/icons/gcp/identity-platform.js +26 -8
  498. package/icons/gcp/iot-core.js +23 -8
  499. package/icons/gcp/iot-edge.js +86 -8
  500. package/icons/gcp/key-access-justifications.js +46 -8
  501. package/icons/gcp/key-management-service.js +23 -8
  502. package/icons/gcp/kuberun.js +26 -8
  503. package/icons/gcp/launcher.js +35 -8
  504. package/icons/gcp/local-ssd.js +13 -8
  505. package/icons/gcp/looker.js +46 -8
  506. package/icons/gcp/managed-service-for-microsoft-active-directory.js +24 -8
  507. package/icons/gcp/media-translation-api.js +28 -8
  508. package/icons/gcp/memorystore.js +26 -8
  509. package/icons/gcp/migrate-for-anthos.js +13 -8
  510. package/icons/gcp/migrate-for-compute-engine.js +13 -8
  511. package/icons/gcp/my-cloud.js +21 -8
  512. package/icons/gcp/network-connectivity-center.js +84 -8
  513. package/icons/gcp/network-intelligence-center.js +13 -8
  514. package/icons/gcp/network-security.js +32 -8
  515. package/icons/gcp/network-tiers.js +23 -8
  516. package/icons/gcp/network-topology.js +13 -8
  517. package/icons/gcp/onboarding.js +25 -8
  518. package/icons/gcp/os-configuration-management.js +13 -8
  519. package/icons/gcp/os-inventory-management.js +15 -8
  520. package/icons/gcp/os-patch-management.js +13 -8
  521. package/icons/gcp/partner-interconnect.js +21 -8
  522. package/icons/gcp/partner-portal.js +35 -8
  523. package/icons/gcp/performance-dashboard.js +13 -8
  524. package/icons/gcp/permissions.js +35 -8
  525. package/icons/gcp/persistent-disk.js +10 -8
  526. package/icons/gcp/phishing-protection.js +36 -8
  527. package/icons/gcp/policy-analyzer.js +13 -8
  528. package/icons/gcp/premium-network-tier.js +19 -8
  529. package/icons/gcp/private-connectivity.js +18 -8
  530. package/icons/gcp/private-service-connect.js +27 -8
  531. package/icons/gcp/producer-portal.js +21 -8
  532. package/icons/gcp/profiler.js +21 -8
  533. package/icons/gcp/project.js +28 -8
  534. package/icons/gcp/pub-sub.js +41 -8
  535. package/icons/gcp/quantum-engine.js +27 -8
  536. package/icons/gcp/quotas.js +26 -8
  537. package/icons/gcp/real-world-insights.js +19 -8
  538. package/icons/gcp/recommendations-ai.js +24 -8
  539. package/icons/gcp/release-notes.js +12 -8
  540. package/icons/gcp/retail-api.js +22 -8
  541. package/icons/gcp/risk-manager.js +12 -8
  542. package/icons/gcp/runtime-config.js +19 -8
  543. package/icons/gcp/secret-manager.js +13 -8
  544. package/icons/gcp/security-command-center.js +18 -8
  545. package/icons/gcp/security-health-advisor.js +43 -8
  546. package/icons/gcp/security-key-enforcement.js +21 -8
  547. package/icons/gcp/security.js +27 -8
  548. package/icons/gcp/service-discovery.js +26 -8
  549. package/icons/gcp/speech-to-text.js +21 -8
  550. package/icons/gcp/stackdriver.js +10 -8
  551. package/icons/gcp/standard-network-tier.js +13 -8
  552. package/icons/gcp/stream-suite.js +16 -8
  553. package/icons/gcp/support.js +29 -8
  554. package/icons/gcp/tensorflow-enterprise.js +13 -8
  555. package/icons/gcp/text-to-speech.js +24 -8
  556. package/icons/gcp/tools-for-powershell.js +29 -8
  557. package/icons/gcp/trace.js +17 -8
  558. package/icons/gcp/traffic-director.js +20 -8
  559. package/icons/gcp/transfer-appliance.js +20 -8
  560. package/icons/gcp/transfer.js +13 -8
  561. package/icons/gcp/user-preferences.js +35 -8
  562. package/icons/gcp/vertex-ai.js +48 -8
  563. package/icons/gcp/video-intelligence-api.js +15 -8
  564. package/icons/gcp/virtual-private-cloud.js +19 -8
  565. package/icons/gcp/visual-inspection.js +24 -8
  566. package/icons/gcp/vmware-engine.js +13 -8
  567. package/icons/gcp/web-risk.js +27 -8
  568. package/icons/gcp/web-security-scanner.js +27 -8
  569. package/icons/gcp/workflows.js +82 -8
  570. package/icons/gcp/workload-identity-pool.js +24 -8
  571. package/icons/tech/aarch64.js +48 -8
  572. package/icons/tech/adobe-illustrator.js +14 -8
  573. package/icons/tech/adobe-photoshop.js +14 -8
  574. package/icons/tech/adobe-premiere-pro.js +16 -8
  575. package/icons/tech/adobe-xd.js +12 -8
  576. package/icons/tech/adonis-js.js +14 -8
  577. package/icons/tech/after-effects.js +16 -8
  578. package/icons/tech/airflow.js +64 -8
  579. package/icons/tech/akka.js +21 -8
  580. package/icons/tech/algolia.js +12 -8
  581. package/icons/tech/alpine-js.js +17 -8
  582. package/icons/tech/amazon-web-services.js +21 -8
  583. package/icons/tech/anaconda.js +12 -8
  584. package/icons/tech/android-studio.js +44 -8
  585. package/icons/tech/android.js +35 -8
  586. package/icons/tech/angular-js.js +24 -8
  587. package/icons/tech/angular.js +37 -8
  588. package/icons/tech/ansible.js +15 -8
  589. package/icons/tech/ant-design.js +112 -8
  590. package/icons/tech/apache.js +156 -8
  591. package/icons/tech/apl.js +21 -8
  592. package/icons/tech/appcelerator.js +12 -8
  593. package/icons/tech/apple-safari.js +39 -10
  594. package/icons/tech/apple.js +6 -8
  595. package/icons/tech/appwrite.js +21 -8
  596. package/icons/tech/arch-linux.js +29 -8
  597. package/icons/tech/arduino.js +9 -8
  598. package/icons/tech/argo-cd.js +134 -8
  599. package/icons/tech/astro.js +62 -8
  600. package/icons/tech/atom.js +14 -8
  601. package/icons/tech/autodesk-maya.js +55 -8
  602. package/icons/tech/autodesk-shot-grid.js +15 -8
  603. package/icons/tech/awk.js +34 -8
  604. package/icons/tech/azios.js +12 -8
  605. package/icons/tech/azure-devops.js +33 -8
  606. package/icons/tech/azure-sql-database.js +95 -8
  607. package/icons/tech/azure.js +55 -8
  608. package/icons/tech/babel.js +15 -8
  609. package/icons/tech/backbone-js.js +16 -8
  610. package/icons/tech/ballerina.js +12 -8
  611. package/icons/tech/bamboo.js +62 -8
  612. package/icons/tech/bash.js +22 -8
  613. package/icons/tech/behance.js +19 -8
  614. package/icons/tech/bitbucket.js +37 -8
  615. package/icons/tech/blender.js +21 -8
  616. package/icons/tech/bootstrap.js +78 -8
  617. package/icons/tech/bower.js +123 -8
  618. package/icons/tech/browserstack.js +77 -8
  619. package/icons/tech/bulma.js +6 -8
  620. package/icons/tech/bun.js +68 -8
  621. package/icons/tech/c.js +28 -8
  622. package/icons/tech/cairo-graphics.js +21 -8
  623. package/icons/tech/cake-php.js +12 -8
  624. package/icons/tech/canva.js +9 -8
  625. package/icons/tech/capacitor.js +25 -8
  626. package/icons/tech/cassandra.js +101 -8
  627. package/icons/tech/cent-os.js +22 -8
  628. package/icons/tech/chrome.js +156 -8
  629. package/icons/tech/circle-ci.js +12 -8
  630. package/icons/tech/clarity.js +35 -8
  631. package/icons/tech/clion.js +98 -8
  632. package/icons/tech/clojure-script.js +39 -8
  633. package/icons/tech/clojure.js +42 -8
  634. package/icons/tech/cloudflare-workers.js +196 -8
  635. package/icons/tech/cloudflare.js +22 -8
  636. package/icons/tech/cmake.js +11 -8
  637. package/icons/tech/code-igniter.js +12 -8
  638. package/icons/tech/code-pen.js +12 -8
  639. package/icons/tech/codeac.js +12 -8
  640. package/icons/tech/codecov.js +12 -8
  641. package/icons/tech/coffee-script.js +12 -8
  642. package/icons/tech/composer.js +59 -8
  643. package/icons/tech/confluence.js +57 -8
  644. package/icons/tech/consul.js +12 -8
  645. package/icons/tech/contao.js +15 -8
  646. package/icons/tech/corejs.js +6 -8
  647. package/icons/tech/cosmosdb.js +52 -8
  648. package/icons/tech/couchdb.js +12 -8
  649. package/icons/tech/cplusplus.js +35 -8
  650. package/icons/tech/crystal.js +12 -8
  651. package/icons/tech/csharp.js +28 -8
  652. package/icons/tech/css3.js +25 -8
  653. package/icons/tech/cucumber.js +12 -8
  654. package/icons/tech/cypress.js +34 -12
  655. package/icons/tech/d3js.js +145 -8
  656. package/icons/tech/dart.js +24 -8
  657. package/icons/tech/data-grip.js +109 -8
  658. package/icons/tech/data-spell.js +102 -8
  659. package/icons/tech/dbeaver.js +56 -8
  660. package/icons/tech/debian.js +12 -8
  661. package/icons/tech/deno.js +6 -8
  662. package/icons/tech/devicon.js +25 -8
  663. package/icons/tech/digital-ocean.js +9 -8
  664. package/icons/tech/discord-js.js +56 -8
  665. package/icons/tech/django-rest.js +35 -8
  666. package/icons/tech/django.js +9 -8
  667. package/icons/tech/docker.js +133 -8
  668. package/icons/tech/doctrine.js +21 -8
  669. package/icons/tech/dropwizard.js +70 -8
  670. package/icons/tech/drupal.js +56 -8
  671. package/icons/tech/eclipse-ceylon.js +44 -8
  672. package/icons/tech/eclipse-ide.js +93 -8
  673. package/icons/tech/eclipse-vert-x.js +29 -8
  674. package/icons/tech/elasticbeats.js +22 -8
  675. package/icons/tech/elasticsearch.js +28 -8
  676. package/icons/tech/electron.js +11 -8
  677. package/icons/tech/eleventy-11ty.js +15 -8
  678. package/icons/tech/elixir.js +211 -8
  679. package/icons/tech/elm.js +19 -8
  680. package/icons/tech/embedded-c.js +42 -8
  681. package/icons/tech/ember-js.js +16 -8
  682. package/icons/tech/envoy.js +28 -8
  683. package/icons/tech/erlang.js +12 -8
  684. package/icons/tech/eslint.js +21 -8
  685. package/icons/tech/express.js +6 -8
  686. package/icons/tech/facebook.js +15 -8
  687. package/icons/tech/fast-api.js +12 -8
  688. package/icons/tech/fastify.js +15 -8
  689. package/icons/tech/fauna.js +12 -8
  690. package/icons/tech/feathers.js +6 -8
  691. package/icons/tech/fedora.js +53 -8
  692. package/icons/tech/figma.js +24 -8
  693. package/icons/tech/file-zilla.js +18 -8
  694. package/icons/tech/firebase.js +12 -8
  695. package/icons/tech/firefox.js +1381 -8
  696. package/icons/tech/flask.js +12 -8
  697. package/icons/tech/flutter.js +16 -8
  698. package/icons/tech/fortran.js +15 -8
  699. package/icons/tech/foundation.js +240 -8
  700. package/icons/tech/fsharp.js +10 -8
  701. package/icons/tech/gatling.js +12 -8
  702. package/icons/tech/gatsby.js +12 -8
  703. package/icons/tech/gazebo.js +23 -8
  704. package/icons/tech/gcc.js +44 -8
  705. package/icons/tech/gentoo.js +14 -8
  706. package/icons/tech/ghost.js +27 -8
  707. package/icons/tech/gimp.js +370 -8
  708. package/icons/tech/git.js +12 -8
  709. package/icons/tech/gitbook.js +13 -8
  710. package/icons/tech/github-actions.js +21 -8
  711. package/icons/tech/github-codespaces.js +85 -8
  712. package/icons/tech/github.js +16 -8
  713. package/icons/tech/gitlab.js +35 -8
  714. package/icons/tech/gitpod.js +32 -8
  715. package/icons/tech/gitter.js +6 -8
  716. package/icons/tech/gnu-emacs.js +15 -8
  717. package/icons/tech/go-land.js +82 -8
  718. package/icons/tech/go.js +285 -8
  719. package/icons/tech/godot-engine.js +56 -8
  720. package/icons/tech/google-cloud.js +29 -8
  721. package/icons/tech/google.js +42 -8
  722. package/icons/tech/gradle.js +12 -8
  723. package/icons/tech/grafana.js +30 -8
  724. package/icons/tech/grails.js +21 -8
  725. package/icons/tech/graphql.js +15 -8
  726. package/icons/tech/groovy.js +715 -8
  727. package/icons/tech/grunt-js.js +260 -8
  728. package/icons/tech/gulp-js.js +14 -8
  729. package/icons/tech/hadoop.js +36 -8
  730. package/icons/tech/handlebars.js +9 -8
  731. package/icons/tech/hardhat.js +98 -8
  732. package/icons/tech/harvester.js +10 -8
  733. package/icons/tech/hashicorp-vault.js +12 -8
  734. package/icons/tech/haskell.js +10 -8
  735. package/icons/tech/haxe.js +17 -8
  736. package/icons/tech/helm.js +12 -8
  737. package/icons/tech/heroku.js +12 -8
  738. package/icons/tech/hibernate.js +15 -8
  739. package/icons/tech/homebrew.js +36 -8
  740. package/icons/tech/html5.js +23 -8
  741. package/icons/tech/hugo.js +22 -8
  742. package/icons/tech/ibm-spss-statistics.js +21 -8
  743. package/icons/tech/ie10.js +12 -8
  744. package/icons/tech/ifttt.js +6 -8
  745. package/icons/tech/influxdb.js +14 -8
  746. package/icons/tech/inkscape.js +534 -8
  747. package/icons/tech/insomnia.js +44 -8
  748. package/icons/tech/intellij-idea.js +92 -8
  749. package/icons/tech/ionic.js +9 -8
  750. package/icons/tech/jaeger.js +102 -8
  751. package/icons/tech/jamstack.js +12 -8
  752. package/icons/tech/jasmine.js +10 -8
  753. package/icons/tech/java.js +42 -8
  754. package/icons/tech/javascript.js +15 -8
  755. package/icons/tech/jeet.js +135 -8
  756. package/icons/tech/jekyll.js +187 -8
  757. package/icons/tech/jenkins.js +126 -8
  758. package/icons/tech/jest.js +12 -8
  759. package/icons/tech/jetbrains.js +118 -8
  760. package/icons/tech/jira-align.js +57 -8
  761. package/icons/tech/jira.js +62 -8
  762. package/icons/tech/jquery.js +12 -8
  763. package/icons/tech/json.js +57 -8
  764. package/icons/tech/jule.js +12 -8
  765. package/icons/tech/julia.js +49 -8
  766. package/icons/tech/junit.js +30 -8
  767. package/icons/tech/jupyter.js +35 -8
  768. package/icons/tech/k3os.js +6 -8
  769. package/icons/tech/k3s.js +12 -8
  770. package/icons/tech/kafka.js +12 -8
  771. package/icons/tech/kaggle.js +12 -8
  772. package/icons/tech/karate.js +15 -8
  773. package/icons/tech/karma.js +21 -8
  774. package/icons/tech/keras.js +15 -8
  775. package/icons/tech/kibana.js +10 -8
  776. package/icons/tech/knex-js.js +12 -8
  777. package/icons/tech/knockout.js +13 -8
  778. package/icons/tech/kotlin.js +25 -8
  779. package/icons/tech/krakenjs.js +14 -8
  780. package/icons/tech/ktor.js +48 -8
  781. package/icons/tech/kubernetes.js +10 -8
  782. package/icons/tech/labview.js +69 -44
  783. package/icons/tech/laravel.js +15 -8
  784. package/icons/tech/latex.js +12 -8
  785. package/icons/tech/less-js.js +14 -8
  786. package/icons/tech/linkedin.js +21 -8
  787. package/icons/tech/linux.js +5267 -8
  788. package/icons/tech/liquibase.js +12 -8
  789. package/icons/tech/livewire.js +79 -8
  790. package/icons/tech/llvm.js +36 -8
  791. package/icons/tech/logstash.js +10 -8
  792. package/icons/tech/lua.js +28 -8
  793. package/icons/tech/lumen.js +12 -8
  794. package/icons/tech/magento.js +12 -8
  795. package/icons/tech/markdown.js +44 -33
  796. package/icons/tech/material-ui.js +11 -8
  797. package/icons/tech/materialize.js +21 -8
  798. package/icons/tech/matlab.js +73 -8
  799. package/icons/tech/matplotlib.js +182 -8
  800. package/icons/tech/maven.js +620 -8
  801. package/icons/tech/meteor-js.js +12 -8
  802. package/icons/tech/microsoft-sql-server.js +6 -8
  803. package/icons/tech/minitab.js +45 -8
  804. package/icons/tech/mob-x.js +57 -8
  805. package/icons/tech/mocha.js +21 -8
  806. package/icons/tech/modx.js +11 -8
  807. package/icons/tech/moleculer.js +12 -8
  808. package/icons/tech/mongodb.js +135 -8
  809. package/icons/tech/mongoose-js.js +29 -8
  810. package/icons/tech/moodle.js +139 -8
  811. package/icons/tech/ms-dos.js +78 -8
  812. package/icons/tech/mysql.js +12 -8
  813. package/icons/tech/nano.js +12 -8
  814. package/icons/tech/nerog.js +136 -8
  815. package/icons/tech/nestjs.js +12 -8
  816. package/icons/tech/net-core.js +9 -8
  817. package/icons/tech/net.js +551 -8
  818. package/icons/tech/network-x.js +58 -8
  819. package/icons/tech/new4j.js +21 -8
  820. package/icons/tech/nextjs.js +6 -8
  821. package/icons/tech/nginx.js +12 -8
  822. package/icons/tech/nhibernate.js +21 -8
  823. package/icons/tech/nim.js +29 -8
  824. package/icons/tech/nimble.js +84 -8
  825. package/icons/tech/nix.js +25 -8
  826. package/icons/tech/nodejs.js +12 -8
  827. package/icons/tech/nodemon.js +21 -8
  828. package/icons/tech/nodewebkit.js +42 -8
  829. package/icons/tech/npm.js +12 -8
  830. package/icons/tech/nuget.js +12 -8
  831. package/icons/tech/num-py.js +29 -12
  832. package/icons/tech/nuxt-js.js +28 -8
  833. package/icons/tech/objective-c.js +9 -8
  834. package/icons/tech/ocaml.js +96 -8
  835. package/icons/tech/oh-my-zsh.js +38 -8
  836. package/icons/tech/okta.js +21 -8
  837. package/icons/tech/open-al.js +22 -8
  838. package/icons/tech/open-api.js +139 -8
  839. package/icons/tech/open-cl.js +42 -8
  840. package/icons/tech/open-cv.js +28 -8
  841. package/icons/tech/open-gl.js +35 -8
  842. package/icons/tech/open-stack.js +12 -8
  843. package/icons/tech/open-suse.js +15 -8
  844. package/icons/tech/open-telemetry.js +21 -8
  845. package/icons/tech/opera.js +32 -8
  846. package/icons/tech/oracle.js +12 -8
  847. package/icons/tech/p5js.js +12 -8
  848. package/icons/tech/packer.js +15 -8
  849. package/icons/tech/pandas.js +62 -18
  850. package/icons/tech/perl.js +21 -8
  851. package/icons/tech/pf-sense.js +6 -8
  852. package/icons/tech/phalcon.js +32 -8
  853. package/icons/tech/phoenix-framework.js +12 -8
  854. package/icons/tech/photon-engine.js +41 -8
  855. package/icons/tech/php-storm.js +93 -8
  856. package/icons/tech/php.js +62 -8
  857. package/icons/tech/playwrite.js +56 -8
  858. package/icons/tech/ploty.js +28 -8
  859. package/icons/tech/podman.js +150 -8
  860. package/icons/tech/polygon.js +15 -8
  861. package/icons/tech/portainer.js +12 -8
  862. package/icons/tech/postcss.js +28 -8
  863. package/icons/tech/postgresql.js +23 -8
  864. package/icons/tech/postman.js +28 -8
  865. package/icons/tech/powershell.js +79 -8
  866. package/icons/tech/processing.js +201 -22
  867. package/icons/tech/prometheus.js +12 -8
  868. package/icons/tech/protractor.js +12 -8
  869. package/icons/tech/purescript.js +16 -8
  870. package/icons/tech/putty.js +56 -8
  871. package/icons/tech/pycharm.js +81 -8
  872. package/icons/tech/pyscript.js +15 -8
  873. package/icons/tech/pytest.js +21 -8
  874. package/icons/tech/python-poetry.js +155 -16
  875. package/icons/tech/python.js +78 -8
  876. package/icons/tech/pytorch.js +15 -8
  877. package/icons/tech/qodana.js +52 -8
  878. package/icons/tech/qt.js +12 -8
  879. package/icons/tech/quarkus.js +23 -8
  880. package/icons/tech/quasar.js +15 -8
  881. package/icons/tech/qwik.js +37 -8
  882. package/icons/tech/r.js +57 -8
  883. package/icons/tech/rabbitmq.js +12 -8
  884. package/icons/tech/rancher.js +6 -8
  885. package/icons/tech/raspberrypi.js +28 -8
  886. package/icons/tech/reach.js +27 -8
  887. package/icons/tech/react-bootstrap.js +12 -8
  888. package/icons/tech/react.js +9 -8
  889. package/icons/tech/realm.js +63 -8
  890. package/icons/tech/red-cube-s-epic-compiler-thingy-programming-re-ct.js +17 -8
  891. package/icons/tech/redhat.js +22 -8
  892. package/icons/tech/redis.js +59 -8
  893. package/icons/tech/redux.js +12 -8
  894. package/icons/tech/ren-py.js +541 -8
  895. package/icons/tech/rider.js +32 -8
  896. package/icons/tech/robot-operating-system-ros.js +15 -8
  897. package/icons/tech/rocksdb.js +9 -8
  898. package/icons/tech/rollup-js.js +155 -8
  899. package/icons/tech/rspec.js +35 -8
  900. package/icons/tech/rstudio.js +30 -8
  901. package/icons/tech/ruby-mine.js +52 -8
  902. package/icons/tech/ruby-on-rails.js +14 -8
  903. package/icons/tech/ruby.js +353 -8
  904. package/icons/tech/rust.js +6 -8
  905. package/icons/tech/salesforce.js +28 -8
  906. package/icons/tech/sanity.js +22 -8
  907. package/icons/tech/sass.js +14 -8
  908. package/icons/tech/scala.js +21 -8
  909. package/icons/tech/scalingo.js +29 -8
  910. package/icons/tech/sdl.js +42 -8
  911. package/icons/tech/selenium.js +15 -8
  912. package/icons/tech/sema-software.js +15 -8
  913. package/icons/tech/sequelize.js +34 -8
  914. package/icons/tech/shopware.js +9 -8
  915. package/icons/tech/sketch.js +14 -8
  916. package/icons/tech/slack.js +35 -8
  917. package/icons/tech/socket-io.js +45 -33
  918. package/icons/tech/solid-js.js +121 -8
  919. package/icons/tech/solidity.js +13 -8
  920. package/icons/tech/sonarqube.js +12 -8
  921. package/icons/tech/sourcetree.js +12 -8
  922. package/icons/tech/spark.js +12 -8
  923. package/icons/tech/splunk.js +12 -8
  924. package/icons/tech/spring.js +12 -8
  925. package/icons/tech/sql-developer.js +43 -8
  926. package/icons/tech/sqlalchemy.js +21 -8
  927. package/icons/tech/sqlite.js +45 -8
  928. package/icons/tech/ssh.js +12 -8
  929. package/icons/tech/stackoverflow.js +15 -8
  930. package/icons/tech/stata.js +12 -8
  931. package/icons/tech/storybook.js +12 -8
  932. package/icons/tech/streamlit.js +31 -8
  933. package/icons/tech/stylus.js +9 -8
  934. package/icons/tech/subversion.js +12 -8
  935. package/icons/tech/svelte.js +23 -8
  936. package/icons/tech/swagger.js +21 -8
  937. package/icons/tech/swift.js +21 -8
  938. package/icons/tech/symfony.js +12 -8
  939. package/icons/tech/tailwind-css.js +12 -8
  940. package/icons/tech/tauri.js +35 -8
  941. package/icons/tech/tensorflow.js +12 -8
  942. package/icons/tech/terraform.js +16 -8
  943. package/icons/tech/tex.js +6 -8
  944. package/icons/tech/the-algorithms.js +12 -8
  945. package/icons/tech/three-js.js +139 -108
  946. package/icons/tech/titanium-sdk.js +12 -8
  947. package/icons/tech/tomcat.js +26 -8
  948. package/icons/tech/tortoise-git.js +37 -8
  949. package/icons/tech/tower.js +357 -8
  950. package/icons/tech/traefik-mesh.js +12 -8
  951. package/icons/tech/traefik-proxy.js +12 -8
  952. package/icons/tech/travis-ci.js +12 -8
  953. package/icons/tech/trello.js +12 -8
  954. package/icons/tech/twitter.js +12 -8
  955. package/icons/tech/typescript.js +16 -8
  956. package/icons/tech/typo3.js +12 -8
  957. package/icons/tech/ubuntu.js +12 -8
  958. package/icons/tech/uml.js +29 -8
  959. package/icons/tech/unity.js +22 -8
  960. package/icons/tech/unix.js +12 -8
  961. package/icons/tech/unreal-engine.js +9 -8
  962. package/icons/tech/uwsgi.js +38 -8
  963. package/icons/tech/v8.js +109 -8
  964. package/icons/tech/vagrant.js +21 -8
  965. package/icons/tech/vala.js +57 -8
  966. package/icons/tech/vercel.js +6 -8
  967. package/icons/tech/veutify.js +11 -8
  968. package/icons/tech/vim.js +82 -8
  969. package/icons/tech/visualstudio.js +12 -8
  970. package/icons/tech/vite.js +6 -8
  971. package/icons/tech/vitejs.js +56 -8
  972. package/icons/tech/vscode.js +114 -12
  973. package/icons/tech/vsphere.js +25 -8
  974. package/icons/tech/vue-storefront.js +22 -8
  975. package/icons/tech/vue.js +16 -8
  976. package/icons/tech/vyper.js +17 -8
  977. package/icons/tech/webassembly.js +12 -8
  978. package/icons/tech/webflow.js +12 -8
  979. package/icons/tech/weblate.js +80 -8
  980. package/icons/tech/webpack.js +21 -8
  981. package/icons/tech/webstorm.js +80 -8
  982. package/icons/tech/windows11.js +12 -8
  983. package/icons/tech/windows8.js +12 -8
  984. package/icons/tech/woo-commerce.js +22 -8
  985. package/icons/tech/wordpress.js +70 -8
  986. package/icons/tech/xamarin.js +12 -8
  987. package/icons/tech/xcode.js +575 -8
  988. package/icons/tech/xml.js +51 -8
  989. package/icons/tech/yaml.js +16 -8
  990. package/icons/tech/yarn.js +9 -8
  991. package/icons/tech/yii-framework.js +35 -8
  992. package/icons/tech/yuno-host.js +15 -8
  993. package/icons/tech/zend-framework.js +14 -8
  994. package/icons/tech/zig.js +28 -8
  995. package/package.json +35 -26
  996. package/react/LikeC4Browser.d.ts +1 -1
  997. package/react/LikeC4ViewElement.d.ts +4 -2
  998. package/react/index.d.ts +1 -0
  999. package/react/index.mjs +1452 -1312
  1000. package/react/styles.d.ts +2 -2
  1001. package/react/types.d.ts +4 -2
  1002. package/dist/__app__/react/components.mjs +0 -25397
  1003. /package/dist/__app__/src/{-view-lazy-data-WZmbIsHq.js → routes/-view-lazy-data.js} +0 -0
@@ -0,0 +1,2484 @@
1
+ import * as React from "react";
2
+ import React__default from "react";
3
+ import { flushSync } from "react-dom";
4
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
5
+ const pushStateEvent = "pushstate", popStateEvent = "popstate", beforeUnloadEvent = "beforeunload", beforeUnloadListener = (event) => (event.preventDefault(),
6
+ event.returnValue = ""), stopBlocking = () => {
7
+ removeEventListener(beforeUnloadEvent, beforeUnloadListener, {
8
+ capture: !0
9
+ });
10
+ };
11
+ function createHistory(opts) {
12
+ let location = opts.getLocation();
13
+ const subscribers = /* @__PURE__ */ new Set();
14
+ let blockers = [];
15
+ const notify = () => {
16
+ location = opts.getLocation(), subscribers.forEach((subscriber) => subscriber());
17
+ }, tryNavigation = async (task, navigateOpts) => {
18
+ var _a;
19
+ if (!(navigateOpts?.ignoreBlocker ?? !1) && typeof document < "u" && blockers.length) {
20
+ for (const blocker of blockers)
21
+ if (!await blocker()) {
22
+ (_a = opts.onBlocked) == null || _a.call(opts, notify);
23
+ return;
24
+ }
25
+ }
26
+ task();
27
+ };
28
+ return {
29
+ get location() {
30
+ return location;
31
+ },
32
+ subscribers,
33
+ subscribe: (cb) => (subscribers.add(cb), () => {
34
+ subscribers.delete(cb);
35
+ }),
36
+ push: (path, state, navigateOpts) => {
37
+ state = assignKey(state), tryNavigation(() => {
38
+ opts.pushState(path, state), notify();
39
+ }, navigateOpts);
40
+ },
41
+ replace: (path, state, navigateOpts) => {
42
+ state = assignKey(state), tryNavigation(() => {
43
+ opts.replaceState(path, state), notify();
44
+ }, navigateOpts);
45
+ },
46
+ go: (index, navigateOpts) => {
47
+ tryNavigation(() => {
48
+ opts.go(index), notify();
49
+ }, navigateOpts);
50
+ },
51
+ back: (navigateOpts) => {
52
+ tryNavigation(() => {
53
+ opts.back(), notify();
54
+ }, navigateOpts);
55
+ },
56
+ forward: (navigateOpts) => {
57
+ tryNavigation(() => {
58
+ opts.forward(), notify();
59
+ }, navigateOpts);
60
+ },
61
+ createHref: (str) => opts.createHref(str),
62
+ block: (blocker) => (blockers.push(blocker), blockers.length === 1 && addEventListener(beforeUnloadEvent, beforeUnloadListener, {
63
+ capture: !0
64
+ }), () => {
65
+ blockers = blockers.filter((b) => b !== blocker), blockers.length || stopBlocking();
66
+ }),
67
+ flush: () => {
68
+ var _a;
69
+ return (_a = opts.flush) == null ? void 0 : _a.call(opts);
70
+ },
71
+ destroy: () => {
72
+ var _a;
73
+ return (_a = opts.destroy) == null ? void 0 : _a.call(opts);
74
+ },
75
+ notify
76
+ };
77
+ }
78
+ function assignKey(state) {
79
+ return state || (state = {}), {
80
+ ...state,
81
+ key: createRandomKey()
82
+ };
83
+ }
84
+ function createBrowserHistory(opts) {
85
+ const win = opts?.window ?? (typeof document < "u" ? window : void 0), originalPushState = win.history.pushState, originalReplaceState = win.history.
86
+ replaceState, createHref = opts?.createHref ?? ((path) => path), parseLocation = opts?.parseLocation ?? (() => parseHref(
87
+ `${win.location.pathname}${win.location.search}${win.location.hash}`,
88
+ win.history.state
89
+ ));
90
+ let currentLocation = parseLocation(), rollbackLocation;
91
+ const getLocation = () => currentLocation;
92
+ let next, scheduled;
93
+ const flush = () => {
94
+ if (!next)
95
+ return;
96
+ (next.isPush ? originalPushState : originalReplaceState).call(win.history, next.state, "", next.href), next = void 0, scheduled = void 0, rollbackLocation =
97
+ void 0;
98
+ }, queueHistoryAction = (type, destHref, state) => {
99
+ const href = createHref(destHref);
100
+ scheduled || (rollbackLocation = currentLocation), currentLocation = parseHref(destHref, state), next = {
101
+ href,
102
+ state,
103
+ isPush: next?.isPush || type === "push"
104
+ }, scheduled || (scheduled = Promise.resolve().then(() => flush()));
105
+ }, onPushPop = () => {
106
+ currentLocation = parseLocation(), history.notify();
107
+ }, history = createHistory({
108
+ getLocation,
109
+ pushState: (href, state) => queueHistoryAction("push", href, state),
110
+ replaceState: (href, state) => queueHistoryAction("replace", href, state),
111
+ back: () => win.history.back(),
112
+ forward: () => win.history.forward(),
113
+ go: (n2) => win.history.go(n2),
114
+ createHref: (href) => createHref(href),
115
+ flush,
116
+ destroy: () => {
117
+ win.history.pushState = originalPushState, win.history.replaceState = originalReplaceState, win.removeEventListener(pushStateEvent, onPushPop), win.
118
+ removeEventListener(popStateEvent, onPushPop);
119
+ },
120
+ onBlocked: (onUpdate) => {
121
+ rollbackLocation && currentLocation !== rollbackLocation && (currentLocation = rollbackLocation, onUpdate());
122
+ }
123
+ });
124
+ return win.addEventListener(pushStateEvent, onPushPop), win.addEventListener(popStateEvent, onPushPop), win.history.pushState = function(...args) {
125
+ const res = originalPushState.apply(win.history, args);
126
+ return onPushPop(), res;
127
+ }, win.history.replaceState = function(...args) {
128
+ const res = originalReplaceState.apply(win.history, args);
129
+ return onPushPop(), res;
130
+ }, history;
131
+ }
132
+ function createHashHistory(opts) {
133
+ const win = typeof document < "u" ? window : void 0;
134
+ return createBrowserHistory({
135
+ window: win,
136
+ parseLocation: () => {
137
+ const hashHref = win.location.hash.split("#").slice(1).join("#") ?? "/";
138
+ return parseHref(hashHref, win.history.state);
139
+ },
140
+ createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`
141
+ });
142
+ }
143
+ function createMemoryHistory(opts = {
144
+ initialEntries: ["/"]
145
+ }) {
146
+ const entries = opts.initialEntries;
147
+ let index = opts.initialIndex ?? entries.length - 1, currentState = {
148
+ key: createRandomKey()
149
+ };
150
+ return createHistory({
151
+ getLocation: () => parseHref(entries[index], currentState),
152
+ pushState: (path, state) => {
153
+ currentState = state, index < entries.length - 1 && entries.splice(index + 1), entries.push(path), index = Math.max(entries.length - 1, 0);
154
+ },
155
+ replaceState: (path, state) => {
156
+ currentState = state, entries[index] = path;
157
+ },
158
+ back: () => {
159
+ currentState = assignKey(currentState), index = Math.max(index - 1, 0);
160
+ },
161
+ forward: () => {
162
+ currentState = assignKey(currentState), index = Math.min(index + 1, entries.length - 1);
163
+ },
164
+ go: (n2) => {
165
+ currentState = assignKey(currentState), index = Math.min(Math.max(index + n2, 0), entries.length - 1);
166
+ },
167
+ createHref: (path) => path
168
+ });
169
+ }
170
+ function parseHref(href, state) {
171
+ const hashIndex = href.indexOf("#"), searchIndex = href.indexOf("?");
172
+ return {
173
+ href,
174
+ pathname: href.substring(
175
+ 0,
176
+ hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length
177
+ ),
178
+ hash: hashIndex > -1 ? href.substring(hashIndex) : "",
179
+ search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
180
+ state: state || {}
181
+ };
182
+ }
183
+ function createRandomKey() {
184
+ return (Math.random() + 1).toString(36).substring(7);
185
+ }
186
+ var prefix = "Invariant failed";
187
+ function invariant(condition, message) {
188
+ if (!condition)
189
+ throw new Error(prefix);
190
+ }
191
+ const routerContext = React.createContext(null);
192
+ function getRouterContext() {
193
+ return typeof document > "u" ? routerContext : window.__TSR_ROUTER_CONTEXT__ ? window.__TSR_ROUTER_CONTEXT__ : (window.__TSR_ROUTER_CONTEXT__ = routerContext,
194
+ routerContext);
195
+ }
196
+ function useRouter(opts) {
197
+ return React.useContext(getRouterContext());
198
+ }
199
+ var withSelector = { exports: {} }, withSelector_production_min = {}, shim = { exports: {} }, useSyncExternalStoreShim_production_min = {};
200
+ /**
201
+ * @license React
202
+ * use-sync-external-store-shim.production.min.js
203
+ *
204
+ * Copyright (c) Facebook, Inc. and its affiliates.
205
+ *
206
+ * This source code is licensed under the MIT license found in the
207
+ * LICENSE file in the root directory of this source tree.
208
+ */
209
+ var e = React__default;
210
+ function h$1(a, b) {
211
+ return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
212
+ }
213
+ var k = typeof Object.is == "function" ? Object.is : h$1, l = e.useState, m = e.useEffect, n$1 = e.useLayoutEffect, p$1 = e.useDebugValue;
214
+ function q$1(a, b) {
215
+ var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
216
+ return n$1(function() {
217
+ c.value = d, c.getSnapshot = b, r$1(c) && g({ inst: c });
218
+ }, [a, d, b]), m(function() {
219
+ return r$1(c) && g({ inst: c }), a(function() {
220
+ r$1(c) && g({ inst: c });
221
+ });
222
+ }, [a]), p$1(d), d;
223
+ }
224
+ function r$1(a) {
225
+ var b = a.getSnapshot;
226
+ a = a.value;
227
+ try {
228
+ var d = b();
229
+ return !k(a, d);
230
+ } catch {
231
+ return !0;
232
+ }
233
+ }
234
+ function t$1(a, b) {
235
+ return b();
236
+ }
237
+ var u$1 = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t$1 : q$1;
238
+ useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$1;
239
+ shim.exports = useSyncExternalStoreShim_production_min;
240
+ var shimExports = shim.exports;
241
+ /**
242
+ * @license React
243
+ * use-sync-external-store-shim/with-selector.production.min.js
244
+ *
245
+ * Copyright (c) Facebook, Inc. and its affiliates.
246
+ *
247
+ * This source code is licensed under the MIT license found in the
248
+ * LICENSE file in the root directory of this source tree.
249
+ */
250
+ var h = React__default, n = shimExports;
251
+ function p(a, b) {
252
+ return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
253
+ }
254
+ var q = typeof Object.is == "function" ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
255
+ withSelector_production_min.useSyncExternalStoreWithSelector = function(a, b, e2, l2, g) {
256
+ var c = t(null);
257
+ if (c.current === null) {
258
+ var f = { hasValue: !1, value: null };
259
+ c.current = f;
260
+ } else f = c.current;
261
+ c = v(function() {
262
+ function a2(a3) {
263
+ if (!c2) {
264
+ if (c2 = !0, d2 = a3, a3 = l2(a3), g !== void 0 && f.hasValue) {
265
+ var b2 = f.value;
266
+ if (g(b2, a3)) return k2 = b2;
267
+ }
268
+ return k2 = a3;
269
+ }
270
+ if (b2 = k2, q(d2, a3)) return b2;
271
+ var e3 = l2(a3);
272
+ return g !== void 0 && g(b2, e3) ? b2 : (d2 = a3, k2 = e3);
273
+ }
274
+ var c2 = !1, d2, k2, m2 = e2 === void 0 ? null : e2;
275
+ return [function() {
276
+ return a2(b());
277
+ }, m2 === null ? void 0 : function() {
278
+ return a2(m2());
279
+ }];
280
+ }, [b, e2, l2, g]);
281
+ var d = r(a, c[0], c[1]);
282
+ return u(function() {
283
+ f.hasValue = !0, f.value = d;
284
+ }, [d]), w(d), d;
285
+ };
286
+ withSelector.exports = withSelector_production_min;
287
+ var withSelectorExports = withSelector.exports;
288
+ class Store {
289
+ constructor(initialState, options) {
290
+ this.listeners = /* @__PURE__ */ new Set(), this._batching = !1, this._flushing = 0, this.subscribe = (listener) => {
291
+ var _a, _b;
292
+ this.listeners.add(listener);
293
+ const unsub = (_b = (_a = this.options) == null ? void 0 : _a.onSubscribe) == null ? void 0 : _b.call(_a, listener, this);
294
+ return () => {
295
+ this.listeners.delete(listener), unsub?.();
296
+ };
297
+ }, this.setState = (updater) => {
298
+ var _a, _b, _c;
299
+ const previous = this.state;
300
+ this.state = (_a = this.options) != null && _a.updateFn ? this.options.updateFn(previous)(updater) : updater(previous), (_c = (_b = this.options) ==
301
+ null ? void 0 : _b.onUpdate) == null || _c.call(_b), this._flush();
302
+ }, this._flush = () => {
303
+ if (this._batching) return;
304
+ const flushId = ++this._flushing;
305
+ this.listeners.forEach((listener) => {
306
+ this._flushing === flushId && listener();
307
+ });
308
+ }, this.batch = (cb) => {
309
+ if (this._batching) return cb();
310
+ this._batching = !0, cb(), this._batching = !1, this._flush();
311
+ }, this.state = initialState, this.options = options;
312
+ }
313
+ }
314
+ function useStore(store, selector = (d) => d) {
315
+ return withSelectorExports.useSyncExternalStoreWithSelector(
316
+ store.subscribe,
317
+ () => store.state,
318
+ () => store.state,
319
+ selector,
320
+ shallow
321
+ );
322
+ }
323
+ function shallow(objA, objB) {
324
+ if (Object.is(objA, objB))
325
+ return !0;
326
+ if (typeof objA != "object" || objA === null || typeof objB != "object" || objB === null)
327
+ return !1;
328
+ const keysA = Object.keys(objA);
329
+ if (keysA.length !== Object.keys(objB).length)
330
+ return !1;
331
+ for (let i = 0; i < keysA.length; i++)
332
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]]))
333
+ return !1;
334
+ return !0;
335
+ }
336
+ const rootRouteId = "__root__";
337
+ function encode(obj, pfx) {
338
+ let k2, i, tmp, str = "";
339
+ for (k2 in obj)
340
+ if ((tmp = obj[k2]) !== void 0)
341
+ if (Array.isArray(tmp))
342
+ for (i = 0; i < tmp.length; i++)
343
+ str && (str += "&"), str += encodeURIComponent(k2) + "=" + encodeURIComponent(tmp[i]);
344
+ else
345
+ str && (str += "&"), str += encodeURIComponent(k2) + "=" + encodeURIComponent(tmp);
346
+ return "" + str;
347
+ }
348
+ function toValue(mix) {
349
+ if (!mix) return "";
350
+ const str = decodeURIComponent(mix);
351
+ return str === "false" ? !1 : str === "true" ? !0 : +str * 0 === 0 && +str + "" === str ? +str : str;
352
+ }
353
+ function decode(str, pfx) {
354
+ let tmp, k2;
355
+ const out = {}, arr = str.split("&");
356
+ for (; tmp = arr.shift(); ) {
357
+ const equalIndex = tmp.indexOf("=");
358
+ if (equalIndex !== -1) {
359
+ k2 = tmp.slice(0, equalIndex);
360
+ const value = tmp.slice(equalIndex + 1);
361
+ out[k2] !== void 0 ? out[k2] = [].concat(out[k2], toValue(value)) : out[k2] = toValue(value);
362
+ } else
363
+ k2 = tmp, out[k2] = "";
364
+ }
365
+ return out;
366
+ }
367
+ const defaultParseSearch = parseSearchWith(JSON.parse), defaultStringifySearch = stringifySearchWith(
368
+ JSON.stringify,
369
+ JSON.parse
370
+ );
371
+ function parseSearchWith(parser) {
372
+ return (searchStr) => {
373
+ searchStr.substring(0, 1) === "?" && (searchStr = searchStr.substring(1));
374
+ const query = decode(searchStr);
375
+ for (const key in query) {
376
+ const value = query[key];
377
+ if (typeof value == "string")
378
+ try {
379
+ query[key] = parser(value);
380
+ } catch {
381
+ }
382
+ }
383
+ return query;
384
+ };
385
+ }
386
+ function stringifySearchWith(stringify, parser) {
387
+ function stringifyValue(val) {
388
+ if (typeof val == "object" && val !== null)
389
+ try {
390
+ return stringify(val);
391
+ } catch {
392
+ }
393
+ else if (typeof val == "string" && typeof parser == "function")
394
+ try {
395
+ return parser(val), stringify(val);
396
+ } catch {
397
+ }
398
+ return val;
399
+ }
400
+ return (search) => {
401
+ search = { ...search }, Object.keys(search).forEach((key) => {
402
+ const val = search[key];
403
+ typeof val > "u" || val === void 0 ? delete search[key] : search[key] = stringifyValue(val);
404
+ });
405
+ const searchStr = encode(search).toString();
406
+ return searchStr ? `?${searchStr}` : "";
407
+ };
408
+ }
409
+ function last(arr) {
410
+ return arr[arr.length - 1];
411
+ }
412
+ function isFunction(d) {
413
+ return typeof d == "function";
414
+ }
415
+ function functionalUpdate(updater, previous) {
416
+ return isFunction(updater) ? updater(previous) : updater;
417
+ }
418
+ function pick(parent, keys) {
419
+ return keys.reduce((obj, key) => (obj[key] = parent[key], obj), {});
420
+ }
421
+ function replaceEqualDeep(prev, _next) {
422
+ if (prev === _next)
423
+ return prev;
424
+ const next = _next, array = isPlainArray(prev) && isPlainArray(next);
425
+ if (array || isPlainObject(prev) && isPlainObject(next)) {
426
+ const prevItems = array ? prev : Object.keys(prev), prevSize = prevItems.length, nextItems = array ? next : Object.keys(next), nextSize = nextItems.
427
+ length, copy = array ? [] : {};
428
+ let equalItems = 0;
429
+ for (let i = 0; i < nextSize; i++) {
430
+ const key = array ? i : nextItems[i];
431
+ (!array && prevItems.includes(key) || array) && prev[key] === void 0 && next[key] === void 0 ? (copy[key] = void 0, equalItems++) : (copy[key] =
432
+ replaceEqualDeep(prev[key], next[key]), copy[key] === prev[key] && prev[key] !== void 0 && equalItems++);
433
+ }
434
+ return prevSize === nextSize && equalItems === prevSize ? prev : copy;
435
+ }
436
+ return next;
437
+ }
438
+ function isPlainObject(o) {
439
+ if (!hasObjectPrototype(o))
440
+ return !1;
441
+ const ctor = o.constructor;
442
+ if (typeof ctor > "u")
443
+ return !0;
444
+ const prot = ctor.prototype;
445
+ return !(!hasObjectPrototype(prot) || !prot.hasOwnProperty("isPrototypeOf"));
446
+ }
447
+ function hasObjectPrototype(o) {
448
+ return Object.prototype.toString.call(o) === "[object Object]";
449
+ }
450
+ function isPlainArray(value) {
451
+ return Array.isArray(value) && value.length === Object.keys(value).length;
452
+ }
453
+ function deepEqual(a, b, partial = !1) {
454
+ if (a === b)
455
+ return !0;
456
+ if (typeof a != typeof b)
457
+ return !1;
458
+ if (isPlainObject(a) && isPlainObject(b)) {
459
+ const aKeys = Object.keys(a).filter((key) => a[key] !== void 0), bKeys = Object.keys(b).filter((key) => b[key] !== void 0);
460
+ return !partial && aKeys.length !== bKeys.length ? !1 : !bKeys.some(
461
+ (key) => !(key in a) || !deepEqual(a[key], b[key], partial)
462
+ );
463
+ }
464
+ return Array.isArray(a) && Array.isArray(b) ? a.length !== b.length ? !1 : !a.some((item, index) => !deepEqual(item, b[index], partial)) : !1;
465
+ }
466
+ const useLayoutEffect$1 = typeof window < "u" ? React.useLayoutEffect : React.useEffect;
467
+ function createControlledPromise(onResolve) {
468
+ let resolveLoadPromise, rejectLoadPromise;
469
+ const controlledPromise = new Promise((resolve, reject) => {
470
+ resolveLoadPromise = resolve, rejectLoadPromise = reject;
471
+ });
472
+ return controlledPromise.status = "pending", controlledPromise.resolve = (value) => {
473
+ controlledPromise.status = "resolved", controlledPromise.value = value, resolveLoadPromise(value), onResolve?.(value);
474
+ }, controlledPromise.reject = (e2) => {
475
+ controlledPromise.status = "rejected", rejectLoadPromise(e2);
476
+ }, controlledPromise;
477
+ }
478
+ function usePrevious(value) {
479
+ const ref = React.useRef({
480
+ value,
481
+ prev: null
482
+ }), current = ref.current.value;
483
+ return value !== current && (ref.current = {
484
+ value,
485
+ prev: current
486
+ }), ref.current.prev;
487
+ }
488
+ function joinPaths(paths) {
489
+ return cleanPath(
490
+ paths.filter((val) => val !== void 0).join("/")
491
+ );
492
+ }
493
+ function cleanPath(path) {
494
+ return path.replace(/\/{2,}/g, "/");
495
+ }
496
+ function trimPathLeft(path) {
497
+ return path === "/" ? path : path.replace(/^\/{1,}/, "");
498
+ }
499
+ function trimPathRight(path) {
500
+ return path === "/" ? path : path.replace(/\/{1,}$/, "");
501
+ }
502
+ function trimPath(path) {
503
+ return trimPathRight(trimPathLeft(path));
504
+ }
505
+ function removeTrailingSlash(value, basepath) {
506
+ return value.endsWith("/") && value !== "/" && value !== `${basepath}/` ? value.slice(0, -1) : value;
507
+ }
508
+ function exactPathTest(pathName1, pathName2, basepath) {
509
+ return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);
510
+ }
511
+ function resolvePath({
512
+ basepath,
513
+ base,
514
+ to,
515
+ trailingSlash = "never"
516
+ }) {
517
+ var _a, _b;
518
+ base = removeBasepath(basepath, base), to = removeBasepath(basepath, to);
519
+ let baseSegments = parsePathname(base);
520
+ const toSegments = parsePathname(to);
521
+ baseSegments.length > 1 && ((_a = last(baseSegments)) == null ? void 0 : _a.value) === "/" && baseSegments.pop(), toSegments.forEach((toSegment, index) => {
522
+ toSegment.value === "/" ? index ? index === toSegments.length - 1 && baseSegments.push(toSegment) : baseSegments = [toSegment] : toSegment.value ===
523
+ ".." ? baseSegments.pop() : toSegment.value === "." || baseSegments.push(toSegment);
524
+ }), baseSegments.length > 1 && (((_b = last(baseSegments)) == null ? void 0 : _b.value) === "/" ? trailingSlash === "never" && baseSegments.pop() : trailingSlash ===
525
+ "always" && baseSegments.push({ type: "pathname", value: "/" }));
526
+ const joined = joinPaths([basepath, ...baseSegments.map((d) => d.value)]);
527
+ return cleanPath(joined);
528
+ }
529
+ function parsePathname(pathname) {
530
+ if (!pathname)
531
+ return [];
532
+ pathname = cleanPath(pathname);
533
+ const segments = [];
534
+ if (pathname.slice(0, 1) === "/" && (pathname = pathname.substring(1), segments.push({
535
+ type: "pathname",
536
+ value: "/"
537
+ })), !pathname)
538
+ return segments;
539
+ const split = pathname.split("/").filter(Boolean);
540
+ return segments.push(
541
+ ...split.map((part) => part === "$" || part === "*" ? {
542
+ type: "wildcard",
543
+ value: part
544
+ } : part.charAt(0) === "$" ? {
545
+ type: "param",
546
+ value: part
547
+ } : {
548
+ type: "pathname",
549
+ value: decodeURIComponent(part)
550
+ })
551
+ ), pathname.slice(-1) === "/" && (pathname = pathname.substring(1), segments.push({
552
+ type: "pathname",
553
+ value: "/"
554
+ })), segments;
555
+ }
556
+ function interpolatePath({
557
+ path,
558
+ params,
559
+ leaveWildcards,
560
+ leaveParams
561
+ }) {
562
+ const interpolatedPathSegments = parsePathname(path), encodedParams = {};
563
+ for (const [key, value] of Object.entries(params)) {
564
+ const isValueString = typeof value == "string";
565
+ ["*", "_splat"].includes(key) ? encodedParams[key] = isValueString ? encodeURI(value) : value : encodedParams[key] = isValueString ? encodeURIComponent(
566
+ value) : value;
567
+ }
568
+ return joinPaths(
569
+ interpolatedPathSegments.map((segment) => {
570
+ if (segment.type === "wildcard") {
571
+ const value = encodedParams._splat;
572
+ return leaveWildcards ? `${segment.value}${value ?? ""}` : value;
573
+ }
574
+ if (segment.type === "param") {
575
+ if (leaveParams) {
576
+ const value = encodedParams[segment.value];
577
+ return `${segment.value}${value ?? ""}`;
578
+ }
579
+ return encodedParams[segment.value.substring(1)] ?? "undefined";
580
+ }
581
+ return segment.value;
582
+ })
583
+ );
584
+ }
585
+ function matchPathname(basepath, currentPathname, matchLocation) {
586
+ const pathParams = matchByPath(basepath, currentPathname, matchLocation);
587
+ if (!(matchLocation.to && !pathParams))
588
+ return pathParams ?? {};
589
+ }
590
+ function removeBasepath(basepath, pathname) {
591
+ switch (!0) {
592
+ case basepath === "/":
593
+ return pathname;
594
+ case pathname === basepath:
595
+ return "";
596
+ case pathname.length < basepath.length:
597
+ return pathname;
598
+ case pathname[basepath.length] !== "/":
599
+ return pathname;
600
+ case pathname.startsWith(basepath):
601
+ return pathname.slice(basepath.length);
602
+ default:
603
+ return pathname;
604
+ }
605
+ }
606
+ function matchByPath(basepath, from, matchLocation) {
607
+ from = removeBasepath(basepath, from);
608
+ const to = removeBasepath(basepath, `${matchLocation.to ?? "$"}`), baseSegments = parsePathname(from), routeSegments = parsePathname(to);
609
+ from.startsWith("/") || baseSegments.unshift({
610
+ type: "pathname",
611
+ value: "/"
612
+ }), to.startsWith("/") || routeSegments.unshift({
613
+ type: "pathname",
614
+ value: "/"
615
+ });
616
+ const params = {};
617
+ return (() => {
618
+ for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) {
619
+ const baseSegment = baseSegments[i], routeSegment = routeSegments[i], isLastBaseSegment = i >= baseSegments.length - 1, isLastRouteSegment = i >=
620
+ routeSegments.length - 1;
621
+ if (routeSegment) {
622
+ if (routeSegment.type === "wildcard") {
623
+ if (baseSegment?.value) {
624
+ const _splat = decodeURI(
625
+ joinPaths(baseSegments.slice(i).map((d) => d.value))
626
+ );
627
+ return params["*"] = _splat, params._splat = _splat, !0;
628
+ }
629
+ return !1;
630
+ }
631
+ if (routeSegment.type === "pathname") {
632
+ if (routeSegment.value === "/" && !baseSegment?.value)
633
+ return !0;
634
+ if (baseSegment) {
635
+ if (matchLocation.caseSensitive) {
636
+ if (routeSegment.value !== baseSegment.value)
637
+ return !1;
638
+ } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase())
639
+ return !1;
640
+ }
641
+ }
642
+ if (!baseSegment)
643
+ return !1;
644
+ if (routeSegment.type === "param") {
645
+ if (baseSegment.value === "/")
646
+ return !1;
647
+ baseSegment.value.charAt(0) !== "$" && (params[routeSegment.value.substring(1)] = decodeURIComponent(
648
+ baseSegment.value
649
+ ));
650
+ }
651
+ }
652
+ if (!isLastBaseSegment && isLastRouteSegment)
653
+ return params["**"] = joinPaths(baseSegments.slice(i + 1).map((d) => d.value)), !!matchLocation.fuzzy && routeSegment?.value !== "/";
654
+ }
655
+ return !0;
656
+ })() ? params : void 0;
657
+ }
658
+ function isRedirect(obj) {
659
+ return !!obj?.isRedirect;
660
+ }
661
+ function isResolvedRedirect(obj) {
662
+ return !!obj?.isRedirect && obj.href;
663
+ }
664
+ function CatchBoundary(props) {
665
+ const errorComponent = props.errorComponent ?? ErrorComponent;
666
+ return /* @__PURE__ */ jsx(
667
+ CatchBoundaryImpl,
668
+ {
669
+ getResetKey: props.getResetKey,
670
+ onCatch: props.onCatch,
671
+ children: ({ error, reset }) => error ? React.createElement(errorComponent, {
672
+ error,
673
+ reset
674
+ }) : props.children
675
+ }
676
+ );
677
+ }
678
+ class CatchBoundaryImpl extends React.Component {
679
+ constructor() {
680
+ super(...arguments), this.state = { error: null };
681
+ }
682
+ static getDerivedStateFromProps(props) {
683
+ return { resetKey: props.getResetKey() };
684
+ }
685
+ static getDerivedStateFromError(error) {
686
+ return { error };
687
+ }
688
+ reset() {
689
+ this.setState({ error: null });
690
+ }
691
+ componentDidUpdate(prevProps, prevState) {
692
+ prevState.error && prevState.resetKey !== this.state.resetKey && this.reset();
693
+ }
694
+ componentDidCatch(error, errorInfo) {
695
+ this.props.onCatch && this.props.onCatch(error, errorInfo);
696
+ }
697
+ render() {
698
+ return this.props.children({
699
+ error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error,
700
+ reset: () => {
701
+ this.reset();
702
+ }
703
+ });
704
+ }
705
+ }
706
+ function ErrorComponent({ error }) {
707
+ const [show, setShow] = React.useState(!1);
708
+ return /* @__PURE__ */ jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [
709
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [
710
+ /* @__PURE__ */ jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }),
711
+ /* @__PURE__ */ jsx(
712
+ "button",
713
+ {
714
+ style: {
715
+ appearance: "none",
716
+ fontSize: ".6em",
717
+ border: "1px solid currentColor",
718
+ padding: ".1rem .2rem",
719
+ fontWeight: "bold",
720
+ borderRadius: ".25rem"
721
+ },
722
+ onClick: () => setShow((d) => !d),
723
+ children: show ? "Hide Error" : "Show Error"
724
+ }
725
+ )
726
+ ] }),
727
+ /* @__PURE__ */ jsx("div", { style: { height: ".25rem" } }),
728
+ show ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
729
+ "pre",
730
+ {
731
+ style: {
732
+ fontSize: ".7em",
733
+ border: "1px solid red",
734
+ borderRadius: ".25rem",
735
+ padding: ".3rem",
736
+ color: "red",
737
+ overflow: "auto"
738
+ },
739
+ children: error.message ? /* @__PURE__ */ jsx("code", { children: error.message }) : null
740
+ }
741
+ ) }) : null
742
+ ] });
743
+ }
744
+ function useRouterState(opts) {
745
+ const contextRouter = useRouter();
746
+ return useStore((opts?.router || contextRouter).__store, opts?.select);
747
+ }
748
+ function notFound(options = {}) {
749
+ if (options.isNotFound = !0, options.throw) throw options;
750
+ return options;
751
+ }
752
+ function isNotFound(obj) {
753
+ return !!obj?.isNotFound;
754
+ }
755
+ function CatchNotFound(props) {
756
+ const resetKey = useRouterState({
757
+ select: (s) => `not-found-${s.location.pathname}-${s.status}`
758
+ });
759
+ return /* @__PURE__ */ jsx(
760
+ CatchBoundary,
761
+ {
762
+ getResetKey: () => resetKey,
763
+ onCatch: (error, errorInfo) => {
764
+ var _a;
765
+ if (isNotFound(error))
766
+ (_a = props.onCatch) == null || _a.call(props, error, errorInfo);
767
+ else
768
+ throw error;
769
+ },
770
+ errorComponent: ({ error }) => {
771
+ var _a;
772
+ return (_a = props.fallback) == null ? void 0 : _a.call(props, error);
773
+ },
774
+ children: props.children
775
+ }
776
+ );
777
+ }
778
+ function DefaultGlobalNotFound() {
779
+ return /* @__PURE__ */ jsx("p", { children: "Not Found" });
780
+ }
781
+ const componentTypes = [
782
+ "component",
783
+ "errorComponent",
784
+ "pendingComponent",
785
+ "notFoundComponent"
786
+ ];
787
+ function createRouter(options) {
788
+ return new Router(options);
789
+ }
790
+ class Router {
791
+ /**
792
+ * @deprecated Use the `createRouter` function instead
793
+ */
794
+ constructor(options) {
795
+ this.tempLocationKey = `${Math.round(
796
+ Math.random() * 1e7
797
+ )}`, this.resetNextScroll = !0, this.shouldViewTransition = void 0, this.subscribers = /* @__PURE__ */ new Set(), this.startReactTransition = (fn) => fn(),
798
+ this.update = (newOptions) => {
799
+ newOptions.notFoundRoute && console.warn(
800
+ "The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-er\
801
+ rors#migrating-from-notfoundroute for more info."
802
+ );
803
+ const previousOptions = this.options;
804
+ this.options = {
805
+ ...this.options,
806
+ ...newOptions
807
+ }, this.isServer = this.options.isServer ?? typeof document > "u", (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.
808
+ basepath) && (newOptions.basepath === void 0 || newOptions.basepath === "" || newOptions.basepath === "/" ? this.basepath = "/" : this.basepath =
809
+ `/${trimPath(newOptions.basepath)}`), // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
810
+ (!this.history || this.options.history && this.options.history !== this.history) && (this.history = this.options.history ?? (this.isServer ? createMemoryHistory(
811
+ {
812
+ initialEntries: [this.basepath || "/"]
813
+ }) : createBrowserHistory()), this.latestLocation = this.parseLocation()), this.options.routeTree !== this.routeTree && (this.routeTree = this.options.
814
+ routeTree, this.buildRouteTree()), this.__store || (this.__store = new Store(getInitialRouterState(this.latestLocation), {
815
+ onUpdate: () => {
816
+ this.__store.state = {
817
+ ...this.state,
818
+ cachedMatches: this.state.cachedMatches.filter(
819
+ (d) => !["redirected"].includes(d.status)
820
+ )
821
+ };
822
+ }
823
+ }));
824
+ }, this.buildRouteTree = () => {
825
+ this.routesById = {}, this.routesByPath = {};
826
+ const notFoundRoute = this.options.notFoundRoute;
827
+ notFoundRoute && (notFoundRoute.init({ originalIndex: 99999999999 }), this.routesById[notFoundRoute.id] = notFoundRoute);
828
+ const recurseRoutes = (childRoutes) => {
829
+ childRoutes.forEach((childRoute, i) => {
830
+ childRoute.init({ originalIndex: i });
831
+ const existingRoute = this.routesById[childRoute.id];
832
+ if (invariant(
833
+ !existingRoute
834
+ ), this.routesById[childRoute.id] = childRoute, !childRoute.isRoot && childRoute.path) {
835
+ const trimmedFullPath = trimPathRight(childRoute.fullPath);
836
+ (!this.routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith("/")) && (this.routesByPath[trimmedFullPath] = childRoute);
837
+ }
838
+ const children = childRoute.children;
839
+ children?.length && recurseRoutes(children);
840
+ });
841
+ };
842
+ recurseRoutes([this.routeTree]);
843
+ const scoredRoutes = [];
844
+ Object.values(this.routesById).forEach((d, i) => {
845
+ var _a;
846
+ if (d.isRoot || !d.path)
847
+ return;
848
+ const trimmed = trimPathLeft(d.fullPath), parsed = parsePathname(trimmed);
849
+ for (; parsed.length > 1 && ((_a = parsed[0]) == null ? void 0 : _a.value) === "/"; )
850
+ parsed.shift();
851
+ const scores = parsed.map((segment) => segment.value === "/" ? 0.75 : segment.type === "param" ? 0.5 : segment.type === "wildcard" ? 0.25 : 1);
852
+ scoredRoutes.push({ child: d, trimmed, parsed, index: i, scores });
853
+ }), this.flatRoutes = scoredRoutes.sort((a, b) => {
854
+ const minLength = Math.min(a.scores.length, b.scores.length);
855
+ for (let i = 0; i < minLength; i++)
856
+ if (a.scores[i] !== b.scores[i])
857
+ return b.scores[i] - a.scores[i];
858
+ if (a.scores.length !== b.scores.length)
859
+ return b.scores.length - a.scores.length;
860
+ for (let i = 0; i < minLength; i++)
861
+ if (a.parsed[i].value !== b.parsed[i].value)
862
+ return a.parsed[i].value > b.parsed[i].value ? 1 : -1;
863
+ return a.index - b.index;
864
+ }).map((d, i) => (d.child.rank = i, d.child));
865
+ }, this.subscribe = (eventType, fn) => {
866
+ const listener = {
867
+ eventType,
868
+ fn
869
+ };
870
+ return this.subscribers.add(listener), () => {
871
+ this.subscribers.delete(listener);
872
+ };
873
+ }, this.emit = (routerEvent) => {
874
+ this.subscribers.forEach((listener) => {
875
+ listener.eventType === routerEvent.type && listener.fn(routerEvent);
876
+ });
877
+ }, this.parseLocation = (previousLocation) => {
878
+ const parse = ({
879
+ pathname,
880
+ search,
881
+ hash,
882
+ state
883
+ }) => {
884
+ const parsedSearch = this.options.parseSearch(search), searchStr = this.options.stringifySearch(parsedSearch);
885
+ return {
886
+ pathname,
887
+ searchStr,
888
+ search: replaceEqualDeep(previousLocation?.search, parsedSearch),
889
+ hash: hash.split("#").reverse()[0] ?? "",
890
+ href: `${pathname}${searchStr}${hash}`,
891
+ state: replaceEqualDeep(previousLocation?.state, state)
892
+ };
893
+ }, location = parse(this.history.location), { __tempLocation, __tempKey } = location.state;
894
+ if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {
895
+ const parsedTempLocation = parse(__tempLocation);
896
+ return parsedTempLocation.state.key = location.state.key, delete parsedTempLocation.state.__tempLocation, {
897
+ ...parsedTempLocation,
898
+ maskedLocation: location
899
+ };
900
+ }
901
+ return location;
902
+ }, this.resolvePathWithBase = (from, path) => resolvePath({
903
+ basepath: this.basepath,
904
+ base: from,
905
+ to: cleanPath(path),
906
+ trailingSlash: this.options.trailingSlash
907
+ }), this.matchRoutes = (pathname, locationSearch, opts) => {
908
+ let routeParams = {};
909
+ const foundRoute = this.flatRoutes.find((route) => {
910
+ const matchedParams = matchPathname(
911
+ this.basepath,
912
+ trimPathRight(pathname),
913
+ {
914
+ to: route.fullPath,
915
+ caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive,
916
+ fuzzy: !0
917
+ }
918
+ );
919
+ return matchedParams ? (routeParams = matchedParams, !0) : !1;
920
+ });
921
+ let routeCursor = foundRoute || this.routesById[rootRouteId];
922
+ const matchedRoutes = [routeCursor];
923
+ let isGlobalNotFound = !1;
924
+ for (// If we found a route, and it's not an index route and we have left over path
925
+ (foundRoute ? foundRoute.path !== "/" && routeParams["**"] : (
926
+ // Or if we didn't find a route and we have left over path
927
+ trimPathRight(pathname)
928
+ )) && (this.options.notFoundRoute ? matchedRoutes.push(this.options.notFoundRoute) : isGlobalNotFound = !0); routeCursor.parentRoute; )
929
+ routeCursor = routeCursor.parentRoute, matchedRoutes.unshift(routeCursor);
930
+ const globalNotFoundRouteId = (() => {
931
+ if (isGlobalNotFound) {
932
+ if (this.options.notFoundMode !== "root")
933
+ for (let i = matchedRoutes.length - 1; i >= 0; i--) {
934
+ const route = matchedRoutes[i];
935
+ if (route.children)
936
+ return route.id;
937
+ }
938
+ return rootRouteId;
939
+ }
940
+ })(), parseErrors = matchedRoutes.map((route) => {
941
+ var _a;
942
+ let parsedParamsError;
943
+ const parseParams = ((_a = route.options.params) == null ? void 0 : _a.parse) ?? route.options.parseParams;
944
+ if (parseParams)
945
+ try {
946
+ const parsedParams = parseParams(routeParams);
947
+ Object.assign(routeParams, parsedParams);
948
+ } catch (err) {
949
+ if (parsedParamsError = new PathParamError(err.message, {
950
+ cause: err
951
+ }), opts?.throwOnError)
952
+ throw parsedParamsError;
953
+ return parsedParamsError;
954
+ }
955
+ }), matches = [];
956
+ return matchedRoutes.forEach((route, index) => {
957
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
958
+ const parentMatch = matches[index - 1], [preMatchSearch, searchError] = (() => {
959
+ const parentSearch = parentMatch?.search ?? locationSearch;
960
+ try {
961
+ const validator = typeof route.options.validateSearch == "object" ? route.options.validateSearch.parse : route.options.validateSearch, search = validator?.(
962
+ parentSearch) ?? {};
963
+ return [
964
+ {
965
+ ...parentSearch,
966
+ ...search
967
+ },
968
+ void 0
969
+ ];
970
+ } catch (err) {
971
+ const searchParamError = new SearchParamError(err.message, {
972
+ cause: err
973
+ });
974
+ if (opts?.throwOnError)
975
+ throw searchParamError;
976
+ return [parentSearch, searchParamError];
977
+ }
978
+ })(), loaderDeps = ((_b = (_a = route.options).loaderDeps) == null ? void 0 : _b.call(_a, {
979
+ search: preMatchSearch
980
+ })) ?? "", loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : "", interpolatedPath = interpolatePath({
981
+ path: route.fullPath,
982
+ params: routeParams
983
+ }), matchId = interpolatePath({
984
+ path: route.id,
985
+ params: routeParams,
986
+ leaveWildcards: !0
987
+ }) + loaderDepsHash, existingMatch = this.getMatch(matchId), cause = this.state.matches.find((d) => d.id === matchId) ? "stay" : "enter";
988
+ let match;
989
+ if (existingMatch)
990
+ match = {
991
+ ...existingMatch,
992
+ cause,
993
+ params: routeParams
994
+ };
995
+ else {
996
+ const status = route.options.loader || route.options.beforeLoad || route.lazyFn ? "pending" : "success";
997
+ match = {
998
+ id: matchId,
999
+ index,
1000
+ routeId: route.id,
1001
+ params: routeParams,
1002
+ pathname: joinPaths([this.basepath, interpolatedPath]),
1003
+ updatedAt: Date.now(),
1004
+ search: {},
1005
+ searchError: void 0,
1006
+ status,
1007
+ isFetching: !1,
1008
+ error: void 0,
1009
+ paramsError: parseErrors[index],
1010
+ routeContext: void 0,
1011
+ context: void 0,
1012
+ abortController: new AbortController(),
1013
+ fetchCount: 0,
1014
+ cause,
1015
+ loaderDeps,
1016
+ invalid: !1,
1017
+ preload: !1,
1018
+ links: (_d = (_c = route.options).links) == null ? void 0 : _d.call(_c),
1019
+ scripts: (_f = (_e = route.options).scripts) == null ? void 0 : _f.call(_e),
1020
+ staticData: route.options.staticData || {},
1021
+ loadPromise: createControlledPromise()
1022
+ };
1023
+ }
1024
+ match.status === "success" && (match.meta = (_h = (_g = route.options).meta) == null ? void 0 : _h.call(_g, {
1025
+ matches,
1026
+ match,
1027
+ params: match.params,
1028
+ loaderData: match.loaderData
1029
+ }), match.headers = (_j = (_i = route.options).headers) == null ? void 0 : _j.call(_i, {
1030
+ loaderData: match.loaderData
1031
+ })), opts?.preload || (match.globalNotFound = globalNotFoundRouteId === route.id), match.search = replaceEqualDeep(match.search, preMatchSearch),
1032
+ match.searchError = searchError, matches.push(match);
1033
+ }), matches;
1034
+ }, this.cancelMatch = (id) => {
1035
+ const match = this.getMatch(id);
1036
+ match && (match.abortController.abort(), clearTimeout(match.pendingTimeout));
1037
+ }, this.cancelMatches = () => {
1038
+ var _a;
1039
+ (_a = this.state.pendingMatches) == null || _a.forEach((match) => {
1040
+ this.cancelMatch(match.id);
1041
+ });
1042
+ }, this.buildLocation = (opts) => {
1043
+ const build = (dest = {}, matches) => {
1044
+ var _a, _b, _c;
1045
+ const fromMatches = dest._fromLocation != null ? this.matchRoutes(
1046
+ dest._fromLocation.pathname,
1047
+ dest.fromSearch || dest._fromLocation.search
1048
+ ) : this.state.matches, fromMatch = dest.from != null ? fromMatches.find(
1049
+ (d) => matchPathname(this.basepath, trimPathRight(d.pathname), {
1050
+ to: dest.from,
1051
+ caseSensitive: !1,
1052
+ fuzzy: !1
1053
+ })
1054
+ ) : void 0, fromPath = fromMatch?.pathname || this.latestLocation.pathname;
1055
+ invariant(
1056
+ dest.from == null || fromMatch != null
1057
+ );
1058
+ const fromSearch = ((_a = last(fromMatches)) == null ? void 0 : _a.search) || this.latestLocation.search, stayingMatches = matches?.filter(
1059
+ (d) => fromMatches.find((e2) => e2.routeId === d.routeId)
1060
+ ), fromRouteByFromPathRouteId = this.routesById[(_b = stayingMatches?.find((d) => d.pathname === fromPath)) == null ? void 0 : _b.routeId];
1061
+ let pathname = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(
1062
+ fromPath,
1063
+ fromRouteByFromPathRouteId?.to ?? fromPath
1064
+ );
1065
+ const prevParams = { ...(_c = last(fromMatches)) == null ? void 0 : _c.params };
1066
+ let nextParams = (dest.params ?? !0) === !0 ? prevParams : { ...prevParams, ...functionalUpdate(dest.params, prevParams) };
1067
+ Object.keys(nextParams).length > 0 && matches?.map((d) => {
1068
+ var _a2;
1069
+ const route = this.looseRoutesById[d.routeId];
1070
+ return ((_a2 = route?.options.params) == null ? void 0 : _a2.stringify) ?? route.options.stringifyParams;
1071
+ }).filter(Boolean).forEach((fn) => {
1072
+ nextParams = { ...nextParams, ...fn(nextParams) };
1073
+ }), pathname = interpolatePath({
1074
+ path: pathname,
1075
+ params: nextParams ?? {},
1076
+ leaveWildcards: !1,
1077
+ leaveParams: opts.leaveParams
1078
+ });
1079
+ const preSearchFilters = stayingMatches?.map(
1080
+ (match) => this.looseRoutesById[match.routeId].options.preSearchFilters ?? []
1081
+ ).flat().filter(Boolean) ?? [], postSearchFilters = stayingMatches?.map(
1082
+ (match) => this.looseRoutesById[match.routeId].options.postSearchFilters ?? []
1083
+ ).flat().filter(Boolean) ?? [], preFilteredSearch = preSearchFilters.length ? preSearchFilters.reduce((prev, next) => next(prev), fromSearch) :
1084
+ fromSearch, destSearch = dest.search === !0 ? preFilteredSearch : dest.search ? functionalUpdate(dest.search, preFilteredSearch) : preSearchFilters.
1085
+ length ? preFilteredSearch : {}, postFilteredSearch = postSearchFilters.length ? postSearchFilters.reduce((prev, next) => next(prev), destSearch) :
1086
+ destSearch, search = replaceEqualDeep(fromSearch, postFilteredSearch), searchStr = this.options.stringifySearch(search), hash = dest.hash === !0 ?
1087
+ this.latestLocation.hash : dest.hash ? functionalUpdate(dest.hash, this.latestLocation.hash) : void 0, hashStr = hash ? `#${hash}` : "";
1088
+ let nextState = dest.state === !0 ? this.latestLocation.state : dest.state ? functionalUpdate(dest.state, this.latestLocation.state) : {};
1089
+ return nextState = replaceEqualDeep(this.latestLocation.state, nextState), {
1090
+ pathname,
1091
+ search,
1092
+ searchStr,
1093
+ state: nextState,
1094
+ hash: hash ?? "",
1095
+ href: `${pathname}${searchStr}${hashStr}`,
1096
+ unmaskOnReload: dest.unmaskOnReload
1097
+ };
1098
+ }, buildWithMatches = (dest = {}, maskedDest) => {
1099
+ var _a;
1100
+ const next = build(dest);
1101
+ let maskedNext = maskedDest ? build(maskedDest) : void 0;
1102
+ if (!maskedNext) {
1103
+ let params = {};
1104
+ const foundMask = (_a = this.options.routeMasks) == null ? void 0 : _a.find((d) => {
1105
+ const match = matchPathname(this.basepath, next.pathname, {
1106
+ to: d.from,
1107
+ caseSensitive: !1,
1108
+ fuzzy: !1
1109
+ });
1110
+ return match ? (params = match, !0) : !1;
1111
+ });
1112
+ if (foundMask) {
1113
+ const { from, ...maskProps } = foundMask;
1114
+ maskedDest = {
1115
+ ...pick(opts, ["from"]),
1116
+ ...maskProps,
1117
+ params
1118
+ }, maskedNext = build(maskedDest);
1119
+ }
1120
+ }
1121
+ const nextMatches = this.matchRoutes(next.pathname, next.search), maskedMatches = maskedNext ? this.matchRoutes(maskedNext.pathname, maskedNext.
1122
+ search) : void 0, maskedFinal = maskedNext ? build(maskedDest, maskedMatches) : void 0, final = build(dest, nextMatches);
1123
+ return maskedFinal && (final.maskedLocation = maskedFinal), final;
1124
+ };
1125
+ return opts.mask ? buildWithMatches(opts, {
1126
+ ...pick(opts, ["from"]),
1127
+ ...opts.mask
1128
+ }) : buildWithMatches(opts);
1129
+ }, this.commitLocation = ({
1130
+ viewTransition,
1131
+ ignoreBlocker,
1132
+ ...next
1133
+ }) => {
1134
+ const isSameState = () => {
1135
+ next.state.key = this.latestLocation.state.key;
1136
+ const isEqual = deepEqual(next.state, this.latestLocation.state);
1137
+ return delete next.state.key, isEqual;
1138
+ }, isSameUrl = this.latestLocation.href === next.href, previousCommitPromise = this.commitLocationPromise;
1139
+ if (this.commitLocationPromise = createControlledPromise(() => {
1140
+ previousCommitPromise?.resolve();
1141
+ }), isSameUrl && isSameState())
1142
+ this.load();
1143
+ else {
1144
+ let { maskedLocation, ...nextHistory } = next;
1145
+ maskedLocation && (nextHistory = {
1146
+ ...maskedLocation,
1147
+ state: {
1148
+ ...maskedLocation.state,
1149
+ __tempKey: void 0,
1150
+ __tempLocation: {
1151
+ ...nextHistory,
1152
+ search: nextHistory.searchStr,
1153
+ state: {
1154
+ ...nextHistory.state,
1155
+ __tempKey: void 0,
1156
+ __tempLocation: void 0,
1157
+ key: void 0
1158
+ }
1159
+ }
1160
+ }
1161
+ }, (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? !1) && (nextHistory.state.__tempKey = this.tempLocationKey)), this.shouldViewTransition =
1162
+ viewTransition, this.history[next.replace ? "replace" : "push"](
1163
+ nextHistory.href,
1164
+ nextHistory.state,
1165
+ { ignoreBlocker }
1166
+ );
1167
+ }
1168
+ return this.resetNextScroll = next.resetScroll ?? !0, this.history.subscribers.size || this.load(), this.commitLocationPromise;
1169
+ }, this.buildAndCommitLocation = ({
1170
+ replace,
1171
+ resetScroll,
1172
+ viewTransition,
1173
+ ignoreBlocker,
1174
+ ...rest
1175
+ } = {}) => {
1176
+ const location = this.buildLocation(rest);
1177
+ return this.commitLocation({
1178
+ ...location,
1179
+ viewTransition,
1180
+ replace,
1181
+ resetScroll,
1182
+ ignoreBlocker
1183
+ });
1184
+ }, this.navigate = ({ from, to, __isRedirect, ...rest }) => {
1185
+ const toString = String(to);
1186
+ let isExternal;
1187
+ try {
1188
+ new URL(`${toString}`), isExternal = !0;
1189
+ } catch {
1190
+ }
1191
+ return invariant(
1192
+ !isExternal
1193
+ ), this.buildAndCommitLocation({
1194
+ ...rest,
1195
+ from,
1196
+ to
1197
+ // to: toString,
1198
+ });
1199
+ }, this.load = async () => {
1200
+ this.latestLocation = this.parseLocation(this.latestLocation), this.__store.setState((s) => ({
1201
+ ...s,
1202
+ loadedAt: Date.now()
1203
+ }));
1204
+ let redirect, notFound2;
1205
+ const loadPromise = new Promise((resolve) => {
1206
+ this.startReactTransition(async () => {
1207
+ var _a;
1208
+ try {
1209
+ const next = this.latestLocation, prevLocation = this.state.resolvedLocation, pathDidChange = prevLocation.href !== next.href;
1210
+ this.cancelMatches();
1211
+ let pendingMatches;
1212
+ this.__store.batch(() => {
1213
+ pendingMatches = this.matchRoutes(next.pathname, next.search), this.__store.setState((s) => ({
1214
+ ...s,
1215
+ status: "pending",
1216
+ isLoading: !0,
1217
+ location: next,
1218
+ pendingMatches,
1219
+ // If a cached moved to pendingMatches, remove it from cachedMatches
1220
+ cachedMatches: s.cachedMatches.filter((d) => !pendingMatches.find((e2) => e2.id === d.id))
1221
+ }));
1222
+ }), this.state.redirect || this.emit({
1223
+ type: "onBeforeNavigate",
1224
+ fromLocation: prevLocation,
1225
+ toLocation: next,
1226
+ pathChanged: pathDidChange
1227
+ }), this.emit({
1228
+ type: "onBeforeLoad",
1229
+ fromLocation: prevLocation,
1230
+ toLocation: next,
1231
+ pathChanged: pathDidChange
1232
+ }), await this.loadMatches({
1233
+ matches: pendingMatches,
1234
+ location: next,
1235
+ // eslint-disable-next-line @typescript-eslint/require-await
1236
+ onReady: async () => {
1237
+ this.startViewTransition(async () => {
1238
+ let exitingMatches, enteringMatches, stayingMatches;
1239
+ this.__store.batch(() => {
1240
+ this.__store.setState((s) => {
1241
+ const previousMatches = s.matches, newMatches = s.pendingMatches || s.matches;
1242
+ return exitingMatches = previousMatches.filter(
1243
+ (match) => !newMatches.find((d) => d.id === match.id)
1244
+ ), enteringMatches = newMatches.filter(
1245
+ (match) => !previousMatches.find((d) => d.id === match.id)
1246
+ ), stayingMatches = previousMatches.filter(
1247
+ (match) => newMatches.find((d) => d.id === match.id)
1248
+ ), {
1249
+ ...s,
1250
+ isLoading: !1,
1251
+ matches: newMatches,
1252
+ pendingMatches: void 0,
1253
+ cachedMatches: [
1254
+ ...s.cachedMatches,
1255
+ ...exitingMatches.filter((d) => d.status !== "error")
1256
+ ]
1257
+ };
1258
+ }), this.cleanCache();
1259
+ }), [
1260
+ [exitingMatches, "onLeave"],
1261
+ [enteringMatches, "onEnter"],
1262
+ [stayingMatches, "onStay"]
1263
+ ].forEach(([matches, hook]) => {
1264
+ matches.forEach((match) => {
1265
+ var _a2, _b;
1266
+ (_b = (_a2 = this.looseRoutesById[match.routeId].options)[hook]) == null || _b.call(_a2, match);
1267
+ });
1268
+ });
1269
+ });
1270
+ }
1271
+ });
1272
+ } catch (err) {
1273
+ isResolvedRedirect(err) ? (redirect = err, this.isServer || this.navigate({ ...err, replace: !0, __isRedirect: !0 })) : isNotFound(err) &&
1274
+ (notFound2 = err), this.__store.setState((s) => ({
1275
+ ...s,
1276
+ statusCode: redirect ? redirect.statusCode : notFound2 ? 404 : s.matches.some((d) => d.status === "error") ? 500 : 200,
1277
+ redirect
1278
+ }));
1279
+ }
1280
+ this.latestLoadPromise === loadPromise && ((_a = this.commitLocationPromise) == null || _a.resolve(), this.latestLoadPromise = void 0, this.
1281
+ commitLocationPromise = void 0), resolve();
1282
+ });
1283
+ });
1284
+ for (this.latestLoadPromise = loadPromise, await loadPromise; this.latestLoadPromise && loadPromise !== this.latestLoadPromise; )
1285
+ await this.latestLoadPromise;
1286
+ }, this.startViewTransition = (fn) => {
1287
+ var _a, _b;
1288
+ const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;
1289
+ delete this.shouldViewTransition, (_b = (_a = shouldViewTransition && typeof document < "u" ? document : void 0) == null ? void 0 : _a.startViewTransition) !=
1290
+ null && _b.call(_a, fn) || fn();
1291
+ }, this.updateMatch = (id, updater) => {
1292
+ var _a;
1293
+ let updated;
1294
+ const isPending = (_a = this.state.pendingMatches) == null ? void 0 : _a.find((d) => d.id === id), isMatched = this.state.matches.find((d) => d.
1295
+ id === id), matchesKey = isPending ? "pendingMatches" : isMatched ? "matches" : "cachedMatches";
1296
+ return this.__store.setState((s) => {
1297
+ var _a2;
1298
+ return {
1299
+ ...s,
1300
+ [matchesKey]: (_a2 = s[matchesKey]) == null ? void 0 : _a2.map(
1301
+ (d) => d.id === id ? updated = updater(d) : d
1302
+ )
1303
+ };
1304
+ }), updated;
1305
+ }, this.getMatch = (matchId) => [
1306
+ ...this.state.cachedMatches,
1307
+ ...this.state.pendingMatches ?? [],
1308
+ ...this.state.matches
1309
+ ].find((d) => d.id === matchId), this.loadMatches = async ({
1310
+ location,
1311
+ matches,
1312
+ preload,
1313
+ onReady,
1314
+ updateMatch = this.updateMatch
1315
+ }) => {
1316
+ let firstBadMatchIndex, rendered = !1;
1317
+ const triggerOnReady = async () => {
1318
+ rendered || (rendered = !0, await onReady?.());
1319
+ };
1320
+ !this.isServer && !this.state.matches.length && triggerOnReady();
1321
+ const handleRedirectAndNotFound = (match, err) => {
1322
+ var _a, _b, _c;
1323
+ if (isResolvedRedirect(err)) throw err;
1324
+ if (isRedirect(err) || isNotFound(err)) {
1325
+ if (updateMatch(match.id, (prev) => ({
1326
+ ...prev,
1327
+ status: isRedirect(err) ? "redirected" : isNotFound(err) ? "notFound" : "error",
1328
+ isFetching: !1,
1329
+ error: err,
1330
+ beforeLoadPromise: void 0,
1331
+ loaderPromise: void 0
1332
+ })), err.routeId || (err.routeId = match.routeId), (_a = match.beforeLoadPromise) == null || _a.resolve(), (_b = match.loaderPromise) == null ||
1333
+ _b.resolve(), (_c = match.loadPromise) == null || _c.resolve(), isRedirect(err))
1334
+ throw rendered = !0, err = this.resolveRedirect({ ...err, _fromLocation: location }), err;
1335
+ if (isNotFound(err))
1336
+ throw this._handleNotFound(matches, err, {
1337
+ updateMatch
1338
+ }), err;
1339
+ }
1340
+ };
1341
+ try {
1342
+ await new Promise((resolveAll, rejectAll) => {
1343
+ (async () => {
1344
+ var _a, _b, _c;
1345
+ try {
1346
+ const handleSerialError = (index, err, routerCode) => {
1347
+ var _a2, _b2;
1348
+ const { id: matchId, routeId } = matches[index], route = this.looseRoutesById[routeId];
1349
+ if (err instanceof Promise)
1350
+ throw err;
1351
+ err.routerCode = routerCode, firstBadMatchIndex = firstBadMatchIndex ?? index, handleRedirectAndNotFound(this.getMatch(matchId), err);
1352
+ try {
1353
+ (_b2 = (_a2 = route.options).onError) == null || _b2.call(_a2, err);
1354
+ } catch (errorHandlerErr) {
1355
+ err = errorHandlerErr, handleRedirectAndNotFound(this.getMatch(matchId), err);
1356
+ }
1357
+ updateMatch(matchId, (prev) => {
1358
+ var _a3;
1359
+ return (_a3 = prev.beforeLoadPromise) == null || _a3.resolve(), {
1360
+ ...prev,
1361
+ error: err,
1362
+ status: "error",
1363
+ isFetching: !1,
1364
+ updatedAt: Date.now(),
1365
+ abortController: new AbortController(),
1366
+ beforeLoadPromise: void 0
1367
+ };
1368
+ });
1369
+ };
1370
+ for (const [index, { id: matchId, routeId }] of matches.entries()) {
1371
+ const existingMatch = this.getMatch(matchId);
1372
+ if (
1373
+ // If we are in the middle of a load, either of these will be present
1374
+ // (not to be confused with `loadPromise`, which is always defined)
1375
+ existingMatch.beforeLoadPromise || existingMatch.loaderPromise
1376
+ )
1377
+ await existingMatch.beforeLoadPromise;
1378
+ else {
1379
+ try {
1380
+ updateMatch(matchId, (prev) => ({
1381
+ ...prev,
1382
+ loadPromise: createControlledPromise(() => {
1383
+ var _a2;
1384
+ (_a2 = prev.loadPromise) == null || _a2.resolve();
1385
+ }),
1386
+ beforeLoadPromise: createControlledPromise()
1387
+ }));
1388
+ const route = this.looseRoutesById[routeId], abortController = new AbortController(), parentMatchId = (_a = matches[index - 1]) ==
1389
+ null ? void 0 : _a.id, getParentContext = () => parentMatchId ? this.getMatch(parentMatchId).context ?? this.options.context ?? {} :
1390
+ this.options.context ?? {}, pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs, shouldPending = !!(onReady && !this.
1391
+ isServer && !preload && (route.options.loader || route.options.beforeLoad) && typeof pendingMs == "number" && pendingMs !== 1 / 0 &&
1392
+ (route.options.pendingComponent ?? this.options.defaultPendingComponent));
1393
+ let pendingTimeout;
1394
+ shouldPending && (pendingTimeout = setTimeout(() => {
1395
+ try {
1396
+ triggerOnReady();
1397
+ } catch {
1398
+ }
1399
+ }, pendingMs));
1400
+ const { paramsError, searchError } = this.getMatch(matchId);
1401
+ paramsError && handleSerialError(index, paramsError, "PARSE_PARAMS"), searchError && handleSerialError(index, searchError, "VALIDA\
1402
+ TE_SEARCH");
1403
+ const parentContext = getParentContext();
1404
+ updateMatch(matchId, (prev) => ({
1405
+ ...prev,
1406
+ isFetching: "beforeLoad",
1407
+ fetchCount: prev.fetchCount + 1,
1408
+ routeContext: replaceEqualDeep(
1409
+ prev.routeContext,
1410
+ parentContext
1411
+ ),
1412
+ context: replaceEqualDeep(prev.context, parentContext),
1413
+ abortController,
1414
+ pendingTimeout
1415
+ }));
1416
+ const { search, params, routeContext, cause } = this.getMatch(matchId), beforeLoadFnContext = {
1417
+ search,
1418
+ abortController,
1419
+ params,
1420
+ preload: !!preload,
1421
+ context: routeContext,
1422
+ location,
1423
+ navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }),
1424
+ buildLocation: this.buildLocation,
1425
+ cause: preload ? "preload" : cause
1426
+ }, beforeLoadContext = await ((_c = (_b = route.options).beforeLoad) == null ? void 0 : _c.call(_b, beforeLoadFnContext)) ?? {};
1427
+ (isRedirect(beforeLoadContext) || isNotFound(beforeLoadContext)) && handleSerialError(index, beforeLoadContext, "BEFORE_LOAD"), updateMatch(
1428
+ matchId, (prev) => {
1429
+ const routeContext2 = {
1430
+ ...prev.routeContext,
1431
+ ...beforeLoadContext
1432
+ };
1433
+ return {
1434
+ ...prev,
1435
+ routeContext: replaceEqualDeep(
1436
+ prev.routeContext,
1437
+ routeContext2
1438
+ ),
1439
+ context: replaceEqualDeep(prev.context, routeContext2),
1440
+ abortController
1441
+ };
1442
+ });
1443
+ } catch (err) {
1444
+ handleSerialError(index, err, "BEFORE_LOAD");
1445
+ }
1446
+ updateMatch(matchId, (prev) => {
1447
+ var _a2;
1448
+ return (_a2 = prev.beforeLoadPromise) == null || _a2.resolve(), {
1449
+ ...prev,
1450
+ beforeLoadPromise: void 0,
1451
+ isFetching: !1
1452
+ };
1453
+ });
1454
+ }
1455
+ }
1456
+ const validResolvedMatches = matches.slice(0, firstBadMatchIndex), matchPromises = [];
1457
+ validResolvedMatches.forEach(({ id: matchId, routeId }, index) => {
1458
+ matchPromises.push(
1459
+ (async () => {
1460
+ const { loaderPromise: prevLoaderPromise } = this.getMatch(matchId);
1461
+ if (prevLoaderPromise)
1462
+ await prevLoaderPromise;
1463
+ else {
1464
+ const parentMatchPromise = matchPromises[index - 1], route = this.looseRoutesById[routeId], getLoaderContext = () => {
1465
+ const {
1466
+ params,
1467
+ loaderDeps,
1468
+ abortController,
1469
+ context,
1470
+ cause
1471
+ } = this.getMatch(matchId);
1472
+ return {
1473
+ params,
1474
+ deps: loaderDeps,
1475
+ preload: !!preload,
1476
+ parentMatchPromise,
1477
+ abortController,
1478
+ context,
1479
+ location,
1480
+ navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }),
1481
+ cause: preload ? "preload" : cause,
1482
+ route
1483
+ };
1484
+ }, age = Date.now() - this.getMatch(matchId).updatedAt, staleAge = preload ? route.options.preloadStaleTime ?? this.options.defaultPreloadStaleTime ??
1485
+ 3e4 : route.options.staleTime ?? this.options.defaultStaleTime ?? 0, shouldReloadOption = route.options.shouldReload, shouldReload = typeof shouldReloadOption ==
1486
+ "function" ? shouldReloadOption(getLoaderContext()) : shouldReloadOption;
1487
+ updateMatch(matchId, (prev) => ({
1488
+ ...prev,
1489
+ loaderPromise: createControlledPromise(),
1490
+ preload: !!preload && !this.state.matches.find((d) => d.id === matchId)
1491
+ }));
1492
+ const runLoader = async () => {
1493
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
1494
+ try {
1495
+ const potentialPendingMinPromise = async () => {
1496
+ const latestMatch = this.getMatch(matchId);
1497
+ latestMatch.minPendingPromise && await latestMatch.minPendingPromise;
1498
+ };
1499
+ try {
1500
+ route._lazyPromise = route._lazyPromise || (route.lazyFn ? route.lazyFn().then((lazyRoute) => {
1501
+ Object.assign(
1502
+ route.options,
1503
+ lazyRoute.options
1504
+ );
1505
+ }) : Promise.resolve());
1506
+ const componentsPromise = this.getMatch(matchId).componentsPromise || route._lazyPromise.then(
1507
+ () => Promise.all(
1508
+ componentTypes.map(async (type) => {
1509
+ const component = route.options[type];
1510
+ component?.preload && await component.preload();
1511
+ })
1512
+ )
1513
+ );
1514
+ updateMatch(matchId, (prev) => ({
1515
+ ...prev,
1516
+ isFetching: "loader",
1517
+ componentsPromise
1518
+ })), await route._lazyPromise;
1519
+ let loaderData = await ((_b2 = (_a2 = route.options).loader) == null ? void 0 : _b2.call(_a2, getLoaderContext()));
1520
+ this.serializeLoaderData && (loaderData = this.serializeLoaderData(loaderData, {
1521
+ router: this,
1522
+ match: this.getMatch(matchId)
1523
+ })), handleRedirectAndNotFound(
1524
+ this.getMatch(matchId),
1525
+ loaderData
1526
+ ), await potentialPendingMinPromise();
1527
+ const meta = (_d = (_c2 = route.options).meta) == null ? void 0 : _d.call(_c2, {
1528
+ matches,
1529
+ match: this.getMatch(matchId),
1530
+ params: this.getMatch(matchId).params,
1531
+ loaderData
1532
+ }), headers = (_f = (_e = route.options).headers) == null ? void 0 : _f.call(_e, {
1533
+ loaderData
1534
+ });
1535
+ updateMatch(matchId, (prev) => ({
1536
+ ...prev,
1537
+ error: void 0,
1538
+ status: "success",
1539
+ isFetching: !1,
1540
+ updatedAt: Date.now(),
1541
+ loaderData,
1542
+ meta,
1543
+ headers
1544
+ }));
1545
+ } catch (e2) {
1546
+ let error = e2;
1547
+ await potentialPendingMinPromise(), handleRedirectAndNotFound(this.getMatch(matchId), e2);
1548
+ try {
1549
+ (_h = (_g = route.options).onError) == null || _h.call(_g, e2);
1550
+ } catch (onErrorError) {
1551
+ error = onErrorError, handleRedirectAndNotFound(
1552
+ this.getMatch(matchId),
1553
+ onErrorError
1554
+ );
1555
+ }
1556
+ updateMatch(matchId, (prev) => ({
1557
+ ...prev,
1558
+ error,
1559
+ status: "error",
1560
+ isFetching: !1
1561
+ }));
1562
+ }
1563
+ await this.getMatch(matchId).componentsPromise;
1564
+ } catch (err) {
1565
+ handleRedirectAndNotFound(this.getMatch(matchId), err);
1566
+ }
1567
+ }, { status, invalid } = this.getMatch(matchId);
1568
+ status === "success" && (invalid || (shouldReload ?? age > staleAge)) ? (async () => {
1569
+ try {
1570
+ await runLoader();
1571
+ } catch {
1572
+ }
1573
+ })() : status !== "success" && await runLoader();
1574
+ const { loaderPromise, loadPromise } = this.getMatch(matchId);
1575
+ loaderPromise?.resolve(), loadPromise?.resolve();
1576
+ }
1577
+ updateMatch(matchId, (prev) => ({
1578
+ ...prev,
1579
+ isFetching: !1,
1580
+ loaderPromise: void 0
1581
+ }));
1582
+ })()
1583
+ );
1584
+ }), await Promise.all(matchPromises), resolveAll();
1585
+ } catch (err) {
1586
+ rejectAll(err);
1587
+ }
1588
+ })();
1589
+ }), await triggerOnReady();
1590
+ } catch (err) {
1591
+ if (isRedirect(err) || isNotFound(err))
1592
+ throw isNotFound(err) && !preload && await triggerOnReady(), err;
1593
+ }
1594
+ return matches;
1595
+ }, this.invalidate = () => {
1596
+ const invalidate = (d) => ({
1597
+ ...d,
1598
+ invalid: !0,
1599
+ ...d.status === "error" ? { status: "pending", error: void 0 } : {}
1600
+ });
1601
+ return this.__store.setState((s) => {
1602
+ var _a;
1603
+ return {
1604
+ ...s,
1605
+ matches: s.matches.map(invalidate),
1606
+ cachedMatches: s.cachedMatches.map(invalidate),
1607
+ pendingMatches: (_a = s.pendingMatches) == null ? void 0 : _a.map(invalidate)
1608
+ };
1609
+ }), this.load();
1610
+ }, this.resolveRedirect = (err) => {
1611
+ const redirect = err;
1612
+ return redirect.href || (redirect.href = this.buildLocation(redirect).href), redirect;
1613
+ }, this.cleanCache = () => {
1614
+ this.__store.setState((s) => ({
1615
+ ...s,
1616
+ cachedMatches: s.cachedMatches.filter((d) => {
1617
+ const route = this.looseRoutesById[d.routeId];
1618
+ if (!route.options.loader)
1619
+ return !1;
1620
+ const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ??
1621
+ 5 * 60 * 1e3;
1622
+ return d.status !== "error" && Date.now() - d.updatedAt < gcTime;
1623
+ })
1624
+ }));
1625
+ }, this.preloadRoute = async (opts) => {
1626
+ const next = this.buildLocation(opts);
1627
+ let matches = this.matchRoutes(next.pathname, next.search, {
1628
+ throwOnError: !0,
1629
+ preload: !0
1630
+ });
1631
+ const loadedMatchIds = Object.fromEntries(
1632
+ [
1633
+ ...this.state.matches,
1634
+ ...this.state.pendingMatches ?? [],
1635
+ ...this.state.cachedMatches
1636
+ ].map((d) => [d.id, !0])
1637
+ );
1638
+ this.__store.batch(() => {
1639
+ matches.forEach((match) => {
1640
+ loadedMatchIds[match.id] || this.__store.setState((s) => ({
1641
+ ...s,
1642
+ cachedMatches: [...s.cachedMatches, match]
1643
+ }));
1644
+ });
1645
+ });
1646
+ const activeMatchIds = new Set(
1647
+ [...this.state.matches, ...this.state.pendingMatches ?? []].map(
1648
+ (d) => d.id
1649
+ )
1650
+ );
1651
+ try {
1652
+ return matches = await this.loadMatches({
1653
+ matches,
1654
+ location: next,
1655
+ preload: !0,
1656
+ updateMatch: (id, updater) => {
1657
+ activeMatchIds.has(id) ? matches = matches.map((d) => d.id === id ? updater(d) : d) : this.updateMatch(id, updater);
1658
+ }
1659
+ }), matches;
1660
+ } catch (err) {
1661
+ if (isRedirect(err))
1662
+ return await this.preloadRoute({
1663
+ ...err,
1664
+ _fromLocation: next
1665
+ });
1666
+ console.error(err);
1667
+ return;
1668
+ }
1669
+ }, this.matchRoute = (location, opts) => {
1670
+ const matchLocation = {
1671
+ ...location,
1672
+ to: location.to ? this.resolvePathWithBase(location.from || "", location.to) : void 0,
1673
+ params: location.params || {},
1674
+ leaveParams: !0
1675
+ }, next = this.buildLocation(matchLocation);
1676
+ if (opts?.pending && this.state.status !== "pending")
1677
+ return !1;
1678
+ const baseLocation = (opts?.pending === void 0 ? !this.state.isLoading : opts.pending) ? this.latestLocation : this.state.resolvedLocation, match = matchPathname(
1679
+ this.basepath, baseLocation.pathname, {
1680
+ ...opts,
1681
+ to: next.pathname
1682
+ });
1683
+ return !match || location.params && !deepEqual(match, location.params, !0) ? !1 : match && (opts?.includeSearch ?? !0) ? deepEqual(baseLocation.
1684
+ search, next.search, !0) ? match : !1 : match;
1685
+ }, this.dehydrate = () => {
1686
+ var _a;
1687
+ const pickError = ((_a = this.options.errorSerializer) == null ? void 0 : _a.serialize) ?? defaultSerializeError;
1688
+ return {
1689
+ state: {
1690
+ dehydratedMatches: this.state.matches.map((d) => ({
1691
+ ...pick(d, ["id", "status", "updatedAt"]),
1692
+ // If an error occurs server-side during SSRing,
1693
+ // send a small subset of the error to the client
1694
+ error: d.error ? {
1695
+ data: pickError(d.error),
1696
+ __isServerError: !0
1697
+ } : void 0
1698
+ // NOTE: We don't send the loader data here, because
1699
+ // there is a potential that it needs to be streamed.
1700
+ // Instead, we render it next to the route match in the HTML
1701
+ // which gives us the potential to stream it via suspense.
1702
+ }))
1703
+ },
1704
+ manifest: this.manifest
1705
+ };
1706
+ }, this.hydrate = () => {
1707
+ var _a, _b, _c;
1708
+ let ctx;
1709
+ typeof document < "u" && (ctx = this.options.transformer.parse((_a = window.__TSR__) == null ? void 0 : _a.dehydrated)), invariant(
1710
+ ctx
1711
+ ), this.dehydratedData = ctx.payload, (_c = (_b = this.options).hydrate) == null || _c.call(_b, ctx.payload);
1712
+ const dehydratedState = ctx.router.state, matches = this.matchRoutes(
1713
+ this.state.location.pathname,
1714
+ this.state.location.search
1715
+ ).map((match) => {
1716
+ const dehydratedMatch = dehydratedState.dehydratedMatches.find(
1717
+ (d) => d.id === match.id
1718
+ );
1719
+ return invariant(
1720
+ dehydratedMatch
1721
+ ), {
1722
+ ...match,
1723
+ ...dehydratedMatch
1724
+ };
1725
+ });
1726
+ this.__store.setState((s) => ({
1727
+ ...s,
1728
+ matches
1729
+ })), this.manifest = ctx.router.manifest;
1730
+ }, this.injectedHtml = [], this.injectHtml = (html) => {
1731
+ const cb = () => (this.injectedHtml = this.injectedHtml.filter((d) => d !== cb), html);
1732
+ this.injectedHtml.push(cb);
1733
+ }, this.streamedKeys = /* @__PURE__ */ new Set(), this.getStreamedValue = (key) => {
1734
+ var _a;
1735
+ if (this.isServer)
1736
+ return;
1737
+ const streamedValue = (_a = window.__TSR__) == null ? void 0 : _a.streamedValues[key];
1738
+ if (streamedValue)
1739
+ return streamedValue.parsed || (streamedValue.parsed = this.options.transformer.parse(streamedValue.value)), streamedValue.parsed;
1740
+ }, this.streamValue = (key, value) => {
1741
+ var _a;
1742
+ this.streamedKeys.has(key), this.streamedKeys.add(key);
1743
+ const children = `__TSR__.streamedValues['${key}'] = { value: ${(_a = this.serializer) == null ? void 0 : _a.call(this, this.options.transformer.
1744
+ stringify(value))}}`;
1745
+ this.injectHtml(
1746
+ `<script class='tsr-once'>${children}; __TSR__.cleanScripts()<\/script>`
1747
+ );
1748
+ }, this._handleNotFound = (matches, err, {
1749
+ updateMatch = this.updateMatch
1750
+ } = {}) => {
1751
+ const matchesByRouteId = Object.fromEntries(
1752
+ matches.map((match2) => [match2.routeId, match2])
1753
+ );
1754
+ let routeCursor = (err.global ? this.looseRoutesById[rootRouteId] : this.looseRoutesById[err.routeId]) || this.looseRoutesById[rootRouteId];
1755
+ for (; !routeCursor.options.notFoundComponent && !this.options.defaultNotFoundComponent && routeCursor.id !== rootRouteId; )
1756
+ routeCursor = routeCursor.parentRoute, invariant(
1757
+ routeCursor
1758
+ );
1759
+ const match = matchesByRouteId[routeCursor.id];
1760
+ invariant(match), updateMatch(match.id, (prev) => ({
1761
+ ...prev,
1762
+ status: "notFound",
1763
+ error: err,
1764
+ isFetching: !1
1765
+ })), err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute && (err.routeId = routeCursor.parentRoute.id, this._handleNotFound(matches, err,
1766
+ {
1767
+ updateMatch
1768
+ }));
1769
+ }, this.hasNotFoundMatch = () => this.__store.state.matches.some(
1770
+ (d) => d.status === "notFound" || d.globalNotFound
1771
+ ), this.update({
1772
+ defaultPreloadDelay: 50,
1773
+ defaultPendingMs: 1e3,
1774
+ defaultPendingMinMs: 500,
1775
+ context: void 0,
1776
+ ...options,
1777
+ stringifySearch: options.stringifySearch ?? defaultStringifySearch,
1778
+ parseSearch: options.parseSearch ?? defaultParseSearch
1779
+ }), typeof document < "u" && (window.__TSR__ROUTER__ = this);
1780
+ }
1781
+ get state() {
1782
+ return this.__store.state;
1783
+ }
1784
+ get looseRoutesById() {
1785
+ return this.routesById;
1786
+ }
1787
+ }
1788
+ class SearchParamError extends Error {
1789
+ }
1790
+ class PathParamError extends Error {
1791
+ }
1792
+ function getInitialRouterState(location) {
1793
+ return {
1794
+ loadedAt: 0,
1795
+ isLoading: !1,
1796
+ isTransitioning: !1,
1797
+ status: "idle",
1798
+ resolvedLocation: { ...location },
1799
+ location,
1800
+ matches: [],
1801
+ pendingMatches: [],
1802
+ cachedMatches: [],
1803
+ statusCode: 200
1804
+ };
1805
+ }
1806
+ function defaultSerializeError(err) {
1807
+ return err instanceof Error ? {
1808
+ name: err.name,
1809
+ message: err.message
1810
+ } : {
1811
+ data: err
1812
+ };
1813
+ }
1814
+ function isServerSideError(error) {
1815
+ return !(typeof error == "object" && error && "data" in error) || !("__isServerError" in error && error.__isServerError) || !(typeof error.data == "\
1816
+ object" && error.data) ? !1 : error.__isServerError === !0;
1817
+ }
1818
+ function defaultDeserializeError(serializedData) {
1819
+ if ("name" in serializedData && "message" in serializedData) {
1820
+ const error = new Error(serializedData.message);
1821
+ return error.name = serializedData.name, error;
1822
+ }
1823
+ return serializedData.data;
1824
+ }
1825
+ const matchContext = React.createContext(void 0);
1826
+ function useMatch(opts) {
1827
+ const nearestMatchId = React.useContext(matchContext);
1828
+ return useRouterState({
1829
+ select: (state) => {
1830
+ const match = state.matches.find(
1831
+ (d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId
1832
+ );
1833
+ if (invariant(
1834
+ !((opts.shouldThrow ?? !0) && !match)
1835
+ ), match !== void 0)
1836
+ return opts.select ? opts.select(match) : match;
1837
+ }
1838
+ });
1839
+ }
1840
+ function useLoaderDeps(opts) {
1841
+ return useMatch({
1842
+ ...opts,
1843
+ select: (s) => typeof opts.select == "function" ? opts.select(s.loaderDeps) : s.loaderDeps
1844
+ });
1845
+ }
1846
+ function useLoaderData(opts) {
1847
+ return useMatch({
1848
+ ...opts,
1849
+ select: (s) => typeof opts.select == "function" ? opts.select(s.loaderData) : s.loaderData
1850
+ });
1851
+ }
1852
+ function useParams(opts) {
1853
+ return useMatch({
1854
+ ...opts,
1855
+ select: (match) => opts.select ? opts.select(match.params) : match.params
1856
+ });
1857
+ }
1858
+ function useSearch(opts) {
1859
+ return useMatch({
1860
+ ...opts,
1861
+ select: (match) => opts.select ? opts.select(match.search) : match.search
1862
+ });
1863
+ }
1864
+ function useNavigate(_defaultOpts) {
1865
+ const router = useRouter();
1866
+ return React.useCallback(
1867
+ (options) => router.navigate({
1868
+ ...options
1869
+ }),
1870
+ [router]
1871
+ );
1872
+ }
1873
+ class Route {
1874
+ /**
1875
+ * @deprecated Use the `createRoute` function instead.
1876
+ */
1877
+ constructor(options) {
1878
+ this.init = (opts) => {
1879
+ var _a, _b;
1880
+ this.originalIndex = opts.originalIndex;
1881
+ const options2 = this.options, isRoot = !options2?.path && !options2?.id;
1882
+ this.parentRoute = (_b = (_a = this.options) == null ? void 0 : _a.getParentRoute) == null ? void 0 : _b.call(_a), isRoot ? this.path = rootRouteId :
1883
+ invariant(
1884
+ this.parentRoute
1885
+ );
1886
+ let path = isRoot ? rootRouteId : options2.path;
1887
+ path && path !== "/" && (path = trimPathLeft(path));
1888
+ const customId = options2?.id || path;
1889
+ let id = isRoot ? rootRouteId : joinPaths([
1890
+ this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id,
1891
+ customId
1892
+ ]);
1893
+ path === rootRouteId && (path = "/"), id !== rootRouteId && (id = joinPaths(["/", id]));
1894
+ const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]);
1895
+ this.path = path, this.id = id, this.fullPath = fullPath, this.to = fullPath;
1896
+ }, this.updateLoader = (options2) => (Object.assign(this.options, options2), this), this.update = (options2) => (Object.assign(this.options, options2),
1897
+ this), this.lazy = (lazyFn) => (this.lazyFn = lazyFn, this), this.useMatch = (opts) => useMatch({ ...opts, from: this.id }), this.useRouteContext =
1898
+ (opts) => useMatch({
1899
+ ...opts,
1900
+ from: this.id,
1901
+ select: (d) => opts?.select ? opts.select(d.context) : d.context
1902
+ }), this.useSearch = (opts) => useSearch({ ...opts, from: this.id }), this.useParams = (opts) => useParams({ ...opts, from: this.id }), this.useLoaderDeps =
1903
+ (opts) => useLoaderDeps({ ...opts, from: this.id }), this.useLoaderData = (opts) => useLoaderData({ ...opts, from: this.id }), this.useNavigate = () => useNavigate(),
1904
+ this.options = options || {}, this.isRoot = !options?.getParentRoute, invariant(
1905
+ !(options?.id && options?.path)
1906
+ ), this.$$typeof = Symbol.for("react.memo");
1907
+ }
1908
+ addChildren(children) {
1909
+ return this.children = Array.isArray(children) ? children : Object.values(children), this;
1910
+ }
1911
+ }
1912
+ function createRoute(options) {
1913
+ return new Route(options);
1914
+ }
1915
+ function createRootRouteWithContext() {
1916
+ return (options) => createRootRoute(options);
1917
+ }
1918
+ class RootRoute extends Route {
1919
+ /**
1920
+ * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
1921
+ */
1922
+ constructor(options) {
1923
+ super(options);
1924
+ }
1925
+ addChildren(children) {
1926
+ return super.addChildren(children);
1927
+ }
1928
+ }
1929
+ function createRootRoute(options) {
1930
+ return new RootRoute(options);
1931
+ }
1932
+ function createFileRoute(path) {
1933
+ return new FileRoute(path, {
1934
+ silent: !0
1935
+ }).createRoute;
1936
+ }
1937
+ class FileRoute {
1938
+ constructor(path, _opts) {
1939
+ this.path = path, this.createRoute = (options) => {
1940
+ const route = createRoute(options);
1941
+ return route.isRoot = !1, route;
1942
+ }, this.silent = _opts?.silent;
1943
+ }
1944
+ }
1945
+ const preloadWarning = "Error preloading route! ☝️";
1946
+ function useLinkProps(options) {
1947
+ const router = useRouter(), [isTransitioning, setIsTransitioning] = React.useState(!1), {
1948
+ // custom props
1949
+ activeProps = () => ({ className: "active" }),
1950
+ inactiveProps = () => ({}),
1951
+ activeOptions,
1952
+ hash,
1953
+ search,
1954
+ params,
1955
+ to,
1956
+ state,
1957
+ mask,
1958
+ preload: userPreload,
1959
+ preloadDelay: userPreloadDelay,
1960
+ replace,
1961
+ startTransition,
1962
+ resetScroll,
1963
+ viewTransition,
1964
+ // element props
1965
+ children,
1966
+ target,
1967
+ disabled,
1968
+ style,
1969
+ className,
1970
+ onClick,
1971
+ onFocus,
1972
+ onMouseEnter,
1973
+ onMouseLeave,
1974
+ onTouchStart,
1975
+ ignoreBlocker,
1976
+ ...rest
1977
+ } = options;
1978
+ let type = "internal";
1979
+ try {
1980
+ new URL(`${to}`), type = "external";
1981
+ } catch {
1982
+ }
1983
+ const next = router.buildLocation(options), preload = userPreload ?? router.options.defaultPreload, preloadDelay = userPreloadDelay ?? router.options.
1984
+ defaultPreloadDelay ?? 0, isActive = useRouterState({
1985
+ select: (s) => {
1986
+ const currentPathSplit = removeTrailingSlash(
1987
+ s.location.pathname,
1988
+ router.basepath
1989
+ ).split("/"), pathIsFuzzyEqual = removeTrailingSlash(
1990
+ next.pathname,
1991
+ router.basepath
1992
+ ).split("/").every(
1993
+ (d, i) => d === currentPathSplit[i]
1994
+ ), pathTest = activeOptions?.exact ? exactPathTest(s.location.pathname, next.pathname, router.basepath) : pathIsFuzzyEqual, hashTest = activeOptions?.
1995
+ includeHash ? s.location.hash === next.hash : !0, searchTest = activeOptions?.includeSearch ?? !0 ? deepEqual(s.location.search, next.search, !activeOptions?.
1996
+ exact) : !0;
1997
+ return pathTest && hashTest && searchTest;
1998
+ }
1999
+ });
2000
+ if (type === "external")
2001
+ return {
2002
+ ...rest,
2003
+ type,
2004
+ href: to,
2005
+ ...children && { children },
2006
+ ...target && { target },
2007
+ ...disabled && { disabled },
2008
+ ...style && { style },
2009
+ ...className && { className },
2010
+ ...onClick && { onClick },
2011
+ ...onFocus && { onFocus },
2012
+ ...onMouseEnter && { onMouseEnter },
2013
+ ...onMouseLeave && { onMouseLeave },
2014
+ ...onTouchStart && { onTouchStart }
2015
+ };
2016
+ const handleClick = (e2) => {
2017
+ if (!disabled && !isCtrlEvent(e2) && !e2.defaultPrevented && (!target || target === "_self") && e2.button === 0) {
2018
+ e2.preventDefault(), flushSync(() => {
2019
+ setIsTransitioning(!0);
2020
+ });
2021
+ const unsub = router.subscribe("onResolved", () => {
2022
+ unsub(), setIsTransitioning(!1);
2023
+ });
2024
+ router.commitLocation({
2025
+ ...next,
2026
+ replace,
2027
+ resetScroll,
2028
+ startTransition,
2029
+ viewTransition,
2030
+ ignoreBlocker
2031
+ });
2032
+ }
2033
+ }, doPreload = () => {
2034
+ router.preloadRoute(options).catch((err) => {
2035
+ console.warn(err), console.warn(preloadWarning);
2036
+ });
2037
+ }, handleFocus = (e2) => {
2038
+ disabled || preload && doPreload();
2039
+ }, handleTouchStart = handleFocus, handleEnter = (e2) => {
2040
+ if (disabled) return;
2041
+ const eventTarget = e2.target || {};
2042
+ if (preload) {
2043
+ if (eventTarget.preloadTimeout)
2044
+ return;
2045
+ eventTarget.preloadTimeout = setTimeout(() => {
2046
+ eventTarget.preloadTimeout = null, doPreload();
2047
+ }, preloadDelay);
2048
+ }
2049
+ }, handleLeave = (e2) => {
2050
+ if (disabled) return;
2051
+ const eventTarget = e2.target || {};
2052
+ eventTarget.preloadTimeout && (clearTimeout(eventTarget.preloadTimeout), eventTarget.preloadTimeout = null);
2053
+ }, composeHandlers = (handlers) => (e2) => {
2054
+ var _a;
2055
+ (_a = e2.persist) == null || _a.call(e2), handlers.filter(Boolean).forEach((handler) => {
2056
+ e2.defaultPrevented || handler(e2);
2057
+ });
2058
+ }, resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? {} : {}, resolvedInactiveProps = isActive ? {} : functionalUpdate(inactiveProps,
2059
+ {}), resolvedClassName = [
2060
+ className,
2061
+ resolvedActiveProps.className,
2062
+ resolvedInactiveProps.className
2063
+ ].filter(Boolean).join(" "), resolvedStyle = {
2064
+ ...style,
2065
+ ...resolvedActiveProps.style,
2066
+ ...resolvedInactiveProps.style
2067
+ };
2068
+ return {
2069
+ ...resolvedActiveProps,
2070
+ ...resolvedInactiveProps,
2071
+ ...rest,
2072
+ href: disabled ? void 0 : next.maskedLocation ? router.history.createHref(next.maskedLocation.href) : router.history.createHref(next.href),
2073
+ onClick: composeHandlers([onClick, handleClick]),
2074
+ onFocus: composeHandlers([onFocus, handleFocus]),
2075
+ onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
2076
+ onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
2077
+ onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
2078
+ disabled: !!disabled,
2079
+ target,
2080
+ ...Object.keys(resolvedStyle).length && { style: resolvedStyle },
2081
+ ...resolvedClassName && { className: resolvedClassName },
2082
+ ...disabled && {
2083
+ role: "link",
2084
+ "aria-disabled": !0
2085
+ },
2086
+ ...isActive && { "data-status": "active", "aria-current": "page" },
2087
+ ...isTransitioning && { "data-transitioning": "transitioning" }
2088
+ };
2089
+ }
2090
+ const Link = React.forwardRef((props, ref) => {
2091
+ const { _asChild, ...rest } = props, { type, ...linkProps } = useLinkProps(rest), children = typeof rest.children == "function" ? rest.children({
2092
+ isActive: linkProps["data-status"] === "active"
2093
+ }) : rest.children;
2094
+ return typeof _asChild > "u" && delete linkProps.disabled, React.createElement(
2095
+ _asChild || "a",
2096
+ {
2097
+ ...linkProps,
2098
+ ref
2099
+ },
2100
+ children
2101
+ );
2102
+ });
2103
+ function isCtrlEvent(e2) {
2104
+ return !!(e2.metaKey || e2.altKey || e2.ctrlKey || e2.shiftKey);
2105
+ }
2106
+ function Transitioner() {
2107
+ const router = useRouter(), mountLoadForRouter = React.useRef({ router, mounted: !1 }), routerState = useRouterState({
2108
+ select: (s) => pick(s, ["isLoading", "location", "resolvedLocation", "isTransitioning"])
2109
+ }), [isTransitioning, startReactTransition_] = React.useTransition(), hasPendingMatches = useRouterState({
2110
+ select: (s) => s.matches.some((d) => d.status === "pending")
2111
+ }), previousIsLoading = usePrevious(routerState.isLoading), isAnyPending = routerState.isLoading || isTransitioning || hasPendingMatches, previousIsAnyPending = usePrevious(
2112
+ isAnyPending);
2113
+ return router.isServer || (router.startReactTransition = startReactTransition_), React.useEffect(() => {
2114
+ const unsub = router.history.subscribe(router.load), nextLocation = router.buildLocation({
2115
+ to: router.latestLocation.pathname,
2116
+ search: !0,
2117
+ params: !0,
2118
+ hash: !0,
2119
+ state: !0
2120
+ });
2121
+ return trimPathRight(router.latestLocation.href) !== trimPathRight(nextLocation.href) && router.commitLocation({ ...nextLocation, replace: !0 }), () => {
2122
+ unsub();
2123
+ };
2124
+ }, [router, router.history]), useLayoutEffect$1(() => {
2125
+ var _a;
2126
+ if ((_a = window.__TSR__) != null && _a.dehydrated || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted)
2127
+ return;
2128
+ mountLoadForRouter.current = { router, mounted: !0 }, (async () => {
2129
+ try {
2130
+ await router.load();
2131
+ } catch (err) {
2132
+ console.error(err);
2133
+ }
2134
+ })();
2135
+ }, [router]), useLayoutEffect$1(() => {
2136
+ if (previousIsLoading && !routerState.isLoading) {
2137
+ const toLocation = router.state.location, fromLocation = router.state.resolvedLocation, pathChanged = fromLocation.href !== toLocation.href;
2138
+ router.emit({
2139
+ type: "onLoad",
2140
+ // When the new URL has committed, when the new matches have been loaded into state.matches
2141
+ fromLocation,
2142
+ toLocation,
2143
+ pathChanged
2144
+ });
2145
+ }
2146
+ }, [previousIsLoading, router, routerState.isLoading]), useLayoutEffect$1(() => {
2147
+ if (previousIsAnyPending && !isAnyPending) {
2148
+ const toLocation = router.state.location, fromLocation = router.state.resolvedLocation, pathChanged = fromLocation.href !== toLocation.href;
2149
+ if (router.emit({
2150
+ type: "onResolved",
2151
+ fromLocation,
2152
+ toLocation,
2153
+ pathChanged
2154
+ }), router.__store.setState((s) => ({
2155
+ ...s,
2156
+ status: "idle",
2157
+ resolvedLocation: s.location
2158
+ })), document.querySelector && router.state.location.hash !== "") {
2159
+ const el = document.getElementById(router.state.location.hash);
2160
+ el && el.scrollIntoView();
2161
+ }
2162
+ }
2163
+ }, [isAnyPending, previousIsAnyPending, router]), null;
2164
+ }
2165
+ function SafeFragment(props) {
2166
+ return /* @__PURE__ */ jsx(Fragment, { children: props.children });
2167
+ }
2168
+ function renderRouteNotFound(router, route, data) {
2169
+ return route.options.notFoundComponent ? /* @__PURE__ */ jsx(route.options.notFoundComponent, { data }) : router.options.defaultNotFoundComponent ? /* @__PURE__ */ jsx(
2170
+ router.options.defaultNotFoundComponent, { data }) : /* @__PURE__ */ jsx(DefaultGlobalNotFound, {});
2171
+ }
2172
+ function Match({ matchId }) {
2173
+ var _a, _b;
2174
+ const router = useRouter(), routeId = useRouterState({
2175
+ select: (s) => {
2176
+ var _a2;
2177
+ return (_a2 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;
2178
+ }
2179
+ });
2180
+ invariant(
2181
+ routeId
2182
+ );
2183
+ const route = router.routesById[routeId], PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent, pendingElement = PendingComponent ?
2184
+ /* @__PURE__ */ jsx(PendingComponent, {}) : null, routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent, routeOnCatch = route.
2185
+ options.onCatch ?? router.options.defaultOnCatch, routeNotFoundComponent = route.isRoot ? (
2186
+ // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component
2187
+ route.options.notFoundComponent ?? ((_a = router.options.notFoundRoute) == null ? void 0 : _a.options.component)
2188
+ ) : route.options.notFoundComponent, ResolvedSuspenseBoundary = (
2189
+ // If we're on the root route, allow forcefully wrapping in suspense
2190
+ (!route.isRoot || route.options.wrapInSuspense) && (route.options.wrapInSuspense ?? PendingComponent ?? ((_b = route.options.errorComponent) == null ?
2191
+ void 0 : _b.preload)) ? React.Suspense : SafeFragment
2192
+ ), ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment, ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment,
2193
+ resetKey = useRouterState({
2194
+ select: (s) => s.loadedAt
2195
+ });
2196
+ return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(ResolvedSuspenseBoundary, { fallback: pendingElement,
2197
+ children: /* @__PURE__ */ jsx(
2198
+ ResolvedCatchBoundary,
2199
+ {
2200
+ getResetKey: () => resetKey,
2201
+ errorComponent: routeErrorComponent || ErrorComponent,
2202
+ onCatch: (error, errorInfo) => {
2203
+ if (isNotFound(error)) throw error;
2204
+ routeOnCatch?.(error, errorInfo);
2205
+ },
2206
+ children: /* @__PURE__ */ jsx(
2207
+ ResolvedNotFoundBoundary,
2208
+ {
2209
+ fallback: (error) => {
2210
+ if (!routeNotFoundComponent || error.routeId && error.routeId !== routeId || !error.routeId && !route.isRoot)
2211
+ throw error;
2212
+ return React.createElement(routeNotFoundComponent, error);
2213
+ },
2214
+ children: /* @__PURE__ */ jsx(MatchInner, { matchId })
2215
+ }
2216
+ )
2217
+ }
2218
+ ) }) });
2219
+ }
2220
+ function MatchInner({ matchId }) {
2221
+ var _a, _b;
2222
+ const router = useRouter(), routeId = useRouterState({
2223
+ select: (s) => {
2224
+ var _a2;
2225
+ return (_a2 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;
2226
+ }
2227
+ }), route = router.routesById[routeId], matchIndex = useRouterState({
2228
+ select: (s) => s.matches.findIndex((d) => d.id === matchId)
2229
+ }), match = useRouterState({
2230
+ select: (s) => {
2231
+ const match2 = s.matches[matchIndex];
2232
+ return pick(match2, [
2233
+ "id",
2234
+ "status",
2235
+ "error",
2236
+ "loadPromise",
2237
+ "minPendingPromise"
2238
+ ]);
2239
+ }
2240
+ }), RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent;
2241
+ if (match.status === "notFound") {
2242
+ let error;
2243
+ return isServerSideError(match.error) ? error = (((_a = router.options.errorSerializer) == null ? void 0 : _a.deserialize) ?? defaultDeserializeError)(
2244
+ match.error.data) : error = match.error, invariant(isNotFound(error)), renderRouteNotFound(router, route, error);
2245
+ }
2246
+ if (match.status === "redirected")
2247
+ throw invariant(isRedirect(match.error)), match.loadPromise;
2248
+ if (match.status === "error") {
2249
+ if (router.isServer)
2250
+ return /* @__PURE__ */ jsx(
2251
+ RouteErrorComponent,
2252
+ {
2253
+ error: match.error,
2254
+ info: {
2255
+ componentStack: ""
2256
+ }
2257
+ }
2258
+ );
2259
+ throw isServerSideError(match.error) ? (((_b = router.options.errorSerializer) == null ? void 0 : _b.deserialize) ?? defaultDeserializeError)(match.
2260
+ error.data) : match.error;
2261
+ }
2262
+ if (match.status === "pending") {
2263
+ const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs;
2264
+ if (pendingMinMs && !match.minPendingPromise && !router.isServer) {
2265
+ const minPendingPromise = createControlledPromise();
2266
+ Promise.resolve().then(() => {
2267
+ router.updateMatch(match.id, (prev) => ({
2268
+ ...prev,
2269
+ minPendingPromise
2270
+ }));
2271
+ }), setTimeout(() => {
2272
+ minPendingPromise.resolve(), router.updateMatch(match.id, (prev) => ({
2273
+ ...prev,
2274
+ minPendingPromise: void 0
2275
+ }));
2276
+ }, pendingMinMs);
2277
+ }
2278
+ throw match.loadPromise;
2279
+ }
2280
+ const Comp = route.options.component ?? router.options.defaultComponent;
2281
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2282
+ Comp ? /* @__PURE__ */ jsx(Comp, {}) : /* @__PURE__ */ jsx(Outlet, {}),
2283
+ router.AfterEachMatch ? /* @__PURE__ */ jsx(router.AfterEachMatch, { match, matchIndex }) : null
2284
+ ] });
2285
+ }
2286
+ const Outlet = React.memo(function() {
2287
+ const router = useRouter(), matchId = React.useContext(matchContext), routeId = useRouterState({
2288
+ select: (s) => {
2289
+ var _a;
2290
+ return (_a = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a.routeId;
2291
+ }
2292
+ }), route = router.routesById[routeId], { parentGlobalNotFound } = useRouterState({
2293
+ select: (s) => {
2294
+ const parentMatch = s.matches.find((d) => d.id === matchId);
2295
+ return invariant(
2296
+ parentMatch
2297
+ ), {
2298
+ parentGlobalNotFound: parentMatch.globalNotFound
2299
+ };
2300
+ }
2301
+ }), childMatchId = useRouterState({
2302
+ select: (s) => {
2303
+ var _a;
2304
+ const matches = s.matches, index = matches.findIndex((d) => d.id === matchId);
2305
+ return (_a = matches[index + 1]) == null ? void 0 : _a.id;
2306
+ }
2307
+ });
2308
+ if (parentGlobalNotFound)
2309
+ return renderRouteNotFound(router, route, void 0);
2310
+ if (!childMatchId)
2311
+ return null;
2312
+ const nextMatch = /* @__PURE__ */ jsx(Match, { matchId: childMatchId }), pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(
2313
+ router.options.defaultPendingComponent, {}) : null;
2314
+ return matchId === rootRouteId ? /* @__PURE__ */ jsx(React.Suspense, { fallback: pendingElement, children: nextMatch }) : nextMatch;
2315
+ });
2316
+ function Matches() {
2317
+ const router = useRouter(), pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(router.options.defaultPendingComponent, {}) :
2318
+ null, ResolvedSuspense = router.state.matches.length ? SafeFragment : React.Suspense, inner = /* @__PURE__ */ jsxs(ResolvedSuspense, { fallback: pendingElement,
2319
+ children: [
2320
+ /* @__PURE__ */ jsx(Transitioner, {}),
2321
+ /* @__PURE__ */ jsx(MatchesInner, {})
2322
+ ] });
2323
+ return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;
2324
+ }
2325
+ function MatchesInner() {
2326
+ const matchId = useRouterState({
2327
+ select: (s) => {
2328
+ var _a;
2329
+ return (_a = s.matches[0]) == null ? void 0 : _a.id;
2330
+ }
2331
+ }), resetKey = useRouterState({
2332
+ select: (s) => s.loadedAt
2333
+ });
2334
+ return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(
2335
+ CatchBoundary,
2336
+ {
2337
+ getResetKey: () => resetKey,
2338
+ errorComponent: ErrorComponent,
2339
+ onCatch: (error) => {
2340
+ error.message || error.toString();
2341
+ },
2342
+ children: matchId ? /* @__PURE__ */ jsx(Match, { matchId }) : null
2343
+ }
2344
+ ) });
2345
+ }
2346
+ function RouterContextProvider({
2347
+ router,
2348
+ children,
2349
+ ...rest
2350
+ }) {
2351
+ router.update({
2352
+ ...router.options,
2353
+ ...rest,
2354
+ context: {
2355
+ ...router.options.context,
2356
+ ...rest.context
2357
+ }
2358
+ });
2359
+ const routerContext2 = getRouterContext(), provider = /* @__PURE__ */ jsx(routerContext2.Provider, { value: router, children });
2360
+ return router.options.Wrap ? /* @__PURE__ */ jsx(router.options.Wrap, { children: provider }) : provider;
2361
+ }
2362
+ function RouterProvider({ router, ...rest }) {
2363
+ return /* @__PURE__ */ jsx(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ jsx(Matches, {}) });
2364
+ }
2365
+ const useLayoutEffect = typeof window < "u" ? React.useLayoutEffect : React.useEffect, windowKey = "window", delimiter = "___";
2366
+ let weakScrolledElements = /* @__PURE__ */ new WeakSet();
2367
+ const sessionsStorage = typeof window < "u" && window.sessionStorage, cache = sessionsStorage ? (() => {
2368
+ const storageKey = "tsr-scroll-restoration-v2";
2369
+ return {
2370
+ state: JSON.parse(
2371
+ window.sessionStorage.getItem(storageKey) || "null"
2372
+ ) || { cached: {}, next: {} },
2373
+ set: (updater) => {
2374
+ cache.state = functionalUpdate(updater, cache.state), window.sessionStorage.setItem(storageKey, JSON.stringify(cache.state));
2375
+ }
2376
+ };
2377
+ })() : void 0, defaultGetKey = (location) => location.state.key || location.href;
2378
+ function useScrollRestoration(options) {
2379
+ const router = useRouter();
2380
+ useLayoutEffect(() => {
2381
+ const getKey = options?.getKey || defaultGetKey, { history } = window;
2382
+ history.scrollRestoration = "manual";
2383
+ const onScroll = (event) => {
2384
+ if (weakScrolledElements.has(event.target)) return;
2385
+ weakScrolledElements.add(event.target);
2386
+ let elementSelector = "";
2387
+ if (event.target === document || event.target === window)
2388
+ elementSelector = windowKey;
2389
+ else {
2390
+ const attrId = event.target.getAttribute(
2391
+ "data-scroll-restoration-id"
2392
+ );
2393
+ attrId ? elementSelector = `[data-scroll-restoration-id="${attrId}"]` : elementSelector = getCssSelector(event.target);
2394
+ }
2395
+ cache.state.next[elementSelector] || cache.set((c) => ({
2396
+ ...c,
2397
+ next: {
2398
+ ...c.next,
2399
+ [elementSelector]: {
2400
+ scrollX: NaN,
2401
+ scrollY: NaN
2402
+ }
2403
+ }
2404
+ }));
2405
+ };
2406
+ typeof document < "u" && document.addEventListener("scroll", onScroll, !0);
2407
+ const unsubOnBeforeLoad = router.subscribe("onBeforeLoad", (event) => {
2408
+ if (event.pathChanged) {
2409
+ const restoreKey = getKey(event.fromLocation);
2410
+ for (const elementSelector in cache.state.next) {
2411
+ const entry = cache.state.next[elementSelector];
2412
+ if (elementSelector === windowKey)
2413
+ entry.scrollX = window.scrollX || 0, entry.scrollY = window.scrollY || 0;
2414
+ else if (elementSelector) {
2415
+ const element = document.querySelector(elementSelector);
2416
+ entry.scrollX = element?.scrollLeft || 0, entry.scrollY = element?.scrollTop || 0;
2417
+ }
2418
+ cache.set((c) => {
2419
+ const next = { ...c.next };
2420
+ return delete next[elementSelector], {
2421
+ ...c,
2422
+ next,
2423
+ cached: {
2424
+ ...c.cached,
2425
+ [[restoreKey, elementSelector].join(delimiter)]: entry
2426
+ }
2427
+ };
2428
+ });
2429
+ }
2430
+ }
2431
+ }), unsubOnResolved = router.subscribe("onResolved", (event) => {
2432
+ if (event.pathChanged) {
2433
+ if (!router.resetNextScroll)
2434
+ return;
2435
+ router.resetNextScroll = !0;
2436
+ const restoreKey = getKey(event.toLocation);
2437
+ let windowRestored = !1;
2438
+ for (const cacheKey in cache.state.cached) {
2439
+ const entry = cache.state.cached[cacheKey], [key, elementSelector] = cacheKey.split(delimiter);
2440
+ if (key === restoreKey) {
2441
+ if (elementSelector === windowKey)
2442
+ windowRestored = !0, window.scrollTo(entry.scrollX, entry.scrollY);
2443
+ else if (elementSelector) {
2444
+ const element = document.querySelector(elementSelector);
2445
+ element && (element.scrollLeft = entry.scrollX, element.scrollTop = entry.scrollY);
2446
+ }
2447
+ }
2448
+ }
2449
+ windowRestored || window.scrollTo(0, 0), cache.set((c) => ({ ...c, next: {} })), weakScrolledElements = /* @__PURE__ */ new WeakSet();
2450
+ }
2451
+ });
2452
+ return () => {
2453
+ document.removeEventListener("scroll", onScroll), unsubOnBeforeLoad(), unsubOnResolved();
2454
+ };
2455
+ }, [options?.getKey, router]);
2456
+ }
2457
+ function ScrollRestoration(props) {
2458
+ return useScrollRestoration(props), null;
2459
+ }
2460
+ function getCssSelector(el) {
2461
+ const path = [];
2462
+ let parent;
2463
+ for (; parent = el.parentNode; )
2464
+ path.unshift(
2465
+ `${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`
2466
+ ), el = parent;
2467
+ return `${path.join(" > ")}`.toLowerCase();
2468
+ }
2469
+ export {
2470
+ Link as L,
2471
+ Outlet as O,
2472
+ RouterProvider as R,
2473
+ ScrollRestoration as S,
2474
+ createHashHistory as a,
2475
+ createBrowserHistory as b,
2476
+ createRouter as c,
2477
+ createRootRouteWithContext as d,
2478
+ createFileRoute as e,
2479
+ useParams as f,
2480
+ useRouterState as g,
2481
+ isNotFound as i,
2482
+ notFound as n,
2483
+ useRouter as u
2484
+ };