ember-source 7.1.0-alpha.4 → 7.1.0-beta.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 (499) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dev/packages/@ember/-internals/container/index.js +4 -401
  3. package/dist/dev/packages/@ember/-internals/deprecations/index.js +1 -1
  4. package/dist/dev/packages/@ember/-internals/environment/index.js +3 -161
  5. package/dist/dev/packages/@ember/-internals/glimmer/index.js +14 -15
  6. package/dist/dev/packages/@ember/-internals/meta/lib/meta.js +0 -1
  7. package/dist/dev/packages/@ember/-internals/metal/index.js +18 -9
  8. package/dist/dev/packages/@ember/-internals/routing/index.js +1 -10
  9. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -12
  10. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -10
  11. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -10
  12. package/dist/dev/packages/@ember/-internals/string/index.js +0 -1
  13. package/dist/dev/packages/@ember/-internals/utils/index.js +8 -3
  14. package/dist/dev/packages/@ember/-internals/views/index.js +0 -1
  15. package/dist/dev/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -1
  16. package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -12
  17. package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -11
  18. package/dist/dev/packages/@ember/-internals/views/lib/system/utils.js +1 -1
  19. package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +2 -19
  20. package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +1 -1
  21. package/dist/dev/packages/@ember/application/index.js +5 -28
  22. package/dist/dev/packages/@ember/application/instance.js +3 -22
  23. package/dist/dev/packages/@ember/application/namespace.js +4 -11
  24. package/dist/dev/packages/@ember/array/index.js +7 -15
  25. package/dist/dev/packages/@ember/array/proxy.js +10 -14
  26. package/dist/dev/packages/@ember/canary-features/index.js +1 -1
  27. package/dist/dev/packages/@ember/component/helper.js +1 -14
  28. package/dist/dev/packages/@ember/component/index.js +1356 -17
  29. package/dist/dev/packages/@ember/component/template-only.js +1 -9
  30. package/dist/dev/packages/@ember/controller/index.js +3 -19
  31. package/dist/dev/packages/@ember/debug/container-debug-adapter.js +0 -19
  32. package/dist/dev/packages/@ember/debug/data-adapter.js +4 -11
  33. package/dist/dev/packages/@ember/debug/index.js +1 -1
  34. package/dist/dev/packages/@ember/debug/lib/deprecate.js +1 -1
  35. package/dist/dev/packages/@ember/engine/index.js +3 -31
  36. package/dist/dev/packages/@ember/engine/instance.js +3 -8
  37. package/dist/dev/packages/@ember/helper/index.js +159 -21
  38. package/dist/dev/packages/@ember/instrumentation/index.js +1 -1
  39. package/dist/dev/packages/@ember/modifier/index.js +2 -16
  40. package/dist/dev/packages/@ember/modifier/on.js +1 -9
  41. package/dist/dev/packages/@ember/object/-internals.js +3 -11
  42. package/dist/dev/packages/@ember/object/compat.js +3 -10
  43. package/dist/dev/packages/@ember/object/computed.js +2 -12
  44. package/dist/dev/packages/@ember/object/core.js +10 -18
  45. package/dist/dev/packages/@ember/object/evented.js +2 -12
  46. package/dist/dev/packages/@ember/object/events.js +1 -11
  47. package/dist/dev/packages/@ember/object/index.js +10 -14
  48. package/dist/dev/packages/@ember/object/internals.js +1 -1
  49. package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +6 -23
  50. package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -12
  51. package/dist/dev/packages/@ember/object/mixin.js +7 -10
  52. package/dist/dev/packages/@ember/object/observable.js +8 -12
  53. package/dist/dev/packages/@ember/object/observers.js +1 -11
  54. package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -13
  55. package/dist/dev/packages/@ember/object/proxy.js +0 -7
  56. package/dist/dev/packages/@ember/reactive/collections.js +591 -1
  57. package/dist/dev/packages/@ember/renderer/index.js +1 -14
  58. package/dist/dev/packages/@ember/routing/-internals.js +1 -10
  59. package/dist/dev/packages/@ember/routing/index.js +614 -14
  60. package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -11
  61. package/dist/dev/packages/@ember/routing/lib/routing-service.js +7 -17
  62. package/dist/dev/packages/@ember/routing/lib/utils.js +2 -11
  63. package/dist/dev/packages/@ember/routing/route.js +13 -24
  64. package/dist/dev/packages/@ember/routing/router-service.js +9 -18
  65. package/dist/dev/packages/@ember/routing/router.js +5 -21
  66. package/dist/dev/packages/@ember/runloop/index.js +1 -10
  67. package/dist/dev/packages/@ember/service/index.js +1 -11
  68. package/dist/dev/packages/@ember/template/index.js +1 -14
  69. package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +12 -15
  70. package/dist/dev/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -1
  71. package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  72. package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  73. package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -3
  74. package/dist/dev/packages/@ember/template-compiler/lib/template.js +3 -11
  75. package/dist/dev/packages/@ember/template-factory/index.js +1 -8
  76. package/dist/dev/packages/@ember/utils/lib/compare.js +0 -7
  77. package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -12
  78. package/dist/dev/packages/@glimmer/destroyable/index.js +1 -1
  79. package/dist/dev/packages/@glimmer/manager/index.js +5 -315
  80. package/dist/dev/packages/@glimmer/node/index.js +3 -11
  81. package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -7
  82. package/dist/dev/packages/@glimmer/program/index.js +194 -3
  83. package/dist/dev/packages/@glimmer/reference/index.js +4 -5
  84. package/dist/dev/packages/@glimmer/runtime/index.js +15 -10
  85. package/dist/dev/packages/@glimmer/tracking/index.js +2 -11
  86. package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -11
  87. package/dist/dev/packages/@glimmer/util/index.js +1 -2
  88. package/dist/dev/packages/@glimmer/validator/index.js +4 -1253
  89. package/dist/dev/packages/@glimmer/vm/index.js +1 -1
  90. package/dist/dev/packages/@glimmer/wire-format/index.js +3 -65
  91. package/dist/dev/packages/ember/version.js +1 -1
  92. package/dist/dev/packages/ember-template-compiler/index.js +7 -7
  93. package/dist/dev/packages/shared-chunks/{alias-CSC0WIbj.js → alias-ZcMQckQV.js} +8 -4
  94. package/dist/dev/packages/shared-chunks/api-BAmlf_CN.js +310 -0
  95. package/dist/dev/packages/shared-chunks/{api-BQMslHhq.js → api-BawZUDYD.js} +5 -6
  96. package/dist/dev/packages/shared-chunks/{args-proxy-DgXMc9b5.js → args-proxy-BNLuRFlO.js} +2 -4
  97. package/dist/dev/packages/shared-chunks/{array-D8PfjQHi.js → array-Bh_kUjzy.js} +2 -1
  98. package/dist/dev/packages/shared-chunks/assert-Zqc4wiAV.js +6 -0
  99. package/dist/dev/packages/shared-chunks/cache-B7dqAS38.js +596 -0
  100. package/dist/dev/packages/shared-chunks/{capabilities-O_xc7Yqk.js → capabilities-CZkuOqqC.js} +0 -5
  101. package/dist/dev/packages/shared-chunks/chain-tags-D6tuFUj_.js +190 -0
  102. package/dist/dev/packages/shared-chunks/{collections-D_nY_0UJ.js → collections-DPkjqeA3.js} +0 -1
  103. package/dist/dev/packages/shared-chunks/{compiler-D1leQ3Gl.js → compiler-QUSl_urU.js} +7043 -235
  104. package/dist/dev/packages/shared-chunks/computed-CJnghmXC.js +980 -0
  105. package/dist/dev/packages/shared-chunks/container-BzzHmCNj.js +404 -0
  106. package/dist/dev/packages/shared-chunks/curly-BBzF_bI8.js +617 -0
  107. package/dist/dev/packages/shared-chunks/curried-BZnYakIg.js +5 -0
  108. package/dist/dev/packages/shared-chunks/{debug-to-string-CFb7h0lY.js → debug-to-string-C6LsA_qz.js} +1 -2
  109. package/dist/dev/packages/shared-chunks/decorator-B5Uh5NFI.js +135 -0
  110. package/dist/dev/packages/shared-chunks/element-DQJOvSlQ.js +109 -0
  111. package/dist/dev/packages/shared-chunks/element-builder--iTIJyCB.js +812 -0
  112. package/dist/dev/packages/shared-chunks/env-g-kaAFLN.js +161 -0
  113. package/dist/dev/packages/shared-chunks/events-6aFVjD4k.js +180 -0
  114. package/dist/dev/packages/shared-chunks/get-D5b5QlqE.js +138 -0
  115. package/dist/dev/packages/shared-chunks/get-debug-name-CSniHBsn.js +45 -0
  116. package/dist/dev/packages/shared-chunks/get_properties-CIm8IAtP.js +55 -0
  117. package/dist/dev/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  118. package/dist/dev/packages/shared-chunks/hash-BRRFQJ99.js +192 -0
  119. package/dist/dev/packages/shared-chunks/helper-Do7NCZHI.js +314 -0
  120. package/dist/dev/packages/shared-chunks/index-CwnQYqK5.js +2500 -0
  121. package/dist/dev/packages/shared-chunks/{index-BUPd6pkm.js → index-CyZiGiEI.js} +28 -29
  122. package/dist/dev/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  123. package/dist/dev/packages/shared-chunks/injected_property-B4T-FzZZ.js +70 -0
  124. package/dist/dev/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  125. package/dist/dev/packages/shared-chunks/internal-CAL-jHZt.js +140 -0
  126. package/dist/dev/packages/shared-chunks/internal-helper-Ez7zbEIa.js +7 -0
  127. package/dist/dev/packages/shared-chunks/{neq-DujMPv1k.js → invoke-B8M5fQQS.js} +4 -32
  128. package/dist/{prod/packages/shared-chunks/is_proxy-Cr1qlMv_.js → dev/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  129. package/dist/dev/packages/shared-chunks/libraries-CHBwbR72.js +79 -0
  130. package/dist/dev/packages/shared-chunks/mandatory-setter-BpbAMTzV.js +107 -0
  131. package/dist/dev/packages/shared-chunks/meta-BmRXesrk.js +46 -0
  132. package/dist/{prod/packages/shared-chunks/name-C68GLLO3.js → dev/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  133. package/dist/dev/packages/shared-chunks/{namespace_search-uT8odThF.js → namespace_search-BfvzEQzN.js} +1 -2
  134. package/dist/dev/packages/shared-chunks/normalize-CKySQVU7.js +84 -0
  135. package/dist/dev/packages/shared-chunks/observers-C2DurkLG.js +199 -0
  136. package/dist/dev/packages/shared-chunks/on-BueSMv9L.js +253 -0
  137. package/dist/dev/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  138. package/dist/dev/packages/shared-chunks/or-O0eJQ4K-.js +118 -0
  139. package/dist/{prod/packages/shared-chunks/program-B7SJZ5NF.js → dev/packages/shared-chunks/program-DzAfcWFj.js} +1 -1
  140. package/dist/{prod/packages/shared-chunks/program-context-DFiwaPMR.js → dev/packages/shared-chunks/program-context-CadjldRr.js} +4 -3
  141. package/dist/dev/packages/shared-chunks/property_get-CIBS9umw.js +139 -0
  142. package/dist/dev/packages/shared-chunks/{property_set-DaoZXGM5.js → property_set-D3PKyisF.js} +4 -2
  143. package/dist/dev/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  144. package/dist/dev/packages/shared-chunks/{reference-C3TKDRnP.js → reference-BoPB2LfI.js} +3 -4
  145. package/dist/{prod/packages/shared-chunks/registers-ylirb0dq.js → dev/packages/shared-chunks/registers-C_W2qYHJ.js} +1 -1
  146. package/dist/{prod/packages/shared-chunks/rehydrate-builder-D3t52iGR.js → dev/packages/shared-chunks/rehydrate-builder-DCyIgnCR.js} +7 -4
  147. package/dist/dev/packages/shared-chunks/{render-DCchifOK.js → render-CpKaO-BO.js} +512 -16
  148. package/dist/{prod/packages/shared-chunks/chunk-3SQBS3Y5-Cj4eryg1.js → dev/packages/shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js} +4 -59
  149. package/dist/{prod/packages/shared-chunks/serialize-builder-iXiRs1Pg.js → dev/packages/shared-chunks/serialize-builder-DxgGRvH_.js} +2 -7
  150. package/dist/dev/packages/shared-chunks/set_properties-BghuuGJx.js +48 -0
  151. package/dist/dev/packages/shared-chunks/{setup-registry-DxchCIL2.js → setup-registry-BC5VMvei.js} +34 -14
  152. package/dist/dev/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  153. package/dist/dev/packages/shared-chunks/super-BBBjgF69.js +91 -0
  154. package/dist/dev/packages/shared-chunks/syscall-ops-BPFtDquC.js +133 -0
  155. package/dist/dev/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  156. package/dist/dev/packages/shared-chunks/{template-kM-7TTcc.js → template-R_5UMHhb.js} +1 -1
  157. package/dist/dev/packages/shared-chunks/template-only-BqOt8bDl.js +78 -0
  158. package/dist/dev/packages/shared-chunks/textarea-WSlUEr0y.js +468 -0
  159. package/dist/dev/packages/shared-chunks/tracked-CKE4wnE6.js +148 -0
  160. package/dist/dev/packages/shared-chunks/tracked-data-CGnA4ytZ.js +31 -0
  161. package/dist/dev/packages/shared-chunks/transform-resolutions-h1ik8gqW.js +645 -0
  162. package/dist/dev/packages/shared-chunks/unique-id-CgmHQiwi.js +32 -0
  163. package/dist/{prod/packages/shared-chunks/on-CersD7PL.js → dev/packages/shared-chunks/untouchable-this-B3DVwpHS.js} +215 -1397
  164. package/dist/dev/packages/shared-chunks/vm-ops-ImHv0Wtg.js +12 -0
  165. package/dist/dev/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  166. package/dist/prod/packages/@ember/-internals/container/index.js +4 -315
  167. package/dist/prod/packages/@ember/-internals/deprecations/index.js +1 -1
  168. package/dist/prod/packages/@ember/-internals/environment/index.js +3 -158
  169. package/dist/prod/packages/@ember/-internals/glimmer/index.js +14 -13
  170. package/dist/prod/packages/@ember/-internals/meta/lib/meta.js +0 -3
  171. package/dist/prod/packages/@ember/-internals/metal/index.js +18 -13
  172. package/dist/prod/packages/@ember/-internals/routing/index.js +1 -6
  173. package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +0 -1
  174. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +9 -10
  175. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -6
  176. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +0 -1
  177. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +2 -6
  178. package/dist/prod/packages/@ember/-internals/string/index.js +0 -2
  179. package/dist/prod/packages/@ember/-internals/utils/index.js +32 -30
  180. package/dist/prod/packages/@ember/-internals/views/index.js +0 -1
  181. package/dist/prod/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -2
  182. package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -6
  183. package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -7
  184. package/dist/prod/packages/@ember/-internals/views/lib/system/utils.js +1 -2
  185. package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +2 -15
  186. package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +0 -2
  187. package/dist/prod/packages/@ember/application/index.js +5 -24
  188. package/dist/prod/packages/@ember/application/instance.js +5 -18
  189. package/dist/prod/packages/@ember/application/namespace.js +4 -8
  190. package/dist/prod/packages/@ember/array/index.js +7 -12
  191. package/dist/prod/packages/@ember/array/proxy.js +9 -10
  192. package/dist/prod/packages/@ember/canary-features/index.js +1 -1
  193. package/dist/prod/packages/@ember/component/helper.js +1 -12
  194. package/dist/prod/packages/@ember/component/index.js +1291 -15
  195. package/dist/prod/packages/@ember/component/template-only.js +1 -6
  196. package/dist/prod/packages/@ember/controller/index.js +3 -16
  197. package/dist/prod/packages/@ember/debug/container-debug-adapter.js +1 -15
  198. package/dist/prod/packages/@ember/debug/data-adapter.js +5 -7
  199. package/dist/prod/packages/@ember/debug/index.js +1 -1
  200. package/dist/prod/packages/@ember/debug/lib/deprecate.js +1 -1
  201. package/dist/prod/packages/@ember/engine/index.js +3 -27
  202. package/dist/prod/packages/@ember/engine/instance.js +3 -9
  203. package/dist/prod/packages/@ember/helper/index.js +159 -19
  204. package/dist/prod/packages/@ember/instrumentation/index.js +1 -1
  205. package/dist/prod/packages/@ember/modifier/index.js +2 -14
  206. package/dist/prod/packages/@ember/modifier/on.js +1 -6
  207. package/dist/prod/packages/@ember/object/-internals.js +2 -6
  208. package/dist/prod/packages/@ember/object/compat.js +3 -7
  209. package/dist/prod/packages/@ember/object/computed.js +2 -8
  210. package/dist/prod/packages/@ember/object/core.js +8 -15
  211. package/dist/prod/packages/@ember/object/evented.js +2 -7
  212. package/dist/prod/packages/@ember/object/events.js +1 -6
  213. package/dist/prod/packages/@ember/object/index.js +10 -12
  214. package/dist/prod/packages/@ember/object/internals.js +2 -6
  215. package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +5 -20
  216. package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +2 -9
  217. package/dist/prod/packages/@ember/object/mixin.js +6 -9
  218. package/dist/prod/packages/@ember/object/observable.js +7 -9
  219. package/dist/prod/packages/@ember/object/observers.js +1 -6
  220. package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -9
  221. package/dist/prod/packages/@ember/object/proxy.js +0 -7
  222. package/dist/prod/packages/@ember/reactive/collections.js +591 -1
  223. package/dist/prod/packages/@ember/renderer/index.js +1 -12
  224. package/dist/prod/packages/@ember/routing/history-location.js +0 -1
  225. package/dist/prod/packages/@ember/routing/index.js +580 -12
  226. package/dist/prod/packages/@ember/routing/lib/dsl.js +0 -2
  227. package/dist/prod/packages/@ember/routing/lib/generate_controller.js +1 -6
  228. package/dist/prod/packages/@ember/routing/lib/routing-service.js +4 -14
  229. package/dist/prod/packages/@ember/routing/lib/utils.js +1 -6
  230. package/dist/prod/packages/@ember/routing/none-location.js +0 -1
  231. package/dist/prod/packages/@ember/routing/route.js +12 -22
  232. package/dist/prod/packages/@ember/routing/router-service.js +6 -15
  233. package/dist/prod/packages/@ember/routing/router.js +4 -17
  234. package/dist/prod/packages/@ember/runloop/index.js +1 -6
  235. package/dist/prod/packages/@ember/service/index.js +1 -7
  236. package/dist/prod/packages/@ember/template/index.js +1 -12
  237. package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +12 -14
  238. package/dist/prod/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -2
  239. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +0 -1
  240. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +0 -1
  241. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +0 -1
  242. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +0 -2
  243. package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  244. package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  245. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +0 -1
  246. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-in-element.js +0 -1
  247. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +126 -4
  248. package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -7
  249. package/dist/prod/packages/@ember/template-factory/index.js +1 -5
  250. package/dist/prod/packages/@ember/utils/lib/compare.js +0 -8
  251. package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -7
  252. package/dist/prod/packages/@glimmer/manager/index.js +4 -292
  253. package/dist/prod/packages/@glimmer/node/index.js +3 -8
  254. package/dist/prod/packages/@glimmer/opcode-compiler/index.js +2 -5
  255. package/dist/prod/packages/@glimmer/program/index.js +194 -3
  256. package/dist/prod/packages/@glimmer/reference/index.js +4 -4
  257. package/dist/prod/packages/@glimmer/runtime/index.js +14 -8
  258. package/dist/prod/packages/@glimmer/tracking/index.js +2 -7
  259. package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -6
  260. package/dist/prod/packages/@glimmer/util/index.js +2 -2
  261. package/dist/prod/packages/@glimmer/validator/index.js +5 -1016
  262. package/dist/prod/packages/@glimmer/vm/index.js +1 -1
  263. package/dist/prod/packages/@glimmer/wire-format/index.js +3 -65
  264. package/dist/prod/packages/ember/version.js +1 -1
  265. package/dist/prod/packages/ember-template-compiler/index.js +4 -7
  266. package/dist/prod/packages/shared-chunks/{alias-BLBQkche.js → alias-DBW_V5vD.js} +7 -6
  267. package/dist/prod/packages/shared-chunks/api-CM1trl_4.js +289 -0
  268. package/dist/prod/packages/shared-chunks/{api-B5UrgITK.js → api-zh_k31vb.js} +4 -5
  269. package/dist/prod/packages/shared-chunks/{args-proxy-Dl0A0YWI.js → args-proxy-BDXbXCF9.js} +2 -2
  270. package/dist/prod/packages/shared-chunks/{array-kVQfzrQn.js → array-D6Couewv.js} +2 -3
  271. package/dist/prod/packages/shared-chunks/assert-Zqc4wiAV.js +6 -0
  272. package/dist/prod/packages/shared-chunks/cache-BIlOoPA7.js +371 -0
  273. package/dist/prod/packages/shared-chunks/{capabilities-DXA-L0iT.js → capabilities-_5e35539.js} +0 -3
  274. package/dist/prod/packages/shared-chunks/chain-tags-C9rFtQ_x.js +178 -0
  275. package/dist/prod/packages/shared-chunks/{compiler-Bbki2GT_.js → compiler-c4yUVrl_.js} +7044 -193
  276. package/dist/prod/packages/shared-chunks/{namespace_search-Dcdalhj6.js → computed-DjCIU_ht.js} +108 -239
  277. package/dist/prod/packages/shared-chunks/container-BYOnjnwz.js +315 -0
  278. package/dist/prod/packages/shared-chunks/curly-ZzX43b50.js +545 -0
  279. package/dist/prod/packages/shared-chunks/curried-BZnYakIg.js +5 -0
  280. package/dist/prod/packages/shared-chunks/debug-render-tree-CF5O4-WI.js +2049 -0
  281. package/dist/prod/packages/shared-chunks/{decorator-BdDDBUd2.js → decorator-9ikVwsjY.js} +0 -1
  282. package/dist/prod/packages/shared-chunks/element-DUOVW5Ho.js +100 -0
  283. package/dist/prod/packages/shared-chunks/{element-builder-CzXb9l1W.js → element-builder-CnlTPNyw.js} +109 -88
  284. package/dist/prod/packages/shared-chunks/env-DXxsTFkM.js +158 -0
  285. package/dist/prod/packages/shared-chunks/events-DYrYz3V8.js +174 -0
  286. package/dist/prod/packages/shared-chunks/get-t0-itmA-.js +138 -0
  287. package/dist/prod/packages/shared-chunks/get_properties-Nn08mLAH.js +55 -0
  288. package/dist/prod/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  289. package/dist/prod/packages/shared-chunks/hash-mcs3pEFO.js +192 -0
  290. package/dist/prod/packages/shared-chunks/helper-DLjV2ZZW.js +298 -0
  291. package/dist/prod/packages/shared-chunks/{index-CjaDF9kC.js → index-Bj71BDDA.js} +17 -10
  292. package/dist/prod/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  293. package/dist/prod/packages/shared-chunks/index-qDFz6Mfe.js +2322 -0
  294. package/dist/prod/packages/shared-chunks/{injected_property-CTVs5FPh.js → injected_property--eJunJph.js} +2 -3
  295. package/dist/prod/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  296. package/dist/prod/packages/shared-chunks/internal-DidurjJB.js +137 -0
  297. package/dist/prod/packages/shared-chunks/internal-helper-DIbr1RgC.js +7 -0
  298. package/dist/prod/packages/shared-chunks/{neq-BqdovTuC.js → invoke-Cj5zMqHz.js} +4 -24
  299. package/dist/{dev/packages/shared-chunks/is_proxy-B0smdQy8.js → prod/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  300. package/dist/prod/packages/shared-chunks/libraries-_k-4KK5_.js +59 -0
  301. package/dist/prod/packages/shared-chunks/meta-B9mldqPL.js +36 -0
  302. package/dist/{dev/packages/shared-chunks/name-Z7dpqvzn.js → prod/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  303. package/dist/prod/packages/shared-chunks/namespace_search-BfvzEQzN.js +134 -0
  304. package/dist/prod/packages/shared-chunks/normalize-D9jDJVGg.js +84 -0
  305. package/dist/prod/packages/shared-chunks/observers-CDkeR0nI.js +199 -0
  306. package/dist/prod/packages/shared-chunks/on-B5NVufs_.js +228 -0
  307. package/dist/prod/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  308. package/dist/prod/packages/shared-chunks/or-3AxY5TPj.js +91 -0
  309. package/dist/{dev/packages/shared-chunks/program-DfV0v8aa.js → prod/packages/shared-chunks/program-B7CWdS8W.js} +1 -2
  310. package/dist/{dev/packages/shared-chunks/program-context-sJz0oHOA.js → prod/packages/shared-chunks/program-context-B8HKU7wu.js} +4 -3
  311. package/dist/prod/packages/shared-chunks/property_get-CAFdpRyu.js +121 -0
  312. package/dist/prod/packages/shared-chunks/{property_set-B2sZxeCw.js → property_set-BunbMFtp.js} +3 -5
  313. package/dist/prod/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  314. package/dist/prod/packages/shared-chunks/{reference-BNqcwZWH.js → reference-BshxG6wn.js} +3 -3
  315. package/dist/{dev/packages/shared-chunks/registers-ylirb0dq.js → prod/packages/shared-chunks/registers-C_W2qYHJ.js} +1 -1
  316. package/dist/{dev/packages/shared-chunks/rehydrate-builder-BRH0p0wA.js → prod/packages/shared-chunks/rehydrate-builder-DJ8k-6fg.js} +7 -7
  317. package/dist/prod/packages/shared-chunks/{render-D78XHdek.js → render-DkJJmoI4.js} +488 -12
  318. package/dist/{dev/packages/shared-chunks/chunk-3SQBS3Y5-Cj4eryg1.js → prod/packages/shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js} +4 -59
  319. package/dist/{dev/packages/shared-chunks/serialize-builder-DiO7Ak9_.js → prod/packages/shared-chunks/serialize-builder-R3Ozg0sC.js} +2 -10
  320. package/dist/prod/packages/shared-chunks/set_properties-LT3RzRmJ.js +48 -0
  321. package/dist/prod/packages/shared-chunks/{setup-registry-Cs-7NIJU.js → setup-registry-C2KfZJWI.js} +34 -13
  322. package/dist/prod/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  323. package/dist/prod/packages/shared-chunks/super-BBBjgF69.js +91 -0
  324. package/dist/prod/packages/shared-chunks/syscall-ops-BPFtDquC.js +133 -0
  325. package/dist/prod/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  326. package/dist/prod/packages/shared-chunks/template-only-BtLl0uH0.js +78 -0
  327. package/dist/prod/packages/shared-chunks/textarea-CHqL0Rdh.js +454 -0
  328. package/dist/prod/packages/shared-chunks/{tracked-Cl5l4v8b.js → tracked-DAVrVqJl.js} +5 -4
  329. package/dist/prod/packages/shared-chunks/tracked-data-C83f5V5S.js +31 -0
  330. package/dist/prod/packages/shared-chunks/unique-id-CfHImDRV.js +32 -0
  331. package/dist/prod/packages/shared-chunks/vm-ops-ImHv0Wtg.js +12 -0
  332. package/dist/prod/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  333. package/docs/data.json +1237 -1023
  334. package/lib/index.js +0 -1
  335. package/package.json +14 -12
  336. package/types/stable/@ember/-internals/container/lib/registry.d.ts +1 -1
  337. package/types/stable/@ember/-internals/deprecations/index.d.ts +1 -1
  338. package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
  339. package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +1 -1
  340. package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
  341. package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
  342. package/types/stable/@ember/-internals/glimmer/lib/component-managers/route-template.d.ts +2 -2
  343. package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +9 -7
  344. package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +1 -1
  345. package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +6 -2
  346. package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +1 -1
  347. package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +1 -1
  348. package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
  349. package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +1 -1
  350. package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +1 -1
  351. package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +3 -2
  352. package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +1 -1
  353. package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +2 -1
  354. package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +1 -1
  355. package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +1 -1
  356. package/types/stable/@ember/-internals/meta/lib/meta.d.ts +3 -2
  357. package/types/stable/@ember/-internals/metal/lib/cache.d.ts +1 -1
  358. package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +3 -2
  359. package/types/stable/@ember/-internals/metal/lib/computed.d.ts +1 -1
  360. package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +1 -1
  361. package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +1 -1
  362. package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -1
  363. package/types/stable/@ember/-internals/metal/lib/observer.d.ts +1 -1
  364. package/types/stable/@ember/-internals/metal/lib/properties.d.ts +1 -1
  365. package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +1 -1
  366. package/types/stable/@ember/-internals/metal/lib/tags.d.ts +2 -1
  367. package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +1 -1
  368. package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +1 -1
  369. package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +1 -1
  370. package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +1 -1
  371. package/types/stable/@ember/-internals/views/index.d.ts +0 -1
  372. package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +1 -1
  373. package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +2 -2
  374. package/types/stable/@ember/-internals/views/lib/views/states.d.ts +1 -1
  375. package/types/stable/@ember/application/index.d.ts +5 -4
  376. package/types/stable/@ember/application/instance.d.ts +4 -3
  377. package/types/stable/@ember/application/namespace.d.ts +1 -1
  378. package/types/stable/@ember/array/proxy.d.ts +4 -3
  379. package/types/stable/@ember/component/helper.d.ts +1 -1
  380. package/types/stable/@ember/component/index.d.ts +6 -3
  381. package/types/stable/@ember/controller/index.d.ts +2 -2
  382. package/types/stable/@ember/debug/container-debug-adapter.d.ts +1 -1
  383. package/types/stable/@ember/engine/index.d.ts +3 -3
  384. package/types/stable/@ember/engine/instance.d.ts +4 -3
  385. package/types/stable/@ember/helper/index.d.ts +167 -5
  386. package/types/stable/@ember/modifier/index.d.ts +1 -1
  387. package/types/stable/@ember/object/-internals.d.ts +2 -2
  388. package/types/stable/@ember/object/compat.d.ts +2 -2
  389. package/types/stable/@ember/object/computed.d.ts +3 -1
  390. package/types/stable/@ember/object/evented.d.ts +1 -1
  391. package/types/stable/@ember/object/events.d.ts +1 -1
  392. package/types/stable/@ember/object/index.d.ts +8 -2
  393. package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +1 -1
  394. package/types/stable/@ember/object/mixin.d.ts +1 -1
  395. package/types/stable/@ember/object/observers.d.ts +1 -1
  396. package/types/stable/@ember/object/proxy.d.ts +1 -1
  397. package/types/stable/@ember/reactive/collections.d.ts +6 -6
  398. package/types/stable/@ember/renderer/index.d.ts +2 -2
  399. package/types/stable/@ember/routing/index.d.ts +1 -1
  400. package/types/stable/@ember/routing/lib/controller_for.d.ts +2 -2
  401. package/types/stable/@ember/routing/route.d.ts +2 -2
  402. package/types/stable/@ember/routing/router.d.ts +2 -2
  403. package/types/stable/@ember/service/index.d.ts +1 -1
  404. package/types/stable/@ember/template/index.d.ts +1 -1
  405. package/types/stable/@ember/template-compiler/lib/dasherize-component-name.d.ts +1 -1
  406. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-attrs.d.ts +1 -1
  407. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-named-outlets.d.ts +1 -1
  408. package/types/stable/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +1 -1
  409. package/types/stable/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +1 -1
  410. package/types/stable/@ember/template-compiler/lib/plugins/auto-import-builtins.d.ts +1 -4
  411. package/types/stable/@ember/template-compiler/lib/plugins/transform-action-syntax.d.ts +1 -1
  412. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-in-into-each.d.ts +1 -1
  413. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-track-array.d.ts +1 -1
  414. package/types/stable/@ember/template-compiler/lib/plugins/transform-in-element.d.ts +1 -1
  415. package/types/stable/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +1 -1
  416. package/types/stable/@ember/template-compiler/lib/plugins/transform-resolutions.d.ts +1 -1
  417. package/types/stable/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +1 -1
  418. package/types/stable/@ember/template-compiler/lib/plugins/utils.d.ts +1 -1
  419. package/types/stable/@ember/template-compiler/lib/system/calculate-location-display.d.ts +1 -1
  420. package/types/stable/@ember/template-compiler/lib/types.d.ts +2 -1
  421. package/types/stable/@ember/template-factory/index.d.ts +1 -1
  422. package/types/stable/@glimmer/compiler/lib/builder/builder-interface.d.ts +2 -2
  423. package/types/stable/@glimmer/compiler/lib/builder/builder.d.ts +2 -2
  424. package/types/stable/@glimmer/compiler/lib/compiler.d.ts +1 -1
  425. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/context.d.ts +2 -1
  426. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/index.d.ts +2 -1
  427. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/impl.d.ts +2 -1
  428. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/curry.d.ts +1 -1
  429. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/dynamic-vars.d.ts +1 -1
  430. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/has-block.d.ts +2 -1
  431. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/if-unless.d.ts +1 -1
  432. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/log.d.ts +1 -1
  433. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/classified.d.ts +1 -1
  434. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/component.d.ts +1 -1
  435. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/simple-element.d.ts +2 -1
  436. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/expressions.d.ts +1 -1
  437. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/statements.d.ts +1 -1
  438. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/strict-mode.d.ts +1 -1
  439. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/expressions.d.ts +1 -1
  440. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/mir.d.ts +3 -1
  441. package/types/stable/@glimmer/compiler/lib/shared/result.d.ts +1 -1
  442. package/types/stable/@glimmer/manager/lib/public/component.d.ts +1 -1
  443. package/types/stable/@glimmer/manager/lib/util/args-proxy.d.ts +1 -1
  444. package/types/stable/@glimmer/manager/lib/util/capabilities.d.ts +1 -1
  445. package/types/stable/@glimmer/node/lib/node-dom-helper.d.ts +1 -1
  446. package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/components.d.ts +1 -1
  447. package/types/stable/@glimmer/runtime/index.d.ts +7 -4
  448. package/types/stable/@glimmer/runtime/lib/compiled/expressions/concat.d.ts +1 -1
  449. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/-debug-strip.d.ts +4 -3
  450. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/component.d.ts +1 -1
  451. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/dom.d.ts +2 -2
  452. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/vm.d.ts +2 -2
  453. package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +1 -1
  454. package/types/stable/@glimmer/runtime/lib/curried-value.d.ts +1 -1
  455. package/types/stable/@glimmer/runtime/lib/helpers/and.d.ts +3 -0
  456. package/types/stable/@glimmer/runtime/lib/helpers/gt.d.ts +8 -0
  457. package/types/stable/@glimmer/runtime/lib/helpers/gte.d.ts +8 -0
  458. package/types/stable/@glimmer/runtime/lib/helpers/invoke.d.ts +1 -1
  459. package/types/stable/@glimmer/runtime/lib/helpers/lt.d.ts +8 -0
  460. package/types/stable/@glimmer/runtime/lib/helpers/lte.d.ts +8 -0
  461. package/types/stable/@glimmer/runtime/lib/helpers/not.d.ts +3 -0
  462. package/types/stable/@glimmer/runtime/lib/helpers/or.d.ts +3 -0
  463. package/types/stable/@glimmer/runtime/lib/opcodes.d.ts +2 -2
  464. package/types/stable/@glimmer/runtime/lib/references/class-list.d.ts +1 -1
  465. package/types/stable/@glimmer/runtime/lib/references/curry-value.d.ts +1 -1
  466. package/types/stable/@glimmer/runtime/lib/render.d.ts +1 -1
  467. package/types/stable/@glimmer/runtime/lib/scope.d.ts +1 -1
  468. package/types/stable/@glimmer/runtime/lib/vm/append.d.ts +3 -2
  469. package/types/stable/@glimmer/runtime/lib/vm/arguments.d.ts +2 -2
  470. package/types/stable/@glimmer/runtime/lib/vm/content/text.d.ts +1 -1
  471. package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +1 -1
  472. package/types/stable/@glimmer/runtime/lib/vm/low-level.d.ts +2 -1
  473. package/types/stable/@glimmer/runtime/lib/vm/rehydrate-builder.d.ts +1 -1
  474. package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -1
  475. package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
  476. package/types/stable/@glimmer/tracking/index.d.ts +2 -1
  477. package/types/stable/@glimmer/tracking/primitives/cache.d.ts +1 -1
  478. package/types/stable/index.d.ts +7 -1
  479. package/dist/dev/packages/@ember/-internals/views/lib/component_lookup.js +0 -14
  480. package/dist/dev/packages/shared-chunks/assert-CUCJBR2C.js +0 -19
  481. package/dist/dev/packages/shared-chunks/constants-BbdWMvgs.js +0 -213
  482. package/dist/dev/packages/shared-chunks/dynamic-CgX8M02_.js +0 -3823
  483. package/dist/dev/packages/shared-chunks/element-builder-BpJIoi99.js +0 -404
  484. package/dist/dev/packages/shared-chunks/fragment-Cc5k9Oy4.js +0 -911
  485. package/dist/dev/packages/shared-chunks/index-RzG0Jvjx.js +0 -6306
  486. package/dist/dev/packages/shared-chunks/mandatory-setter-DHZe7-kW.js +0 -425
  487. package/dist/dev/packages/shared-chunks/observers-Bj9qLVau.js +0 -2062
  488. package/dist/dev/packages/shared-chunks/set_properties-kVGzZL_a.js +0 -100
  489. package/dist/dev/packages/shared-chunks/transform-resolutions-D-YtZ0_g.js +0 -7458
  490. package/dist/prod/packages/@ember/-internals/views/lib/component_lookup.js +0 -14
  491. package/dist/prod/packages/shared-chunks/constants-DThhT5fu.js +0 -210
  492. package/dist/prod/packages/shared-chunks/fragment-D7nBU9ae.js +0 -925
  493. package/dist/prod/packages/shared-chunks/index-r-Dz_hzt.js +0 -5931
  494. package/dist/prod/packages/shared-chunks/observers-tZ2aOzr4.js +0 -714
  495. package/dist/prod/packages/shared-chunks/set_properties-C1T46IiN.js +0 -101
  496. package/dist/prod/packages/shared-chunks/super-Cm_a_cLQ.js +0 -275
  497. package/dist/prod/packages/shared-chunks/transform-resolutions-DR4GLmR2.js +0 -6936
  498. package/types/stable/@ember/-internals/views/lib/component_lookup.d.ts +0 -8
  499. package/dist/prod/packages/shared-chunks/{collections-GpG8lT2g.js → collections-C3Y8z_9v.js} +9 -9
@@ -1,911 +0,0 @@
1
- import { e as $v0, f as $t1, g as $t0, h as $s1, $ as $s0, d as $sp, c as $fp, b as $ra, a as $pc } from './registers-ylirb0dq.js';
2
- import './debug-to-string-CFb7h0lY.js';
3
- import { b as assertNever } from './assert-CUCJBR2C.js';
4
-
5
- const CURRIED_COMPONENT = 0;
6
- const CURRIED_HELPER = 1;
7
- const CURRIED_MODIFIER = 2;
8
-
9
- const SIGN_BIT = -536870913;
10
- const MAX_INT = ~SIGN_BIT - 1;
11
- const MIN_INT = ~MAX_INT;
12
- function isHandle(value) {
13
- return value >= 0;
14
- }
15
- function constants(...values) {
16
- return [false, true, null, undefined, ...values];
17
- }
18
- function isSmallInt(value) {
19
- return value % 1 === 0 && value <= MAX_INT && value >= MIN_INT;
20
- }
21
- function encodeNegative(num) {
22
- return num & SIGN_BIT;
23
- }
24
- function decodeNegative(num) {
25
- return num | ~SIGN_BIT;
26
- }
27
- function encodePositive(num) {
28
- return ~num;
29
- }
30
- function decodePositive(num) {
31
- return ~num;
32
- }
33
- function encodeHandle(num) {
34
- return num;
35
- }
36
- function decodeHandle(num) {
37
- return num;
38
- }
39
- function encodeImmediate(num) {
40
- num |= 0;
41
- return num < 0 ? encodeNegative(num) : encodePositive(num);
42
- }
43
- function decodeImmediate(num) {
44
- num |= 0;
45
- return num > SIGN_BIT ? decodePositive(num) : decodeNegative(num);
46
- }
47
- [1, -1].forEach(x => decodeImmediate(encodeImmediate(x)));
48
-
49
- const VM_HELPER_OP = 16;
50
- const VM_SET_NAMED_VARIABLES_OP = 17;
51
- const VM_SET_BLOCKS_OP = 18;
52
- const VM_SET_VARIABLE_OP = 19;
53
- const VM_SET_BLOCK_OP = 20;
54
- const VM_GET_VARIABLE_OP = 21;
55
- const VM_GET_PROPERTY_OP = 22;
56
- const VM_GET_BLOCK_OP = 23;
57
- const VM_SPREAD_BLOCK_OP = 24;
58
- const VM_HAS_BLOCK_OP = 25;
59
- const VM_HAS_BLOCK_PARAMS_OP = 26;
60
- const VM_CONCAT_OP = 27;
61
- const VM_CONSTANT_OP = 28;
62
- const VM_CONSTANT_REFERENCE_OP = 29;
63
- const VM_PRIMITIVE_OP = 30;
64
- const VM_PRIMITIVE_REFERENCE_OP = 31;
65
- const VM_DUP_OP = 33;
66
- const VM_POP_OP = 34;
67
- const VM_LOAD_OP = 35;
68
- const VM_FETCH_OP = 36;
69
- const VM_ROOT_SCOPE_OP = 37;
70
- const VM_VIRTUAL_ROOT_SCOPE_OP = 38;
71
- const VM_CHILD_SCOPE_OP = 39;
72
- const VM_POP_SCOPE_OP = 40;
73
- const VM_TEXT_OP = 41;
74
- const VM_COMMENT_OP = 42;
75
- const VM_APPEND_HTML_OP = 43;
76
- const VM_APPEND_SAFE_HTML_OP = 44;
77
- const VM_APPEND_DOCUMENT_FRAGMENT_OP = 45;
78
- const VM_APPEND_NODE_OP = 46;
79
- const VM_APPEND_TEXT_OP = 47;
80
- const VM_OPEN_ELEMENT_OP = 48;
81
- const VM_OPEN_DYNAMIC_ELEMENT_OP = 49;
82
- const VM_PUSH_REMOTE_ELEMENT_OP = 50;
83
- const VM_STATIC_ATTR_OP = 51;
84
- const VM_DYNAMIC_ATTR_OP = 52;
85
- const VM_COMPONENT_ATTR_OP = 53;
86
- const VM_FLUSH_ELEMENT_OP = 54;
87
- const VM_CLOSE_ELEMENT_OP = 55;
88
- const VM_POP_REMOTE_ELEMENT_OP = 56;
89
- const VM_MODIFIER_OP = 57;
90
- const VM_BIND_DYNAMIC_SCOPE_OP = 58;
91
- const VM_PUSH_DYNAMIC_SCOPE_OP = 59;
92
- const VM_POP_DYNAMIC_SCOPE_OP = 60;
93
- const VM_COMPILE_BLOCK_OP = 61;
94
- const VM_PUSH_BLOCK_SCOPE_OP = 62;
95
- const VM_PUSH_SYMBOL_TABLE_OP = 63;
96
- const VM_INVOKE_YIELD_OP = 64;
97
- const VM_JUMP_IF_OP = 65;
98
- const VM_JUMP_UNLESS_OP = 66;
99
- const VM_JUMP_EQ_OP = 67;
100
- const VM_ASSERT_SAME_OP = 68;
101
- const VM_ENTER_OP = 69;
102
- const VM_EXIT_OP = 70;
103
- const VM_TO_BOOLEAN_OP = 71;
104
- const VM_ENTER_LIST_OP = 72;
105
- const VM_EXIT_LIST_OP = 73;
106
- const VM_ITERATE_OP = 74;
107
- const VM_MAIN_OP = 75;
108
- const VM_CONTENT_TYPE_OP = 76;
109
- const VM_CURRY_OP = 77;
110
- const VM_PUSH_COMPONENT_DEFINITION_OP = 78;
111
- const VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP = 79;
112
- const VM_RESOLVE_DYNAMIC_COMPONENT_OP = 80;
113
- const VM_RESOLVE_CURRIED_COMPONENT_OP = 81;
114
- const VM_PUSH_ARGS_OP = 82;
115
- const VM_PUSH_EMPTY_ARGS_OP = 83;
116
- const VM_PREPARE_ARGS_OP = 85;
117
- const VM_CAPTURE_ARGS_OP = 86;
118
- const VM_CREATE_COMPONENT_OP = 87;
119
- const VM_REGISTER_COMPONENT_DESTRUCTOR_OP = 88;
120
- const VM_PUT_COMPONENT_OPERATIONS_OP = 89;
121
- const VM_GET_COMPONENT_SELF_OP = 90;
122
- const VM_GET_COMPONENT_TAG_NAME_OP = 91;
123
- const VM_GET_COMPONENT_LAYOUT_OP = 92;
124
- const VM_POPULATE_LAYOUT_OP = 95;
125
- const VM_INVOKE_COMPONENT_LAYOUT_OP = 96;
126
- const VM_BEGIN_COMPONENT_TRANSACTION_OP = 97;
127
- const VM_COMMIT_COMPONENT_TRANSACTION_OP = 98;
128
- const VM_DID_CREATE_ELEMENT_OP = 99;
129
- const VM_DID_RENDER_LAYOUT_OP = 100;
130
- const VM_DEBUGGER_OP = 103;
131
- const VM_STATIC_COMPONENT_ATTR_OP = 105;
132
- const VM_DYNAMIC_CONTENT_TYPE_OP = 106;
133
- const VM_DYNAMIC_HELPER_OP = 107;
134
- const VM_DYNAMIC_MODIFIER_OP = 108;
135
- const VM_IF_INLINE_OP = 109;
136
- const VM_NOT_OP = 110;
137
- const VM_GET_DYNAMIC_VAR_OP = 111;
138
- const VM_LOG_OP = 112;
139
- const VM_SYSCALL_SIZE = 113;
140
-
141
- const VM_PUSH_FRAME_OP = 0;
142
- const VM_POP_FRAME_OP = 1;
143
- const VM_INVOKE_VIRTUAL_OP = 2;
144
- const VM_INVOKE_STATIC_OP = 3;
145
- const VM_JUMP_OP = 4;
146
- const VM_RETURN_OP = 5;
147
- const VM_RETURN_TO_OP = 6;
148
- const VM_MACHINE_SIZE = 7;
149
- function isMachineOp(value) {
150
- return value >= 0 && value <= 15;
151
- }
152
-
153
- function decodeCurry(curry) {
154
- switch (curry) {
155
- case CURRIED_COMPONENT:
156
- return 'component';
157
- case CURRIED_HELPER:
158
- return 'helper';
159
- case CURRIED_MODIFIER:
160
- return 'modifier';
161
- default:
162
- throw Error(`Unexpected curry value: ${curry}`);
163
- }
164
- }
165
- function decodeRegister(register) {
166
- switch (register) {
167
- case $pc:
168
- return '$pc';
169
- case $ra:
170
- return '$ra';
171
- case $fp:
172
- return '$fp';
173
- case $sp:
174
- return '$sp';
175
- case $s0:
176
- return '$s0';
177
- case $s1:
178
- return '$s1';
179
- case $t0:
180
- return '$t0';
181
- case $t1:
182
- return '$t1';
183
- case $v0:
184
- return '$v0';
185
- default:
186
- return `$bug${register}`;
187
- }
188
- }
189
- function decodePrimitive(primitive, constants) {
190
- if (primitive >= 0) {
191
- return constants.getValue(decodeHandle(primitive));
192
- }
193
- return decodeImmediate(primitive);
194
- }
195
-
196
- const todo = ({
197
- label,
198
- value
199
- }) => ['error:operand', value, {
200
- label
201
- }];
202
-
203
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
204
-
205
- class Disassembler {
206
- static build(builder) {
207
- return builder(new Disassembler()).#disms;
208
- }
209
- #disms;
210
- constructor() {
211
- this.#disms = {};
212
- }
213
- addNullable(names, dism) {
214
- for (const name of names) {
215
- this.#disms[name] = dism;
216
- this.#disms[`${name}?`] = dism;
217
- }
218
- return this;
219
- }
220
- add(names, dism) {
221
- const add = (name, dism) => this.#disms[name] = dism;
222
- for (const name of names) {
223
- add(name, dism);
224
- }
225
- return this;
226
- }
227
- }
228
- Disassembler.build(d => {
229
- return d.add(['imm/u32', 'imm/i32', 'imm/u32{todo}', 'imm/i32{todo}'], ({
230
- value
231
- }) => ['number', value]).add(['const/i32[]'], ({
232
- value,
233
- constants
234
- }) => ['array', constants.getArray(value), {
235
- kind: Number
236
- }]).add(['const/bool'], ({
237
- value
238
- }) => ['boolean', !!value]).add(['imm/bool'], ({
239
- value,
240
- constants
241
- }) => ['boolean', constants.getValue(decodeHandle(value))]).add(['handle'], ({
242
- constants,
243
- value
244
- }) => ['constant', constants.getValue(value)]).add(['handle/block'], ({
245
- value,
246
- heap
247
- }) => ['instruction', heap.getaddr(value)]).add(['imm/pc'], ({
248
- value
249
- }) => ['instruction', value]).add(['const/any[]'], ({
250
- value,
251
- constants
252
- }) => ['array', constants.getArray(value)]).add(['const/primitive'], ({
253
- value,
254
- constants
255
- }) => ['primitive', decodePrimitive(value, constants)]).add(['register'], ({
256
- value
257
- }) => ['register', decodeRegister(value)]).add(['const/any'], ({
258
- value,
259
- constants
260
- }) => ['dynamic', constants.getValue(value)]).add(['variable'], ({
261
- value,
262
- meta
263
- }) => {
264
- return ['variable', value, {
265
- name: meta?.symbols.lexical?.at(value) ?? null
266
- }];
267
- }).add(['register/instruction'], ({
268
- value
269
- }) => ['instruction', value]).add(['imm/enum<curry>'], ({
270
- value
271
- }) => ['enum<curry>', decodeCurry(value)]).addNullable(['const/str'], ({
272
- value,
273
- constants
274
- }) => ['string', constants.getValue(value)]).addNullable(['const/str[]'], ({
275
- value,
276
- constants
277
- }) => ['array', constants.getArray(value), {
278
- kind: String
279
- }]).add(['imm/block:handle'], todo).add(['const/definition'], todo).add(['const/fn'], todo).add(['instruction/relative'], ({
280
- value,
281
- offset
282
- }) => ['instruction', offset + value]).add(['register/sN'], todo).add(['register/stack'], todo).add(['register/tN'], todo).add(['register/v0'], todo);
283
- });
284
-
285
- /* This file is generated by build/debug.js */
286
-
287
- new Array(VM_SYSCALL_SIZE).fill(null);
288
- new Array(VM_MACHINE_SIZE).fill(null);
289
-
290
- const ANNOTATION_STYLES = ['background-color: oklch(93% 0.03 300); color: oklch(34% 0.18 300)', 'background-color: oklch(93% 0.03 250); color: oklch(34% 0.18 250)', 'background-color: oklch(93% 0.03 200); color: oklch(34% 0.18 200)', 'background-color: oklch(93% 0.03 150); color: oklch(34% 0.18 150)', 'background-color: oklch(93% 0.03 100); color: oklch(34% 0.18 100)', 'background-color: oklch(93% 0.03 50); color: oklch(34% 0.18 50)', 'background-color: oklch(93% 0.03 0); color: oklch(34% 0.18 0)'];
291
-
292
- /**
293
- * The `LogFragmentBuffer` is responsible for collecting the fragments that are logged to the
294
- * `DebugLogger` so that they can be accumulated during a group and flushed together.
295
- *
296
- * This queuing serves two purposes:
297
- *
298
- * 1. To allow the individual fragments that make up a single line to append their values to
299
- * the current line. To accomplish this, each fragment can append static content and its
300
- * formatting specifier (e.g. `%o`) to the accumulated {@link #template} *and* append the
301
- * value to format to the {@link #substitutions} array.
302
- * 2. To allow logs that refer to objects to be represented as footnotes in the current line,
303
- * with the footnote to be printed in a later line.
304
- *
305
- * This allows a list of fragments, each of which represent formattable values, to be flattened
306
- * into a single template string and an array of values to format.
307
- *
308
- * ## Footnotes
309
- *
310
- * An opcode slice containing constant references will be logged like this:
311
- *
312
- * ```
313
- * ...
314
- * 362. (PushArgs names=[] block-names=[] flags=16)
315
- * 366. (Helper helper=[0])
316
- * [0] glimmerHelper()
317
- * 368. (PopFrame)
318
- * 369. (Fetch register=$v0)
319
- * 371. (Primitive constant="/index.html")
320
- * ...
321
- * ```
322
- *
323
- * The fragment for line `366` includes an `ObjectFragment` for the helper value. When logged,
324
- * the object will be represented as a footnote and the value will be printed in a later
325
- * line.
326
- */
327
- class LogFragmentBuffer {
328
- /**
329
- * The first parameter to the `console.log` family of APIs is a *template* that can use
330
- * format specifiers (e.g. `%c`, `%o`, and `%O`) to refer to subsequent parameters.
331
- *
332
- * When a fragment is appended to a line,
333
- */
334
- #template = '';
335
-
336
- /**
337
- * Each format specified in the {@link #template} corresponds to a value in the
338
- * `#substitutions` array.
339
- */
340
- #substitutions = [];
341
-
342
- /**
343
- * The logging options for the buffer, which currently only contains `showSubtle`.
344
- *
345
- * When fragments call the buffer's {@linkcode append} method, they specify whether the
346
- * content to append is subtle or not. If the buffer is not configured to show subtle
347
- * content, the content is not appended.
348
- *
349
- * This allows fragments to append content to the buffer without having to know how the
350
- * buffer is configured.
351
- */
352
- #options;
353
-
354
- /**
355
- * A single line can produce multiple queued log entries. This happens when fragments
356
- * append *footnotes* to the buffer. A *reference* to the footnote is appended to the
357
- * primary line, and a line containing the *value* of the footnote is appended to the
358
- * `#queued` array.
359
- *
360
- * Both the primary line and any queued footnotes are flushed together when the buffer
361
- * is flushed.
362
- */
363
- #footnotes = [];
364
- #nextFootnote = 1;
365
- #style = 0;
366
- constructor(options) {
367
- this.#options = options;
368
- }
369
-
370
- /**
371
- * Add a footnoted value to the current buffer.
372
- *
373
- * If the `subtle` option is set, the fragment will only be printed if the buffer is configured
374
- * to show subtle content.
375
- *
376
- * This method takes two callbacks: `add` and `append`.
377
- *
378
- * The `append` callback behaves like {@linkcode append}, but without the `subtle` argument. If
379
- * `addFootnoted` is called with `subtle: false`, then the callback will never be called, so
380
- * there is no need to pass the `subtle` argument again.
381
- *
382
- * The `add` callback is responsible for appending the footnote itself to the buffer. The first
383
- * parameter to `add` (`useNumber`) specifies whether the caller has used the footnote number
384
- * to refer to the footnote.
385
- *
386
- * This is typically true, but fragments can specify an alternative annotation that should be used
387
- * instead of the default footnote number. In that case, the footnote number is not used, and the
388
- * next footnote is free to use it.
389
- *
390
- * The `add` callback also takes a template string and an optional list of substitutions, which
391
- * describe the way the footnote itself should be formatted.
392
- */
393
- addFootnoted(subtle, add) {
394
- if (subtle && !this.#options.showSubtle) return;
395
- const child = new LogFragmentBuffer(this.#options);
396
- const style = ANNOTATION_STYLES[this.#style++ % ANNOTATION_STYLES.length];
397
- const usedNumber = add({
398
- n: this.#nextFootnote,
399
- style
400
- }, child);
401
- if (usedNumber) {
402
- this.#nextFootnote += 1;
403
- }
404
- this.#footnotes.push({
405
- type: 'line',
406
- subtle: false,
407
- template: child.#template,
408
- substitutions: child.#substitutions
409
- });
410
- this.#footnotes.push(...child.#footnotes);
411
- }
412
-
413
- /**
414
- * Append a fragment to the current buffer.
415
- *
416
- * If the `subtle` option is set, the fragment will only be printed if the buffer is configured
417
- * to show subtle content.
418
- */
419
- append(subtle, template, ...substitutions) {
420
- if (subtle && !this.#options.showSubtle) return;
421
- this.#template += template;
422
- this.#substitutions.push(...substitutions);
423
- }
424
- #mapLine(line) {
425
- if (line.subtle && !this.#options.showSubtle) return [];
426
- return [{
427
- type: 'line',
428
- line: [line.template, ...line.substitutions]
429
- }];
430
- }
431
- flush() {
432
- return [{
433
- type: 'line',
434
- line: [this.#template, ...this.#substitutions]
435
- }, ...this.#footnotes.flatMap(queued => this.#mapLine(queued))];
436
- }
437
- }
438
-
439
- // inspired by https://github.com/ChromeDevTools/devtools-frontend/blob/c2c17396c9e0da3f1ce6514c3a946f88a06b17f2/front_end/ui/legacy/themeColors.css#L65
440
- const STYLES = {
441
- var: 'color: grey',
442
- varReference: 'color: blue; text-decoration: underline',
443
- varBinding: 'color: blue;',
444
- specialVar: 'color: blue',
445
- prop: 'color: grey',
446
- specialProp: 'color: red',
447
- token: 'color: green',
448
- def: 'color: blue',
449
- builtin: 'color: blue',
450
- punct: 'color: GrayText',
451
- kw: 'color: rgb(185 0 99 / 100%);',
452
- type: 'color: teal',
453
- number: 'color: blue',
454
- string: 'color: red',
455
- null: 'color: grey',
456
- specialString: 'color: darkred',
457
- atom: 'color: blue',
458
- attrName: 'color: orange',
459
- attrValue: 'color: blue',
460
- boolean: 'color: blue',
461
- comment: 'color: green',
462
- meta: 'color: grey',
463
- register: 'color: purple',
464
- constant: 'color: purple',
465
- dim: 'color: grey',
466
- internals: 'color: lightgrey; font-style: italic',
467
- diffAdd: 'color: Highlight',
468
- diffDelete: 'color: SelectedItemText; background-color: SelectedItem',
469
- diffChange: 'color: MarkText; background-color: Mark',
470
- sublabel: 'font-style: italic; color: grey',
471
- error: 'color: red',
472
- label: 'text-decoration: underline',
473
- errorLabel: 'color: darkred; font-style: italic',
474
- errorMessage: 'color: darkred; text-decoration: underline',
475
- stack: 'color: grey; font-style: italic',
476
- unbold: 'font-weight: normal',
477
- pointer: 'background-color: lavender; color: indigo',
478
- pointee: 'background-color: lavender; color: indigo',
479
- focus: 'font-weight: bold',
480
- focusColor: 'background-color: lightred; color: darkred'
481
- };
482
- function mergeStyle(a, b) {
483
- if (a && b) {
484
- return `${a}; ${b}`;
485
- } else {
486
- return a || b;
487
- }
488
- }
489
-
490
- function intoFormat(format) {
491
- if (typeof format === 'string') {
492
- return {
493
- style: STYLES[format]
494
- };
495
- } else {
496
- return format;
497
- }
498
- }
499
- function formats(...formats) {
500
- return formats.map(c => intoFormat(c).style).join('; ');
501
- }
502
-
503
- const FORMATTERS = {
504
- value: '%O',
505
- string: '%s',
506
- integer: '%d',
507
- float: '%f',
508
- special: '%o'
509
- };
510
-
511
- /**
512
- * A leaf fragment that represents an arbitrary value.
513
- *
514
- * When the value is a primitive, the fragment is appended to the buffer as if it was an instance of
515
- * the appropriate leaf fragment type (e.g. strings are appended as if they were `StringFragment`).
516
- *
517
- * Otherwise, `ValueFragment` is appended to the current line as a footnote reference and the value
518
- * itself is appended to a later line that *defines* the footnote using the `%O` format specifier.
519
- */
520
-
521
- /**
522
- * A leaf fragment that represents a string value.
523
- *
524
- * Corresponds to the `%s` format specifier.
525
- */
526
-
527
- /**
528
- * A leaf fragment that represents an integer value.
529
- *
530
- * Corresponds to the `%d` format specifier.
531
- */
532
-
533
- /**
534
- * A leaf fragment that represents a float value.
535
- *
536
- * Corresponds to the `%f` format specifier.
537
- */
538
-
539
- /**
540
- * A leaf fragment that represents a DOM node.
541
- *
542
- * Corresponds to the `%o` format specifier.
543
- */
544
-
545
- /**
546
- * The list of leaf fragment types correspond exactly to the list of console.log
547
- * format specifiers.
548
- */
549
-
550
- /**
551
- * @import { StyleName } from './styles';
552
- */
553
-
554
- /**
555
- * Fragment is the most fundamental building block of the debug logger.
556
- *
557
- */
558
- class Fragment {
559
- static integer(value, options) {
560
- return new Fragment({
561
- kind: 'integer',
562
- value,
563
- ...options
564
- });
565
- }
566
- static float(value, options) {
567
- return new Fragment({
568
- kind: 'float',
569
- value,
570
- ...options
571
- });
572
- }
573
- static string(value, options) {
574
- return new Fragment({
575
- kind: 'string',
576
- value,
577
- ...options
578
- });
579
- }
580
- static special(value, options) {
581
- return new Fragment({
582
- kind: 'special',
583
- value,
584
- ...options
585
- });
586
- }
587
- #type;
588
- constructor(type) {
589
- this.#type = type;
590
- }
591
-
592
- /**
593
- * A subtle fragment is only printed if the `showSubtle` option is set.
594
- *
595
- * Returns true if this fragment is a subtle leaf or is a multi fragment
596
- * with all subtle leaves.
597
- */
598
- isSubtle() {
599
- return this.leaves().every(leaf => leaf.#type.subtle);
600
- }
601
-
602
- /**
603
- * If the current fragment is not empty, apply `ifPresent` to the current
604
- * fragment. Otherwise, do nothing.
605
- *
606
- * If the current fragment is subtle, the result is also subtle.
607
- */
608
- map(ifPresent) {
609
- if (this.isEmpty()) return this;
610
- const fragment = ifPresent(this);
611
- return this.isSubtle() ? fragment.subtle() : fragment;
612
- }
613
-
614
- /**
615
- * A fragment is empty if it should not be printed with the provided display options.
616
- *
617
- * This means that if a fragment is subtle and `showSubtle` is false, the fragment is empty.
618
- */
619
- isEmpty(options = {
620
- showSubtle: true
621
- }) {
622
- return this.leaves().every(leaf => !leaf.#shouldShow(options));
623
- }
624
-
625
- /**
626
- * Returns an array of {@linkcode LeafFragment}s that make up the current
627
- * fragment.
628
- *
629
- * This effectively flattens any number of nested multi-fragments into a flat array of leaf
630
- * fragments.
631
- */
632
- leaves() {
633
- if (this.#type.kind === 'multi') {
634
- return this.#type.value.flatMap(f => f.leaves());
635
- } else if (this.#type.kind === 'string' && this.#type.value === '') {
636
- return [];
637
- } else {
638
- return [this];
639
- }
640
- }
641
-
642
- /**
643
- * Returns a fragment with the specified subtle status without mutating the current fragment.
644
- *
645
- * If `isSubtle` is true, the fragment will also be styled with the `subtle` style.
646
- */
647
- subtle(isSubtle = true) {
648
- if (!this.isSubtle() && !isSubtle) {
649
- return this;
650
- }
651
- const fragment = this.#subtle(isSubtle);
652
- return isSubtle ? fragment.styleAll('dim') : fragment;
653
- }
654
- #subtle(isSubtle) {
655
- if (this.#type.kind === 'multi') {
656
- return new Fragment({
657
- ...this.#type,
658
- value: this.leaves().flatMap(f => f.subtle(isSubtle).leaves())
659
- });
660
- } else {
661
- return new Fragment({
662
- ...this.#type,
663
- subtle: isSubtle
664
- });
665
- }
666
- }
667
-
668
- /**
669
- * Apply the specified styles to the current fragment (if it's a leaf) or all
670
- * of its children (if it's a multi-fragment).
671
- *
672
- * Keep in mind that merging styles might be very difficult to undo, so treat
673
- * this as a low-level operation, and prefer to use higher-level concepts like
674
- * `subtle` if you can instead.
675
- */
676
- styleAll(...allFormats) {
677
- if (allFormats.length === 0) return this;
678
- if (this.#type.kind === 'multi') {
679
- return new Fragment({
680
- ...this.#type,
681
- value: this.#type.value.flatMap(f => f.styleAll(...allFormats).leaves())
682
- });
683
- } else {
684
- return new Fragment({
685
- ...this.#type,
686
- style: mergeStyle(this.#type.style, formats(...allFormats))
687
- });
688
- }
689
- }
690
-
691
- /**
692
- * Convert the current fragment into a string with no additional formatting.
693
- * The primary purpose for this method is to support converting a fragment
694
- * into a string for inclusion in thrown Errors. If you're going to *log*
695
- * a fragment, log it using `DebugLogger` and don't convert it to
696
- * a string first.
697
- */
698
- stringify(options) {
699
- return this.leaves().filter(leaf => leaf.#shouldShow(options)).map(leaf => {
700
- const fragment = leaf.#type;
701
- if (fragment.kind === 'value') {
702
- return `<object>`;
703
- } else {
704
- // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme
705
- return String(fragment.value);
706
- }
707
- }).join('');
708
- }
709
-
710
- /**
711
- * Should the current fragment be printed with the provided display options?
712
- *
713
- * Importantly, if the current fragment contains subtle content but the `showSubtle` option is
714
- * false, `#shouldShow` will return false.
715
- *
716
- * @see isEmpty
717
- */
718
- #shouldShow(options) {
719
- return this.leaves().some(leaf => {
720
- const fragment = leaf.#type;
721
- if (fragment.subtle && !options.showSubtle) {
722
- return false;
723
- } else if (fragment.kind === 'string' && fragment.value === '') {
724
- return false;
725
- }
726
- return true;
727
- });
728
- }
729
-
730
- /**
731
- * Convert this fragment into a Loggable for logging through the `DebugLogger`.
732
- */
733
- toLoggable(options) {
734
- const buffer = new LogFragmentBuffer(options);
735
- for (const leaf of this.leaves()) {
736
- leaf.appendTo(buffer);
737
- }
738
- return buffer.flush();
739
- }
740
-
741
- /**
742
- * Append this fragment to the low-level `LogFragmentBuffer`.
743
- */
744
- appendTo(buffer) {
745
- const fragment = this.#type;
746
- const subtle = this.isSubtle();
747
-
748
- // If the fragment is a multi fragment, append each of its leaves to the buffer
749
- // and return.
750
- if (fragment.kind === 'multi') {
751
- for (const f of fragment.value) {
752
- f.appendTo(buffer);
753
- }
754
- return;
755
- }
756
-
757
- // If the fragment is a value fragment and the value is a primitive, give it special
758
- // treatment since we can trivially serialize it.
759
- if (fragment.kind === 'value') {
760
- // If the value is a string or number, convert it into a string, float or integer
761
- // fragment and append that instead. This means that strings and numbers are
762
- // represented the same way in logs whether they are explicitly created as string,
763
- // float or integer fragments *or* whether they are the value of a value fragment.
764
- if (typeof fragment.value === 'string') {
765
- return Fragment.string(JSON.stringify(fragment.value), {
766
- style: STYLES.string,
767
- subtle
768
- }).appendTo(buffer);
769
- } else if (typeof fragment.value === 'number') {
770
- const f = fragment.value % 1 === 0 ? Fragment.integer : Fragment.float;
771
- return f(fragment.value, {
772
- style: STYLES.number,
773
- subtle
774
- }).appendTo(buffer);
775
-
776
- // Alternatively, if the value of a `value` fragment is `null` or `undefined`,
777
- // append the string `null` or `undefined`, respectively with the `null` style.
778
- } else if (fragment.value === null || fragment.value === undefined) {
779
- return Fragment.string('null', {
780
- style: STYLES.null,
781
- subtle: this.isSubtle()
782
- }).appendTo(buffer);
783
-
784
- // Finally, if the value of a `value` fragment is boolean, append the string
785
- // `true` or `false` with the `boolean` style.
786
- } else if (typeof fragment.value === 'boolean') {
787
- return Fragment.string(String(fragment.value), {
788
- style: STYLES.boolean,
789
- subtle
790
- }).appendTo(buffer);
791
- }
792
-
793
- // All other values (i.e. objects and functions) are represented as footnotes and
794
- // are handled below.
795
- }
796
- switch (fragment.kind) {
797
- // strings are appended using %s
798
- case 'string':
799
- // integers are appended using %d
800
- case 'integer':
801
- // floats are appended using %f
802
- case 'float':
803
- buffer.append(fragment.subtle ?? false, `%c${FORMATTERS[fragment.kind]}`, fragment.style, fragment.value);
804
- break;
805
- // the remaining value types are represented as footnotes
806
- // dom nodes are appended to the footnote line using %o
807
- case 'special':
808
- // values are appended to the footnote line using %O
809
- case 'value':
810
- {
811
- // If a fragment has an associated annotation, we'll use the annotation as the
812
- // footnote rather than the footnote number.
813
- const override = fragment.kind === 'value' ? fragment.display : undefined;
814
- buffer.addFootnoted(fragment.subtle ?? false, ({
815
- n,
816
- style
817
- }, footnote) => {
818
- const appendValueAsFootnote = ref => void footnote.append(subtle, `%c| %c[${ref}]%c ${FORMATTERS[fragment.kind]}`, STYLES.dim, style, '', fragment.value);
819
- if (override) {
820
- if ('inline' in override) {
821
- override.inline.subtle(subtle).appendTo(footnote);
822
- return false;
823
- }
824
- buffer.append(subtle, `%c[${override.ref}]%c`, style, '');
825
- if (override.footnote) {
826
- frag`${as.dim('| ')}${override.footnote}`.subtle(subtle).appendTo(footnote);
827
- } else {
828
- appendValueAsFootnote(override.ref);
829
- }
830
- return false;
831
- }
832
- buffer.append(subtle, `%c[${n}]%c`, style, '');
833
- appendValueAsFootnote(String(n));
834
- return true;
835
- });
836
- break;
837
- }
838
- default:
839
- assertNever(fragment);
840
- }
841
- }
842
- }
843
- function intoFragment(value) {
844
- const fragments = intoFragments(value);
845
- const [first, ...rest] = fragments;
846
- if (first !== undefined && rest.length === 0) {
847
- return first;
848
- }
849
- return new Fragment({
850
- kind: 'multi',
851
- value: fragments
852
- });
853
- }
854
- function intoFragments(value) {
855
- if (Array.isArray(value)) {
856
- return value.flatMap(intoFragments);
857
- } else if (typeof value === 'object' && value !== null) {
858
- return value.leaves();
859
- } else {
860
- return [intoLeafFragment(value)];
861
- }
862
- }
863
- function intoLeafFragment(value) {
864
- if (value === null) {
865
- return new Fragment({
866
- kind: 'value',
867
- value: null
868
- });
869
- } else if (typeof value === 'number') {
870
- return new Fragment({
871
- kind: 'integer',
872
- value
873
- });
874
- } else if (typeof value === 'string') {
875
- // If the string contains only whitespace and punctuation, we can treat it as a
876
- // punctuation fragment.
877
- if (/^[\s\p{P}\p{Sm}]*$/u.test(value)) {
878
- return new Fragment({
879
- kind: 'string',
880
- value,
881
- style: STYLES.punct
882
- });
883
- } else {
884
- return new Fragment({
885
- kind: 'string',
886
- value
887
- });
888
- }
889
- } else {
890
- return value;
891
- }
892
- }
893
- function frag(strings, ...values) {
894
- const buffer = [];
895
- strings.forEach((string, i) => {
896
- buffer.push(...intoFragment(string).leaves());
897
- const dynamic = values[i];
898
- if (dynamic) {
899
- buffer.push(...intoFragment(dynamic).leaves());
900
- }
901
- });
902
- return new Fragment({
903
- kind: 'multi',
904
- value: buffer
905
- });
906
- }
907
- const as = Object.fromEntries(Object.entries(STYLES).map(([k, v]) => [k, value => intoFragment(value).styleAll({
908
- style: v
909
- })]));
910
-
911
- export { VM_CLOSE_ELEMENT_OP as $, isHandle as A, decodeImmediate as B, CURRIED_COMPONENT as C, VM_PRIMITIVE_REFERENCE_OP as D, VM_DUP_OP as E, VM_POP_OP as F, VM_LOAD_OP as G, VM_FETCH_OP as H, VM_BIND_DYNAMIC_SCOPE_OP as I, VM_ENTER_OP as J, VM_EXIT_OP as K, VM_PUSH_SYMBOL_TABLE_OP as L, VM_PUSH_BLOCK_SCOPE_OP as M, VM_COMPILE_BLOCK_OP as N, VM_INVOKE_YIELD_OP as O, VM_JUMP_IF_OP as P, VM_JUMP_UNLESS_OP as Q, VM_JUMP_EQ_OP as R, VM_TO_BOOLEAN_OP as S, VM_TEXT_OP as T, VM_COMMENT_OP as U, VM_MAIN_OP as V, VM_OPEN_ELEMENT_OP as W, VM_OPEN_DYNAMIC_ELEMENT_OP as X, VM_PUSH_REMOTE_ELEMENT_OP as Y, VM_POP_REMOTE_ELEMENT_OP as Z, VM_FLUSH_ELEMENT_OP as _, VM_CONTENT_TYPE_OP as a, VM_MODIFIER_OP as a0, VM_DYNAMIC_MODIFIER_OP as a1, VM_STATIC_ATTR_OP as a2, VM_DYNAMIC_ATTR_OP as a3, CURRIED_MODIFIER as a4, VM_PUSH_COMPONENT_DEFINITION_OP as a5, VM_RESOLVE_DYNAMIC_COMPONENT_OP as a6, VM_PUSH_ARGS_OP as a7, VM_PUSH_EMPTY_ARGS_OP as a8, VM_CAPTURE_ARGS_OP as a9, VM_GET_PROPERTY_OP as aA, VM_GET_BLOCK_OP as aB, VM_SPREAD_BLOCK_OP as aC, VM_HAS_BLOCK_OP as aD, VM_HAS_BLOCK_PARAMS_OP as aE, VM_CONCAT_OP as aF, VM_IF_INLINE_OP as aG, VM_NOT_OP as aH, VM_GET_DYNAMIC_VAR_OP as aI, VM_LOG_OP as aJ, VM_DYNAMIC_CONTENT_TYPE_OP as aK, VM_DEBUGGER_OP as aL, VM_ENTER_LIST_OP as aM, VM_EXIT_LIST_OP as aN, VM_ITERATE_OP as aO, encodeHandle as aP, isMachineOp as aQ, isSmallInt as aR, encodeImmediate as aS, VM_PREPARE_ARGS_OP as aa, VM_CREATE_COMPONENT_OP as ab, VM_REGISTER_COMPONENT_DESTRUCTOR_OP as ac, VM_BEGIN_COMPONENT_TRANSACTION_OP as ad, VM_PUT_COMPONENT_OPERATIONS_OP as ae, VM_COMPONENT_ATTR_OP as af, VM_STATIC_COMPONENT_ATTR_OP as ag, VM_DID_CREATE_ELEMENT_OP as ah, VM_GET_COMPONENT_SELF_OP as ai, VM_GET_COMPONENT_TAG_NAME_OP as aj, VM_GET_COMPONENT_LAYOUT_OP as ak, VM_POPULATE_LAYOUT_OP as al, VM_VIRTUAL_ROOT_SCOPE_OP as am, VM_SET_NAMED_VARIABLES_OP as an, VM_SET_BLOCKS_OP as ao, VM_INVOKE_COMPONENT_LAYOUT_OP as ap, VM_DID_RENDER_LAYOUT_OP as aq, VM_COMMIT_COMPONENT_TRANSACTION_OP as ar, VM_CURRY_OP as as, VM_DYNAMIC_HELPER_OP as at, CURRIED_HELPER as au, VM_HELPER_OP as av, VM_GET_VARIABLE_OP as aw, VM_SET_VARIABLE_OP as ax, VM_SET_BLOCK_OP as ay, VM_ROOT_SCOPE_OP as az, VM_ASSERT_SAME_OP as b, constants as c, VM_APPEND_HTML_OP as d, VM_APPEND_TEXT_OP as e, VM_RESOLVE_CURRIED_COMPONENT_OP as f, VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP as g, VM_APPEND_SAFE_HTML_OP as h, VM_APPEND_DOCUMENT_FRAGMENT_OP as i, VM_APPEND_NODE_OP as j, VM_INVOKE_STATIC_OP as k, VM_RETURN_TO_OP as l, VM_RETURN_OP as m, VM_JUMP_OP as n, VM_INVOKE_VIRTUAL_OP as o, VM_POP_FRAME_OP as p, VM_PUSH_FRAME_OP as q, VM_SYSCALL_SIZE as r, VM_CHILD_SCOPE_OP as s, VM_POP_SCOPE_OP as t, VM_PUSH_DYNAMIC_SCOPE_OP as u, VM_POP_DYNAMIC_SCOPE_OP as v, VM_CONSTANT_OP as w, decodeHandle as x, VM_CONSTANT_REFERENCE_OP as y, VM_PRIMITIVE_OP as z };