@epic-web/workshop-app 4.0.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 (2191) hide show
  1. package/README.md +10 -0
  2. package/bin/epicshop.js +84 -0
  3. package/build/client/app-default.css +39 -0
  4. package/build/client/assets/_-ByTWgb53.js +2 -0
  5. package/build/client/assets/_-ByTWgb53.js.map +1 -0
  6. package/build/client/assets/_-l0sNRNKZ.js +2 -0
  7. package/build/client/assets/_-l0sNRNKZ.js.map +1 -0
  8. package/build/client/assets/_exerciseNumber-B_VU-pG1.js +2 -0
  9. package/build/client/assets/_exerciseNumber-B_VU-pG1.js.map +1 -0
  10. package/build/client/assets/_exerciseNumber_._stepNumber-D1wwEMQx.js +2 -0
  11. package/build/client/assets/_exerciseNumber_._stepNumber-D1wwEMQx.js.map +1 -0
  12. package/build/client/assets/_exerciseNumber_._stepNumber.index-l0sNRNKZ.js +2 -0
  13. package/build/client/assets/_exerciseNumber_._stepNumber.index-l0sNRNKZ.js.map +1 -0
  14. package/build/client/assets/_exerciseNumber_.finished-DldgXnJy.js +2 -0
  15. package/build/client/assets/_exerciseNumber_.finished-DldgXnJy.js.map +1 -0
  16. package/build/client/assets/_layout--icRfEZS.js +2 -0
  17. package/build/client/assets/_layout--icRfEZS.js.map +1 -0
  18. package/build/client/assets/_layout-BaPtC79F.js +2 -0
  19. package/build/client/assets/_layout-BaPtC79F.js.map +1 -0
  20. package/build/client/assets/_layout-Bj9PyQQD.js +2 -0
  21. package/build/client/assets/_layout-Bj9PyQQD.js.map +1 -0
  22. package/build/client/assets/_layout-CIgVeko6.js +2 -0
  23. package/build/client/assets/_layout-CIgVeko6.js.map +1 -0
  24. package/build/client/assets/account-Bk4o4AzZ.js +2 -0
  25. package/build/client/assets/account-Bk4o4AzZ.js.map +1 -0
  26. package/build/client/assets/api._-l0sNRNKZ.js +2 -0
  27. package/build/client/assets/api._-l0sNRNKZ.js.map +1 -0
  28. package/build/client/assets/app-B0HiIPBO.css +1 -0
  29. package/build/client/assets/app._id-l0sNRNKZ.js +2 -0
  30. package/build/client/assets/app._id-l0sNRNKZ.js.map +1 -0
  31. package/build/client/assets/app._id._-l0sNRNKZ.js +2 -0
  32. package/build/client/assets/app._id._-l0sNRNKZ.js.map +1 -0
  33. package/build/client/assets/app._id.api._-l0sNRNKZ.js +2 -0
  34. package/build/client/assets/app._id.api._-l0sNRNKZ.js.map +1 -0
  35. package/build/client/assets/app._id.epic_ws_.js_-l0sNRNKZ.js +2 -0
  36. package/build/client/assets/app._id.epic_ws_.js_-l0sNRNKZ.js.map +1 -0
  37. package/build/client/assets/app._id.test._testName-l0sNRNKZ.js +2 -0
  38. package/build/client/assets/app._id.test._testName-l0sNRNKZ.js.map +1 -0
  39. package/build/client/assets/apps-DP2rzg_V.js +2 -0
  40. package/build/client/assets/apps-DP2rzg_V.js.map +1 -0
  41. package/build/client/assets/apps-l0sNRNKZ.js +2 -0
  42. package/build/client/assets/apps-l0sNRNKZ.js.map +1 -0
  43. package/build/client/assets/button-DnQOyJAN.js +2 -0
  44. package/build/client/assets/button-DnQOyJAN.js.map +1 -0
  45. package/build/client/assets/client-hints-BHTHvBjk.js +24 -0
  46. package/build/client/assets/client-hints-BHTHvBjk.js.map +1 -0
  47. package/build/client/assets/clsx-B-dksMZM.js +2 -0
  48. package/build/client/assets/clsx-B-dksMZM.js.map +1 -0
  49. package/build/client/assets/components-Dj3sm47B.js +100 -0
  50. package/build/client/assets/components-Dj3sm47B.js.map +1 -0
  51. package/build/client/assets/diff-Blb5EPiO.js +2 -0
  52. package/build/client/assets/diff-Blb5EPiO.js.map +1 -0
  53. package/build/client/assets/diff-MSYB00VZ.js +42 -0
  54. package/build/client/assets/diff-MSYB00VZ.js.map +1 -0
  55. package/build/client/assets/discord-CK7yz4w6.js +2 -0
  56. package/build/client/assets/discord-CK7yz4w6.js.map +1 -0
  57. package/build/client/assets/discord-CsluX01E.js +2 -0
  58. package/build/client/assets/discord-CsluX01E.js.map +1 -0
  59. package/build/client/assets/discord.callback-l0sNRNKZ.js +2 -0
  60. package/build/client/assets/discord.callback-l0sNRNKZ.js.map +1 -0
  61. package/build/client/assets/entry.client-DBBrAxtJ.js +73 -0
  62. package/build/client/assets/entry.client-DBBrAxtJ.js.map +1 -0
  63. package/build/client/assets/epic-video-BwJwnV_j.js +2992 -0
  64. package/build/client/assets/epic-video-BwJwnV_j.js.map +1 -0
  65. package/build/client/assets/epic-video-DUnRvy1A.css +1 -0
  66. package/build/client/assets/error-boundary-Bg54_knF.js +2 -0
  67. package/build/client/assets/error-boundary-Bg54_knF.js.map +1 -0
  68. package/build/client/assets/exercises-l0sNRNKZ.js +2 -0
  69. package/build/client/assets/exercises-l0sNRNKZ.js.map +1 -0
  70. package/build/client/assets/finished-CGll5TOI.js +2 -0
  71. package/build/client/assets/finished-CGll5TOI.js.map +1 -0
  72. package/build/client/assets/index-B8k-Gd1G.js +2 -0
  73. package/build/client/assets/index-B8k-Gd1G.js.map +1 -0
  74. package/build/client/assets/index-BL4aE6WC.js +8 -0
  75. package/build/client/assets/index-BL4aE6WC.js.map +1 -0
  76. package/build/client/assets/index-BfoHqrT5.js +2 -0
  77. package/build/client/assets/index-BfoHqrT5.js.map +1 -0
  78. package/build/client/assets/index-D1WEsmVZ.js +36 -0
  79. package/build/client/assets/index-D1WEsmVZ.js.map +1 -0
  80. package/build/client/assets/index-DP2rzg_V.js +2 -0
  81. package/build/client/assets/index-DP2rzg_V.js.map +1 -0
  82. package/build/client/assets/index-DqBktlAI.js +2 -0
  83. package/build/client/assets/index-DqBktlAI.js.map +1 -0
  84. package/build/client/assets/index-K6Dvbx-E.js +2 -0
  85. package/build/client/assets/index-K6Dvbx-E.js.map +1 -0
  86. package/build/client/assets/index-l0sNRNKZ.js +2 -0
  87. package/build/client/assets/index-l0sNRNKZ.js.map +1 -0
  88. package/build/client/assets/index-zG3_j9lj.js +2 -0
  89. package/build/client/assets/index-zG3_j9lj.js.map +1 -0
  90. package/build/client/assets/kcd_ws_.js_-l0sNRNKZ.js +2 -0
  91. package/build/client/assets/kcd_ws_.js_-l0sNRNKZ.js.map +1 -0
  92. package/build/client/assets/launch-editor-l0sNRNKZ.js +2 -0
  93. package/build/client/assets/launch-editor-l0sNRNKZ.js.map +1 -0
  94. package/build/client/assets/loading-CaagEELb.js +2 -0
  95. package/build/client/assets/loading-CaagEELb.js.map +1 -0
  96. package/build/client/assets/login-2BiFV7_R.js +2 -0
  97. package/build/client/assets/login-2BiFV7_R.js.map +1 -0
  98. package/build/client/assets/login-sse-l0sNRNKZ.js +2 -0
  99. package/build/client/assets/login-sse-l0sNRNKZ.js.map +1 -0
  100. package/build/client/assets/manifest-92896199.js +1 -0
  101. package/build/client/assets/mdx-DdywIxB6.js +2 -0
  102. package/build/client/assets/mdx-DdywIxB6.js.map +1 -0
  103. package/build/client/assets/misc-CXGQ7VS9.js +2 -0
  104. package/build/client/assets/misc-CXGQ7VS9.js.map +1 -0
  105. package/build/client/assets/nav-chevrons-D8c9lJW6.js +2 -0
  106. package/build/client/assets/nav-chevrons-D8c9lJW6.js.map +1 -0
  107. package/build/client/assets/onboarding-eFvyCmxD.js +2 -0
  108. package/build/client/assets/onboarding-eFvyCmxD.js.map +1 -0
  109. package/build/client/assets/presence-u-05JV3Z.js +28 -0
  110. package/build/client/assets/presence-u-05JV3Z.js.map +1 -0
  111. package/build/client/assets/processes-l0sNRNKZ.js +2 -0
  112. package/build/client/assets/processes-l0sNRNKZ.js.map +1 -0
  113. package/build/client/assets/progress-CBZt2pmu.js +2 -0
  114. package/build/client/assets/progress-CBZt2pmu.js.map +1 -0
  115. package/build/client/assets/progress-bar-DX6yYES2.js +2 -0
  116. package/build/client/assets/progress-bar-DX6yYES2.js.map +1 -0
  117. package/build/client/assets/progress-l0sNRNKZ.js +2 -0
  118. package/build/client/assets/progress-l0sNRNKZ.js.map +1 -0
  119. package/build/client/assets/root-BLcghf_N.js +68 -0
  120. package/build/client/assets/root-BLcghf_N.js.map +1 -0
  121. package/build/client/assets/set-playground-l0sNRNKZ.js +2 -0
  122. package/build/client/assets/set-playground-l0sNRNKZ.js.map +1 -0
  123. package/build/client/assets/start-l0sNRNKZ.js +2 -0
  124. package/build/client/assets/start-l0sNRNKZ.js.map +1 -0
  125. package/build/client/assets/support-QTdmLyE7.js +2 -0
  126. package/build/client/assets/support-QTdmLyE7.js.map +1 -0
  127. package/build/client/assets/tailwind-BStGdHyu.css +1 -0
  128. package/build/client/assets/test-l0sNRNKZ.js +2 -0
  129. package/build/client/assets/test-l0sNRNKZ.js.map +1 -0
  130. package/build/client/assets/test._testName-l0sNRNKZ.js +2 -0
  131. package/build/client/assets/test._testName-l0sNRNKZ.js.map +1 -0
  132. package/build/client/assets/tooltip-CVFWPOu0.js +2 -0
  133. package/build/client/assets/tooltip-CVFWPOu0.js.map +1 -0
  134. package/build/client/assets/update-mdx-cache-l0sNRNKZ.js +2 -0
  135. package/build/client/assets/update-mdx-cache-l0sNRNKZ.js.map +1 -0
  136. package/build/client/assets/use-event-source-DXlRuRq2.js +2 -0
  137. package/build/client/assets/use-event-source-DXlRuRq2.js.map +1 -0
  138. package/build/client/assets/user-DiGtbaa7.js +2 -0
  139. package/build/client/assets/user-DiGtbaa7.js.map +1 -0
  140. package/build/client/favicon.ico +0 -0
  141. package/build/client/favicon.png +0 -0
  142. package/build/client/favicon.svg +13 -0
  143. package/build/client/fonts/neogrotesk/0b8b755c-fee2-4661-9c8b-c5d1fbea901b.woff2 +0 -0
  144. package/build/client/fonts/neogrotesk/146d9d20-3e53-4e5d-beb2-1209bba5ac61.woff2 +0 -0
  145. package/build/client/fonts/neogrotesk/1798ef2b-5ee0-4f39-8b2c-ae3e36f07cd1.woff2 +0 -0
  146. package/build/client/fonts/neogrotesk/1eb2cb40-6822-4654-856c-8cbe652366b6.woff +0 -0
  147. package/build/client/fonts/neogrotesk/3b64793c-0bdb-4e4f-bf0e-cdf2e974d5f2.woff +0 -0
  148. package/build/client/fonts/neogrotesk/3bb44ed4-cf17-469c-8d0d-5946d10fdad1.woff +0 -0
  149. package/build/client/fonts/neogrotesk/4bd29470-1701-41fe-94b6-4a147512160c.woff +0 -0
  150. package/build/client/fonts/neogrotesk/5cdbf070-a094-44c8-b8f1-17a00a19c959.woff2 +0 -0
  151. package/build/client/fonts/neogrotesk/6d439be9-37df-4912-ac09-388ce938fa46.woff2 +0 -0
  152. package/build/client/fonts/neogrotesk/7fc2971f-a9c2-4e09-bd24-bfd4ee6e97b3.woff +0 -0
  153. package/build/client/fonts/neogrotesk/861b65ee-56bd-4057-9af4-3b2903af231e.woff +0 -0
  154. package/build/client/fonts/neogrotesk/8cf836d9-a49e-4387-bcbd-4800766e5d24.woff +0 -0
  155. package/build/client/fonts/neogrotesk/8d61128d-534c-4793-9668-b98bcc2e5969.woff2 +0 -0
  156. package/build/client/fonts/neogrotesk/98423f75-c341-4161-8b92-7cd5c05081e5.woff +0 -0
  157. package/build/client/fonts/neogrotesk/a1456726-ad0d-4f5e-9d8f-ce92e8ce375d.woff2 +0 -0
  158. package/build/client/fonts/neogrotesk/af81e7d2-0bb1-4aa0-bc76-adb78338c568.woff +0 -0
  159. package/build/client/fonts/neogrotesk/d1302ad5-ceee-47cb-a0fa-2da6bd0d4d54.woff2 +0 -0
  160. package/build/client/fonts/neogrotesk/e7e15c31-aad1-4384-abd3-0671ccd03251.woff +0 -0
  161. package/build/client/fonts/neogrotesk/ec6cb127-161b-469c-9816-69489032a234.woff2 +0 -0
  162. package/build/client/fonts/neogrotesk/f480430c-6c50-4ae3-9abb-e92c484f84d6.woff2 +0 -0
  163. package/build/client/icons.svg +529 -0
  164. package/build/client/neogrotesk-font.css +100 -0
  165. package/build/server/index.js +12875 -0
  166. package/build/server/index.js.map +1 -0
  167. package/dist/server/index.js +176 -0
  168. package/node_modules/@babel/runtime/LICENSE +22 -0
  169. package/node_modules/@babel/runtime/README.md +19 -0
  170. package/node_modules/@babel/runtime/helpers/AsyncGenerator.js +64 -0
  171. package/node_modules/@babel/runtime/helpers/AwaitValue.js +4 -0
  172. package/node_modules/@babel/runtime/helpers/OverloadYield.js +4 -0
  173. package/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +24 -0
  174. package/node_modules/@babel/runtime/helpers/applyDecs.js +236 -0
  175. package/node_modules/@babel/runtime/helpers/applyDecs2203.js +184 -0
  176. package/node_modules/@babel/runtime/helpers/applyDecs2203R.js +191 -0
  177. package/node_modules/@babel/runtime/helpers/applyDecs2301.js +222 -0
  178. package/node_modules/@babel/runtime/helpers/applyDecs2305.js +133 -0
  179. package/node_modules/@babel/runtime/helpers/applyDecs2311.js +124 -0
  180. package/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +6 -0
  181. package/node_modules/@babel/runtime/helpers/arrayWithHoles.js +4 -0
  182. package/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +5 -0
  183. package/node_modules/@babel/runtime/helpers/assertClassBrand.js +5 -0
  184. package/node_modules/@babel/runtime/helpers/assertThisInitialized.js +7 -0
  185. package/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +24 -0
  186. package/node_modules/@babel/runtime/helpers/asyncIterator.js +45 -0
  187. package/node_modules/@babel/runtime/helpers/asyncToGenerator.js +31 -0
  188. package/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +5 -0
  189. package/node_modules/@babel/runtime/helpers/callSuper.js +7 -0
  190. package/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
  191. package/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +6 -0
  192. package/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +18 -0
  193. package/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +7 -0
  194. package/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +11 -0
  195. package/node_modules/@babel/runtime/helpers/classCallCheck.js +6 -0
  196. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +5 -0
  197. package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +6 -0
  198. package/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +5 -0
  199. package/node_modules/@babel/runtime/helpers/classNameTDZError.js +4 -0
  200. package/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +7 -0
  201. package/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +7 -0
  202. package/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js +5 -0
  203. package/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +6 -0
  204. package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +7 -0
  205. package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +5 -0
  206. package/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +8 -0
  207. package/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js +5 -0
  208. package/node_modules/@babel/runtime/helpers/classPrivateGetter.js +5 -0
  209. package/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +6 -0
  210. package/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +6 -0
  211. package/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +4 -0
  212. package/node_modules/@babel/runtime/helpers/classPrivateSetter.js +5 -0
  213. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +9 -0
  214. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +9 -0
  215. package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +10 -0
  216. package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +6 -0
  217. package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +4 -0
  218. package/node_modules/@babel/runtime/helpers/construct.js +10 -0
  219. package/node_modules/@babel/runtime/helpers/createClass.js +19 -0
  220. package/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +53 -0
  221. package/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +20 -0
  222. package/node_modules/@babel/runtime/helpers/createSuper.js +18 -0
  223. package/node_modules/@babel/runtime/helpers/decorate.js +343 -0
  224. package/node_modules/@babel/runtime/helpers/defaults.js +12 -0
  225. package/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
  226. package/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +20 -0
  227. package/node_modules/@babel/runtime/helpers/defineProperty.js +16 -0
  228. package/node_modules/@babel/runtime/helpers/dispose.js +28 -0
  229. package/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +63 -0
  230. package/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +3 -0
  231. package/node_modules/@babel/runtime/helpers/esm/OverloadYield.js +3 -0
  232. package/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +23 -0
  233. package/node_modules/@babel/runtime/helpers/esm/applyDecs.js +235 -0
  234. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +183 -0
  235. package/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +190 -0
  236. package/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +221 -0
  237. package/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +132 -0
  238. package/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js +123 -0
  239. package/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +5 -0
  240. package/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +3 -0
  241. package/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +4 -0
  242. package/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js +4 -0
  243. package/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +6 -0
  244. package/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +23 -0
  245. package/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +44 -0
  246. package/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +30 -0
  247. package/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +4 -0
  248. package/node_modules/@babel/runtime/helpers/esm/callSuper.js +6 -0
  249. package/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +5 -0
  250. package/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +5 -0
  251. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +17 -0
  252. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +6 -0
  253. package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +10 -0
  254. package/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +5 -0
  255. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +4 -0
  256. package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +5 -0
  257. package/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +4 -0
  258. package/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +3 -0
  259. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +6 -0
  260. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +6 -0
  261. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js +4 -0
  262. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +5 -0
  263. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +6 -0
  264. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +4 -0
  265. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +7 -0
  266. package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js +4 -0
  267. package/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js +4 -0
  268. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +5 -0
  269. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +5 -0
  270. package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +3 -0
  271. package/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js +4 -0
  272. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +8 -0
  273. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +8 -0
  274. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +9 -0
  275. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +5 -0
  276. package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +3 -0
  277. package/node_modules/@babel/runtime/helpers/esm/construct.js +9 -0
  278. package/node_modules/@babel/runtime/helpers/esm/createClass.js +18 -0
  279. package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +52 -0
  280. package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
  281. package/node_modules/@babel/runtime/helpers/esm/createSuper.js +17 -0
  282. package/node_modules/@babel/runtime/helpers/esm/decorate.js +342 -0
  283. package/node_modules/@babel/runtime/helpers/esm/defaults.js +11 -0
  284. package/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +7 -0
  285. package/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +19 -0
  286. package/node_modules/@babel/runtime/helpers/esm/defineProperty.js +15 -0
  287. package/node_modules/@babel/runtime/helpers/esm/dispose.js +27 -0
  288. package/node_modules/@babel/runtime/helpers/esm/extends.js +14 -0
  289. package/node_modules/@babel/runtime/helpers/esm/get.js +17 -0
  290. package/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +6 -0
  291. package/node_modules/@babel/runtime/helpers/esm/identity.js +3 -0
  292. package/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js +26 -0
  293. package/node_modules/@babel/runtime/helpers/esm/inherits.js +17 -0
  294. package/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +6 -0
  295. package/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +9 -0
  296. package/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +3 -0
  297. package/node_modules/@babel/runtime/helpers/esm/instanceof.js +7 -0
  298. package/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +5 -0
  299. package/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +26 -0
  300. package/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +7 -0
  301. package/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +8 -0
  302. package/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +3 -0
  303. package/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +27 -0
  304. package/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +9 -0
  305. package/node_modules/@babel/runtime/helpers/esm/jsx.js +21 -0
  306. package/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +8 -0
  307. package/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +5 -0
  308. package/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +3 -0
  309. package/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +3 -0
  310. package/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js +3 -0
  311. package/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +3 -0
  312. package/node_modules/@babel/runtime/helpers/esm/objectSpread.js +16 -0
  313. package/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +22 -0
  314. package/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +16 -0
  315. package/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  316. package/node_modules/@babel/runtime/helpers/esm/package.json +3 -0
  317. package/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +10 -0
  318. package/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +3 -0
  319. package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +303 -0
  320. package/node_modules/@babel/runtime/helpers/esm/set.js +40 -0
  321. package/node_modules/@babel/runtime/helpers/esm/setFunctionName.js +11 -0
  322. package/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +7 -0
  323. package/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +7 -0
  324. package/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +7 -0
  325. package/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +7 -0
  326. package/node_modules/@babel/runtime/helpers/esm/superPropBase.js +8 -0
  327. package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +10 -0
  328. package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +7 -0
  329. package/node_modules/@babel/runtime/helpers/esm/tdz.js +3 -0
  330. package/node_modules/@babel/runtime/helpers/esm/temporalRef.js +5 -0
  331. package/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +1 -0
  332. package/node_modules/@babel/runtime/helpers/esm/toArray.js +7 -0
  333. package/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +7 -0
  334. package/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +11 -0
  335. package/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +6 -0
  336. package/node_modules/@babel/runtime/helpers/esm/toSetter.js +9 -0
  337. package/node_modules/@babel/runtime/helpers/esm/typeof.js +9 -0
  338. package/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +9 -0
  339. package/node_modules/@babel/runtime/helpers/esm/using.js +11 -0
  340. package/node_modules/@babel/runtime/helpers/esm/usingCtx.js +43 -0
  341. package/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +6 -0
  342. package/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +30 -0
  343. package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +50 -0
  344. package/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +3 -0
  345. package/node_modules/@babel/runtime/helpers/extends.js +15 -0
  346. package/node_modules/@babel/runtime/helpers/get.js +18 -0
  347. package/node_modules/@babel/runtime/helpers/getPrototypeOf.js +7 -0
  348. package/node_modules/@babel/runtime/helpers/identity.js +4 -0
  349. package/node_modules/@babel/runtime/helpers/importDeferProxy.js +27 -0
  350. package/node_modules/@babel/runtime/helpers/inherits.js +18 -0
  351. package/node_modules/@babel/runtime/helpers/inheritsLoose.js +7 -0
  352. package/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +10 -0
  353. package/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +4 -0
  354. package/node_modules/@babel/runtime/helpers/instanceof.js +8 -0
  355. package/node_modules/@babel/runtime/helpers/interopRequireDefault.js +6 -0
  356. package/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +27 -0
  357. package/node_modules/@babel/runtime/helpers/isNativeFunction.js +8 -0
  358. package/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +9 -0
  359. package/node_modules/@babel/runtime/helpers/iterableToArray.js +4 -0
  360. package/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +28 -0
  361. package/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +10 -0
  362. package/node_modules/@babel/runtime/helpers/jsx.js +22 -0
  363. package/node_modules/@babel/runtime/helpers/maybeArrayLike.js +9 -0
  364. package/node_modules/@babel/runtime/helpers/newArrowCheck.js +6 -0
  365. package/node_modules/@babel/runtime/helpers/nonIterableRest.js +4 -0
  366. package/node_modules/@babel/runtime/helpers/nonIterableSpread.js +4 -0
  367. package/node_modules/@babel/runtime/helpers/nullishReceiverError.js +4 -0
  368. package/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +4 -0
  369. package/node_modules/@babel/runtime/helpers/objectSpread.js +17 -0
  370. package/node_modules/@babel/runtime/helpers/objectSpread2.js +23 -0
  371. package/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +17 -0
  372. package/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +13 -0
  373. package/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +11 -0
  374. package/node_modules/@babel/runtime/helpers/readOnlyError.js +4 -0
  375. package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +304 -0
  376. package/node_modules/@babel/runtime/helpers/set.js +41 -0
  377. package/node_modules/@babel/runtime/helpers/setFunctionName.js +12 -0
  378. package/node_modules/@babel/runtime/helpers/setPrototypeOf.js +8 -0
  379. package/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +8 -0
  380. package/node_modules/@babel/runtime/helpers/slicedToArray.js +8 -0
  381. package/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +8 -0
  382. package/node_modules/@babel/runtime/helpers/superPropBase.js +9 -0
  383. package/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +11 -0
  384. package/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +8 -0
  385. package/node_modules/@babel/runtime/helpers/tdz.js +4 -0
  386. package/node_modules/@babel/runtime/helpers/temporalRef.js +6 -0
  387. package/node_modules/@babel/runtime/helpers/temporalUndefined.js +2 -0
  388. package/node_modules/@babel/runtime/helpers/toArray.js +8 -0
  389. package/node_modules/@babel/runtime/helpers/toConsumableArray.js +8 -0
  390. package/node_modules/@babel/runtime/helpers/toPrimitive.js +12 -0
  391. package/node_modules/@babel/runtime/helpers/toPropertyKey.js +7 -0
  392. package/node_modules/@babel/runtime/helpers/toSetter.js +10 -0
  393. package/node_modules/@babel/runtime/helpers/typeof.js +10 -0
  394. package/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +10 -0
  395. package/node_modules/@babel/runtime/helpers/using.js +12 -0
  396. package/node_modules/@babel/runtime/helpers/usingCtx.js +44 -0
  397. package/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +7 -0
  398. package/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +31 -0
  399. package/node_modules/@babel/runtime/helpers/wrapRegExp.js +51 -0
  400. package/node_modules/@babel/runtime/helpers/writeOnlyError.js +4 -0
  401. package/node_modules/@babel/runtime/package.json +1065 -0
  402. package/node_modules/@babel/runtime/regenerator/index.js +15 -0
  403. package/node_modules/@conform-to/dom/LICENSE +21 -0
  404. package/node_modules/@conform-to/dom/README +37 -0
  405. package/node_modules/@conform-to/dom/_virtual/_rollupPluginBabelHelpers.js +58 -0
  406. package/node_modules/@conform-to/dom/_virtual/_rollupPluginBabelHelpers.mjs +51 -0
  407. package/node_modules/@conform-to/dom/dom.d.ts +43 -0
  408. package/node_modules/@conform-to/dom/dom.js +104 -0
  409. package/node_modules/@conform-to/dom/dom.mjs +95 -0
  410. package/node_modules/@conform-to/dom/form.d.ts +147 -0
  411. package/node_modules/@conform-to/dom/form.js +578 -0
  412. package/node_modules/@conform-to/dom/form.mjs +574 -0
  413. package/node_modules/@conform-to/dom/formdata.d.ts +61 -0
  414. package/node_modules/@conform-to/dom/formdata.js +234 -0
  415. package/node_modules/@conform-to/dom/formdata.mjs +220 -0
  416. package/node_modules/@conform-to/dom/index.d.ts +4 -0
  417. package/node_modules/@conform-to/dom/index.js +20 -0
  418. package/node_modules/@conform-to/dom/index.mjs +4 -0
  419. package/node_modules/@conform-to/dom/package.json +42 -0
  420. package/node_modules/@conform-to/dom/submission.d.ts +135 -0
  421. package/node_modules/@conform-to/dom/submission.js +303 -0
  422. package/node_modules/@conform-to/dom/submission.mjs +286 -0
  423. package/node_modules/@conform-to/dom/util.d.ts +3 -0
  424. package/node_modules/@conform-to/dom/util.js +19 -0
  425. package/node_modules/@conform-to/dom/util.mjs +13 -0
  426. package/node_modules/@conform-to/react/LICENSE +21 -0
  427. package/node_modules/@conform-to/react/README +37 -0
  428. package/node_modules/@conform-to/react/_virtual/_rollupPluginBabelHelpers.js +87 -0
  429. package/node_modules/@conform-to/react/_virtual/_rollupPluginBabelHelpers.mjs +78 -0
  430. package/node_modules/@conform-to/react/context.d.ts +72 -0
  431. package/node_modules/@conform-to/react/context.js +258 -0
  432. package/node_modules/@conform-to/react/context.mjs +243 -0
  433. package/node_modules/@conform-to/react/helpers.d.ts +208 -0
  434. package/node_modules/@conform-to/react/helpers.js +222 -0
  435. package/node_modules/@conform-to/react/helpers.mjs +211 -0
  436. package/node_modules/@conform-to/react/hooks.d.ts +34 -0
  437. package/node_modules/@conform-to/react/hooks.js +88 -0
  438. package/node_modules/@conform-to/react/hooks.mjs +79 -0
  439. package/node_modules/@conform-to/react/index.d.ts +5 -0
  440. package/node_modules/@conform-to/react/index.js +30 -0
  441. package/node_modules/@conform-to/react/index.mjs +5 -0
  442. package/node_modules/@conform-to/react/integrations.d.ts +45 -0
  443. package/node_modules/@conform-to/react/integrations.js +285 -0
  444. package/node_modules/@conform-to/react/integrations.mjs +271 -0
  445. package/node_modules/@conform-to/react/package.json +53 -0
  446. package/node_modules/@conform-to/zod/LICENSE +21 -0
  447. package/node_modules/@conform-to/zod/README +37 -0
  448. package/node_modules/@conform-to/zod/_virtual/_rollupPluginBabelHelpers.js +58 -0
  449. package/node_modules/@conform-to/zod/_virtual/_rollupPluginBabelHelpers.mjs +51 -0
  450. package/node_modules/@conform-to/zod/coercion.d.ts +26 -0
  451. package/node_modules/@conform-to/zod/coercion.js +169 -0
  452. package/node_modules/@conform-to/zod/coercion.mjs +162 -0
  453. package/node_modules/@conform-to/zod/constraint.d.ts +3 -0
  454. package/node_modules/@conform-to/zod/constraint.js +100 -0
  455. package/node_modules/@conform-to/zod/constraint.mjs +96 -0
  456. package/node_modules/@conform-to/zod/index.d.ts +2 -0
  457. package/node_modules/@conform-to/zod/index.js +12 -0
  458. package/node_modules/@conform-to/zod/index.mjs +2 -0
  459. package/node_modules/@conform-to/zod/package.json +46 -0
  460. package/node_modules/@conform-to/zod/parse.d.ts +28 -0
  461. package/node_modules/@conform-to/zod/parse.js +64 -0
  462. package/node_modules/@conform-to/zod/parse.mjs +59 -0
  463. package/node_modules/@epic-web/client-hints/README.md +221 -0
  464. package/node_modules/@epic-web/client-hints/dist/color-scheme.d.ts +12 -0
  465. package/node_modules/@epic-web/client-hints/dist/color-scheme.js +25 -0
  466. package/node_modules/@epic-web/client-hints/dist/index.d.ts +6 -0
  467. package/node_modules/@epic-web/client-hints/dist/index.js +67 -0
  468. package/node_modules/@epic-web/client-hints/dist/reduced-motion.d.ts +12 -0
  469. package/node_modules/@epic-web/client-hints/dist/reduced-motion.js +25 -0
  470. package/node_modules/@epic-web/client-hints/dist/time-zone.d.ts +5 -0
  471. package/node_modules/@epic-web/client-hints/dist/time-zone.js +5 -0
  472. package/node_modules/@epic-web/client-hints/dist/utils.d.ts +9 -0
  473. package/node_modules/@epic-web/client-hints/dist/utils.js +1 -0
  474. package/node_modules/@epic-web/client-hints/package.json +71 -0
  475. package/node_modules/@epic-web/restore-scroll/README.md +103 -0
  476. package/node_modules/@epic-web/restore-scroll/dist/index.d.ts +4 -0
  477. package/node_modules/@epic-web/restore-scroll/dist/index.js +77 -0
  478. package/node_modules/@epic-web/restore-scroll/package.json +64 -0
  479. package/node_modules/@floating-ui/core/LICENSE +20 -0
  480. package/node_modules/@floating-ui/core/README.md +4 -0
  481. package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs +1 -0
  482. package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs +1141 -0
  483. package/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +521 -0
  484. package/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +521 -0
  485. package/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js +1022 -0
  486. package/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1022 -0
  487. package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js +1160 -0
  488. package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js +1 -0
  489. package/node_modules/@floating-ui/core/package.json +62 -0
  490. package/node_modules/@floating-ui/dom/LICENSE +20 -0
  491. package/node_modules/@floating-ui/dom/README.md +4 -0
  492. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs +1 -0
  493. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs +816 -0
  494. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +315 -0
  495. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts +315 -0
  496. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +679 -0
  497. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +679 -0
  498. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js +840 -0
  499. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.min.js +1 -0
  500. package/node_modules/@floating-ui/dom/package.json +70 -0
  501. package/node_modules/@floating-ui/react-dom/LICENSE +20 -0
  502. package/node_modules/@floating-ui/react-dom/README.md +3 -0
  503. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.d.mts +258 -0
  504. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.d.ts +258 -0
  505. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js +273 -0
  506. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +273 -0
  507. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js +348 -0
  508. package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.min.js +1 -0
  509. package/node_modules/@floating-ui/react-dom/package.json +76 -0
  510. package/node_modules/@floating-ui/utils/LICENSE +20 -0
  511. package/node_modules/@floating-ui/utils/README.md +4 -0
  512. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.browser.min.mjs +1 -0
  513. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.browser.mjs +129 -0
  514. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +98 -0
  515. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +98 -0
  516. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.browser.min.mjs +1 -0
  517. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.browser.mjs +128 -0
  518. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +43 -0
  519. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +43 -0
  520. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.esm.js +128 -0
  521. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +128 -0
  522. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.js +153 -0
  523. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.min.js +1 -0
  524. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.esm.js +129 -0
  525. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +129 -0
  526. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.js +160 -0
  527. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.min.js +1 -0
  528. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +43 -0
  529. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.esm.js +128 -0
  530. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.umd.js +153 -0
  531. package/node_modules/@floating-ui/utils/dom/package.json +6 -0
  532. package/node_modules/@floating-ui/utils/package.json +69 -0
  533. package/node_modules/@radix-ui/number/README.md +13 -0
  534. package/node_modules/@radix-ui/number/dist/index.d.mts +3 -0
  535. package/node_modules/@radix-ui/number/dist/index.d.ts +3 -0
  536. package/node_modules/@radix-ui/number/dist/index.d.ts.map +1 -0
  537. package/node_modules/@radix-ui/number/dist/index.js +13 -0
  538. package/node_modules/@radix-ui/number/dist/index.js.map +1 -0
  539. package/node_modules/@radix-ui/number/dist/index.mjs +9 -0
  540. package/node_modules/@radix-ui/number/dist/index.mjs.map +1 -0
  541. package/node_modules/@radix-ui/number/package.json +41 -0
  542. package/node_modules/@radix-ui/primitive/README.md +13 -0
  543. package/node_modules/@radix-ui/primitive/dist/index.d.mts +5 -0
  544. package/node_modules/@radix-ui/primitive/dist/index.d.ts +5 -0
  545. package/node_modules/@radix-ui/primitive/dist/index.d.ts.map +1 -0
  546. package/node_modules/@radix-ui/primitive/dist/index.js +16 -0
  547. package/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
  548. package/node_modules/@radix-ui/primitive/dist/index.mjs +12 -0
  549. package/node_modules/@radix-ui/primitive/dist/index.mjs.map +1 -0
  550. package/node_modules/@radix-ui/primitive/package.json +41 -0
  551. package/node_modules/@radix-ui/react-accordion/README.md +13 -0
  552. package/node_modules/@radix-ui/react-accordion/dist/index.d.mts +113 -0
  553. package/node_modules/@radix-ui/react-accordion/dist/index.d.ts +113 -0
  554. package/node_modules/@radix-ui/react-accordion/dist/index.d.ts.map +1 -0
  555. package/node_modules/@radix-ui/react-accordion/dist/index.js +342 -0
  556. package/node_modules/@radix-ui/react-accordion/dist/index.js.map +1 -0
  557. package/node_modules/@radix-ui/react-accordion/dist/index.mjs +325 -0
  558. package/node_modules/@radix-ui/react-accordion/dist/index.mjs.map +1 -0
  559. package/node_modules/@radix-ui/react-accordion/package.json +64 -0
  560. package/node_modules/@radix-ui/react-arrow/README.md +13 -0
  561. package/node_modules/@radix-ui/react-arrow/dist/index.d.mts +10 -0
  562. package/node_modules/@radix-ui/react-arrow/dist/index.d.ts +10 -0
  563. package/node_modules/@radix-ui/react-arrow/dist/index.d.ts.map +1 -0
  564. package/node_modules/@radix-ui/react-arrow/dist/index.js +40 -0
  565. package/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -0
  566. package/node_modules/@radix-ui/react-arrow/dist/index.mjs +32 -0
  567. package/node_modules/@radix-ui/react-arrow/dist/index.mjs.map +1 -0
  568. package/node_modules/@radix-ui/react-arrow/package.json +56 -0
  569. package/node_modules/@radix-ui/react-collapsible/README.md +13 -0
  570. package/node_modules/@radix-ui/react-collapsible/dist/index.d.mts +32 -0
  571. package/node_modules/@radix-ui/react-collapsible/dist/index.d.ts +32 -0
  572. package/node_modules/@radix-ui/react-collapsible/dist/index.d.ts.map +1 -0
  573. package/node_modules/@radix-ui/react-collapsible/dist/index.js +177 -0
  574. package/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -0
  575. package/node_modules/@radix-ui/react-collapsible/dist/index.mjs +164 -0
  576. package/node_modules/@radix-ui/react-collapsible/dist/index.mjs.map +1 -0
  577. package/node_modules/@radix-ui/react-collapsible/package.json +63 -0
  578. package/node_modules/@radix-ui/react-collection/README.md +13 -0
  579. package/node_modules/@radix-ui/react-collection/dist/index.d.mts +22 -0
  580. package/node_modules/@radix-ui/react-collection/dist/index.d.ts +22 -0
  581. package/node_modules/@radix-ui/react-collection/dist/index.d.ts.map +1 -0
  582. package/node_modules/@radix-ui/react-collection/dist/index.js +117 -0
  583. package/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
  584. package/node_modules/@radix-ui/react-collection/dist/index.mjs +110 -0
  585. package/node_modules/@radix-ui/react-collection/dist/index.mjs.map +1 -0
  586. package/node_modules/@radix-ui/react-collection/package.json +59 -0
  587. package/node_modules/@radix-ui/react-compose-refs/README.md +13 -0
  588. package/node_modules/@radix-ui/react-compose-refs/dist/index.d.mts +14 -0
  589. package/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts +14 -0
  590. package/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts.map +1 -0
  591. package/node_modules/@radix-ui/react-compose-refs/dist/index.js +36 -0
  592. package/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
  593. package/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +31 -0
  594. package/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map +1 -0
  595. package/node_modules/@radix-ui/react-compose-refs/package.json +50 -0
  596. package/node_modules/@radix-ui/react-context/README.md +13 -0
  597. package/node_modules/@radix-ui/react-context/dist/index.d.mts +26 -0
  598. package/node_modules/@radix-ui/react-context/dist/index.d.ts +26 -0
  599. package/node_modules/@radix-ui/react-context/dist/index.d.ts.map +1 -0
  600. package/node_modules/@radix-ui/react-context/dist/index.js +133 -0
  601. package/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
  602. package/node_modules/@radix-ui/react-context/dist/index.mjs +128 -0
  603. package/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
  604. package/node_modules/@radix-ui/react-context/package.json +50 -0
  605. package/node_modules/@radix-ui/react-direction/README.md +13 -0
  606. package/node_modules/@radix-ui/react-direction/dist/index.d.mts +11 -0
  607. package/node_modules/@radix-ui/react-direction/dist/index.d.ts +11 -0
  608. package/node_modules/@radix-ui/react-direction/dist/index.d.ts.map +1 -0
  609. package/node_modules/@radix-ui/react-direction/dist/index.js +29 -0
  610. package/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -0
  611. package/node_modules/@radix-ui/react-direction/dist/index.mjs +23 -0
  612. package/node_modules/@radix-ui/react-direction/dist/index.mjs.map +1 -0
  613. package/node_modules/@radix-ui/react-direction/package.json +50 -0
  614. package/node_modules/@radix-ui/react-dismissable-layer/README.md +13 -0
  615. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts +51 -0
  616. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts +51 -0
  617. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts.map +1 -0
  618. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +293 -0
  619. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
  620. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +283 -0
  621. package/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +1 -0
  622. package/node_modules/@radix-ui/react-dismissable-layer/package.json +63 -0
  623. package/node_modules/@radix-ui/react-focus-guards/README.md +13 -0
  624. package/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts +9 -0
  625. package/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts +9 -0
  626. package/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts.map +1 -0
  627. package/node_modules/@radix-ui/react-focus-guards/dist/index.js +45 -0
  628. package/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
  629. package/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +39 -0
  630. package/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +1 -0
  631. package/node_modules/@radix-ui/react-focus-guards/package.json +50 -0
  632. package/node_modules/@radix-ui/react-focus-scope/README.md +13 -0
  633. package/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts +32 -0
  634. package/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts +32 -0
  635. package/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts.map +1 -0
  636. package/node_modules/@radix-ui/react-focus-scope/dist/index.js +300 -0
  637. package/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
  638. package/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +292 -0
  639. package/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map +1 -0
  640. package/node_modules/@radix-ui/react-focus-scope/package.json +58 -0
  641. package/node_modules/@radix-ui/react-id/README.md +13 -0
  642. package/node_modules/@radix-ui/react-id/dist/index.d.mts +3 -0
  643. package/node_modules/@radix-ui/react-id/dist/index.d.ts +3 -0
  644. package/node_modules/@radix-ui/react-id/dist/index.d.ts.map +1 -0
  645. package/node_modules/@radix-ui/react-id/dist/index.js +28 -0
  646. package/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
  647. package/node_modules/@radix-ui/react-id/dist/index.mjs +24 -0
  648. package/node_modules/@radix-ui/react-id/dist/index.mjs.map +1 -0
  649. package/node_modules/@radix-ui/react-id/package.json +51 -0
  650. package/node_modules/@radix-ui/react-popover/README.md +13 -0
  651. package/node_modules/@radix-ui/react-popover/dist/index.d.mts +84 -0
  652. package/node_modules/@radix-ui/react-popover/dist/index.d.ts +84 -0
  653. package/node_modules/@radix-ui/react-popover/dist/index.d.ts.map +1 -0
  654. package/node_modules/@radix-ui/react-popover/dist/index.js +342 -0
  655. package/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -0
  656. package/node_modules/@radix-ui/react-popover/dist/index.mjs +321 -0
  657. package/node_modules/@radix-ui/react-popover/dist/index.mjs.map +1 -0
  658. package/node_modules/@radix-ui/react-popover/package.json +70 -0
  659. package/node_modules/@radix-ui/react-popper/README.md +13 -0
  660. package/node_modules/@radix-ui/react-popper/dist/index.d.mts +45 -0
  661. package/node_modules/@radix-ui/react-popper/dist/index.d.ts +45 -0
  662. package/node_modules/@radix-ui/react-popper/dist/index.d.ts.map +1 -0
  663. package/node_modules/@radix-ui/react-popper/dist/index.js +341 -0
  664. package/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -0
  665. package/node_modules/@radix-ui/react-popper/dist/index.mjs +324 -0
  666. package/node_modules/@radix-ui/react-popper/dist/index.mjs.map +1 -0
  667. package/node_modules/@radix-ui/react-popper/package.json +65 -0
  668. package/node_modules/@radix-ui/react-portal/README.md +13 -0
  669. package/node_modules/@radix-ui/react-portal/dist/index.d.mts +14 -0
  670. package/node_modules/@radix-ui/react-portal/dist/index.d.ts +14 -0
  671. package/node_modules/@radix-ui/react-portal/dist/index.d.ts.map +1 -0
  672. package/node_modules/@radix-ui/react-portal/dist/index.js +37 -0
  673. package/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
  674. package/node_modules/@radix-ui/react-portal/dist/index.mjs +29 -0
  675. package/node_modules/@radix-ui/react-portal/dist/index.mjs.map +1 -0
  676. package/node_modules/@radix-ui/react-portal/package.json +56 -0
  677. package/node_modules/@radix-ui/react-presence/README.md +13 -0
  678. package/node_modules/@radix-ui/react-presence/dist/index.d.mts +10 -0
  679. package/node_modules/@radix-ui/react-presence/dist/index.d.ts +10 -0
  680. package/node_modules/@radix-ui/react-presence/dist/index.d.ts.map +1 -0
  681. package/node_modules/@radix-ui/react-presence/dist/index.js +143 -0
  682. package/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
  683. package/node_modules/@radix-ui/react-presence/dist/index.mjs +139 -0
  684. package/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -0
  685. package/node_modules/@radix-ui/react-presence/package.json +57 -0
  686. package/node_modules/@radix-ui/react-primitive/README.md +13 -0
  687. package/node_modules/@radix-ui/react-primitive/dist/index.d.mts +53 -0
  688. package/node_modules/@radix-ui/react-primitive/dist/index.d.ts +53 -0
  689. package/node_modules/@radix-ui/react-primitive/dist/index.d.ts.map +1 -0
  690. package/node_modules/@radix-ui/react-primitive/dist/index.js +105 -0
  691. package/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  692. package/node_modules/@radix-ui/react-primitive/dist/index.mjs +96 -0
  693. package/node_modules/@radix-ui/react-primitive/dist/index.mjs.map +1 -0
  694. package/node_modules/@radix-ui/react-primitive/package.json +59 -0
  695. package/node_modules/@radix-ui/react-roving-focus/README.md +13 -0
  696. package/node_modules/@radix-ui/react-roving-focus/dist/index.d.mts +43 -0
  697. package/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts +43 -0
  698. package/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts.map +1 -0
  699. package/node_modules/@radix-ui/react-roving-focus/dist/index.js +268 -0
  700. package/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -0
  701. package/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +257 -0
  702. package/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map +1 -0
  703. package/node_modules/@radix-ui/react-roving-focus/package.json +64 -0
  704. package/node_modules/@radix-ui/react-select/README.md +13 -0
  705. package/node_modules/@radix-ui/react-select/dist/index.d.mts +132 -0
  706. package/node_modules/@radix-ui/react-select/dist/index.d.ts +132 -0
  707. package/node_modules/@radix-ui/react-select/dist/index.d.ts.map +1 -0
  708. package/node_modules/@radix-ui/react-select/dist/index.js +1310 -0
  709. package/node_modules/@radix-ui/react-select/dist/index.js.map +1 -0
  710. package/node_modules/@radix-ui/react-select/dist/index.mjs +1271 -0
  711. package/node_modules/@radix-ui/react-select/dist/index.mjs.map +1 -0
  712. package/node_modules/@radix-ui/react-select/package.json +76 -0
  713. package/node_modules/@radix-ui/react-slot/README.md +13 -0
  714. package/node_modules/@radix-ui/react-slot/dist/index.d.mts +11 -0
  715. package/node_modules/@radix-ui/react-slot/dist/index.d.ts +11 -0
  716. package/node_modules/@radix-ui/react-slot/dist/index.d.ts.map +1 -0
  717. package/node_modules/@radix-ui/react-slot/dist/index.js +98 -0
  718. package/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  719. package/node_modules/@radix-ui/react-slot/dist/index.mjs +89 -0
  720. package/node_modules/@radix-ui/react-slot/dist/index.mjs.map +1 -0
  721. package/node_modules/@radix-ui/react-slot/package.json +51 -0
  722. package/node_modules/@radix-ui/react-tabs/README.md +13 -0
  723. package/node_modules/@radix-ui/react-tabs/dist/index.d.mts +55 -0
  724. package/node_modules/@radix-ui/react-tabs/dist/index.d.ts +55 -0
  725. package/node_modules/@radix-ui/react-tabs/dist/index.d.ts.map +1 -0
  726. package/node_modules/@radix-ui/react-tabs/dist/index.js +198 -0
  727. package/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -0
  728. package/node_modules/@radix-ui/react-tabs/dist/index.mjs +183 -0
  729. package/node_modules/@radix-ui/react-tabs/dist/index.mjs.map +1 -0
  730. package/node_modules/@radix-ui/react-tabs/package.json +63 -0
  731. package/node_modules/@radix-ui/react-toast/README.md +13 -0
  732. package/node_modules/@radix-ui/react-toast/dist/index.d.mts +119 -0
  733. package/node_modules/@radix-ui/react-toast/dist/index.d.ts +119 -0
  734. package/node_modules/@radix-ui/react-toast/dist/index.d.ts.map +1 -0
  735. package/node_modules/@radix-ui/react-toast/dist/index.js +751 -0
  736. package/node_modules/@radix-ui/react-toast/dist/index.js.map +1 -0
  737. package/node_modules/@radix-ui/react-toast/dist/index.mjs +730 -0
  738. package/node_modules/@radix-ui/react-toast/dist/index.mjs.map +1 -0
  739. package/node_modules/@radix-ui/react-toast/package.json +67 -0
  740. package/node_modules/@radix-ui/react-use-callback-ref/README.md +13 -0
  741. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts +7 -0
  742. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts +7 -0
  743. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts.map +1 -0
  744. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +27 -0
  745. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
  746. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +23 -0
  747. package/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map +1 -0
  748. package/node_modules/@radix-ui/react-use-callback-ref/package.json +50 -0
  749. package/node_modules/@radix-ui/react-use-controllable-state/README.md +13 -0
  750. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts +9 -0
  751. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts +9 -0
  752. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts.map +1 -0
  753. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +57 -0
  754. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
  755. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +53 -0
  756. package/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map +1 -0
  757. package/node_modules/@radix-ui/react-use-controllable-state/package.json +51 -0
  758. package/node_modules/@radix-ui/react-use-escape-keydown/README.md +13 -0
  759. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts +6 -0
  760. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts +6 -0
  761. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts.map +1 -0
  762. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +31 -0
  763. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
  764. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +27 -0
  765. package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map +1 -0
  766. package/node_modules/@radix-ui/react-use-escape-keydown/package.json +51 -0
  767. package/node_modules/@radix-ui/react-use-layout-effect/README.md +13 -0
  768. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts +11 -0
  769. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts +11 -0
  770. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts.map +1 -0
  771. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +20 -0
  772. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
  773. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +16 -0
  774. package/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map +1 -0
  775. package/node_modules/@radix-ui/react-use-layout-effect/package.json +50 -0
  776. package/node_modules/@radix-ui/react-use-previous/README.md +13 -0
  777. package/node_modules/@radix-ui/react-use-previous/dist/index.d.mts +3 -0
  778. package/node_modules/@radix-ui/react-use-previous/dist/index.d.ts +3 -0
  779. package/node_modules/@radix-ui/react-use-previous/dist/index.d.ts.map +1 -0
  780. package/node_modules/@radix-ui/react-use-previous/dist/index.js +30 -0
  781. package/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -0
  782. package/node_modules/@radix-ui/react-use-previous/dist/index.mjs +26 -0
  783. package/node_modules/@radix-ui/react-use-previous/dist/index.mjs.map +1 -0
  784. package/node_modules/@radix-ui/react-use-previous/package.json +50 -0
  785. package/node_modules/@radix-ui/react-use-rect/README.md +13 -0
  786. package/node_modules/@radix-ui/react-use-rect/dist/index.d.mts +8 -0
  787. package/node_modules/@radix-ui/react-use-rect/dist/index.d.ts +8 -0
  788. package/node_modules/@radix-ui/react-use-rect/dist/index.d.ts.map +1 -0
  789. package/node_modules/@radix-ui/react-use-rect/dist/index.js +34 -0
  790. package/node_modules/@radix-ui/react-use-rect/dist/index.js.map +1 -0
  791. package/node_modules/@radix-ui/react-use-rect/dist/index.mjs +30 -0
  792. package/node_modules/@radix-ui/react-use-rect/dist/index.mjs.map +1 -0
  793. package/node_modules/@radix-ui/react-use-rect/package.json +51 -0
  794. package/node_modules/@radix-ui/react-use-size/README.md +13 -0
  795. package/node_modules/@radix-ui/react-use-size/dist/index.d.mts +6 -0
  796. package/node_modules/@radix-ui/react-use-size/dist/index.d.ts +6 -0
  797. package/node_modules/@radix-ui/react-use-size/dist/index.d.ts.map +1 -0
  798. package/node_modules/@radix-ui/react-use-size/dist/index.js +61 -0
  799. package/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -0
  800. package/node_modules/@radix-ui/react-use-size/dist/index.mjs +57 -0
  801. package/node_modules/@radix-ui/react-use-size/dist/index.mjs.map +1 -0
  802. package/node_modules/@radix-ui/react-use-size/package.json +54 -0
  803. package/node_modules/@radix-ui/react-visually-hidden/README.md +13 -0
  804. package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.mts +10 -0
  805. package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.ts +10 -0
  806. package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.ts.map +1 -0
  807. package/node_modules/@radix-ui/react-visually-hidden/dist/index.js +47 -0
  808. package/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -0
  809. package/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +39 -0
  810. package/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs.map +1 -0
  811. package/node_modules/@radix-ui/react-visually-hidden/package.json +56 -0
  812. package/node_modules/@radix-ui/rect/README.md +13 -0
  813. package/node_modules/@radix-ui/rect/dist/index.d.mts +16 -0
  814. package/node_modules/@radix-ui/rect/dist/index.d.ts +16 -0
  815. package/node_modules/@radix-ui/rect/dist/index.d.ts.map +1 -0
  816. package/node_modules/@radix-ui/rect/dist/index.js +70 -0
  817. package/node_modules/@radix-ui/rect/dist/index.js.map +1 -0
  818. package/node_modules/@radix-ui/rect/dist/index.mjs +66 -0
  819. package/node_modules/@radix-ui/rect/dist/index.mjs.map +1 -0
  820. package/node_modules/@radix-ui/rect/package.json +41 -0
  821. package/node_modules/@remix-run/react/CHANGELOG.md +907 -0
  822. package/node_modules/@remix-run/react/LICENSE.md +22 -0
  823. package/node_modules/@remix-run/react/README.md +13 -0
  824. package/node_modules/@remix-run/react/dist/_virtual/_rollupPluginBabelHelpers.js +30 -0
  825. package/node_modules/@remix-run/react/dist/browser.d.ts +35 -0
  826. package/node_modules/@remix-run/react/dist/browser.js +221 -0
  827. package/node_modules/@remix-run/react/dist/components.d.ts +128 -0
  828. package/node_modules/@remix-run/react/dist/components.js +874 -0
  829. package/node_modules/@remix-run/react/dist/data.d.ts +14 -0
  830. package/node_modules/@remix-run/react/dist/data.js +275 -0
  831. package/node_modules/@remix-run/react/dist/entry.d.ts +38 -0
  832. package/node_modules/@remix-run/react/dist/errorBoundaries.d.ts +33 -0
  833. package/node_modules/@remix-run/react/dist/errorBoundaries.js +165 -0
  834. package/node_modules/@remix-run/react/dist/errors.d.ts +2 -0
  835. package/node_modules/@remix-run/react/dist/errors.js +53 -0
  836. package/node_modules/@remix-run/react/dist/esm/_virtual/_rollupPluginBabelHelpers.js +26 -0
  837. package/node_modules/@remix-run/react/dist/esm/browser.js +261 -0
  838. package/node_modules/@remix-run/react/dist/esm/components.js +841 -0
  839. package/node_modules/@remix-run/react/dist/esm/data.js +263 -0
  840. package/node_modules/@remix-run/react/dist/esm/errorBoundaries.js +139 -0
  841. package/node_modules/@remix-run/react/dist/esm/errors.js +49 -0
  842. package/node_modules/@remix-run/react/dist/esm/fallback.js +35 -0
  843. package/node_modules/@remix-run/react/dist/esm/index.js +16 -0
  844. package/node_modules/@remix-run/react/dist/esm/invariant.js +17 -0
  845. package/node_modules/@remix-run/react/dist/esm/links.js +258 -0
  846. package/node_modules/@remix-run/react/dist/esm/markup.js +34 -0
  847. package/node_modules/@remix-run/react/dist/esm/routeModules.js +89 -0
  848. package/node_modules/@remix-run/react/dist/esm/routes.js +407 -0
  849. package/node_modules/@remix-run/react/dist/esm/scroll-restoration.js +84 -0
  850. package/node_modules/@remix-run/react/dist/esm/server.js +84 -0
  851. package/node_modules/@remix-run/react/dist/fallback.d.ts +2 -0
  852. package/node_modules/@remix-run/react/dist/fallback.js +59 -0
  853. package/node_modules/@remix-run/react/dist/index.d.ts +14 -0
  854. package/node_modules/@remix-run/react/dist/index.js +224 -0
  855. package/node_modules/@remix-run/react/dist/invariant.d.ts +2 -0
  856. package/node_modules/@remix-run/react/dist/invariant.js +19 -0
  857. package/node_modules/@remix-run/react/dist/links.d.ts +128 -0
  858. package/node_modules/@remix-run/react/dist/links.js +268 -0
  859. package/node_modules/@remix-run/react/dist/markup.d.ts +5 -0
  860. package/node_modules/@remix-run/react/dist/markup.js +39 -0
  861. package/node_modules/@remix-run/react/dist/routeModules.d.ts +132 -0
  862. package/node_modules/@remix-run/react/dist/routeModules.js +111 -0
  863. package/node_modules/@remix-run/react/dist/routes.d.ts +32 -0
  864. package/node_modules/@remix-run/react/dist/routes.js +434 -0
  865. package/node_modules/@remix-run/react/dist/scroll-restoration.d.ts +12 -0
  866. package/node_modules/@remix-run/react/dist/scroll-restoration.js +108 -0
  867. package/node_modules/@remix-run/react/dist/server.d.ts +13 -0
  868. package/node_modules/@remix-run/react/dist/server.js +108 -0
  869. package/node_modules/@remix-run/react/dist/tsconfig.tsbuildinfo +1 -0
  870. package/node_modules/@remix-run/react/dist/warnings.d.ts +1 -0
  871. package/node_modules/@remix-run/react/node_modules/@remix-run/router/CHANGELOG.md +716 -0
  872. package/node_modules/@remix-run/react/node_modules/@remix-run/router/LICENSE.md +23 -0
  873. package/node_modules/@remix-run/react/node_modules/@remix-run/router/README.md +135 -0
  874. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/history.d.ts +250 -0
  875. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/index.d.ts +9 -0
  876. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.cjs.js +4870 -0
  877. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.cjs.js.map +1 -0
  878. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.d.ts +508 -0
  879. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.js +4327 -0
  880. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.js.map +1 -0
  881. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.umd.js +4876 -0
  882. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.umd.js.map +1 -0
  883. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.umd.min.js +12 -0
  884. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/router.umd.min.js.map +1 -0
  885. package/node_modules/@remix-run/react/node_modules/@remix-run/router/dist/utils.d.ts +502 -0
  886. package/node_modules/@remix-run/react/node_modules/@remix-run/router/history.ts +746 -0
  887. package/node_modules/@remix-run/react/node_modules/@remix-run/router/index.ts +96 -0
  888. package/node_modules/@remix-run/react/node_modules/@remix-run/router/package.json +33 -0
  889. package/node_modules/@remix-run/react/node_modules/@remix-run/router/router.ts +4915 -0
  890. package/node_modules/@remix-run/react/node_modules/@remix-run/router/utils.ts +1598 -0
  891. package/node_modules/@remix-run/react/package.json +52 -0
  892. package/node_modules/@remix-run/server-runtime/CHANGELOG.md +957 -0
  893. package/node_modules/@remix-run/server-runtime/LICENSE.md +22 -0
  894. package/node_modules/@remix-run/server-runtime/README.md +26 -0
  895. package/node_modules/@remix-run/server-runtime/dist/build.d.ts +38 -0
  896. package/node_modules/@remix-run/server-runtime/dist/cookies.d.ts +69 -0
  897. package/node_modules/@remix-run/server-runtime/dist/cookies.js +173 -0
  898. package/node_modules/@remix-run/server-runtime/dist/crypto.d.ts +2 -0
  899. package/node_modules/@remix-run/server-runtime/dist/data.d.ts +28 -0
  900. package/node_modules/@remix-run/server-runtime/dist/data.js +114 -0
  901. package/node_modules/@remix-run/server-runtime/dist/dev.d.ts +10 -0
  902. package/node_modules/@remix-run/server-runtime/dist/dev.js +53 -0
  903. package/node_modules/@remix-run/server-runtime/dist/entry.d.ts +30 -0
  904. package/node_modules/@remix-run/server-runtime/dist/entry.js +22 -0
  905. package/node_modules/@remix-run/server-runtime/dist/errors.d.ts +51 -0
  906. package/node_modules/@remix-run/server-runtime/dist/errors.js +122 -0
  907. package/node_modules/@remix-run/server-runtime/dist/esm/cookies.js +168 -0
  908. package/node_modules/@remix-run/server-runtime/dist/esm/data.js +109 -0
  909. package/node_modules/@remix-run/server-runtime/dist/esm/dev.js +46 -0
  910. package/node_modules/@remix-run/server-runtime/dist/esm/entry.js +18 -0
  911. package/node_modules/@remix-run/server-runtime/dist/esm/errors.js +115 -0
  912. package/node_modules/@remix-run/server-runtime/dist/esm/formData.js +55 -0
  913. package/node_modules/@remix-run/server-runtime/dist/esm/headers.js +90 -0
  914. package/node_modules/@remix-run/server-runtime/dist/esm/index.js +20 -0
  915. package/node_modules/@remix-run/server-runtime/dist/esm/invariant.js +18 -0
  916. package/node_modules/@remix-run/server-runtime/dist/esm/markup.js +29 -0
  917. package/node_modules/@remix-run/server-runtime/dist/esm/mode.js +24 -0
  918. package/node_modules/@remix-run/server-runtime/dist/esm/responses.js +123 -0
  919. package/node_modules/@remix-run/server-runtime/dist/esm/routeMatching.js +23 -0
  920. package/node_modules/@remix-run/server-runtime/dist/esm/routes.js +77 -0
  921. package/node_modules/@remix-run/server-runtime/dist/esm/server.js +343 -0
  922. package/node_modules/@remix-run/server-runtime/dist/esm/serverHandoff.js +20 -0
  923. package/node_modules/@remix-run/server-runtime/dist/esm/sessions/cookieStorage.js +51 -0
  924. package/node_modules/@remix-run/server-runtime/dist/esm/sessions/memoryStorage.js +61 -0
  925. package/node_modules/@remix-run/server-runtime/dist/esm/sessions.js +145 -0
  926. package/node_modules/@remix-run/server-runtime/dist/esm/upload/errors.js +19 -0
  927. package/node_modules/@remix-run/server-runtime/dist/esm/upload/memoryUploadHandler.js +50 -0
  928. package/node_modules/@remix-run/server-runtime/dist/esm/warnings.js +19 -0
  929. package/node_modules/@remix-run/server-runtime/dist/formData.d.ts +15 -0
  930. package/node_modules/@remix-run/server-runtime/dist/formData.js +60 -0
  931. package/node_modules/@remix-run/server-runtime/dist/headers.d.ts +3 -0
  932. package/node_modules/@remix-run/server-runtime/dist/headers.js +94 -0
  933. package/node_modules/@remix-run/server-runtime/dist/index.d.ts +12 -0
  934. package/node_modules/@remix-run/server-runtime/dist/index.js +46 -0
  935. package/node_modules/@remix-run/server-runtime/dist/interface.d.ts +6 -0
  936. package/node_modules/@remix-run/server-runtime/dist/invariant.d.ts +2 -0
  937. package/node_modules/@remix-run/server-runtime/dist/invariant.js +22 -0
  938. package/node_modules/@remix-run/server-runtime/dist/jsonify.d.ts +33 -0
  939. package/node_modules/@remix-run/server-runtime/dist/links.d.ts +104 -0
  940. package/node_modules/@remix-run/server-runtime/dist/markup.d.ts +1 -0
  941. package/node_modules/@remix-run/server-runtime/dist/markup.js +33 -0
  942. package/node_modules/@remix-run/server-runtime/dist/mode.d.ts +9 -0
  943. package/node_modules/@remix-run/server-runtime/dist/mode.js +29 -0
  944. package/node_modules/@remix-run/server-runtime/dist/reexport.d.ts +14 -0
  945. package/node_modules/@remix-run/server-runtime/dist/responses.d.ts +47 -0
  946. package/node_modules/@remix-run/server-runtime/dist/responses.js +135 -0
  947. package/node_modules/@remix-run/server-runtime/dist/routeMatching.d.ts +8 -0
  948. package/node_modules/@remix-run/server-runtime/dist/routeMatching.js +27 -0
  949. package/node_modules/@remix-run/server-runtime/dist/routeModules.d.ts +211 -0
  950. package/node_modules/@remix-run/server-runtime/dist/routes.d.ts +31 -0
  951. package/node_modules/@remix-run/server-runtime/dist/routes.js +82 -0
  952. package/node_modules/@remix-run/server-runtime/dist/serialize.d.ts +25 -0
  953. package/node_modules/@remix-run/server-runtime/dist/server.d.ts +5 -0
  954. package/node_modules/@remix-run/server-runtime/dist/server.js +347 -0
  955. package/node_modules/@remix-run/server-runtime/dist/serverHandoff.d.ts +12 -0
  956. package/node_modules/@remix-run/server-runtime/dist/serverHandoff.js +24 -0
  957. package/node_modules/@remix-run/server-runtime/dist/sessions/cookieStorage.d.ts +23 -0
  958. package/node_modules/@remix-run/server-runtime/dist/sessions/cookieStorage.js +55 -0
  959. package/node_modules/@remix-run/server-runtime/dist/sessions/memoryStorage.d.ts +20 -0
  960. package/node_modules/@remix-run/server-runtime/dist/sessions/memoryStorage.js +65 -0
  961. package/node_modules/@remix-run/server-runtime/dist/sessions.d.ts +143 -0
  962. package/node_modules/@remix-run/server-runtime/dist/sessions.js +152 -0
  963. package/node_modules/@remix-run/server-runtime/dist/tsconfig.tsbuildinfo +1 -0
  964. package/node_modules/@remix-run/server-runtime/dist/typecheck.d.ts +4 -0
  965. package/node_modules/@remix-run/server-runtime/dist/upload/errors.d.ts +5 -0
  966. package/node_modules/@remix-run/server-runtime/dist/upload/errors.js +23 -0
  967. package/node_modules/@remix-run/server-runtime/dist/upload/memoryUploadHandler.d.ts +21 -0
  968. package/node_modules/@remix-run/server-runtime/dist/upload/memoryUploadHandler.js +54 -0
  969. package/node_modules/@remix-run/server-runtime/dist/warnings.d.ts +1 -0
  970. package/node_modules/@remix-run/server-runtime/dist/warnings.js +23 -0
  971. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/CHANGELOG.md +716 -0
  972. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/LICENSE.md +23 -0
  973. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/README.md +135 -0
  974. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/history.d.ts +250 -0
  975. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/index.d.ts +9 -0
  976. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js +4870 -0
  977. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.cjs.js.map +1 -0
  978. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.d.ts +508 -0
  979. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.js +4327 -0
  980. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.js.map +1 -0
  981. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.umd.js +4876 -0
  982. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.umd.js.map +1 -0
  983. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.umd.min.js +12 -0
  984. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/router.umd.min.js.map +1 -0
  985. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/dist/utils.d.ts +502 -0
  986. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/history.ts +746 -0
  987. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/index.ts +96 -0
  988. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/package.json +33 -0
  989. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/router.ts +4915 -0
  990. package/node_modules/@remix-run/server-runtime/node_modules/@remix-run/router/utils.ts +1598 -0
  991. package/node_modules/@remix-run/server-runtime/package.json +47 -0
  992. package/node_modules/@types/cookie/LICENSE +21 -0
  993. package/node_modules/@types/cookie/README.md +15 -0
  994. package/node_modules/@types/cookie/index.d.ts +154 -0
  995. package/node_modules/@types/cookie/package.json +30 -0
  996. package/node_modules/@web3-storage/multipart-parser/README.md +37 -0
  997. package/node_modules/@web3-storage/multipart-parser/cjs/src/index.js +218 -0
  998. package/node_modules/@web3-storage/multipart-parser/cjs/src/search.js +269 -0
  999. package/node_modules/@web3-storage/multipart-parser/cjs/src/utils.js +37 -0
  1000. package/node_modules/@web3-storage/multipart-parser/esm/package.json +4 -0
  1001. package/node_modules/@web3-storage/multipart-parser/esm/src/index.js +219 -0
  1002. package/node_modules/@web3-storage/multipart-parser/esm/src/search.js +269 -0
  1003. package/node_modules/@web3-storage/multipart-parser/esm/src/utils.js +28 -0
  1004. package/node_modules/@web3-storage/multipart-parser/index.js +1 -0
  1005. package/node_modules/@web3-storage/multipart-parser/package.json +44 -0
  1006. package/node_modules/@web3-storage/multipart-parser/src/index.js +257 -0
  1007. package/node_modules/@web3-storage/multipart-parser/src/search.js +329 -0
  1008. package/node_modules/@web3-storage/multipart-parser/src/utils.js +43 -0
  1009. package/node_modules/@web3-storage/multipart-parser/test/test.spec.js +65 -0
  1010. package/node_modules/@web3-storage/multipart-parser/tsconfig.json +41 -0
  1011. package/node_modules/@web3-storage/multipart-parser/types/index.d.ts +15 -0
  1012. package/node_modules/@web3-storage/multipart-parser/types/index.d.ts.map +1 -0
  1013. package/node_modules/@web3-storage/multipart-parser/types/search.d.ts +36 -0
  1014. package/node_modules/@web3-storage/multipart-parser/types/search.d.ts.map +1 -0
  1015. package/node_modules/@web3-storage/multipart-parser/types/utils.d.ts +18 -0
  1016. package/node_modules/@web3-storage/multipart-parser/types/utils.d.ts.map +1 -0
  1017. package/node_modules/aria-hidden/LICENSE +21 -0
  1018. package/node_modules/aria-hidden/README.md +99 -0
  1019. package/node_modules/aria-hidden/dist/es2015/index.d.ts +29 -0
  1020. package/node_modules/aria-hidden/dist/es2015/index.js +166 -0
  1021. package/node_modules/aria-hidden/dist/es2019/index.d.ts +29 -0
  1022. package/node_modules/aria-hidden/dist/es2019/index.js +155 -0
  1023. package/node_modules/aria-hidden/dist/es5/index.d.ts +29 -0
  1024. package/node_modules/aria-hidden/dist/es5/index.js +173 -0
  1025. package/node_modules/aria-hidden/package.json +70 -0
  1026. package/node_modules/assertion-error/LICENSE +21 -0
  1027. package/node_modules/assertion-error/README.md +68 -0
  1028. package/node_modules/assertion-error/index.d.ts +27 -0
  1029. package/node_modules/assertion-error/index.js +60 -0
  1030. package/node_modules/assertion-error/package.json +32 -0
  1031. package/node_modules/chai/CODEOWNERS +1 -0
  1032. package/node_modules/chai/CODE_OF_CONDUCT.md +58 -0
  1033. package/node_modules/chai/CONTRIBUTING.md +218 -0
  1034. package/node_modules/chai/History.md +1059 -0
  1035. package/node_modules/chai/LICENSE +21 -0
  1036. package/node_modules/chai/README.md +154 -0
  1037. package/node_modules/chai/ReleaseNotes.md +737 -0
  1038. package/node_modules/chai/chai.js +3992 -0
  1039. package/node_modules/chai/index.js +1 -0
  1040. package/node_modules/chai/lib/chai/assertion.js +164 -0
  1041. package/node_modules/chai/lib/chai/config.js +120 -0
  1042. package/node_modules/chai/lib/chai/core/assertions.js +3937 -0
  1043. package/node_modules/chai/lib/chai/interface/assert.js +3003 -0
  1044. package/node_modules/chai/lib/chai/interface/expect.js +50 -0
  1045. package/node_modules/chai/lib/chai/interface/should.js +211 -0
  1046. package/node_modules/chai/lib/chai/utils/addChainableMethod.js +148 -0
  1047. package/node_modules/chai/lib/chai/utils/addLengthGuard.js +60 -0
  1048. package/node_modules/chai/lib/chai/utils/addMethod.js +68 -0
  1049. package/node_modules/chai/lib/chai/utils/addProperty.js +72 -0
  1050. package/node_modules/chai/lib/chai/utils/compareByInspect.js +27 -0
  1051. package/node_modules/chai/lib/chai/utils/expectTypes.js +51 -0
  1052. package/node_modules/chai/lib/chai/utils/flag.js +33 -0
  1053. package/node_modules/chai/lib/chai/utils/getActual.js +20 -0
  1054. package/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
  1055. package/node_modules/chai/lib/chai/utils/getMessage.js +46 -0
  1056. package/node_modules/chai/lib/chai/utils/getOperator.js +54 -0
  1057. package/node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js +25 -0
  1058. package/node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js +27 -0
  1059. package/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
  1060. package/node_modules/chai/lib/chai/utils/index.js +91 -0
  1061. package/node_modules/chai/lib/chai/utils/inspect.js +30 -0
  1062. package/node_modules/chai/lib/chai/utils/isNaN.js +26 -0
  1063. package/node_modules/chai/lib/chai/utils/isProxyEnabled.js +24 -0
  1064. package/node_modules/chai/lib/chai/utils/objDisplay.js +47 -0
  1065. package/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +69 -0
  1066. package/node_modules/chai/lib/chai/utils/overwriteMethod.js +92 -0
  1067. package/node_modules/chai/lib/chai/utils/overwriteProperty.js +92 -0
  1068. package/node_modules/chai/lib/chai/utils/proxify.js +147 -0
  1069. package/node_modules/chai/lib/chai/utils/test.js +24 -0
  1070. package/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
  1071. package/node_modules/chai/lib/chai/utils/type-detect.js +16 -0
  1072. package/node_modules/chai/lib/chai.js +65 -0
  1073. package/node_modules/chai/package.json +58 -0
  1074. package/node_modules/chai/register-assert.cjs +3 -0
  1075. package/node_modules/chai/register-assert.js +3 -0
  1076. package/node_modules/chai/register-expect.cjs +3 -0
  1077. package/node_modules/chai/register-expect.js +3 -0
  1078. package/node_modules/chai/register-should.cjs +3 -0
  1079. package/node_modules/chai/register-should.js +3 -0
  1080. package/node_modules/chai/web-test-runner.config.js +17 -0
  1081. package/node_modules/chai-dom/.eslintrc +22 -0
  1082. package/node_modules/chai-dom/.travis.yml +15 -0
  1083. package/node_modules/chai-dom/LICENSE +24 -0
  1084. package/node_modules/chai-dom/README.md +267 -0
  1085. package/node_modules/chai-dom/bower.json +31 -0
  1086. package/node_modules/chai-dom/chai-dom.js +429 -0
  1087. package/node_modules/chai-dom/package.json +44 -0
  1088. package/node_modules/chai-dom/test/.eslintrc +12 -0
  1089. package/node_modules/chai-dom/test/index.html +27 -0
  1090. package/node_modules/chai-dom/test/tests.js +1124 -0
  1091. package/node_modules/chai-dom/testem.js +31 -0
  1092. package/node_modules/check-error/LICENSE +19 -0
  1093. package/node_modules/check-error/README.md +204 -0
  1094. package/node_modules/check-error/index.js +125 -0
  1095. package/node_modules/check-error/package.json +79 -0
  1096. package/node_modules/clsx/clsx.d.mts +6 -0
  1097. package/node_modules/clsx/clsx.d.ts +10 -0
  1098. package/node_modules/clsx/dist/clsx.js +1 -0
  1099. package/node_modules/clsx/dist/clsx.min.js +1 -0
  1100. package/node_modules/clsx/dist/clsx.mjs +1 -0
  1101. package/node_modules/clsx/dist/lite.js +1 -0
  1102. package/node_modules/clsx/dist/lite.mjs +1 -0
  1103. package/node_modules/clsx/license +9 -0
  1104. package/node_modules/clsx/package.json +60 -0
  1105. package/node_modules/clsx/readme.md +154 -0
  1106. package/node_modules/cookie/HISTORY.md +147 -0
  1107. package/node_modules/cookie/LICENSE +24 -0
  1108. package/node_modules/cookie/README.md +317 -0
  1109. package/node_modules/cookie/SECURITY.md +25 -0
  1110. package/node_modules/cookie/index.js +274 -0
  1111. package/node_modules/cookie/package.json +44 -0
  1112. package/node_modules/deep-eql/LICENSE +19 -0
  1113. package/node_modules/deep-eql/README.md +93 -0
  1114. package/node_modules/deep-eql/index.js +508 -0
  1115. package/node_modules/deep-eql/package.json +73 -0
  1116. package/node_modules/detect-node-es/LICENSE +21 -0
  1117. package/node_modules/detect-node-es/Readme.md +39 -0
  1118. package/node_modules/detect-node-es/es5/browser.js +2 -0
  1119. package/node_modules/detect-node-es/es5/node.d.ts +4 -0
  1120. package/node_modules/detect-node-es/es5/node.js +2 -0
  1121. package/node_modules/detect-node-es/esm/browser.js +2 -0
  1122. package/node_modules/detect-node-es/esm/node.js +2 -0
  1123. package/node_modules/detect-node-es/package.json +29 -0
  1124. package/node_modules/framer-motion/LICENSE.md +21 -0
  1125. package/node_modules/framer-motion/README.md +105 -0
  1126. package/node_modules/framer-motion/dist/cjs/dom-entry.js +53 -0
  1127. package/node_modules/framer-motion/dist/cjs/index-legacy-94465f57.js +5926 -0
  1128. package/node_modules/framer-motion/dist/cjs/index.js +6391 -0
  1129. package/node_modules/framer-motion/dist/dom-entry.d.ts +951 -0
  1130. package/node_modules/framer-motion/dist/dom.js +1 -0
  1131. package/node_modules/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +81 -0
  1132. package/node_modules/framer-motion/dist/es/animation/animate.mjs +83 -0
  1133. package/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +295 -0
  1134. package/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +84 -0
  1135. package/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +378 -0
  1136. package/node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +17 -0
  1137. package/node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +33 -0
  1138. package/node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs +31 -0
  1139. package/node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs +23 -0
  1140. package/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +12 -0
  1141. package/node_modules/framer-motion/dist/es/animation/generators/inertia.mjs +87 -0
  1142. package/node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs +51 -0
  1143. package/node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs +89 -0
  1144. package/node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs +131 -0
  1145. package/node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +17 -0
  1146. package/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs +9 -0
  1147. package/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs +80 -0
  1148. package/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs +17 -0
  1149. package/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +62 -0
  1150. package/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs +41 -0
  1151. package/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs +109 -0
  1152. package/node_modules/framer-motion/dist/es/animation/interfaces/single-value.mjs +11 -0
  1153. package/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +80 -0
  1154. package/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +66 -0
  1155. package/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs +29 -0
  1156. package/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +6 -0
  1157. package/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +62 -0
  1158. package/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs +80 -0
  1159. package/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +3 -0
  1160. package/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs +3 -0
  1161. package/node_modules/framer-motion/dist/es/animation/sequence/create.mjs +227 -0
  1162. package/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +21 -0
  1163. package/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs +31 -0
  1164. package/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs +14 -0
  1165. package/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs +32 -0
  1166. package/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs +40 -0
  1167. package/node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs +30 -0
  1168. package/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +7 -0
  1169. package/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +5 -0
  1170. package/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +5 -0
  1171. package/node_modules/framer-motion/dist/es/animation/utils/is-none.mjs +15 -0
  1172. package/node_modules/framer-motion/dist/es/animation/utils/stagger.mjs +26 -0
  1173. package/node_modules/framer-motion/dist/es/animation/utils/transitions.mjs +13 -0
  1174. package/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +75 -0
  1175. package/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +56 -0
  1176. package/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs +169 -0
  1177. package/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +66 -0
  1178. package/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs +14 -0
  1179. package/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs +31 -0
  1180. package/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs +67 -0
  1181. package/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs +43 -0
  1182. package/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs +53 -0
  1183. package/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs +33 -0
  1184. package/node_modules/framer-motion/dist/es/components/Reorder/index.mjs +9 -0
  1185. package/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +24 -0
  1186. package/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +10 -0
  1187. package/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs +5 -0
  1188. package/node_modules/framer-motion/dist/es/context/LazyContext.mjs +5 -0
  1189. package/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs +12 -0
  1190. package/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs +13 -0
  1191. package/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs +5 -0
  1192. package/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs +17 -0
  1193. package/node_modules/framer-motion/dist/es/context/PresenceContext.mjs +8 -0
  1194. package/node_modules/framer-motion/dist/es/context/ReorderContext.mjs +5 -0
  1195. package/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +8 -0
  1196. package/node_modules/framer-motion/dist/es/debug/record.mjs +7 -0
  1197. package/node_modules/framer-motion/dist/es/dom-entry.mjs +25 -0
  1198. package/node_modules/framer-motion/dist/es/easing/anticipate.mjs +5 -0
  1199. package/node_modules/framer-motion/dist/es/easing/back.mjs +9 -0
  1200. package/node_modules/framer-motion/dist/es/easing/circ.mjs +8 -0
  1201. package/node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs +51 -0
  1202. package/node_modules/framer-motion/dist/es/easing/ease.mjs +7 -0
  1203. package/node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs +5 -0
  1204. package/node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs +5 -0
  1205. package/node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +18 -0
  1206. package/node_modules/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +8 -0
  1207. package/node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +3 -0
  1208. package/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs +5 -0
  1209. package/node_modules/framer-motion/dist/es/easing/utils/map.mjs +37 -0
  1210. package/node_modules/framer-motion/dist/es/events/add-dom-event.mjs +6 -0
  1211. package/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs +8 -0
  1212. package/node_modules/framer-motion/dist/es/events/event-info.mjs +15 -0
  1213. package/node_modules/framer-motion/dist/es/events/use-dom-event.mjs +34 -0
  1214. package/node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs +18 -0
  1215. package/node_modules/framer-motion/dist/es/frameloop/batcher.mjs +65 -0
  1216. package/node_modules/framer-motion/dist/es/frameloop/frame.mjs +6 -0
  1217. package/node_modules/framer-motion/dist/es/frameloop/index-legacy.mjs +20 -0
  1218. package/node_modules/framer-motion/dist/es/frameloop/microtask.mjs +5 -0
  1219. package/node_modules/framer-motion/dist/es/frameloop/render-step.mjs +104 -0
  1220. package/node_modules/framer-motion/dist/es/frameloop/sync-time.mjs +31 -0
  1221. package/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +478 -0
  1222. package/node_modules/framer-motion/dist/es/gestures/drag/index.mjs +27 -0
  1223. package/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +88 -0
  1224. package/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +129 -0
  1225. package/node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs +53 -0
  1226. package/node_modules/framer-motion/dist/es/gestures/focus.mjs +41 -0
  1227. package/node_modules/framer-motion/dist/es/gestures/hover.mjs +31 -0
  1228. package/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs +156 -0
  1229. package/node_modules/framer-motion/dist/es/gestures/pan/index.mjs +48 -0
  1230. package/node_modules/framer-motion/dist/es/gestures/press.mjs +116 -0
  1231. package/node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs +20 -0
  1232. package/node_modules/framer-motion/dist/es/index.mjs +101 -0
  1233. package/node_modules/framer-motion/dist/es/motion/features/Feature.mjs +9 -0
  1234. package/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs +31 -0
  1235. package/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs +38 -0
  1236. package/node_modules/framer-motion/dist/es/motion/features/animations.mjs +13 -0
  1237. package/node_modules/framer-motion/dist/es/motion/features/definitions.mjs +28 -0
  1238. package/node_modules/framer-motion/dist/es/motion/features/drag.mjs +17 -0
  1239. package/node_modules/framer-motion/dist/es/motion/features/gestures.mjs +21 -0
  1240. package/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +132 -0
  1241. package/node_modules/framer-motion/dist/es/motion/features/layout.mjs +11 -0
  1242. package/node_modules/framer-motion/dist/es/motion/features/load-features.mjs +12 -0
  1243. package/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs +72 -0
  1244. package/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs +49 -0
  1245. package/node_modules/framer-motion/dist/es/motion/index.mjs +79 -0
  1246. package/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +11 -0
  1247. package/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs +12 -0
  1248. package/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs +3 -0
  1249. package/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +17 -0
  1250. package/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +33 -0
  1251. package/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs +75 -0
  1252. package/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs +81 -0
  1253. package/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs +57 -0
  1254. package/node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs +93 -0
  1255. package/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs +33 -0
  1256. package/node_modules/framer-motion/dist/es/projection/geometry/copy.mjs +20 -0
  1257. package/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs +122 -0
  1258. package/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs +41 -0
  1259. package/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs +54 -0
  1260. package/node_modules/framer-motion/dist/es/projection/geometry/models.mjs +17 -0
  1261. package/node_modules/framer-motion/dist/es/projection/geometry/utils.mjs +25 -0
  1262. package/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +13 -0
  1263. package/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +27 -0
  1264. package/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs +1519 -0
  1265. package/node_modules/framer-motion/dist/es/projection/node/group.mjs +24 -0
  1266. package/node_modules/framer-motion/dist/es/projection/node/state.mjs +19 -0
  1267. package/node_modules/framer-motion/dist/es/projection/shared/stack.mjs +112 -0
  1268. package/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +41 -0
  1269. package/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +35 -0
  1270. package/node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs +6 -0
  1271. package/node_modules/framer-motion/dist/es/projection/styles/transform.mjs +49 -0
  1272. package/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +14 -0
  1273. package/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs +14 -0
  1274. package/node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs +5 -0
  1275. package/node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs +26 -0
  1276. package/node_modules/framer-motion/dist/es/projection/utils/measure.mjs +17 -0
  1277. package/node_modules/framer-motion/dist/es/render/VisualElement.mjs +534 -0
  1278. package/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +121 -0
  1279. package/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +26 -0
  1280. package/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs +15 -0
  1281. package/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs +14 -0
  1282. package/node_modules/framer-motion/dist/es/render/dom/features-max.mjs +14 -0
  1283. package/node_modules/framer-motion/dist/es/render/dom/motion-minimal.mjs +9 -0
  1284. package/node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs +47 -0
  1285. package/node_modules/framer-motion/dist/es/render/dom/motion.mjs +42 -0
  1286. package/node_modules/framer-motion/dist/es/render/dom/resize/handle-element.mjs +64 -0
  1287. package/node_modules/framer-motion/dist/es/render/dom/resize/handle-window.mjs +30 -0
  1288. package/node_modules/framer-motion/dist/es/render/dom/resize/index.mjs +8 -0
  1289. package/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs +36 -0
  1290. package/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs +56 -0
  1291. package/node_modules/framer-motion/dist/es/render/dom/scroll/observe.mjs +18 -0
  1292. package/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +45 -0
  1293. package/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +59 -0
  1294. package/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +45 -0
  1295. package/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +35 -0
  1296. package/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +20 -0
  1297. package/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +48 -0
  1298. package/node_modules/framer-motion/dist/es/render/dom/scroll/supports.mjs +5 -0
  1299. package/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs +84 -0
  1300. package/node_modules/framer-motion/dist/es/render/dom/use-render.mjs +33 -0
  1301. package/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +6 -0
  1302. package/node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs +19 -0
  1303. package/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +42 -0
  1304. package/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs +57 -0
  1305. package/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +13 -0
  1306. package/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +30 -0
  1307. package/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +5 -0
  1308. package/node_modules/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +28 -0
  1309. package/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +65 -0
  1310. package/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +15 -0
  1311. package/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs +30 -0
  1312. package/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +15 -0
  1313. package/node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs +15 -0
  1314. package/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +10 -0
  1315. package/node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs +74 -0
  1316. package/node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs +6 -0
  1317. package/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +9 -0
  1318. package/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs +8 -0
  1319. package/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs +43 -0
  1320. package/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +59 -0
  1321. package/node_modules/framer-motion/dist/es/render/html/config-motion.mjs +12 -0
  1322. package/node_modules/framer-motion/dist/es/render/html/use-props.mjs +57 -0
  1323. package/node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs +74 -0
  1324. package/node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs +45 -0
  1325. package/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs +8 -0
  1326. package/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +27 -0
  1327. package/node_modules/framer-motion/dist/es/render/html/utils/render.mjs +9 -0
  1328. package/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +19 -0
  1329. package/node_modules/framer-motion/dist/es/render/html/utils/transform.mjs +28 -0
  1330. package/node_modules/framer-motion/dist/es/render/store.mjs +3 -0
  1331. package/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +47 -0
  1332. package/node_modules/framer-motion/dist/es/render/svg/config-motion.mjs +40 -0
  1333. package/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs +33 -0
  1334. package/node_modules/framer-motion/dist/es/render/svg/use-props.mjs +24 -0
  1335. package/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +52 -0
  1336. package/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +30 -0
  1337. package/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +8 -0
  1338. package/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +3 -0
  1339. package/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs +32 -0
  1340. package/node_modules/framer-motion/dist/es/render/svg/utils/render.mjs +12 -0
  1341. package/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +18 -0
  1342. package/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +18 -0
  1343. package/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +157 -0
  1344. package/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs +320 -0
  1345. package/node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs +3 -0
  1346. package/node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs +24 -0
  1347. package/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +13 -0
  1348. package/node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs +8 -0
  1349. package/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs +67 -0
  1350. package/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +24 -0
  1351. package/node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs +26 -0
  1352. package/node_modules/framer-motion/dist/es/render/utils/setters.mjs +27 -0
  1353. package/node_modules/framer-motion/dist/es/render/utils/variant-props.mjs +12 -0
  1354. package/node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs +6 -0
  1355. package/node_modules/framer-motion/dist/es/utils/array.mjs +21 -0
  1356. package/node_modules/framer-motion/dist/es/utils/clamp.mjs +9 -0
  1357. package/node_modules/framer-motion/dist/es/utils/delay.mjs +20 -0
  1358. package/node_modules/framer-motion/dist/es/utils/distance.mjs +9 -0
  1359. package/node_modules/framer-motion/dist/es/utils/errors.mjs +18 -0
  1360. package/node_modules/framer-motion/dist/es/utils/get-context-window.mjs +6 -0
  1361. package/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs +42 -0
  1362. package/node_modules/framer-motion/dist/es/utils/interpolate.mjs +75 -0
  1363. package/node_modules/framer-motion/dist/es/utils/is-browser.mjs +3 -0
  1364. package/node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs +6 -0
  1365. package/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs +7 -0
  1366. package/node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs +6 -0
  1367. package/node_modules/framer-motion/dist/es/utils/memo.mjs +10 -0
  1368. package/node_modules/framer-motion/dist/es/utils/mix/color.mjs +41 -0
  1369. package/node_modules/framer-motion/dist/es/utils/mix/complex.mjs +89 -0
  1370. package/node_modules/framer-motion/dist/es/utils/mix/index.mjs +14 -0
  1371. package/node_modules/framer-motion/dist/es/utils/mix/number.mjs +26 -0
  1372. package/node_modules/framer-motion/dist/es/utils/noop.mjs +3 -0
  1373. package/node_modules/framer-motion/dist/es/utils/offsets/default.mjs +9 -0
  1374. package/node_modules/framer-motion/dist/es/utils/offsets/fill.mjs +12 -0
  1375. package/node_modules/framer-motion/dist/es/utils/offsets/time.mjs +5 -0
  1376. package/node_modules/framer-motion/dist/es/utils/pipe.mjs +11 -0
  1377. package/node_modules/framer-motion/dist/es/utils/progress.mjs +18 -0
  1378. package/node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs +19 -0
  1379. package/node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs +5 -0
  1380. package/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +19 -0
  1381. package/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +47 -0
  1382. package/node_modules/framer-motion/dist/es/utils/resolve-value.mjs +11 -0
  1383. package/node_modules/framer-motion/dist/es/utils/shallow-compare.mjs +14 -0
  1384. package/node_modules/framer-motion/dist/es/utils/subscription-manager.mjs +40 -0
  1385. package/node_modules/framer-motion/dist/es/utils/time-conversion.mjs +10 -0
  1386. package/node_modules/framer-motion/dist/es/utils/transform.mjs +21 -0
  1387. package/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs +21 -0
  1388. package/node_modules/framer-motion/dist/es/utils/use-constant.mjs +18 -0
  1389. package/node_modules/framer-motion/dist/es/utils/use-cycle.mjs +47 -0
  1390. package/node_modules/framer-motion/dist/es/utils/use-force-update.mjs +19 -0
  1391. package/node_modules/framer-motion/dist/es/utils/use-in-view.mjs +23 -0
  1392. package/node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs +5 -0
  1393. package/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs +41 -0
  1394. package/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs +15 -0
  1395. package/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +6 -0
  1396. package/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs +13 -0
  1397. package/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs +7 -0
  1398. package/node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs +11 -0
  1399. package/node_modules/framer-motion/dist/es/utils/warn-once.mjs +11 -0
  1400. package/node_modules/framer-motion/dist/es/utils/wrap.mjs +6 -0
  1401. package/node_modules/framer-motion/dist/es/value/index.mjs +317 -0
  1402. package/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +14 -0
  1403. package/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +14 -0
  1404. package/node_modules/framer-motion/dist/es/value/types/color/hex.mjs +40 -0
  1405. package/node_modules/framer-motion/dist/es/value/types/color/hsla.mjs +22 -0
  1406. package/node_modules/framer-motion/dist/es/value/types/color/index.mjs +28 -0
  1407. package/node_modules/framer-motion/dist/es/value/types/color/rgba.mjs +25 -0
  1408. package/node_modules/framer-motion/dist/es/value/types/color/utils.mjs +23 -0
  1409. package/node_modules/framer-motion/dist/es/value/types/complex/filter.mjs +30 -0
  1410. package/node_modules/framer-motion/dist/es/value/types/complex/index.mjs +90 -0
  1411. package/node_modules/framer-motion/dist/es/value/types/numbers/index.mjs +17 -0
  1412. package/node_modules/framer-motion/dist/es/value/types/numbers/units.mjs +19 -0
  1413. package/node_modules/framer-motion/dist/es/value/types/utils.mjs +15 -0
  1414. package/node_modules/framer-motion/dist/es/value/use-combine-values.mjs +37 -0
  1415. package/node_modules/framer-motion/dist/es/value/use-computed.mjs +19 -0
  1416. package/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs +52 -0
  1417. package/node_modules/framer-motion/dist/es/value/use-motion-template.mjs +45 -0
  1418. package/node_modules/framer-motion/dist/es/value/use-motion-value.mjs +38 -0
  1419. package/node_modules/framer-motion/dist/es/value/use-scroll.mjs +39 -0
  1420. package/node_modules/framer-motion/dist/es/value/use-spring.mjs +73 -0
  1421. package/node_modules/framer-motion/dist/es/value/use-time.mjs +10 -0
  1422. package/node_modules/framer-motion/dist/es/value/use-transform.mjs +29 -0
  1423. package/node_modules/framer-motion/dist/es/value/use-velocity.mjs +35 -0
  1424. package/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs +50 -0
  1425. package/node_modules/framer-motion/dist/es/value/use-will-change/is.mjs +7 -0
  1426. package/node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs +3 -0
  1427. package/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +16 -0
  1428. package/node_modules/framer-motion/dist/framer-motion.dev.js +12195 -0
  1429. package/node_modules/framer-motion/dist/framer-motion.js +1 -0
  1430. package/node_modules/framer-motion/dist/index.d.ts +5242 -0
  1431. package/node_modules/framer-motion/dist/projection.dev.js +6433 -0
  1432. package/node_modules/framer-motion/dist/three-entry.d.ts +2977 -0
  1433. package/node_modules/framer-motion/dom/README.md +1 -0
  1434. package/node_modules/framer-motion/dom/package.json +6 -0
  1435. package/node_modules/framer-motion/package.json +122 -0
  1436. package/node_modules/get-func-name/LICENSE +19 -0
  1437. package/node_modules/get-func-name/README.md +123 -0
  1438. package/node_modules/get-func-name/get-func-name.js +1 -0
  1439. package/node_modules/get-func-name/index.js +52 -0
  1440. package/node_modules/get-func-name/package.json +85 -0
  1441. package/node_modules/get-nonce/LICENSE +21 -0
  1442. package/node_modules/get-nonce/README.md +54 -0
  1443. package/node_modules/get-nonce/dist/es2015/index.d.ts +2 -0
  1444. package/node_modules/get-nonce/dist/es2015/index.js +13 -0
  1445. package/node_modules/get-nonce/dist/es5/index.d.ts +2 -0
  1446. package/node_modules/get-nonce/dist/es5/index.js +15 -0
  1447. package/node_modules/get-nonce/package.json +68 -0
  1448. package/node_modules/invariant/LICENSE +21 -0
  1449. package/node_modules/invariant/README.md +37 -0
  1450. package/node_modules/invariant/browser.js +49 -0
  1451. package/node_modules/invariant/invariant.js +51 -0
  1452. package/node_modules/invariant/invariant.js.flow +7 -0
  1453. package/node_modules/invariant/package.json +35 -0
  1454. package/node_modules/js-tokens/LICENSE +21 -0
  1455. package/node_modules/js-tokens/README.md +240 -0
  1456. package/node_modules/js-tokens/index.js +23 -0
  1457. package/node_modules/js-tokens/package.json +30 -0
  1458. package/node_modules/loose-envify/LICENSE +21 -0
  1459. package/node_modules/loose-envify/README.md +45 -0
  1460. package/node_modules/loose-envify/cli.js +16 -0
  1461. package/node_modules/loose-envify/custom.js +4 -0
  1462. package/node_modules/loose-envify/index.js +3 -0
  1463. package/node_modules/loose-envify/loose-envify.js +36 -0
  1464. package/node_modules/loose-envify/package.json +36 -0
  1465. package/node_modules/loose-envify/replace.js +65 -0
  1466. package/node_modules/loupe/LICENSE +9 -0
  1467. package/node_modules/loupe/README.md +63 -0
  1468. package/node_modules/loupe/lib/arguments.d.ts +3 -0
  1469. package/node_modules/loupe/lib/arguments.d.ts.map +1 -0
  1470. package/node_modules/loupe/lib/arguments.js +7 -0
  1471. package/node_modules/loupe/lib/array.d.ts +3 -0
  1472. package/node_modules/loupe/lib/array.d.ts.map +1 -0
  1473. package/node_modules/loupe/lib/array.js +16 -0
  1474. package/node_modules/loupe/lib/bigint.d.ts +3 -0
  1475. package/node_modules/loupe/lib/bigint.d.ts.map +1 -0
  1476. package/node_modules/loupe/lib/bigint.js +7 -0
  1477. package/node_modules/loupe/lib/class.d.ts +5 -0
  1478. package/node_modules/loupe/lib/class.d.ts.map +1 -0
  1479. package/node_modules/loupe/lib/class.js +15 -0
  1480. package/node_modules/loupe/lib/date.d.ts +3 -0
  1481. package/node_modules/loupe/lib/date.d.ts.map +1 -0
  1482. package/node_modules/loupe/lib/date.js +11 -0
  1483. package/node_modules/loupe/lib/error.d.ts +3 -0
  1484. package/node_modules/loupe/lib/error.d.ts.map +1 -0
  1485. package/node_modules/loupe/lib/error.js +29 -0
  1486. package/node_modules/loupe/lib/function.d.ts +7 -0
  1487. package/node_modules/loupe/lib/function.d.ts.map +1 -0
  1488. package/node_modules/loupe/lib/function.js +9 -0
  1489. package/node_modules/loupe/lib/helpers.d.ts +7 -0
  1490. package/node_modules/loupe/lib/helpers.d.ts.map +1 -0
  1491. package/node_modules/loupe/lib/helpers.js +152 -0
  1492. package/node_modules/loupe/lib/html.d.ts +5 -0
  1493. package/node_modules/loupe/lib/html.d.ts.map +1 -0
  1494. package/node_modules/loupe/lib/html.js +34 -0
  1495. package/node_modules/loupe/lib/index.d.ts +7 -0
  1496. package/node_modules/loupe/lib/index.d.ts.map +1 -0
  1497. package/node_modules/loupe/lib/index.js +161 -0
  1498. package/node_modules/loupe/lib/map.d.ts +3 -0
  1499. package/node_modules/loupe/lib/map.d.ts.map +1 -0
  1500. package/node_modules/loupe/lib/map.js +24 -0
  1501. package/node_modules/loupe/lib/number.d.ts +3 -0
  1502. package/node_modules/loupe/lib/number.d.ts.map +1 -0
  1503. package/node_modules/loupe/lib/number.js +17 -0
  1504. package/node_modules/loupe/lib/object.d.ts +3 -0
  1505. package/node_modules/loupe/lib/object.d.ts.map +1 -0
  1506. package/node_modules/loupe/lib/object.js +22 -0
  1507. package/node_modules/loupe/lib/promise.d.ts +5 -0
  1508. package/node_modules/loupe/lib/promise.d.ts.map +1 -0
  1509. package/node_modules/loupe/lib/promise.js +18 -0
  1510. package/node_modules/loupe/lib/regexp.d.ts +3 -0
  1511. package/node_modules/loupe/lib/regexp.d.ts.map +1 -0
  1512. package/node_modules/loupe/lib/regexp.js +7 -0
  1513. package/node_modules/loupe/lib/set.d.ts +3 -0
  1514. package/node_modules/loupe/lib/set.d.ts.map +1 -0
  1515. package/node_modules/loupe/lib/set.js +15 -0
  1516. package/node_modules/loupe/lib/string.d.ts +3 -0
  1517. package/node_modules/loupe/lib/string.d.ts.map +1 -0
  1518. package/node_modules/loupe/lib/string.js +24 -0
  1519. package/node_modules/loupe/lib/symbol.d.ts +2 -0
  1520. package/node_modules/loupe/lib/symbol.d.ts.map +1 -0
  1521. package/node_modules/loupe/lib/symbol.js +6 -0
  1522. package/node_modules/loupe/lib/typedarray.d.ts +5 -0
  1523. package/node_modules/loupe/lib/typedarray.d.ts.map +1 -0
  1524. package/node_modules/loupe/lib/typedarray.js +38 -0
  1525. package/node_modules/loupe/lib/types.d.ts +15 -0
  1526. package/node_modules/loupe/lib/types.d.ts.map +1 -0
  1527. package/node_modules/loupe/lib/types.js +1 -0
  1528. package/node_modules/loupe/loupe.js +637 -0
  1529. package/node_modules/loupe/package.json +126 -0
  1530. package/node_modules/pathval/LICENSE +16 -0
  1531. package/node_modules/pathval/README.md +147 -0
  1532. package/node_modules/pathval/index.js +292 -0
  1533. package/node_modules/pathval/package.json +73 -0
  1534. package/node_modules/pathval/pathval.js +1 -0
  1535. package/node_modules/react-remove-scroll/LICENSE +21 -0
  1536. package/node_modules/react-remove-scroll/README.md +152 -0
  1537. package/node_modules/react-remove-scroll/UI/UI.d.ts +1 -0
  1538. package/node_modules/react-remove-scroll/UI/package.json +8 -0
  1539. package/node_modules/react-remove-scroll/dist/es2015/Combination.d.ts +3 -0
  1540. package/node_modules/react-remove-scroll/dist/es2015/Combination.js +7 -0
  1541. package/node_modules/react-remove-scroll/dist/es2015/SideEffect.d.ts +5 -0
  1542. package/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +146 -0
  1543. package/node_modules/react-remove-scroll/dist/es2015/UI.d.ts +7 -0
  1544. package/node_modules/react-remove-scroll/dist/es2015/UI.js +36 -0
  1545. package/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.d.ts +3 -0
  1546. package/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +19 -0
  1547. package/node_modules/react-remove-scroll/dist/es2015/handleScroll.d.ts +3 -0
  1548. package/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +96 -0
  1549. package/node_modules/react-remove-scroll/dist/es2015/index.d.ts +2 -0
  1550. package/node_modules/react-remove-scroll/dist/es2015/index.js +2 -0
  1551. package/node_modules/react-remove-scroll/dist/es2015/medium.d.ts +2 -0
  1552. package/node_modules/react-remove-scroll/dist/es2015/medium.js +2 -0
  1553. package/node_modules/react-remove-scroll/dist/es2015/pinchAndZoom.d.ts +8 -0
  1554. package/node_modules/react-remove-scroll/dist/es2015/pinchAndZoom.js +33 -0
  1555. package/node_modules/react-remove-scroll/dist/es2015/sidecar.d.ts +2 -0
  1556. package/node_modules/react-remove-scroll/dist/es2015/sidecar.js +4 -0
  1557. package/node_modules/react-remove-scroll/dist/es2015/types.d.ts +90 -0
  1558. package/node_modules/react-remove-scroll/dist/es2015/types.js +1 -0
  1559. package/node_modules/react-remove-scroll/dist/es2019/Combination.d.ts +3 -0
  1560. package/node_modules/react-remove-scroll/dist/es2019/Combination.js +6 -0
  1561. package/node_modules/react-remove-scroll/dist/es2019/SideEffect.d.ts +5 -0
  1562. package/node_modules/react-remove-scroll/dist/es2019/SideEffect.js +144 -0
  1563. package/node_modules/react-remove-scroll/dist/es2019/UI.d.ts +7 -0
  1564. package/node_modules/react-remove-scroll/dist/es2019/UI.js +41 -0
  1565. package/node_modules/react-remove-scroll/dist/es2019/aggresiveCapture.d.ts +3 -0
  1566. package/node_modules/react-remove-scroll/dist/es2019/aggresiveCapture.js +19 -0
  1567. package/node_modules/react-remove-scroll/dist/es2019/handleScroll.d.ts +3 -0
  1568. package/node_modules/react-remove-scroll/dist/es2019/handleScroll.js +84 -0
  1569. package/node_modules/react-remove-scroll/dist/es2019/index.d.ts +2 -0
  1570. package/node_modules/react-remove-scroll/dist/es2019/index.js +2 -0
  1571. package/node_modules/react-remove-scroll/dist/es2019/medium.d.ts +2 -0
  1572. package/node_modules/react-remove-scroll/dist/es2019/medium.js +2 -0
  1573. package/node_modules/react-remove-scroll/dist/es2019/pinchAndZoom.d.ts +8 -0
  1574. package/node_modules/react-remove-scroll/dist/es2019/pinchAndZoom.js +33 -0
  1575. package/node_modules/react-remove-scroll/dist/es2019/sidecar.d.ts +2 -0
  1576. package/node_modules/react-remove-scroll/dist/es2019/sidecar.js +4 -0
  1577. package/node_modules/react-remove-scroll/dist/es2019/types.d.ts +90 -0
  1578. package/node_modules/react-remove-scroll/dist/es2019/types.js +1 -0
  1579. package/node_modules/react-remove-scroll/dist/es5/Combination.d.ts +3 -0
  1580. package/node_modules/react-remove-scroll/dist/es5/Combination.js +9 -0
  1581. package/node_modules/react-remove-scroll/dist/es5/SideEffect.d.ts +5 -0
  1582. package/node_modules/react-remove-scroll/dist/es5/SideEffect.js +152 -0
  1583. package/node_modules/react-remove-scroll/dist/es5/UI.d.ts +7 -0
  1584. package/node_modules/react-remove-scroll/dist/es5/UI.js +39 -0
  1585. package/node_modules/react-remove-scroll/dist/es5/aggresiveCapture.d.ts +3 -0
  1586. package/node_modules/react-remove-scroll/dist/es5/aggresiveCapture.js +22 -0
  1587. package/node_modules/react-remove-scroll/dist/es5/handleScroll.d.ts +3 -0
  1588. package/node_modules/react-remove-scroll/dist/es5/handleScroll.js +101 -0
  1589. package/node_modules/react-remove-scroll/dist/es5/index.d.ts +2 -0
  1590. package/node_modules/react-remove-scroll/dist/es5/index.js +6 -0
  1591. package/node_modules/react-remove-scroll/dist/es5/medium.d.ts +2 -0
  1592. package/node_modules/react-remove-scroll/dist/es5/medium.js +5 -0
  1593. package/node_modules/react-remove-scroll/dist/es5/pinchAndZoom.d.ts +8 -0
  1594. package/node_modules/react-remove-scroll/dist/es5/pinchAndZoom.js +37 -0
  1595. package/node_modules/react-remove-scroll/dist/es5/sidecar.d.ts +2 -0
  1596. package/node_modules/react-remove-scroll/dist/es5/sidecar.js +6 -0
  1597. package/node_modules/react-remove-scroll/dist/es5/types.d.ts +90 -0
  1598. package/node_modules/react-remove-scroll/dist/es5/types.js +2 -0
  1599. package/node_modules/react-remove-scroll/package.json +96 -0
  1600. package/node_modules/react-remove-scroll/sidecar/package.json +7 -0
  1601. package/node_modules/react-remove-scroll/sidecar/sidecar.d.ts +5 -0
  1602. package/node_modules/react-remove-scroll-bar/README.md +52 -0
  1603. package/node_modules/react-remove-scroll-bar/constants/package.json +8 -0
  1604. package/node_modules/react-remove-scroll-bar/dist/es2015/component.d.ts +13 -0
  1605. package/node_modules/react-remove-scroll-bar/dist/es2015/component.js +53 -0
  1606. package/node_modules/react-remove-scroll-bar/dist/es2015/constants.d.ts +8 -0
  1607. package/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -0
  1608. package/node_modules/react-remove-scroll-bar/dist/es2015/index.d.ts +4 -0
  1609. package/node_modules/react-remove-scroll-bar/dist/es2015/index.js +4 -0
  1610. package/node_modules/react-remove-scroll-bar/dist/es2015/utils.d.ts +14 -0
  1611. package/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +29 -0
  1612. package/node_modules/react-remove-scroll-bar/dist/es2019/component.d.ts +13 -0
  1613. package/node_modules/react-remove-scroll-bar/dist/es2019/component.js +85 -0
  1614. package/node_modules/react-remove-scroll-bar/dist/es2019/constants.d.ts +8 -0
  1615. package/node_modules/react-remove-scroll-bar/dist/es2019/constants.js +8 -0
  1616. package/node_modules/react-remove-scroll-bar/dist/es2019/index.d.ts +4 -0
  1617. package/node_modules/react-remove-scroll-bar/dist/es2019/index.js +4 -0
  1618. package/node_modules/react-remove-scroll-bar/dist/es2019/utils.d.ts +14 -0
  1619. package/node_modules/react-remove-scroll-bar/dist/es2019/utils.js +28 -0
  1620. package/node_modules/react-remove-scroll-bar/dist/es5/component.d.ts +13 -0
  1621. package/node_modules/react-remove-scroll-bar/dist/es5/component.js +59 -0
  1622. package/node_modules/react-remove-scroll-bar/dist/es5/constants.d.ts +8 -0
  1623. package/node_modules/react-remove-scroll-bar/dist/es5/constants.js +11 -0
  1624. package/node_modules/react-remove-scroll-bar/dist/es5/index.d.ts +4 -0
  1625. package/node_modules/react-remove-scroll-bar/dist/es5/index.js +12 -0
  1626. package/node_modules/react-remove-scroll-bar/dist/es5/utils.d.ts +14 -0
  1627. package/node_modules/react-remove-scroll-bar/dist/es5/utils.js +33 -0
  1628. package/node_modules/react-remove-scroll-bar/package.json +85 -0
  1629. package/node_modules/react-router/CHANGELOG.md +688 -0
  1630. package/node_modules/react-router/LICENSE.md +23 -0
  1631. package/node_modules/react-router/README.md +16 -0
  1632. package/node_modules/react-router/dist/index.d.ts +25 -0
  1633. package/node_modules/react-router/dist/index.js +1454 -0
  1634. package/node_modules/react-router/dist/index.js.map +1 -0
  1635. package/node_modules/react-router/dist/lib/components.d.ts +157 -0
  1636. package/node_modules/react-router/dist/lib/context.d.ts +102 -0
  1637. package/node_modules/react-router/dist/lib/hooks.d.ts +181 -0
  1638. package/node_modules/react-router/dist/main.js +19 -0
  1639. package/node_modules/react-router/dist/react-router.development.js +1350 -0
  1640. package/node_modules/react-router/dist/react-router.development.js.map +1 -0
  1641. package/node_modules/react-router/dist/react-router.production.min.js +12 -0
  1642. package/node_modules/react-router/dist/react-router.production.min.js.map +1 -0
  1643. package/node_modules/react-router/dist/umd/react-router.development.js +1572 -0
  1644. package/node_modules/react-router/dist/umd/react-router.development.js.map +1 -0
  1645. package/node_modules/react-router/dist/umd/react-router.production.min.js +12 -0
  1646. package/node_modules/react-router/dist/umd/react-router.production.min.js.map +1 -0
  1647. package/node_modules/react-router/node_modules/@remix-run/router/CHANGELOG.md +716 -0
  1648. package/node_modules/react-router/node_modules/@remix-run/router/LICENSE.md +23 -0
  1649. package/node_modules/react-router/node_modules/@remix-run/router/README.md +135 -0
  1650. package/node_modules/react-router/node_modules/@remix-run/router/dist/history.d.ts +250 -0
  1651. package/node_modules/react-router/node_modules/@remix-run/router/dist/index.d.ts +9 -0
  1652. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.cjs.js +4870 -0
  1653. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.cjs.js.map +1 -0
  1654. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.d.ts +508 -0
  1655. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.js +4327 -0
  1656. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.js.map +1 -0
  1657. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.umd.js +4876 -0
  1658. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.umd.js.map +1 -0
  1659. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.umd.min.js +12 -0
  1660. package/node_modules/react-router/node_modules/@remix-run/router/dist/router.umd.min.js.map +1 -0
  1661. package/node_modules/react-router/node_modules/@remix-run/router/dist/utils.d.ts +502 -0
  1662. package/node_modules/react-router/node_modules/@remix-run/router/history.ts +746 -0
  1663. package/node_modules/react-router/node_modules/@remix-run/router/index.ts +96 -0
  1664. package/node_modules/react-router/node_modules/@remix-run/router/package.json +33 -0
  1665. package/node_modules/react-router/node_modules/@remix-run/router/router.ts +4915 -0
  1666. package/node_modules/react-router/node_modules/@remix-run/router/utils.ts +1598 -0
  1667. package/node_modules/react-router/package.json +43 -0
  1668. package/node_modules/react-router-dom/CHANGELOG.md +825 -0
  1669. package/node_modules/react-router-dom/LICENSE.md +23 -0
  1670. package/node_modules/react-router-dom/README.md +5 -0
  1671. package/node_modules/react-router-dom/dist/dom.d.ts +104 -0
  1672. package/node_modules/react-router-dom/dist/index.d.ts +317 -0
  1673. package/node_modules/react-router-dom/dist/index.js +1442 -0
  1674. package/node_modules/react-router-dom/dist/index.js.map +1 -0
  1675. package/node_modules/react-router-dom/dist/main.js +19 -0
  1676. package/node_modules/react-router-dom/dist/react-router-dom.development.js +1483 -0
  1677. package/node_modules/react-router-dom/dist/react-router-dom.development.js.map +1 -0
  1678. package/node_modules/react-router-dom/dist/react-router-dom.production.min.js +12 -0
  1679. package/node_modules/react-router-dom/dist/react-router-dom.production.min.js.map +1 -0
  1680. package/node_modules/react-router-dom/dist/server.d.ts +31 -0
  1681. package/node_modules/react-router-dom/dist/server.js +318 -0
  1682. package/node_modules/react-router-dom/dist/server.mjs +293 -0
  1683. package/node_modules/react-router-dom/dist/umd/react-router-dom.development.js +1779 -0
  1684. package/node_modules/react-router-dom/dist/umd/react-router-dom.development.js.map +1 -0
  1685. package/node_modules/react-router-dom/dist/umd/react-router-dom.production.min.js +12 -0
  1686. package/node_modules/react-router-dom/dist/umd/react-router-dom.production.min.js.map +1 -0
  1687. package/node_modules/react-router-dom/node_modules/@remix-run/router/CHANGELOG.md +716 -0
  1688. package/node_modules/react-router-dom/node_modules/@remix-run/router/LICENSE.md +23 -0
  1689. package/node_modules/react-router-dom/node_modules/@remix-run/router/README.md +135 -0
  1690. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/history.d.ts +250 -0
  1691. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/index.d.ts +9 -0
  1692. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.cjs.js +4870 -0
  1693. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.cjs.js.map +1 -0
  1694. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.d.ts +508 -0
  1695. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.js +4327 -0
  1696. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.js.map +1 -0
  1697. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.umd.js +4876 -0
  1698. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.umd.js.map +1 -0
  1699. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.umd.min.js +12 -0
  1700. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/router.umd.min.js.map +1 -0
  1701. package/node_modules/react-router-dom/node_modules/@remix-run/router/dist/utils.d.ts +502 -0
  1702. package/node_modules/react-router-dom/node_modules/@remix-run/router/history.ts +746 -0
  1703. package/node_modules/react-router-dom/node_modules/@remix-run/router/index.ts +96 -0
  1704. package/node_modules/react-router-dom/node_modules/@remix-run/router/package.json +33 -0
  1705. package/node_modules/react-router-dom/node_modules/@remix-run/router/router.ts +4915 -0
  1706. package/node_modules/react-router-dom/node_modules/@remix-run/router/utils.ts +1598 -0
  1707. package/node_modules/react-router-dom/package.json +49 -0
  1708. package/node_modules/react-router-dom/server.d.ts +31 -0
  1709. package/node_modules/react-router-dom/server.js +318 -0
  1710. package/node_modules/react-router-dom/server.mjs +293 -0
  1711. package/node_modules/react-style-singleton/README.md +41 -0
  1712. package/node_modules/react-style-singleton/dist/es2015/component.d.ts +21 -0
  1713. package/node_modules/react-style-singleton/dist/es2015/component.js +16 -0
  1714. package/node_modules/react-style-singleton/dist/es2015/hook.d.ts +23 -0
  1715. package/node_modules/react-style-singleton/dist/es2015/hook.js +22 -0
  1716. package/node_modules/react-style-singleton/dist/es2015/index.d.ts +3 -0
  1717. package/node_modules/react-style-singleton/dist/es2015/index.js +3 -0
  1718. package/node_modules/react-style-singleton/dist/es2015/singleton.d.ts +4 -0
  1719. package/node_modules/react-style-singleton/dist/es2015/singleton.js +48 -0
  1720. package/node_modules/react-style-singleton/dist/es2019/component.d.ts +21 -0
  1721. package/node_modules/react-style-singleton/dist/es2019/component.js +15 -0
  1722. package/node_modules/react-style-singleton/dist/es2019/hook.d.ts +23 -0
  1723. package/node_modules/react-style-singleton/dist/es2019/hook.js +22 -0
  1724. package/node_modules/react-style-singleton/dist/es2019/index.d.ts +3 -0
  1725. package/node_modules/react-style-singleton/dist/es2019/index.js +3 -0
  1726. package/node_modules/react-style-singleton/dist/es2019/singleton.d.ts +4 -0
  1727. package/node_modules/react-style-singleton/dist/es2019/singleton.js +48 -0
  1728. package/node_modules/react-style-singleton/dist/es5/component.d.ts +21 -0
  1729. package/node_modules/react-style-singleton/dist/es5/component.js +20 -0
  1730. package/node_modules/react-style-singleton/dist/es5/hook.d.ts +23 -0
  1731. package/node_modules/react-style-singleton/dist/es5/hook.js +27 -0
  1732. package/node_modules/react-style-singleton/dist/es5/index.d.ts +3 -0
  1733. package/node_modules/react-style-singleton/dist/es5/index.js +9 -0
  1734. package/node_modules/react-style-singleton/dist/es5/singleton.d.ts +4 -0
  1735. package/node_modules/react-style-singleton/dist/es5/singleton.js +52 -0
  1736. package/node_modules/react-style-singleton/dist/index.js +1 -0
  1737. package/node_modules/react-style-singleton/package.json +87 -0
  1738. package/node_modules/regenerator-runtime/LICENSE +21 -0
  1739. package/node_modules/regenerator-runtime/README.md +31 -0
  1740. package/node_modules/regenerator-runtime/package.json +19 -0
  1741. package/node_modules/regenerator-runtime/path.js +11 -0
  1742. package/node_modules/regenerator-runtime/runtime.js +761 -0
  1743. package/node_modules/remix-utils/.eslintrc.cjs +54 -0
  1744. package/node_modules/remix-utils/LICENSE +21 -0
  1745. package/node_modules/remix-utils/README.md +2141 -0
  1746. package/node_modules/remix-utils/build/client/cache-assets.d.ts +22 -0
  1747. package/node_modules/remix-utils/build/client/cache-assets.js +66 -0
  1748. package/node_modules/remix-utils/build/common/promise.d.ts +87 -0
  1749. package/node_modules/remix-utils/build/common/promise.js +112 -0
  1750. package/node_modules/remix-utils/build/common/timers.d.ts +27 -0
  1751. package/node_modules/remix-utils/build/common/timers.js +47 -0
  1752. package/node_modules/remix-utils/build/react/authenticity-token.d.ts +50 -0
  1753. package/node_modules/remix-utils/build/react/authenticity-token.js +54 -0
  1754. package/node_modules/remix-utils/build/react/client-only.d.ts +27 -0
  1755. package/node_modules/remix-utils/build/react/client-only.js +20 -0
  1756. package/node_modules/remix-utils/build/react/existing-search-params.d.ts +34 -0
  1757. package/node_modules/remix-utils/build/react/existing-search-params.js +32 -0
  1758. package/node_modules/remix-utils/build/react/external-scripts.d.ts +91 -0
  1759. package/node_modules/remix-utils/build/react/external-scripts.js +106 -0
  1760. package/node_modules/remix-utils/build/react/fetcher-type.d.ts +31 -0
  1761. package/node_modules/remix-utils/build/react/fetcher-type.js +53 -0
  1762. package/node_modules/remix-utils/build/react/handle-conventions.d.ts +10 -0
  1763. package/node_modules/remix-utils/build/react/handle-conventions.js +1 -0
  1764. package/node_modules/remix-utils/build/react/honeypot.d.ts +11 -0
  1765. package/node_modules/remix-utils/build/react/honeypot.js +16 -0
  1766. package/node_modules/remix-utils/build/react/server-only.d.ts +25 -0
  1767. package/node_modules/remix-utils/build/react/server-only.js +18 -0
  1768. package/node_modules/remix-utils/build/react/use-debounce-fetcher.d.ts +28 -0
  1769. package/node_modules/remix-utils/build/react/use-debounce-fetcher.js +27 -0
  1770. package/node_modules/remix-utils/build/react/use-debounce-submit.d.ts +7 -0
  1771. package/node_modules/remix-utils/build/react/use-debounce-submit.js +41 -0
  1772. package/node_modules/remix-utils/build/react/use-delegated-anchors.d.ts +6 -0
  1773. package/node_modules/remix-utils/build/react/use-delegated-anchors.js +69 -0
  1774. package/node_modules/remix-utils/build/react/use-event-source.d.ts +17 -0
  1775. package/node_modules/remix-utils/build/react/use-event-source.js +37 -0
  1776. package/node_modules/remix-utils/build/react/use-global-navigation-state.d.ts +33 -0
  1777. package/node_modules/remix-utils/build/react/use-global-navigation-state.js +67 -0
  1778. package/node_modules/remix-utils/build/react/use-hydrated.d.ts +18 -0
  1779. package/node_modules/remix-utils/build/react/use-hydrated.js +24 -0
  1780. package/node_modules/remix-utils/build/react/use-locales.d.ts +24 -0
  1781. package/node_modules/remix-utils/build/react/use-locales.js +56 -0
  1782. package/node_modules/remix-utils/build/react/use-should-hydrate.d.ts +21 -0
  1783. package/node_modules/remix-utils/build/react/use-should-hydrate.js +44 -0
  1784. package/node_modules/remix-utils/build/server/cors.d.ts +101 -0
  1785. package/node_modules/remix-utils/build/server/cors.js +179 -0
  1786. package/node_modules/remix-utils/build/server/csrf.d.ts +75 -0
  1787. package/node_modules/remix-utils/build/server/csrf.js +106 -0
  1788. package/node_modules/remix-utils/build/server/event-stream.d.ts +27 -0
  1789. package/node_modules/remix-utils/build/server/event-stream.js +44 -0
  1790. package/node_modules/remix-utils/build/server/get-client-ip-address.d.ts +29 -0
  1791. package/node_modules/remix-utils/build/server/get-client-ip-address.js +51 -0
  1792. package/node_modules/remix-utils/build/server/get-client-locales.d.ts +18 -0
  1793. package/node_modules/remix-utils/build/server/get-client-locales.js +18 -0
  1794. package/node_modules/remix-utils/build/server/get-headers.d.ts +6 -0
  1795. package/node_modules/remix-utils/build/server/get-headers.js +11 -0
  1796. package/node_modules/remix-utils/build/server/honeypot.d.ts +32 -0
  1797. package/node_modules/remix-utils/build/server/honeypot.js +96 -0
  1798. package/node_modules/remix-utils/build/server/is-prefetch.d.ts +16 -0
  1799. package/node_modules/remix-utils/build/server/is-prefetch.js +11 -0
  1800. package/node_modules/remix-utils/build/server/json-hash.d.ts +6 -0
  1801. package/node_modules/remix-utils/build/server/json-hash.js +16 -0
  1802. package/node_modules/remix-utils/build/server/named-action.d.ts +19 -0
  1803. package/node_modules/remix-utils/build/server/named-action.js +62 -0
  1804. package/node_modules/remix-utils/build/server/parse-accept-header.d.ts +12 -0
  1805. package/node_modules/remix-utils/build/server/parse-accept-header.js +17 -0
  1806. package/node_modules/remix-utils/build/server/preload-route-assets.d.ts +80 -0
  1807. package/node_modules/remix-utils/build/server/preload-route-assets.js +120 -0
  1808. package/node_modules/remix-utils/build/server/redirect-back.d.ts +17 -0
  1809. package/node_modules/remix-utils/build/server/redirect-back.js +29 -0
  1810. package/node_modules/remix-utils/build/server/respond-to.d.ts +40 -0
  1811. package/node_modules/remix-utils/build/server/respond-to.js +22 -0
  1812. package/node_modules/remix-utils/build/server/responses.d.ts +100 -0
  1813. package/node_modules/remix-utils/build/server/responses.js +167 -0
  1814. package/node_modules/remix-utils/build/server/rolling-cookie.d.ts +4 -0
  1815. package/node_modules/remix-utils/build/server/rolling-cookie.js +9 -0
  1816. package/node_modules/remix-utils/build/server/safe-redirect.d.ts +10 -0
  1817. package/node_modules/remix-utils/build/server/safe-redirect.js +22 -0
  1818. package/node_modules/remix-utils/build/server/sec-fetch.d.ts +43 -0
  1819. package/node_modules/remix-utils/build/server/sec-fetch.js +67 -0
  1820. package/node_modules/remix-utils/build/server/typed-cookie.d.ts +17 -0
  1821. package/node_modules/remix-utils/build/server/typed-cookie.js +58 -0
  1822. package/node_modules/remix-utils/build/server/typed-session.d.ts +59 -0
  1823. package/node_modules/remix-utils/build/server/typed-session.js +88 -0
  1824. package/node_modules/remix-utils/package.json +182 -0
  1825. package/node_modules/remix-utils/scripts/check-pkg-exports.ts +61 -0
  1826. package/node_modules/set-cookie-parser/LICENSE +21 -0
  1827. package/node_modules/set-cookie-parser/README.md +199 -0
  1828. package/node_modules/set-cookie-parser/lib/set-cookie.js +226 -0
  1829. package/node_modules/set-cookie-parser/package.json +43 -0
  1830. package/node_modules/source-map/LICENSE +28 -0
  1831. package/node_modules/source-map/README.md +822 -0
  1832. package/node_modules/source-map/dist/source-map.js +1 -0
  1833. package/node_modules/source-map/lib/array-set.js +100 -0
  1834. package/node_modules/source-map/lib/base64-vlq.js +111 -0
  1835. package/node_modules/source-map/lib/base64.js +18 -0
  1836. package/node_modules/source-map/lib/binary-search.js +107 -0
  1837. package/node_modules/source-map/lib/mapping-list.js +80 -0
  1838. package/node_modules/source-map/lib/mappings.wasm +0 -0
  1839. package/node_modules/source-map/lib/read-wasm.js +49 -0
  1840. package/node_modules/source-map/lib/source-map-consumer.js +1237 -0
  1841. package/node_modules/source-map/lib/source-map-generator.js +413 -0
  1842. package/node_modules/source-map/lib/source-node.js +404 -0
  1843. package/node_modules/source-map/lib/util.js +546 -0
  1844. package/node_modules/source-map/lib/wasm.js +107 -0
  1845. package/node_modules/source-map/package.json +91 -0
  1846. package/node_modules/source-map/source-map.d.ts +369 -0
  1847. package/node_modules/source-map/source-map.js +8 -0
  1848. package/node_modules/tailwind-merge/LICENSE.md +21 -0
  1849. package/node_modules/tailwind-merge/README.md +38 -0
  1850. package/node_modules/tailwind-merge/dist/bundle-cjs.js +2595 -0
  1851. package/node_modules/tailwind-merge/dist/bundle-cjs.js.map +1 -0
  1852. package/node_modules/tailwind-merge/dist/bundle-mjs.mjs +2583 -0
  1853. package/node_modules/tailwind-merge/dist/bundle-mjs.mjs.map +1 -0
  1854. package/node_modules/tailwind-merge/dist/es5/bundle-cjs.js +2645 -0
  1855. package/node_modules/tailwind-merge/dist/es5/bundle-cjs.js.map +1 -0
  1856. package/node_modules/tailwind-merge/dist/es5/bundle-mjs.mjs +2633 -0
  1857. package/node_modules/tailwind-merge/dist/es5/bundle-mjs.mjs.map +1 -0
  1858. package/node_modules/tailwind-merge/dist/types.d.ts +2143 -0
  1859. package/node_modules/tailwind-merge/package.json +95 -0
  1860. package/node_modules/tailwind-merge/src/index.ts +14 -0
  1861. package/node_modules/tailwind-merge/src/lib/class-utils.ts +215 -0
  1862. package/node_modules/tailwind-merge/src/lib/config-utils.ts +14 -0
  1863. package/node_modules/tailwind-merge/src/lib/create-tailwind-merge.ts +50 -0
  1864. package/node_modules/tailwind-merge/src/lib/default-config.ts +1866 -0
  1865. package/node_modules/tailwind-merge/src/lib/extend-tailwind-merge.ts +26 -0
  1866. package/node_modules/tailwind-merge/src/lib/from-theme.ts +13 -0
  1867. package/node_modules/tailwind-merge/src/lib/lru-cache.ts +52 -0
  1868. package/node_modules/tailwind-merge/src/lib/merge-classlist.ts +99 -0
  1869. package/node_modules/tailwind-merge/src/lib/merge-configs.ts +72 -0
  1870. package/node_modules/tailwind-merge/src/lib/modifier-utils.ts +95 -0
  1871. package/node_modules/tailwind-merge/src/lib/tw-join.ts +50 -0
  1872. package/node_modules/tailwind-merge/src/lib/tw-merge.ts +4 -0
  1873. package/node_modules/tailwind-merge/src/lib/types.ts +412 -0
  1874. package/node_modules/tailwind-merge/src/lib/validators.ts +104 -0
  1875. package/node_modules/tslib/CopyrightNotice.txt +15 -0
  1876. package/node_modules/tslib/LICENSE.txt +12 -0
  1877. package/node_modules/tslib/README.md +164 -0
  1878. package/node_modules/tslib/SECURITY.md +41 -0
  1879. package/node_modules/tslib/modules/index.d.ts +37 -0
  1880. package/node_modules/tslib/modules/index.js +68 -0
  1881. package/node_modules/tslib/modules/package.json +3 -0
  1882. package/node_modules/tslib/package.json +47 -0
  1883. package/node_modules/tslib/tslib.d.ts +453 -0
  1884. package/node_modules/tslib/tslib.es6.html +1 -0
  1885. package/node_modules/tslib/tslib.es6.js +370 -0
  1886. package/node_modules/tslib/tslib.es6.mjs +370 -0
  1887. package/node_modules/tslib/tslib.html +1 -0
  1888. package/node_modules/tslib/tslib.js +421 -0
  1889. package/node_modules/type-fest/index.d.ts +153 -0
  1890. package/node_modules/type-fest/package.json +71 -0
  1891. package/node_modules/type-fest/readme.md +971 -0
  1892. package/node_modules/type-fest/source/array-indices.d.ts +23 -0
  1893. package/node_modules/type-fest/source/array-slice.d.ts +106 -0
  1894. package/node_modules/type-fest/source/array-splice.d.ts +97 -0
  1895. package/node_modules/type-fest/source/array-values.d.ts +22 -0
  1896. package/node_modules/type-fest/source/async-return-type.d.ts +23 -0
  1897. package/node_modules/type-fest/source/asyncify.d.ts +32 -0
  1898. package/node_modules/type-fest/source/basic.d.ts +68 -0
  1899. package/node_modules/type-fest/source/camel-case.d.ts +80 -0
  1900. package/node_modules/type-fest/source/camel-cased-properties-deep.d.ts +54 -0
  1901. package/node_modules/type-fest/source/camel-cased-properties.d.ts +36 -0
  1902. package/node_modules/type-fest/source/conditional-except.d.ts +45 -0
  1903. package/node_modules/type-fest/source/conditional-keys.d.ts +45 -0
  1904. package/node_modules/type-fest/source/conditional-pick-deep.d.ts +104 -0
  1905. package/node_modules/type-fest/source/conditional-pick.d.ts +44 -0
  1906. package/node_modules/type-fest/source/conditional-simplify.d.ts +32 -0
  1907. package/node_modules/type-fest/source/delimiter-case.d.ts +99 -0
  1908. package/node_modules/type-fest/source/delimiter-cased-properties-deep.d.ts +82 -0
  1909. package/node_modules/type-fest/source/delimiter-cased-properties.d.ts +37 -0
  1910. package/node_modules/type-fest/source/distributed-omit.d.ts +89 -0
  1911. package/node_modules/type-fest/source/distributed-pick.d.ts +85 -0
  1912. package/node_modules/type-fest/source/empty-object.d.ts +46 -0
  1913. package/node_modules/type-fest/source/enforce-optional.d.ts +47 -0
  1914. package/node_modules/type-fest/source/entries.d.ts +62 -0
  1915. package/node_modules/type-fest/source/entry.d.ts +65 -0
  1916. package/node_modules/type-fest/source/exact.d.ts +63 -0
  1917. package/node_modules/type-fest/source/except.d.ts +80 -0
  1918. package/node_modules/type-fest/source/fixed-length-array.d.ts +43 -0
  1919. package/node_modules/type-fest/source/get.d.ts +191 -0
  1920. package/node_modules/type-fest/source/global-this.d.ts +21 -0
  1921. package/node_modules/type-fest/source/greater-than-or-equal.d.ts +22 -0
  1922. package/node_modules/type-fest/source/greater-than.d.ts +49 -0
  1923. package/node_modules/type-fest/source/has-optional-keys.d.ts +21 -0
  1924. package/node_modules/type-fest/source/has-readonly-keys.d.ts +21 -0
  1925. package/node_modules/type-fest/source/has-required-keys.d.ts +59 -0
  1926. package/node_modules/type-fest/source/has-writable-keys.d.ts +21 -0
  1927. package/node_modules/type-fest/source/if-any.d.ts +24 -0
  1928. package/node_modules/type-fest/source/if-empty-object.d.ts +26 -0
  1929. package/node_modules/type-fest/source/if-never.d.ts +24 -0
  1930. package/node_modules/type-fest/source/if-unknown.d.ts +24 -0
  1931. package/node_modules/type-fest/source/includes.d.ts +22 -0
  1932. package/node_modules/type-fest/source/int-range.d.ts +53 -0
  1933. package/node_modules/type-fest/source/internal.d.ts +824 -0
  1934. package/node_modules/type-fest/source/invariant-of.d.ts +78 -0
  1935. package/node_modules/type-fest/source/is-any.d.ts +29 -0
  1936. package/node_modules/type-fest/source/is-equal.d.ts +31 -0
  1937. package/node_modules/type-fest/source/is-literal.d.ts +256 -0
  1938. package/node_modules/type-fest/source/is-never.d.ts +49 -0
  1939. package/node_modules/type-fest/source/is-unknown.d.ts +52 -0
  1940. package/node_modules/type-fest/source/iterable-element.d.ts +54 -0
  1941. package/node_modules/type-fest/source/join.d.ts +68 -0
  1942. package/node_modules/type-fest/source/jsonifiable.d.ts +37 -0
  1943. package/node_modules/type-fest/source/jsonify.d.ts +121 -0
  1944. package/node_modules/type-fest/source/kebab-case.d.ts +38 -0
  1945. package/node_modules/type-fest/source/kebab-cased-properties-deep.d.ts +47 -0
  1946. package/node_modules/type-fest/source/kebab-cased-properties.d.ts +30 -0
  1947. package/node_modules/type-fest/source/keys-of-union.d.ts +40 -0
  1948. package/node_modules/type-fest/source/last-array-element.d.ts +38 -0
  1949. package/node_modules/type-fest/source/less-than-or-equal.d.ts +22 -0
  1950. package/node_modules/type-fest/source/less-than.d.ts +22 -0
  1951. package/node_modules/type-fest/source/literal-to-primitive-deep.d.ts +36 -0
  1952. package/node_modules/type-fest/source/literal-to-primitive.d.ts +36 -0
  1953. package/node_modules/type-fest/source/literal-union.d.ts +35 -0
  1954. package/node_modules/type-fest/source/merge-deep.d.ts +487 -0
  1955. package/node_modules/type-fest/source/merge-exclusive.d.ts +41 -0
  1956. package/node_modules/type-fest/source/merge.d.ts +48 -0
  1957. package/node_modules/type-fest/source/multidimensional-array.d.ts +44 -0
  1958. package/node_modules/type-fest/source/multidimensional-readonly-array.d.ts +48 -0
  1959. package/node_modules/type-fest/source/non-empty-object.d.ts +35 -0
  1960. package/node_modules/type-fest/source/numeric.d.ts +187 -0
  1961. package/node_modules/type-fest/source/observable-like.d.ts +63 -0
  1962. package/node_modules/type-fest/source/omit-deep.d.ts +140 -0
  1963. package/node_modules/type-fest/source/omit-index-signature.d.ts +107 -0
  1964. package/node_modules/type-fest/source/opaque.d.ts +250 -0
  1965. package/node_modules/type-fest/source/optional-keys-of.d.ts +38 -0
  1966. package/node_modules/type-fest/source/override-properties.d.ts +36 -0
  1967. package/node_modules/type-fest/source/package-json.d.ts +676 -0
  1968. package/node_modules/type-fest/source/partial-deep.d.ts +109 -0
  1969. package/node_modules/type-fest/source/partial-on-undefined-deep.d.ts +71 -0
  1970. package/node_modules/type-fest/source/pascal-case.d.ts +38 -0
  1971. package/node_modules/type-fest/source/pascal-cased-properties-deep.d.ts +55 -0
  1972. package/node_modules/type-fest/source/pascal-cased-properties.d.ts +35 -0
  1973. package/node_modules/type-fest/source/paths.d.ts +79 -0
  1974. package/node_modules/type-fest/source/pick-deep.d.ts +149 -0
  1975. package/node_modules/type-fest/source/pick-index-signature.d.ts +102 -0
  1976. package/node_modules/type-fest/source/primitive.d.ts +13 -0
  1977. package/node_modules/type-fest/source/promisable.d.ts +25 -0
  1978. package/node_modules/type-fest/source/readonly-deep.d.ts +81 -0
  1979. package/node_modules/type-fest/source/readonly-keys-of.d.ts +29 -0
  1980. package/node_modules/type-fest/source/readonly-tuple.d.ts +41 -0
  1981. package/node_modules/type-fest/source/replace.d.ts +67 -0
  1982. package/node_modules/type-fest/source/require-all-or-none.d.ts +42 -0
  1983. package/node_modules/type-fest/source/require-at-least-one.d.ts +34 -0
  1984. package/node_modules/type-fest/source/require-exactly-one.d.ts +34 -0
  1985. package/node_modules/type-fest/source/require-one-or-none.d.ts +37 -0
  1986. package/node_modules/type-fest/source/required-deep.d.ts +78 -0
  1987. package/node_modules/type-fest/source/required-keys-of.d.ts +29 -0
  1988. package/node_modules/type-fest/source/schema.d.ts +71 -0
  1989. package/node_modules/type-fest/source/screaming-snake-case.d.ts +33 -0
  1990. package/node_modules/type-fest/source/set-field-type.d.ts +37 -0
  1991. package/node_modules/type-fest/source/set-non-nullable.d.ts +39 -0
  1992. package/node_modules/type-fest/source/set-optional.d.ts +35 -0
  1993. package/node_modules/type-fest/source/set-parameter-type.d.ts +117 -0
  1994. package/node_modules/type-fest/source/set-readonly.d.ts +38 -0
  1995. package/node_modules/type-fest/source/set-required.d.ts +40 -0
  1996. package/node_modules/type-fest/source/set-return-type.d.ts +29 -0
  1997. package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +168 -0
  1998. package/node_modules/type-fest/source/simplify.d.ts +58 -0
  1999. package/node_modules/type-fest/source/single-key-object.d.ts +29 -0
  2000. package/node_modules/type-fest/source/snake-case.d.ts +38 -0
  2001. package/node_modules/type-fest/source/snake-cased-properties-deep.d.ts +47 -0
  2002. package/node_modules/type-fest/source/snake-cased-properties.d.ts +30 -0
  2003. package/node_modules/type-fest/source/split-words.d.ts +57 -0
  2004. package/node_modules/type-fest/source/split.d.ts +29 -0
  2005. package/node_modules/type-fest/source/spread.d.ts +85 -0
  2006. package/node_modules/type-fest/source/string-key-of.d.ts +25 -0
  2007. package/node_modules/type-fest/source/string-slice.d.ts +37 -0
  2008. package/node_modules/type-fest/source/stringified.d.ts +23 -0
  2009. package/node_modules/type-fest/source/subtract.d.ts +68 -0
  2010. package/node_modules/type-fest/source/sum.d.ts +68 -0
  2011. package/node_modules/type-fest/source/tagged-union.d.ts +51 -0
  2012. package/node_modules/type-fest/source/trim.d.ts +27 -0
  2013. package/node_modules/type-fest/source/tsconfig-json.d.ts +1180 -0
  2014. package/node_modules/type-fest/source/tuple-to-union.d.ts +51 -0
  2015. package/node_modules/type-fest/source/typed-array.d.ts +17 -0
  2016. package/node_modules/type-fest/source/undefined-on-partial-deep.d.ts +81 -0
  2017. package/node_modules/type-fest/source/union-to-intersection.d.ts +61 -0
  2018. package/node_modules/type-fest/source/unknown-array.d.ts +25 -0
  2019. package/node_modules/type-fest/source/unknown-record.d.ts +31 -0
  2020. package/node_modules/type-fest/source/value-of.d.ts +42 -0
  2021. package/node_modules/type-fest/source/writable-deep.d.ts +83 -0
  2022. package/node_modules/type-fest/source/writable-keys-of.d.ts +30 -0
  2023. package/node_modules/type-fest/source/writable.d.ts +68 -0
  2024. package/node_modules/use-callback-ref/LICENSE +21 -0
  2025. package/node_modules/use-callback-ref/README.md +170 -0
  2026. package/node_modules/use-callback-ref/dist/es2015/assignRef.d.ts +15 -0
  2027. package/node_modules/use-callback-ref/dist/es2015/assignRef.js +22 -0
  2028. package/node_modules/use-callback-ref/dist/es2015/createRef.d.ts +10 -0
  2029. package/node_modules/use-callback-ref/dist/es2015/createRef.js +23 -0
  2030. package/node_modules/use-callback-ref/dist/es2015/index.d.ts +8 -0
  2031. package/node_modules/use-callback-ref/dist/es2015/index.js +12 -0
  2032. package/node_modules/use-callback-ref/dist/es2015/mergeRef.d.ts +16 -0
  2033. package/node_modules/use-callback-ref/dist/es2015/mergeRef.js +18 -0
  2034. package/node_modules/use-callback-ref/dist/es2015/refToCallback.d.ts +24 -0
  2035. package/node_modules/use-callback-ref/dist/es2015/refToCallback.js +48 -0
  2036. package/node_modules/use-callback-ref/dist/es2015/transformRef.d.ts +11 -0
  2037. package/node_modules/use-callback-ref/dist/es2015/transformRef.js +14 -0
  2038. package/node_modules/use-callback-ref/dist/es2015/types.d.ts +5 -0
  2039. package/node_modules/use-callback-ref/dist/es2015/types.js +1 -0
  2040. package/node_modules/use-callback-ref/dist/es2015/useMergeRef.d.ts +17 -0
  2041. package/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +45 -0
  2042. package/node_modules/use-callback-ref/dist/es2015/useRef.d.ts +16 -0
  2043. package/node_modules/use-callback-ref/dist/es2015/useRef.js +39 -0
  2044. package/node_modules/use-callback-ref/dist/es2015/useTransformRef.d.ts +15 -0
  2045. package/node_modules/use-callback-ref/dist/es2015/useTransformRef.js +18 -0
  2046. package/node_modules/use-callback-ref/dist/es2019/assignRef.d.ts +15 -0
  2047. package/node_modules/use-callback-ref/dist/es2019/assignRef.js +22 -0
  2048. package/node_modules/use-callback-ref/dist/es2019/createRef.d.ts +10 -0
  2049. package/node_modules/use-callback-ref/dist/es2019/createRef.js +23 -0
  2050. package/node_modules/use-callback-ref/dist/es2019/index.d.ts +8 -0
  2051. package/node_modules/use-callback-ref/dist/es2019/index.js +12 -0
  2052. package/node_modules/use-callback-ref/dist/es2019/mergeRef.d.ts +16 -0
  2053. package/node_modules/use-callback-ref/dist/es2019/mergeRef.js +18 -0
  2054. package/node_modules/use-callback-ref/dist/es2019/refToCallback.d.ts +24 -0
  2055. package/node_modules/use-callback-ref/dist/es2019/refToCallback.js +48 -0
  2056. package/node_modules/use-callback-ref/dist/es2019/transformRef.d.ts +11 -0
  2057. package/node_modules/use-callback-ref/dist/es2019/transformRef.js +14 -0
  2058. package/node_modules/use-callback-ref/dist/es2019/types.d.ts +5 -0
  2059. package/node_modules/use-callback-ref/dist/es2019/types.js +1 -0
  2060. package/node_modules/use-callback-ref/dist/es2019/useMergeRef.d.ts +17 -0
  2061. package/node_modules/use-callback-ref/dist/es2019/useMergeRef.js +43 -0
  2062. package/node_modules/use-callback-ref/dist/es2019/useRef.d.ts +16 -0
  2063. package/node_modules/use-callback-ref/dist/es2019/useRef.js +39 -0
  2064. package/node_modules/use-callback-ref/dist/es2019/useTransformRef.d.ts +15 -0
  2065. package/node_modules/use-callback-ref/dist/es2019/useTransformRef.js +18 -0
  2066. package/node_modules/use-callback-ref/dist/es5/assignRef.d.ts +15 -0
  2067. package/node_modules/use-callback-ref/dist/es5/assignRef.js +26 -0
  2068. package/node_modules/use-callback-ref/dist/es5/createRef.d.ts +10 -0
  2069. package/node_modules/use-callback-ref/dist/es5/createRef.js +27 -0
  2070. package/node_modules/use-callback-ref/dist/es5/index.d.ts +8 -0
  2071. package/node_modules/use-callback-ref/dist/es5/index.js +24 -0
  2072. package/node_modules/use-callback-ref/dist/es5/mergeRef.d.ts +16 -0
  2073. package/node_modules/use-callback-ref/dist/es5/mergeRef.js +22 -0
  2074. package/node_modules/use-callback-ref/dist/es5/refToCallback.d.ts +24 -0
  2075. package/node_modules/use-callback-ref/dist/es5/refToCallback.js +53 -0
  2076. package/node_modules/use-callback-ref/dist/es5/transformRef.d.ts +11 -0
  2077. package/node_modules/use-callback-ref/dist/es5/transformRef.js +18 -0
  2078. package/node_modules/use-callback-ref/dist/es5/types.d.ts +5 -0
  2079. package/node_modules/use-callback-ref/dist/es5/types.js +2 -0
  2080. package/node_modules/use-callback-ref/dist/es5/useMergeRef.d.ts +17 -0
  2081. package/node_modules/use-callback-ref/dist/es5/useMergeRef.js +50 -0
  2082. package/node_modules/use-callback-ref/dist/es5/useRef.d.ts +16 -0
  2083. package/node_modules/use-callback-ref/dist/es5/useRef.js +43 -0
  2084. package/node_modules/use-callback-ref/dist/es5/useTransformRef.d.ts +15 -0
  2085. package/node_modules/use-callback-ref/dist/es5/useTransformRef.js +22 -0
  2086. package/node_modules/use-callback-ref/package.json +84 -0
  2087. package/node_modules/use-sidecar/LICENSE +21 -0
  2088. package/node_modules/use-sidecar/README.md +349 -0
  2089. package/node_modules/use-sidecar/dist/es2015/config.d.ts +5 -0
  2090. package/node_modules/use-sidecar/dist/es2015/config.js +6 -0
  2091. package/node_modules/use-sidecar/dist/es2015/env.d.ts +4 -0
  2092. package/node_modules/use-sidecar/dist/es2015/env.js +5 -0
  2093. package/node_modules/use-sidecar/dist/es2015/exports.d.ts +3 -0
  2094. package/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  2095. package/node_modules/use-sidecar/dist/es2015/hoc.d.ts +3 -0
  2096. package/node_modules/use-sidecar/dist/es2015/hoc.js +15 -0
  2097. package/node_modules/use-sidecar/dist/es2015/hook.d.ts +2 -0
  2098. package/node_modules/use-sidecar/dist/es2015/hook.js +41 -0
  2099. package/node_modules/use-sidecar/dist/es2015/index.d.ts +7 -0
  2100. package/node_modules/use-sidecar/dist/es2015/index.js +6 -0
  2101. package/node_modules/use-sidecar/dist/es2015/medium.d.ts +3 -0
  2102. package/node_modules/use-sidecar/dist/es2015/medium.js +78 -0
  2103. package/node_modules/use-sidecar/dist/es2015/renderProp.d.ts +8 -0
  2104. package/node_modules/use-sidecar/dist/es2015/renderProp.js +35 -0
  2105. package/node_modules/use-sidecar/dist/es2015/types.d.ts +47 -0
  2106. package/node_modules/use-sidecar/dist/es2015/types.js +1 -0
  2107. package/node_modules/use-sidecar/dist/es2019/config.d.ts +5 -0
  2108. package/node_modules/use-sidecar/dist/es2019/config.js +6 -0
  2109. package/node_modules/use-sidecar/dist/es2019/env.d.ts +4 -0
  2110. package/node_modules/use-sidecar/dist/es2019/env.js +5 -0
  2111. package/node_modules/use-sidecar/dist/es2019/exports.d.ts +3 -0
  2112. package/node_modules/use-sidecar/dist/es2019/exports.js +16 -0
  2113. package/node_modules/use-sidecar/dist/es2019/hoc.d.ts +3 -0
  2114. package/node_modules/use-sidecar/dist/es2019/hoc.js +14 -0
  2115. package/node_modules/use-sidecar/dist/es2019/hook.d.ts +2 -0
  2116. package/node_modules/use-sidecar/dist/es2019/hook.js +41 -0
  2117. package/node_modules/use-sidecar/dist/es2019/index.d.ts +7 -0
  2118. package/node_modules/use-sidecar/dist/es2019/index.js +6 -0
  2119. package/node_modules/use-sidecar/dist/es2019/medium.d.ts +3 -0
  2120. package/node_modules/use-sidecar/dist/es2019/medium.js +78 -0
  2121. package/node_modules/use-sidecar/dist/es2019/renderProp.d.ts +8 -0
  2122. package/node_modules/use-sidecar/dist/es2019/renderProp.js +28 -0
  2123. package/node_modules/use-sidecar/dist/es2019/types.d.ts +47 -0
  2124. package/node_modules/use-sidecar/dist/es2019/types.js +1 -0
  2125. package/node_modules/use-sidecar/dist/es5/config.d.ts +5 -0
  2126. package/node_modules/use-sidecar/dist/es5/config.js +10 -0
  2127. package/node_modules/use-sidecar/dist/es5/env.d.ts +4 -0
  2128. package/node_modules/use-sidecar/dist/es5/env.js +8 -0
  2129. package/node_modules/use-sidecar/dist/es5/exports.d.ts +3 -0
  2130. package/node_modules/use-sidecar/dist/es5/exports.js +22 -0
  2131. package/node_modules/use-sidecar/dist/es5/hoc.d.ts +3 -0
  2132. package/node_modules/use-sidecar/dist/es5/hoc.js +19 -0
  2133. package/node_modules/use-sidecar/dist/es5/hook.d.ts +2 -0
  2134. package/node_modules/use-sidecar/dist/es5/hook.js +45 -0
  2135. package/node_modules/use-sidecar/dist/es5/index.d.ts +7 -0
  2136. package/node_modules/use-sidecar/dist/es5/index.js +16 -0
  2137. package/node_modules/use-sidecar/dist/es5/medium.d.ts +3 -0
  2138. package/node_modules/use-sidecar/dist/es5/medium.js +83 -0
  2139. package/node_modules/use-sidecar/dist/es5/renderProp.d.ts +8 -0
  2140. package/node_modules/use-sidecar/dist/es5/renderProp.js +39 -0
  2141. package/node_modules/use-sidecar/dist/es5/types.d.ts +47 -0
  2142. package/node_modules/use-sidecar/dist/es5/types.js +2 -0
  2143. package/node_modules/use-sidecar/package.json +89 -0
  2144. package/node_modules/zod/LICENSE +21 -0
  2145. package/node_modules/zod/README.md +2834 -0
  2146. package/node_modules/zod/index.d.ts +2 -0
  2147. package/node_modules/zod/lib/ZodError.d.ts +163 -0
  2148. package/node_modules/zod/lib/ZodError.js +132 -0
  2149. package/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
  2150. package/node_modules/zod/lib/__tests__/Mocker.js +57 -0
  2151. package/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
  2152. package/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
  2153. package/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
  2154. package/node_modules/zod/lib/benchmarks/index.js +46 -0
  2155. package/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
  2156. package/node_modules/zod/lib/benchmarks/object.js +70 -0
  2157. package/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
  2158. package/node_modules/zod/lib/benchmarks/primitives.js +136 -0
  2159. package/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
  2160. package/node_modules/zod/lib/benchmarks/realworld.js +56 -0
  2161. package/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
  2162. package/node_modules/zod/lib/benchmarks/string.js +55 -0
  2163. package/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
  2164. package/node_modules/zod/lib/benchmarks/union.js +79 -0
  2165. package/node_modules/zod/lib/errors.d.ts +5 -0
  2166. package/node_modules/zod/lib/errors.js +17 -0
  2167. package/node_modules/zod/lib/external.d.ts +6 -0
  2168. package/node_modules/zod/lib/external.js +18 -0
  2169. package/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
  2170. package/node_modules/zod/lib/helpers/enumUtil.js +2 -0
  2171. package/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
  2172. package/node_modules/zod/lib/helpers/errorUtil.js +8 -0
  2173. package/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
  2174. package/node_modules/zod/lib/helpers/parseUtil.js +115 -0
  2175. package/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
  2176. package/node_modules/zod/lib/helpers/partialUtil.js +2 -0
  2177. package/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
  2178. package/node_modules/zod/lib/helpers/typeAliases.js +2 -0
  2179. package/node_modules/zod/lib/helpers/util.d.ts +68 -0
  2180. package/node_modules/zod/lib/helpers/util.js +142 -0
  2181. package/node_modules/zod/lib/index.d.ts +4 -0
  2182. package/node_modules/zod/lib/index.js +29 -0
  2183. package/node_modules/zod/lib/index.mjs +4017 -0
  2184. package/node_modules/zod/lib/index.umd.js +4131 -0
  2185. package/node_modules/zod/lib/locales/en.d.ts +3 -0
  2186. package/node_modules/zod/lib/locales/en.js +129 -0
  2187. package/node_modules/zod/lib/types.d.ts +1057 -0
  2188. package/node_modules/zod/lib/types.js +3495 -0
  2189. package/node_modules/zod/package.json +119 -0
  2190. package/package.json +191 -0
  2191. package/start.js +52 -0
@@ -0,0 +1,4915 @@
1
+ import type { History, Location, Path, To } from "./history";
2
+ import {
3
+ Action as HistoryAction,
4
+ createLocation,
5
+ createPath,
6
+ invariant,
7
+ parsePath,
8
+ warning,
9
+ } from "./history";
10
+ import type {
11
+ ActionFunction,
12
+ AgnosticDataRouteMatch,
13
+ AgnosticDataRouteObject,
14
+ AgnosticRouteObject,
15
+ DataResult,
16
+ DeferredData,
17
+ DeferredResult,
18
+ DetectErrorBoundaryFunction,
19
+ ErrorResult,
20
+ FormEncType,
21
+ FormMethod,
22
+ HTMLFormMethod,
23
+ ImmutableRouteKey,
24
+ LoaderFunction,
25
+ MapRoutePropertiesFunction,
26
+ MutationFormMethod,
27
+ RedirectResult,
28
+ RouteData,
29
+ RouteManifest,
30
+ ShouldRevalidateFunctionArgs,
31
+ Submission,
32
+ SuccessResult,
33
+ UIMatch,
34
+ V7_FormMethod,
35
+ V7_MutationFormMethod,
36
+ } from "./utils";
37
+ import {
38
+ ErrorResponseImpl,
39
+ ResultType,
40
+ convertRouteMatchToUiMatch,
41
+ convertRoutesToDataRoutes,
42
+ getPathContributingMatches,
43
+ getResolveToMatches,
44
+ immutableRouteKeys,
45
+ isRouteErrorResponse,
46
+ joinPaths,
47
+ matchRoutes,
48
+ resolveTo,
49
+ stripBasename,
50
+ } from "./utils";
51
+
52
+ ////////////////////////////////////////////////////////////////////////////////
53
+ //#region Types and Constants
54
+ ////////////////////////////////////////////////////////////////////////////////
55
+
56
+ /**
57
+ * A Router instance manages all navigation and data loading/mutations
58
+ */
59
+ export interface Router {
60
+ /**
61
+ * @internal
62
+ * PRIVATE - DO NOT USE
63
+ *
64
+ * Return the basename for the router
65
+ */
66
+ get basename(): RouterInit["basename"];
67
+
68
+ /**
69
+ * @internal
70
+ * PRIVATE - DO NOT USE
71
+ *
72
+ * Return the future config for the router
73
+ */
74
+ get future(): FutureConfig;
75
+
76
+ /**
77
+ * @internal
78
+ * PRIVATE - DO NOT USE
79
+ *
80
+ * Return the current state of the router
81
+ */
82
+ get state(): RouterState;
83
+
84
+ /**
85
+ * @internal
86
+ * PRIVATE - DO NOT USE
87
+ *
88
+ * Return the routes for this router instance
89
+ */
90
+ get routes(): AgnosticDataRouteObject[];
91
+
92
+ /**
93
+ * @internal
94
+ * PRIVATE - DO NOT USE
95
+ *
96
+ * Return the window associated with the router
97
+ */
98
+ get window(): RouterInit["window"];
99
+
100
+ /**
101
+ * @internal
102
+ * PRIVATE - DO NOT USE
103
+ *
104
+ * Initialize the router, including adding history listeners and kicking off
105
+ * initial data fetches. Returns a function to cleanup listeners and abort
106
+ * any in-progress loads
107
+ */
108
+ initialize(): Router;
109
+
110
+ /**
111
+ * @internal
112
+ * PRIVATE - DO NOT USE
113
+ *
114
+ * Subscribe to router.state updates
115
+ *
116
+ * @param fn function to call with the new state
117
+ */
118
+ subscribe(fn: RouterSubscriber): () => void;
119
+
120
+ /**
121
+ * @internal
122
+ * PRIVATE - DO NOT USE
123
+ *
124
+ * Enable scroll restoration behavior in the router
125
+ *
126
+ * @param savedScrollPositions Object that will manage positions, in case
127
+ * it's being restored from sessionStorage
128
+ * @param getScrollPosition Function to get the active Y scroll position
129
+ * @param getKey Function to get the key to use for restoration
130
+ */
131
+ enableScrollRestoration(
132
+ savedScrollPositions: Record<string, number>,
133
+ getScrollPosition: GetScrollPositionFunction,
134
+ getKey?: GetScrollRestorationKeyFunction
135
+ ): () => void;
136
+
137
+ /**
138
+ * @internal
139
+ * PRIVATE - DO NOT USE
140
+ *
141
+ * Navigate forward/backward in the history stack
142
+ * @param to Delta to move in the history stack
143
+ */
144
+ navigate(to: number): Promise<void>;
145
+
146
+ /**
147
+ * Navigate to the given path
148
+ * @param to Path to navigate to
149
+ * @param opts Navigation options (method, submission, etc.)
150
+ */
151
+ navigate(to: To | null, opts?: RouterNavigateOptions): Promise<void>;
152
+
153
+ /**
154
+ * @internal
155
+ * PRIVATE - DO NOT USE
156
+ *
157
+ * Trigger a fetcher load/submission
158
+ *
159
+ * @param key Fetcher key
160
+ * @param routeId Route that owns the fetcher
161
+ * @param href href to fetch
162
+ * @param opts Fetcher options, (method, submission, etc.)
163
+ */
164
+ fetch(
165
+ key: string,
166
+ routeId: string,
167
+ href: string | null,
168
+ opts?: RouterFetchOptions
169
+ ): void;
170
+
171
+ /**
172
+ * @internal
173
+ * PRIVATE - DO NOT USE
174
+ *
175
+ * Trigger a revalidation of all current route loaders and fetcher loads
176
+ */
177
+ revalidate(): void;
178
+
179
+ /**
180
+ * @internal
181
+ * PRIVATE - DO NOT USE
182
+ *
183
+ * Utility function to create an href for the given location
184
+ * @param location
185
+ */
186
+ createHref(location: Location | URL): string;
187
+
188
+ /**
189
+ * @internal
190
+ * PRIVATE - DO NOT USE
191
+ *
192
+ * Utility function to URL encode a destination path according to the internal
193
+ * history implementation
194
+ * @param to
195
+ */
196
+ encodeLocation(to: To): Path;
197
+
198
+ /**
199
+ * @internal
200
+ * PRIVATE - DO NOT USE
201
+ *
202
+ * Get/create a fetcher for the given key
203
+ * @param key
204
+ */
205
+ getFetcher<TData = any>(key: string): Fetcher<TData>;
206
+
207
+ /**
208
+ * @internal
209
+ * PRIVATE - DO NOT USE
210
+ *
211
+ * Delete the fetcher for a given key
212
+ * @param key
213
+ */
214
+ deleteFetcher(key: string): void;
215
+
216
+ /**
217
+ * @internal
218
+ * PRIVATE - DO NOT USE
219
+ *
220
+ * Cleanup listeners and abort any in-progress loads
221
+ */
222
+ dispose(): void;
223
+
224
+ /**
225
+ * @internal
226
+ * PRIVATE - DO NOT USE
227
+ *
228
+ * Get a navigation blocker
229
+ * @param key The identifier for the blocker
230
+ * @param fn The blocker function implementation
231
+ */
232
+ getBlocker(key: string, fn: BlockerFunction): Blocker;
233
+
234
+ /**
235
+ * @internal
236
+ * PRIVATE - DO NOT USE
237
+ *
238
+ * Delete a navigation blocker
239
+ * @param key The identifier for the blocker
240
+ */
241
+ deleteBlocker(key: string): void;
242
+
243
+ /**
244
+ * @internal
245
+ * PRIVATE - DO NOT USE
246
+ *
247
+ * HMR needs to pass in-flight route updates to React Router
248
+ * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
249
+ */
250
+ _internalSetRoutes(routes: AgnosticRouteObject[]): void;
251
+
252
+ /**
253
+ * @internal
254
+ * PRIVATE - DO NOT USE
255
+ *
256
+ * Internal fetch AbortControllers accessed by unit tests
257
+ */
258
+ _internalFetchControllers: Map<string, AbortController>;
259
+
260
+ /**
261
+ * @internal
262
+ * PRIVATE - DO NOT USE
263
+ *
264
+ * Internal pending DeferredData instances accessed by unit tests
265
+ */
266
+ _internalActiveDeferreds: Map<string, DeferredData>;
267
+ }
268
+
269
+ /**
270
+ * State maintained internally by the router. During a navigation, all states
271
+ * reflect the the "old" location unless otherwise noted.
272
+ */
273
+ export interface RouterState {
274
+ /**
275
+ * The action of the most recent navigation
276
+ */
277
+ historyAction: HistoryAction;
278
+
279
+ /**
280
+ * The current location reflected by the router
281
+ */
282
+ location: Location;
283
+
284
+ /**
285
+ * The current set of route matches
286
+ */
287
+ matches: AgnosticDataRouteMatch[];
288
+
289
+ /**
290
+ * Tracks whether we've completed our initial data load
291
+ */
292
+ initialized: boolean;
293
+
294
+ /**
295
+ * Current scroll position we should start at for a new view
296
+ * - number -> scroll position to restore to
297
+ * - false -> do not restore scroll at all (used during submissions)
298
+ * - null -> don't have a saved position, scroll to hash or top of page
299
+ */
300
+ restoreScrollPosition: number | false | null;
301
+
302
+ /**
303
+ * Indicate whether this navigation should skip resetting the scroll position
304
+ * if we are unable to restore the scroll position
305
+ */
306
+ preventScrollReset: boolean;
307
+
308
+ /**
309
+ * Tracks the state of the current navigation
310
+ */
311
+ navigation: Navigation;
312
+
313
+ /**
314
+ * Tracks any in-progress revalidations
315
+ */
316
+ revalidation: RevalidationState;
317
+
318
+ /**
319
+ * Data from the loaders for the current matches
320
+ */
321
+ loaderData: RouteData;
322
+
323
+ /**
324
+ * Data from the action for the current matches
325
+ */
326
+ actionData: RouteData | null;
327
+
328
+ /**
329
+ * Errors caught from loaders for the current matches
330
+ */
331
+ errors: RouteData | null;
332
+
333
+ /**
334
+ * Map of current fetchers
335
+ */
336
+ fetchers: Map<string, Fetcher>;
337
+
338
+ /**
339
+ * Map of current blockers
340
+ */
341
+ blockers: Map<string, Blocker>;
342
+ }
343
+
344
+ /**
345
+ * Data that can be passed into hydrate a Router from SSR
346
+ */
347
+ export type HydrationState = Partial<
348
+ Pick<RouterState, "loaderData" | "actionData" | "errors">
349
+ >;
350
+
351
+ /**
352
+ * Future flags to toggle new feature behavior
353
+ */
354
+ export interface FutureConfig {
355
+ v7_fetcherPersist: boolean;
356
+ v7_normalizeFormMethod: boolean;
357
+ v7_partialHydration: boolean;
358
+ v7_prependBasename: boolean;
359
+ v7_relativeSplatPath: boolean;
360
+ }
361
+
362
+ /**
363
+ * Initialization options for createRouter
364
+ */
365
+ export interface RouterInit {
366
+ routes: AgnosticRouteObject[];
367
+ history: History;
368
+ basename?: string;
369
+ /**
370
+ * @deprecated Use `mapRouteProperties` instead
371
+ */
372
+ detectErrorBoundary?: DetectErrorBoundaryFunction;
373
+ mapRouteProperties?: MapRoutePropertiesFunction;
374
+ future?: Partial<FutureConfig>;
375
+ hydrationData?: HydrationState;
376
+ window?: Window;
377
+ }
378
+
379
+ /**
380
+ * State returned from a server-side query() call
381
+ */
382
+ export interface StaticHandlerContext {
383
+ basename: Router["basename"];
384
+ location: RouterState["location"];
385
+ matches: RouterState["matches"];
386
+ loaderData: RouterState["loaderData"];
387
+ actionData: RouterState["actionData"];
388
+ errors: RouterState["errors"];
389
+ statusCode: number;
390
+ loaderHeaders: Record<string, Headers>;
391
+ actionHeaders: Record<string, Headers>;
392
+ activeDeferreds: Record<string, DeferredData> | null;
393
+ _deepestRenderedBoundaryId?: string | null;
394
+ }
395
+
396
+ /**
397
+ * A StaticHandler instance manages a singular SSR navigation/fetch event
398
+ */
399
+ export interface StaticHandler {
400
+ dataRoutes: AgnosticDataRouteObject[];
401
+ query(
402
+ request: Request,
403
+ opts?: { requestContext?: unknown }
404
+ ): Promise<StaticHandlerContext | Response>;
405
+ queryRoute(
406
+ request: Request,
407
+ opts?: { routeId?: string; requestContext?: unknown }
408
+ ): Promise<any>;
409
+ }
410
+
411
+ type ViewTransitionOpts = {
412
+ currentLocation: Location;
413
+ nextLocation: Location;
414
+ };
415
+
416
+ /**
417
+ * Subscriber function signature for changes to router state
418
+ */
419
+ export interface RouterSubscriber {
420
+ (
421
+ state: RouterState,
422
+ opts: {
423
+ deletedFetchers: string[];
424
+ unstable_viewTransitionOpts?: ViewTransitionOpts;
425
+ unstable_flushSync: boolean;
426
+ }
427
+ ): void;
428
+ }
429
+
430
+ /**
431
+ * Function signature for determining the key to be used in scroll restoration
432
+ * for a given location
433
+ */
434
+ export interface GetScrollRestorationKeyFunction {
435
+ (location: Location, matches: UIMatch[]): string | null;
436
+ }
437
+
438
+ /**
439
+ * Function signature for determining the current scroll position
440
+ */
441
+ export interface GetScrollPositionFunction {
442
+ (): number;
443
+ }
444
+
445
+ export type RelativeRoutingType = "route" | "path";
446
+
447
+ // Allowed for any navigation or fetch
448
+ type BaseNavigateOrFetchOptions = {
449
+ preventScrollReset?: boolean;
450
+ relative?: RelativeRoutingType;
451
+ unstable_flushSync?: boolean;
452
+ };
453
+
454
+ // Only allowed for navigations
455
+ type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
456
+ replace?: boolean;
457
+ state?: any;
458
+ fromRouteId?: string;
459
+ unstable_viewTransition?: boolean;
460
+ };
461
+
462
+ // Only allowed for submission navigations
463
+ type BaseSubmissionOptions = {
464
+ formMethod?: HTMLFormMethod;
465
+ formEncType?: FormEncType;
466
+ } & (
467
+ | { formData: FormData; body?: undefined }
468
+ | { formData?: undefined; body: any }
469
+ );
470
+
471
+ /**
472
+ * Options for a navigate() call for a normal (non-submission) navigation
473
+ */
474
+ type LinkNavigateOptions = BaseNavigateOptions;
475
+
476
+ /**
477
+ * Options for a navigate() call for a submission navigation
478
+ */
479
+ type SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;
480
+
481
+ /**
482
+ * Options to pass to navigate() for a navigation
483
+ */
484
+ export type RouterNavigateOptions =
485
+ | LinkNavigateOptions
486
+ | SubmissionNavigateOptions;
487
+
488
+ /**
489
+ * Options for a fetch() load
490
+ */
491
+ type LoadFetchOptions = BaseNavigateOrFetchOptions;
492
+
493
+ /**
494
+ * Options for a fetch() submission
495
+ */
496
+ type SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;
497
+
498
+ /**
499
+ * Options to pass to fetch()
500
+ */
501
+ export type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;
502
+
503
+ /**
504
+ * Potential states for state.navigation
505
+ */
506
+ export type NavigationStates = {
507
+ Idle: {
508
+ state: "idle";
509
+ location: undefined;
510
+ formMethod: undefined;
511
+ formAction: undefined;
512
+ formEncType: undefined;
513
+ formData: undefined;
514
+ json: undefined;
515
+ text: undefined;
516
+ };
517
+ Loading: {
518
+ state: "loading";
519
+ location: Location;
520
+ formMethod: Submission["formMethod"] | undefined;
521
+ formAction: Submission["formAction"] | undefined;
522
+ formEncType: Submission["formEncType"] | undefined;
523
+ formData: Submission["formData"] | undefined;
524
+ json: Submission["json"] | undefined;
525
+ text: Submission["text"] | undefined;
526
+ };
527
+ Submitting: {
528
+ state: "submitting";
529
+ location: Location;
530
+ formMethod: Submission["formMethod"];
531
+ formAction: Submission["formAction"];
532
+ formEncType: Submission["formEncType"];
533
+ formData: Submission["formData"];
534
+ json: Submission["json"];
535
+ text: Submission["text"];
536
+ };
537
+ };
538
+
539
+ export type Navigation = NavigationStates[keyof NavigationStates];
540
+
541
+ export type RevalidationState = "idle" | "loading";
542
+
543
+ /**
544
+ * Potential states for fetchers
545
+ */
546
+ type FetcherStates<TData = any> = {
547
+ Idle: {
548
+ state: "idle";
549
+ formMethod: undefined;
550
+ formAction: undefined;
551
+ formEncType: undefined;
552
+ text: undefined;
553
+ formData: undefined;
554
+ json: undefined;
555
+ data: TData | undefined;
556
+ };
557
+ Loading: {
558
+ state: "loading";
559
+ formMethod: Submission["formMethod"] | undefined;
560
+ formAction: Submission["formAction"] | undefined;
561
+ formEncType: Submission["formEncType"] | undefined;
562
+ text: Submission["text"] | undefined;
563
+ formData: Submission["formData"] | undefined;
564
+ json: Submission["json"] | undefined;
565
+ data: TData | undefined;
566
+ };
567
+ Submitting: {
568
+ state: "submitting";
569
+ formMethod: Submission["formMethod"];
570
+ formAction: Submission["formAction"];
571
+ formEncType: Submission["formEncType"];
572
+ text: Submission["text"];
573
+ formData: Submission["formData"];
574
+ json: Submission["json"];
575
+ data: TData | undefined;
576
+ };
577
+ };
578
+
579
+ export type Fetcher<TData = any> =
580
+ FetcherStates<TData>[keyof FetcherStates<TData>];
581
+
582
+ interface BlockerBlocked {
583
+ state: "blocked";
584
+ reset(): void;
585
+ proceed(): void;
586
+ location: Location;
587
+ }
588
+
589
+ interface BlockerUnblocked {
590
+ state: "unblocked";
591
+ reset: undefined;
592
+ proceed: undefined;
593
+ location: undefined;
594
+ }
595
+
596
+ interface BlockerProceeding {
597
+ state: "proceeding";
598
+ reset: undefined;
599
+ proceed: undefined;
600
+ location: Location;
601
+ }
602
+
603
+ export type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
604
+
605
+ export type BlockerFunction = (args: {
606
+ currentLocation: Location;
607
+ nextLocation: Location;
608
+ historyAction: HistoryAction;
609
+ }) => boolean;
610
+
611
+ interface ShortCircuitable {
612
+ /**
613
+ * startNavigation does not need to complete the navigation because we
614
+ * redirected or got interrupted
615
+ */
616
+ shortCircuited?: boolean;
617
+ }
618
+
619
+ interface HandleActionResult extends ShortCircuitable {
620
+ /**
621
+ * Error thrown from the current action, keyed by the route containing the
622
+ * error boundary to render the error. To be committed to the state after
623
+ * loaders have completed
624
+ */
625
+ pendingActionError?: RouteData;
626
+ /**
627
+ * Data returned from the current action, keyed by the route owning the action.
628
+ * To be committed to the state after loaders have completed
629
+ */
630
+ pendingActionData?: RouteData;
631
+ }
632
+
633
+ interface HandleLoadersResult extends ShortCircuitable {
634
+ /**
635
+ * loaderData returned from the current set of loaders
636
+ */
637
+ loaderData?: RouterState["loaderData"];
638
+ /**
639
+ * errors thrown from the current set of loaders
640
+ */
641
+ errors?: RouterState["errors"];
642
+ }
643
+
644
+ /**
645
+ * Cached info for active fetcher.load() instances so they can participate
646
+ * in revalidation
647
+ */
648
+ interface FetchLoadMatch {
649
+ routeId: string;
650
+ path: string;
651
+ }
652
+
653
+ /**
654
+ * Identified fetcher.load() calls that need to be revalidated
655
+ */
656
+ interface RevalidatingFetcher extends FetchLoadMatch {
657
+ key: string;
658
+ match: AgnosticDataRouteMatch | null;
659
+ matches: AgnosticDataRouteMatch[] | null;
660
+ controller: AbortController | null;
661
+ }
662
+
663
+ /**
664
+ * Wrapper object to allow us to throw any response out from callLoaderOrAction
665
+ * for queryRouter while preserving whether or not it was thrown or returned
666
+ * from the loader/action
667
+ */
668
+ interface QueryRouteResponse {
669
+ type: ResultType.data | ResultType.error;
670
+ response: Response;
671
+ }
672
+
673
+ const validMutationMethodsArr: MutationFormMethod[] = [
674
+ "post",
675
+ "put",
676
+ "patch",
677
+ "delete",
678
+ ];
679
+ const validMutationMethods = new Set<MutationFormMethod>(
680
+ validMutationMethodsArr
681
+ );
682
+
683
+ const validRequestMethodsArr: FormMethod[] = [
684
+ "get",
685
+ ...validMutationMethodsArr,
686
+ ];
687
+ const validRequestMethods = new Set<FormMethod>(validRequestMethodsArr);
688
+
689
+ const redirectStatusCodes = new Set([301, 302, 303, 307, 308]);
690
+ const redirectPreserveMethodStatusCodes = new Set([307, 308]);
691
+
692
+ export const IDLE_NAVIGATION: NavigationStates["Idle"] = {
693
+ state: "idle",
694
+ location: undefined,
695
+ formMethod: undefined,
696
+ formAction: undefined,
697
+ formEncType: undefined,
698
+ formData: undefined,
699
+ json: undefined,
700
+ text: undefined,
701
+ };
702
+
703
+ export const IDLE_FETCHER: FetcherStates["Idle"] = {
704
+ state: "idle",
705
+ data: undefined,
706
+ formMethod: undefined,
707
+ formAction: undefined,
708
+ formEncType: undefined,
709
+ formData: undefined,
710
+ json: undefined,
711
+ text: undefined,
712
+ };
713
+
714
+ export const IDLE_BLOCKER: BlockerUnblocked = {
715
+ state: "unblocked",
716
+ proceed: undefined,
717
+ reset: undefined,
718
+ location: undefined,
719
+ };
720
+
721
+ const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
722
+
723
+ const defaultMapRouteProperties: MapRoutePropertiesFunction = (route) => ({
724
+ hasErrorBoundary: Boolean(route.hasErrorBoundary),
725
+ });
726
+
727
+ const TRANSITIONS_STORAGE_KEY = "remix-router-transitions";
728
+
729
+ //#endregion
730
+
731
+ ////////////////////////////////////////////////////////////////////////////////
732
+ //#region createRouter
733
+ ////////////////////////////////////////////////////////////////////////////////
734
+
735
+ /**
736
+ * Create a router and listen to history POP navigations
737
+ */
738
+ export function createRouter(init: RouterInit): Router {
739
+ const routerWindow = init.window
740
+ ? init.window
741
+ : typeof window !== "undefined"
742
+ ? window
743
+ : undefined;
744
+ const isBrowser =
745
+ typeof routerWindow !== "undefined" &&
746
+ typeof routerWindow.document !== "undefined" &&
747
+ typeof routerWindow.document.createElement !== "undefined";
748
+ const isServer = !isBrowser;
749
+
750
+ invariant(
751
+ init.routes.length > 0,
752
+ "You must provide a non-empty routes array to createRouter"
753
+ );
754
+
755
+ let mapRouteProperties: MapRoutePropertiesFunction;
756
+ if (init.mapRouteProperties) {
757
+ mapRouteProperties = init.mapRouteProperties;
758
+ } else if (init.detectErrorBoundary) {
759
+ // If they are still using the deprecated version, wrap it with the new API
760
+ let detectErrorBoundary = init.detectErrorBoundary;
761
+ mapRouteProperties = (route) => ({
762
+ hasErrorBoundary: detectErrorBoundary(route),
763
+ });
764
+ } else {
765
+ mapRouteProperties = defaultMapRouteProperties;
766
+ }
767
+
768
+ // Routes keyed by ID
769
+ let manifest: RouteManifest = {};
770
+ // Routes in tree format for matching
771
+ let dataRoutes = convertRoutesToDataRoutes(
772
+ init.routes,
773
+ mapRouteProperties,
774
+ undefined,
775
+ manifest
776
+ );
777
+ let inFlightDataRoutes: AgnosticDataRouteObject[] | undefined;
778
+ let basename = init.basename || "/";
779
+ // Config driven behavior flags
780
+ let future: FutureConfig = {
781
+ v7_fetcherPersist: false,
782
+ v7_normalizeFormMethod: false,
783
+ v7_partialHydration: false,
784
+ v7_prependBasename: false,
785
+ v7_relativeSplatPath: false,
786
+ ...init.future,
787
+ };
788
+ // Cleanup function for history
789
+ let unlistenHistory: (() => void) | null = null;
790
+ // Externally-provided functions to call on all state changes
791
+ let subscribers = new Set<RouterSubscriber>();
792
+ // Externally-provided object to hold scroll restoration locations during routing
793
+ let savedScrollPositions: Record<string, number> | null = null;
794
+ // Externally-provided function to get scroll restoration keys
795
+ let getScrollRestorationKey: GetScrollRestorationKeyFunction | null = null;
796
+ // Externally-provided function to get current scroll position
797
+ let getScrollPosition: GetScrollPositionFunction | null = null;
798
+ // One-time flag to control the initial hydration scroll restoration. Because
799
+ // we don't get the saved positions from <ScrollRestoration /> until _after_
800
+ // the initial render, we need to manually trigger a separate updateState to
801
+ // send along the restoreScrollPosition
802
+ // Set to true if we have `hydrationData` since we assume we were SSR'd and that
803
+ // SSR did the initial scroll restoration.
804
+ let initialScrollRestored = init.hydrationData != null;
805
+
806
+ let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
807
+ let initialErrors: RouteData | null = null;
808
+
809
+ if (initialMatches == null) {
810
+ // If we do not match a user-provided-route, fall back to the root
811
+ // to allow the error boundary to take over
812
+ let error = getInternalRouterError(404, {
813
+ pathname: init.history.location.pathname,
814
+ });
815
+ let { matches, route } = getShortCircuitMatches(dataRoutes);
816
+ initialMatches = matches;
817
+ initialErrors = { [route.id]: error };
818
+ }
819
+
820
+ let initialized: boolean;
821
+ let hasLazyRoutes = initialMatches.some((m) => m.route.lazy);
822
+ let hasLoaders = initialMatches.some((m) => m.route.loader);
823
+ if (hasLazyRoutes) {
824
+ // All initialMatches need to be loaded before we're ready. If we have lazy
825
+ // functions around still then we'll need to run them in initialize()
826
+ initialized = false;
827
+ } else if (!hasLoaders) {
828
+ // If we've got no loaders to run, then we're good to go
829
+ initialized = true;
830
+ } else if (future.v7_partialHydration) {
831
+ // If partial hydration is enabled, we're initialized so long as we were
832
+ // provided with hydrationData for every route with a loader, and no loaders
833
+ // were marked for explicit hydration
834
+ let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
835
+ let errors = init.hydrationData ? init.hydrationData.errors : null;
836
+ let isRouteInitialized = (m: AgnosticDataRouteMatch) => {
837
+ // No loader, nothing to initialize
838
+ if (!m.route.loader) return true;
839
+ // Explicitly opting-in to running on hydration
840
+ if (m.route.loader.hydrate === true) return false;
841
+ // Otherwise, initialized if hydrated with data or an error
842
+ return (
843
+ (loaderData && loaderData[m.route.id] !== undefined) ||
844
+ (errors && errors[m.route.id] !== undefined)
845
+ );
846
+ };
847
+
848
+ // If errors exist, don't consider routes below the boundary
849
+ if (errors) {
850
+ let idx = initialMatches.findIndex(
851
+ (m) => errors![m.route.id] !== undefined
852
+ );
853
+ initialized = initialMatches.slice(0, idx + 1).every(isRouteInitialized);
854
+ } else {
855
+ initialized = initialMatches.every(isRouteInitialized);
856
+ }
857
+ } else {
858
+ // Without partial hydration - we're initialized if we were provided any
859
+ // hydrationData - which is expected to be complete
860
+ initialized = init.hydrationData != null;
861
+ }
862
+
863
+ let router: Router;
864
+ let state: RouterState = {
865
+ historyAction: init.history.action,
866
+ location: init.history.location,
867
+ matches: initialMatches,
868
+ initialized,
869
+ navigation: IDLE_NAVIGATION,
870
+ // Don't restore on initial updateState() if we were SSR'd
871
+ restoreScrollPosition: init.hydrationData != null ? false : null,
872
+ preventScrollReset: false,
873
+ revalidation: "idle",
874
+ loaderData: (init.hydrationData && init.hydrationData.loaderData) || {},
875
+ actionData: (init.hydrationData && init.hydrationData.actionData) || null,
876
+ errors: (init.hydrationData && init.hydrationData.errors) || initialErrors,
877
+ fetchers: new Map(),
878
+ blockers: new Map(),
879
+ };
880
+
881
+ // -- Stateful internal variables to manage navigations --
882
+ // Current navigation in progress (to be committed in completeNavigation)
883
+ let pendingAction: HistoryAction = HistoryAction.Pop;
884
+
885
+ // Should the current navigation prevent the scroll reset if scroll cannot
886
+ // be restored?
887
+ let pendingPreventScrollReset = false;
888
+
889
+ // AbortController for the active navigation
890
+ let pendingNavigationController: AbortController | null;
891
+
892
+ // Should the current navigation enable document.startViewTransition?
893
+ let pendingViewTransitionEnabled = false;
894
+
895
+ // Store applied view transitions so we can apply them on POP
896
+ let appliedViewTransitions: Map<string, Set<string>> = new Map<
897
+ string,
898
+ Set<string>
899
+ >();
900
+
901
+ // Cleanup function for persisting applied transitions to sessionStorage
902
+ let removePageHideEventListener: (() => void) | null = null;
903
+
904
+ // We use this to avoid touching history in completeNavigation if a
905
+ // revalidation is entirely uninterrupted
906
+ let isUninterruptedRevalidation = false;
907
+
908
+ // Use this internal flag to force revalidation of all loaders:
909
+ // - submissions (completed or interrupted)
910
+ // - useRevalidator()
911
+ // - X-Remix-Revalidate (from redirect)
912
+ let isRevalidationRequired = false;
913
+
914
+ // Use this internal array to capture routes that require revalidation due
915
+ // to a cancelled deferred on action submission
916
+ let cancelledDeferredRoutes: string[] = [];
917
+
918
+ // Use this internal array to capture fetcher loads that were cancelled by an
919
+ // action navigation and require revalidation
920
+ let cancelledFetcherLoads: string[] = [];
921
+
922
+ // AbortControllers for any in-flight fetchers
923
+ let fetchControllers = new Map<string, AbortController>();
924
+
925
+ // Track loads based on the order in which they started
926
+ let incrementingLoadId = 0;
927
+
928
+ // Track the outstanding pending navigation data load to be compared against
929
+ // the globally incrementing load when a fetcher load lands after a completed
930
+ // navigation
931
+ let pendingNavigationLoadId = -1;
932
+
933
+ // Fetchers that triggered data reloads as a result of their actions
934
+ let fetchReloadIds = new Map<string, number>();
935
+
936
+ // Fetchers that triggered redirect navigations
937
+ let fetchRedirectIds = new Set<string>();
938
+
939
+ // Most recent href/match for fetcher.load calls for fetchers
940
+ let fetchLoadMatches = new Map<string, FetchLoadMatch>();
941
+
942
+ // Ref-count mounted fetchers so we know when it's ok to clean them up
943
+ let activeFetchers = new Map<string, number>();
944
+
945
+ // Fetchers that have requested a delete when using v7_fetcherPersist,
946
+ // they'll be officially removed after they return to idle
947
+ let deletedFetchers = new Set<string>();
948
+
949
+ // Store DeferredData instances for active route matches. When a
950
+ // route loader returns defer() we stick one in here. Then, when a nested
951
+ // promise resolves we update loaderData. If a new navigation starts we
952
+ // cancel active deferreds for eliminated routes.
953
+ let activeDeferreds = new Map<string, DeferredData>();
954
+
955
+ // Store blocker functions in a separate Map outside of router state since
956
+ // we don't need to update UI state if they change
957
+ let blockerFunctions = new Map<string, BlockerFunction>();
958
+
959
+ // Flag to ignore the next history update, so we can revert the URL change on
960
+ // a POP navigation that was blocked by the user without touching router state
961
+ let ignoreNextHistoryUpdate = false;
962
+
963
+ // Initialize the router, all side effects should be kicked off from here.
964
+ // Implemented as a Fluent API for ease of:
965
+ // let router = createRouter(init).initialize();
966
+ function initialize() {
967
+ // If history informs us of a POP navigation, start the navigation but do not update
968
+ // state. We'll update our own state once the navigation completes
969
+ unlistenHistory = init.history.listen(
970
+ ({ action: historyAction, location, delta }) => {
971
+ // Ignore this event if it was just us resetting the URL from a
972
+ // blocked POP navigation
973
+ if (ignoreNextHistoryUpdate) {
974
+ ignoreNextHistoryUpdate = false;
975
+ return;
976
+ }
977
+
978
+ warning(
979
+ blockerFunctions.size === 0 || delta != null,
980
+ "You are trying to use a blocker on a POP navigation to a location " +
981
+ "that was not created by @remix-run/router. This will fail silently in " +
982
+ "production. This can happen if you are navigating outside the router " +
983
+ "via `window.history.pushState`/`window.location.hash` instead of using " +
984
+ "router navigation APIs. This can also happen if you are using " +
985
+ "createHashRouter and the user manually changes the URL."
986
+ );
987
+
988
+ let blockerKey = shouldBlockNavigation({
989
+ currentLocation: state.location,
990
+ nextLocation: location,
991
+ historyAction,
992
+ });
993
+
994
+ if (blockerKey && delta != null) {
995
+ // Restore the URL to match the current UI, but don't update router state
996
+ ignoreNextHistoryUpdate = true;
997
+ init.history.go(delta * -1);
998
+
999
+ // Put the blocker into a blocked state
1000
+ updateBlocker(blockerKey, {
1001
+ state: "blocked",
1002
+ location,
1003
+ proceed() {
1004
+ updateBlocker(blockerKey!, {
1005
+ state: "proceeding",
1006
+ proceed: undefined,
1007
+ reset: undefined,
1008
+ location,
1009
+ });
1010
+ // Re-do the same POP navigation we just blocked
1011
+ init.history.go(delta);
1012
+ },
1013
+ reset() {
1014
+ let blockers = new Map(state.blockers);
1015
+ blockers.set(blockerKey!, IDLE_BLOCKER);
1016
+ updateState({ blockers });
1017
+ },
1018
+ });
1019
+ return;
1020
+ }
1021
+
1022
+ return startNavigation(historyAction, location);
1023
+ }
1024
+ );
1025
+
1026
+ if (isBrowser) {
1027
+ // FIXME: This feels gross. How can we cleanup the lines between
1028
+ // scrollRestoration/appliedTransitions persistance?
1029
+ restoreAppliedTransitions(routerWindow, appliedViewTransitions);
1030
+ let _saveAppliedTransitions = () =>
1031
+ persistAppliedTransitions(routerWindow, appliedViewTransitions);
1032
+ routerWindow.addEventListener("pagehide", _saveAppliedTransitions);
1033
+ removePageHideEventListener = () =>
1034
+ routerWindow.removeEventListener("pagehide", _saveAppliedTransitions);
1035
+ }
1036
+
1037
+ // Kick off initial data load if needed. Use Pop to avoid modifying history
1038
+ // Note we don't do any handling of lazy here. For SPA's it'll get handled
1039
+ // in the normal navigation flow. For SSR it's expected that lazy modules are
1040
+ // resolved prior to router creation since we can't go into a fallbackElement
1041
+ // UI for SSR'd apps
1042
+ if (!state.initialized) {
1043
+ startNavigation(HistoryAction.Pop, state.location, {
1044
+ initialHydration: true,
1045
+ });
1046
+ }
1047
+
1048
+ return router;
1049
+ }
1050
+
1051
+ // Clean up a router and it's side effects
1052
+ function dispose() {
1053
+ if (unlistenHistory) {
1054
+ unlistenHistory();
1055
+ }
1056
+ if (removePageHideEventListener) {
1057
+ removePageHideEventListener();
1058
+ }
1059
+ subscribers.clear();
1060
+ pendingNavigationController && pendingNavigationController.abort();
1061
+ state.fetchers.forEach((_, key) => deleteFetcher(key));
1062
+ state.blockers.forEach((_, key) => deleteBlocker(key));
1063
+ }
1064
+
1065
+ // Subscribe to state updates for the router
1066
+ function subscribe(fn: RouterSubscriber) {
1067
+ subscribers.add(fn);
1068
+ return () => subscribers.delete(fn);
1069
+ }
1070
+
1071
+ // Update our state and notify the calling context of the change
1072
+ function updateState(
1073
+ newState: Partial<RouterState>,
1074
+ opts: {
1075
+ flushSync?: boolean;
1076
+ viewTransitionOpts?: ViewTransitionOpts;
1077
+ } = {}
1078
+ ): void {
1079
+ state = {
1080
+ ...state,
1081
+ ...newState,
1082
+ };
1083
+
1084
+ // Prep fetcher cleanup so we can tell the UI which fetcher data entries
1085
+ // can be removed
1086
+ let completedFetchers: string[] = [];
1087
+ let deletedFetchersKeys: string[] = [];
1088
+
1089
+ if (future.v7_fetcherPersist) {
1090
+ state.fetchers.forEach((fetcher, key) => {
1091
+ if (fetcher.state === "idle") {
1092
+ if (deletedFetchers.has(key)) {
1093
+ // Unmounted from the UI and can be totally removed
1094
+ deletedFetchersKeys.push(key);
1095
+ } else {
1096
+ // Returned to idle but still mounted in the UI, so semi-remains for
1097
+ // revalidations and such
1098
+ completedFetchers.push(key);
1099
+ }
1100
+ }
1101
+ });
1102
+ }
1103
+
1104
+ // Iterate over a local copy so that if flushSync is used and we end up
1105
+ // removing and adding a new subscriber due to the useCallback dependencies,
1106
+ // we don't get ourselves into a loop calling the new subscriber immediately
1107
+ [...subscribers].forEach((subscriber) =>
1108
+ subscriber(state, {
1109
+ deletedFetchers: deletedFetchersKeys,
1110
+ unstable_viewTransitionOpts: opts.viewTransitionOpts,
1111
+ unstable_flushSync: opts.flushSync === true,
1112
+ })
1113
+ );
1114
+
1115
+ // Remove idle fetchers from state since we only care about in-flight fetchers.
1116
+ if (future.v7_fetcherPersist) {
1117
+ completedFetchers.forEach((key) => state.fetchers.delete(key));
1118
+ deletedFetchersKeys.forEach((key) => deleteFetcher(key));
1119
+ }
1120
+ }
1121
+
1122
+ // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION
1123
+ // and setting state.[historyAction/location/matches] to the new route.
1124
+ // - Location is a required param
1125
+ // - Navigation will always be set to IDLE_NAVIGATION
1126
+ // - Can pass any other state in newState
1127
+ function completeNavigation(
1128
+ location: Location,
1129
+ newState: Partial<Omit<RouterState, "action" | "location" | "navigation">>,
1130
+ { flushSync }: { flushSync?: boolean } = {}
1131
+ ): void {
1132
+ // Deduce if we're in a loading/actionReload state:
1133
+ // - We have committed actionData in the store
1134
+ // - The current navigation was a mutation submission
1135
+ // - We're past the submitting state and into the loading state
1136
+ // - The location being loaded is not the result of a redirect
1137
+ let isActionReload =
1138
+ state.actionData != null &&
1139
+ state.navigation.formMethod != null &&
1140
+ isMutationMethod(state.navigation.formMethod) &&
1141
+ state.navigation.state === "loading" &&
1142
+ location.state?._isRedirect !== true;
1143
+
1144
+ let actionData: RouteData | null;
1145
+ if (newState.actionData) {
1146
+ if (Object.keys(newState.actionData).length > 0) {
1147
+ actionData = newState.actionData;
1148
+ } else {
1149
+ // Empty actionData -> clear prior actionData due to an action error
1150
+ actionData = null;
1151
+ }
1152
+ } else if (isActionReload) {
1153
+ // Keep the current data if we're wrapping up the action reload
1154
+ actionData = state.actionData;
1155
+ } else {
1156
+ // Clear actionData on any other completed navigations
1157
+ actionData = null;
1158
+ }
1159
+
1160
+ // Always preserve any existing loaderData from re-used routes
1161
+ let loaderData = newState.loaderData
1162
+ ? mergeLoaderData(
1163
+ state.loaderData,
1164
+ newState.loaderData,
1165
+ newState.matches || [],
1166
+ newState.errors
1167
+ )
1168
+ : state.loaderData;
1169
+
1170
+ // On a successful navigation we can assume we got through all blockers
1171
+ // so we can start fresh
1172
+ let blockers = state.blockers;
1173
+ if (blockers.size > 0) {
1174
+ blockers = new Map(blockers);
1175
+ blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));
1176
+ }
1177
+
1178
+ // Always respect the user flag. Otherwise don't reset on mutation
1179
+ // submission navigations unless they redirect
1180
+ let preventScrollReset =
1181
+ pendingPreventScrollReset === true ||
1182
+ (state.navigation.formMethod != null &&
1183
+ isMutationMethod(state.navigation.formMethod) &&
1184
+ location.state?._isRedirect !== true);
1185
+
1186
+ if (inFlightDataRoutes) {
1187
+ dataRoutes = inFlightDataRoutes;
1188
+ inFlightDataRoutes = undefined;
1189
+ }
1190
+
1191
+ if (isUninterruptedRevalidation) {
1192
+ // If this was an uninterrupted revalidation then do not touch history
1193
+ } else if (pendingAction === HistoryAction.Pop) {
1194
+ // Do nothing for POP - URL has already been updated
1195
+ } else if (pendingAction === HistoryAction.Push) {
1196
+ init.history.push(location, location.state);
1197
+ } else if (pendingAction === HistoryAction.Replace) {
1198
+ init.history.replace(location, location.state);
1199
+ }
1200
+
1201
+ let viewTransitionOpts: ViewTransitionOpts | undefined;
1202
+
1203
+ // On POP, enable transitions if they were enabled on the original navigation
1204
+ if (pendingAction === HistoryAction.Pop) {
1205
+ // Forward takes precedence so they behave like the original navigation
1206
+ let priorPaths = appliedViewTransitions.get(state.location.pathname);
1207
+ if (priorPaths && priorPaths.has(location.pathname)) {
1208
+ viewTransitionOpts = {
1209
+ currentLocation: state.location,
1210
+ nextLocation: location,
1211
+ };
1212
+ } else if (appliedViewTransitions.has(location.pathname)) {
1213
+ // If we don't have a previous forward nav, assume we're popping back to
1214
+ // the new location and enable if that location previously enabled
1215
+ viewTransitionOpts = {
1216
+ currentLocation: location,
1217
+ nextLocation: state.location,
1218
+ };
1219
+ }
1220
+ } else if (pendingViewTransitionEnabled) {
1221
+ // Store the applied transition on PUSH/REPLACE
1222
+ let toPaths = appliedViewTransitions.get(state.location.pathname);
1223
+ if (toPaths) {
1224
+ toPaths.add(location.pathname);
1225
+ } else {
1226
+ toPaths = new Set<string>([location.pathname]);
1227
+ appliedViewTransitions.set(state.location.pathname, toPaths);
1228
+ }
1229
+ viewTransitionOpts = {
1230
+ currentLocation: state.location,
1231
+ nextLocation: location,
1232
+ };
1233
+ }
1234
+
1235
+ updateState(
1236
+ {
1237
+ ...newState, // matches, errors, fetchers go through as-is
1238
+ actionData,
1239
+ loaderData,
1240
+ historyAction: pendingAction,
1241
+ location,
1242
+ initialized: true,
1243
+ navigation: IDLE_NAVIGATION,
1244
+ revalidation: "idle",
1245
+ restoreScrollPosition: getSavedScrollPosition(
1246
+ location,
1247
+ newState.matches || state.matches
1248
+ ),
1249
+ preventScrollReset,
1250
+ blockers,
1251
+ },
1252
+ {
1253
+ viewTransitionOpts,
1254
+ flushSync: flushSync === true,
1255
+ }
1256
+ );
1257
+
1258
+ // Reset stateful navigation vars
1259
+ pendingAction = HistoryAction.Pop;
1260
+ pendingPreventScrollReset = false;
1261
+ pendingViewTransitionEnabled = false;
1262
+ isUninterruptedRevalidation = false;
1263
+ isRevalidationRequired = false;
1264
+ cancelledDeferredRoutes = [];
1265
+ cancelledFetcherLoads = [];
1266
+ }
1267
+
1268
+ // Trigger a navigation event, which can either be a numerical POP or a PUSH
1269
+ // replace with an optional submission
1270
+ async function navigate(
1271
+ to: number | To | null,
1272
+ opts?: RouterNavigateOptions
1273
+ ): Promise<void> {
1274
+ if (typeof to === "number") {
1275
+ init.history.go(to);
1276
+ return;
1277
+ }
1278
+
1279
+ let normalizedPath = normalizeTo(
1280
+ state.location,
1281
+ state.matches,
1282
+ basename,
1283
+ future.v7_prependBasename,
1284
+ to,
1285
+ future.v7_relativeSplatPath,
1286
+ opts?.fromRouteId,
1287
+ opts?.relative
1288
+ );
1289
+ let { path, submission, error } = normalizeNavigateOptions(
1290
+ future.v7_normalizeFormMethod,
1291
+ false,
1292
+ normalizedPath,
1293
+ opts
1294
+ );
1295
+
1296
+ let currentLocation = state.location;
1297
+ let nextLocation = createLocation(state.location, path, opts && opts.state);
1298
+
1299
+ // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded
1300
+ // URL from window.location, so we need to encode it here so the behavior
1301
+ // remains the same as POP and non-data-router usages. new URL() does all
1302
+ // the same encoding we'd get from a history.pushState/window.location read
1303
+ // without having to touch history
1304
+ nextLocation = {
1305
+ ...nextLocation,
1306
+ ...init.history.encodeLocation(nextLocation),
1307
+ };
1308
+
1309
+ let userReplace = opts && opts.replace != null ? opts.replace : undefined;
1310
+
1311
+ let historyAction = HistoryAction.Push;
1312
+
1313
+ if (userReplace === true) {
1314
+ historyAction = HistoryAction.Replace;
1315
+ } else if (userReplace === false) {
1316
+ // no-op
1317
+ } else if (
1318
+ submission != null &&
1319
+ isMutationMethod(submission.formMethod) &&
1320
+ submission.formAction === state.location.pathname + state.location.search
1321
+ ) {
1322
+ // By default on submissions to the current location we REPLACE so that
1323
+ // users don't have to double-click the back button to get to the prior
1324
+ // location. If the user redirects to a different location from the
1325
+ // action/loader this will be ignored and the redirect will be a PUSH
1326
+ historyAction = HistoryAction.Replace;
1327
+ }
1328
+
1329
+ let preventScrollReset =
1330
+ opts && "preventScrollReset" in opts
1331
+ ? opts.preventScrollReset === true
1332
+ : undefined;
1333
+
1334
+ let flushSync = (opts && opts.unstable_flushSync) === true;
1335
+
1336
+ let blockerKey = shouldBlockNavigation({
1337
+ currentLocation,
1338
+ nextLocation,
1339
+ historyAction,
1340
+ });
1341
+
1342
+ if (blockerKey) {
1343
+ // Put the blocker into a blocked state
1344
+ updateBlocker(blockerKey, {
1345
+ state: "blocked",
1346
+ location: nextLocation,
1347
+ proceed() {
1348
+ updateBlocker(blockerKey!, {
1349
+ state: "proceeding",
1350
+ proceed: undefined,
1351
+ reset: undefined,
1352
+ location: nextLocation,
1353
+ });
1354
+ // Send the same navigation through
1355
+ navigate(to, opts);
1356
+ },
1357
+ reset() {
1358
+ let blockers = new Map(state.blockers);
1359
+ blockers.set(blockerKey!, IDLE_BLOCKER);
1360
+ updateState({ blockers });
1361
+ },
1362
+ });
1363
+ return;
1364
+ }
1365
+
1366
+ return await startNavigation(historyAction, nextLocation, {
1367
+ submission,
1368
+ // Send through the formData serialization error if we have one so we can
1369
+ // render at the right error boundary after we match routes
1370
+ pendingError: error,
1371
+ preventScrollReset,
1372
+ replace: opts && opts.replace,
1373
+ enableViewTransition: opts && opts.unstable_viewTransition,
1374
+ flushSync,
1375
+ });
1376
+ }
1377
+
1378
+ // Revalidate all current loaders. If a navigation is in progress or if this
1379
+ // is interrupted by a navigation, allow this to "succeed" by calling all
1380
+ // loaders during the next loader round
1381
+ function revalidate() {
1382
+ interruptActiveLoads();
1383
+ updateState({ revalidation: "loading" });
1384
+
1385
+ // If we're currently submitting an action, we don't need to start a new
1386
+ // navigation, we'll just let the follow up loader execution call all loaders
1387
+ if (state.navigation.state === "submitting") {
1388
+ return;
1389
+ }
1390
+
1391
+ // If we're currently in an idle state, start a new navigation for the current
1392
+ // action/location and mark it as uninterrupted, which will skip the history
1393
+ // update in completeNavigation
1394
+ if (state.navigation.state === "idle") {
1395
+ startNavigation(state.historyAction, state.location, {
1396
+ startUninterruptedRevalidation: true,
1397
+ });
1398
+ return;
1399
+ }
1400
+
1401
+ // Otherwise, if we're currently in a loading state, just start a new
1402
+ // navigation to the navigation.location but do not trigger an uninterrupted
1403
+ // revalidation so that history correctly updates once the navigation completes
1404
+ startNavigation(
1405
+ pendingAction || state.historyAction,
1406
+ state.navigation.location,
1407
+ { overrideNavigation: state.navigation }
1408
+ );
1409
+ }
1410
+
1411
+ // Start a navigation to the given action/location. Can optionally provide a
1412
+ // overrideNavigation which will override the normalLoad in the case of a redirect
1413
+ // navigation
1414
+ async function startNavigation(
1415
+ historyAction: HistoryAction,
1416
+ location: Location,
1417
+ opts?: {
1418
+ initialHydration?: boolean;
1419
+ submission?: Submission;
1420
+ fetcherSubmission?: Submission;
1421
+ overrideNavigation?: Navigation;
1422
+ pendingError?: ErrorResponseImpl;
1423
+ startUninterruptedRevalidation?: boolean;
1424
+ preventScrollReset?: boolean;
1425
+ replace?: boolean;
1426
+ enableViewTransition?: boolean;
1427
+ flushSync?: boolean;
1428
+ }
1429
+ ): Promise<void> {
1430
+ // Abort any in-progress navigations and start a new one. Unset any ongoing
1431
+ // uninterrupted revalidations unless told otherwise, since we want this
1432
+ // new navigation to update history normally
1433
+ pendingNavigationController && pendingNavigationController.abort();
1434
+ pendingNavigationController = null;
1435
+ pendingAction = historyAction;
1436
+ isUninterruptedRevalidation =
1437
+ (opts && opts.startUninterruptedRevalidation) === true;
1438
+
1439
+ // Save the current scroll position every time we start a new navigation,
1440
+ // and track whether we should reset scroll on completion
1441
+ saveScrollPosition(state.location, state.matches);
1442
+ pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
1443
+
1444
+ pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
1445
+
1446
+ let routesToUse = inFlightDataRoutes || dataRoutes;
1447
+ let loadingNavigation = opts && opts.overrideNavigation;
1448
+ let matches = matchRoutes(routesToUse, location, basename);
1449
+ let flushSync = (opts && opts.flushSync) === true;
1450
+
1451
+ // Short circuit with a 404 on the root error boundary if we match nothing
1452
+ if (!matches) {
1453
+ let error = getInternalRouterError(404, { pathname: location.pathname });
1454
+ let { matches: notFoundMatches, route } =
1455
+ getShortCircuitMatches(routesToUse);
1456
+ // Cancel all pending deferred on 404s since we don't keep any routes
1457
+ cancelActiveDeferreds();
1458
+ completeNavigation(
1459
+ location,
1460
+ {
1461
+ matches: notFoundMatches,
1462
+ loaderData: {},
1463
+ errors: {
1464
+ [route.id]: error,
1465
+ },
1466
+ },
1467
+ { flushSync }
1468
+ );
1469
+ return;
1470
+ }
1471
+
1472
+ // Short circuit if it's only a hash change and not a revalidation or
1473
+ // mutation submission.
1474
+ //
1475
+ // Ignore on initial page loads because since the initial load will always
1476
+ // be "same hash". For example, on /page#hash and submit a <Form method="post">
1477
+ // which will default to a navigation to /page
1478
+ if (
1479
+ state.initialized &&
1480
+ !isRevalidationRequired &&
1481
+ isHashChangeOnly(state.location, location) &&
1482
+ !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))
1483
+ ) {
1484
+ completeNavigation(location, { matches }, { flushSync });
1485
+ return;
1486
+ }
1487
+
1488
+ // Create a controller/Request for this navigation
1489
+ pendingNavigationController = new AbortController();
1490
+ let request = createClientSideRequest(
1491
+ init.history,
1492
+ location,
1493
+ pendingNavigationController.signal,
1494
+ opts && opts.submission
1495
+ );
1496
+ let pendingActionData: RouteData | undefined;
1497
+ let pendingError: RouteData | undefined;
1498
+
1499
+ if (opts && opts.pendingError) {
1500
+ // If we have a pendingError, it means the user attempted a GET submission
1501
+ // with binary FormData so assign here and skip to handleLoaders. That
1502
+ // way we handle calling loaders above the boundary etc. It's not really
1503
+ // different from an actionError in that sense.
1504
+ pendingError = {
1505
+ [findNearestBoundary(matches).route.id]: opts.pendingError,
1506
+ };
1507
+ } else if (
1508
+ opts &&
1509
+ opts.submission &&
1510
+ isMutationMethod(opts.submission.formMethod)
1511
+ ) {
1512
+ // Call action if we received an action submission
1513
+ let actionOutput = await handleAction(
1514
+ request,
1515
+ location,
1516
+ opts.submission,
1517
+ matches,
1518
+ { replace: opts.replace, flushSync }
1519
+ );
1520
+
1521
+ if (actionOutput.shortCircuited) {
1522
+ return;
1523
+ }
1524
+
1525
+ pendingActionData = actionOutput.pendingActionData;
1526
+ pendingError = actionOutput.pendingActionError;
1527
+ loadingNavigation = getLoadingNavigation(location, opts.submission);
1528
+ flushSync = false;
1529
+
1530
+ // Create a GET request for the loaders
1531
+ request = new Request(request.url, { signal: request.signal });
1532
+ }
1533
+
1534
+ // Call loaders
1535
+ let { shortCircuited, loaderData, errors } = await handleLoaders(
1536
+ request,
1537
+ location,
1538
+ matches,
1539
+ loadingNavigation,
1540
+ opts && opts.submission,
1541
+ opts && opts.fetcherSubmission,
1542
+ opts && opts.replace,
1543
+ opts && opts.initialHydration === true,
1544
+ flushSync,
1545
+ pendingActionData,
1546
+ pendingError
1547
+ );
1548
+
1549
+ if (shortCircuited) {
1550
+ return;
1551
+ }
1552
+
1553
+ // Clean up now that the action/loaders have completed. Don't clean up if
1554
+ // we short circuited because pendingNavigationController will have already
1555
+ // been assigned to a new controller for the next navigation
1556
+ pendingNavigationController = null;
1557
+
1558
+ completeNavigation(location, {
1559
+ matches,
1560
+ ...(pendingActionData ? { actionData: pendingActionData } : {}),
1561
+ loaderData,
1562
+ errors,
1563
+ });
1564
+ }
1565
+
1566
+ // Call the action matched by the leaf route for this navigation and handle
1567
+ // redirects/errors
1568
+ async function handleAction(
1569
+ request: Request,
1570
+ location: Location,
1571
+ submission: Submission,
1572
+ matches: AgnosticDataRouteMatch[],
1573
+ opts: { replace?: boolean; flushSync?: boolean } = {}
1574
+ ): Promise<HandleActionResult> {
1575
+ interruptActiveLoads();
1576
+
1577
+ // Put us in a submitting state
1578
+ let navigation = getSubmittingNavigation(location, submission);
1579
+ updateState({ navigation }, { flushSync: opts.flushSync === true });
1580
+
1581
+ // Call our action and get the result
1582
+ let result: DataResult;
1583
+ let actionMatch = getTargetMatch(matches, location);
1584
+
1585
+ if (!actionMatch.route.action && !actionMatch.route.lazy) {
1586
+ result = {
1587
+ type: ResultType.error,
1588
+ error: getInternalRouterError(405, {
1589
+ method: request.method,
1590
+ pathname: location.pathname,
1591
+ routeId: actionMatch.route.id,
1592
+ }),
1593
+ };
1594
+ } else {
1595
+ result = await callLoaderOrAction(
1596
+ "action",
1597
+ request,
1598
+ actionMatch,
1599
+ matches,
1600
+ manifest,
1601
+ mapRouteProperties,
1602
+ basename,
1603
+ future.v7_relativeSplatPath
1604
+ );
1605
+
1606
+ if (request.signal.aborted) {
1607
+ return { shortCircuited: true };
1608
+ }
1609
+ }
1610
+
1611
+ if (isRedirectResult(result)) {
1612
+ let replace: boolean;
1613
+ if (opts && opts.replace != null) {
1614
+ replace = opts.replace;
1615
+ } else {
1616
+ // If the user didn't explicity indicate replace behavior, replace if
1617
+ // we redirected to the exact same location we're currently at to avoid
1618
+ // double back-buttons
1619
+ replace =
1620
+ result.location === state.location.pathname + state.location.search;
1621
+ }
1622
+ await startRedirectNavigation(state, result, { submission, replace });
1623
+ return { shortCircuited: true };
1624
+ }
1625
+
1626
+ if (isErrorResult(result)) {
1627
+ // Store off the pending error - we use it to determine which loaders
1628
+ // to call and will commit it when we complete the navigation
1629
+ let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
1630
+
1631
+ // By default, all submissions are REPLACE navigations, but if the
1632
+ // action threw an error that'll be rendered in an errorElement, we fall
1633
+ // back to PUSH so that the user can use the back button to get back to
1634
+ // the pre-submission form location to try again
1635
+ if ((opts && opts.replace) !== true) {
1636
+ pendingAction = HistoryAction.Push;
1637
+ }
1638
+
1639
+ return {
1640
+ // Send back an empty object we can use to clear out any prior actionData
1641
+ pendingActionData: {},
1642
+ pendingActionError: { [boundaryMatch.route.id]: result.error },
1643
+ };
1644
+ }
1645
+
1646
+ if (isDeferredResult(result)) {
1647
+ throw getInternalRouterError(400, { type: "defer-action" });
1648
+ }
1649
+
1650
+ return {
1651
+ pendingActionData: { [actionMatch.route.id]: result.data },
1652
+ };
1653
+ }
1654
+
1655
+ // Call all applicable loaders for the given matches, handling redirects,
1656
+ // errors, etc.
1657
+ async function handleLoaders(
1658
+ request: Request,
1659
+ location: Location,
1660
+ matches: AgnosticDataRouteMatch[],
1661
+ overrideNavigation?: Navigation,
1662
+ submission?: Submission,
1663
+ fetcherSubmission?: Submission,
1664
+ replace?: boolean,
1665
+ initialHydration?: boolean,
1666
+ flushSync?: boolean,
1667
+ pendingActionData?: RouteData,
1668
+ pendingError?: RouteData
1669
+ ): Promise<HandleLoadersResult> {
1670
+ // Figure out the right navigation we want to use for data loading
1671
+ let loadingNavigation =
1672
+ overrideNavigation || getLoadingNavigation(location, submission);
1673
+
1674
+ // If this was a redirect from an action we don't have a "submission" but
1675
+ // we have it on the loading navigation so use that if available
1676
+ let activeSubmission =
1677
+ submission ||
1678
+ fetcherSubmission ||
1679
+ getSubmissionFromNavigation(loadingNavigation);
1680
+
1681
+ let routesToUse = inFlightDataRoutes || dataRoutes;
1682
+ let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(
1683
+ init.history,
1684
+ state,
1685
+ matches,
1686
+ activeSubmission,
1687
+ location,
1688
+ future.v7_partialHydration && initialHydration === true,
1689
+ isRevalidationRequired,
1690
+ cancelledDeferredRoutes,
1691
+ cancelledFetcherLoads,
1692
+ deletedFetchers,
1693
+ fetchLoadMatches,
1694
+ fetchRedirectIds,
1695
+ routesToUse,
1696
+ basename,
1697
+ pendingActionData,
1698
+ pendingError
1699
+ );
1700
+
1701
+ // Cancel pending deferreds for no-longer-matched routes or routes we're
1702
+ // about to reload. Note that if this is an action reload we would have
1703
+ // already cancelled all pending deferreds so this would be a no-op
1704
+ cancelActiveDeferreds(
1705
+ (routeId) =>
1706
+ !(matches && matches.some((m) => m.route.id === routeId)) ||
1707
+ (matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))
1708
+ );
1709
+
1710
+ pendingNavigationLoadId = ++incrementingLoadId;
1711
+
1712
+ // Short circuit if we have no loaders to run
1713
+ if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {
1714
+ let updatedFetchers = markFetchRedirectsDone();
1715
+ completeNavigation(
1716
+ location,
1717
+ {
1718
+ matches,
1719
+ loaderData: {},
1720
+ // Commit pending error if we're short circuiting
1721
+ errors: pendingError || null,
1722
+ ...(pendingActionData ? { actionData: pendingActionData } : {}),
1723
+ ...(updatedFetchers ? { fetchers: new Map(state.fetchers) } : {}),
1724
+ },
1725
+ { flushSync }
1726
+ );
1727
+ return { shortCircuited: true };
1728
+ }
1729
+
1730
+ // If this is an uninterrupted revalidation, we remain in our current idle
1731
+ // state. If not, we need to switch to our loading state and load data,
1732
+ // preserving any new action data or existing action data (in the case of
1733
+ // a revalidation interrupting an actionReload)
1734
+ // If we have partialHydration enabled, then don't update the state for the
1735
+ // initial data load since it's not a "navigation"
1736
+ if (
1737
+ !isUninterruptedRevalidation &&
1738
+ (!future.v7_partialHydration || !initialHydration)
1739
+ ) {
1740
+ revalidatingFetchers.forEach((rf) => {
1741
+ let fetcher = state.fetchers.get(rf.key);
1742
+ let revalidatingFetcher = getLoadingFetcher(
1743
+ undefined,
1744
+ fetcher ? fetcher.data : undefined
1745
+ );
1746
+ state.fetchers.set(rf.key, revalidatingFetcher);
1747
+ });
1748
+ let actionData = pendingActionData || state.actionData;
1749
+ updateState(
1750
+ {
1751
+ navigation: loadingNavigation,
1752
+ ...(actionData
1753
+ ? Object.keys(actionData).length === 0
1754
+ ? { actionData: null }
1755
+ : { actionData }
1756
+ : {}),
1757
+ ...(revalidatingFetchers.length > 0
1758
+ ? { fetchers: new Map(state.fetchers) }
1759
+ : {}),
1760
+ },
1761
+ {
1762
+ flushSync,
1763
+ }
1764
+ );
1765
+ }
1766
+
1767
+ revalidatingFetchers.forEach((rf) => {
1768
+ if (fetchControllers.has(rf.key)) {
1769
+ abortFetcher(rf.key);
1770
+ }
1771
+ if (rf.controller) {
1772
+ // Fetchers use an independent AbortController so that aborting a fetcher
1773
+ // (via deleteFetcher) does not abort the triggering navigation that
1774
+ // triggered the revalidation
1775
+ fetchControllers.set(rf.key, rf.controller);
1776
+ }
1777
+ });
1778
+
1779
+ // Proxy navigation abort through to revalidation fetchers
1780
+ let abortPendingFetchRevalidations = () =>
1781
+ revalidatingFetchers.forEach((f) => abortFetcher(f.key));
1782
+ if (pendingNavigationController) {
1783
+ pendingNavigationController.signal.addEventListener(
1784
+ "abort",
1785
+ abortPendingFetchRevalidations
1786
+ );
1787
+ }
1788
+
1789
+ let { results, loaderResults, fetcherResults } =
1790
+ await callLoadersAndMaybeResolveData(
1791
+ state.matches,
1792
+ matches,
1793
+ matchesToLoad,
1794
+ revalidatingFetchers,
1795
+ request
1796
+ );
1797
+
1798
+ if (request.signal.aborted) {
1799
+ return { shortCircuited: true };
1800
+ }
1801
+
1802
+ // Clean up _after_ loaders have completed. Don't clean up if we short
1803
+ // circuited because fetchControllers would have been aborted and
1804
+ // reassigned to new controllers for the next navigation
1805
+ if (pendingNavigationController) {
1806
+ pendingNavigationController.signal.removeEventListener(
1807
+ "abort",
1808
+ abortPendingFetchRevalidations
1809
+ );
1810
+ }
1811
+ revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));
1812
+
1813
+ // If any loaders returned a redirect Response, start a new REPLACE navigation
1814
+ let redirect = findRedirect(results);
1815
+ if (redirect) {
1816
+ if (redirect.idx >= matchesToLoad.length) {
1817
+ // If this redirect came from a fetcher make sure we mark it in
1818
+ // fetchRedirectIds so it doesn't get revalidated on the next set of
1819
+ // loader executions
1820
+ let fetcherKey =
1821
+ revalidatingFetchers[redirect.idx - matchesToLoad.length].key;
1822
+ fetchRedirectIds.add(fetcherKey);
1823
+ }
1824
+ await startRedirectNavigation(state, redirect.result, { replace });
1825
+ return { shortCircuited: true };
1826
+ }
1827
+
1828
+ // Process and commit output from loaders
1829
+ let { loaderData, errors } = processLoaderData(
1830
+ state,
1831
+ matches,
1832
+ matchesToLoad,
1833
+ loaderResults,
1834
+ pendingError,
1835
+ revalidatingFetchers,
1836
+ fetcherResults,
1837
+ activeDeferreds
1838
+ );
1839
+
1840
+ // Wire up subscribers to update loaderData as promises settle
1841
+ activeDeferreds.forEach((deferredData, routeId) => {
1842
+ deferredData.subscribe((aborted) => {
1843
+ // Note: No need to updateState here since the TrackedPromise on
1844
+ // loaderData is stable across resolve/reject
1845
+ // Remove this instance if we were aborted or if promises have settled
1846
+ if (aborted || deferredData.done) {
1847
+ activeDeferreds.delete(routeId);
1848
+ }
1849
+ });
1850
+ });
1851
+
1852
+ // During partial hydration, preserve SSR errors for routes that don't re-run
1853
+ if (future.v7_partialHydration && initialHydration && state.errors) {
1854
+ Object.entries(state.errors)
1855
+ .filter(([id]) => !matchesToLoad.some((m) => m.route.id === id))
1856
+ .forEach(([routeId, error]) => {
1857
+ errors = Object.assign(errors || {}, { [routeId]: error });
1858
+ });
1859
+ }
1860
+
1861
+ let updatedFetchers = markFetchRedirectsDone();
1862
+ let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
1863
+ let shouldUpdateFetchers =
1864
+ updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;
1865
+
1866
+ return {
1867
+ loaderData,
1868
+ errors,
1869
+ ...(shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}),
1870
+ };
1871
+ }
1872
+
1873
+ // Trigger a fetcher load/submit for the given fetcher key
1874
+ function fetch(
1875
+ key: string,
1876
+ routeId: string,
1877
+ href: string | null,
1878
+ opts?: RouterFetchOptions
1879
+ ) {
1880
+ if (isServer) {
1881
+ throw new Error(
1882
+ "router.fetch() was called during the server render, but it shouldn't be. " +
1883
+ "You are likely calling a useFetcher() method in the body of your component. " +
1884
+ "Try moving it to a useEffect or a callback."
1885
+ );
1886
+ }
1887
+
1888
+ if (fetchControllers.has(key)) abortFetcher(key);
1889
+ let flushSync = (opts && opts.unstable_flushSync) === true;
1890
+
1891
+ let routesToUse = inFlightDataRoutes || dataRoutes;
1892
+ let normalizedPath = normalizeTo(
1893
+ state.location,
1894
+ state.matches,
1895
+ basename,
1896
+ future.v7_prependBasename,
1897
+ href,
1898
+ future.v7_relativeSplatPath,
1899
+ routeId,
1900
+ opts?.relative
1901
+ );
1902
+ let matches = matchRoutes(routesToUse, normalizedPath, basename);
1903
+
1904
+ if (!matches) {
1905
+ setFetcherError(
1906
+ key,
1907
+ routeId,
1908
+ getInternalRouterError(404, { pathname: normalizedPath }),
1909
+ { flushSync }
1910
+ );
1911
+ return;
1912
+ }
1913
+
1914
+ let { path, submission, error } = normalizeNavigateOptions(
1915
+ future.v7_normalizeFormMethod,
1916
+ true,
1917
+ normalizedPath,
1918
+ opts
1919
+ );
1920
+
1921
+ if (error) {
1922
+ setFetcherError(key, routeId, error, { flushSync });
1923
+ return;
1924
+ }
1925
+
1926
+ let match = getTargetMatch(matches, path);
1927
+
1928
+ pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
1929
+
1930
+ if (submission && isMutationMethod(submission.formMethod)) {
1931
+ handleFetcherAction(
1932
+ key,
1933
+ routeId,
1934
+ path,
1935
+ match,
1936
+ matches,
1937
+ flushSync,
1938
+ submission
1939
+ );
1940
+ return;
1941
+ }
1942
+
1943
+ // Store off the match so we can call it's shouldRevalidate on subsequent
1944
+ // revalidations
1945
+ fetchLoadMatches.set(key, { routeId, path });
1946
+ handleFetcherLoader(
1947
+ key,
1948
+ routeId,
1949
+ path,
1950
+ match,
1951
+ matches,
1952
+ flushSync,
1953
+ submission
1954
+ );
1955
+ }
1956
+
1957
+ // Call the action for the matched fetcher.submit(), and then handle redirects,
1958
+ // errors, and revalidation
1959
+ async function handleFetcherAction(
1960
+ key: string,
1961
+ routeId: string,
1962
+ path: string,
1963
+ match: AgnosticDataRouteMatch,
1964
+ requestMatches: AgnosticDataRouteMatch[],
1965
+ flushSync: boolean,
1966
+ submission: Submission
1967
+ ) {
1968
+ interruptActiveLoads();
1969
+ fetchLoadMatches.delete(key);
1970
+
1971
+ if (!match.route.action && !match.route.lazy) {
1972
+ let error = getInternalRouterError(405, {
1973
+ method: submission.formMethod,
1974
+ pathname: path,
1975
+ routeId: routeId,
1976
+ });
1977
+ setFetcherError(key, routeId, error, { flushSync });
1978
+ return;
1979
+ }
1980
+
1981
+ // Put this fetcher into it's submitting state
1982
+ let existingFetcher = state.fetchers.get(key);
1983
+ updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), {
1984
+ flushSync,
1985
+ });
1986
+
1987
+ // Call the action for the fetcher
1988
+ let abortController = new AbortController();
1989
+ let fetchRequest = createClientSideRequest(
1990
+ init.history,
1991
+ path,
1992
+ abortController.signal,
1993
+ submission
1994
+ );
1995
+ fetchControllers.set(key, abortController);
1996
+
1997
+ let originatingLoadId = incrementingLoadId;
1998
+ let actionResult = await callLoaderOrAction(
1999
+ "action",
2000
+ fetchRequest,
2001
+ match,
2002
+ requestMatches,
2003
+ manifest,
2004
+ mapRouteProperties,
2005
+ basename,
2006
+ future.v7_relativeSplatPath
2007
+ );
2008
+
2009
+ if (fetchRequest.signal.aborted) {
2010
+ // We can delete this so long as we weren't aborted by our own fetcher
2011
+ // re-submit which would have put _new_ controller is in fetchControllers
2012
+ if (fetchControllers.get(key) === abortController) {
2013
+ fetchControllers.delete(key);
2014
+ }
2015
+ return;
2016
+ }
2017
+
2018
+ // When using v7_fetcherPersist, we don't want errors bubbling up to the UI
2019
+ // or redirects processed for unmounted fetchers so we just revert them to
2020
+ // idle
2021
+ if (future.v7_fetcherPersist && deletedFetchers.has(key)) {
2022
+ if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {
2023
+ updateFetcherState(key, getDoneFetcher(undefined));
2024
+ return;
2025
+ }
2026
+ // Let SuccessResult's fall through for revalidation
2027
+ } else {
2028
+ if (isRedirectResult(actionResult)) {
2029
+ fetchControllers.delete(key);
2030
+ if (pendingNavigationLoadId > originatingLoadId) {
2031
+ // A new navigation was kicked off after our action started, so that
2032
+ // should take precedence over this redirect navigation. We already
2033
+ // set isRevalidationRequired so all loaders for the new route should
2034
+ // fire unless opted out via shouldRevalidate
2035
+ updateFetcherState(key, getDoneFetcher(undefined));
2036
+ return;
2037
+ } else {
2038
+ fetchRedirectIds.add(key);
2039
+ updateFetcherState(key, getLoadingFetcher(submission));
2040
+ return startRedirectNavigation(state, actionResult, {
2041
+ fetcherSubmission: submission,
2042
+ });
2043
+ }
2044
+ }
2045
+
2046
+ // Process any non-redirect errors thrown
2047
+ if (isErrorResult(actionResult)) {
2048
+ setFetcherError(key, routeId, actionResult.error);
2049
+ return;
2050
+ }
2051
+ }
2052
+
2053
+ if (isDeferredResult(actionResult)) {
2054
+ throw getInternalRouterError(400, { type: "defer-action" });
2055
+ }
2056
+
2057
+ // Start the data load for current matches, or the next location if we're
2058
+ // in the middle of a navigation
2059
+ let nextLocation = state.navigation.location || state.location;
2060
+ let revalidationRequest = createClientSideRequest(
2061
+ init.history,
2062
+ nextLocation,
2063
+ abortController.signal
2064
+ );
2065
+ let routesToUse = inFlightDataRoutes || dataRoutes;
2066
+ let matches =
2067
+ state.navigation.state !== "idle"
2068
+ ? matchRoutes(routesToUse, state.navigation.location, basename)
2069
+ : state.matches;
2070
+
2071
+ invariant(matches, "Didn't find any matches after fetcher action");
2072
+
2073
+ let loadId = ++incrementingLoadId;
2074
+ fetchReloadIds.set(key, loadId);
2075
+
2076
+ let loadFetcher = getLoadingFetcher(submission, actionResult.data);
2077
+ state.fetchers.set(key, loadFetcher);
2078
+
2079
+ let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(
2080
+ init.history,
2081
+ state,
2082
+ matches,
2083
+ submission,
2084
+ nextLocation,
2085
+ false,
2086
+ isRevalidationRequired,
2087
+ cancelledDeferredRoutes,
2088
+ cancelledFetcherLoads,
2089
+ deletedFetchers,
2090
+ fetchLoadMatches,
2091
+ fetchRedirectIds,
2092
+ routesToUse,
2093
+ basename,
2094
+ { [match.route.id]: actionResult.data },
2095
+ undefined // No need to send through errors since we short circuit above
2096
+ );
2097
+
2098
+ // Put all revalidating fetchers into the loading state, except for the
2099
+ // current fetcher which we want to keep in it's current loading state which
2100
+ // contains it's action submission info + action data
2101
+ revalidatingFetchers
2102
+ .filter((rf) => rf.key !== key)
2103
+ .forEach((rf) => {
2104
+ let staleKey = rf.key;
2105
+ let existingFetcher = state.fetchers.get(staleKey);
2106
+ let revalidatingFetcher = getLoadingFetcher(
2107
+ undefined,
2108
+ existingFetcher ? existingFetcher.data : undefined
2109
+ );
2110
+ state.fetchers.set(staleKey, revalidatingFetcher);
2111
+ if (fetchControllers.has(staleKey)) {
2112
+ abortFetcher(staleKey);
2113
+ }
2114
+ if (rf.controller) {
2115
+ fetchControllers.set(staleKey, rf.controller);
2116
+ }
2117
+ });
2118
+
2119
+ updateState({ fetchers: new Map(state.fetchers) });
2120
+
2121
+ let abortPendingFetchRevalidations = () =>
2122
+ revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));
2123
+
2124
+ abortController.signal.addEventListener(
2125
+ "abort",
2126
+ abortPendingFetchRevalidations
2127
+ );
2128
+
2129
+ let { results, loaderResults, fetcherResults } =
2130
+ await callLoadersAndMaybeResolveData(
2131
+ state.matches,
2132
+ matches,
2133
+ matchesToLoad,
2134
+ revalidatingFetchers,
2135
+ revalidationRequest
2136
+ );
2137
+
2138
+ if (abortController.signal.aborted) {
2139
+ return;
2140
+ }
2141
+
2142
+ abortController.signal.removeEventListener(
2143
+ "abort",
2144
+ abortPendingFetchRevalidations
2145
+ );
2146
+
2147
+ fetchReloadIds.delete(key);
2148
+ fetchControllers.delete(key);
2149
+ revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));
2150
+
2151
+ let redirect = findRedirect(results);
2152
+ if (redirect) {
2153
+ if (redirect.idx >= matchesToLoad.length) {
2154
+ // If this redirect came from a fetcher make sure we mark it in
2155
+ // fetchRedirectIds so it doesn't get revalidated on the next set of
2156
+ // loader executions
2157
+ let fetcherKey =
2158
+ revalidatingFetchers[redirect.idx - matchesToLoad.length].key;
2159
+ fetchRedirectIds.add(fetcherKey);
2160
+ }
2161
+ return startRedirectNavigation(state, redirect.result);
2162
+ }
2163
+
2164
+ // Process and commit output from loaders
2165
+ let { loaderData, errors } = processLoaderData(
2166
+ state,
2167
+ state.matches,
2168
+ matchesToLoad,
2169
+ loaderResults,
2170
+ undefined,
2171
+ revalidatingFetchers,
2172
+ fetcherResults,
2173
+ activeDeferreds
2174
+ );
2175
+
2176
+ // Since we let revalidations complete even if the submitting fetcher was
2177
+ // deleted, only put it back to idle if it hasn't been deleted
2178
+ if (state.fetchers.has(key)) {
2179
+ let doneFetcher = getDoneFetcher(actionResult.data);
2180
+ state.fetchers.set(key, doneFetcher);
2181
+ }
2182
+
2183
+ abortStaleFetchLoads(loadId);
2184
+
2185
+ // If we are currently in a navigation loading state and this fetcher is
2186
+ // more recent than the navigation, we want the newer data so abort the
2187
+ // navigation and complete it with the fetcher data
2188
+ if (
2189
+ state.navigation.state === "loading" &&
2190
+ loadId > pendingNavigationLoadId
2191
+ ) {
2192
+ invariant(pendingAction, "Expected pending action");
2193
+ pendingNavigationController && pendingNavigationController.abort();
2194
+
2195
+ completeNavigation(state.navigation.location, {
2196
+ matches,
2197
+ loaderData,
2198
+ errors,
2199
+ fetchers: new Map(state.fetchers),
2200
+ });
2201
+ } else {
2202
+ // otherwise just update with the fetcher data, preserving any existing
2203
+ // loaderData for loaders that did not need to reload. We have to
2204
+ // manually merge here since we aren't going through completeNavigation
2205
+ updateState({
2206
+ errors,
2207
+ loaderData: mergeLoaderData(
2208
+ state.loaderData,
2209
+ loaderData,
2210
+ matches,
2211
+ errors
2212
+ ),
2213
+ fetchers: new Map(state.fetchers),
2214
+ });
2215
+ isRevalidationRequired = false;
2216
+ }
2217
+ }
2218
+
2219
+ // Call the matched loader for fetcher.load(), handling redirects, errors, etc.
2220
+ async function handleFetcherLoader(
2221
+ key: string,
2222
+ routeId: string,
2223
+ path: string,
2224
+ match: AgnosticDataRouteMatch,
2225
+ matches: AgnosticDataRouteMatch[],
2226
+ flushSync: boolean,
2227
+ submission?: Submission
2228
+ ) {
2229
+ let existingFetcher = state.fetchers.get(key);
2230
+ updateFetcherState(
2231
+ key,
2232
+ getLoadingFetcher(
2233
+ submission,
2234
+ existingFetcher ? existingFetcher.data : undefined
2235
+ ),
2236
+ { flushSync }
2237
+ );
2238
+
2239
+ // Call the loader for this fetcher route match
2240
+ let abortController = new AbortController();
2241
+ let fetchRequest = createClientSideRequest(
2242
+ init.history,
2243
+ path,
2244
+ abortController.signal
2245
+ );
2246
+ fetchControllers.set(key, abortController);
2247
+
2248
+ let originatingLoadId = incrementingLoadId;
2249
+ let result: DataResult = await callLoaderOrAction(
2250
+ "loader",
2251
+ fetchRequest,
2252
+ match,
2253
+ matches,
2254
+ manifest,
2255
+ mapRouteProperties,
2256
+ basename,
2257
+ future.v7_relativeSplatPath
2258
+ );
2259
+
2260
+ // Deferred isn't supported for fetcher loads, await everything and treat it
2261
+ // as a normal load. resolveDeferredData will return undefined if this
2262
+ // fetcher gets aborted, so we just leave result untouched and short circuit
2263
+ // below if that happens
2264
+ if (isDeferredResult(result)) {
2265
+ result =
2266
+ (await resolveDeferredData(result, fetchRequest.signal, true)) ||
2267
+ result;
2268
+ }
2269
+
2270
+ // We can delete this so long as we weren't aborted by our our own fetcher
2271
+ // re-load which would have put _new_ controller is in fetchControllers
2272
+ if (fetchControllers.get(key) === abortController) {
2273
+ fetchControllers.delete(key);
2274
+ }
2275
+
2276
+ if (fetchRequest.signal.aborted) {
2277
+ return;
2278
+ }
2279
+
2280
+ // We don't want errors bubbling up or redirects followed for unmounted
2281
+ // fetchers, so short circuit here if it was removed from the UI
2282
+ if (deletedFetchers.has(key)) {
2283
+ updateFetcherState(key, getDoneFetcher(undefined));
2284
+ return;
2285
+ }
2286
+
2287
+ // If the loader threw a redirect Response, start a new REPLACE navigation
2288
+ if (isRedirectResult(result)) {
2289
+ if (pendingNavigationLoadId > originatingLoadId) {
2290
+ // A new navigation was kicked off after our loader started, so that
2291
+ // should take precedence over this redirect navigation
2292
+ updateFetcherState(key, getDoneFetcher(undefined));
2293
+ return;
2294
+ } else {
2295
+ fetchRedirectIds.add(key);
2296
+ await startRedirectNavigation(state, result);
2297
+ return;
2298
+ }
2299
+ }
2300
+
2301
+ // Process any non-redirect errors thrown
2302
+ if (isErrorResult(result)) {
2303
+ setFetcherError(key, routeId, result.error);
2304
+ return;
2305
+ }
2306
+
2307
+ invariant(!isDeferredResult(result), "Unhandled fetcher deferred data");
2308
+
2309
+ // Put the fetcher back into an idle state
2310
+ updateFetcherState(key, getDoneFetcher(result.data));
2311
+ }
2312
+
2313
+ /**
2314
+ * Utility function to handle redirects returned from an action or loader.
2315
+ * Normally, a redirect "replaces" the navigation that triggered it. So, for
2316
+ * example:
2317
+ *
2318
+ * - user is on /a
2319
+ * - user clicks a link to /b
2320
+ * - loader for /b redirects to /c
2321
+ *
2322
+ * In a non-JS app the browser would track the in-flight navigation to /b and
2323
+ * then replace it with /c when it encountered the redirect response. In
2324
+ * the end it would only ever update the URL bar with /c.
2325
+ *
2326
+ * In client-side routing using pushState/replaceState, we aim to emulate
2327
+ * this behavior and we also do not update history until the end of the
2328
+ * navigation (including processed redirects). This means that we never
2329
+ * actually touch history until we've processed redirects, so we just use
2330
+ * the history action from the original navigation (PUSH or REPLACE).
2331
+ */
2332
+ async function startRedirectNavigation(
2333
+ state: RouterState,
2334
+ redirect: RedirectResult,
2335
+ {
2336
+ submission,
2337
+ fetcherSubmission,
2338
+ replace,
2339
+ }: {
2340
+ submission?: Submission;
2341
+ fetcherSubmission?: Submission;
2342
+ replace?: boolean;
2343
+ } = {}
2344
+ ) {
2345
+ if (redirect.revalidate) {
2346
+ isRevalidationRequired = true;
2347
+ }
2348
+
2349
+ let redirectLocation = createLocation(state.location, redirect.location, {
2350
+ _isRedirect: true,
2351
+ });
2352
+ invariant(
2353
+ redirectLocation,
2354
+ "Expected a location on the redirect navigation"
2355
+ );
2356
+
2357
+ if (isBrowser) {
2358
+ let isDocumentReload = false;
2359
+
2360
+ if (redirect.reloadDocument) {
2361
+ // Hard reload if the response contained X-Remix-Reload-Document
2362
+ isDocumentReload = true;
2363
+ } else if (ABSOLUTE_URL_REGEX.test(redirect.location)) {
2364
+ const url = init.history.createURL(redirect.location);
2365
+ isDocumentReload =
2366
+ // Hard reload if it's an absolute URL to a new origin
2367
+ url.origin !== routerWindow.location.origin ||
2368
+ // Hard reload if it's an absolute URL that does not match our basename
2369
+ stripBasename(url.pathname, basename) == null;
2370
+ }
2371
+
2372
+ if (isDocumentReload) {
2373
+ if (replace) {
2374
+ routerWindow.location.replace(redirect.location);
2375
+ } else {
2376
+ routerWindow.location.assign(redirect.location);
2377
+ }
2378
+ return;
2379
+ }
2380
+ }
2381
+
2382
+ // There's no need to abort on redirects, since we don't detect the
2383
+ // redirect until the action/loaders have settled
2384
+ pendingNavigationController = null;
2385
+
2386
+ let redirectHistoryAction =
2387
+ replace === true ? HistoryAction.Replace : HistoryAction.Push;
2388
+
2389
+ // Use the incoming submission if provided, fallback on the active one in
2390
+ // state.navigation
2391
+ let { formMethod, formAction, formEncType } = state.navigation;
2392
+ if (
2393
+ !submission &&
2394
+ !fetcherSubmission &&
2395
+ formMethod &&
2396
+ formAction &&
2397
+ formEncType
2398
+ ) {
2399
+ submission = getSubmissionFromNavigation(state.navigation);
2400
+ }
2401
+
2402
+ // If this was a 307/308 submission we want to preserve the HTTP method and
2403
+ // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the
2404
+ // redirected location
2405
+ let activeSubmission = submission || fetcherSubmission;
2406
+ if (
2407
+ redirectPreserveMethodStatusCodes.has(redirect.status) &&
2408
+ activeSubmission &&
2409
+ isMutationMethod(activeSubmission.formMethod)
2410
+ ) {
2411
+ await startNavigation(redirectHistoryAction, redirectLocation, {
2412
+ submission: {
2413
+ ...activeSubmission,
2414
+ formAction: redirect.location,
2415
+ },
2416
+ // Preserve this flag across redirects
2417
+ preventScrollReset: pendingPreventScrollReset,
2418
+ });
2419
+ } else {
2420
+ // If we have a navigation submission, we will preserve it through the
2421
+ // redirect navigation
2422
+ let overrideNavigation = getLoadingNavigation(
2423
+ redirectLocation,
2424
+ submission
2425
+ );
2426
+ await startNavigation(redirectHistoryAction, redirectLocation, {
2427
+ overrideNavigation,
2428
+ // Send fetcher submissions through for shouldRevalidate
2429
+ fetcherSubmission,
2430
+ // Preserve this flag across redirects
2431
+ preventScrollReset: pendingPreventScrollReset,
2432
+ });
2433
+ }
2434
+ }
2435
+
2436
+ async function callLoadersAndMaybeResolveData(
2437
+ currentMatches: AgnosticDataRouteMatch[],
2438
+ matches: AgnosticDataRouteMatch[],
2439
+ matchesToLoad: AgnosticDataRouteMatch[],
2440
+ fetchersToLoad: RevalidatingFetcher[],
2441
+ request: Request
2442
+ ) {
2443
+ // Call all navigation loaders and revalidating fetcher loaders in parallel,
2444
+ // then slice off the results into separate arrays so we can handle them
2445
+ // accordingly
2446
+ let results = await Promise.all([
2447
+ ...matchesToLoad.map((match) =>
2448
+ callLoaderOrAction(
2449
+ "loader",
2450
+ request,
2451
+ match,
2452
+ matches,
2453
+ manifest,
2454
+ mapRouteProperties,
2455
+ basename,
2456
+ future.v7_relativeSplatPath
2457
+ )
2458
+ ),
2459
+ ...fetchersToLoad.map((f) => {
2460
+ if (f.matches && f.match && f.controller) {
2461
+ return callLoaderOrAction(
2462
+ "loader",
2463
+ createClientSideRequest(init.history, f.path, f.controller.signal),
2464
+ f.match,
2465
+ f.matches,
2466
+ manifest,
2467
+ mapRouteProperties,
2468
+ basename,
2469
+ future.v7_relativeSplatPath
2470
+ );
2471
+ } else {
2472
+ let error: ErrorResult = {
2473
+ type: ResultType.error,
2474
+ error: getInternalRouterError(404, { pathname: f.path }),
2475
+ };
2476
+ return error;
2477
+ }
2478
+ }),
2479
+ ]);
2480
+ let loaderResults = results.slice(0, matchesToLoad.length);
2481
+ let fetcherResults = results.slice(matchesToLoad.length);
2482
+
2483
+ await Promise.all([
2484
+ resolveDeferredResults(
2485
+ currentMatches,
2486
+ matchesToLoad,
2487
+ loaderResults,
2488
+ loaderResults.map(() => request.signal),
2489
+ false,
2490
+ state.loaderData
2491
+ ),
2492
+ resolveDeferredResults(
2493
+ currentMatches,
2494
+ fetchersToLoad.map((f) => f.match),
2495
+ fetcherResults,
2496
+ fetchersToLoad.map((f) => (f.controller ? f.controller.signal : null)),
2497
+ true
2498
+ ),
2499
+ ]);
2500
+
2501
+ return { results, loaderResults, fetcherResults };
2502
+ }
2503
+
2504
+ function interruptActiveLoads() {
2505
+ // Every interruption triggers a revalidation
2506
+ isRevalidationRequired = true;
2507
+
2508
+ // Cancel pending route-level deferreds and mark cancelled routes for
2509
+ // revalidation
2510
+ cancelledDeferredRoutes.push(...cancelActiveDeferreds());
2511
+
2512
+ // Abort in-flight fetcher loads
2513
+ fetchLoadMatches.forEach((_, key) => {
2514
+ if (fetchControllers.has(key)) {
2515
+ cancelledFetcherLoads.push(key);
2516
+ abortFetcher(key);
2517
+ }
2518
+ });
2519
+ }
2520
+
2521
+ function updateFetcherState(
2522
+ key: string,
2523
+ fetcher: Fetcher,
2524
+ opts: { flushSync?: boolean } = {}
2525
+ ) {
2526
+ state.fetchers.set(key, fetcher);
2527
+ updateState(
2528
+ { fetchers: new Map(state.fetchers) },
2529
+ { flushSync: (opts && opts.flushSync) === true }
2530
+ );
2531
+ }
2532
+
2533
+ function setFetcherError(
2534
+ key: string,
2535
+ routeId: string,
2536
+ error: any,
2537
+ opts: { flushSync?: boolean } = {}
2538
+ ) {
2539
+ let boundaryMatch = findNearestBoundary(state.matches, routeId);
2540
+ deleteFetcher(key);
2541
+ updateState(
2542
+ {
2543
+ errors: {
2544
+ [boundaryMatch.route.id]: error,
2545
+ },
2546
+ fetchers: new Map(state.fetchers),
2547
+ },
2548
+ { flushSync: (opts && opts.flushSync) === true }
2549
+ );
2550
+ }
2551
+
2552
+ function getFetcher<TData = any>(key: string): Fetcher<TData> {
2553
+ if (future.v7_fetcherPersist) {
2554
+ activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);
2555
+ // If this fetcher was previously marked for deletion, unmark it since we
2556
+ // have a new instance
2557
+ if (deletedFetchers.has(key)) {
2558
+ deletedFetchers.delete(key);
2559
+ }
2560
+ }
2561
+ return state.fetchers.get(key) || IDLE_FETCHER;
2562
+ }
2563
+
2564
+ function deleteFetcher(key: string): void {
2565
+ let fetcher = state.fetchers.get(key);
2566
+ // Don't abort the controller if this is a deletion of a fetcher.submit()
2567
+ // in it's loading phase since - we don't want to abort the corresponding
2568
+ // revalidation and want them to complete and land
2569
+ if (
2570
+ fetchControllers.has(key) &&
2571
+ !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))
2572
+ ) {
2573
+ abortFetcher(key);
2574
+ }
2575
+ fetchLoadMatches.delete(key);
2576
+ fetchReloadIds.delete(key);
2577
+ fetchRedirectIds.delete(key);
2578
+ deletedFetchers.delete(key);
2579
+ state.fetchers.delete(key);
2580
+ }
2581
+
2582
+ function deleteFetcherAndUpdateState(key: string): void {
2583
+ if (future.v7_fetcherPersist) {
2584
+ let count = (activeFetchers.get(key) || 0) - 1;
2585
+ if (count <= 0) {
2586
+ activeFetchers.delete(key);
2587
+ deletedFetchers.add(key);
2588
+ } else {
2589
+ activeFetchers.set(key, count);
2590
+ }
2591
+ } else {
2592
+ deleteFetcher(key);
2593
+ }
2594
+ updateState({ fetchers: new Map(state.fetchers) });
2595
+ }
2596
+
2597
+ function abortFetcher(key: string) {
2598
+ let controller = fetchControllers.get(key);
2599
+ invariant(controller, `Expected fetch controller: ${key}`);
2600
+ controller.abort();
2601
+ fetchControllers.delete(key);
2602
+ }
2603
+
2604
+ function markFetchersDone(keys: string[]) {
2605
+ for (let key of keys) {
2606
+ let fetcher = getFetcher(key);
2607
+ let doneFetcher = getDoneFetcher(fetcher.data);
2608
+ state.fetchers.set(key, doneFetcher);
2609
+ }
2610
+ }
2611
+
2612
+ function markFetchRedirectsDone(): boolean {
2613
+ let doneKeys = [];
2614
+ let updatedFetchers = false;
2615
+ for (let key of fetchRedirectIds) {
2616
+ let fetcher = state.fetchers.get(key);
2617
+ invariant(fetcher, `Expected fetcher: ${key}`);
2618
+ if (fetcher.state === "loading") {
2619
+ fetchRedirectIds.delete(key);
2620
+ doneKeys.push(key);
2621
+ updatedFetchers = true;
2622
+ }
2623
+ }
2624
+ markFetchersDone(doneKeys);
2625
+ return updatedFetchers;
2626
+ }
2627
+
2628
+ function abortStaleFetchLoads(landedId: number): boolean {
2629
+ let yeetedKeys = [];
2630
+ for (let [key, id] of fetchReloadIds) {
2631
+ if (id < landedId) {
2632
+ let fetcher = state.fetchers.get(key);
2633
+ invariant(fetcher, `Expected fetcher: ${key}`);
2634
+ if (fetcher.state === "loading") {
2635
+ abortFetcher(key);
2636
+ fetchReloadIds.delete(key);
2637
+ yeetedKeys.push(key);
2638
+ }
2639
+ }
2640
+ }
2641
+ markFetchersDone(yeetedKeys);
2642
+ return yeetedKeys.length > 0;
2643
+ }
2644
+
2645
+ function getBlocker(key: string, fn: BlockerFunction) {
2646
+ let blocker: Blocker = state.blockers.get(key) || IDLE_BLOCKER;
2647
+
2648
+ if (blockerFunctions.get(key) !== fn) {
2649
+ blockerFunctions.set(key, fn);
2650
+ }
2651
+
2652
+ return blocker;
2653
+ }
2654
+
2655
+ function deleteBlocker(key: string) {
2656
+ state.blockers.delete(key);
2657
+ blockerFunctions.delete(key);
2658
+ }
2659
+
2660
+ // Utility function to update blockers, ensuring valid state transitions
2661
+ function updateBlocker(key: string, newBlocker: Blocker) {
2662
+ let blocker = state.blockers.get(key) || IDLE_BLOCKER;
2663
+
2664
+ // Poor mans state machine :)
2665
+ // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM
2666
+ invariant(
2667
+ (blocker.state === "unblocked" && newBlocker.state === "blocked") ||
2668
+ (blocker.state === "blocked" && newBlocker.state === "blocked") ||
2669
+ (blocker.state === "blocked" && newBlocker.state === "proceeding") ||
2670
+ (blocker.state === "blocked" && newBlocker.state === "unblocked") ||
2671
+ (blocker.state === "proceeding" && newBlocker.state === "unblocked"),
2672
+ `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`
2673
+ );
2674
+
2675
+ let blockers = new Map(state.blockers);
2676
+ blockers.set(key, newBlocker);
2677
+ updateState({ blockers });
2678
+ }
2679
+
2680
+ function shouldBlockNavigation({
2681
+ currentLocation,
2682
+ nextLocation,
2683
+ historyAction,
2684
+ }: {
2685
+ currentLocation: Location;
2686
+ nextLocation: Location;
2687
+ historyAction: HistoryAction;
2688
+ }): string | undefined {
2689
+ if (blockerFunctions.size === 0) {
2690
+ return;
2691
+ }
2692
+
2693
+ // We ony support a single active blocker at the moment since we don't have
2694
+ // any compelling use cases for multi-blocker yet
2695
+ if (blockerFunctions.size > 1) {
2696
+ warning(false, "A router only supports one blocker at a time");
2697
+ }
2698
+
2699
+ let entries = Array.from(blockerFunctions.entries());
2700
+ let [blockerKey, blockerFunction] = entries[entries.length - 1];
2701
+ let blocker = state.blockers.get(blockerKey);
2702
+
2703
+ if (blocker && blocker.state === "proceeding") {
2704
+ // If the blocker is currently proceeding, we don't need to re-check
2705
+ // it and can let this navigation continue
2706
+ return;
2707
+ }
2708
+
2709
+ // At this point, we know we're unblocked/blocked so we need to check the
2710
+ // user-provided blocker function
2711
+ if (blockerFunction({ currentLocation, nextLocation, historyAction })) {
2712
+ return blockerKey;
2713
+ }
2714
+ }
2715
+
2716
+ function cancelActiveDeferreds(
2717
+ predicate?: (routeId: string) => boolean
2718
+ ): string[] {
2719
+ let cancelledRouteIds: string[] = [];
2720
+ activeDeferreds.forEach((dfd, routeId) => {
2721
+ if (!predicate || predicate(routeId)) {
2722
+ // Cancel the deferred - but do not remove from activeDeferreds here -
2723
+ // we rely on the subscribers to do that so our tests can assert proper
2724
+ // cleanup via _internalActiveDeferreds
2725
+ dfd.cancel();
2726
+ cancelledRouteIds.push(routeId);
2727
+ activeDeferreds.delete(routeId);
2728
+ }
2729
+ });
2730
+ return cancelledRouteIds;
2731
+ }
2732
+
2733
+ // Opt in to capturing and reporting scroll positions during navigations,
2734
+ // used by the <ScrollRestoration> component
2735
+ function enableScrollRestoration(
2736
+ positions: Record<string, number>,
2737
+ getPosition: GetScrollPositionFunction,
2738
+ getKey?: GetScrollRestorationKeyFunction
2739
+ ) {
2740
+ savedScrollPositions = positions;
2741
+ getScrollPosition = getPosition;
2742
+ getScrollRestorationKey = getKey || null;
2743
+
2744
+ // Perform initial hydration scroll restoration, since we miss the boat on
2745
+ // the initial updateState() because we've not yet rendered <ScrollRestoration/>
2746
+ // and therefore have no savedScrollPositions available
2747
+ if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {
2748
+ initialScrollRestored = true;
2749
+ let y = getSavedScrollPosition(state.location, state.matches);
2750
+ if (y != null) {
2751
+ updateState({ restoreScrollPosition: y });
2752
+ }
2753
+ }
2754
+
2755
+ return () => {
2756
+ savedScrollPositions = null;
2757
+ getScrollPosition = null;
2758
+ getScrollRestorationKey = null;
2759
+ };
2760
+ }
2761
+
2762
+ function getScrollKey(location: Location, matches: AgnosticDataRouteMatch[]) {
2763
+ if (getScrollRestorationKey) {
2764
+ let key = getScrollRestorationKey(
2765
+ location,
2766
+ matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData))
2767
+ );
2768
+ return key || location.key;
2769
+ }
2770
+ return location.key;
2771
+ }
2772
+
2773
+ function saveScrollPosition(
2774
+ location: Location,
2775
+ matches: AgnosticDataRouteMatch[]
2776
+ ): void {
2777
+ if (savedScrollPositions && getScrollPosition) {
2778
+ let key = getScrollKey(location, matches);
2779
+ savedScrollPositions[key] = getScrollPosition();
2780
+ }
2781
+ }
2782
+
2783
+ function getSavedScrollPosition(
2784
+ location: Location,
2785
+ matches: AgnosticDataRouteMatch[]
2786
+ ): number | null {
2787
+ if (savedScrollPositions) {
2788
+ let key = getScrollKey(location, matches);
2789
+ let y = savedScrollPositions[key];
2790
+ if (typeof y === "number") {
2791
+ return y;
2792
+ }
2793
+ }
2794
+ return null;
2795
+ }
2796
+
2797
+ function _internalSetRoutes(newRoutes: AgnosticDataRouteObject[]) {
2798
+ manifest = {};
2799
+ inFlightDataRoutes = convertRoutesToDataRoutes(
2800
+ newRoutes,
2801
+ mapRouteProperties,
2802
+ undefined,
2803
+ manifest
2804
+ );
2805
+ }
2806
+
2807
+ router = {
2808
+ get basename() {
2809
+ return basename;
2810
+ },
2811
+ get future() {
2812
+ return future;
2813
+ },
2814
+ get state() {
2815
+ return state;
2816
+ },
2817
+ get routes() {
2818
+ return dataRoutes;
2819
+ },
2820
+ get window() {
2821
+ return routerWindow;
2822
+ },
2823
+ initialize,
2824
+ subscribe,
2825
+ enableScrollRestoration,
2826
+ navigate,
2827
+ fetch,
2828
+ revalidate,
2829
+ // Passthrough to history-aware createHref used by useHref so we get proper
2830
+ // hash-aware URLs in DOM paths
2831
+ createHref: (to: To) => init.history.createHref(to),
2832
+ encodeLocation: (to: To) => init.history.encodeLocation(to),
2833
+ getFetcher,
2834
+ deleteFetcher: deleteFetcherAndUpdateState,
2835
+ dispose,
2836
+ getBlocker,
2837
+ deleteBlocker,
2838
+ _internalFetchControllers: fetchControllers,
2839
+ _internalActiveDeferreds: activeDeferreds,
2840
+ // TODO: Remove setRoutes, it's temporary to avoid dealing with
2841
+ // updating the tree while validating the update algorithm.
2842
+ _internalSetRoutes,
2843
+ };
2844
+
2845
+ return router;
2846
+ }
2847
+ //#endregion
2848
+
2849
+ ////////////////////////////////////////////////////////////////////////////////
2850
+ //#region createStaticHandler
2851
+ ////////////////////////////////////////////////////////////////////////////////
2852
+
2853
+ export const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
2854
+
2855
+ /**
2856
+ * Future flags to toggle new feature behavior
2857
+ */
2858
+ export interface StaticHandlerFutureConfig {
2859
+ v7_relativeSplatPath: boolean;
2860
+ v7_throwAbortReason: boolean;
2861
+ }
2862
+
2863
+ export interface CreateStaticHandlerOptions {
2864
+ basename?: string;
2865
+ /**
2866
+ * @deprecated Use `mapRouteProperties` instead
2867
+ */
2868
+ detectErrorBoundary?: DetectErrorBoundaryFunction;
2869
+ mapRouteProperties?: MapRoutePropertiesFunction;
2870
+ future?: Partial<StaticHandlerFutureConfig>;
2871
+ }
2872
+
2873
+ export function createStaticHandler(
2874
+ routes: AgnosticRouteObject[],
2875
+ opts?: CreateStaticHandlerOptions
2876
+ ): StaticHandler {
2877
+ invariant(
2878
+ routes.length > 0,
2879
+ "You must provide a non-empty routes array to createStaticHandler"
2880
+ );
2881
+
2882
+ let manifest: RouteManifest = {};
2883
+ let basename = (opts ? opts.basename : null) || "/";
2884
+ let mapRouteProperties: MapRoutePropertiesFunction;
2885
+ if (opts?.mapRouteProperties) {
2886
+ mapRouteProperties = opts.mapRouteProperties;
2887
+ } else if (opts?.detectErrorBoundary) {
2888
+ // If they are still using the deprecated version, wrap it with the new API
2889
+ let detectErrorBoundary = opts.detectErrorBoundary;
2890
+ mapRouteProperties = (route) => ({
2891
+ hasErrorBoundary: detectErrorBoundary(route),
2892
+ });
2893
+ } else {
2894
+ mapRouteProperties = defaultMapRouteProperties;
2895
+ }
2896
+ // Config driven behavior flags
2897
+ let future: StaticHandlerFutureConfig = {
2898
+ v7_relativeSplatPath: false,
2899
+ v7_throwAbortReason: false,
2900
+ ...(opts ? opts.future : null),
2901
+ };
2902
+
2903
+ let dataRoutes = convertRoutesToDataRoutes(
2904
+ routes,
2905
+ mapRouteProperties,
2906
+ undefined,
2907
+ manifest
2908
+ );
2909
+
2910
+ /**
2911
+ * The query() method is intended for document requests, in which we want to
2912
+ * call an optional action and potentially multiple loaders for all nested
2913
+ * routes. It returns a StaticHandlerContext object, which is very similar
2914
+ * to the router state (location, loaderData, actionData, errors, etc.) and
2915
+ * also adds SSR-specific information such as the statusCode and headers
2916
+ * from action/loaders Responses.
2917
+ *
2918
+ * It _should_ never throw and should report all errors through the
2919
+ * returned context.errors object, properly associating errors to their error
2920
+ * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be
2921
+ * used to emulate React error boundaries during SSr by performing a second
2922
+ * pass only down to the boundaryId.
2923
+ *
2924
+ * The one exception where we do not return a StaticHandlerContext is when a
2925
+ * redirect response is returned or thrown from any action/loader. We
2926
+ * propagate that out and return the raw Response so the HTTP server can
2927
+ * return it directly.
2928
+ */
2929
+ async function query(
2930
+ request: Request,
2931
+ { requestContext }: { requestContext?: unknown } = {}
2932
+ ): Promise<StaticHandlerContext | Response> {
2933
+ let url = new URL(request.url);
2934
+ let method = request.method;
2935
+ let location = createLocation("", createPath(url), null, "default");
2936
+ let matches = matchRoutes(dataRoutes, location, basename);
2937
+
2938
+ // SSR supports HEAD requests while SPA doesn't
2939
+ if (!isValidMethod(method) && method !== "HEAD") {
2940
+ let error = getInternalRouterError(405, { method });
2941
+ let { matches: methodNotAllowedMatches, route } =
2942
+ getShortCircuitMatches(dataRoutes);
2943
+ return {
2944
+ basename,
2945
+ location,
2946
+ matches: methodNotAllowedMatches,
2947
+ loaderData: {},
2948
+ actionData: null,
2949
+ errors: {
2950
+ [route.id]: error,
2951
+ },
2952
+ statusCode: error.status,
2953
+ loaderHeaders: {},
2954
+ actionHeaders: {},
2955
+ activeDeferreds: null,
2956
+ };
2957
+ } else if (!matches) {
2958
+ let error = getInternalRouterError(404, { pathname: location.pathname });
2959
+ let { matches: notFoundMatches, route } =
2960
+ getShortCircuitMatches(dataRoutes);
2961
+ return {
2962
+ basename,
2963
+ location,
2964
+ matches: notFoundMatches,
2965
+ loaderData: {},
2966
+ actionData: null,
2967
+ errors: {
2968
+ [route.id]: error,
2969
+ },
2970
+ statusCode: error.status,
2971
+ loaderHeaders: {},
2972
+ actionHeaders: {},
2973
+ activeDeferreds: null,
2974
+ };
2975
+ }
2976
+
2977
+ let result = await queryImpl(request, location, matches, requestContext);
2978
+ if (isResponse(result)) {
2979
+ return result;
2980
+ }
2981
+
2982
+ // When returning StaticHandlerContext, we patch back in the location here
2983
+ // since we need it for React Context. But this helps keep our submit and
2984
+ // loadRouteData operating on a Request instead of a Location
2985
+ return { location, basename, ...result };
2986
+ }
2987
+
2988
+ /**
2989
+ * The queryRoute() method is intended for targeted route requests, either
2990
+ * for fetch ?_data requests or resource route requests. In this case, we
2991
+ * are only ever calling a single action or loader, and we are returning the
2992
+ * returned value directly. In most cases, this will be a Response returned
2993
+ * from the action/loader, but it may be a primitive or other value as well -
2994
+ * and in such cases the calling context should handle that accordingly.
2995
+ *
2996
+ * We do respect the throw/return differentiation, so if an action/loader
2997
+ * throws, then this method will throw the value. This is important so we
2998
+ * can do proper boundary identification in Remix where a thrown Response
2999
+ * must go to the Catch Boundary but a returned Response is happy-path.
3000
+ *
3001
+ * One thing to note is that any Router-initiated Errors that make sense
3002
+ * to associate with a status code will be thrown as an ErrorResponse
3003
+ * instance which include the raw Error, such that the calling context can
3004
+ * serialize the error as they see fit while including the proper response
3005
+ * code. Examples here are 404 and 405 errors that occur prior to reaching
3006
+ * any user-defined loaders.
3007
+ */
3008
+ async function queryRoute(
3009
+ request: Request,
3010
+ {
3011
+ routeId,
3012
+ requestContext,
3013
+ }: { requestContext?: unknown; routeId?: string } = {}
3014
+ ): Promise<any> {
3015
+ let url = new URL(request.url);
3016
+ let method = request.method;
3017
+ let location = createLocation("", createPath(url), null, "default");
3018
+ let matches = matchRoutes(dataRoutes, location, basename);
3019
+
3020
+ // SSR supports HEAD requests while SPA doesn't
3021
+ if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") {
3022
+ throw getInternalRouterError(405, { method });
3023
+ } else if (!matches) {
3024
+ throw getInternalRouterError(404, { pathname: location.pathname });
3025
+ }
3026
+
3027
+ let match = routeId
3028
+ ? matches.find((m) => m.route.id === routeId)
3029
+ : getTargetMatch(matches, location);
3030
+
3031
+ if (routeId && !match) {
3032
+ throw getInternalRouterError(403, {
3033
+ pathname: location.pathname,
3034
+ routeId,
3035
+ });
3036
+ } else if (!match) {
3037
+ // This should never hit I don't think?
3038
+ throw getInternalRouterError(404, { pathname: location.pathname });
3039
+ }
3040
+
3041
+ let result = await queryImpl(
3042
+ request,
3043
+ location,
3044
+ matches,
3045
+ requestContext,
3046
+ match
3047
+ );
3048
+ if (isResponse(result)) {
3049
+ return result;
3050
+ }
3051
+
3052
+ let error = result.errors ? Object.values(result.errors)[0] : undefined;
3053
+ if (error !== undefined) {
3054
+ // If we got back result.errors, that means the loader/action threw
3055
+ // _something_ that wasn't a Response, but it's not guaranteed/required
3056
+ // to be an `instanceof Error` either, so we have to use throw here to
3057
+ // preserve the "error" state outside of queryImpl.
3058
+ throw error;
3059
+ }
3060
+
3061
+ // Pick off the right state value to return
3062
+ if (result.actionData) {
3063
+ return Object.values(result.actionData)[0];
3064
+ }
3065
+
3066
+ if (result.loaderData) {
3067
+ let data = Object.values(result.loaderData)[0];
3068
+ if (result.activeDeferreds?.[match.route.id]) {
3069
+ data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];
3070
+ }
3071
+ return data;
3072
+ }
3073
+
3074
+ return undefined;
3075
+ }
3076
+
3077
+ async function queryImpl(
3078
+ request: Request,
3079
+ location: Location,
3080
+ matches: AgnosticDataRouteMatch[],
3081
+ requestContext: unknown,
3082
+ routeMatch?: AgnosticDataRouteMatch
3083
+ ): Promise<Omit<StaticHandlerContext, "location" | "basename"> | Response> {
3084
+ invariant(
3085
+ request.signal,
3086
+ "query()/queryRoute() requests must contain an AbortController signal"
3087
+ );
3088
+
3089
+ try {
3090
+ if (isMutationMethod(request.method.toLowerCase())) {
3091
+ let result = await submit(
3092
+ request,
3093
+ matches,
3094
+ routeMatch || getTargetMatch(matches, location),
3095
+ requestContext,
3096
+ routeMatch != null
3097
+ );
3098
+ return result;
3099
+ }
3100
+
3101
+ let result = await loadRouteData(
3102
+ request,
3103
+ matches,
3104
+ requestContext,
3105
+ routeMatch
3106
+ );
3107
+ return isResponse(result)
3108
+ ? result
3109
+ : {
3110
+ ...result,
3111
+ actionData: null,
3112
+ actionHeaders: {},
3113
+ };
3114
+ } catch (e) {
3115
+ // If the user threw/returned a Response in callLoaderOrAction, we throw
3116
+ // it to bail out and then return or throw here based on whether the user
3117
+ // returned or threw
3118
+ if (isQueryRouteResponse(e)) {
3119
+ if (e.type === ResultType.error) {
3120
+ throw e.response;
3121
+ }
3122
+ return e.response;
3123
+ }
3124
+ // Redirects are always returned since they don't propagate to catch
3125
+ // boundaries
3126
+ if (isRedirectResponse(e)) {
3127
+ return e;
3128
+ }
3129
+ throw e;
3130
+ }
3131
+ }
3132
+
3133
+ async function submit(
3134
+ request: Request,
3135
+ matches: AgnosticDataRouteMatch[],
3136
+ actionMatch: AgnosticDataRouteMatch,
3137
+ requestContext: unknown,
3138
+ isRouteRequest: boolean
3139
+ ): Promise<Omit<StaticHandlerContext, "location" | "basename"> | Response> {
3140
+ let result: DataResult;
3141
+
3142
+ if (!actionMatch.route.action && !actionMatch.route.lazy) {
3143
+ let error = getInternalRouterError(405, {
3144
+ method: request.method,
3145
+ pathname: new URL(request.url).pathname,
3146
+ routeId: actionMatch.route.id,
3147
+ });
3148
+ if (isRouteRequest) {
3149
+ throw error;
3150
+ }
3151
+ result = {
3152
+ type: ResultType.error,
3153
+ error,
3154
+ };
3155
+ } else {
3156
+ result = await callLoaderOrAction(
3157
+ "action",
3158
+ request,
3159
+ actionMatch,
3160
+ matches,
3161
+ manifest,
3162
+ mapRouteProperties,
3163
+ basename,
3164
+ future.v7_relativeSplatPath,
3165
+ { isStaticRequest: true, isRouteRequest, requestContext }
3166
+ );
3167
+
3168
+ if (request.signal.aborted) {
3169
+ throwStaticHandlerAbortedError(request, isRouteRequest, future);
3170
+ }
3171
+ }
3172
+
3173
+ if (isRedirectResult(result)) {
3174
+ // Uhhhh - this should never happen, we should always throw these from
3175
+ // callLoaderOrAction, but the type narrowing here keeps TS happy and we
3176
+ // can get back on the "throw all redirect responses" train here should
3177
+ // this ever happen :/
3178
+ throw new Response(null, {
3179
+ status: result.status,
3180
+ headers: {
3181
+ Location: result.location,
3182
+ },
3183
+ });
3184
+ }
3185
+
3186
+ if (isDeferredResult(result)) {
3187
+ let error = getInternalRouterError(400, { type: "defer-action" });
3188
+ if (isRouteRequest) {
3189
+ throw error;
3190
+ }
3191
+ result = {
3192
+ type: ResultType.error,
3193
+ error,
3194
+ };
3195
+ }
3196
+
3197
+ if (isRouteRequest) {
3198
+ // Note: This should only be non-Response values if we get here, since
3199
+ // isRouteRequest should throw any Response received in callLoaderOrAction
3200
+ if (isErrorResult(result)) {
3201
+ throw result.error;
3202
+ }
3203
+
3204
+ return {
3205
+ matches: [actionMatch],
3206
+ loaderData: {},
3207
+ actionData: { [actionMatch.route.id]: result.data },
3208
+ errors: null,
3209
+ // Note: statusCode + headers are unused here since queryRoute will
3210
+ // return the raw Response or value
3211
+ statusCode: 200,
3212
+ loaderHeaders: {},
3213
+ actionHeaders: {},
3214
+ activeDeferreds: null,
3215
+ };
3216
+ }
3217
+
3218
+ if (isErrorResult(result)) {
3219
+ // Store off the pending error - we use it to determine which loaders
3220
+ // to call and will commit it when we complete the navigation
3221
+ let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
3222
+ let context = await loadRouteData(
3223
+ request,
3224
+ matches,
3225
+ requestContext,
3226
+ undefined,
3227
+ {
3228
+ [boundaryMatch.route.id]: result.error,
3229
+ }
3230
+ );
3231
+
3232
+ // action status codes take precedence over loader status codes
3233
+ return {
3234
+ ...context,
3235
+ statusCode: isRouteErrorResponse(result.error)
3236
+ ? result.error.status
3237
+ : 500,
3238
+ actionData: null,
3239
+ actionHeaders: {
3240
+ ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),
3241
+ },
3242
+ };
3243
+ }
3244
+
3245
+ // Create a GET request for the loaders
3246
+ let loaderRequest = new Request(request.url, {
3247
+ headers: request.headers,
3248
+ redirect: request.redirect,
3249
+ signal: request.signal,
3250
+ });
3251
+ let context = await loadRouteData(loaderRequest, matches, requestContext);
3252
+
3253
+ return {
3254
+ ...context,
3255
+ // action status codes take precedence over loader status codes
3256
+ ...(result.statusCode ? { statusCode: result.statusCode } : {}),
3257
+ actionData: {
3258
+ [actionMatch.route.id]: result.data,
3259
+ },
3260
+ actionHeaders: {
3261
+ ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),
3262
+ },
3263
+ };
3264
+ }
3265
+
3266
+ async function loadRouteData(
3267
+ request: Request,
3268
+ matches: AgnosticDataRouteMatch[],
3269
+ requestContext: unknown,
3270
+ routeMatch?: AgnosticDataRouteMatch,
3271
+ pendingActionError?: RouteData
3272
+ ): Promise<
3273
+ | Omit<
3274
+ StaticHandlerContext,
3275
+ "location" | "basename" | "actionData" | "actionHeaders"
3276
+ >
3277
+ | Response
3278
+ > {
3279
+ let isRouteRequest = routeMatch != null;
3280
+
3281
+ // Short circuit if we have no loaders to run (queryRoute())
3282
+ if (
3283
+ isRouteRequest &&
3284
+ !routeMatch?.route.loader &&
3285
+ !routeMatch?.route.lazy
3286
+ ) {
3287
+ throw getInternalRouterError(400, {
3288
+ method: request.method,
3289
+ pathname: new URL(request.url).pathname,
3290
+ routeId: routeMatch?.route.id,
3291
+ });
3292
+ }
3293
+
3294
+ let requestMatches = routeMatch
3295
+ ? [routeMatch]
3296
+ : getLoaderMatchesUntilBoundary(
3297
+ matches,
3298
+ Object.keys(pendingActionError || {})[0]
3299
+ );
3300
+ let matchesToLoad = requestMatches.filter(
3301
+ (m) => m.route.loader || m.route.lazy
3302
+ );
3303
+
3304
+ // Short circuit if we have no loaders to run (query())
3305
+ if (matchesToLoad.length === 0) {
3306
+ return {
3307
+ matches,
3308
+ // Add a null for all matched routes for proper revalidation on the client
3309
+ loaderData: matches.reduce(
3310
+ (acc, m) => Object.assign(acc, { [m.route.id]: null }),
3311
+ {}
3312
+ ),
3313
+ errors: pendingActionError || null,
3314
+ statusCode: 200,
3315
+ loaderHeaders: {},
3316
+ activeDeferreds: null,
3317
+ };
3318
+ }
3319
+
3320
+ let results = await Promise.all([
3321
+ ...matchesToLoad.map((match) =>
3322
+ callLoaderOrAction(
3323
+ "loader",
3324
+ request,
3325
+ match,
3326
+ matches,
3327
+ manifest,
3328
+ mapRouteProperties,
3329
+ basename,
3330
+ future.v7_relativeSplatPath,
3331
+ { isStaticRequest: true, isRouteRequest, requestContext }
3332
+ )
3333
+ ),
3334
+ ]);
3335
+
3336
+ if (request.signal.aborted) {
3337
+ throwStaticHandlerAbortedError(request, isRouteRequest, future);
3338
+ }
3339
+
3340
+ // Process and commit output from loaders
3341
+ let activeDeferreds = new Map<string, DeferredData>();
3342
+ let context = processRouteLoaderData(
3343
+ matches,
3344
+ matchesToLoad,
3345
+ results,
3346
+ pendingActionError,
3347
+ activeDeferreds
3348
+ );
3349
+
3350
+ // Add a null for any non-loader matches for proper revalidation on the client
3351
+ let executedLoaders = new Set<string>(
3352
+ matchesToLoad.map((match) => match.route.id)
3353
+ );
3354
+ matches.forEach((match) => {
3355
+ if (!executedLoaders.has(match.route.id)) {
3356
+ context.loaderData[match.route.id] = null;
3357
+ }
3358
+ });
3359
+
3360
+ return {
3361
+ ...context,
3362
+ matches,
3363
+ activeDeferreds:
3364
+ activeDeferreds.size > 0
3365
+ ? Object.fromEntries(activeDeferreds.entries())
3366
+ : null,
3367
+ };
3368
+ }
3369
+
3370
+ return {
3371
+ dataRoutes,
3372
+ query,
3373
+ queryRoute,
3374
+ };
3375
+ }
3376
+
3377
+ //#endregion
3378
+
3379
+ ////////////////////////////////////////////////////////////////////////////////
3380
+ //#region Helpers
3381
+ ////////////////////////////////////////////////////////////////////////////////
3382
+
3383
+ /**
3384
+ * Given an existing StaticHandlerContext and an error thrown at render time,
3385
+ * provide an updated StaticHandlerContext suitable for a second SSR render
3386
+ */
3387
+ export function getStaticContextFromError(
3388
+ routes: AgnosticDataRouteObject[],
3389
+ context: StaticHandlerContext,
3390
+ error: any
3391
+ ) {
3392
+ let newContext: StaticHandlerContext = {
3393
+ ...context,
3394
+ statusCode: isRouteErrorResponse(error) ? error.status : 500,
3395
+ errors: {
3396
+ [context._deepestRenderedBoundaryId || routes[0].id]: error,
3397
+ },
3398
+ };
3399
+ return newContext;
3400
+ }
3401
+
3402
+ function throwStaticHandlerAbortedError(
3403
+ request: Request,
3404
+ isRouteRequest: boolean,
3405
+ future: StaticHandlerFutureConfig
3406
+ ) {
3407
+ if (future.v7_throwAbortReason && request.signal.reason !== undefined) {
3408
+ throw request.signal.reason;
3409
+ }
3410
+
3411
+ let method = isRouteRequest ? "queryRoute" : "query";
3412
+ throw new Error(`${method}() call aborted: ${request.method} ${request.url}`);
3413
+ }
3414
+
3415
+ function isSubmissionNavigation(
3416
+ opts: BaseNavigateOrFetchOptions
3417
+ ): opts is SubmissionNavigateOptions {
3418
+ return (
3419
+ opts != null &&
3420
+ (("formData" in opts && opts.formData != null) ||
3421
+ ("body" in opts && opts.body !== undefined))
3422
+ );
3423
+ }
3424
+
3425
+ function normalizeTo(
3426
+ location: Path,
3427
+ matches: AgnosticDataRouteMatch[],
3428
+ basename: string,
3429
+ prependBasename: boolean,
3430
+ to: To | null,
3431
+ v7_relativeSplatPath: boolean,
3432
+ fromRouteId?: string,
3433
+ relative?: RelativeRoutingType
3434
+ ) {
3435
+ let contextualMatches: AgnosticDataRouteMatch[];
3436
+ let activeRouteMatch: AgnosticDataRouteMatch | undefined;
3437
+ if (fromRouteId) {
3438
+ // Grab matches up to the calling route so our route-relative logic is
3439
+ // relative to the correct source route
3440
+ contextualMatches = [];
3441
+ for (let match of matches) {
3442
+ contextualMatches.push(match);
3443
+ if (match.route.id === fromRouteId) {
3444
+ activeRouteMatch = match;
3445
+ break;
3446
+ }
3447
+ }
3448
+ } else {
3449
+ contextualMatches = matches;
3450
+ activeRouteMatch = matches[matches.length - 1];
3451
+ }
3452
+
3453
+ // Resolve the relative path
3454
+ let path = resolveTo(
3455
+ to ? to : ".",
3456
+ getResolveToMatches(contextualMatches, v7_relativeSplatPath),
3457
+ stripBasename(location.pathname, basename) || location.pathname,
3458
+ relative === "path"
3459
+ );
3460
+
3461
+ // When `to` is not specified we inherit search/hash from the current
3462
+ // location, unlike when to="." and we just inherit the path.
3463
+ // See https://github.com/remix-run/remix/issues/927
3464
+ if (to == null) {
3465
+ path.search = location.search;
3466
+ path.hash = location.hash;
3467
+ }
3468
+
3469
+ // Add an ?index param for matched index routes if we don't already have one
3470
+ if (
3471
+ (to == null || to === "" || to === ".") &&
3472
+ activeRouteMatch &&
3473
+ activeRouteMatch.route.index &&
3474
+ !hasNakedIndexQuery(path.search)
3475
+ ) {
3476
+ path.search = path.search
3477
+ ? path.search.replace(/^\?/, "?index&")
3478
+ : "?index";
3479
+ }
3480
+
3481
+ // If we're operating within a basename, prepend it to the pathname. If
3482
+ // this is a root navigation, then just use the raw basename which allows
3483
+ // the basename to have full control over the presence of a trailing slash
3484
+ // on root actions
3485
+ if (prependBasename && basename !== "/") {
3486
+ path.pathname =
3487
+ path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
3488
+ }
3489
+
3490
+ return createPath(path);
3491
+ }
3492
+
3493
+ // Normalize navigation options by converting formMethod=GET formData objects to
3494
+ // URLSearchParams so they behave identically to links with query params
3495
+ function normalizeNavigateOptions(
3496
+ normalizeFormMethod: boolean,
3497
+ isFetcher: boolean,
3498
+ path: string,
3499
+ opts?: BaseNavigateOrFetchOptions
3500
+ ): {
3501
+ path: string;
3502
+ submission?: Submission;
3503
+ error?: ErrorResponseImpl;
3504
+ } {
3505
+ // Return location verbatim on non-submission navigations
3506
+ if (!opts || !isSubmissionNavigation(opts)) {
3507
+ return { path };
3508
+ }
3509
+
3510
+ if (opts.formMethod && !isValidMethod(opts.formMethod)) {
3511
+ return {
3512
+ path,
3513
+ error: getInternalRouterError(405, { method: opts.formMethod }),
3514
+ };
3515
+ }
3516
+
3517
+ let getInvalidBodyError = () => ({
3518
+ path,
3519
+ error: getInternalRouterError(400, { type: "invalid-body" }),
3520
+ });
3521
+
3522
+ // Create a Submission on non-GET navigations
3523
+ let rawFormMethod = opts.formMethod || "get";
3524
+ let formMethod = normalizeFormMethod
3525
+ ? (rawFormMethod.toUpperCase() as V7_FormMethod)
3526
+ : (rawFormMethod.toLowerCase() as FormMethod);
3527
+ let formAction = stripHashFromPath(path);
3528
+
3529
+ if (opts.body !== undefined) {
3530
+ if (opts.formEncType === "text/plain") {
3531
+ // text only support POST/PUT/PATCH/DELETE submissions
3532
+ if (!isMutationMethod(formMethod)) {
3533
+ return getInvalidBodyError();
3534
+ }
3535
+
3536
+ let text =
3537
+ typeof opts.body === "string"
3538
+ ? opts.body
3539
+ : opts.body instanceof FormData ||
3540
+ opts.body instanceof URLSearchParams
3541
+ ? // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
3542
+ Array.from(opts.body.entries()).reduce(
3543
+ (acc, [name, value]) => `${acc}${name}=${value}\n`,
3544
+ ""
3545
+ )
3546
+ : String(opts.body);
3547
+
3548
+ return {
3549
+ path,
3550
+ submission: {
3551
+ formMethod,
3552
+ formAction,
3553
+ formEncType: opts.formEncType,
3554
+ formData: undefined,
3555
+ json: undefined,
3556
+ text,
3557
+ },
3558
+ };
3559
+ } else if (opts.formEncType === "application/json") {
3560
+ // json only supports POST/PUT/PATCH/DELETE submissions
3561
+ if (!isMutationMethod(formMethod)) {
3562
+ return getInvalidBodyError();
3563
+ }
3564
+
3565
+ try {
3566
+ let json =
3567
+ typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body;
3568
+
3569
+ return {
3570
+ path,
3571
+ submission: {
3572
+ formMethod,
3573
+ formAction,
3574
+ formEncType: opts.formEncType,
3575
+ formData: undefined,
3576
+ json,
3577
+ text: undefined,
3578
+ },
3579
+ };
3580
+ } catch (e) {
3581
+ return getInvalidBodyError();
3582
+ }
3583
+ }
3584
+ }
3585
+
3586
+ invariant(
3587
+ typeof FormData === "function",
3588
+ "FormData is not available in this environment"
3589
+ );
3590
+
3591
+ let searchParams: URLSearchParams;
3592
+ let formData: FormData;
3593
+
3594
+ if (opts.formData) {
3595
+ searchParams = convertFormDataToSearchParams(opts.formData);
3596
+ formData = opts.formData;
3597
+ } else if (opts.body instanceof FormData) {
3598
+ searchParams = convertFormDataToSearchParams(opts.body);
3599
+ formData = opts.body;
3600
+ } else if (opts.body instanceof URLSearchParams) {
3601
+ searchParams = opts.body;
3602
+ formData = convertSearchParamsToFormData(searchParams);
3603
+ } else if (opts.body == null) {
3604
+ searchParams = new URLSearchParams();
3605
+ formData = new FormData();
3606
+ } else {
3607
+ try {
3608
+ searchParams = new URLSearchParams(opts.body);
3609
+ formData = convertSearchParamsToFormData(searchParams);
3610
+ } catch (e) {
3611
+ return getInvalidBodyError();
3612
+ }
3613
+ }
3614
+
3615
+ let submission: Submission = {
3616
+ formMethod,
3617
+ formAction,
3618
+ formEncType:
3619
+ (opts && opts.formEncType) || "application/x-www-form-urlencoded",
3620
+ formData,
3621
+ json: undefined,
3622
+ text: undefined,
3623
+ };
3624
+
3625
+ if (isMutationMethod(submission.formMethod)) {
3626
+ return { path, submission };
3627
+ }
3628
+
3629
+ // Flatten submission onto URLSearchParams for GET submissions
3630
+ let parsedPath = parsePath(path);
3631
+ // On GET navigation submissions we can drop the ?index param from the
3632
+ // resulting location since all loaders will run. But fetcher GET submissions
3633
+ // only run a single loader so we need to preserve any incoming ?index params
3634
+ if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {
3635
+ searchParams.append("index", "");
3636
+ }
3637
+ parsedPath.search = `?${searchParams}`;
3638
+
3639
+ return { path: createPath(parsedPath), submission };
3640
+ }
3641
+
3642
+ // Filter out all routes below any caught error as they aren't going to
3643
+ // render so we don't need to load them
3644
+ function getLoaderMatchesUntilBoundary(
3645
+ matches: AgnosticDataRouteMatch[],
3646
+ boundaryId?: string
3647
+ ) {
3648
+ let boundaryMatches = matches;
3649
+ if (boundaryId) {
3650
+ let index = matches.findIndex((m) => m.route.id === boundaryId);
3651
+ if (index >= 0) {
3652
+ boundaryMatches = matches.slice(0, index);
3653
+ }
3654
+ }
3655
+ return boundaryMatches;
3656
+ }
3657
+
3658
+ function getMatchesToLoad(
3659
+ history: History,
3660
+ state: RouterState,
3661
+ matches: AgnosticDataRouteMatch[],
3662
+ submission: Submission | undefined,
3663
+ location: Location,
3664
+ isInitialLoad: boolean,
3665
+ isRevalidationRequired: boolean,
3666
+ cancelledDeferredRoutes: string[],
3667
+ cancelledFetcherLoads: string[],
3668
+ deletedFetchers: Set<string>,
3669
+ fetchLoadMatches: Map<string, FetchLoadMatch>,
3670
+ fetchRedirectIds: Set<string>,
3671
+ routesToUse: AgnosticDataRouteObject[],
3672
+ basename: string | undefined,
3673
+ pendingActionData?: RouteData,
3674
+ pendingError?: RouteData
3675
+ ): [AgnosticDataRouteMatch[], RevalidatingFetcher[]] {
3676
+ let actionResult = pendingError
3677
+ ? Object.values(pendingError)[0]
3678
+ : pendingActionData
3679
+ ? Object.values(pendingActionData)[0]
3680
+ : undefined;
3681
+
3682
+ let currentUrl = history.createURL(state.location);
3683
+ let nextUrl = history.createURL(location);
3684
+
3685
+ // Pick navigation matches that are net-new or qualify for revalidation
3686
+ let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;
3687
+ let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);
3688
+
3689
+ let navigationMatches = boundaryMatches.filter((match, index) => {
3690
+ let { route } = match;
3691
+ if (route.lazy) {
3692
+ // We haven't loaded this route yet so we don't know if it's got a loader!
3693
+ return true;
3694
+ }
3695
+
3696
+ if (route.loader == null) {
3697
+ return false;
3698
+ }
3699
+
3700
+ if (isInitialLoad) {
3701
+ if (route.loader.hydrate) {
3702
+ return true;
3703
+ }
3704
+ return (
3705
+ state.loaderData[route.id] === undefined &&
3706
+ // Don't re-run if the loader ran and threw an error
3707
+ (!state.errors || state.errors[route.id] === undefined)
3708
+ );
3709
+ }
3710
+
3711
+ // Always call the loader on new route instances and pending defer cancellations
3712
+ if (
3713
+ isNewLoader(state.loaderData, state.matches[index], match) ||
3714
+ cancelledDeferredRoutes.some((id) => id === match.route.id)
3715
+ ) {
3716
+ return true;
3717
+ }
3718
+
3719
+ // This is the default implementation for when we revalidate. If the route
3720
+ // provides it's own implementation, then we give them full control but
3721
+ // provide this value so they can leverage it if needed after they check
3722
+ // their own specific use cases
3723
+ let currentRouteMatch = state.matches[index];
3724
+ let nextRouteMatch = match;
3725
+
3726
+ return shouldRevalidateLoader(match, {
3727
+ currentUrl,
3728
+ currentParams: currentRouteMatch.params,
3729
+ nextUrl,
3730
+ nextParams: nextRouteMatch.params,
3731
+ ...submission,
3732
+ actionResult,
3733
+ defaultShouldRevalidate:
3734
+ // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
3735
+ isRevalidationRequired ||
3736
+ // Clicked the same link, resubmitted a GET form
3737
+ currentUrl.pathname + currentUrl.search ===
3738
+ nextUrl.pathname + nextUrl.search ||
3739
+ // Search params affect all loaders
3740
+ currentUrl.search !== nextUrl.search ||
3741
+ isNewRouteInstance(currentRouteMatch, nextRouteMatch),
3742
+ });
3743
+ });
3744
+
3745
+ // Pick fetcher.loads that need to be revalidated
3746
+ let revalidatingFetchers: RevalidatingFetcher[] = [];
3747
+ fetchLoadMatches.forEach((f, key) => {
3748
+ // Don't revalidate:
3749
+ // - on initial load (shouldn't be any fetchers then anyway)
3750
+ // - if fetcher won't be present in the subsequent render
3751
+ // - no longer matches the URL (v7_fetcherPersist=false)
3752
+ // - was unmounted but persisted due to v7_fetcherPersist=true
3753
+ if (
3754
+ isInitialLoad ||
3755
+ !matches.some((m) => m.route.id === f.routeId) ||
3756
+ deletedFetchers.has(key)
3757
+ ) {
3758
+ return;
3759
+ }
3760
+
3761
+ let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
3762
+
3763
+ // If the fetcher path no longer matches, push it in with null matches so
3764
+ // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is
3765
+ // currently only a use-case for Remix HMR where the route tree can change
3766
+ // at runtime and remove a route previously loaded via a fetcher
3767
+ if (!fetcherMatches) {
3768
+ revalidatingFetchers.push({
3769
+ key,
3770
+ routeId: f.routeId,
3771
+ path: f.path,
3772
+ matches: null,
3773
+ match: null,
3774
+ controller: null,
3775
+ });
3776
+ return;
3777
+ }
3778
+
3779
+ // Revalidating fetchers are decoupled from the route matches since they
3780
+ // load from a static href. They revalidate based on explicit revalidation
3781
+ // (submission, useRevalidator, or X-Remix-Revalidate)
3782
+ let fetcher = state.fetchers.get(key);
3783
+ let fetcherMatch = getTargetMatch(fetcherMatches, f.path);
3784
+
3785
+ let shouldRevalidate = false;
3786
+ if (fetchRedirectIds.has(key)) {
3787
+ // Never trigger a revalidation of an actively redirecting fetcher
3788
+ shouldRevalidate = false;
3789
+ } else if (cancelledFetcherLoads.includes(key)) {
3790
+ // Always revalidate if the fetcher was cancelled
3791
+ shouldRevalidate = true;
3792
+ } else if (
3793
+ fetcher &&
3794
+ fetcher.state !== "idle" &&
3795
+ fetcher.data === undefined
3796
+ ) {
3797
+ // If the fetcher hasn't ever completed loading yet, then this isn't a
3798
+ // revalidation, it would just be a brand new load if an explicit
3799
+ // revalidation is required
3800
+ shouldRevalidate = isRevalidationRequired;
3801
+ } else {
3802
+ // Otherwise fall back on any user-defined shouldRevalidate, defaulting
3803
+ // to explicit revalidations only
3804
+ shouldRevalidate = shouldRevalidateLoader(fetcherMatch, {
3805
+ currentUrl,
3806
+ currentParams: state.matches[state.matches.length - 1].params,
3807
+ nextUrl,
3808
+ nextParams: matches[matches.length - 1].params,
3809
+ ...submission,
3810
+ actionResult,
3811
+ defaultShouldRevalidate: isRevalidationRequired,
3812
+ });
3813
+ }
3814
+
3815
+ if (shouldRevalidate) {
3816
+ revalidatingFetchers.push({
3817
+ key,
3818
+ routeId: f.routeId,
3819
+ path: f.path,
3820
+ matches: fetcherMatches,
3821
+ match: fetcherMatch,
3822
+ controller: new AbortController(),
3823
+ });
3824
+ }
3825
+ });
3826
+
3827
+ return [navigationMatches, revalidatingFetchers];
3828
+ }
3829
+
3830
+ function isNewLoader(
3831
+ currentLoaderData: RouteData,
3832
+ currentMatch: AgnosticDataRouteMatch,
3833
+ match: AgnosticDataRouteMatch
3834
+ ) {
3835
+ let isNew =
3836
+ // [a] -> [a, b]
3837
+ !currentMatch ||
3838
+ // [a, b] -> [a, c]
3839
+ match.route.id !== currentMatch.route.id;
3840
+
3841
+ // Handle the case that we don't have data for a re-used route, potentially
3842
+ // from a prior error or from a cancelled pending deferred
3843
+ let isMissingData = currentLoaderData[match.route.id] === undefined;
3844
+
3845
+ // Always load if this is a net-new route or we don't yet have data
3846
+ return isNew || isMissingData;
3847
+ }
3848
+
3849
+ function isNewRouteInstance(
3850
+ currentMatch: AgnosticDataRouteMatch,
3851
+ match: AgnosticDataRouteMatch
3852
+ ) {
3853
+ let currentPath = currentMatch.route.path;
3854
+ return (
3855
+ // param change for this match, /users/123 -> /users/456
3856
+ currentMatch.pathname !== match.pathname ||
3857
+ // splat param changed, which is not present in match.path
3858
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
3859
+ (currentPath != null &&
3860
+ currentPath.endsWith("*") &&
3861
+ currentMatch.params["*"] !== match.params["*"])
3862
+ );
3863
+ }
3864
+
3865
+ function shouldRevalidateLoader(
3866
+ loaderMatch: AgnosticDataRouteMatch,
3867
+ arg: ShouldRevalidateFunctionArgs
3868
+ ) {
3869
+ if (loaderMatch.route.shouldRevalidate) {
3870
+ let routeChoice = loaderMatch.route.shouldRevalidate(arg);
3871
+ if (typeof routeChoice === "boolean") {
3872
+ return routeChoice;
3873
+ }
3874
+ }
3875
+
3876
+ return arg.defaultShouldRevalidate;
3877
+ }
3878
+
3879
+ /**
3880
+ * Execute route.lazy() methods to lazily load route modules (loader, action,
3881
+ * shouldRevalidate) and update the routeManifest in place which shares objects
3882
+ * with dataRoutes so those get updated as well.
3883
+ */
3884
+ async function loadLazyRouteModule(
3885
+ route: AgnosticDataRouteObject,
3886
+ mapRouteProperties: MapRoutePropertiesFunction,
3887
+ manifest: RouteManifest
3888
+ ) {
3889
+ if (!route.lazy) {
3890
+ return;
3891
+ }
3892
+
3893
+ let lazyRoute = await route.lazy();
3894
+
3895
+ // If the lazy route function was executed and removed by another parallel
3896
+ // call then we can return - first lazy() to finish wins because the return
3897
+ // value of lazy is expected to be static
3898
+ if (!route.lazy) {
3899
+ return;
3900
+ }
3901
+
3902
+ let routeToUpdate = manifest[route.id];
3903
+ invariant(routeToUpdate, "No route found in manifest");
3904
+
3905
+ // Update the route in place. This should be safe because there's no way
3906
+ // we could yet be sitting on this route as we can't get there without
3907
+ // resolving lazy() first.
3908
+ //
3909
+ // This is different than the HMR "update" use-case where we may actively be
3910
+ // on the route being updated. The main concern boils down to "does this
3911
+ // mutation affect any ongoing navigations or any current state.matches
3912
+ // values?". If not, it should be safe to update in place.
3913
+ let routeUpdates: Record<string, any> = {};
3914
+ for (let lazyRouteProperty in lazyRoute) {
3915
+ let staticRouteValue =
3916
+ routeToUpdate[lazyRouteProperty as keyof typeof routeToUpdate];
3917
+
3918
+ let isPropertyStaticallyDefined =
3919
+ staticRouteValue !== undefined &&
3920
+ // This property isn't static since it should always be updated based
3921
+ // on the route updates
3922
+ lazyRouteProperty !== "hasErrorBoundary";
3923
+
3924
+ warning(
3925
+ !isPropertyStaticallyDefined,
3926
+ `Route "${routeToUpdate.id}" has a static property "${lazyRouteProperty}" ` +
3927
+ `defined but its lazy function is also returning a value for this property. ` +
3928
+ `The lazy route property "${lazyRouteProperty}" will be ignored.`
3929
+ );
3930
+
3931
+ if (
3932
+ !isPropertyStaticallyDefined &&
3933
+ !immutableRouteKeys.has(lazyRouteProperty as ImmutableRouteKey)
3934
+ ) {
3935
+ routeUpdates[lazyRouteProperty] =
3936
+ lazyRoute[lazyRouteProperty as keyof typeof lazyRoute];
3937
+ }
3938
+ }
3939
+
3940
+ // Mutate the route with the provided updates. Do this first so we pass
3941
+ // the updated version to mapRouteProperties
3942
+ Object.assign(routeToUpdate, routeUpdates);
3943
+
3944
+ // Mutate the `hasErrorBoundary` property on the route based on the route
3945
+ // updates and remove the `lazy` function so we don't resolve the lazy
3946
+ // route again.
3947
+ Object.assign(routeToUpdate, {
3948
+ // To keep things framework agnostic, we use the provided
3949
+ // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to
3950
+ // set the framework-aware properties (`element`/`hasErrorBoundary`) since
3951
+ // the logic will differ between frameworks.
3952
+ ...mapRouteProperties(routeToUpdate),
3953
+ lazy: undefined,
3954
+ });
3955
+ }
3956
+
3957
+ async function callLoaderOrAction(
3958
+ type: "loader" | "action",
3959
+ request: Request,
3960
+ match: AgnosticDataRouteMatch,
3961
+ matches: AgnosticDataRouteMatch[],
3962
+ manifest: RouteManifest,
3963
+ mapRouteProperties: MapRoutePropertiesFunction,
3964
+ basename: string,
3965
+ v7_relativeSplatPath: boolean,
3966
+ opts: {
3967
+ isStaticRequest?: boolean;
3968
+ isRouteRequest?: boolean;
3969
+ requestContext?: unknown;
3970
+ } = {}
3971
+ ): Promise<DataResult> {
3972
+ let resultType;
3973
+ let result;
3974
+ let onReject: (() => void) | undefined;
3975
+
3976
+ let runHandler = (handler: ActionFunction | LoaderFunction) => {
3977
+ // Setup a promise we can race against so that abort signals short circuit
3978
+ let reject: () => void;
3979
+ let abortPromise = new Promise((_, r) => (reject = r));
3980
+ onReject = () => reject();
3981
+ request.signal.addEventListener("abort", onReject);
3982
+ return Promise.race([
3983
+ handler({
3984
+ request,
3985
+ params: match.params,
3986
+ context: opts.requestContext,
3987
+ }),
3988
+ abortPromise,
3989
+ ]);
3990
+ };
3991
+
3992
+ try {
3993
+ let handler = match.route[type];
3994
+
3995
+ if (match.route.lazy) {
3996
+ if (handler) {
3997
+ // Run statically defined handler in parallel with lazy()
3998
+ let handlerError;
3999
+ let values = await Promise.all([
4000
+ // If the handler throws, don't let it immediately bubble out,
4001
+ // since we need to let the lazy() execution finish so we know if this
4002
+ // route has a boundary that can handle the error
4003
+ runHandler(handler).catch((e) => {
4004
+ handlerError = e;
4005
+ }),
4006
+ loadLazyRouteModule(match.route, mapRouteProperties, manifest),
4007
+ ]);
4008
+ if (handlerError) {
4009
+ throw handlerError;
4010
+ }
4011
+ result = values[0];
4012
+ } else {
4013
+ // Load lazy route module, then run any returned handler
4014
+ await loadLazyRouteModule(match.route, mapRouteProperties, manifest);
4015
+
4016
+ handler = match.route[type];
4017
+ if (handler) {
4018
+ // Handler still run even if we got interrupted to maintain consistency
4019
+ // with un-abortable behavior of handler execution on non-lazy or
4020
+ // previously-lazy-loaded routes
4021
+ result = await runHandler(handler);
4022
+ } else if (type === "action") {
4023
+ let url = new URL(request.url);
4024
+ let pathname = url.pathname + url.search;
4025
+ throw getInternalRouterError(405, {
4026
+ method: request.method,
4027
+ pathname,
4028
+ routeId: match.route.id,
4029
+ });
4030
+ } else {
4031
+ // lazy() route has no loader to run. Short circuit here so we don't
4032
+ // hit the invariant below that errors on returning undefined.
4033
+ return { type: ResultType.data, data: undefined };
4034
+ }
4035
+ }
4036
+ } else if (!handler) {
4037
+ let url = new URL(request.url);
4038
+ let pathname = url.pathname + url.search;
4039
+ throw getInternalRouterError(404, {
4040
+ pathname,
4041
+ });
4042
+ } else {
4043
+ result = await runHandler(handler);
4044
+ }
4045
+
4046
+ invariant(
4047
+ result !== undefined,
4048
+ `You defined ${type === "action" ? "an action" : "a loader"} for route ` +
4049
+ `"${match.route.id}" but didn't return anything from your \`${type}\` ` +
4050
+ `function. Please return a value or \`null\`.`
4051
+ );
4052
+ } catch (e) {
4053
+ resultType = ResultType.error;
4054
+ result = e;
4055
+ } finally {
4056
+ if (onReject) {
4057
+ request.signal.removeEventListener("abort", onReject);
4058
+ }
4059
+ }
4060
+
4061
+ if (isResponse(result)) {
4062
+ let status = result.status;
4063
+
4064
+ // Process redirects
4065
+ if (redirectStatusCodes.has(status)) {
4066
+ let location = result.headers.get("Location");
4067
+ invariant(
4068
+ location,
4069
+ "Redirects returned/thrown from loaders/actions must have a Location header"
4070
+ );
4071
+
4072
+ // Support relative routing in internal redirects
4073
+ if (!ABSOLUTE_URL_REGEX.test(location)) {
4074
+ location = normalizeTo(
4075
+ new URL(request.url),
4076
+ matches.slice(0, matches.indexOf(match) + 1),
4077
+ basename,
4078
+ true,
4079
+ location,
4080
+ v7_relativeSplatPath
4081
+ );
4082
+ } else if (!opts.isStaticRequest) {
4083
+ // Strip off the protocol+origin for same-origin + same-basename absolute
4084
+ // redirects. If this is a static request, we can let it go back to the
4085
+ // browser as-is
4086
+ let currentUrl = new URL(request.url);
4087
+ let url = location.startsWith("//")
4088
+ ? new URL(currentUrl.protocol + location)
4089
+ : new URL(location);
4090
+ let isSameBasename = stripBasename(url.pathname, basename) != null;
4091
+ if (url.origin === currentUrl.origin && isSameBasename) {
4092
+ location = url.pathname + url.search + url.hash;
4093
+ }
4094
+ }
4095
+
4096
+ // Don't process redirects in the router during static requests requests.
4097
+ // Instead, throw the Response and let the server handle it with an HTTP
4098
+ // redirect. We also update the Location header in place in this flow so
4099
+ // basename and relative routing is taken into account
4100
+ if (opts.isStaticRequest) {
4101
+ result.headers.set("Location", location);
4102
+ throw result;
4103
+ }
4104
+
4105
+ return {
4106
+ type: ResultType.redirect,
4107
+ status,
4108
+ location,
4109
+ revalidate: result.headers.get("X-Remix-Revalidate") !== null,
4110
+ reloadDocument: result.headers.get("X-Remix-Reload-Document") !== null,
4111
+ };
4112
+ }
4113
+
4114
+ // For SSR single-route requests, we want to hand Responses back directly
4115
+ // without unwrapping. We do this with the QueryRouteResponse wrapper
4116
+ // interface so we can know whether it was returned or thrown
4117
+ if (opts.isRouteRequest) {
4118
+ let queryRouteResponse: QueryRouteResponse = {
4119
+ type:
4120
+ resultType === ResultType.error ? ResultType.error : ResultType.data,
4121
+ response: result,
4122
+ };
4123
+ throw queryRouteResponse;
4124
+ }
4125
+
4126
+ let data: any;
4127
+
4128
+ try {
4129
+ let contentType = result.headers.get("Content-Type");
4130
+ // Check between word boundaries instead of startsWith() due to the last
4131
+ // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type
4132
+ if (contentType && /\bapplication\/json\b/.test(contentType)) {
4133
+ if (result.body == null) {
4134
+ data = null;
4135
+ } else {
4136
+ data = await result.json();
4137
+ }
4138
+ } else {
4139
+ data = await result.text();
4140
+ }
4141
+ } catch (e) {
4142
+ return { type: ResultType.error, error: e };
4143
+ }
4144
+
4145
+ if (resultType === ResultType.error) {
4146
+ return {
4147
+ type: resultType,
4148
+ error: new ErrorResponseImpl(status, result.statusText, data),
4149
+ headers: result.headers,
4150
+ };
4151
+ }
4152
+
4153
+ return {
4154
+ type: ResultType.data,
4155
+ data,
4156
+ statusCode: result.status,
4157
+ headers: result.headers,
4158
+ };
4159
+ }
4160
+
4161
+ if (resultType === ResultType.error) {
4162
+ return { type: resultType, error: result };
4163
+ }
4164
+
4165
+ if (isDeferredData(result)) {
4166
+ return {
4167
+ type: ResultType.deferred,
4168
+ deferredData: result,
4169
+ statusCode: result.init?.status,
4170
+ headers: result.init?.headers && new Headers(result.init.headers),
4171
+ };
4172
+ }
4173
+
4174
+ return { type: ResultType.data, data: result };
4175
+ }
4176
+
4177
+ // Utility method for creating the Request instances for loaders/actions during
4178
+ // client-side navigations and fetches. During SSR we will always have a
4179
+ // Request instance from the static handler (query/queryRoute)
4180
+ function createClientSideRequest(
4181
+ history: History,
4182
+ location: string | Location,
4183
+ signal: AbortSignal,
4184
+ submission?: Submission
4185
+ ): Request {
4186
+ let url = history.createURL(stripHashFromPath(location)).toString();
4187
+ let init: RequestInit = { signal };
4188
+
4189
+ if (submission && isMutationMethod(submission.formMethod)) {
4190
+ let { formMethod, formEncType } = submission;
4191
+ // Didn't think we needed this but it turns out unlike other methods, patch
4192
+ // won't be properly normalized to uppercase and results in a 405 error.
4193
+ // See: https://fetch.spec.whatwg.org/#concept-method
4194
+ init.method = formMethod.toUpperCase();
4195
+
4196
+ if (formEncType === "application/json") {
4197
+ init.headers = new Headers({ "Content-Type": formEncType });
4198
+ init.body = JSON.stringify(submission.json);
4199
+ } else if (formEncType === "text/plain") {
4200
+ // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
4201
+ init.body = submission.text;
4202
+ } else if (
4203
+ formEncType === "application/x-www-form-urlencoded" &&
4204
+ submission.formData
4205
+ ) {
4206
+ // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
4207
+ init.body = convertFormDataToSearchParams(submission.formData);
4208
+ } else {
4209
+ // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
4210
+ init.body = submission.formData;
4211
+ }
4212
+ }
4213
+
4214
+ return new Request(url, init);
4215
+ }
4216
+
4217
+ function convertFormDataToSearchParams(formData: FormData): URLSearchParams {
4218
+ let searchParams = new URLSearchParams();
4219
+
4220
+ for (let [key, value] of formData.entries()) {
4221
+ // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs
4222
+ searchParams.append(key, typeof value === "string" ? value : value.name);
4223
+ }
4224
+
4225
+ return searchParams;
4226
+ }
4227
+
4228
+ function convertSearchParamsToFormData(
4229
+ searchParams: URLSearchParams
4230
+ ): FormData {
4231
+ let formData = new FormData();
4232
+ for (let [key, value] of searchParams.entries()) {
4233
+ formData.append(key, value);
4234
+ }
4235
+ return formData;
4236
+ }
4237
+
4238
+ function processRouteLoaderData(
4239
+ matches: AgnosticDataRouteMatch[],
4240
+ matchesToLoad: AgnosticDataRouteMatch[],
4241
+ results: DataResult[],
4242
+ pendingError: RouteData | undefined,
4243
+ activeDeferreds: Map<string, DeferredData>
4244
+ ): {
4245
+ loaderData: RouterState["loaderData"];
4246
+ errors: RouterState["errors"] | null;
4247
+ statusCode: number;
4248
+ loaderHeaders: Record<string, Headers>;
4249
+ } {
4250
+ // Fill in loaderData/errors from our loaders
4251
+ let loaderData: RouterState["loaderData"] = {};
4252
+ let errors: RouterState["errors"] | null = null;
4253
+ let statusCode: number | undefined;
4254
+ let foundError = false;
4255
+ let loaderHeaders: Record<string, Headers> = {};
4256
+
4257
+ // Process loader results into state.loaderData/state.errors
4258
+ results.forEach((result, index) => {
4259
+ let id = matchesToLoad[index].route.id;
4260
+ invariant(
4261
+ !isRedirectResult(result),
4262
+ "Cannot handle redirect results in processLoaderData"
4263
+ );
4264
+ if (isErrorResult(result)) {
4265
+ // Look upwards from the matched route for the closest ancestor
4266
+ // error boundary, defaulting to the root match
4267
+ let boundaryMatch = findNearestBoundary(matches, id);
4268
+ let error = result.error;
4269
+ // If we have a pending action error, we report it at the highest-route
4270
+ // that throws a loader error, and then clear it out to indicate that
4271
+ // it was consumed
4272
+ if (pendingError) {
4273
+ error = Object.values(pendingError)[0];
4274
+ pendingError = undefined;
4275
+ }
4276
+
4277
+ errors = errors || {};
4278
+
4279
+ // Prefer higher error values if lower errors bubble to the same boundary
4280
+ if (errors[boundaryMatch.route.id] == null) {
4281
+ errors[boundaryMatch.route.id] = error;
4282
+ }
4283
+
4284
+ // Clear our any prior loaderData for the throwing route
4285
+ loaderData[id] = undefined;
4286
+
4287
+ // Once we find our first (highest) error, we set the status code and
4288
+ // prevent deeper status codes from overriding
4289
+ if (!foundError) {
4290
+ foundError = true;
4291
+ statusCode = isRouteErrorResponse(result.error)
4292
+ ? result.error.status
4293
+ : 500;
4294
+ }
4295
+ if (result.headers) {
4296
+ loaderHeaders[id] = result.headers;
4297
+ }
4298
+ } else {
4299
+ if (isDeferredResult(result)) {
4300
+ activeDeferreds.set(id, result.deferredData);
4301
+ loaderData[id] = result.deferredData.data;
4302
+ } else {
4303
+ loaderData[id] = result.data;
4304
+ }
4305
+
4306
+ // Error status codes always override success status codes, but if all
4307
+ // loaders are successful we take the deepest status code.
4308
+ if (
4309
+ result.statusCode != null &&
4310
+ result.statusCode !== 200 &&
4311
+ !foundError
4312
+ ) {
4313
+ statusCode = result.statusCode;
4314
+ }
4315
+ if (result.headers) {
4316
+ loaderHeaders[id] = result.headers;
4317
+ }
4318
+ }
4319
+ });
4320
+
4321
+ // If we didn't consume the pending action error (i.e., all loaders
4322
+ // resolved), then consume it here. Also clear out any loaderData for the
4323
+ // throwing route
4324
+ if (pendingError) {
4325
+ errors = pendingError;
4326
+ loaderData[Object.keys(pendingError)[0]] = undefined;
4327
+ }
4328
+
4329
+ return {
4330
+ loaderData,
4331
+ errors,
4332
+ statusCode: statusCode || 200,
4333
+ loaderHeaders,
4334
+ };
4335
+ }
4336
+
4337
+ function processLoaderData(
4338
+ state: RouterState,
4339
+ matches: AgnosticDataRouteMatch[],
4340
+ matchesToLoad: AgnosticDataRouteMatch[],
4341
+ results: DataResult[],
4342
+ pendingError: RouteData | undefined,
4343
+ revalidatingFetchers: RevalidatingFetcher[],
4344
+ fetcherResults: DataResult[],
4345
+ activeDeferreds: Map<string, DeferredData>
4346
+ ): {
4347
+ loaderData: RouterState["loaderData"];
4348
+ errors?: RouterState["errors"];
4349
+ } {
4350
+ let { loaderData, errors } = processRouteLoaderData(
4351
+ matches,
4352
+ matchesToLoad,
4353
+ results,
4354
+ pendingError,
4355
+ activeDeferreds
4356
+ );
4357
+
4358
+ // Process results from our revalidating fetchers
4359
+ for (let index = 0; index < revalidatingFetchers.length; index++) {
4360
+ let { key, match, controller } = revalidatingFetchers[index];
4361
+ invariant(
4362
+ fetcherResults !== undefined && fetcherResults[index] !== undefined,
4363
+ "Did not find corresponding fetcher result"
4364
+ );
4365
+ let result = fetcherResults[index];
4366
+
4367
+ // Process fetcher non-redirect errors
4368
+ if (controller && controller.signal.aborted) {
4369
+ // Nothing to do for aborted fetchers
4370
+ continue;
4371
+ } else if (isErrorResult(result)) {
4372
+ let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);
4373
+ if (!(errors && errors[boundaryMatch.route.id])) {
4374
+ errors = {
4375
+ ...errors,
4376
+ [boundaryMatch.route.id]: result.error,
4377
+ };
4378
+ }
4379
+ state.fetchers.delete(key);
4380
+ } else if (isRedirectResult(result)) {
4381
+ // Should never get here, redirects should get processed above, but we
4382
+ // keep this to type narrow to a success result in the else
4383
+ invariant(false, "Unhandled fetcher revalidation redirect");
4384
+ } else if (isDeferredResult(result)) {
4385
+ // Should never get here, deferred data should be awaited for fetchers
4386
+ // in resolveDeferredResults
4387
+ invariant(false, "Unhandled fetcher deferred data");
4388
+ } else {
4389
+ let doneFetcher = getDoneFetcher(result.data);
4390
+ state.fetchers.set(key, doneFetcher);
4391
+ }
4392
+ }
4393
+
4394
+ return { loaderData, errors };
4395
+ }
4396
+
4397
+ function mergeLoaderData(
4398
+ loaderData: RouteData,
4399
+ newLoaderData: RouteData,
4400
+ matches: AgnosticDataRouteMatch[],
4401
+ errors: RouteData | null | undefined
4402
+ ): RouteData {
4403
+ let mergedLoaderData = { ...newLoaderData };
4404
+ for (let match of matches) {
4405
+ let id = match.route.id;
4406
+ if (newLoaderData.hasOwnProperty(id)) {
4407
+ if (newLoaderData[id] !== undefined) {
4408
+ mergedLoaderData[id] = newLoaderData[id];
4409
+ } else {
4410
+ // No-op - this is so we ignore existing data if we have a key in the
4411
+ // incoming object with an undefined value, which is how we unset a prior
4412
+ // loaderData if we encounter a loader error
4413
+ }
4414
+ } else if (loaderData[id] !== undefined && match.route.loader) {
4415
+ // Preserve existing keys not included in newLoaderData and where a loader
4416
+ // wasn't removed by HMR
4417
+ mergedLoaderData[id] = loaderData[id];
4418
+ }
4419
+
4420
+ if (errors && errors.hasOwnProperty(id)) {
4421
+ // Don't keep any loader data below the boundary
4422
+ break;
4423
+ }
4424
+ }
4425
+ return mergedLoaderData;
4426
+ }
4427
+
4428
+ // Find the nearest error boundary, looking upwards from the leaf route (or the
4429
+ // route specified by routeId) for the closest ancestor error boundary,
4430
+ // defaulting to the root match
4431
+ function findNearestBoundary(
4432
+ matches: AgnosticDataRouteMatch[],
4433
+ routeId?: string
4434
+ ): AgnosticDataRouteMatch {
4435
+ let eligibleMatches = routeId
4436
+ ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1)
4437
+ : [...matches];
4438
+ return (
4439
+ eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) ||
4440
+ matches[0]
4441
+ );
4442
+ }
4443
+
4444
+ function getShortCircuitMatches(routes: AgnosticDataRouteObject[]): {
4445
+ matches: AgnosticDataRouteMatch[];
4446
+ route: AgnosticDataRouteObject;
4447
+ } {
4448
+ // Prefer a root layout route if present, otherwise shim in a route object
4449
+ let route =
4450
+ routes.length === 1
4451
+ ? routes[0]
4452
+ : routes.find((r) => r.index || !r.path || r.path === "/") || {
4453
+ id: `__shim-error-route__`,
4454
+ };
4455
+
4456
+ return {
4457
+ matches: [
4458
+ {
4459
+ params: {},
4460
+ pathname: "",
4461
+ pathnameBase: "",
4462
+ route,
4463
+ },
4464
+ ],
4465
+ route,
4466
+ };
4467
+ }
4468
+
4469
+ function getInternalRouterError(
4470
+ status: number,
4471
+ {
4472
+ pathname,
4473
+ routeId,
4474
+ method,
4475
+ type,
4476
+ }: {
4477
+ pathname?: string;
4478
+ routeId?: string;
4479
+ method?: string;
4480
+ type?: "defer-action" | "invalid-body";
4481
+ } = {}
4482
+ ) {
4483
+ let statusText = "Unknown Server Error";
4484
+ let errorMessage = "Unknown @remix-run/router error";
4485
+
4486
+ if (status === 400) {
4487
+ statusText = "Bad Request";
4488
+ if (method && pathname && routeId) {
4489
+ errorMessage =
4490
+ `You made a ${method} request to "${pathname}" but ` +
4491
+ `did not provide a \`loader\` for route "${routeId}", ` +
4492
+ `so there is no way to handle the request.`;
4493
+ } else if (type === "defer-action") {
4494
+ errorMessage = "defer() is not supported in actions";
4495
+ } else if (type === "invalid-body") {
4496
+ errorMessage = "Unable to encode submission body";
4497
+ }
4498
+ } else if (status === 403) {
4499
+ statusText = "Forbidden";
4500
+ errorMessage = `Route "${routeId}" does not match URL "${pathname}"`;
4501
+ } else if (status === 404) {
4502
+ statusText = "Not Found";
4503
+ errorMessage = `No route matches URL "${pathname}"`;
4504
+ } else if (status === 405) {
4505
+ statusText = "Method Not Allowed";
4506
+ if (method && pathname && routeId) {
4507
+ errorMessage =
4508
+ `You made a ${method.toUpperCase()} request to "${pathname}" but ` +
4509
+ `did not provide an \`action\` for route "${routeId}", ` +
4510
+ `so there is no way to handle the request.`;
4511
+ } else if (method) {
4512
+ errorMessage = `Invalid request method "${method.toUpperCase()}"`;
4513
+ }
4514
+ }
4515
+
4516
+ return new ErrorResponseImpl(
4517
+ status || 500,
4518
+ statusText,
4519
+ new Error(errorMessage),
4520
+ true
4521
+ );
4522
+ }
4523
+
4524
+ // Find any returned redirect errors, starting from the lowest match
4525
+ function findRedirect(
4526
+ results: DataResult[]
4527
+ ): { result: RedirectResult; idx: number } | undefined {
4528
+ for (let i = results.length - 1; i >= 0; i--) {
4529
+ let result = results[i];
4530
+ if (isRedirectResult(result)) {
4531
+ return { result, idx: i };
4532
+ }
4533
+ }
4534
+ }
4535
+
4536
+ function stripHashFromPath(path: To) {
4537
+ let parsedPath = typeof path === "string" ? parsePath(path) : path;
4538
+ return createPath({ ...parsedPath, hash: "" });
4539
+ }
4540
+
4541
+ function isHashChangeOnly(a: Location, b: Location): boolean {
4542
+ if (a.pathname !== b.pathname || a.search !== b.search) {
4543
+ return false;
4544
+ }
4545
+
4546
+ if (a.hash === "") {
4547
+ // /page -> /page#hash
4548
+ return b.hash !== "";
4549
+ } else if (a.hash === b.hash) {
4550
+ // /page#hash -> /page#hash
4551
+ return true;
4552
+ } else if (b.hash !== "") {
4553
+ // /page#hash -> /page#other
4554
+ return true;
4555
+ }
4556
+
4557
+ // If the hash is removed the browser will re-perform a request to the server
4558
+ // /page#hash -> /page
4559
+ return false;
4560
+ }
4561
+
4562
+ function isDeferredResult(result: DataResult): result is DeferredResult {
4563
+ return result.type === ResultType.deferred;
4564
+ }
4565
+
4566
+ function isErrorResult(result: DataResult): result is ErrorResult {
4567
+ return result.type === ResultType.error;
4568
+ }
4569
+
4570
+ function isRedirectResult(result?: DataResult): result is RedirectResult {
4571
+ return (result && result.type) === ResultType.redirect;
4572
+ }
4573
+
4574
+ export function isDeferredData(value: any): value is DeferredData {
4575
+ let deferred: DeferredData = value;
4576
+ return (
4577
+ deferred &&
4578
+ typeof deferred === "object" &&
4579
+ typeof deferred.data === "object" &&
4580
+ typeof deferred.subscribe === "function" &&
4581
+ typeof deferred.cancel === "function" &&
4582
+ typeof deferred.resolveData === "function"
4583
+ );
4584
+ }
4585
+
4586
+ function isResponse(value: any): value is Response {
4587
+ return (
4588
+ value != null &&
4589
+ typeof value.status === "number" &&
4590
+ typeof value.statusText === "string" &&
4591
+ typeof value.headers === "object" &&
4592
+ typeof value.body !== "undefined"
4593
+ );
4594
+ }
4595
+
4596
+ function isRedirectResponse(result: any): result is Response {
4597
+ if (!isResponse(result)) {
4598
+ return false;
4599
+ }
4600
+
4601
+ let status = result.status;
4602
+ let location = result.headers.get("Location");
4603
+ return status >= 300 && status <= 399 && location != null;
4604
+ }
4605
+
4606
+ function isQueryRouteResponse(obj: any): obj is QueryRouteResponse {
4607
+ return (
4608
+ obj &&
4609
+ isResponse(obj.response) &&
4610
+ (obj.type === ResultType.data || obj.type === ResultType.error)
4611
+ );
4612
+ }
4613
+
4614
+ function isValidMethod(method: string): method is FormMethod | V7_FormMethod {
4615
+ return validRequestMethods.has(method.toLowerCase() as FormMethod);
4616
+ }
4617
+
4618
+ function isMutationMethod(
4619
+ method: string
4620
+ ): method is MutationFormMethod | V7_MutationFormMethod {
4621
+ return validMutationMethods.has(method.toLowerCase() as MutationFormMethod);
4622
+ }
4623
+
4624
+ async function resolveDeferredResults(
4625
+ currentMatches: AgnosticDataRouteMatch[],
4626
+ matchesToLoad: (AgnosticDataRouteMatch | null)[],
4627
+ results: DataResult[],
4628
+ signals: (AbortSignal | null)[],
4629
+ isFetcher: boolean,
4630
+ currentLoaderData?: RouteData
4631
+ ) {
4632
+ for (let index = 0; index < results.length; index++) {
4633
+ let result = results[index];
4634
+ let match = matchesToLoad[index];
4635
+ // If we don't have a match, then we can have a deferred result to do
4636
+ // anything with. This is for revalidating fetchers where the route was
4637
+ // removed during HMR
4638
+ if (!match) {
4639
+ continue;
4640
+ }
4641
+
4642
+ let currentMatch = currentMatches.find(
4643
+ (m) => m.route.id === match!.route.id
4644
+ );
4645
+ let isRevalidatingLoader =
4646
+ currentMatch != null &&
4647
+ !isNewRouteInstance(currentMatch, match) &&
4648
+ (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;
4649
+
4650
+ if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {
4651
+ // Note: we do not have to touch activeDeferreds here since we race them
4652
+ // against the signal in resolveDeferredData and they'll get aborted
4653
+ // there if needed
4654
+ let signal = signals[index];
4655
+ invariant(
4656
+ signal,
4657
+ "Expected an AbortSignal for revalidating fetcher deferred result"
4658
+ );
4659
+ await resolveDeferredData(result, signal, isFetcher).then((result) => {
4660
+ if (result) {
4661
+ results[index] = result || results[index];
4662
+ }
4663
+ });
4664
+ }
4665
+ }
4666
+ }
4667
+
4668
+ async function resolveDeferredData(
4669
+ result: DeferredResult,
4670
+ signal: AbortSignal,
4671
+ unwrap = false
4672
+ ): Promise<SuccessResult | ErrorResult | undefined> {
4673
+ let aborted = await result.deferredData.resolveData(signal);
4674
+ if (aborted) {
4675
+ return;
4676
+ }
4677
+
4678
+ if (unwrap) {
4679
+ try {
4680
+ return {
4681
+ type: ResultType.data,
4682
+ data: result.deferredData.unwrappedData,
4683
+ };
4684
+ } catch (e) {
4685
+ // Handle any TrackedPromise._error values encountered while unwrapping
4686
+ return {
4687
+ type: ResultType.error,
4688
+ error: e,
4689
+ };
4690
+ }
4691
+ }
4692
+
4693
+ return {
4694
+ type: ResultType.data,
4695
+ data: result.deferredData.data,
4696
+ };
4697
+ }
4698
+
4699
+ function hasNakedIndexQuery(search: string): boolean {
4700
+ return new URLSearchParams(search).getAll("index").some((v) => v === "");
4701
+ }
4702
+
4703
+ function getTargetMatch(
4704
+ matches: AgnosticDataRouteMatch[],
4705
+ location: Location | string
4706
+ ) {
4707
+ let search =
4708
+ typeof location === "string" ? parsePath(location).search : location.search;
4709
+ if (
4710
+ matches[matches.length - 1].route.index &&
4711
+ hasNakedIndexQuery(search || "")
4712
+ ) {
4713
+ // Return the leaf index route when index is present
4714
+ return matches[matches.length - 1];
4715
+ }
4716
+ // Otherwise grab the deepest "path contributing" match (ignoring index and
4717
+ // pathless layout routes)
4718
+ let pathMatches = getPathContributingMatches(matches);
4719
+ return pathMatches[pathMatches.length - 1];
4720
+ }
4721
+
4722
+ function getSubmissionFromNavigation(
4723
+ navigation: Navigation
4724
+ ): Submission | undefined {
4725
+ let { formMethod, formAction, formEncType, text, formData, json } =
4726
+ navigation;
4727
+ if (!formMethod || !formAction || !formEncType) {
4728
+ return;
4729
+ }
4730
+
4731
+ if (text != null) {
4732
+ return {
4733
+ formMethod,
4734
+ formAction,
4735
+ formEncType,
4736
+ formData: undefined,
4737
+ json: undefined,
4738
+ text,
4739
+ };
4740
+ } else if (formData != null) {
4741
+ return {
4742
+ formMethod,
4743
+ formAction,
4744
+ formEncType,
4745
+ formData,
4746
+ json: undefined,
4747
+ text: undefined,
4748
+ };
4749
+ } else if (json !== undefined) {
4750
+ return {
4751
+ formMethod,
4752
+ formAction,
4753
+ formEncType,
4754
+ formData: undefined,
4755
+ json,
4756
+ text: undefined,
4757
+ };
4758
+ }
4759
+ }
4760
+
4761
+ function getLoadingNavigation(
4762
+ location: Location,
4763
+ submission?: Submission
4764
+ ): NavigationStates["Loading"] {
4765
+ if (submission) {
4766
+ let navigation: NavigationStates["Loading"] = {
4767
+ state: "loading",
4768
+ location,
4769
+ formMethod: submission.formMethod,
4770
+ formAction: submission.formAction,
4771
+ formEncType: submission.formEncType,
4772
+ formData: submission.formData,
4773
+ json: submission.json,
4774
+ text: submission.text,
4775
+ };
4776
+ return navigation;
4777
+ } else {
4778
+ let navigation: NavigationStates["Loading"] = {
4779
+ state: "loading",
4780
+ location,
4781
+ formMethod: undefined,
4782
+ formAction: undefined,
4783
+ formEncType: undefined,
4784
+ formData: undefined,
4785
+ json: undefined,
4786
+ text: undefined,
4787
+ };
4788
+ return navigation;
4789
+ }
4790
+ }
4791
+
4792
+ function getSubmittingNavigation(
4793
+ location: Location,
4794
+ submission: Submission
4795
+ ): NavigationStates["Submitting"] {
4796
+ let navigation: NavigationStates["Submitting"] = {
4797
+ state: "submitting",
4798
+ location,
4799
+ formMethod: submission.formMethod,
4800
+ formAction: submission.formAction,
4801
+ formEncType: submission.formEncType,
4802
+ formData: submission.formData,
4803
+ json: submission.json,
4804
+ text: submission.text,
4805
+ };
4806
+ return navigation;
4807
+ }
4808
+
4809
+ function getLoadingFetcher(
4810
+ submission?: Submission,
4811
+ data?: Fetcher["data"]
4812
+ ): FetcherStates["Loading"] {
4813
+ if (submission) {
4814
+ let fetcher: FetcherStates["Loading"] = {
4815
+ state: "loading",
4816
+ formMethod: submission.formMethod,
4817
+ formAction: submission.formAction,
4818
+ formEncType: submission.formEncType,
4819
+ formData: submission.formData,
4820
+ json: submission.json,
4821
+ text: submission.text,
4822
+ data,
4823
+ };
4824
+ return fetcher;
4825
+ } else {
4826
+ let fetcher: FetcherStates["Loading"] = {
4827
+ state: "loading",
4828
+ formMethod: undefined,
4829
+ formAction: undefined,
4830
+ formEncType: undefined,
4831
+ formData: undefined,
4832
+ json: undefined,
4833
+ text: undefined,
4834
+ data,
4835
+ };
4836
+ return fetcher;
4837
+ }
4838
+ }
4839
+
4840
+ function getSubmittingFetcher(
4841
+ submission: Submission,
4842
+ existingFetcher?: Fetcher
4843
+ ): FetcherStates["Submitting"] {
4844
+ let fetcher: FetcherStates["Submitting"] = {
4845
+ state: "submitting",
4846
+ formMethod: submission.formMethod,
4847
+ formAction: submission.formAction,
4848
+ formEncType: submission.formEncType,
4849
+ formData: submission.formData,
4850
+ json: submission.json,
4851
+ text: submission.text,
4852
+ data: existingFetcher ? existingFetcher.data : undefined,
4853
+ };
4854
+ return fetcher;
4855
+ }
4856
+
4857
+ function getDoneFetcher(data: Fetcher["data"]): FetcherStates["Idle"] {
4858
+ let fetcher: FetcherStates["Idle"] = {
4859
+ state: "idle",
4860
+ formMethod: undefined,
4861
+ formAction: undefined,
4862
+ formEncType: undefined,
4863
+ formData: undefined,
4864
+ json: undefined,
4865
+ text: undefined,
4866
+ data,
4867
+ };
4868
+ return fetcher;
4869
+ }
4870
+
4871
+ function restoreAppliedTransitions(
4872
+ _window: Window,
4873
+ transitions: Map<string, Set<string>>
4874
+ ) {
4875
+ try {
4876
+ let sessionPositions = _window.sessionStorage.getItem(
4877
+ TRANSITIONS_STORAGE_KEY
4878
+ );
4879
+ if (sessionPositions) {
4880
+ let json = JSON.parse(sessionPositions);
4881
+ for (let [k, v] of Object.entries(json || {})) {
4882
+ if (v && Array.isArray(v)) {
4883
+ transitions.set(k, new Set(v || []));
4884
+ }
4885
+ }
4886
+ }
4887
+ } catch (e) {
4888
+ // no-op, use default empty object
4889
+ }
4890
+ }
4891
+
4892
+ function persistAppliedTransitions(
4893
+ _window: Window,
4894
+ transitions: Map<string, Set<string>>
4895
+ ) {
4896
+ if (transitions.size > 0) {
4897
+ let json: Record<string, string[]> = {};
4898
+ for (let [k, v] of transitions) {
4899
+ json[k] = [...v];
4900
+ }
4901
+ try {
4902
+ _window.sessionStorage.setItem(
4903
+ TRANSITIONS_STORAGE_KEY,
4904
+ JSON.stringify(json)
4905
+ );
4906
+ } catch (error) {
4907
+ warning(
4908
+ false,
4909
+ `Failed to save applied view transitions in sessionStorage (${error}).`
4910
+ );
4911
+ }
4912
+ }
4913
+ }
4914
+
4915
+ //#endregion