@blazetrails/actionpack 0.0.0-stage → 0.1.0-alpha0.1

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 (590) hide show
  1. package/LICENSE +21 -0
  2. package/dist/abstract-controller/asset-paths.d.ts +18 -0
  3. package/dist/abstract-controller/asset-paths.js +8 -0
  4. package/dist/abstract-controller/asset-paths.js.map +1 -0
  5. package/dist/abstract-controller/base.d.ts +63 -0
  6. package/dist/abstract-controller/base.js +235 -0
  7. package/dist/abstract-controller/base.js.map +1 -0
  8. package/dist/abstract-controller/caching/fragments.d.ts +39 -0
  9. package/dist/abstract-controller/caching/fragments.js +119 -0
  10. package/dist/abstract-controller/caching/fragments.js.map +1 -0
  11. package/dist/abstract-controller/caching.d.ts +40 -0
  12. package/dist/abstract-controller/caching.js +57 -0
  13. package/dist/abstract-controller/caching.js.map +1 -0
  14. package/dist/abstract-controller/callbacks.d.ts +101 -0
  15. package/dist/abstract-controller/callbacks.js +183 -0
  16. package/dist/abstract-controller/callbacks.js.map +1 -0
  17. package/dist/abstract-controller/collector.d.ts +10 -0
  18. package/dist/abstract-controller/collector.js +69 -0
  19. package/dist/abstract-controller/collector.js.map +1 -0
  20. package/dist/abstract-controller/deprecator.d.ts +3 -0
  21. package/dist/abstract-controller/deprecator.js +7 -0
  22. package/dist/abstract-controller/deprecator.js.map +1 -0
  23. package/dist/abstract-controller/error.d.ts +5 -0
  24. package/dist/abstract-controller/error.js +5 -0
  25. package/dist/abstract-controller/error.js.map +1 -0
  26. package/dist/abstract-controller/helpers.d.ts +67 -0
  27. package/dist/abstract-controller/helpers.js +177 -0
  28. package/dist/abstract-controller/helpers.js.map +1 -0
  29. package/dist/abstract-controller/index.d.ts +16 -0
  30. package/dist/abstract-controller/index.js +15 -0
  31. package/dist/abstract-controller/index.js.map +1 -0
  32. package/dist/abstract-controller/logger.d.ts +7 -0
  33. package/dist/abstract-controller/logger.js +10 -0
  34. package/dist/abstract-controller/logger.js.map +1 -0
  35. package/dist/abstract-controller/rendering.d.ts +54 -0
  36. package/dist/abstract-controller/rendering.js +116 -0
  37. package/dist/abstract-controller/rendering.js.map +1 -0
  38. package/dist/abstract-controller/trailties/routes-helpers.d.ts +34 -0
  39. package/dist/abstract-controller/trailties/routes-helpers.js +149 -0
  40. package/dist/abstract-controller/trailties/routes-helpers.js.map +1 -0
  41. package/dist/abstract-controller/translation.d.ts +29 -0
  42. package/dist/abstract-controller/translation.js +31 -0
  43. package/dist/abstract-controller/translation.js.map +1 -0
  44. package/dist/abstract-controller/url-for.d.ts +24 -0
  45. package/dist/abstract-controller/url-for.js +33 -0
  46. package/dist/abstract-controller/url-for.js.map +1 -0
  47. package/dist/action-controller/api/api-rendering.d.ts +6 -0
  48. package/dist/action-controller/api/api-rendering.js +16 -0
  49. package/dist/action-controller/api/api-rendering.js.map +1 -0
  50. package/dist/action-controller/api.d.ts +66 -0
  51. package/dist/action-controller/api.js +73 -0
  52. package/dist/action-controller/api.js.map +1 -0
  53. package/dist/action-controller/base.d.ts +416 -0
  54. package/dist/action-controller/base.js +153 -0
  55. package/dist/action-controller/base.js.map +1 -0
  56. package/dist/action-controller/caching.d.ts +19 -0
  57. package/dist/action-controller/caching.js +75 -0
  58. package/dist/action-controller/caching.js.map +1 -0
  59. package/dist/action-controller/deprecator.d.ts +4 -0
  60. package/dist/action-controller/deprecator.js +7 -0
  61. package/dist/action-controller/deprecator.js.map +1 -0
  62. package/dist/action-controller/form-builder.d.ts +17 -0
  63. package/dist/action-controller/form-builder.js +18 -0
  64. package/dist/action-controller/form-builder.js.map +1 -0
  65. package/dist/action-controller/index.d.ts +31 -0
  66. package/dist/action-controller/index.js +28 -0
  67. package/dist/action-controller/index.js.map +1 -0
  68. package/dist/action-controller/log-subscriber.d.ts +17 -0
  69. package/dist/action-controller/log-subscriber.js +111 -0
  70. package/dist/action-controller/log-subscriber.js.map +1 -0
  71. package/dist/action-controller/metal/allow-browser.d.ts +71 -0
  72. package/dist/action-controller/metal/allow-browser.js +128 -0
  73. package/dist/action-controller/metal/allow-browser.js.map +1 -0
  74. package/dist/action-controller/metal/basic-implicit-render.d.ts +13 -0
  75. package/dist/action-controller/metal/basic-implicit-render.js +14 -0
  76. package/dist/action-controller/metal/basic-implicit-render.js.map +1 -0
  77. package/dist/action-controller/metal/conditional-get.d.ts +57 -0
  78. package/dist/action-controller/metal/conditional-get.js +96 -0
  79. package/dist/action-controller/metal/conditional-get.js.map +1 -0
  80. package/dist/action-controller/metal/content-security-policy.d.ts +37 -0
  81. package/dist/action-controller/metal/content-security-policy.js +54 -0
  82. package/dist/action-controller/metal/content-security-policy.js.map +1 -0
  83. package/dist/action-controller/metal/cookies.d.ts +15 -0
  84. package/dist/action-controller/metal/cookies.js +15 -0
  85. package/dist/action-controller/metal/cookies.js.map +1 -0
  86. package/dist/action-controller/metal/data-streaming.d.ts +48 -0
  87. package/dist/action-controller/metal/data-streaming.js +73 -0
  88. package/dist/action-controller/metal/data-streaming.js.map +1 -0
  89. package/dist/action-controller/metal/default-headers.d.ts +12 -0
  90. package/dist/action-controller/metal/default-headers.js +13 -0
  91. package/dist/action-controller/metal/default-headers.js.map +1 -0
  92. package/dist/action-controller/metal/etag-with-flash.d.ts +2 -0
  93. package/dist/action-controller/metal/etag-with-flash.js +17 -0
  94. package/dist/action-controller/metal/etag-with-flash.js.map +1 -0
  95. package/dist/action-controller/metal/etag-with-template-digest.d.ts +23 -0
  96. package/dist/action-controller/metal/etag-with-template-digest.js +41 -0
  97. package/dist/action-controller/metal/etag-with-template-digest.js.map +1 -0
  98. package/dist/action-controller/metal/exceptions.d.ts +50 -0
  99. package/dist/action-controller/metal/exceptions.js +86 -0
  100. package/dist/action-controller/metal/exceptions.js.map +1 -0
  101. package/dist/action-controller/metal/flash.d.ts +42 -0
  102. package/dist/action-controller/metal/flash.js +59 -0
  103. package/dist/action-controller/metal/flash.js.map +1 -0
  104. package/dist/action-controller/metal/head.d.ts +18 -0
  105. package/dist/action-controller/metal/head.js +51 -0
  106. package/dist/action-controller/metal/head.js.map +1 -0
  107. package/dist/action-controller/metal/helpers.d.ts +38 -0
  108. package/dist/action-controller/metal/helpers.js +51 -0
  109. package/dist/action-controller/metal/helpers.js.map +1 -0
  110. package/dist/action-controller/metal/http-authentication.d.ts +82 -0
  111. package/dist/action-controller/metal/http-authentication.js +306 -0
  112. package/dist/action-controller/metal/http-authentication.js.map +1 -0
  113. package/dist/action-controller/metal/implicit-render.d.ts +47 -0
  114. package/dist/action-controller/metal/implicit-render.js +62 -0
  115. package/dist/action-controller/metal/implicit-render.js.map +1 -0
  116. package/dist/action-controller/metal/instrumentation.d.ts +39 -0
  117. package/dist/action-controller/metal/instrumentation.js +110 -0
  118. package/dist/action-controller/metal/instrumentation.js.map +1 -0
  119. package/dist/action-controller/metal/live.d.ts +103 -0
  120. package/dist/action-controller/metal/live.js +284 -0
  121. package/dist/action-controller/metal/live.js.map +1 -0
  122. package/dist/action-controller/metal/logging.d.ts +14 -0
  123. package/dist/action-controller/metal/logging.js +10 -0
  124. package/dist/action-controller/metal/logging.js.map +1 -0
  125. package/dist/action-controller/metal/mime-responds.d.ts +54 -0
  126. package/dist/action-controller/metal/mime-responds.js +145 -0
  127. package/dist/action-controller/metal/mime-responds.js.map +1 -0
  128. package/dist/action-controller/metal/parameter-encoding.d.ts +26 -0
  129. package/dist/action-controller/metal/parameter-encoding.js +48 -0
  130. package/dist/action-controller/metal/parameter-encoding.js.map +1 -0
  131. package/dist/action-controller/metal/params-wrapper.d.ts +96 -0
  132. package/dist/action-controller/metal/params-wrapper.js +218 -0
  133. package/dist/action-controller/metal/params-wrapper.js.map +1 -0
  134. package/dist/action-controller/metal/permissions-policy.d.ts +15 -0
  135. package/dist/action-controller/metal/permissions-policy.js +19 -0
  136. package/dist/action-controller/metal/permissions-policy.js.map +1 -0
  137. package/dist/action-controller/metal/rate-limiting.d.ts +48 -0
  138. package/dist/action-controller/metal/rate-limiting.js +32 -0
  139. package/dist/action-controller/metal/rate-limiting.js.map +1 -0
  140. package/dist/action-controller/metal/redirecting.d.ts +76 -0
  141. package/dist/action-controller/metal/redirecting.js +142 -0
  142. package/dist/action-controller/metal/redirecting.js.map +1 -0
  143. package/dist/action-controller/metal/renderers.d.ts +37 -0
  144. package/dist/action-controller/metal/renderers.js +108 -0
  145. package/dist/action-controller/metal/renderers.js.map +1 -0
  146. package/dist/action-controller/metal/rendering.d.ts +78 -0
  147. package/dist/action-controller/metal/rendering.js +154 -0
  148. package/dist/action-controller/metal/rendering.js.map +1 -0
  149. package/dist/action-controller/metal/request-forgery-protection.d.ts +269 -0
  150. package/dist/action-controller/metal/request-forgery-protection.js +488 -0
  151. package/dist/action-controller/metal/request-forgery-protection.js.map +1 -0
  152. package/dist/action-controller/metal/rescue.d.ts +16 -0
  153. package/dist/action-controller/metal/rescue.js +25 -0
  154. package/dist/action-controller/metal/rescue.js.map +1 -0
  155. package/dist/action-controller/metal/streaming.d.ts +14 -0
  156. package/dist/action-controller/metal/streaming.js +18 -0
  157. package/dist/action-controller/metal/streaming.js.map +1 -0
  158. package/dist/action-controller/metal/strong-parameters.d.ts +236 -0
  159. package/dist/action-controller/metal/strong-parameters.js +728 -0
  160. package/dist/action-controller/metal/strong-parameters.js.map +1 -0
  161. package/dist/action-controller/metal/testing.d.ts +11 -0
  162. package/dist/action-controller/metal/testing.js +20 -0
  163. package/dist/action-controller/metal/testing.js.map +1 -0
  164. package/dist/action-controller/metal/url-for.d.ts +12 -0
  165. package/dist/action-controller/metal/url-for.js +42 -0
  166. package/dist/action-controller/metal/url-for.js.map +1 -0
  167. package/dist/action-controller/metal.d.ts +68 -0
  168. package/dist/action-controller/metal.js +229 -0
  169. package/dist/action-controller/metal.js.map +1 -0
  170. package/dist/action-controller/renderer.d.ts +37 -0
  171. package/dist/action-controller/renderer.js +98 -0
  172. package/dist/action-controller/renderer.js.map +1 -0
  173. package/dist/action-controller/template-assertions.d.ts +8 -0
  174. package/dist/action-controller/template-assertions.js +8 -0
  175. package/dist/action-controller/template-assertions.js.map +1 -0
  176. package/dist/action-controller/test-case.d.ts +188 -0
  177. package/dist/action-controller/test-case.js +511 -0
  178. package/dist/action-controller/test-case.js.map +1 -0
  179. package/dist/action-controller/trailties/helpers.d.ts +9 -0
  180. package/dist/action-controller/trailties/helpers.js +23 -0
  181. package/dist/action-controller/trailties/helpers.js.map +1 -0
  182. package/dist/action-dispatch/action-dispatch.d.ts +4 -0
  183. package/dist/action-dispatch/action-dispatch.js +6 -0
  184. package/dist/action-dispatch/action-dispatch.js.map +1 -0
  185. package/dist/action-dispatch/constants.d.ts +11 -0
  186. package/dist/action-dispatch/constants.js +37 -0
  187. package/dist/action-dispatch/constants.js.map +1 -0
  188. package/dist/action-dispatch/deprecator.d.ts +23 -0
  189. package/dist/action-dispatch/deprecator.js +26 -0
  190. package/dist/action-dispatch/deprecator.js.map +1 -0
  191. package/dist/action-dispatch/http/cache.d.ts +73 -0
  192. package/dist/action-dispatch/http/cache.js +287 -0
  193. package/dist/action-dispatch/http/cache.js.map +1 -0
  194. package/dist/action-dispatch/http/content-disposition.d.ts +14 -0
  195. package/dist/action-dispatch/http/content-disposition.js +39 -0
  196. package/dist/action-dispatch/http/content-disposition.js.map +1 -0
  197. package/dist/action-dispatch/http/content-security-policy.d.ts +114 -0
  198. package/dist/action-dispatch/http/content-security-policy.js +426 -0
  199. package/dist/action-dispatch/http/content-security-policy.js.map +1 -0
  200. package/dist/action-dispatch/http/filter-parameters.d.ts +36 -0
  201. package/dist/action-dispatch/http/filter-parameters.js +69 -0
  202. package/dist/action-dispatch/http/filter-parameters.js.map +1 -0
  203. package/dist/action-dispatch/http/filter-redirect.d.ts +20 -0
  204. package/dist/action-dispatch/http/filter-redirect.js +54 -0
  205. package/dist/action-dispatch/http/filter-redirect.js.map +1 -0
  206. package/dist/action-dispatch/http/headers.d.ts +18 -0
  207. package/dist/action-dispatch/http/headers.js +87 -0
  208. package/dist/action-dispatch/http/headers.js.map +1 -0
  209. package/dist/action-dispatch/http/index.d.ts +16 -0
  210. package/dist/action-dispatch/http/index.js +16 -0
  211. package/dist/action-dispatch/http/index.js.map +1 -0
  212. package/dist/action-dispatch/http/mime-negotiation.d.ts +38 -0
  213. package/dist/action-dispatch/http/mime-negotiation.js +151 -0
  214. package/dist/action-dispatch/http/mime-negotiation.js.map +1 -0
  215. package/dist/action-dispatch/http/mime-type.d.ts +139 -0
  216. package/dist/action-dispatch/http/mime-type.js +416 -0
  217. package/dist/action-dispatch/http/mime-type.js.map +1 -0
  218. package/dist/action-dispatch/http/mime-types.d.ts +7 -0
  219. package/dist/action-dispatch/http/mime-types.js +46 -0
  220. package/dist/action-dispatch/http/mime-types.js.map +1 -0
  221. package/dist/action-dispatch/http/param-builder.d.ts +47 -0
  222. package/dist/action-dispatch/http/param-builder.js +255 -0
  223. package/dist/action-dispatch/http/param-builder.js.map +1 -0
  224. package/dist/action-dispatch/http/param-error.d.ts +14 -0
  225. package/dist/action-dispatch/http/param-error.js +34 -0
  226. package/dist/action-dispatch/http/param-error.js.map +1 -0
  227. package/dist/action-dispatch/http/parameters.d.ts +48 -0
  228. package/dist/action-dispatch/http/parameters.js +136 -0
  229. package/dist/action-dispatch/http/parameters.js.map +1 -0
  230. package/dist/action-dispatch/http/permissions-policy.d.ts +58 -0
  231. package/dist/action-dispatch/http/permissions-policy.js +289 -0
  232. package/dist/action-dispatch/http/permissions-policy.js.map +1 -0
  233. package/dist/action-dispatch/http/query-parser.d.ts +9 -0
  234. package/dist/action-dispatch/http/query-parser.js +63 -0
  235. package/dist/action-dispatch/http/query-parser.js.map +1 -0
  236. package/dist/action-dispatch/http/rack-cache.d.ts +39 -0
  237. package/dist/action-dispatch/http/rack-cache.js +67 -0
  238. package/dist/action-dispatch/http/rack-cache.js.map +1 -0
  239. package/dist/action-dispatch/http/request.d.ts +239 -0
  240. package/dist/action-dispatch/http/request.js +554 -0
  241. package/dist/action-dispatch/http/request.js.map +1 -0
  242. package/dist/action-dispatch/http/response.d.ts +226 -0
  243. package/dist/action-dispatch/http/response.js +658 -0
  244. package/dist/action-dispatch/http/response.js.map +1 -0
  245. package/dist/action-dispatch/http/upload.d.ts +26 -0
  246. package/dist/action-dispatch/http/upload.js +53 -0
  247. package/dist/action-dispatch/http/upload.js.map +1 -0
  248. package/dist/action-dispatch/http/url.d.ts +55 -0
  249. package/dist/action-dispatch/http/url.js +218 -0
  250. package/dist/action-dispatch/http/url.js.map +1 -0
  251. package/dist/action-dispatch/index.d.ts +48 -0
  252. package/dist/action-dispatch/index.js +50 -0
  253. package/dist/action-dispatch/index.js.map +1 -0
  254. package/dist/action-dispatch/journey/formatter.d.ts +57 -0
  255. package/dist/action-dispatch/journey/formatter.js +247 -0
  256. package/dist/action-dispatch/journey/formatter.js.map +1 -0
  257. package/dist/action-dispatch/journey/gtg/builder.d.ts +19 -0
  258. package/dist/action-dispatch/journey/gtg/builder.js +166 -0
  259. package/dist/action-dispatch/journey/gtg/builder.js.map +1 -0
  260. package/dist/action-dispatch/journey/gtg/index.d.ts +4 -0
  261. package/dist/action-dispatch/journey/gtg/index.js +4 -0
  262. package/dist/action-dispatch/journey/gtg/index.js.map +1 -0
  263. package/dist/action-dispatch/journey/gtg/simulator.d.ts +17 -0
  264. package/dist/action-dispatch/journey/gtg/simulator.js +36 -0
  265. package/dist/action-dispatch/journey/gtg/simulator.js.map +1 -0
  266. package/dist/action-dispatch/journey/gtg/transition-table.d.ts +38 -0
  267. package/dist/action-dispatch/journey/gtg/transition-table.js +258 -0
  268. package/dist/action-dispatch/journey/gtg/transition-table.js.map +1 -0
  269. package/dist/action-dispatch/journey/index.d.ts +15 -0
  270. package/dist/action-dispatch/journey/index.js +15 -0
  271. package/dist/action-dispatch/journey/index.js.map +1 -0
  272. package/dist/action-dispatch/journey/nfa/dot.d.ts +8 -0
  273. package/dist/action-dispatch/journey/nfa/dot.js +15 -0
  274. package/dist/action-dispatch/journey/nfa/dot.js.map +1 -0
  275. package/dist/action-dispatch/journey/nodes/node.d.ts +99 -0
  276. package/dist/action-dispatch/journey/nodes/node.js +223 -0
  277. package/dist/action-dispatch/journey/nodes/node.js.map +1 -0
  278. package/dist/action-dispatch/journey/parser.d.ts +25 -0
  279. package/dist/action-dispatch/journey/parser.js +96 -0
  280. package/dist/action-dispatch/journey/parser.js.map +1 -0
  281. package/dist/action-dispatch/journey/path/index.d.ts +2 -0
  282. package/dist/action-dispatch/journey/path/index.js +2 -0
  283. package/dist/action-dispatch/journey/path/index.js.map +1 -0
  284. package/dist/action-dispatch/journey/path/pattern.d.ts +66 -0
  285. package/dist/action-dispatch/journey/path/pattern.js +268 -0
  286. package/dist/action-dispatch/journey/path/pattern.js.map +1 -0
  287. package/dist/action-dispatch/journey/route.d.ts +151 -0
  288. package/dist/action-dispatch/journey/route.js +276 -0
  289. package/dist/action-dispatch/journey/route.js.map +1 -0
  290. package/dist/action-dispatch/journey/router/utils.d.ts +29 -0
  291. package/dist/action-dispatch/journey/router/utils.js +72 -0
  292. package/dist/action-dispatch/journey/router/utils.js.map +1 -0
  293. package/dist/action-dispatch/journey/router.d.ts +40 -0
  294. package/dist/action-dispatch/journey/router.js +146 -0
  295. package/dist/action-dispatch/journey/router.js.map +1 -0
  296. package/dist/action-dispatch/journey/routes.d.ts +29 -0
  297. package/dist/action-dispatch/journey/routes.js +76 -0
  298. package/dist/action-dispatch/journey/routes.js.map +1 -0
  299. package/dist/action-dispatch/journey/scanner.d.ts +28 -0
  300. package/dist/action-dispatch/journey/scanner.js +90 -0
  301. package/dist/action-dispatch/journey/scanner.js.map +1 -0
  302. package/dist/action-dispatch/journey/visitors.d.ts +110 -0
  303. package/dist/action-dispatch/journey/visitors.js +331 -0
  304. package/dist/action-dispatch/journey/visitors.js.map +1 -0
  305. package/dist/action-dispatch/journey/visualizer/fsm.css +30 -0
  306. package/dist/action-dispatch/journey/visualizer/fsm.js +159 -0
  307. package/dist/action-dispatch/journey/visualizer/index.html.tse +52 -0
  308. package/dist/action-dispatch/journey/visualizer/index.html.tse.js +61 -0
  309. package/dist/action-dispatch/journey/visualizer/index.html.tse.js.map +1 -0
  310. package/dist/action-dispatch/log-subscriber.d.ts +5 -0
  311. package/dist/action-dispatch/log-subscriber.js +18 -0
  312. package/dist/action-dispatch/log-subscriber.js.map +1 -0
  313. package/dist/action-dispatch/middleware/actionable-exceptions.d.ts +14 -0
  314. package/dist/action-dispatch/middleware/actionable-exceptions.js +56 -0
  315. package/dist/action-dispatch/middleware/actionable-exceptions.js.map +1 -0
  316. package/dist/action-dispatch/middleware/assume-ssl.d.ts +9 -0
  317. package/dist/action-dispatch/middleware/assume-ssl.js +15 -0
  318. package/dist/action-dispatch/middleware/assume-ssl.js.map +1 -0
  319. package/dist/action-dispatch/middleware/callbacks.d.ts +15 -0
  320. package/dist/action-dispatch/middleware/callbacks.js +32 -0
  321. package/dist/action-dispatch/middleware/callbacks.js.map +1 -0
  322. package/dist/action-dispatch/middleware/cookies.d.ts +277 -0
  323. package/dist/action-dispatch/middleware/cookies.js +583 -0
  324. package/dist/action-dispatch/middleware/cookies.js.map +1 -0
  325. package/dist/action-dispatch/middleware/debug-exceptions.d.ts +53 -0
  326. package/dist/action-dispatch/middleware/debug-exceptions.js +218 -0
  327. package/dist/action-dispatch/middleware/debug-exceptions.js.map +1 -0
  328. package/dist/action-dispatch/middleware/debug-locks.d.ts +14 -0
  329. package/dist/action-dispatch/middleware/debug-locks.js +111 -0
  330. package/dist/action-dispatch/middleware/debug-locks.js.map +1 -0
  331. package/dist/action-dispatch/middleware/debug-view.d.ts +16 -0
  332. package/dist/action-dispatch/middleware/debug-view.js +81 -0
  333. package/dist/action-dispatch/middleware/debug-view.js.map +1 -0
  334. package/dist/action-dispatch/middleware/exception-wrapper.d.ts +98 -0
  335. package/dist/action-dispatch/middleware/exception-wrapper.js +323 -0
  336. package/dist/action-dispatch/middleware/exception-wrapper.js.map +1 -0
  337. package/dist/action-dispatch/middleware/executor.d.ts +25 -0
  338. package/dist/action-dispatch/middleware/executor.js +45 -0
  339. package/dist/action-dispatch/middleware/executor.js.map +1 -0
  340. package/dist/action-dispatch/middleware/flash.d.ts +93 -0
  341. package/dist/action-dispatch/middleware/flash.js +217 -0
  342. package/dist/action-dispatch/middleware/flash.js.map +1 -0
  343. package/dist/action-dispatch/middleware/host-authorization.d.ts +65 -0
  344. package/dist/action-dispatch/middleware/host-authorization.js +167 -0
  345. package/dist/action-dispatch/middleware/host-authorization.js.map +1 -0
  346. package/dist/action-dispatch/middleware/public-exceptions.d.ts +10 -0
  347. package/dist/action-dispatch/middleware/public-exceptions.js +66 -0
  348. package/dist/action-dispatch/middleware/public-exceptions.js.map +1 -0
  349. package/dist/action-dispatch/middleware/reloader.d.ts +4 -0
  350. package/dist/action-dispatch/middleware/reloader.js +4 -0
  351. package/dist/action-dispatch/middleware/reloader.js.map +1 -0
  352. package/dist/action-dispatch/middleware/remote-ip.d.ts +37 -0
  353. package/dist/action-dispatch/middleware/remote-ip.js +189 -0
  354. package/dist/action-dispatch/middleware/remote-ip.js.map +1 -0
  355. package/dist/action-dispatch/middleware/request-id.d.ts +19 -0
  356. package/dist/action-dispatch/middleware/request-id.js +30 -0
  357. package/dist/action-dispatch/middleware/request-id.js.map +1 -0
  358. package/dist/action-dispatch/middleware/server-timing.d.ts +25 -0
  359. package/dist/action-dispatch/middleware/server-timing.js +73 -0
  360. package/dist/action-dispatch/middleware/server-timing.js.map +1 -0
  361. package/dist/action-dispatch/middleware/session/abstract-store.d.ts +55 -0
  362. package/dist/action-dispatch/middleware/session/abstract-store.js +127 -0
  363. package/dist/action-dispatch/middleware/session/abstract-store.js.map +1 -0
  364. package/dist/action-dispatch/middleware/session/cache-store.d.ts +24 -0
  365. package/dist/action-dispatch/middleware/session/cache-store.js +63 -0
  366. package/dist/action-dispatch/middleware/session/cache-store.js.map +1 -0
  367. package/dist/action-dispatch/middleware/session/cookie-store.d.ts +58 -0
  368. package/dist/action-dispatch/middleware/session/cookie-store.js +102 -0
  369. package/dist/action-dispatch/middleware/session/cookie-store.js.map +1 -0
  370. package/dist/action-dispatch/middleware/session/index.d.ts +5 -0
  371. package/dist/action-dispatch/middleware/session/index.js +5 -0
  372. package/dist/action-dispatch/middleware/session/index.js.map +1 -0
  373. package/dist/action-dispatch/middleware/session/mem-cache-store.d.ts +21 -0
  374. package/dist/action-dispatch/middleware/session/mem-cache-store.js +26 -0
  375. package/dist/action-dispatch/middleware/session/mem-cache-store.js.map +1 -0
  376. package/dist/action-dispatch/middleware/show-exceptions.d.ts +15 -0
  377. package/dist/action-dispatch/middleware/show-exceptions.js +84 -0
  378. package/dist/action-dispatch/middleware/show-exceptions.js.map +1 -0
  379. package/dist/action-dispatch/middleware/ssl.d.ts +54 -0
  380. package/dist/action-dispatch/middleware/ssl.js +135 -0
  381. package/dist/action-dispatch/middleware/ssl.js.map +1 -0
  382. package/dist/action-dispatch/middleware/stack.d.ts +68 -0
  383. package/dist/action-dispatch/middleware/stack.js +188 -0
  384. package/dist/action-dispatch/middleware/stack.js.map +1 -0
  385. package/dist/action-dispatch/middleware/static.d.ts +60 -0
  386. package/dist/action-dispatch/middleware/static.js +168 -0
  387. package/dist/action-dispatch/middleware/static.js.map +1 -0
  388. package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse +13 -0
  389. package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse.js +47 -0
  390. package/dist/action-dispatch/middleware/templates/rescues/_actions.html.tse.js.map +1 -0
  391. package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse +0 -0
  392. package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse.js +11 -0
  393. package/dist/action-dispatch/middleware/templates/rescues/_actions.text.tse.js.map +1 -0
  394. package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse +23 -0
  395. package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse.js +60 -0
  396. package/dist/action-dispatch/middleware/templates/rescues/_message_and_suggestions.html.tse.js.map +1 -0
  397. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse +17 -0
  398. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse.js +46 -0
  399. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.html.tse.js.map +1 -0
  400. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse +19 -0
  401. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse.js +42 -0
  402. package/dist/action-dispatch/middleware/templates/rescues/_request_and_response.text.tse.js.map +1 -0
  403. package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse +33 -0
  404. package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse.js +70 -0
  405. package/dist/action-dispatch/middleware/templates/rescues/_source.html.tse.js.map +1 -0
  406. package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse +8 -0
  407. package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse.js +41 -0
  408. package/dist/action-dispatch/middleware/templates/rescues/_source.text.tse.js.map +1 -0
  409. package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse +62 -0
  410. package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse.js +78 -0
  411. package/dist/action-dispatch/middleware/templates/rescues/_trace.html.tse.js.map +1 -0
  412. package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse +9 -0
  413. package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse.js +23 -0
  414. package/dist/action-dispatch/middleware/templates/rescues/_trace.text.tse.js.map +1 -0
  415. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse +12 -0
  416. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse.js +24 -0
  417. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.html.tse.js.map +1 -0
  418. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse +9 -0
  419. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse.js +20 -0
  420. package/dist/action-dispatch/middleware/templates/rescues/blocked_host.text.tse.js.map +1 -0
  421. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse +35 -0
  422. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse.js +77 -0
  423. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.html.tse.js.map +1 -0
  424. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse +9 -0
  425. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse.js +48 -0
  426. package/dist/action-dispatch/middleware/templates/rescues/diagnostics.text.tse.js.map +1 -0
  427. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse +24 -0
  428. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse.js +61 -0
  429. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.html.tse.js.map +1 -0
  430. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse +16 -0
  431. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse.js +55 -0
  432. package/dist/action-dispatch/middleware/templates/rescues/invalid_statement.text.tse.js.map +1 -0
  433. package/dist/action-dispatch/middleware/templates/rescues/layout.tse +284 -0
  434. package/dist/action-dispatch/middleware/templates/rescues/layout.tse.js +16 -0
  435. package/dist/action-dispatch/middleware/templates/rescues/layout.tse.js.map +1 -0
  436. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse +23 -0
  437. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse.js +45 -0
  438. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.html.tse.js.map +1 -0
  439. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse +3 -0
  440. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse.js +14 -0
  441. package/dist/action-dispatch/middleware/templates/rescues/missing_exact_template.text.tse.js.map +1 -0
  442. package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse +11 -0
  443. package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse.js +41 -0
  444. package/dist/action-dispatch/middleware/templates/rescues/missing_template.html.tse.js.map +1 -0
  445. package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse +3 -0
  446. package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse.js +14 -0
  447. package/dist/action-dispatch/middleware/templates/rescues/missing_template.text.tse.js.map +1 -0
  448. package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse +32 -0
  449. package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse.js +58 -0
  450. package/dist/action-dispatch/middleware/templates/rescues/routing_error.html.tse.js.map +1 -0
  451. package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse +11 -0
  452. package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse.js +45 -0
  453. package/dist/action-dispatch/middleware/templates/rescues/routing_error.text.tse.js.map +1 -0
  454. package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse +20 -0
  455. package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse.js +53 -0
  456. package/dist/action-dispatch/middleware/templates/rescues/template_error.html.tse.js.map +1 -0
  457. package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse +7 -0
  458. package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse.js +46 -0
  459. package/dist/action-dispatch/middleware/templates/rescues/template_error.text.tse.js.map +1 -0
  460. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse +6 -0
  461. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse.js +35 -0
  462. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.html.tse.js.map +1 -0
  463. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse +3 -0
  464. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse.js +14 -0
  465. package/dist/action-dispatch/middleware/templates/rescues/unknown_action.text.tse.js.map +1 -0
  466. package/dist/action-dispatch/middleware/templates/routes/_route.html.tse +19 -0
  467. package/dist/action-dispatch/middleware/templates/routes/_route.html.tse.js +51 -0
  468. package/dist/action-dispatch/middleware/templates/routes/_route.html.tse.js.map +1 -0
  469. package/dist/action-dispatch/middleware/templates/routes/_table.html.tse +232 -0
  470. package/dist/action-dispatch/middleware/templates/routes/_table.html.tse.js +46 -0
  471. package/dist/action-dispatch/middleware/templates/routes/_table.html.tse.js.map +1 -0
  472. package/dist/action-dispatch/request/index.d.ts +3 -0
  473. package/dist/action-dispatch/request/index.js +3 -0
  474. package/dist/action-dispatch/request/index.js.map +1 -0
  475. package/dist/action-dispatch/request/session.d.ts +78 -0
  476. package/dist/action-dispatch/request/session.js +276 -0
  477. package/dist/action-dispatch/request/session.js.map +1 -0
  478. package/dist/action-dispatch/request/utils.d.ts +43 -0
  479. package/dist/action-dispatch/request/utils.js +163 -0
  480. package/dist/action-dispatch/request/utils.js.map +1 -0
  481. package/dist/action-dispatch/routing/dispatcher.d.ts +11 -0
  482. package/dist/action-dispatch/routing/dispatcher.js +3 -0
  483. package/dist/action-dispatch/routing/dispatcher.js.map +1 -0
  484. package/dist/action-dispatch/routing/endpoint.d.ts +11 -0
  485. package/dist/action-dispatch/routing/endpoint.js +26 -0
  486. package/dist/action-dispatch/routing/endpoint.js.map +1 -0
  487. package/dist/action-dispatch/routing/index.d.ts +10 -0
  488. package/dist/action-dispatch/routing/index.js +9 -0
  489. package/dist/action-dispatch/routing/index.js.map +1 -0
  490. package/dist/action-dispatch/routing/inspector.d.ts +114 -0
  491. package/dist/action-dispatch/routing/inspector.js +291 -0
  492. package/dist/action-dispatch/routing/inspector.js.map +1 -0
  493. package/dist/action-dispatch/routing/mapper.d.ts +474 -0
  494. package/dist/action-dispatch/routing/mapper.js +1656 -0
  495. package/dist/action-dispatch/routing/mapper.js.map +1 -0
  496. package/dist/action-dispatch/routing/polymorphic-routes.d.ts +69 -0
  497. package/dist/action-dispatch/routing/polymorphic-routes.js +238 -0
  498. package/dist/action-dispatch/routing/polymorphic-routes.js.map +1 -0
  499. package/dist/action-dispatch/routing/redirection.d.ts +56 -0
  500. package/dist/action-dispatch/routing/redirection.js +183 -0
  501. package/dist/action-dispatch/routing/redirection.js.map +1 -0
  502. package/dist/action-dispatch/routing/route-set.d.ts +271 -0
  503. package/dist/action-dispatch/routing/route-set.js +1081 -0
  504. package/dist/action-dispatch/routing/route-set.js.map +1 -0
  505. package/dist/action-dispatch/routing/routes-proxy.d.ts +49 -0
  506. package/dist/action-dispatch/routing/routes-proxy.js +87 -0
  507. package/dist/action-dispatch/routing/routes-proxy.js.map +1 -0
  508. package/dist/action-dispatch/routing/url-for.d.ts +50 -0
  509. package/dist/action-dispatch/routing/url-for.js +126 -0
  510. package/dist/action-dispatch/routing/url-for.js.map +1 -0
  511. package/dist/action-dispatch/system-test-case.d.ts +58 -0
  512. package/dist/action-dispatch/system-test-case.js +122 -0
  513. package/dist/action-dispatch/system-test-case.js.map +1 -0
  514. package/dist/action-dispatch/system-testing/browser.d.ts +31 -0
  515. package/dist/action-dispatch/system-testing/browser.js +93 -0
  516. package/dist/action-dispatch/system-testing/browser.js.map +1 -0
  517. package/dist/action-dispatch/system-testing/driver.d.ts +45 -0
  518. package/dist/action-dispatch/system-testing/driver.js +110 -0
  519. package/dist/action-dispatch/system-testing/driver.js.map +1 -0
  520. package/dist/action-dispatch/system-testing/server.d.ts +27 -0
  521. package/dist/action-dispatch/system-testing/server.js +71 -0
  522. package/dist/action-dispatch/system-testing/server.js.map +1 -0
  523. package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.d.ts +70 -0
  524. package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.js +142 -0
  525. package/dist/action-dispatch/system-testing/test-helpers/screenshot-helper.js.map +1 -0
  526. package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.d.ts +15 -0
  527. package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.js +24 -0
  528. package/dist/action-dispatch/system-testing/test-helpers/setup-and-teardown.js.map +1 -0
  529. package/dist/action-dispatch/testing/assertion-response.d.ts +7 -0
  530. package/dist/action-dispatch/testing/assertion-response.js +44 -0
  531. package/dist/action-dispatch/testing/assertion-response.js.map +1 -0
  532. package/dist/action-dispatch/testing/assertions/response.d.ts +67 -0
  533. package/dist/action-dispatch/testing/assertions/response.js +94 -0
  534. package/dist/action-dispatch/testing/assertions/response.js.map +1 -0
  535. package/dist/action-dispatch/testing/assertions/routing.d.ts +76 -0
  536. package/dist/action-dispatch/testing/assertions/routing.js +291 -0
  537. package/dist/action-dispatch/testing/assertions/routing.js.map +1 -0
  538. package/dist/action-dispatch/testing/assertions.d.ts +37 -0
  539. package/dist/action-dispatch/testing/assertions.js +27 -0
  540. package/dist/action-dispatch/testing/assertions.js.map +1 -0
  541. package/dist/action-dispatch/testing/index.d.ts +10 -0
  542. package/dist/action-dispatch/testing/index.js +10 -0
  543. package/dist/action-dispatch/testing/index.js.map +1 -0
  544. package/dist/action-dispatch/testing/integration.d.ts +203 -0
  545. package/dist/action-dispatch/testing/integration.js +552 -0
  546. package/dist/action-dispatch/testing/integration.js.map +1 -0
  547. package/dist/action-dispatch/testing/request-encoder.d.ts +28 -0
  548. package/dist/action-dispatch/testing/request-encoder.js +76 -0
  549. package/dist/action-dispatch/testing/request-encoder.js.map +1 -0
  550. package/dist/action-dispatch/testing/test-helpers/page-dump-helper.d.ts +22 -0
  551. package/dist/action-dispatch/testing/test-helpers/page-dump-helper.js +53 -0
  552. package/dist/action-dispatch/testing/test-helpers/page-dump-helper.js.map +1 -0
  553. package/dist/action-dispatch/testing/test-process.d.ts +46 -0
  554. package/dist/action-dispatch/testing/test-process.js +45 -0
  555. package/dist/action-dispatch/testing/test-process.js.map +1 -0
  556. package/dist/action-dispatch/testing/test-request.d.ts +26 -0
  557. package/dist/action-dispatch/testing/test-request.js +78 -0
  558. package/dist/action-dispatch/testing/test-request.js.map +1 -0
  559. package/dist/action-dispatch/testing/test-response.d.ts +16 -0
  560. package/dist/action-dispatch/testing/test-response.js +29 -0
  561. package/dist/action-dispatch/testing/test-response.js.map +1 -0
  562. package/dist/action-pack/gem-version.d.ts +9 -0
  563. package/dist/action-pack/gem-version.js +15 -0
  564. package/dist/action-pack/gem-version.js.map +1 -0
  565. package/dist/action-pack/index.d.ts +3 -0
  566. package/dist/action-pack/index.js +3 -0
  567. package/dist/action-pack/index.js.map +1 -0
  568. package/dist/action-pack/version.d.ts +2 -0
  569. package/dist/action-pack/version.js +5 -0
  570. package/dist/action-pack/version.js.map +1 -0
  571. package/dist/constants.excluded.generated.d.ts +2 -0
  572. package/dist/constants.excluded.generated.js +57 -0
  573. package/dist/constants.excluded.generated.js.map +1 -0
  574. package/dist/constants.generated.d.ts +2 -0
  575. package/dist/constants.generated.js +469 -0
  576. package/dist/constants.generated.js.map +1 -0
  577. package/dist/index.d.ts +9 -0
  578. package/dist/index.js +8 -0
  579. package/dist/index.js.map +1 -0
  580. package/dist/namespaces.d.ts +173 -0
  581. package/dist/namespaces.js +99 -0
  582. package/dist/namespaces.js.map +1 -0
  583. package/dist/system-testing.d.ts +5 -0
  584. package/dist/system-testing.js +5 -0
  585. package/dist/system-testing.js.map +1 -0
  586. package/dist/testing.d.ts +7 -0
  587. package/dist/testing.js +18 -0
  588. package/dist/testing.js.map +1 -0
  589. package/package.json +92 -3
  590. package/README.md +0 -3
@@ -0,0 +1,1081 @@
1
+ import { Concern, extractOptionsBang, isBlank, isPlainObject, symbolizeKeys, toParam, } from "@blazetrails/activesupport";
2
+ import { MockRequest } from "@blazetrails/rack";
3
+ import { chomp, eachKey, except, extend, include, InvalidURIError, merge, block, mergeBang, URI, rbAnyToS, rbInspect, rbObjClone, rbDeclareIvar, rbObjIvarGet, rbObjIvarSet, rbObjRespondTo, rbModMethodDefined, rbModDefineMethod, rbModUndefMethod, included, update, RFC2396_PARSER, classModule, rbClearMethodCache, includedModules, } from "@blazetrails/ruby-compat";
4
+ import { Routing } from "../../namespaces.js";
5
+ import { Mapper } from "./mapper.js";
6
+ import { isIncludedMember } from "../../abstract-controller/trailties/routes-helpers.js";
7
+ import { deprecator } from "../deprecator.js";
8
+ import { Router as JourneyRouter, } from "../journey/router.js";
9
+ import { polymorphicUrl as polymorphicUrlFn, } from "./polymorphic-routes.js";
10
+ import { fullUrlFor as fullUrlForFn, routeFor as routeForFn, urlOptions as urlOptionsFn, _routesContext as routesContextFn, _withRoutes as withRoutesFn, UrlFor, _routesIvar, } from "./url-for.js";
11
+ import { Endpoint } from "./endpoint.js";
12
+ import { X_CASCADE } from "../constants.js";
13
+ import { RoutingError, UrlGenerationError } from "../../action-controller/metal/exceptions.js";
14
+ import { RoutesProxy } from "./routes-proxy.js";
15
+ import { Parameters } from "../../action-controller/metal/strong-parameters.js";
16
+ import { Request as AdRequest } from "../http/request.js";
17
+ import { camelize, NameError, squish } from "@blazetrails/activesupport";
18
+ import { ArgumentError } from "@blazetrails/activemodel";
19
+ import { Utils } from "../journey/router/utils.js";
20
+ import { URL } from "../http/url.js";
21
+ import { Routes as JourneyRoutes } from "../journey/routes.js";
22
+ import { Formatter as JourneyFormatter, } from "../journey/formatter.js";
23
+ /** @internal */
24
+ function toS(v) {
25
+ return v == null ? "" : String(v);
26
+ }
27
+ function shallowEqual(a, b) {
28
+ const ka = Object.keys(a);
29
+ if (ka.length !== Object.keys(b).length)
30
+ return false;
31
+ for (const k of ka)
32
+ if (!Object.hasOwn(b, k) || a[k] !== b[k])
33
+ return false;
34
+ return true;
35
+ }
36
+ /** @internal */
37
+ export class CustomUrlHelper {
38
+ name;
39
+ defaults;
40
+ block;
41
+ constructor(name, defaults, block) {
42
+ this.name = name;
43
+ this.defaults = defaults;
44
+ this.block = block;
45
+ }
46
+ call(t, args, onlyPath = false) {
47
+ const options = extractOptionsBang(args);
48
+ const url = t.fullUrlFor(this.evalBlock(t, args, options));
49
+ if (onlyPath) {
50
+ return "/" + (url.match(/(?<!\/)\/(?!\/)(.*)$/s)?.[1] ?? "");
51
+ }
52
+ else {
53
+ return url;
54
+ }
55
+ }
56
+ /** @internal */
57
+ evalBlock(t, args, options) {
58
+ return this.block.apply(t, [...args, this.mergeDefaults(options)]);
59
+ }
60
+ /** @internal */
61
+ mergeDefaults(options) {
62
+ return this.defaults ? { ...this.defaults, ...options } : options;
63
+ }
64
+ }
65
+ export class Generator {
66
+ options;
67
+ recall;
68
+ set;
69
+ namedRoute;
70
+ constructor(namedRoute, options, recall, set) {
71
+ this.namedRoute = namedRoute;
72
+ this.options = options;
73
+ this.recall = recall;
74
+ this.set = set;
75
+ this.normalizeOptionsBang();
76
+ this.normalizeControllerActionIdBang();
77
+ this.useRelativeControllerBang();
78
+ this.normalizeControllerBang();
79
+ }
80
+ get controller() {
81
+ return this.options["controller"];
82
+ }
83
+ get currentController() {
84
+ return this.recall["controller"];
85
+ }
86
+ useRecallFor(key) {
87
+ if (this.recall[key] != null &&
88
+ this.recall[key] !== false &&
89
+ (!Object.hasOwn(this.options, key) || this.options[key] === this.recall[key])) {
90
+ if (!this.isNamedRouteExists() || this.segmentKeys().includes(key)) {
91
+ return (this.options[key] = this.recall[key]);
92
+ }
93
+ }
94
+ return null;
95
+ }
96
+ normalizeOptionsBang() {
97
+ if (this.options["controller"] != null && this.options["controller"] !== false) {
98
+ if (this.options["action"] == null || this.options["action"] === false) {
99
+ this.options["action"] = "index";
100
+ }
101
+ this.options["controller"] = toS(this.options["controller"]);
102
+ }
103
+ if ("action" in this.options) {
104
+ const action = this.options["action"];
105
+ this.options["action"] = toS(action != null && action !== false ? action : "index");
106
+ }
107
+ }
108
+ normalizeControllerActionIdBang() {
109
+ const controller = this.useRecallFor("controller");
110
+ if (controller == null || controller === false)
111
+ return;
112
+ const action = this.useRecallFor("action");
113
+ if (action == null || action === false)
114
+ return;
115
+ this.useRecallFor("id");
116
+ }
117
+ useRelativeControllerBang() {
118
+ if (this.namedRoute == null &&
119
+ this.isDifferentController() &&
120
+ !this.controller.startsWith("/")) {
121
+ const oldParts = this.currentController.split("/");
122
+ const size = (this.controller.match(/\//g) ?? []).length + 1;
123
+ const parts = [...oldParts.slice(0, -size), this.controller];
124
+ this.options["controller"] = parts.join("/");
125
+ }
126
+ }
127
+ normalizeControllerBang() {
128
+ if (this.controller != null && this.controller !== false) {
129
+ if (this.controller.startsWith("/")) {
130
+ this.options["controller"] = this.controller.slice(1);
131
+ }
132
+ else {
133
+ this.options["controller"] = this.controller;
134
+ }
135
+ }
136
+ }
137
+ generate() {
138
+ return this.set.formatter.generate(this.namedRoute ?? null, this.options, this.recall);
139
+ }
140
+ isDifferentController() {
141
+ if (this.currentController == null || this.currentController === false) {
142
+ return false;
143
+ }
144
+ return toParam(this.controller) !== toParam(this.currentController);
145
+ }
146
+ /** @internal */
147
+ isNamedRouteExists() {
148
+ return this.namedRoute != null && this.set.namedRoutes.get(this.namedRoute);
149
+ }
150
+ /** @internal */
151
+ segmentKeys() {
152
+ return this.set.namedRoutes.get(this.namedRoute).segmentKeys;
153
+ }
154
+ }
155
+ export class Dispatcher extends Endpoint {
156
+ _raiseOnNameError;
157
+ constructor(raiseOnNameError) {
158
+ super();
159
+ this._raiseOnNameError = raiseOnNameError;
160
+ }
161
+ dispatcher() {
162
+ return true;
163
+ }
164
+ async serve(req) {
165
+ try {
166
+ const params = req.pathParameters;
167
+ const controller = this._controller(req);
168
+ const res = await controller.makeResponseBang(req);
169
+ return await this._dispatch(controller, params["action"], req, res);
170
+ }
171
+ catch (error) {
172
+ if (error instanceof RoutingError) {
173
+ if (this._raiseOnNameError)
174
+ throw error;
175
+ return [404, { [X_CASCADE]: "pass" }, []];
176
+ }
177
+ throw error;
178
+ }
179
+ }
180
+ /** @internal */
181
+ _controller(req) {
182
+ try {
183
+ return req.controllerClass();
184
+ }
185
+ catch (e) {
186
+ if (e instanceof NameError)
187
+ throw new RoutingError(e.message);
188
+ throw e;
189
+ }
190
+ }
191
+ /** @internal */
192
+ async _dispatch(controller, action, req, res) {
193
+ return (await controller.dispatch(action, req, res));
194
+ }
195
+ }
196
+ export class StaticDispatcher extends Dispatcher {
197
+ _controllerClass;
198
+ constructor(controllerClass) {
199
+ super(false);
200
+ this._controllerClass = controllerClass;
201
+ }
202
+ /** @internal */
203
+ _controller(_req) {
204
+ return this._controllerClass;
205
+ }
206
+ }
207
+ export class Config {
208
+ relativeUrlRoot;
209
+ apiOnly;
210
+ defaultScope;
211
+ constructor(relativeUrlRoot = null, apiOnly = null, defaultScope = null) {
212
+ this.relativeUrlRoot = relativeUrlRoot;
213
+ this.apiOnly = apiOnly;
214
+ this.defaultScope = defaultScope;
215
+ }
216
+ }
217
+ export const MountedHelpers = class {
218
+ static [classModule] = true;
219
+ /** @internal */
220
+ static [included] = (base) => {
221
+ if (typeof base === "function") {
222
+ mountedHelpersIncluders.add(new WeakRef(base.prototype));
223
+ for (const key of Object.getOwnPropertyNames(MountedHelpers.prototype)) {
224
+ if (key.startsWith("_") && Object.hasOwn(MountedHelpers.prototype, key.slice(1))) {
225
+ rbDeclareIvar(base, `@${key}`, `_${key}`);
226
+ }
227
+ }
228
+ }
229
+ };
230
+ };
231
+ extend(MountedHelpers, Concern);
232
+ include(MountedHelpers, UrlFor);
233
+ /**
234
+ * The prototypes that included {@link MountedHelpers}, so a helper
235
+ * `define_mounted_helper` adds later reaches them as Ruby's
236
+ * `rb_include_module` reaches a module's existing includers
237
+ * (vendor/ruby/v3.3.11/class.c:1179-1215).
238
+ */
239
+ const mountedHelpersIncluders = new Set();
240
+ export class UrlHelper {
241
+ static create(route, options, routeName) {
242
+ if (this.isOptimizeHelper(route)) {
243
+ return new UrlHelper.OptimizedUrlHelper(route, options, routeName);
244
+ }
245
+ else {
246
+ return new this(route, options, routeName);
247
+ }
248
+ }
249
+ static isOptimizeHelper(route) {
250
+ return Object.keys(route.path.requirements).length === 0 && !route.isGlob();
251
+ }
252
+ routeName;
253
+ /** @internal */
254
+ options;
255
+ /** @internal */
256
+ segmentKeys;
257
+ /** @internal */
258
+ route;
259
+ constructor(route, options, routeName) {
260
+ this.options = options;
261
+ this.segmentKeys = [...new Set(route.segmentKeys)];
262
+ this.route = route;
263
+ this.routeName = routeName;
264
+ }
265
+ call(t, methodName, args, innerOptions, urlStrategy) {
266
+ const controllerOptions = t.urlOptions();
267
+ const options = { ...controllerOptions, ...this.options };
268
+ const hash = this.handlePositionalArgs(controllerOptions, innerOptions ?? {}, args, options, this.segmentKeys);
269
+ return t._routes.urlFor(hash, this.routeName, urlStrategy, methodName);
270
+ }
271
+ /** @inventedArm block — PERMANENT */
272
+ handlePositionalArgs(controllerOptions, innerOptions, args, result, pathParams) {
273
+ if (args.length > 0) {
274
+ const pathParamsSize = pathParams.includes("format")
275
+ ? pathParams.length - 1
276
+ : pathParams.length;
277
+ if (args.length < pathParamsSize) {
278
+ pathParams = pathParams.filter((k) => !Object.hasOwn(controllerOptions, k));
279
+ const supplied = {
280
+ ...(result["pathParams"] ?? {}),
281
+ ...result,
282
+ };
283
+ pathParams = pathParams.filter((k) => !Object.hasOwn(supplied, k));
284
+ }
285
+ else {
286
+ pathParams = [...pathParams];
287
+ }
288
+ eachKey(innerOptions, (key) => {
289
+ const at = pathParams.indexOf(key);
290
+ if (at !== -1 && args[at] !== null)
291
+ pathParams.splice(at, 1);
292
+ });
293
+ args.forEach((arg, index) => {
294
+ const param = pathParams[index];
295
+ if (param)
296
+ result[param] = arg;
297
+ });
298
+ }
299
+ return mergeBang(result, innerOptions, block((key, oldval, newval) => args[pathParams.indexOf(key)] === null ? oldval : newval));
300
+ }
301
+ }
302
+ export class OptimizedUrlHelper extends UrlHelper {
303
+ argSize;
304
+ /** @internal */
305
+ requiredParts;
306
+ constructor(route, options, routeName) {
307
+ super(route, options, routeName);
308
+ this.requiredParts = this.route.requiredParts;
309
+ this.argSize = this.requiredParts.length;
310
+ }
311
+ call(t, methodName, args, innerOptions, urlStrategy) {
312
+ if (args.length === this.argSize && !innerOptions && this.optimizeRoutesGeneration(t)) {
313
+ const options = { ...t.urlOptions(), ...this.options };
314
+ let path = this.optimizedHelper(args);
315
+ const trailingSlash = options["trailingSlash"];
316
+ if (trailingSlash != null && trailingSlash !== false && !path.endsWith("/"))
317
+ path += "/";
318
+ options["path"] = path;
319
+ const originalScriptName = options["originalScriptName"];
320
+ delete options["originalScriptName"];
321
+ let scriptName = t._routes.findScriptName(options);
322
+ if (originalScriptName != null && originalScriptName !== false) {
323
+ scriptName = originalScriptName + scriptName;
324
+ }
325
+ options["scriptName"] = scriptName;
326
+ return urlStrategy(options);
327
+ }
328
+ else {
329
+ return super.call(t, methodName, args, innerOptions, urlStrategy);
330
+ }
331
+ }
332
+ /** @internal */
333
+ optimizedHelper(args) {
334
+ const params = this.parameterizeArgs(args, () => {
335
+ this.raiseGenerationError(args);
336
+ });
337
+ return this.route.format(params);
338
+ }
339
+ /** @internal */
340
+ optimizeRoutesGeneration(t) {
341
+ return t.optimizeRoutesGeneration();
342
+ }
343
+ /** @internal */
344
+ parameterizeArgs(args, block) {
345
+ const params = {};
346
+ for (let i = 0; i < this.argSize; i++) {
347
+ const key = this.requiredParts[i];
348
+ const value = toParam(args[i]);
349
+ if (value == null || value === "")
350
+ block(key);
351
+ params[key] = value;
352
+ }
353
+ return params;
354
+ }
355
+ /** @internal */
356
+ raiseGenerationError(args) {
357
+ const missingKeys = [];
358
+ const params = this.parameterizeArgs(args, (missingKey) => {
359
+ missingKeys.push(missingKey);
360
+ });
361
+ const merged = { ...this.route.requirements, ...params };
362
+ const constraints = Object.fromEntries(Object.entries(merged).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
363
+ let message = `No route matches ${rbInspect(symbolizeKeys(constraints))}`;
364
+ message += `, missing required keys: ${rbInspect(missingKeys.sort().map((k) => `:${k}`))}`;
365
+ throw new UrlGenerationError(message);
366
+ }
367
+ }
368
+ UrlHelper.OptimizedUrlHelper = OptimizedUrlHelper;
369
+ const PATH = (options) => URL.pathFor(options);
370
+ const UNKNOWN = (options) => URL.urlFor(options);
371
+ export class NamedRouteCollection {
372
+ /** @internal */
373
+ _routes = new Map();
374
+ pathHelpersModule = class {
375
+ static [classModule] = true;
376
+ };
377
+ urlHelpersModule = class {
378
+ static [classModule] = true;
379
+ };
380
+ /** @internal */
381
+ pathHelpers = new Set();
382
+ /** @internal */
383
+ urlHelpers = new Set();
384
+ /** @internal */
385
+ _includers = new Set();
386
+ /** @internal */
387
+ get routes() {
388
+ return this._routes;
389
+ }
390
+ isRouteDefined(name) {
391
+ return this.pathHelpers.has(name) || this.urlHelpers.has(name);
392
+ }
393
+ helperNames() {
394
+ return [...this.pathHelpers, ...this.urlHelpers];
395
+ }
396
+ clearBang() {
397
+ for (const helper of this.pathHelpers) {
398
+ delete this.pathHelpersModule.prototype[helper];
399
+ this._removeFromIncluders(helper);
400
+ }
401
+ for (const helper of this.urlHelpers) {
402
+ delete this.urlHelpersModule.prototype[helper];
403
+ this._removeFromIncluders(helper);
404
+ }
405
+ this._routes.clear();
406
+ this.pathHelpers.clear();
407
+ this.urlHelpers.clear();
408
+ }
409
+ add(name, route) {
410
+ const pathName = camelize(`${name}_path`, "lower");
411
+ const urlName = camelize(`${name}_url`, "lower");
412
+ if (this._routes.has(name)) {
413
+ rbModUndefMethod(this.pathHelpersModule, pathName);
414
+ rbModUndefMethod(this.urlHelpersModule, urlName);
415
+ }
416
+ this._routes.set(name, route);
417
+ const helper = UrlHelper.create(route, route.defaults, name);
418
+ this.defineUrlHelper(this.pathHelpersModule, pathName, helper, PATH);
419
+ this.defineUrlHelper(this.urlHelpersModule, urlName, helper, UNKNOWN);
420
+ this.pathHelpers.add(pathName);
421
+ this.urlHelpers.add(urlName);
422
+ }
423
+ get(name) {
424
+ return this._routes.get(name);
425
+ }
426
+ isKey(name) {
427
+ if (name == null)
428
+ return false;
429
+ return this._routes.has(name);
430
+ }
431
+ clear() {
432
+ this.clearBang();
433
+ }
434
+ each(block) {
435
+ this.routes.forEach((route, name) => block(name, route));
436
+ return this;
437
+ }
438
+ names() {
439
+ return [...this._routes.keys()];
440
+ }
441
+ length() {
442
+ return this._routes.size;
443
+ }
444
+ addUrlHelper(name, defaults, block) {
445
+ const helper = new CustomUrlHelper(name, defaults, block);
446
+ const pathName = camelize(`${name}_path`, "lower");
447
+ const urlName = camelize(`${name}_url`, "lower");
448
+ this.pathHelpersModule.prototype[pathName] = function (...args) {
449
+ return helper.call(this, args, true);
450
+ };
451
+ rbClearMethodCache();
452
+ this._appendToIncluders(pathName, this.pathHelpersModule.prototype[pathName], true);
453
+ this.urlHelpersModule.prototype[urlName] = function (...args) {
454
+ return helper.call(this, args, false);
455
+ };
456
+ rbClearMethodCache();
457
+ this._appendToIncluders(urlName, this.urlHelpersModule.prototype[urlName], false);
458
+ this.pathHelpers.add(pathName);
459
+ this.urlHelpers.add(urlName);
460
+ return this;
461
+ }
462
+ static UrlHelper = UrlHelper;
463
+ defineUrlHelper(mod, name, helper, urlStrategy) {
464
+ const method = function (...args) {
465
+ const last = args[args.length - 1];
466
+ let options;
467
+ if (isPlainObject(last)) {
468
+ options = args.pop();
469
+ }
470
+ else if (last instanceof Parameters) {
471
+ options = args.pop().toH();
472
+ }
473
+ return helper.call(this, name, args, options, urlStrategy);
474
+ };
475
+ rbModDefineMethod(mod, name, method);
476
+ this._appendToIncluders(name, method, mod === this.pathHelpersModule);
477
+ }
478
+ /**
479
+ * Records a class prototype, or a module's singleton, that this
480
+ * collection's helpers were copied onto, so a route drawn later reaches it as Ruby's
481
+ * `rb_include_module` reaches a module's existing includers
482
+ * (vendor/ruby/v3.3.11/class.c:1179-1215).
483
+ *
484
+ * Without `installed`, the members `include()` / `extend()` just copied are
485
+ * read back off `proto`. Every such caller registers in the same synchronous
486
+ * step as the copy, so no helper can be redefined in between and the match
487
+ * is exact; only `RoutesHelpers.with` stacks several route sets on one
488
+ * prototype, and it passes its own `includes` chain.
489
+ *
490
+ * @internal
491
+ */
492
+ _appendIncluder(proto, supportsPath, installed, includes, wrap) {
493
+ if (!installed) {
494
+ installed = new Map();
495
+ const modules = supportsPath
496
+ ? [this.urlHelpersModule, this.pathHelpersModule]
497
+ : [this.urlHelpersModule];
498
+ for (const mod of modules) {
499
+ for (const [name, method] of Object.entries(Object.getOwnPropertyDescriptors(mod.prototype))) {
500
+ const own = Object.getOwnPropertyDescriptor(proto, name);
501
+ if (name !== "constructor" && own && own.value === method.value)
502
+ installed.set(name, own);
503
+ }
504
+ }
505
+ }
506
+ if (!includes) {
507
+ const below = new Map();
508
+ const klass = proto.constructor;
509
+ if (typeof klass === "function" && klass.prototype === proto) {
510
+ for (const mod of includedModules(klass)) {
511
+ const members = typeof mod === "function" ? mod.prototype : mod;
512
+ if (members == null)
513
+ continue;
514
+ for (const [name, method] of Object.entries(Object.getOwnPropertyDescriptors(members))) {
515
+ const own = Object.getOwnPropertyDescriptor(proto, name);
516
+ if (name !== "constructor" &&
517
+ own &&
518
+ own.value === method.value &&
519
+ own.get === method.get &&
520
+ own.set === method.set &&
521
+ !installed.has(name))
522
+ below.set(name, own);
523
+ }
524
+ }
525
+ }
526
+ includes = [below, installed];
527
+ }
528
+ this._includers.add({
529
+ proto: new WeakRef(proto),
530
+ supportsPath,
531
+ installed,
532
+ includes,
533
+ wrap,
534
+ });
535
+ }
536
+ /** @internal */
537
+ _appendToIncluders(name, method, isPath) {
538
+ for (const includer of this._includers) {
539
+ const proto = includer.proto.deref();
540
+ if (!proto) {
541
+ this._includers.delete(includer);
542
+ continue;
543
+ }
544
+ if (isPath && !includer.supportsPath)
545
+ continue;
546
+ const raw = { value: method, writable: true, configurable: true, enumerable: false };
547
+ const descriptor = includer.wrap ? includer.wrap(name, raw) : raw;
548
+ const below = includer.includes.slice(0, includer.includes.indexOf(includer.installed) + 1);
549
+ const isOutranked = Object.hasOwn(proto, name) &&
550
+ !below.some((included) => isIncludedMember(proto, name, included));
551
+ includer.installed.set(name, descriptor);
552
+ if (!isOutranked)
553
+ Object.defineProperty(proto, name, descriptor);
554
+ rbClearMethodCache();
555
+ }
556
+ }
557
+ /** @internal */
558
+ _removeFromIncluders(name) {
559
+ for (const includer of this._includers) {
560
+ const proto = includer.proto.deref();
561
+ if (!proto || !includer.installed.has(name))
562
+ continue;
563
+ const isShadowing = isIncludedMember(proto, name, includer.installed);
564
+ includer.installed.delete(name);
565
+ if (!isShadowing)
566
+ continue;
567
+ delete proto[name];
568
+ const below = includer.includes
569
+ .slice(0, includer.includes.indexOf(includer.installed))
570
+ .reverse()
571
+ .find((included) => included.has(name));
572
+ if (below)
573
+ Object.defineProperty(proto, name, below.get(name));
574
+ rbClearMethodCache();
575
+ }
576
+ }
577
+ }
578
+ export class RouteSet {
579
+ static RESERVED_OPTIONS = [
580
+ "host",
581
+ "protocol",
582
+ "port",
583
+ "subdomain",
584
+ "domain",
585
+ "tldLength",
586
+ "trailingSlash",
587
+ "anchor",
588
+ "params",
589
+ "onlyPath",
590
+ "scriptName",
591
+ "originalScriptName",
592
+ ];
593
+ static NamedRouteCollection = NamedRouteCollection;
594
+ namedRoutes = new NamedRouteCollection();
595
+ /** @internal */
596
+ _config;
597
+ disableClearAndFinalize = false;
598
+ resourcesPathNames = { new: "new", edit: "edit" };
599
+ drawPaths = [];
600
+ envKey = `ROUTES_${(RouteSet._envSeq = (RouteSet._envSeq ?? 0) + 1)}_SCRIPT_NAME`;
601
+ static _envSeq;
602
+ set = new JourneyRoutes();
603
+ router = new JourneyRouter(this.set);
604
+ formatter = new JourneyFormatter(this);
605
+ /** @internal */
606
+ _urlHelpersWithPaths;
607
+ /** @internal */
608
+ _urlHelpersWithoutPaths;
609
+ defaultUrlOptions = {};
610
+ _append = [];
611
+ _prepend = [];
612
+ _finalized = false;
613
+ polymorphicMappings = new Map();
614
+ /** @internal */
615
+ _routes = this;
616
+ static defaultResourcesPathNames() {
617
+ return { new: "new", edit: "edit" };
618
+ }
619
+ static newWithConfig(config) {
620
+ const routeSetConfig = rbObjClone(RouteSet.DEFAULT_CONFIG);
621
+ if (rbObjRespondTo(config, "relativeUrlRoot")) {
622
+ routeSetConfig.relativeUrlRoot = config.relativeUrlRoot;
623
+ }
624
+ if (rbObjRespondTo(config, "apiOnly")) {
625
+ routeSetConfig.apiOnly = config.apiOnly;
626
+ }
627
+ if (rbObjRespondTo(config, "defaultScope")) {
628
+ routeSetConfig.defaultScope = config.defaultScope;
629
+ }
630
+ return new this(routeSetConfig);
631
+ }
632
+ static Config = Config;
633
+ static DEFAULT_CONFIG = new Config(null, false, null);
634
+ constructor(config = rbObjClone(RouteSet.DEFAULT_CONFIG)) {
635
+ this._config = config;
636
+ }
637
+ routes() {
638
+ return this.set;
639
+ }
640
+ get relativeUrlRoot() {
641
+ return this._config.relativeUrlRoot;
642
+ }
643
+ isApiOnly() {
644
+ return this._config.apiOnly;
645
+ }
646
+ get defaultScope() {
647
+ return this._config.defaultScope;
648
+ }
649
+ set defaultScope(value) {
650
+ this._config.defaultScope = value;
651
+ }
652
+ requestClass() {
653
+ return AdRequest;
654
+ }
655
+ /** @internal */
656
+ makeRequest(env) {
657
+ return new (this.requestClass())(env);
658
+ }
659
+ defaultEnv() {
660
+ const cachedOpts = this._defaultEnv?.["action_dispatch.routes.default_url_options"];
661
+ if (this._defaultEnv && cachedOpts && shallowEqual(cachedOpts, this.defaultUrlOptions)) {
662
+ return this._defaultEnv;
663
+ }
664
+ const urlOptions = Object.freeze({ ...this.defaultUrlOptions });
665
+ const uri = URI.parse(URL.fullUrlFor({ host: "example.org", ...urlOptions }));
666
+ this._defaultEnv = Object.freeze({
667
+ "action_dispatch.routes": this,
668
+ "action_dispatch.routes.default_url_options": urlOptions,
669
+ HTTPS: uri.scheme === "https" ? "on" : "off",
670
+ "rack.url_scheme": uri.scheme,
671
+ HTTP_HOST: uri.port === uri.defaultPort ? uri.host : `${uri.host}:${uri.port}`,
672
+ SCRIPT_NAME: chomp(uri.path, "/"),
673
+ "rack.input": "",
674
+ });
675
+ return this._defaultEnv;
676
+ }
677
+ fromRequirements(requirements) {
678
+ return this.routes().routes.find((r) => shallowEqual(r.requirements, requirements));
679
+ }
680
+ inspect() {
681
+ return rbAnyToS(this);
682
+ }
683
+ urlHelpers(supportsPath = true) {
684
+ if (supportsPath) {
685
+ return (this._urlHelpersWithPaths ??= this.generateUrlHelpers(true));
686
+ }
687
+ return (this._urlHelpersWithoutPaths ??= this.generateUrlHelpers(false));
688
+ }
689
+ generateUrlHelpers(supportsPath) {
690
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
691
+ const routes = this;
692
+ let _proxy;
693
+ const build = () => {
694
+ const self = class {
695
+ static [classModule] = true;
696
+ static urlFor(options) {
697
+ return this._proxy.urlFor(options);
698
+ }
699
+ static fullUrlFor(options) {
700
+ return this._proxy.fullUrlFor(options);
701
+ }
702
+ static routeFor(name, ...args) {
703
+ return this._proxy.routeFor(name, ...args);
704
+ }
705
+ static optimizeRoutesGeneration() {
706
+ return this._proxy.optimizeRoutesGeneration();
707
+ }
708
+ static polymorphicUrl(recordOrHashOrArray, options = {}) {
709
+ return this._proxy.polymorphicUrl(recordOrHashOrArray, options);
710
+ }
711
+ static polymorphicPath(recordOrHashOrArray, options = {}) {
712
+ return this._proxy.polymorphicPath(recordOrHashOrArray, options);
713
+ }
714
+ static get _routes() {
715
+ return this._proxy._routes;
716
+ }
717
+ static urlOptions() {
718
+ return {};
719
+ }
720
+ get _routes() {
721
+ return (this[_routesIvar] ?? routes);
722
+ }
723
+ set _routes(value) {
724
+ this[_routesIvar] = value;
725
+ }
726
+ /** @internal */
727
+ _generatePathsByDefault() {
728
+ return supportsPath;
729
+ }
730
+ };
731
+ extend(self, Concern);
732
+ include(self, UrlFor);
733
+ if (_proxy) {
734
+ self._proxy = _proxy;
735
+ }
736
+ else {
737
+ const proxyClass = class {
738
+ _routes;
739
+ constructor(routes) {
740
+ this._routes = routes;
741
+ }
742
+ optimizeRoutesGeneration() {
743
+ return this._routes.isOptimizeRoutesGeneration();
744
+ }
745
+ };
746
+ include(proxyClass, UrlFor);
747
+ include(proxyClass, routes.namedRoutes.pathHelpersModule);
748
+ include(proxyClass, routes.namedRoutes.urlHelpersModule);
749
+ routes.namedRoutes._appendIncluder(proxyClass.prototype, true);
750
+ self._proxy = _proxy = new proxyClass(routes);
751
+ }
752
+ const urlHelpers = routes.namedRoutes.urlHelpersModule;
753
+ extend(self, urlHelpers);
754
+ include(self, urlHelpers);
755
+ if (supportsPath) {
756
+ const pathHelpers = routes.namedRoutes.pathHelpersModule;
757
+ include(self, pathHelpers);
758
+ extend(self, pathHelpers);
759
+ }
760
+ routes.namedRoutes._appendIncluder(self, supportsPath);
761
+ self.included(null, function () {
762
+ Object.defineProperty(this, "_routes", { get: () => routes, configurable: true });
763
+ });
764
+ const concernIncluded = self.included;
765
+ self.included = function (base) {
766
+ concernIncluded.call(this, base);
767
+ if (typeof base === "function") {
768
+ routes.namedRoutes._appendIncluder(base.prototype, supportsPath);
769
+ }
770
+ if (rbObjRespondTo(base, "_routes") &&
771
+ base._routes !== this._proxy._routes) {
772
+ this.dupForReinclude ??= build();
773
+ include(base, this.dupForReinclude);
774
+ }
775
+ };
776
+ return self;
777
+ };
778
+ return build();
779
+ }
780
+ mountedHelpers() {
781
+ return MountedHelpers;
782
+ }
783
+ defineMountedHelper(name, scriptNamer = null) {
784
+ name = camelize(name, "lower");
785
+ if (rbModMethodDefined(MountedHelpers, name))
786
+ return;
787
+ // eslint-disable-next-line @typescript-eslint/no-this-alias -- `routes = self` (`route_set.rb:514`).
788
+ const routes = this;
789
+ const helpers = routes.urlHelpers();
790
+ Object.defineProperty(MountedHelpers.prototype, `_${name}`, {
791
+ value: function () {
792
+ return new RoutesProxy(routes, this._routesContext(), helpers, scriptNamer);
793
+ },
794
+ writable: true,
795
+ configurable: true,
796
+ });
797
+ rbClearMethodCache();
798
+ Object.defineProperty(MountedHelpers.prototype, name, {
799
+ configurable: true,
800
+ get() {
801
+ const ivar = `@_${name}`;
802
+ let proxy = rbObjIvarGet(this, ivar);
803
+ if (proxy == null) {
804
+ proxy = this[`_${name}`].call(this);
805
+ rbObjIvarSet(this, ivar, proxy);
806
+ }
807
+ return proxy;
808
+ },
809
+ });
810
+ rbClearMethodCache();
811
+ rbDeclareIvar(MountedHelpers, `@_${name}`, `__${name}`);
812
+ for (const includer of mountedHelpersIncluders) {
813
+ const proto = includer.deref();
814
+ if (!proto) {
815
+ mountedHelpersIncluders.delete(includer);
816
+ continue;
817
+ }
818
+ rbDeclareIvar({ prototype: proto }, `@_${name}`, `__${name}`);
819
+ for (const key of [`_${name}`, name]) {
820
+ if (Object.hasOwn(proto, key))
821
+ continue;
822
+ Object.defineProperty(proto, key, Object.getOwnPropertyDescriptor(MountedHelpers.prototype, key));
823
+ rbClearMethodCache();
824
+ }
825
+ }
826
+ }
827
+ /** @internal */
828
+ _defaultEnv;
829
+ draw(block) {
830
+ if (!this.disableClearAndFinalize)
831
+ this.clearBang();
832
+ this.evalBlock(block);
833
+ if (!this.disableClearAndFinalize)
834
+ this.finalizeBang();
835
+ }
836
+ /** @internal */
837
+ evalBlock(block) {
838
+ const mapper = new Mapper(this);
839
+ if (this.defaultScope) {
840
+ mapper.withDefaultScope(this.defaultScope, block);
841
+ }
842
+ else {
843
+ block.call(mapper);
844
+ }
845
+ }
846
+ append(block) {
847
+ this._append.push(block);
848
+ }
849
+ prepend(block) {
850
+ this._prepend.push(block);
851
+ }
852
+ finalizeBang() {
853
+ if (this._finalized)
854
+ return;
855
+ for (const blk of this._append)
856
+ this.evalBlock(blk);
857
+ this._finalized = true;
858
+ }
859
+ clearBang() {
860
+ this._finalized = false;
861
+ this.namedRoutes.clear();
862
+ this.set.clear();
863
+ this.formatter.clear();
864
+ this.polymorphicMappings.clear();
865
+ this._defaultEnv = undefined;
866
+ for (const blk of this._prepend)
867
+ this.evalBlock(blk);
868
+ }
869
+ eagerLoadBang() {
870
+ this.router.eagerLoadBang();
871
+ this.routes().each((route) => route.eagerLoadBang());
872
+ this.formatter.eagerLoadBang();
873
+ }
874
+ isEmpty() {
875
+ return this.routes().isEmpty();
876
+ }
877
+ addRoute(mapping, name) {
878
+ if (!(isBlank(name) || String(name).match(/^[_a-z]\w*$/i))) {
879
+ throw new ArgumentError(`Invalid route name: '${name}'`);
880
+ }
881
+ if (name && this.namedRoutes.get(name)) {
882
+ throw new ArgumentError(`Invalid route name, already in use: '${name}' \n` +
883
+ "You may have defined two routes with the same name using the `:as` option, or " +
884
+ "you may be overriding a route already defined by a resource with the same naming. " +
885
+ "For the latter, you can restrict the routes created with `resources` as explained here: \n" +
886
+ "https://guides.rubyonrails.org/routing.html#restricting-the-routes-created");
887
+ }
888
+ const route = this.set.addRoute(name || null, mapping);
889
+ if (name)
890
+ this.namedRoutes.add(name, route);
891
+ if (route.segmentKeys.includes("controller")) {
892
+ deprecator().warn(squish(`
893
+ Using a dynamic :controller segment in a route is deprecated and
894
+ will be removed in Rails 8.1.
895
+ `));
896
+ }
897
+ if (route.segmentKeys.includes("action")) {
898
+ deprecator().warn(squish(`
899
+ Using a dynamic :action segment in a route is deprecated and
900
+ will be removed in Rails 8.1.
901
+ `));
902
+ }
903
+ return route;
904
+ }
905
+ addPolymorphicMapping(klass, options, block) {
906
+ this.polymorphicMappings.set(klass, new CustomUrlHelper(klass, options, block));
907
+ }
908
+ addUrlHelper(name, options, block) {
909
+ return this.namedRoutes.addUrlHelper(name, options, block);
910
+ }
911
+ extraKeys(options, recall = {}) {
912
+ return this.generateExtras(options, recall)[1];
913
+ }
914
+ /** @internal */
915
+ generate(routeName, options, recall = {}, _methodName) {
916
+ return new Generator(routeName, options, recall, this).generate();
917
+ }
918
+ isOptimizeRoutesGeneration() {
919
+ return Object.keys(this.defaultUrlOptions).length === 0;
920
+ }
921
+ findScriptName(options) {
922
+ const scriptName = options["scriptName"];
923
+ delete options["scriptName"];
924
+ if (scriptName != null && scriptName !== false)
925
+ return scriptName;
926
+ return this.relativeUrlRoot ?? "";
927
+ }
928
+ pathFor(options, routeName = null, reserved = RouteSet.RESERVED_OPTIONS) {
929
+ return this.urlFor(options, routeName, PATH, null, reserved);
930
+ }
931
+ urlFor(options, routeName = null, urlStrategy = UNKNOWN, methodName = null, reserved = RouteSet.RESERVED_OPTIONS) {
932
+ // eslint-disable-next-line blazetrails/ruby-compat-native-required, @typescript-eslint/no-unnecessary-type-assertion -- options may be a Hash, which merge converts through to_hash; TS 7 narrows through this cast, which typescript-eslint's TS 6 checker reads as unnecessary
933
+ options = merge(this.defaultUrlOptions, options);
934
+ let user = null;
935
+ let password = null;
936
+ if (options["user"] != null &&
937
+ options["user"] !== false &&
938
+ options["password"] != null &&
939
+ options["password"] !== false) {
940
+ user = options["user"];
941
+ delete options["user"];
942
+ password = options["password"];
943
+ delete options["password"];
944
+ }
945
+ const recall = (Object.hasOwn(options, "_recall") ? options["_recall"] : {});
946
+ delete options["_recall"];
947
+ const originalScriptName = options["originalScriptName"];
948
+ delete options["originalScriptName"];
949
+ let scriptName = this.findScriptName(options);
950
+ if (originalScriptName != null && originalScriptName !== false) {
951
+ scriptName = originalScriptName + scriptName;
952
+ }
953
+ const pathOptions = { ...options };
954
+ for (const ro of reserved)
955
+ delete pathOptions[ro];
956
+ const routeWithParams = this.generate(routeName, pathOptions, recall);
957
+ let path = routeWithParams.path(methodName);
958
+ const trailingSlash = options["trailingSlash"];
959
+ const format = options["format"];
960
+ if (trailingSlash != null &&
961
+ trailingSlash !== false &&
962
+ (format == null || format === false) &&
963
+ !path.endsWith("/")) {
964
+ path += "/";
965
+ }
966
+ const params = routeWithParams.params;
967
+ if (Object.hasOwn(options, "params")) {
968
+ const optParams = options["params"];
969
+ if (rbObjRespondTo(optParams, "toHash")) {
970
+ // eslint-disable-next-line blazetrails/ruby-compat-native-required -- optParams answers to_hash, which update converts through
971
+ update(params, optParams);
972
+ }
973
+ else {
974
+ params["params"] = optParams;
975
+ }
976
+ }
977
+ options["path"] = path;
978
+ options["scriptName"] = scriptName;
979
+ options["params"] = params;
980
+ options["user"] = user;
981
+ options["password"] = password;
982
+ return urlStrategy(options);
983
+ }
984
+ urlOptions() {
985
+ return urlOptionsFn.call(this);
986
+ }
987
+ fullUrlFor(options) {
988
+ return fullUrlForFn.call(this, options);
989
+ }
990
+ routeFor(name, ...args) {
991
+ return routeForFn.call(this, name, ...args);
992
+ }
993
+ polymorphicUrl(recordOrHashOrArray, options = {}) {
994
+ return polymorphicUrlFn.call(this, recordOrHashOrArray, options);
995
+ }
996
+ /** @internal */
997
+ _withRoutes(routes, block) {
998
+ return withRoutesFn.call(this, routes, block);
999
+ }
1000
+ /** @internal */
1001
+ _routesContext() {
1002
+ return routesContextFn.call(this);
1003
+ }
1004
+ recognizePathWithRequest(req, path, extras, { raiseOnMissing = true } = {}) {
1005
+ let pathParameters;
1006
+ this.router.recognize(req, (route, params) => {
1007
+ Object.assign(params, extras);
1008
+ for (const [key, value] of Object.entries(params)) {
1009
+ if (typeof value === "string") {
1010
+ params[key] = RFC2396_PARSER.unescape(value);
1011
+ }
1012
+ }
1013
+ req.pathParameters = params;
1014
+ const app = route.app;
1015
+ if (app.matches(req) && app.dispatcher()) {
1016
+ try {
1017
+ req.controllerClass();
1018
+ }
1019
+ catch (e) {
1020
+ if (!(e instanceof NameError))
1021
+ throw e;
1022
+ throw new RoutingError(`A route matches ${rbInspect(path)}, but references missing controller: ${camelize(String(params["controller"]))}Controller`);
1023
+ }
1024
+ pathParameters = req.pathParameters;
1025
+ return true;
1026
+ }
1027
+ else if (app.matches(req) && app.engine()) {
1028
+ const engineParameters = app.rackApp()
1029
+ .routes()
1030
+ .recognizePathWithRequest(req, path, extras, { raiseOnMissing: false });
1031
+ if (engineParameters) {
1032
+ pathParameters = engineParameters;
1033
+ return true;
1034
+ }
1035
+ }
1036
+ });
1037
+ if (pathParameters !== undefined)
1038
+ return pathParameters;
1039
+ if (raiseOnMissing) {
1040
+ throw new RoutingError(`No route matches ${rbInspect(path)}`);
1041
+ }
1042
+ return undefined;
1043
+ }
1044
+ recognizePath(path, environment = {}) {
1045
+ const method = String(environment.method ?? "GET").toUpperCase();
1046
+ if (!(path != null && path.includes("://")))
1047
+ path = Utils.normalizePath(path);
1048
+ const extras = environment.extras ?? {};
1049
+ let env;
1050
+ try {
1051
+ env = MockRequest.envFor(path, { ":method": method });
1052
+ }
1053
+ catch (e) {
1054
+ if (!(e instanceof InvalidURIError))
1055
+ throw e;
1056
+ throw new RoutingError(e.message);
1057
+ }
1058
+ const req = this.makeRequest(env);
1059
+ return this.recognizePathWithRequest(req, path, extras);
1060
+ }
1061
+ generateExtras(options, recall = {}) {
1062
+ if (recall != null) {
1063
+ options = { ...options, _recall: recall };
1064
+ }
1065
+ const routeName = options["useRoute"];
1066
+ delete options["useRoute"];
1067
+ const generator = this.generate(routeName, options, recall);
1068
+ const pathInfo = this.pathFor(options, routeName ?? null, []);
1069
+ return [URI.parse(pathInfo).path, Object.keys(except(generator.params, "_recall"))];
1070
+ }
1071
+ setDefaultUrlOptions(options) {
1072
+ this.defaultUrlOptions = { ...this.defaultUrlOptions, ...options };
1073
+ }
1074
+ async call(env) {
1075
+ const req = this.makeRequest(env);
1076
+ req.pathInfo = Utils.normalizePath(req.pathInfo);
1077
+ return (await this.router.serve(req));
1078
+ }
1079
+ }
1080
+ Routing.RouteSet = RouteSet;
1081
+ //# sourceMappingURL=route-set.js.map