@torpor/view 0.2.0 → 0.3.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 (728) hide show
  1. package/.oxlintrc.json +3 -0
  2. package/CHANGELOG.md +31 -0
  3. package/README.md +27 -26
  4. package/dist/Component-C6Y3UwGs.d.cts +11 -0
  5. package/dist/Component-C6Y3UwGs.d.cts.map +1 -0
  6. package/dist/Component-d19HOoEw.d.ts +11 -0
  7. package/dist/Component-d19HOoEw.d.ts.map +1 -0
  8. package/dist/ServerSlotRender-BiG4xB8e.d.ts +41 -0
  9. package/dist/ServerSlotRender-BiG4xB8e.d.ts.map +1 -0
  10. package/dist/ServerSlotRender-COS6H8Yk.d.cts +41 -0
  11. package/dist/ServerSlotRender-COS6H8Yk.d.cts.map +1 -0
  12. package/dist/compile.cjs +3383 -3783
  13. package/dist/compile.cjs.map +1 -1
  14. package/dist/compile.d.cts +202 -148
  15. package/dist/compile.d.cts.map +1 -0
  16. package/dist/compile.d.ts +202 -148
  17. package/dist/compile.d.ts.map +1 -0
  18. package/dist/compile.js +3378 -3754
  19. package/dist/compile.js.map +1 -1
  20. package/dist/formatText-B0FXBdFT.js +410 -0
  21. package/dist/formatText-B0FXBdFT.js.map +1 -0
  22. package/dist/formatText-DufG5l83.cjs +500 -0
  23. package/dist/formatText-DufG5l83.cjs.map +1 -0
  24. package/dist/index.cjs +853 -873
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +371 -171
  27. package/dist/index.d.cts.map +1 -0
  28. package/dist/index.d.ts +371 -171
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +819 -765
  31. package/dist/index.js.map +1 -1
  32. package/dist/ssr.cjs +29 -114
  33. package/dist/ssr.cjs.map +1 -1
  34. package/dist/ssr.d.cts +13 -8
  35. package/dist/ssr.d.cts.map +1 -0
  36. package/dist/ssr.d.ts +13 -8
  37. package/dist/ssr.d.ts.map +1 -0
  38. package/dist/ssr.js +18 -27
  39. package/dist/ssr.js.map +1 -1
  40. package/package.json +14 -15
  41. package/scripts/buildTestOutput.ts +1 -1
  42. package/scripts/copyToRepl.ts +9 -7
  43. package/src/ambient.d.ts +1 -0
  44. package/src/compile/build/client/BuildStatus.ts +6 -4
  45. package/src/compile/build/client/addMappedText.ts +25 -0
  46. package/src/compile/build/client/buildAddFragment.ts +26 -4
  47. package/src/compile/build/client/buildAwaitNode.ts +86 -54
  48. package/src/compile/build/client/buildCode.ts +91 -57
  49. package/src/compile/build/client/buildComponentNode.ts +20 -42
  50. package/src/compile/build/client/buildControlNode.ts +5 -4
  51. package/src/compile/build/client/buildElementNode.ts +66 -71
  52. package/src/compile/build/client/buildForNode.ts +24 -12
  53. package/src/compile/build/client/buildFragment.ts +29 -43
  54. package/src/compile/build/client/buildFragmentText.ts +27 -20
  55. package/src/compile/build/client/buildHtmlNode.ts +5 -3
  56. package/src/compile/build/client/buildIfNode.ts +44 -29
  57. package/src/compile/build/client/buildMount.ts +1 -1
  58. package/src/compile/build/client/buildNode.ts +8 -7
  59. package/src/compile/build/client/buildReplaceNode.ts +5 -3
  60. package/src/compile/build/client/buildRootNode.ts +2 -2
  61. package/src/compile/build/client/buildRun.ts +1 -1
  62. package/src/compile/build/client/buildScriptNode.ts +5 -3
  63. package/src/compile/build/client/buildSlotNode.ts +7 -23
  64. package/src/compile/build/client/buildSpecialNode.ts +10 -14
  65. package/src/compile/build/client/buildStyles.ts +53 -18
  66. package/src/compile/build/client/buildSwitchNode.ts +53 -32
  67. package/src/compile/build/client/buildTextNode.ts +31 -28
  68. package/src/compile/build/client/replaceForVarNames.ts +1 -1
  69. package/src/compile/build/client/stashRun.ts +22 -0
  70. package/src/compile/build/client/stashRunWithOffsets.ts +32 -0
  71. package/src/compile/build/server/BuildServerStatus.ts +3 -3
  72. package/src/compile/build/server/buildServerAwaitNode.ts +3 -3
  73. package/src/compile/build/server/buildServerCode.ts +57 -45
  74. package/src/compile/build/server/buildServerComponentNode.ts +10 -35
  75. package/src/compile/build/server/buildServerControlNode.ts +5 -2
  76. package/src/compile/build/server/buildServerElementNode.ts +15 -29
  77. package/src/compile/build/server/buildServerForNode.ts +3 -3
  78. package/src/compile/build/server/buildServerHtmlNode.ts +3 -3
  79. package/src/compile/build/server/buildServerIfNode.ts +3 -3
  80. package/src/compile/build/server/buildServerNode.ts +7 -6
  81. package/src/compile/build/server/buildServerReplaceNode.ts +3 -3
  82. package/src/compile/build/server/buildServerRootNode.ts +2 -2
  83. package/src/compile/build/server/buildServerScriptNode.ts +1 -1
  84. package/src/compile/build/server/buildServerSlotNode.ts +5 -21
  85. package/src/compile/build/server/buildServerSpecialNode.ts +10 -13
  86. package/src/compile/build/server/buildServerSwitchNode.ts +3 -3
  87. package/src/compile/build/server/buildServerTextNode.ts +9 -23
  88. package/src/compile/build/utils/nextVarName.ts +2 -2
  89. package/src/compile/build.ts +9 -4
  90. package/src/compile/buildType.ts +2 -2
  91. package/src/compile/parse/ParseComponentStatus.ts +24 -0
  92. package/src/compile/parse/ParseStatus.ts +6 -26
  93. package/src/compile/parse/addSpaceElement.ts +6 -5
  94. package/src/compile/parse/parseCode.ts +116 -60
  95. package/src/compile/parse/parseControl.ts +34 -32
  96. package/src/compile/parse/parseElement.ts +56 -121
  97. package/src/compile/parse/parseImports.ts +1 -1
  98. package/src/compile/parse/parseInlineScript.ts +12 -26
  99. package/src/compile/parse/parseMarkup.ts +9 -3
  100. package/src/compile/parse/parseStyles.ts +4 -4
  101. package/src/compile/parse/parseTag.ts +50 -8
  102. package/src/compile/parse/parseText.ts +96 -0
  103. package/src/compile/parse/scopeStyles.ts +9 -9
  104. package/src/compile/parse/slottifyChildNodes.ts +8 -7
  105. package/src/compile/parse/utils/accept.ts +1 -1
  106. package/src/compile/parse/utils/addError.ts +24 -6
  107. package/src/compile/parse/utils/consumeAlphaNumeric.ts +1 -1
  108. package/src/compile/parse/utils/consumeNonSpace.ts +1 -1
  109. package/src/compile/parse/utils/consumeSpace.ts +1 -1
  110. package/src/compile/parse/utils/consumeUntil.ts +1 -1
  111. package/src/compile/parse/utils/expect.ts +1 -1
  112. package/src/compile/parse.ts +1 -1
  113. package/src/compile/types/BuildResult.ts +5 -2
  114. package/src/compile/types/CompileError.ts +8 -5
  115. package/src/compile/types/Import.ts +2 -2
  116. package/src/compile/types/ParseResult.ts +4 -4
  117. package/src/compile/types/ScriptChunk.ts +6 -0
  118. package/src/compile/types/SourceMapping.ts +7 -0
  119. package/src/compile/types/SourceRange.ts +4 -0
  120. package/src/compile/types/nodes/Attribute.ts +7 -2
  121. package/src/compile/types/nodes/ControlNode.ts +8 -6
  122. package/src/compile/types/nodes/ElementNode.ts +11 -6
  123. package/src/compile/types/nodes/Fragment.ts +10 -2
  124. package/src/compile/types/nodes/NodeType.ts +3 -1
  125. package/src/compile/types/nodes/OperationType.ts +3 -1
  126. package/src/compile/types/nodes/ParentNode.ts +4 -4
  127. package/src/compile/types/nodes/RootNode.ts +5 -5
  128. package/src/compile/types/nodes/TemplateNode.ts +3 -3
  129. package/src/compile/types/nodes/TextNode.ts +5 -3
  130. package/src/compile/types/styles/Attribute.ts +2 -2
  131. package/src/compile/types/styles/Style.ts +3 -3
  132. package/src/compile/types/styles/StyleBlock.ts +3 -3
  133. package/src/compile/utils/Builder.ts +25 -11
  134. package/src/compile/utils/endOfString.ts +8 -0
  135. package/src/compile/utils/endOfTemplateString.ts +14 -0
  136. package/src/compile/{types/nodes → utils}/isComponentNode.ts +2 -2
  137. package/src/compile/utils/isControlNode.ts +6 -0
  138. package/src/compile/utils/isElementNode.ts +6 -0
  139. package/src/compile/utils/isParentNode.ts +6 -0
  140. package/src/compile/{types/nodes → utils}/isSpaceNode.ts +3 -3
  141. package/src/compile/utils/isSpecialNode.ts +6 -0
  142. package/src/compile/utils/isTextNode.ts +6 -0
  143. package/src/compile.ts +2 -2
  144. package/src/debug/printNode.ts +4 -0
  145. package/src/debug/printRanges.ts +74 -0
  146. package/src/debug/printSignalDiagram.ts +139 -0
  147. package/src/debug/printSimpleDiagram.ts +88 -0
  148. package/src/index.ts +13 -6
  149. package/src/render/$batch.ts +22 -0
  150. package/src/render/$cache.ts +34 -0
  151. package/src/render/$mount.ts +1 -1
  152. package/src/render/$peek.ts +14 -0
  153. package/src/render/$run.ts +16 -13
  154. package/src/render/$serverBatch.ts +3 -0
  155. package/src/render/$serverCache.ts +3 -0
  156. package/src/render/$serverMount.ts +1 -1
  157. package/src/render/$serverPeek.ts +3 -0
  158. package/src/render/$serverRun.ts +1 -1
  159. package/src/render/$unwrap.ts +3 -1
  160. package/src/render/$watch.ts +12 -13
  161. package/src/render/addAnimation.ts +1 -1
  162. package/src/render/addFragment.ts +15 -24
  163. package/src/render/applyProps.ts +1 -1
  164. package/src/render/buildClasses.ts +2 -2
  165. package/src/render/clearLayoutSlot.ts +1 -1
  166. package/src/render/clearRange.ts +43 -50
  167. package/src/render/context.ts +19 -48
  168. package/src/render/fillLayoutSlot.ts +3 -3
  169. package/src/render/getFragment.ts +1 -1
  170. package/src/render/hydrate.ts +9 -2
  171. package/src/render/hydrateRoot.ts +2 -2
  172. package/src/render/isCommentNode.ts +2 -2
  173. package/src/render/isFragmentNode.ts +2 -2
  174. package/src/render/isTextNode.ts +2 -2
  175. package/src/render/mount.ts +12 -4
  176. package/src/render/moveRange.ts +4 -11
  177. package/src/render/newListItem.ts +4 -4
  178. package/src/render/newRange.ts +6 -5
  179. package/src/render/nodeAnchor.ts +3 -3
  180. package/src/render/nodeCheckHydrationBreak.ts +2 -2
  181. package/src/render/nodeChild.ts +2 -2
  182. package/src/render/nodeNext.ts +1 -1
  183. package/src/render/nodeRoot.ts +8 -3
  184. package/src/render/popRange.ts +2 -2
  185. package/src/render/pushRange.ts +12 -4
  186. package/src/render/runControl.ts +1 -5
  187. package/src/render/runControlBranch.ts +10 -24
  188. package/src/render/runList.ts +6 -5
  189. package/src/render/runListItems.ts +39 -39
  190. package/src/render/setAttribute.ts +1 -1
  191. package/src/render/setDynamicElement.ts +2 -2
  192. package/src/ssr.ts +5 -2
  193. package/src/types/Animation.ts +1 -1
  194. package/src/types/BuildOptions.ts +6 -2
  195. package/src/types/Cleanup.ts +3 -1
  196. package/src/types/Component.ts +4 -2
  197. package/src/types/Computed.ts +62 -0
  198. package/src/types/Context.ts +99 -0
  199. package/src/types/Effect.ts +45 -9
  200. package/src/types/ListItem.ts +3 -3
  201. package/src/types/ProxyData.ts +6 -4
  202. package/src/types/ProxySignal.ts +28 -0
  203. package/src/types/Range.ts +10 -16
  204. package/src/types/ServerComponent.ts +4 -2
  205. package/src/types/ServerSlotRender.ts +3 -1
  206. package/src/types/SlotRender.ts +4 -2
  207. package/src/types/Subscription.ts +57 -0
  208. package/src/types/Template.ts +6 -5
  209. package/src/types/TemplateComponent.ts +7 -5
  210. package/src/types/WatchOptions.ts +8 -2
  211. package/src/types/constants.ts +14 -0
  212. package/src/watch/batchEnd.ts +17 -0
  213. package/src/watch/batchStart.ts +5 -0
  214. package/src/watch/checkComputed.ts +46 -0
  215. package/src/watch/checkEffect.ts +30 -0
  216. package/src/watch/checkSources.ts +63 -0
  217. package/src/watch/clearSources.ts +39 -0
  218. package/src/watch/clearTargets.ts +28 -0
  219. package/src/watch/deactivateSources.ts +19 -0
  220. package/src/watch/proxyGet.ts +106 -51
  221. package/src/watch/proxySet.ts +17 -13
  222. package/src/watch/runCleanups.ts +40 -0
  223. package/src/watch/runComputed.ts +36 -0
  224. package/src/watch/runEffect.ts +38 -13
  225. package/src/watch/symbols.ts +3 -1
  226. package/src/watch/trackEffect.ts +63 -15
  227. package/src/watch/trackProxyEffect.ts +21 -0
  228. package/src/watch/transferEffects.ts +66 -62
  229. package/src/watch/triggerEffects.ts +55 -18
  230. package/src/watch/updateSignal.ts +102 -0
  231. package/src/wrappers/ReactiveDate.ts +68 -0
  232. package/test/attributes/attributes.test.ts +2 -2
  233. package/test/attributes/components/output/Attributes-client.ts +8 -20
  234. package/test/attributes/components/output/Attributes-server.ts +8 -11
  235. package/test/attributes/components/temp/{Attributes-client-4620a40099e57a7fdaab895b204d85881f6dbfb7.ts → Attributes-client-9b2935d7824ba501776fdc6c48861422c15b6a12.ts} +8 -20
  236. package/test/attributes/components/temp/{Attributes-server-f4c59f5e4757ce0113907389902499efc36cfe38.ts → Attributes-server-716db6e335e5a372a34dd931e5f358ee6d1869e5.ts} +8 -11
  237. package/test/attributes/disappearing.test.ts +2 -2
  238. package/test/attributes/parse.test.ts +161 -248
  239. package/test/await/await.test.ts +2 -2
  240. package/test/await/components/Await.torp +2 -2
  241. package/test/await/components/output/Await-client.ts +25 -39
  242. package/test/await/components/output/Await-server.ts +9 -11
  243. package/test/await/components/temp/{Await-client-17b0e7c682fbff8518a440831620c1024b8be23a.ts → Await-client-e969f4bd0712acf259ddfaa5a3b3448307201fd2.ts} +25 -39
  244. package/test/await/components/temp/{Await-server-eb8d79f8abc791dd8e87f9713534cebf0eb2c854.ts → Await-server-614014fab69e234b8271088b10397cf0452d9a76.ts} +9 -11
  245. package/test/bench/components/Bench.torp +3 -3
  246. package/test/bench/components/output/Bench-client.ts +43 -252
  247. package/test/bench/components/output/Bench-server.ts +13 -26
  248. package/test/bench/components/temp/Bench-client-7f31596dafc8077370d8d90b1bb9b6e0208154e7.ts +205 -0
  249. package/test/bench/components/temp/Bench-server-341b20073668f4f2160cd2ba37847c7db15e1e0f.ts +129 -0
  250. package/test/bind/bind.test.ts +2 -2
  251. package/test/bind/component.test.ts +2 -2
  252. package/test/bind/components/output/BindComponent-client.ts +9 -19
  253. package/test/bind/components/output/BindComponent-server.ts +13 -18
  254. package/test/bind/components/output/BindText-client.ts +6 -13
  255. package/test/bind/components/output/BindText-server.ts +8 -10
  256. package/test/bind/components/temp/{BindComponent-client-a59ee6a598341c64c79be633ae7b22cb594dd0bc.ts → BindComponent-client-22eccb5354a2b0267841e015f3a2a0baf534bf89.ts} +9 -19
  257. package/test/bind/components/temp/{BindComponent-server-96120f1e75c77e02ba11ab719c225005e168d25f.ts → BindComponent-server-0da6ba90a409468fd1f7358f8198e96b7595ff80.ts} +13 -18
  258. package/test/bind/components/temp/{BindText-client-dac614203e672e51675b22a246983168a7c173ea.ts → BindText-client-7692ae1570533cc17e2186e9c7d4768529e4a2fe.ts} +6 -13
  259. package/test/bind/components/temp/{BindText-server-c713033ef787587f752fc8e6282e3a8faeee9a08.ts → BindText-server-6801c5f8e66a65405b45061bc037a011620c0591.ts} +8 -10
  260. package/test/build-server/build-server.test.ts +1 -0
  261. package/test/{if/components/temp/IfNested-client-f3045daba052e459add6e7f84e8d21ba7b0d81e4.ts → build-server/components/output/IfNested-client.ts} +23 -27
  262. package/test/{if/components/temp/IfNested-server-061ea3d56576a352be8a9db8424fae0f1d74cd36.ts → build-server/components/output/IfNested-server.ts} +6 -9
  263. package/test/build-server/components/temp/IfNested-client-eefdd449fa700b2e7326bc72df8b32ddcadf9d21.ts +88 -0
  264. package/test/build-server/components/temp/IfNested-server-7a53e4969b5dfe5073f05edbcb1b986f718bb939.ts +29 -0
  265. package/test/buildHtml.ts +2 -1
  266. package/test/buildOutputFiles.ts +3 -3
  267. package/test/child-component/child-component.test.ts +2 -2
  268. package/test/child-component/components/output/ParentChild-client.ts +9 -19
  269. package/test/child-component/components/output/ParentChild-server.ts +12 -18
  270. package/test/child-component/components/temp/{ParentChild-client-198e4ebc2ef5277ad7147f69d5879946fbe2d6ec.ts → ParentChild-client-2dfd600f7d409630d429a1d2d18c038bd08b08da.ts} +9 -19
  271. package/test/child-component/components/temp/{ParentChild-server-55e809830788ae740608136cf66664fc5434a9cd.ts → ParentChild-server-448d57c3229189c1d297d01dfb0f33646d280e90.ts} +12 -18
  272. package/test/class/class.test.ts +2 -2
  273. package/test/class/components/output/Class-client.ts +11 -29
  274. package/test/class/components/output/Class-server.ts +16 -19
  275. package/test/class/components/temp/{Class-client-7defac0b98d9c9f303670c0372e329e31823f163.ts → Class-client-5af6a50cd454ae019b2aa79457ba7ead83b8c056.ts} +11 -29
  276. package/test/class/components/temp/{Class-server-46563e9c3bf56b642ac496b60179decfd0b4e952.ts → Class-server-eb70ff01fbc7d6d53e16c3593ba021a6bf0317f9.ts} +16 -19
  277. package/test/comments/html-comments.test.ts +16 -24
  278. package/test/comments/js-block-comments.test.ts +16 -25
  279. package/test/comments/js-line-comments.test.ts +16 -25
  280. package/test/component/component.test.ts +2 -2
  281. package/test/component/components/Component.torp +1 -1
  282. package/test/component/components/output/Component-client.ts +5 -10
  283. package/test/component/components/output/Component-server.ts +7 -10
  284. package/test/component/components/output/Header-client.ts +6 -12
  285. package/test/component/components/output/Header-server.ts +7 -10
  286. package/test/component/components/temp/{Component-client-350d20784712c710929cc3ab34c6828b0ea338d8.ts → Component-client-fdc327499be0a01f987d0f2897baf022a247c77c.ts} +5 -10
  287. package/test/component/components/temp/{Component-server-2d4aa317e6c385036e07f4c3946fc18ba848c00d.ts → Component-server-f53221ac7b1c922ef10de2d1fe8fb534d0169fe7.ts} +7 -10
  288. package/test/component/components/temp/{Header-client-903877003b220272b0cb5bfd62d7d748ad46c477.ts → Header-client-6beb5770e68e6b19595e53e20bc906765fc6c260.ts} +6 -12
  289. package/test/component/components/temp/Header-server-940b0984f9b6c11f310db9200c9075ded385eda5.ts +16 -0
  290. package/test/console/components/output/Console-client.ts +5 -10
  291. package/test/console/components/output/Console-server.ts +7 -10
  292. package/test/console/components/temp/{Console-client-4fa3b3679cee88bf6151185438e36d14010944b7.ts → Console-client-2b58290ac407ebbe89a0613d64eb9cd141b99887.ts} +5 -10
  293. package/test/console/components/temp/Console-server-bde0121ce434f767435b1841fc4c24402becdba2.ts +15 -0
  294. package/test/console/console.test.ts +2 -2
  295. package/test/const/components/output/Const-client.ts +6 -11
  296. package/test/const/components/output/Const-server.ts +7 -10
  297. package/test/const/components/temp/{Const-client-b0293a037d9ed7b6ad4591c153723a3c26d46029.ts → Const-client-d1037557e7ef75a8fe06f56816e65883047e9421.ts} +6 -11
  298. package/test/const/components/temp/{Const-server-5fd2444a9ae7a676b7c4480e01e28f7f89624fdc.ts → Const-server-32ddc3617afe2324f17a4cff6c0f086df6694778.ts} +7 -10
  299. package/test/const/const.test.ts +2 -2
  300. package/test/context/components/ChildA.torp +10 -0
  301. package/test/context/components/ChildB.torp +8 -0
  302. package/test/context/components/Parent.torp +11 -0
  303. package/test/context/components/output/ChildA-client.ts +38 -0
  304. package/test/context/components/output/ChildA-server.ts +19 -0
  305. package/test/context/components/output/ChildB-client.ts +27 -0
  306. package/test/context/components/output/ChildB-server.ts +18 -0
  307. package/test/context/components/output/Parent-server.ts +31 -0
  308. package/test/context/components/temp/ChildA-client-9dea3e29ffcb82ca1779f6ff671e19b1c106fc4a.ts +38 -0
  309. package/test/context/components/temp/ChildA-server-54024d23c8241c3f475068f4fe3a3a14fd1c5870.ts +19 -0
  310. package/test/context/components/temp/ChildB-client-4b801099936c8aa013a1220f291375f67eba1acb.ts +27 -0
  311. package/test/context/components/temp/ChildB-server-f9b71341863bf869248bd406dbe8c7726a30ff90.ts +18 -0
  312. package/test/context/components/temp/Parent-client-9898b2e521527c86d69905053b6727ea8fd28166.ts +41 -0
  313. package/test/context/components/temp/Parent-server-b592ff0f516f4592e56d3a0bcb1f271ed28e812c.ts +31 -0
  314. package/test/context/context.test.ts +37 -0
  315. package/test/effects/components/output/For-client.ts +18 -19
  316. package/test/effects/components/output/For-server.ts +6 -9
  317. package/test/effects/components/output/If-client.ts +14 -18
  318. package/test/effects/components/output/If-server.ts +6 -9
  319. package/test/effects/components/output/NestedIf-client.ts +22 -25
  320. package/test/effects/components/output/NestedIf-server.ts +6 -9
  321. package/test/effects/components/temp/{For-client-268e69779d5b744377af9b30df256a453adaf183.ts → For-client-7c7d7c0dba2547f816b9bd9c6a95d6873ec00ffd.ts} +18 -19
  322. package/test/effects/components/temp/{For-server-b15b01b4daaf50fd95de790102089eb930e84e9b.ts → For-server-9e2de4efaff38ecf6c8a169c629d83c385489ca1.ts} +6 -9
  323. package/test/effects/components/temp/{If-client-4df0e6fc27a6f7d60ce056fd65df687213f3a2f9.ts → If-client-f0480a98f80b32612d12765c6838ff6db5982e82.ts} +14 -18
  324. package/test/effects/components/temp/{If-server-0a213ea232e0225d5a8ecb012ad418136b86fbe7.ts → If-server-ab409671b5d4c918047394a37b6e96b0e17063ca.ts} +6 -9
  325. package/test/effects/components/temp/{NestedIf-client-bfd381672c51febbe2f101f19afd5f6ff570ce7e.ts → NestedIf-client-702deffd158f219c5da4199b563a62cd54385a7f.ts} +22 -25
  326. package/test/effects/components/temp/{NestedIf-server-6089abc72d6208e64d1818ddb624ad5c3f236afa.ts → NestedIf-server-40f6bfd99a7e75fb4f9f874adab77e5eed97c629.ts} +6 -9
  327. package/test/effects/for-effect.test.ts +15 -15
  328. package/test/effects/if-effect.test.ts +7 -7
  329. package/test/effects/nested-if-effect.test.ts +11 -11
  330. package/test/events/components/Increment.torp +1 -1
  331. package/test/events/components/output/Increment-client.ts +7 -12
  332. package/test/events/components/output/Increment-server.ts +9 -11
  333. package/test/events/components/temp/{Increment-client-db2fd3376f12b186a4276eac470bf10b7bf2da19.ts → Increment-client-84c09711baf098c82ee226598ba7a36913616b75.ts} +7 -12
  334. package/test/events/components/temp/{Increment-server-062b9757192b84e5a6e247aa44e1e7887129293d.ts → Increment-server-e77c6b207023ac60e033ca542ee82473ef017f74.ts} +9 -11
  335. package/test/events/events.test.ts +9 -15
  336. package/test/for/components/output/For-client.ts +19 -19
  337. package/test/for/components/output/For-server.ts +7 -10
  338. package/test/for/components/output/ForEscape-client.ts +23 -37
  339. package/test/for/components/output/ForEscape-server.ts +8 -10
  340. package/test/for/components/output/ForIn-client.ts +19 -20
  341. package/test/for/components/output/ForIn-server.ts +7 -10
  342. package/test/for/components/output/ForOf-client.ts +19 -20
  343. package/test/for/components/output/ForOf-server.ts +7 -10
  344. package/test/for/components/temp/{For-client-8ecb11a2f34c81f837bffdb88598da06d8c19158.ts → For-client-2f6b4b81670b0ba31b01176b4f61ebf321e945bb.ts} +19 -19
  345. package/test/for/components/temp/{For-server-082c156a9f047995bc55f9477295d8e3262614f5.ts → For-server-5144615e53d23da5062b7169e847e0777d068738.ts} +7 -10
  346. package/test/for/components/temp/{ForEscape-client-14e7648415d967cdc57bf03d176eb6b6dddf0fb2.ts → ForEscape-client-8d0fcc940851e687173b6a9129c3d83e0fc771ef.ts} +23 -37
  347. package/test/for/components/temp/{ForEscape-server-2db43ff8397ddbb114b5bff3d88a63728184a811.ts → ForEscape-server-b359d8d3e12bac290855a1b27387ddd963562c08.ts} +8 -10
  348. package/test/for/components/temp/{ForIn-client-25cd67f246a50fc6d926a8c66aa5e106f19578a8.ts → ForIn-client-fa0614a1c7b8aa6e8819ed91a518479fd80453ae.ts} +19 -20
  349. package/test/for/components/temp/{ForIn-server-fda7a21cbb8a7ad69c48d2a8533cc13fa98d54b6.ts → ForIn-server-5fd472a7a5a5c00b384791780025a0c3bdc9c41b.ts} +7 -10
  350. package/test/for/components/temp/{ForOf-client-8f6598ccd9dc7b79aff6167b90ccea94f3029c84.ts → ForOf-client-11006c4239d9018363e582dc5b54b50477d652e7.ts} +19 -20
  351. package/test/for/components/temp/{ForOf-server-cd2b01507304e25c34030755b915f56785375de8.ts → ForOf-server-197b29abcb60412c6c8670b2d4a2e644b650faa3.ts} +7 -10
  352. package/test/for/for-escape.test.ts +2 -2
  353. package/test/for/for-in.test.ts +4 -4
  354. package/test/for/for-of.test.ts +4 -4
  355. package/test/for/for-with-key.test.ts +28 -36
  356. package/test/for/for.test.ts +2 -2
  357. package/test/function/components/Function.torp +0 -1
  358. package/test/function/components/output/Function-client.ts +6 -12
  359. package/test/function/components/output/Function-server.ts +8 -11
  360. package/test/function/components/temp/{Function-client-2068eb8ae35b3157b8eda79addde6afd9f4d7006.ts → Function-client-ec5fe7d599d6099bdfab78c2a0c8edf77a23cd9b.ts} +6 -12
  361. package/test/function/components/temp/{Function-server-4b66a728f6f1b170d678313238bdc9158356511e.ts → Function-server-fee2402b0ef4ad4c3d2779afb190ce46dbedf737.ts} +8 -11
  362. package/test/function/function.test.ts +7 -13
  363. package/test/helpers.ts +44 -9
  364. package/test/html/components/output/Html-client.ts +6 -12
  365. package/test/html/components/output/Html-server.ts +7 -10
  366. package/test/html/components/temp/{Html-client-93b0d666142c64cd651dc37f14f12884b2f30612.ts → Html-client-82ff34dcdcbdf4be1112bcb1baac8027cdc32de7.ts} +6 -12
  367. package/test/html/components/temp/Html-server-14fa484fc2a617bc0f24432a2e37e7a756f87a0f.ts +15 -0
  368. package/test/html/html.test.ts +2 -2
  369. package/test/hydrateComponent.ts +2 -2
  370. package/test/if/components/output/IfAfterIf-client.ts +21 -23
  371. package/test/if/components/output/IfAfterIf-server.ts +6 -9
  372. package/test/if/components/output/IfElse-client.ts +14 -18
  373. package/test/if/components/output/IfElse-server.ts +6 -9
  374. package/test/if/components/output/IfElseIf-client.ts +16 -22
  375. package/test/if/components/output/IfElseIf-server.ts +6 -9
  376. package/test/if/components/output/IfFalse-client.ts +13 -16
  377. package/test/if/components/output/IfFalse-server.ts +6 -9
  378. package/test/if/components/output/IfNested-client.ts +23 -27
  379. package/test/if/components/output/IfNested-server.ts +6 -9
  380. package/test/if/components/temp/{IfAfterIf-client-6b4833209a01cdad18d453839e9c8b5dad2a8510.ts → IfAfterIf-client-c1cfd21a6ace4945703ba8f46aada923a60265d9.ts} +21 -23
  381. package/test/if/components/temp/{IfAfterIf-server-3e6a3beab27821c3e53290ee72eca811814aad38.ts → IfAfterIf-server-26c9a638e3933a53208bfe66f8f37067511a28aa.ts} +6 -9
  382. package/test/if/components/temp/{IfElse-client-f7eb8e5fe5e62975a2442c4b0ff3344fa44cef69.ts → IfElse-client-06dfcacd3a5225dcb0947587bcd4fae9ec3d3c1e.ts} +14 -18
  383. package/test/if/components/temp/{IfElse-server-1b5006dfad695f257c7453a79bde3944898fbf6d.ts → IfElse-server-146b3779f85ea02a281c6042dddefa5372945fb0.ts} +6 -9
  384. package/test/if/components/temp/{IfElseIf-client-734f1b2d9133294573770c1ffc2b589273498532.ts → IfElseIf-client-26df9a728c9cb712d5ac0235b4c99885f25545b8.ts} +16 -22
  385. package/test/if/components/temp/{IfElseIf-server-11c65065e9e5640ad65cd0c37af07f1e57c4f49c.ts → IfElseIf-server-f094cdb45bc0fcd3144ca493346994b2445d2ff0.ts} +6 -9
  386. package/test/if/components/temp/{IfFalse-client-8a388cb48b4a5879d491f57d1f2551834de1e72e.ts → IfFalse-client-de6fc8e9eb222153608490e6d172e9aae9000aa1.ts} +13 -16
  387. package/test/if/components/temp/{IfFalse-server-40d07bc07e5edffd7386fb6016cd025b98175219.ts → IfFalse-server-b6d3446fd7d4219d5cb3c1009dec76870e73fa30.ts} +6 -9
  388. package/test/if/components/temp/IfNested-client-eefdd449fa700b2e7326bc72df8b32ddcadf9d21.ts +88 -0
  389. package/test/if/components/temp/IfNested-server-7a53e4969b5dfe5073f05edbcb1b986f718bb939.ts +29 -0
  390. package/test/if/else-if-true.test.ts +4 -4
  391. package/test/if/else-true.test.ts +4 -4
  392. package/test/if/if-after-if.test.ts +4 -4
  393. package/test/if/if-else-false.test.ts +4 -4
  394. package/test/if/if-else-true.test.ts +4 -4
  395. package/test/if/if-false.test.ts +4 -4
  396. package/test/if/if-nested.test.ts +4 -4
  397. package/test/imports/commented-imports.ts +1 -1
  398. package/test/imports/imports.ts +1 -1
  399. package/test/imports/multiple-imports.ts +1 -1
  400. package/test/mount/components/Mount.torp +1 -1
  401. package/test/mount/components/output/Mount-client.ts +6 -11
  402. package/test/mount/components/output/Mount-server.ts +10 -13
  403. package/test/mount/components/temp/{Mount-client-efa5c34fbfc7646e114a1a58f0814b6dff33e566.ts → Mount-client-29896228d7d0ef3692a9d13065c1bbfbe3198cdc.ts} +6 -11
  404. package/test/mount/components/temp/Mount-server-1c5aef88b8cc25b8e02851c0aa7fedffea987224.ts +22 -0
  405. package/test/mount/mount.test.ts +4 -4
  406. package/test/mountComponent.ts +1 -1
  407. package/test/on-mount/components/OnMount.torp +1 -1
  408. package/test/on-mount/components/output/OnMount-client.ts +5 -10
  409. package/test/on-mount/components/output/OnMount-server.ts +7 -10
  410. package/test/on-mount/components/temp/{OnMount-client-4bb62e8bf1fcd67798598fe03bf5455a57f0a6be.ts → OnMount-client-038f8c6bbcf0278406909d6ba5394f311924fda9.ts} +5 -10
  411. package/test/on-mount/components/temp/OnMount-server-ff4afcd976fd907c539e763d7887b38c61737be7.ts +15 -0
  412. package/test/on-mount/on-mount.test.ts +6 -6
  413. package/test/party/1-declare-state.test.ts +2 -2
  414. package/test/party/10-on-mount.test.ts +2 -2
  415. package/test/party/12-props.test.ts +2 -2
  416. package/test/party/13-emit-to-parent.test.ts +2 -2
  417. package/test/party/14-slot.test.ts +2 -2
  418. package/test/party/15-slot-fallback.test.ts +2 -2
  419. package/test/party/16-context.test.ts +2 -2
  420. package/test/party/17-input-text.test.ts +2 -2
  421. package/test/party/18-input-checkbox.test.ts +2 -2
  422. package/test/party/19-input-radio.test.ts +2 -2
  423. package/test/party/2-update-state.test.ts +2 -2
  424. package/test/party/20-input-select.test.ts +2 -2
  425. package/test/party/3-computed-state.test.ts +2 -2
  426. package/test/party/4-minimal-template.test.ts +2 -2
  427. package/test/party/5-styling.test.ts +2 -2
  428. package/test/party/6-loop.test.ts +2 -2
  429. package/test/party/7-event-click.test.ts +2 -2
  430. package/test/party/8-dom-ref.test.ts +4 -4
  431. package/test/party/9-conditional.test.ts +2 -2
  432. package/test/party/components/FunnyButton.torp +2 -2
  433. package/test/party/components/InputFocused.torp +1 -1
  434. package/test/party/components/UserProfile.torp +1 -1
  435. package/test/party/components/UserProfileApp.torp +1 -1
  436. package/test/party/components/UserProfileContextApp.torp +1 -1
  437. package/test/party/components/output/AnswerButton-client.ts +4 -10
  438. package/test/party/components/output/AnswerButton-server.ts +6 -9
  439. package/test/party/components/output/AnswerButtonApp-client.ts +6 -11
  440. package/test/party/components/output/AnswerButtonApp-server.ts +8 -10
  441. package/test/party/components/output/ColorSelect-client.ts +22 -26
  442. package/test/party/components/output/ColorSelect-server.ts +8 -10
  443. package/test/party/components/output/Colors-client.ts +19 -20
  444. package/test/party/components/output/Colors-server.ts +8 -10
  445. package/test/party/components/output/Counter-client.ts +7 -12
  446. package/test/party/components/output/Counter-server.ts +8 -10
  447. package/test/party/components/output/CssStyle-client.ts +5 -10
  448. package/test/party/components/output/CssStyle-server.ts +10 -10
  449. package/test/party/components/output/DoubleCount-client.ts +6 -11
  450. package/test/party/components/output/DoubleCount-server.ts +8 -10
  451. package/test/party/components/output/FunnyButton-client.ts +4 -10
  452. package/test/party/components/output/FunnyButton-server.ts +6 -8
  453. package/test/party/components/output/FunnyButtonApp-client.ts +7 -14
  454. package/test/party/components/output/FunnyButtonApp-server.ts +8 -12
  455. package/test/party/components/output/HelloWorld-client.ts +5 -10
  456. package/test/party/components/output/HelloWorld-server.ts +7 -10
  457. package/test/party/components/output/InputFocused-client.ts +6 -11
  458. package/test/party/components/output/InputFocused-server.ts +10 -13
  459. package/test/party/components/output/InputHello-client.ts +8 -13
  460. package/test/party/components/output/InputHello-server.ts +8 -10
  461. package/test/party/components/output/IsAvailable-client.ts +8 -13
  462. package/test/party/components/output/IsAvailable-server.ts +8 -10
  463. package/test/party/components/output/Name-client.ts +6 -11
  464. package/test/party/components/output/Name-server.ts +8 -10
  465. package/test/party/components/output/NameUpdate-client.ts +6 -11
  466. package/test/party/components/output/NameUpdate-server.ts +8 -10
  467. package/test/party/components/output/PageTitle-client.ts +6 -11
  468. package/test/party/components/output/PageTitle-server.ts +8 -10
  469. package/test/party/components/output/PickPill-client.ts +8 -13
  470. package/test/party/components/output/PickPill-server.ts +8 -10
  471. package/test/party/components/output/Time-client.ts +6 -11
  472. package/test/party/components/output/Time-server.ts +8 -10
  473. package/test/party/components/output/TrafficLight-client.ts +18 -26
  474. package/test/party/components/output/TrafficLight-server.ts +8 -10
  475. package/test/party/components/output/UserProfile-client.ts +6 -18
  476. package/test/party/components/output/UserProfile-server.ts +7 -10
  477. package/test/party/components/output/UserProfileApp-client.ts +6 -11
  478. package/test/party/components/output/UserProfileApp-server.ts +8 -11
  479. package/test/party/components/output/UserProfileContext-client.ts +7 -13
  480. package/test/party/components/output/UserProfileContext-server.ts +8 -9
  481. package/test/party/components/output/UserProfileContextApp-client.ts +7 -12
  482. package/test/party/components/output/UserProfileContextApp-server.ts +9 -11
  483. package/test/party/components/temp/{AnswerButton-client-890e28879c132eea21260eb82af832afc6a48507.ts → AnswerButton-client-df895c3e7a88fd7ede9f951fc9de2ed75c27a5cb.ts} +4 -10
  484. package/test/party/components/temp/{AnswerButton-server-01ffab9f6f92073640df2cf2cb5473407d82b24f.ts → AnswerButton-server-fa0e78b504a78d0e2dcd33a9a589f62e5b99c675.ts} +6 -9
  485. package/test/party/components/temp/{AnswerButtonApp-client-295a835cadf7e7ccec608f84ed01865dd8c73954.ts → AnswerButtonApp-client-4c05ef36b1c0e93370fb463643419928717fa701.ts} +6 -11
  486. package/test/party/components/temp/{AnswerButtonApp-server-b458692868307e6e08ad3deed9c2db542c28dee0.ts → AnswerButtonApp-server-062042691dabfa1a20d4088030c0b5bee1cd0be2.ts} +8 -10
  487. package/test/party/components/temp/{ColorSelect-client-5f74d3b38193a0c9b22317598cdbf2f56754ca2b.ts → ColorSelect-client-5db8d1b0924361fdb5efb867c14491402ec9668c.ts} +22 -26
  488. package/test/party/components/temp/{ColorSelect-server-cf0b1b533948a558e1705d9a7cca3c0b6ae8d315.ts → ColorSelect-server-8722b440cb7266a18a71b35c166be6dd6566fcec.ts} +8 -10
  489. package/test/party/components/temp/{Colors-client-806316cc5e01e8235c0b025cad34b1068addf5a5.ts → Colors-client-6d3ac693e85bdda50b8742282915997063a32769.ts} +19 -20
  490. package/test/party/components/temp/{Colors-server-b050714bfe752b88a99f6498f1b5c13abe6b56a5.ts → Colors-server-16572e26a55214c26683ce560b058b55d8c92685.ts} +8 -10
  491. package/test/party/components/temp/{Counter-client-006caeda8766cb17a161da0c6f58f006f8f16e8b.ts → Counter-client-0c604a107c5b84cdbf725f307dfe29d34f8a2cc8.ts} +7 -12
  492. package/test/party/components/temp/{Counter-server-931d36d8e4bcd114047bbfec8aa5f2fac0c2ce1e.ts → Counter-server-db18f030a6e02ab17708d6a17eb3e590965090e5.ts} +8 -10
  493. package/test/party/components/temp/{CssStyle-client-6ec06cbc4b34344234d289f6c4a9e427efff85a7.ts → CssStyle-client-2a642d115ad52539f97c051c34687b8d6d12b324.ts} +5 -10
  494. package/test/party/components/temp/CssStyle-server-0477c5497707dd9071105e5ec9045a3a7d1dd62d.ts +18 -0
  495. package/test/party/components/temp/{DoubleCount-client-6d4cf1e54368e3c6082e37c1e04f9ecde90624f2.ts → DoubleCount-client-8c85c3af12c471ea23bb702bbf5a3e240420f3ec.ts} +6 -11
  496. package/test/party/components/temp/{DoubleCount-server-8c013a97a08562deb6ad0f35e6e337203b0ddde9.ts → DoubleCount-server-5b04bb31269f9c8de6c25be427f57ab6e3d4dc19.ts} +8 -10
  497. package/test/party/components/temp/{FunnyButton-client-6d5662018a5a5529fd52ee82f7c88975b5c3355a.ts → FunnyButton-client-850dd3da0fa803c1bce5c53e88fcd2d48d279eb8.ts} +4 -10
  498. package/test/party/components/temp/{FunnyButton-server-3fd55a1e1dc71c183a6cea68e4c4693c988b7533.ts → FunnyButton-server-3df0067ec21476e7525d1c3de7099431c976f73b.ts} +6 -8
  499. package/test/party/components/temp/{FunnyButtonApp-client-1f2258b8488469d4704366bc49f5c171d8a854ae.ts → FunnyButtonApp-client-00300846d11a3d0a5a620c2ade87b935b7f0ebf8.ts} +7 -14
  500. package/test/party/components/temp/{FunnyButtonApp-server-6463d1c57adf61450d1415f0d76da4561ca3e798.ts → FunnyButtonApp-server-4cd83d2c71615fe4c905920e5ea836df4ed66c5e.ts} +8 -12
  501. package/test/party/components/temp/{HelloWorld-client-7344e400b4adb975fa8263d3081a06de0a793e57.ts → HelloWorld-client-890b311ad9a3919379acdc1d52807ea36cc9f489.ts} +5 -10
  502. package/test/party/components/temp/HelloWorld-server-e2c800d7f5cd3e772a9e5bbd7af58b00611b79d5.ts +15 -0
  503. package/test/party/components/temp/{InputFocused-client-20d755aea7dfaf1fd5e42dcade8fb7867f59ef28.ts → InputFocused-client-03527f9ceb52f66ac53887dbc884a0aa83bb7a23.ts} +6 -11
  504. package/test/party/components/temp/InputFocused-server-544a76ea64852474a3c7bf450b6fac36cbaf21c6.ts +23 -0
  505. package/test/party/components/temp/{InputHello-client-496d26bdeb6a168c4242e45f35d22e6ecbd211b9.ts → InputHello-client-f65a477624975b68b7aaa3614fbf198d4476480f.ts} +8 -13
  506. package/test/party/components/temp/{InputHello-server-a5fb3e0d8766c19d177a1f4d43d421c7da1b92ab.ts → InputHello-server-102d293d6c0fff7feda50d64bbd607df7d09393a.ts} +8 -10
  507. package/test/party/components/temp/{IsAvailable-client-491b92b5e21ebe1bbab47b2e422c35fb996b55e1.ts → IsAvailable-client-8767437fd92cf79713de5b00828e1502e38d79e3.ts} +8 -13
  508. package/test/party/components/temp/{IsAvailable-server-c0da3c019ef13617d2ab51353eb3360ddaae4189.ts → IsAvailable-server-2cf1e0d72df4bc194b5e00a1b415ba99f488525f.ts} +8 -10
  509. package/test/party/components/temp/{Name-client-62f0dab96aff130e81882099d7c0a111ba99cebd.ts → Name-client-08903a8df8bdff5288170d3c89658192956587a9.ts} +6 -11
  510. package/test/party/components/temp/{Name-server-0306b0c622d71323eb79a6b466d900380a0944f3.ts → Name-server-7d95226078ef4cd13b0ac6c5365ccbe4b8b9c0a2.ts} +8 -10
  511. package/test/party/components/temp/{NameUpdate-client-6ceb440637c99142bafcf8512eabf831c113b8c7.ts → NameUpdate-client-d65b2476c3721d2efddf9385a61433e2a2dd0d72.ts} +6 -11
  512. package/test/party/components/temp/{NameUpdate-server-a54ea11dc6b8f0b55d29ad29163cf27b9aa6ec40.ts → NameUpdate-server-9c901f861eddfde14440c2591dfafb2b1fb1993d.ts} +8 -10
  513. package/test/party/components/temp/{PageTitle-client-75fea3a37fb1213bc13f56160bb6779486b2e6e9.ts → PageTitle-client-c006df9a3e662488a1db089de53fd485c6b923e4.ts} +6 -11
  514. package/test/party/components/temp/{PageTitle-server-8b34f9af760ab39e20a60e10ee3185e70d92e42b.ts → PageTitle-server-f4676ec6feccaa03b89d52835c6635536eb885ef.ts} +8 -10
  515. package/test/party/components/temp/{PickPill-client-a1f48b5c28db87eb57f0ac1f6b4370e4b2952de7.ts → PickPill-client-af8357daf3f6633c7f451d0bddd72fefe786d5c3.ts} +8 -13
  516. package/test/party/components/temp/{PickPill-server-9596fdb8ff254cb4e1b99b714f3c5e8ea8aaa308.ts → PickPill-server-d8fb383bc25f7d26bb0153088a2ee19c765fc66b.ts} +8 -10
  517. package/test/party/components/temp/{Time-client-2013f274e90b45be3138727f2298305e1951131f.ts → Time-client-94380d45de7275a5cec98e5f58c15b74b13e9c3e.ts} +6 -11
  518. package/test/party/components/temp/{Time-server-da1cafe72c0f9a6dbf15a04dfa7282ae5187c101.ts → Time-server-3f71a83b6fd357b57e85344281454ee793024e7b.ts} +8 -10
  519. package/test/party/components/temp/{TrafficLight-client-d04c95686ec0ad8a9c54710773945e9904224d5e.ts → TrafficLight-client-12b20962b4146ef08fe0c37597441533c7699408.ts} +18 -26
  520. package/test/party/components/temp/{TrafficLight-server-6c0f66cdabfc7239b99665c3f7087462ee302e8a.ts → TrafficLight-server-625a774075633be88822f4d345e1421a77aba98a.ts} +8 -10
  521. package/test/party/components/temp/{UserProfile-client-a59466813b208664f35e6e394858c3d61e040644.ts → UserProfile-client-e5330b2c96bd8b225cb6291bc8b1d9f35c93307e.ts} +6 -18
  522. package/test/party/components/temp/{UserProfile-server-b10ec192e03dc818fe66dbd4aad14200e817e596.ts → UserProfile-server-6e89fd7f8ade8e8d64630e5da8361d7a1fa2ff5a.ts} +7 -10
  523. package/test/party/components/temp/{UserProfileApp-client-e0bfaa4ffed336c8be4b23dd81800501980c9938.ts → UserProfileApp-client-4c86e4f9a0d042f4f4811868f0146e872b17353c.ts} +6 -11
  524. package/test/party/components/temp/{UserProfileApp-server-4b308db466a80bcacd190aa71f86cf4d2b6f2873.ts → UserProfileApp-server-754d269451abf8fd04e519b8edde33d25c73ce28.ts} +8 -11
  525. package/test/party/components/temp/{UserProfileContext-client-7ef27199bd35b55b3dadd876174a2ef4b602b63f.ts → UserProfileContext-client-424131db3cc89ae4babe127b9108ffc5696c9e1d.ts} +7 -13
  526. package/test/party/components/temp/{UserProfileContext-server-df958e4fc2de2242c556ffa61ddb58aa395de50c.ts → UserProfileContext-server-e72e8ccee2703cce216f2368a1555d64acc2654c.ts} +8 -9
  527. package/test/party/components/temp/{UserProfileContextApp-client-b3ef357f481dfb940e1c726690d57567fde2dc23.ts → UserProfileContextApp-client-5f94a7ccf3e4542ea40d8046ad75eeb21005c55f.ts} +7 -12
  528. package/test/party/components/temp/{UserProfileContextApp-server-f8fe2b88db3d0dfa4dafd300006b25123cb8e3fb.ts → UserProfileContextApp-server-267ac147e0e59e53aeb6741a8cd0f3ef1216051f.ts} +9 -11
  529. package/test/preact.test.ts +2560 -0
  530. package/test/props/components/output/Reactive-client.ts +8 -17
  531. package/test/props/components/output/Reactive-server.ts +12 -16
  532. package/test/props/components/temp/{Reactive-client-21a24e3b0a76140567db8a01975317c9c0e0ad5a.ts → Reactive-client-9bc3643675fc563f96efb00bc3c4b843ba4b7f2e.ts} +8 -17
  533. package/test/props/components/temp/{Reactive-server-b6e37b5d3488ea74a260ca972906bfab30dde486.ts → Reactive-server-8a84d0fc1f375d91438d840ca9753e32d86366ac.ts} +12 -16
  534. package/test/props/reactive.test.ts +2 -2
  535. package/test/replace/components/output/Replace-client.ts +6 -14
  536. package/test/replace/components/output/Replace-server.ts +7 -9
  537. package/test/replace/components/temp/{Replace-client-aee34e2e40c6f4380b61e9c7c8df9af1897f06cc.ts → Replace-client-6f21ff3eb303bd5488d211087dc35fcf998d4e2a.ts} +6 -14
  538. package/test/replace/components/temp/{Replace-server-3521251fa687ce42af3128d22b129fe1ec6ed411.ts → Replace-server-b536cf6d792ae73aaa7f5ea04cda6858a07479f9.ts} +7 -9
  539. package/test/replace/replace.test.ts +2 -2
  540. package/test/script/script-with-comments.test.ts +14 -19
  541. package/test/script/script-with-strings.test.ts +14 -19
  542. package/test/script/script.test.ts +14 -19
  543. package/test/slots/basic-slot.test.ts +2 -2
  544. package/test/slots/components/Article.torp +3 -3
  545. package/test/slots/components/Basic.torp +1 -1
  546. package/test/slots/components/Header.torp +2 -2
  547. package/test/slots/components/Let.torp +3 -3
  548. package/test/slots/components/List.torp +1 -1
  549. package/test/slots/components/Named.torp +3 -3
  550. package/test/slots/components/Unused.torp +1 -1
  551. package/test/slots/components/output/Article-client.ts +4 -8
  552. package/test/slots/components/output/Article-server.ts +6 -8
  553. package/test/slots/components/output/Basic-client.ts +7 -14
  554. package/test/slots/components/output/Basic-server.ts +8 -12
  555. package/test/slots/components/output/Header-client.ts +4 -9
  556. package/test/slots/components/output/Header-server.ts +6 -8
  557. package/test/slots/components/output/Let-client.ts +7 -14
  558. package/test/slots/components/output/Let-server.ts +7 -11
  559. package/test/slots/components/output/List-client.ts +17 -16
  560. package/test/slots/components/output/List-server.ts +6 -8
  561. package/test/slots/components/output/Named-client.ts +9 -19
  562. package/test/slots/components/output/Named-server.ts +9 -14
  563. package/test/slots/components/output/Unused-client.ts +5 -10
  564. package/test/slots/components/output/Unused-server.ts +7 -10
  565. package/test/slots/components/temp/{Article-client-3f2da4b399f94ae8c329489e1ba0ba98196df9c5.ts → Article-client-0b674ee98ae7f85021bfb8b912f28e3c4b35e877.ts} +4 -8
  566. package/test/slots/components/temp/{Article-server-50fa458663f115c0e80a3a2846de4607d8748ecb.ts → Article-server-3db1718b70b86b456514b54ae17a597d07cc0ca9.ts} +6 -8
  567. package/test/slots/components/temp/{Basic-client-a2c4bf685d4b75d0395da427b7754c2a58374dd7.ts → Basic-client-196f7f0244dca0baeffb547eec55c089a108283d.ts} +7 -14
  568. package/test/slots/components/temp/{Basic-server-593e0ecbc8abbc90e8b06198698d244d110d97e2.ts → Basic-server-a22e6ec236b84e09d4d59c7abc4f0b22bf60f22c.ts} +8 -12
  569. package/test/slots/components/temp/{Header-client-d7418b71df5db36d58a73e909233863a6c03678b.ts → Header-client-e5c784d60469523803898ee4d8b85fb82a7b7c0b.ts} +4 -9
  570. package/test/slots/components/temp/{Header-server-d0f27afc4db322e605491e8f508e83f625e8dc38.ts → Header-server-3182d735443d9cf6a0cc7891919cc2c08df2aa8f.ts} +6 -8
  571. package/test/slots/components/temp/{Let-client-913f9dede92b68a3f4a13d1f56f99b3e08e01efe.ts → Let-client-645271fcd63cd500001c75740b22b1b387330657.ts} +7 -14
  572. package/test/slots/components/temp/{Let-server-f3c026e37c11628914c495083752d8cf285b2e85.ts → Let-server-b6d6e2012155c7533a0eb4ee0aaf00157a7d4493.ts} +7 -11
  573. package/test/slots/components/temp/{List-client-6bc2d267a8b2028a14b12b2c70feb7c6a47d6d64.ts → List-client-ee6047ac396dc0b6fce5e38af51c38093fae83a2.ts} +17 -16
  574. package/test/slots/components/temp/{List-server-8d9c174fc4b3b232f3a9fd2f59843481f023d913.ts → List-server-1ee246e864cdb31bb8f52cf4424b6ef0e9b41cf1.ts} +6 -8
  575. package/test/slots/components/temp/{Named-client-f6e7a984759ce8f50bc52dcf56f6f06cab925a80.ts → Named-client-559988562c5de1ae6017d2ad6de063f4363064b6.ts} +9 -19
  576. package/test/slots/components/temp/{Named-server-ac8d47db82d9a387c8baeee59b975bb810bad168.ts → Named-server-f2ce3d301e916ea38901a92185c25512b11d42d4.ts} +9 -14
  577. package/test/slots/components/temp/{Unused-client-ea0a096aa7a1c958f3bf807f35340b96f8a025ee.ts → Unused-client-52d1828bd28ebf7046a2e948a369563c0ea83b98.ts} +5 -10
  578. package/test/slots/components/temp/{Unused-server-1da99efc50ef70be0d9a0e5499353a17dc666936.ts → Unused-server-f5248f5cd4616c65eaf27c67385f13ed671accad.ts} +7 -10
  579. package/test/slots/let-slot.test.ts +4 -4
  580. package/test/slots/named-slot.test.ts +2 -2
  581. package/test/slots/unused-slot.test.ts +2 -2
  582. package/test/source-maps/components/Source.torp +19 -0
  583. package/test/source-maps/components/output/Source-client.ts +63 -0
  584. package/test/source-maps/components/output/Source-server.ts +26 -0
  585. package/test/source-maps/components/temp/Source-client-ae8c4811ff658c13ee8c9b9e0e53fff1b83b178b.ts +63 -0
  586. package/test/source-maps/components/temp/Source-server-70b20214c52b8820f450324943e8a1ffb0a72d5e.ts +26 -0
  587. package/test/source-maps/parse.test.ts +62 -0
  588. package/test/special-component/components/BigTitle.torp +1 -1
  589. package/test/special-component/components/Component.torp +2 -2
  590. package/test/special-component/components/SmallTitle.torp +1 -1
  591. package/test/special-component/components/output/BigTitle-client.ts +4 -8
  592. package/test/special-component/components/output/BigTitle-server.ts +6 -8
  593. package/test/special-component/components/output/Component-client.ts +7 -15
  594. package/test/special-component/components/output/Component-server.ts +8 -11
  595. package/test/special-component/components/output/SmallTitle-client.ts +4 -8
  596. package/test/special-component/components/output/SmallTitle-server.ts +6 -8
  597. package/test/special-component/components/temp/{BigTitle-client-c4bd66406d55ce83ab4491c4114d563055e1c275.ts → BigTitle-client-cb3055f809aaf17bd1fa82748d039ac3730a8d44.ts} +4 -8
  598. package/test/special-component/components/temp/{BigTitle-server-34af54c15cf575163c1ff8e63978cf5257f2347c.ts → BigTitle-server-fef9d1e1deacfde2be4469c2e63a801b2e518dff.ts} +6 -8
  599. package/test/special-component/components/temp/{Component-client-c39c66cf5274445bb863fd759e0ef223613a9f3a.ts → Component-client-0eb9553b52acce2dfa564242295a4c57a38bd540.ts} +7 -15
  600. package/test/special-component/components/temp/{Component-server-ca4a2192477db4a32ad12f1a6a14d673717b0f7b.ts → Component-server-9d0fddeff790bfb2b6cfbcd2edf677837f5b8120.ts} +8 -11
  601. package/test/special-component/components/temp/{SmallTitle-client-e4b3e51243ca4f1efca21ac0f957b81e8bc93167.ts → SmallTitle-client-5a65b233be29395e9650f57d9708a33de1279af3.ts} +4 -8
  602. package/test/special-component/components/temp/{SmallTitle-server-6c9aabb9139356397e04612b4dd9d849f871a280.ts → SmallTitle-server-11f8b6b3c613716d6a5371883a9b55434bb43ad5.ts} +6 -8
  603. package/test/special-component/special-component.test.ts +2 -2
  604. package/test/special-element/components/Element.torp +2 -2
  605. package/test/special-element/components/output/Element-client.ts +5 -11
  606. package/test/special-element/components/output/Element-server.ts +7 -10
  607. package/test/special-element/components/temp/{Element-client-c5701ed44faa4ec8ae558505063684a84cada3f2.ts → Element-client-745e610fbd5c652d327c8ac349d49d5ee4c8d9ea.ts} +5 -11
  608. package/test/special-element/components/temp/Element-server-7aef6d0ed7369aa2418183519c8320e0409a5641.ts +15 -0
  609. package/test/special-element/special-element.test.ts +2 -2
  610. package/test/special-head/components/Head.torp +2 -4
  611. package/test/special-head/components/output/Head-client.ts +8 -23
  612. package/test/special-head/components/output/Head-server.ts +5 -11
  613. package/test/special-head/components/temp/Head-client-bbbb5e712247ee41ca65a7ffd457987de5e99b3e.ts +19 -0
  614. package/test/special-head/components/temp/Head-server-c3de2e6b56aabc095380370d8bf93ae3bc7c10d9.ts +12 -0
  615. package/test/special-head/special-head.test.ts +2 -2
  616. package/test/special-self/components/output/Self-client.ts +13 -17
  617. package/test/special-self/components/output/Self-server.ts +6 -9
  618. package/test/special-self/components/temp/{Self-client-883ca81e0e44df56f2290698e8d6b9955434a2ad.ts → Self-client-dfe57df69e3677e94f7b5f3657c82602054ef19e.ts} +13 -17
  619. package/test/special-self/components/temp/{Self-server-69dac409fc984db7db97df8a30c5de6794f25655.ts → Self-server-5d135dab2b6fd4ba7fe3f56768f0725607d36bd9.ts} +6 -9
  620. package/test/special-self/special-self.test.ts +2 -2
  621. package/test/style/components/Style.torp +1 -1
  622. package/test/style/components/output/Style-client.ts +6 -12
  623. package/test/style/components/output/Style-server.ts +7 -10
  624. package/test/style/components/temp/{Style-client-ea018338497095f270308b2e73cfe6344721c6eb.ts → Style-client-9491a5aff97f118df542f976d7f7a21e7cc88c62.ts} +6 -12
  625. package/test/style/components/temp/{Style-server-99ff9867ee067760a463a8282773b2eb09aa14f7.ts → Style-server-8b8cbe1868cab30d9e34dda52921652768ada1db.ts} +7 -10
  626. package/test/style/parse.test.ts +507 -193
  627. package/test/style/style.test.ts +2 -2
  628. package/test/svg/components/Shape.torp +1 -1
  629. package/test/svg/components/output/Shape-client.ts +23 -23
  630. package/test/svg/components/output/Shape-server.ts +8 -10
  631. package/test/svg/components/temp/{Shape-client-052ea7838de07222602834de58968a3f89e6ea56.ts → Shape-client-4cc148d8b70d3750d2982360aad76b74d194b60e.ts} +23 -23
  632. package/test/svg/components/temp/Shape-server-76aaef570e067031ff39635ffe37626364c2200a.ts +23 -0
  633. package/test/svg/svg.test.ts +4 -4
  634. package/test/switch/components/output/Switch-client.ts +16 -22
  635. package/test/switch/components/output/Switch-server.ts +6 -9
  636. package/test/switch/components/temp/{Switch-client-1482e2da8fe144d3e867dfad4618e0f364b91b49.ts → Switch-client-5fc00f4d41300dc7587b113d8e53a102beca7558.ts} +16 -22
  637. package/test/switch/components/temp/{Switch-server-d709eb7a418752dd4203a8f824b78c5f308c8f47.ts → Switch-server-440f7e852145b79656c0023ddc776e4d1d077d2a.ts} +6 -9
  638. package/test/switch/switch-values.test.ts +4 -4
  639. package/test/template/basic-file.test.ts +61 -88
  640. package/test/template/empty-file.test.ts +7 -12
  641. package/test/template/errors.test.ts +64 -34
  642. package/test/text/components/output/Text-client.ts +5 -13
  643. package/test/text/components/output/Text-server.ts +6 -9
  644. package/test/text/components/temp/{Text-client-ca2d5402358fba0df1db2353eed304b0dedb7971.ts → Text-client-6c3be8a1a31a13eff86ce8b5330829cd15b07fab.ts} +5 -13
  645. package/test/text/components/temp/{Text-server-9df4606b85f044ea2b38660e799988461edacb27.ts → Text-server-ac34d47e755aa39b2d89cb44f854450c3db1ddff.ts} +6 -9
  646. package/test/text/text.test.ts +4 -4
  647. package/test/watch-array/ArrayState.ts +2 -2
  648. package/test/watch-array/array-all-functions-unkeyed.test.ts +16 -14
  649. package/test/watch-array/array-all-functions.test.ts +16 -14
  650. package/test/watch-array/array-empty.test.ts +8 -6
  651. package/test/watch-array/array-entries.test.ts +11 -9
  652. package/test/watch-array/array-indexes.test.ts +11 -9
  653. package/test/watch-array/array-pop.test.ts +10 -8
  654. package/test/watch-array/array-push.test.ts +10 -8
  655. package/test/watch-array/array-reassign.test.ts +11 -9
  656. package/test/watch-array/array-reverse.test.ts +10 -8
  657. package/test/watch-array/array-set-object.test.ts +10 -8
  658. package/test/watch-array/array-set-property.test.ts +10 -8
  659. package/test/watch-array/array-shift.test.ts +10 -8
  660. package/test/watch-array/array-sort.test.ts +11 -9
  661. package/test/watch-array/array-splice-add.test.ts +10 -8
  662. package/test/watch-array/array-splice-delete-all.test.ts +10 -8
  663. package/test/watch-array/array-splice-delete-and-add.test.ts +10 -8
  664. package/test/watch-array/array-splice-delete-end.test.ts +10 -8
  665. package/test/watch-array/array-splice-delete.test.ts +10 -8
  666. package/test/watch-array/array-swap.test.ts +10 -8
  667. package/test/watch-array/array-unshift.test.ts +10 -8
  668. package/test/watch-array/array-update-assignment.test.ts +10 -8
  669. package/test/watch-array/components/output/Array-client.ts +19 -21
  670. package/test/watch-array/components/output/Array-server.ts +7 -10
  671. package/test/watch-array/components/output/ArrayEntries-client.ts +21 -23
  672. package/test/watch-array/components/output/ArrayEntries-server.ts +7 -10
  673. package/test/watch-array/components/output/ArrayIndexes-client.ts +19 -21
  674. package/test/watch-array/components/output/ArrayIndexes-server.ts +7 -10
  675. package/test/watch-array/components/output/ArrayUnkeyed-client.ts +19 -20
  676. package/test/watch-array/components/output/ArrayUnkeyed-server.ts +7 -10
  677. package/test/watch-array/components/temp/{Array-client-d048f5c224a3f2e2729878dbb069ce15ca913e12.ts → Array-client-552f81452d33fe6dc715c9f6bb7986f06475d761.ts} +19 -21
  678. package/test/watch-array/components/temp/{Array-server-48864ed3b67cae2bcedb216865776e44cc3a1dc2.ts → Array-server-16921ef3289ecba5881fcd59e3353fbfad60d4d3.ts} +7 -10
  679. package/test/watch-array/components/temp/{ArrayEntries-client-741607b276718f5deb520e3b657dbf6abbb8081c.ts → ArrayEntries-client-736755fba2492e74812ff9c905202810de54e15a.ts} +21 -23
  680. package/test/watch-array/components/temp/{ArrayEntries-server-401a989fd5f3a093d5d1a8ef1d4fd9d5107a6be3.ts → ArrayEntries-server-ac150fc9fd18c1d9dab9b329f7703e190f5c2725.ts} +7 -10
  681. package/test/watch-array/components/temp/{ArrayIndexes-client-8ab14b254ef67dafad5228c9ec1906eb3b3babef.ts → ArrayIndexes-client-a496328fa92ffca676ab8893013a0cfec1734ad1.ts} +19 -21
  682. package/test/watch-array/components/temp/{ArrayIndexes-server-35c31a8a4597da68d39cf20bd6b90137695514de.ts → ArrayIndexes-server-e8fc511c0d27796dc1733f8cc63377f7a4511f76.ts} +7 -10
  683. package/test/watch-array/components/temp/{ArrayUnkeyed-client-9684aba82757748815b94c04bf3f8d1f98332535.ts → ArrayUnkeyed-client-5a2c5cb1fecba52653f7f35cfd07627682930c15.ts} +19 -20
  684. package/test/watch-array/components/temp/{ArrayUnkeyed-server-19f195f0cf00760c520ac4c55aef474c8eae4c41.ts → ArrayUnkeyed-server-916a5cdb7c36d95946cafdc69dca782291af24e4.ts} +7 -10
  685. package/test/watch-object/components/output/Watched-client.ts +5 -11
  686. package/test/watch-object/components/output/Watched-server.ts +6 -9
  687. package/test/watch-object/components/temp/{Watched-client-ddba353c5a94f5a874e19d6d4cc6271a04e915c0.ts → Watched-client-1f0409aa6e2c425d0319a23caec7d10ad313d579.ts} +5 -11
  688. package/test/watch-object/components/temp/{Watched-server-e8e8c15b9fb5dda4051a289e9cd75d71078b9e95.ts → Watched-server-156afd257b562162d86417f2bbf5afe1bf57de06.ts} +6 -9
  689. package/test/watch-object/watch-object.test.ts +11 -9
  690. package/{tsup.config.ts → tsdown.config.ts} +1 -3
  691. package/dist/Component-CysAnHpO.d.cts +0 -8
  692. package/dist/Component-CysAnHpO.d.ts +0 -8
  693. package/dist/ServerSlotRender-BMGG0yq3.d.cts +0 -15
  694. package/dist/ServerSlotRender-BMGG0yq3.d.ts +0 -15
  695. package/dist/chunk-EGRHWZRV.js +0 -1
  696. package/dist/chunk-EGRHWZRV.js.map +0 -1
  697. package/dist/chunk-XNO4YEJ3.js +0 -64
  698. package/dist/chunk-XNO4YEJ3.js.map +0 -1
  699. package/dist/metafile-cjs.json +0 -1
  700. package/dist/metafile-esm.json +0 -1
  701. package/src/compile/build/client/buildHeadNode.ts +0 -17
  702. package/src/compile/build/utils/isReactiveAttribute.ts +0 -16
  703. package/src/compile/types/nodes/isControlNode.ts +0 -6
  704. package/src/compile/types/nodes/isElementNode.ts +0 -6
  705. package/src/compile/types/nodes/isParentNode.ts +0 -6
  706. package/src/compile/types/nodes/isSpecialNode.ts +0 -6
  707. package/src/compile/types/nodes/isTextNode.ts +0 -6
  708. package/src/debug/printHtml.ts +0 -25
  709. package/src/types/ProxyPropData.ts +0 -11
  710. package/src/watch/removeEffect.ts +0 -34
  711. package/test/bench/components/temp/Bench-client-4e18421473e97bac7c24b17ba14751ce14dd187e.ts +0 -414
  712. package/test/bench/components/temp/Bench-server-4648921af9bc146718d55a7e9fc288b47a57dfda.ts +0 -142
  713. package/test/component/components/temp/Header-server-91088d2a5a543287bfdf1a24d92b66db6ccd294d.ts +0 -19
  714. package/test/console/components/temp/Console-server-7bc7f568e9c3626dca1bdafcb23186c2dbc59199.ts +0 -18
  715. package/test/dummy/components/temp/ProfilePreview-client-e57ca1ac502e0ddcb3ef376dd5ef27add70090d1.ts +0 -327
  716. package/test/dummy/components/temp/ProfilePreview-server-9d3d0f8b4f80f634db6ba97d037ab07de004b4d3.ts +0 -56
  717. package/test/html/components/temp/Html-server-4f73a2b0c5cd9b82666a99ec6a217c758d435008.ts +0 -18
  718. package/test/mount/components/temp/Mount-server-8564e4e0886ea754dfedf9a4a5fd82f0484c1d83.ts +0 -25
  719. package/test/on-mount/components/temp/OnMount-server-2ff035e067926fadc284030075aa5da69a05cf31.ts +0 -18
  720. package/test/party/components/temp/CssStyle-server-fa4bad3c82930632730e3b6b9f0e9193cab6f777.ts +0 -18
  721. package/test/party/components/temp/HelloWorld-server-50dd4393d55ecd33d5b7684c4f9ed41dfa0ceb5d.ts +0 -18
  722. package/test/party/components/temp/InputFocused-server-7b062b0dd7686ccc389c3c1a17f37e9a9bb19da9.ts +0 -26
  723. package/test/special-element/components/temp/Element-server-011a942cc147900d8e074c084297d8e81f05aa27.ts +0 -18
  724. package/test/special-head/components/temp/Head-client-967d6ea24d46308af586c7553f4658412d94716c.ts +0 -34
  725. package/test/special-head/components/temp/Head-server-7cf8212c95197ed6320b47483524d8b1b3e5ae68.ts +0 -18
  726. package/test/svg/components/temp/Shape-server-4ef7e80f09d3d4c930055d0a25184c48507e51de.ts +0 -25
  727. /package/src/compile/{build/utils → utils}/isFullyReactive.ts +0 -0
  728. /package/src/compile/{build/utils → utils}/isReactive.ts +0 -0
@@ -0,0 +1,410 @@
1
+ //#region src/render/context.ts
2
+ const context = {
3
+ activeTarget: null,
4
+ previousEffect: null,
5
+ extent: 0,
6
+ batch: 0,
7
+ batchOperation: 0,
8
+ registerComputed: null,
9
+ firstEffectToRun: null,
10
+ firstSignalToUpdate: null,
11
+ activeRange: null,
12
+ previousRange: null,
13
+ rootRange: null,
14
+ mountEffects: [],
15
+ stashedEvents: [],
16
+ stashedAnimations: [],
17
+ hydrationNode: null
18
+ };
19
+ var context_default = context;
20
+
21
+ //#endregion
22
+ //#region src/types/constants.ts
23
+ /**
24
+ * The type of a Signal object.
25
+ */
26
+ const SIGNAL_TYPE = 0;
27
+ /**
28
+ * The type of a Computed object.
29
+ */
30
+ const COMPUTED_TYPE = 1;
31
+ /**
32
+ * The type of an Effect object.
33
+ */
34
+ const EFFECT_TYPE = 2;
35
+
36
+ //#endregion
37
+ //#region src/watch/clearSources.ts
38
+ /**
39
+ * Clear unused source subscriptions after each Computed or Effect has been run.
40
+ */
41
+ function clearSources(target) {
42
+ let previousSub = null;
43
+ for (let clearSub = target.firstSource; clearSub !== null; clearSub = clearSub.nextSource) if (target.didError || !clearSub.active) {
44
+ if (previousSub === null) target.firstSource = clearSub.nextSource;
45
+ else previousSub.nextSource = clearSub.nextSource;
46
+ if (clearSub.previousTarget === null) {
47
+ if (clearSub.source.firstTarget === clearSub) clearSub.source.firstTarget = clearSub.nextTarget;
48
+ } else clearSub.previousTarget.nextTarget = clearSub.nextTarget;
49
+ } else {
50
+ clearSub.recalc = false;
51
+ previousSub = clearSub;
52
+ }
53
+ }
54
+
55
+ //#endregion
56
+ //#region src/watch/deactivateSources.ts
57
+ /**
58
+ * Sets source subscriptions to inactive for a Computed or Effect.
59
+ */
60
+ function deactivateSources(target) {
61
+ for (let sourceSub = target.firstSource; sourceSub !== null; sourceSub = sourceSub.nextSource) sourceSub.active = false;
62
+ }
63
+
64
+ //#endregion
65
+ //#region src/watch/trackEffect.ts
66
+ /**
67
+ * If there's an active target, subscribe it to this signal, so that it will be
68
+ * run when the signal changes.
69
+ */
70
+ function trackEffect(signal) {
71
+ const target = context_default.activeTarget;
72
+ if (target !== null) {
73
+ let sub = null;
74
+ let lastSub = null;
75
+ for (let nextSub = signal.firstTarget; nextSub !== null; nextSub = nextSub.nextTarget) {
76
+ lastSub = nextSub;
77
+ if (nextSub.target === target) {
78
+ sub = nextSub;
79
+ break;
80
+ }
81
+ }
82
+ if (sub === null) {
83
+ sub = {
84
+ source: signal,
85
+ target,
86
+ previousTarget: lastSub,
87
+ nextTarget: null,
88
+ nextSource: null,
89
+ active: true,
90
+ recalc: false
91
+ };
92
+ if (lastSub === null) signal.firstTarget = sub;
93
+ else lastSub.nextTarget = sub;
94
+ if (target.firstSource === null) target.firstSource = sub;
95
+ else {
96
+ let lastEffectSub = target.firstSource;
97
+ for (let nextSub = lastEffectSub.nextSource; nextSub !== null; nextSub = nextSub.nextSource) lastEffectSub = nextSub;
98
+ lastEffectSub.nextSource = sub;
99
+ }
100
+ } else sub.active = true;
101
+ }
102
+ }
103
+
104
+ //#endregion
105
+ //#region src/watch/runComputed.ts
106
+ function runComputed(computed) {
107
+ const oldActiveTarget = context_default.activeTarget;
108
+ computed.running = true;
109
+ computed.didError = false;
110
+ try {
111
+ context_default.activeTarget = computed;
112
+ computed.value = computed.run();
113
+ } catch (err) {
114
+ computed.didError = true;
115
+ computed.value = err;
116
+ throw err;
117
+ } finally {
118
+ context_default.activeTarget = oldActiveTarget;
119
+ computed.running = false;
120
+ }
121
+ trackEffect(computed);
122
+ return computed.value;
123
+ }
124
+
125
+ //#endregion
126
+ //#region src/watch/checkComputed.ts
127
+ /**
128
+ * Checks whether a Computed value should be re-run (which will be true if any
129
+ * of its sources have changed) and re-runs it if necessary.
130
+ */
131
+ function checkComputed(computed) {
132
+ let rerun = checkSources(computed);
133
+ let changed = false;
134
+ if (rerun) {
135
+ deactivateSources(computed);
136
+ const oldValue = computed.value;
137
+ runComputed(computed);
138
+ changed = computed.value !== oldValue;
139
+ clearSources(computed);
140
+ }
141
+ computed.recalc = false;
142
+ if (!changed) for (let targetSub = computed.firstTarget; targetSub !== null; targetSub = targetSub.nextTarget) {
143
+ targetSub.active = true;
144
+ targetSub.recalc = false;
145
+ }
146
+ return changed;
147
+ }
148
+
149
+ //#endregion
150
+ //#region src/watch/checkSources.ts
151
+ /**
152
+ * Checks whether a Computed or Effect should be re-run (which will be true if
153
+ * any of its sources have changed).
154
+ */
155
+ function checkSources(target) {
156
+ let haveComputed = false;
157
+ for (let sourceSub = target.firstSource; sourceSub !== null; sourceSub = sourceSub.nextSource) if (sourceSub.recalc) if (sourceSub.source.type === SIGNAL_TYPE) return true;
158
+ else if (sourceSub.source.recalc) haveComputed = true;
159
+ else return true;
160
+ if (haveComputed) {
161
+ for (let sourceSub = target.firstSource; sourceSub !== null; sourceSub = sourceSub.nextSource) if (sourceSub.recalc && sourceSub.source.type === COMPUTED_TYPE && sourceSub.source.recalc) {
162
+ const oldActiveTarget = context_default.activeTarget;
163
+ context_default.activeTarget = target;
164
+ const recalc = checkComputed(sourceSub.source);
165
+ context_default.activeTarget = oldActiveTarget;
166
+ if (recalc) return true;
167
+ }
168
+ }
169
+ return false;
170
+ }
171
+
172
+ //#endregion
173
+ //#region src/watch/runCleanups.ts
174
+ /**
175
+ * Runs cleanup functions for the effect and its children.
176
+ */
177
+ function runCleanups(effect) {
178
+ let effectToClean = effect;
179
+ for (let i = 0; i < effect.extent; i++) {
180
+ if (typeof effectToClean.cleanup === "function") {
181
+ const oldActiveTarget = context_default.activeTarget;
182
+ context_default.activeTarget = null;
183
+ try {
184
+ effectToClean.cleanup();
185
+ } catch (err) {
186
+ effectToClean.didError = true;
187
+ clearSources(effectToClean);
188
+ throw err;
189
+ } finally {
190
+ effectToClean.cleanup = void 0;
191
+ context_default.activeTarget = oldActiveTarget;
192
+ }
193
+ }
194
+ const nextEffect = effectToClean.nextEffect;
195
+ if (i !== 0 && effect.nextEffectToRun === effectToClean) {
196
+ effect.nextEffectToRun = effectToClean.nextEffectToRun;
197
+ effectToClean.nextEffect = effectToClean.nextEffectToRun = null;
198
+ }
199
+ effectToClean = nextEffect;
200
+ }
201
+ }
202
+
203
+ //#endregion
204
+ //#region src/watch/batchStart.ts
205
+ function batchStart() {
206
+ context_default.batch++;
207
+ }
208
+
209
+ //#endregion
210
+ //#region src/watch/runEffect.ts
211
+ function runEffect(effect) {
212
+ const oldActiveTarget = context_default.activeTarget;
213
+ const oldExtent = context_default.extent;
214
+ effect.didError = false;
215
+ batchStart();
216
+ try {
217
+ if (context_default.previousEffect !== null) context_default.previousEffect.nextEffect = effect;
218
+ context_default.activeTarget = effect;
219
+ context_default.previousEffect = effect;
220
+ context_default.extent = 1;
221
+ effect.cleanup = effect.run();
222
+ effect.extent = context_default.extent;
223
+ } catch (err) {
224
+ effect.didError = true;
225
+ clearSources(effect);
226
+ throw err;
227
+ } finally {
228
+ context_default.activeTarget = oldActiveTarget;
229
+ context_default.extent += oldExtent - 1;
230
+ batchEnd();
231
+ }
232
+ }
233
+
234
+ //#endregion
235
+ //#region src/watch/checkEffect.ts
236
+ /**
237
+ * Checks whether an Effect should be re-run (which will be true if any
238
+ * of its sources have changed) and re-runs it if necessary.
239
+ */
240
+ function checkEffect(effect) {
241
+ if (checkSources(effect)) {
242
+ runCleanups(effect);
243
+ deactivateSources(effect);
244
+ runEffect(effect);
245
+ clearSources(effect);
246
+ }
247
+ }
248
+
249
+ //#endregion
250
+ //#region src/watch/clearTargets.ts
251
+ /**
252
+ * Clear unused target subscriptions after all Effects have been run.
253
+ */
254
+ function clearTargets(source) {
255
+ let previousSub = null;
256
+ for (let clearSub = source.firstTarget; clearSub !== null; clearSub = clearSub.nextTarget) if (!clearSub.active) if (previousSub === null) source.firstTarget = clearSub.nextTarget;
257
+ else previousSub.nextTarget = clearSub.nextTarget;
258
+ else previousSub = clearSub;
259
+ }
260
+
261
+ //#endregion
262
+ //#region src/watch/triggerEffects.ts
263
+ /**
264
+ * Runs the effects that have been collected during the batch.
265
+ */
266
+ function triggerEffects() {
267
+ let didError = false;
268
+ let error;
269
+ let effect = context_default.firstEffectToRun;
270
+ while (effect !== null) {
271
+ context_default.batchOperation++;
272
+ try {
273
+ checkEffect(effect);
274
+ } catch (err) {
275
+ if (!didError) {
276
+ didError = true;
277
+ error = err;
278
+ }
279
+ }
280
+ effect = effect.nextEffectToRun;
281
+ }
282
+ effect = context_default.firstEffectToRun;
283
+ context_default.firstEffectToRun = null;
284
+ while (effect !== null) {
285
+ let nextEffect = effect.nextEffectToRun;
286
+ effect.nextEffectToRun = null;
287
+ effect = nextEffect;
288
+ }
289
+ let signal = context_default.firstSignalToUpdate;
290
+ context_default.firstSignalToUpdate = null;
291
+ while (signal !== null) {
292
+ clearTargets(signal);
293
+ const nextSignal = signal.nextSignalToUpdate;
294
+ signal.nextSignalToUpdate = null;
295
+ signal = nextSignal;
296
+ }
297
+ if (didError) throw error;
298
+ }
299
+
300
+ //#endregion
301
+ //#region src/watch/batchEnd.ts
302
+ function batchEnd() {
303
+ if (context_default.batch > 1) {
304
+ context_default.batch--;
305
+ return;
306
+ }
307
+ try {
308
+ triggerEffects();
309
+ } finally {
310
+ context_default.batch = 0;
311
+ context_default.batchOperation = 0;
312
+ context_default.previousEffect = null;
313
+ }
314
+ }
315
+
316
+ //#endregion
317
+ //#region src/render/$batch.ts
318
+ /**
319
+ * Runs updates to proxy values in a batch, where the updates are stored in
320
+ * context, and dependent effects are run all at once at the end.
321
+ *
322
+ * @param fn The function containing the batched updates to run.
323
+ */
324
+ function $batch(fn) {
325
+ if (context_default.batch > 0) return fn();
326
+ batchStart();
327
+ try {
328
+ return fn();
329
+ } finally {
330
+ batchEnd();
331
+ }
332
+ }
333
+
334
+ //#endregion
335
+ //#region src/render/$cache.ts
336
+ /**
337
+ * Caches a computed value from signals accessed in a property getter.
338
+ *
339
+ * @param fn The function containing the signals to compute and cache.
340
+ */
341
+ function $cache(fn) {
342
+ if (context_default.registerComputed === null) throw new Error("$cache must be used in a getter");
343
+ let computed = {
344
+ type: COMPUTED_TYPE,
345
+ value: null,
346
+ run: fn,
347
+ firstSource: null,
348
+ firstTarget: null,
349
+ recalc: false,
350
+ running: false,
351
+ didError: false,
352
+ rollback: null
353
+ };
354
+ context_default.registerComputed(computed);
355
+ runComputed(computed);
356
+ return computed.value;
357
+ }
358
+
359
+ //#endregion
360
+ //#region src/render/$peek.ts
361
+ function $peek(fn) {
362
+ const oldActiveTarget = context_default.activeTarget;
363
+ context_default.activeTarget = null;
364
+ const result = fn();
365
+ context_default.activeTarget = oldActiveTarget;
366
+ return result;
367
+ }
368
+
369
+ //#endregion
370
+ //#region src/render/buildClasses.ts
371
+ function buildClasses(value, styleHash) {
372
+ if (typeof value === "string") {
373
+ if (styleHash !== void 0) value += " " + styleHash;
374
+ return value;
375
+ } else {
376
+ let classes = [];
377
+ gatherNames("", value, classes);
378
+ if (styleHash !== void 0) classes.push(styleHash);
379
+ return classes.join(" ");
380
+ }
381
+ }
382
+ function gatherNames(name, value, classes) {
383
+ if (value) if (Array.isArray(value)) for (let v of value) gatherNames(v, v, classes);
384
+ else if (typeof value === "object") for (let [n, v] of Object.entries(value)) gatherNames(n, v, classes);
385
+ else classes.push(name);
386
+ }
387
+
388
+ //#endregion
389
+ //#region src/render/buildStyles.ts
390
+ function buildStyles(value) {
391
+ if (typeof value === "string") return value;
392
+ else {
393
+ let styles = [];
394
+ if (value) {
395
+ if (Array.isArray(value)) for (let v of value) styles.push(v);
396
+ else if (typeof value === "object") for (let [n, v] of Object.entries(value)) styles.push(`${n}: ${v}`);
397
+ }
398
+ return styles.join("; ");
399
+ }
400
+ }
401
+
402
+ //#endregion
403
+ //#region src/render/formatText.ts
404
+ function formatText(value) {
405
+ return value ?? "";
406
+ }
407
+
408
+ //#endregion
409
+ export { $batch, $cache, $peek, COMPUTED_TYPE, EFFECT_TYPE, SIGNAL_TYPE, batchEnd, batchStart, buildClasses, buildStyles, checkComputed, context_default, formatText, runEffect, trackEffect };
410
+ //# sourceMappingURL=formatText-B0FXBdFT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatText-B0FXBdFT.js","names":["context: Context","previousSub: Subscription | null","clearSub: Subscription | null","sourceSub: Subscription | null","context","sub: Subscription | null","lastSub: Subscription | null","nextSub: Subscription | null","context","targetSub: Subscription | null","sourceSub: Subscription | null","context","effectToClean: Effect | null","context","nextEffect: Effect","context","previousSub: Subscription | null","clearSub: Subscription | null","error: any","effect: Effect | null","context","signal: ProxySignal | null","context","context","context","computed: Computed","context","classes: string[]","styles: string[]"],"sources":["../src/render/context.ts","../src/types/constants.ts","../src/watch/clearSources.ts","../src/watch/deactivateSources.ts","../src/watch/trackEffect.ts","../src/watch/runComputed.ts","../src/watch/checkComputed.ts","../src/watch/checkSources.ts","../src/watch/runCleanups.ts","../src/watch/batchStart.ts","../src/watch/runEffect.ts","../src/watch/checkEffect.ts","../src/watch/clearTargets.ts","../src/watch/triggerEffects.ts","../src/watch/batchEnd.ts","../src/render/$batch.ts","../src/render/$cache.ts","../src/render/$peek.ts","../src/render/buildClasses.ts","../src/render/buildStyles.ts","../src/render/formatText.ts"],"sourcesContent":["import type Context from \"../types/Context\";\n\nconst context: Context = {\n\tactiveTarget: null,\n\tpreviousEffect: null,\n\textent: 0,\n\tbatch: 0,\n\tbatchOperation: 0,\n\tregisterComputed: null,\n\n\tfirstEffectToRun: null,\n\tfirstSignalToUpdate: null,\n\n\t// These will definitely be set, in mount or render\n\t// @ts-ignore\n\tactiveRange: null,\n\t// @ts-ignore\n\tpreviousRange: null,\n\t// @ts-ignore\n\trootRange: null,\n\n\tmountEffects: [],\n\tstashedEvents: [],\n\tstashedAnimations: [],\n\n\thydrationNode: null,\n\t//hn: null,\n\t//get hydrationNode() {\n\t//\treturn this.hn;\n\t//},\n\t//set hydrationNode(value) {\n\t//\tconsole.log(`set hydration ${printNode(value)}`);\n\t//\tthis.hn = value;\n\t//},\n};\n\nexport default context;\n","/**\n * The type of a Signal object.\n */\nexport const SIGNAL_TYPE = 0;\n\n/**\n * The type of a Computed object.\n */\nexport const COMPUTED_TYPE = 1;\n\n/**\n * The type of an Effect object.\n */\nexport const EFFECT_TYPE = 2;\n","import type Computed from \"../types/Computed\";\nimport type Effect from \"../types/Effect\";\nimport type Subscription from \"../types/Subscription\";\n\n/**\n * Clear unused source subscriptions after each Computed or Effect has been run.\n */\nexport default function clearSources(target: Computed | Effect): void {\n\tlet previousSub: Subscription | null = null;\n\tfor (\n\t\tlet clearSub: Subscription | null = target.firstSource;\n\t\tclearSub !== null;\n\t\tclearSub = clearSub.nextSource\n\t) {\n\t\tif (target.didError || !clearSub.active) {\n\t\t\t//console.log(\n\t\t\t//\t`clearing source sub ${clearSub.source.name} <-> ${clearSub.target.name} (${clearSub.name})`,\n\t\t\t//);\n\t\t\tif (previousSub === null) {\n\t\t\t\ttarget.firstSource = clearSub.nextSource;\n\t\t\t} else {\n\t\t\t\tpreviousSub.nextSource = clearSub.nextSource;\n\t\t\t}\n\n\t\t\t// Update the targets list too\n\t\t\tif (clearSub.previousTarget === null) {\n\t\t\t\tif (clearSub.source.firstTarget === clearSub) {\n\t\t\t\t\tclearSub.source.firstTarget = clearSub.nextTarget;\n\t\t\t\t}\n\t\t\t\t// TODO: else???\n\t\t\t} else {\n\t\t\t\tclearSub.previousTarget.nextTarget = clearSub.nextTarget;\n\t\t\t}\n\t\t} else {\n\t\t\tclearSub.recalc = false;\n\t\t\tpreviousSub = clearSub;\n\t\t}\n\t}\n}\n","import type Computed from \"../types/Computed\";\nimport type Effect from \"../types/Effect\";\nimport type Subscription from \"../types/Subscription\";\n\n/**\n * Sets source subscriptions to inactive for a Computed or Effect.\n */\nexport default function deactivateSources(target: Computed | Effect): void {\n\tfor (\n\t\tlet sourceSub: Subscription | null = target.firstSource;\n\t\tsourceSub !== null;\n\t\tsourceSub = sourceSub.nextSource\n\t) {\n\t\tsourceSub.active = false;\n\t\t//console.log(\n\t\t//\t`deactivating ${sourceSub.source.name} <-> ${sourceSub.target.name} (${sourceSub.name})`,\n\t\t//);\n\t}\n}\n","import context from \"../render/context\";\nimport type Computed from \"../types/Computed\";\nimport type ProxySignal from \"../types/ProxySignal\";\nimport type Subscription from \"../types/Subscription\";\n\n// TODO: Rename this to `subscribe` because its purpose has changed a bit\n\n/**\n * If there's an active target, subscribe it to this signal, so that it will be\n * run when the signal changes.\n */\nexport default function trackEffect(signal: ProxySignal | Computed): void {\n\tconst target = context.activeTarget;\n\tif (target !== null) {\n\t\tlet sub: Subscription | null = null;\n\t\tlet lastSub: Subscription | null = null;\n\n\t\t// Check if there's a sub we can re-use\n\t\t// TODO: Maybe we could be smarter with this\n\t\t// -- use the target sub instead?\n\t\t// -- do it differently on push vs pull??\n\t\tfor (\n\t\t\tlet nextSub: Subscription | null = signal.firstTarget;\n\t\t\tnextSub !== null;\n\t\t\tnextSub = nextSub.nextTarget\n\t\t) {\n\t\t\tlastSub = nextSub;\n\t\t\tif (nextSub.target === target) {\n\t\t\t\tsub = nextSub;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (sub === null) {\n\t\t\tsub = {\n\t\t\t\tsource: signal,\n\t\t\t\ttarget: target,\n\t\t\t\tpreviousTarget: lastSub,\n\t\t\t\tnextTarget: null,\n\t\t\t\tnextSource: null,\n\t\t\t\tactive: true,\n\t\t\t\trecalc: false,\n\t\t\t\t//name: dev.subName(),\n\t\t\t};\n\t\t\t//console.log(`creating sub '${signal.name}' => '${effect.name}' (${sub.name})`);\n\t\t\tif (lastSub === null) {\n\t\t\t\tsignal.firstTarget = sub;\n\t\t\t} else {\n\t\t\t\tlastSub.nextTarget = sub;\n\t\t\t}\n\n\t\t\tif (target.firstSource === null) {\n\t\t\t\ttarget.firstSource = sub;\n\t\t\t} else {\n\t\t\t\tlet lastEffectSub = target.firstSource;\n\t\t\t\tfor (\n\t\t\t\t\tlet nextSub: Subscription | null = lastEffectSub.nextSource;\n\t\t\t\t\tnextSub !== null;\n\t\t\t\t\tnextSub = nextSub.nextSource\n\t\t\t\t) {\n\t\t\t\t\tlastEffectSub = nextSub;\n\t\t\t\t}\n\t\t\t\tlastEffectSub.nextSource = sub;\n\t\t\t}\n\t\t} else {\n\t\t\t// We can re-use this subscription object\n\t\t\t//console.log(`re-using sub '${signal.name}' => '${effect.name}' (${sub.name})`);\n\t\t\tsub.active = true;\n\t\t}\n\t}\n}\n","import context from \"../render/context\";\nimport type Computed from \"../types/Computed\";\nimport trackEffect from \"./trackEffect\";\n\nexport default function runComputed<T>(computed: Computed<T>): T {\n\t//console.log(`running computed '${computed.name}'`);\n\n\t// Store the active target\n\tconst oldActiveTarget = context.activeTarget;\n\n\tcomputed.running = true;\n\tcomputed.didError = false;\n\n\ttry {\n\t\t// Set the active target, so that any properties accessed while running it\n\t\t// will trigger it in future\n\t\tcontext.activeTarget = computed;\n\n\t\t// Run the computed and gather its dependencies\n\t\tcomputed.value = computed.run();\n\t} catch (err) {\n\t\tcomputed.didError = true;\n\t\t// @ts-ignore\n\t\tcomputed.value = err;\n\t\tthrow err;\n\t} finally {\n\t\t// Set the active target back to what it was previously\n\t\tcontext.activeTarget = oldActiveTarget;\n\n\t\tcomputed.running = false;\n\t}\n\n\ttrackEffect(computed);\n\n\treturn computed.value;\n}\n","import type Computed from \"../types/Computed\";\nimport type Subscription from \"../types/Subscription\";\nimport checkSources from \"./checkSources\";\nimport clearSources from \"./clearSources\";\nimport deactivateSources from \"./deactivateSources\";\nimport runComputed from \"./runComputed\";\n\n/**\n * Checks whether a Computed value should be re-run (which will be true if any\n * of its sources have changed) and re-runs it if necessary.\n */\nexport default function checkComputed(computed: Computed): boolean {\n\tlet rerun = checkSources(computed);\n\n\tlet changed = false;\n\n\tif (rerun) {\n\t\t// Set source subscriptions to inactive\n\t\tdeactivateSources(computed);\n\n\t\t// Run the computed, which will reset subscriptions\n\t\tconst oldValue = computed.value;\n\t\trunComputed(computed);\n\t\tchanged = computed.value !== oldValue;\n\n\t\t// Clear unused source subscriptions\n\t\tclearSources(computed);\n\t}\n\n\tcomputed.recalc = false;\n\n\t// If it hasn't changed, all of its target subscriptions remain active and\n\t// don't need to be recalculated\n\tif (!changed) {\n\t\tfor (\n\t\t\tlet targetSub: Subscription | null = computed.firstTarget;\n\t\t\ttargetSub !== null;\n\t\t\ttargetSub = targetSub.nextTarget\n\t\t) {\n\t\t\ttargetSub.active = true;\n\t\t\ttargetSub.recalc = false;\n\t\t}\n\t}\n\n\treturn changed;\n}\n","import context from \"../render/context\";\nimport type Computed from \"../types/Computed\";\nimport type Effect from \"../types/Effect\";\nimport type Subscription from \"../types/Subscription\";\nimport { COMPUTED_TYPE, SIGNAL_TYPE } from \"../types/constants\";\nimport checkComputed from \"./checkComputed\";\n\n// RECURSIVE\n\n/**\n * Checks whether a Computed or Effect should be re-run (which will be true if\n * any of its sources have changed).\n */\nexport default function checkSources(target: Computed | Effect): boolean {\n\t// NOTE: We bail early if we know the target needs to be re-run; subsequent\n\t// computed values will be computed in the proxy getter\n\n\t// Check signals first as it's cheap, then computed values\n\tlet haveComputed = false;\n\n\tfor (\n\t\tlet sourceSub: Subscription | null = target.firstSource;\n\t\tsourceSub !== null;\n\t\tsourceSub = sourceSub.nextSource\n\t) {\n\t\t//console.log(`checking source sub '${sourceSub.source.name}' (${sourceSub.name})`);\n\t\tif (sourceSub.recalc) {\n\t\t\tif (sourceSub.source.type === SIGNAL_TYPE) {\n\t\t\t\treturn true;\n\t\t\t} /* else if (sourceSub.source.type === COMPUTED_TYPE) */ else {\n\t\t\t\tif (sourceSub.source.recalc) {\n\t\t\t\t\thaveComputed = true;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (haveComputed) {\n\t\tfor (\n\t\t\tlet sourceSub: Subscription | null = target.firstSource;\n\t\t\tsourceSub !== null;\n\t\t\tsourceSub = sourceSub.nextSource\n\t\t) {\n\t\t\t//console.log(`checking source sub '${sourceSub.source.name}' (${sourceSub.name})`);\n\t\t\tif (sourceSub.recalc && sourceSub.source.type === COMPUTED_TYPE && sourceSub.source.recalc) {\n\t\t\t\tconst oldActiveTarget = context.activeTarget;\n\t\t\t\tcontext.activeTarget = target;\n\n\t\t\t\tconst recalc = checkComputed(sourceSub.source);\n\n\t\t\t\tcontext.activeTarget = oldActiveTarget;\n\n\t\t\t\tif (recalc) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n","import context from \"../render/context\";\nimport type Effect from \"../types/Effect\";\nimport clearSources from \"./clearSources\";\n\n/**\n * Runs cleanup functions for the effect and its children.\n */\nexport default function runCleanups(effect: Effect): void {\n\tlet effectToClean: Effect | null = effect;\n\tfor (let i = 0; i < effect.extent; i++) {\n\t\tif (typeof effectToClean.cleanup === \"function\") {\n\t\t\t//console.log(`cleaning effect '${effectToClean.name}'`);\n\t\t\tconst oldActiveTarget = context.activeTarget;\n\t\t\tcontext.activeTarget = null;\n\n\t\t\ttry {\n\t\t\t\teffectToClean.cleanup();\n\t\t\t} catch (err) {\n\t\t\t\teffectToClean.didError = true;\n\t\t\t\tclearSources(effectToClean);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\teffectToClean.cleanup = undefined;\n\t\t\t\tcontext.activeTarget = oldActiveTarget;\n\t\t\t}\n\t\t}\n\n\t\tconst nextEffect: Effect = effectToClean.nextEffect!;\n\n\t\t// If it's a child effect that has been triggered, clean it up\n\t\t// and remove it from the list of effects to run (it may get\n\t\t// re-created with the parent)\n\t\tif (i !== 0 && effect.nextEffectToRun === effectToClean) {\n\t\t\teffect.nextEffectToRun = effectToClean.nextEffectToRun;\n\t\t\teffectToClean.nextEffect = effectToClean.nextEffectToRun = null;\n\t\t}\n\n\t\teffectToClean = nextEffect;\n\t}\n}\n","import context from \"../render/context\";\n\nexport default function batchStart(): void {\n\tcontext.batch++;\n}\n","import context from \"../render/context\";\nimport type Effect from \"../types/Effect\";\nimport batchEnd from \"./batchEnd\";\nimport batchStart from \"./batchStart\";\nimport clearSources from \"./clearSources\";\n\nexport default function runEffect(effect: Effect): void {\n\t//console.log(`running effect '${effect.name}'`);\n\n\t// Store the active target\n\tconst oldActiveTarget = context.activeTarget;\n\tconst oldExtent = context.extent;\n\n\teffect.didError = false;\n\n\tbatchStart();\n\n\ttry {\n\t\t// Set the next effect for navigating through\n\t\tif (context.previousEffect !== null) {\n\t\t\tcontext.previousEffect.nextEffect = effect;\n\t\t}\n\n\t\t// Set the active effect, so that any properties accessed while running it\n\t\t// will trigger it in future\n\t\tcontext.activeTarget = effect;\n\t\tcontext.previousEffect = effect;\n\t\tcontext.extent = 1;\n\n\t\t// Run the effect to register its subscriptions and get its (optional)\n\t\t// cleanup function\n\t\teffect.cleanup = effect.run();\n\n\t\teffect.extent = context.extent;\n\t} catch (err) {\n\t\teffect.didError = true;\n\t\tclearSources(effect);\n\t\tthrow err;\n\t} finally {\n\t\t// Set the active target back to what it was previously\n\t\tcontext.activeTarget = oldActiveTarget;\n\t\tcontext.extent += oldExtent - 1;\n\n\t\tbatchEnd();\n\t}\n}\n","import type Effect from \"../types/Effect\";\nimport checkSources from \"./checkSources\";\nimport clearSources from \"./clearSources\";\nimport deactivateSources from \"./deactivateSources\";\nimport runCleanups from \"./runCleanups\";\nimport runEffect from \"./runEffect\";\n\n/**\n * Checks whether an Effect should be re-run (which will be true if any\n * of its sources have changed) and re-runs it if necessary.\n */\nexport default function checkEffect(effect: Effect): void {\n\t//console.log(`checking effect '${effect.name}'`);\n\n\tlet rerun = checkSources(effect);\n\n\tif (rerun) {\n\t\t// Run cleanup functions for the effect and its children\n\t\trunCleanups(effect);\n\n\t\t// Set source subscriptions to inactive\n\t\tdeactivateSources(effect);\n\n\t\t// Run the effect, which will reset subscriptions\n\t\trunEffect(effect);\n\n\t\t// Clear unused source subscriptions\n\t\tclearSources(effect);\n\t}\n}\n","import type Computed from \"../types/Computed\";\nimport type ProxySignal from \"../types/ProxySignal\";\nimport type Subscription from \"../types/Subscription\";\n\n/**\n * Clear unused target subscriptions after all Effects have been run.\n */\nexport default function clearTargets(source: ProxySignal | Computed): void {\n\tlet previousSub: Subscription | null = null;\n\tfor (\n\t\tlet clearSub: Subscription | null = source.firstTarget;\n\t\tclearSub !== null;\n\t\tclearSub = clearSub.nextTarget\n\t) {\n\t\tif (!clearSub.active) {\n\t\t\t//console.log(\n\t\t\t//\t`clearing target sub ${clearSub.source.name} <-> ${clearSub.target.name} (${clearSub.name})`,\n\t\t\t//);\n\t\t\tif (previousSub === null) {\n\t\t\t\tsource.firstTarget = clearSub.nextTarget;\n\t\t\t} else {\n\t\t\t\tpreviousSub.nextTarget = clearSub.nextTarget;\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousSub = clearSub;\n\t\t}\n\t}\n}\n","import context from \"../render/context\";\nimport type Effect from \"../types/Effect\";\nimport type ProxySignal from \"../types/ProxySignal\";\nimport checkEffect from \"./checkEffect\";\nimport clearTargets from \"./clearTargets\";\n\n/**\n * Runs the effects that have been collected during the batch.\n */\nexport default function triggerEffects(): void {\n\t//console.log(`triggering effects for '${String(key)}' on`, proxy);\n\t//console.log(\"===\");\n\t//console.log(`triggering effects for '${String(key)}'`);\n\n\tlet didError = false;\n\tlet error: any;\n\n\t// Run the effects\n\tlet effect: Effect | null = context.firstEffectToRun;\n\twhile (effect !== null) {\n\t\tcontext.batchOperation++;\n\n\t\ttry {\n\t\t\tcheckEffect(effect);\n\t\t} catch (err) {\n\t\t\tif (!didError) {\n\t\t\t\tdidError = true;\n\t\t\t\terror = err;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.nextEffectToRun;\n\t}\n\n\t// Clear the effects\n\teffect = context.firstEffectToRun;\n\tcontext.firstEffectToRun = null;\n\twhile (effect !== null) {\n\t\tlet nextEffect = effect.nextEffectToRun;\n\t\teffect.nextEffectToRun = null;\n\t\teffect = nextEffect;\n\t}\n\n\t// Clear unused target subscriptions for the signals that were updated\n\t// during the batch\n\tlet signal: ProxySignal | null = context.firstSignalToUpdate;\n\tcontext.firstSignalToUpdate = null;\n\twhile (signal !== null) {\n\t\tclearTargets(signal);\n\n\t\tconst nextSignal = signal.nextSignalToUpdate;\n\t\tsignal.nextSignalToUpdate = null;\n\t\tsignal = nextSignal;\n\t}\n\n\tif (didError) {\n\t\tthrow error;\n\t}\n}\n","import context from \"../render/context\";\nimport triggerEffects from \"./triggerEffects\";\n\nexport default function batchEnd(): void {\n\tif (context.batch > 1) {\n\t\tcontext.batch--;\n\t\treturn;\n\t}\n\n\ttry {\n\t\ttriggerEffects();\n\t} finally {\n\t\tcontext.batch = 0;\n\t\tcontext.batchOperation = 0;\n\t\tcontext.previousEffect = null;\n\t}\n}\n","import batchEnd from \"../watch/batchEnd\";\nimport batchStart from \"../watch/batchStart\";\nimport context from \"./context\";\n\n/**\n * Runs updates to proxy values in a batch, where the updates are stored in\n * context, and dependent effects are run all at once at the end.\n *\n * @param fn The function containing the batched updates to run.\n */\nexport default function $batch<T>(fn: () => T): T {\n\tif (context.batch > 0) {\n\t\treturn fn();\n\t}\n\n\tbatchStart();\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tbatchEnd();\n\t}\n}\n","import type Computed from \"../types/Computed\";\nimport { COMPUTED_TYPE } from \"../types/constants\";\nimport runComputed from \"../watch/runComputed\";\nimport context from \"./context\";\n\n/**\n * Caches a computed value from signals accessed in a property getter.\n *\n * @param fn The function containing the signals to compute and cache.\n */\nexport default function $cache<T>(fn: () => T): T {\n\tif (context.registerComputed === null) {\n\t\tthrow new Error(\"$cache must be used in a getter\");\n\t}\n\n\tlet computed: Computed = {\n\t\ttype: COMPUTED_TYPE,\n\t\tvalue: null,\n\t\trun: fn,\n\t\tfirstSource: null,\n\t\tfirstTarget: null,\n\t\trecalc: false,\n\t\trunning: false,\n\t\tdidError: false,\n\t\trollback: null,\n\t\t//name: dev.effectName(fn),\n\t};\n\n\tcontext.registerComputed(computed);\n\n\trunComputed(computed);\n\n\treturn computed.value;\n}\n","import context from \"./context\";\n\n// Not sure if this is a good idea?\n\nexport default function $peek<T>(fn: () => T): T {\n\tconst oldActiveTarget = context.activeTarget;\n\tcontext.activeTarget = null;\n\n\tconst result = fn();\n\n\tcontext.activeTarget = oldActiveTarget;\n\n\treturn result;\n}\n","export default function buildClasses(value: unknown, styleHash?: string): string {\n\tif (typeof value === \"string\") {\n\t\tif (styleHash !== undefined) {\n\t\t\tvalue += \" \" + styleHash;\n\t\t}\n\t\treturn value;\n\t} else {\n\t\tlet classes: string[] = [];\n\t\tgatherNames(\"\", value, classes);\n\t\tif (styleHash !== undefined) {\n\t\t\tclasses.push(styleHash);\n\t\t}\n\t\treturn classes.join(\" \");\n\t}\n}\n\nfunction gatherNames(name: unknown, value: unknown, classes: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherNames(v, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tgatherNames(n, v, classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name as string);\n\t\t}\n\t}\n}\n","export default function buildStyles(value: unknown): string {\n\tif (typeof value === \"string\") {\n\t\treturn value;\n\t} else {\n\t\tlet styles: string[] = [];\n\t\tif (value) {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (let v of value) {\n\t\t\t\t\tstyles.push(v);\n\t\t\t\t}\n\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\t\tstyles.push(`${n}: ${v}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn styles.join(\"; \");\n\t}\n}\n","export default function formatText(value: any): string {\n\treturn value ?? \"\";\n}\n"],"mappings":";AAEA,MAAMA,UAAmB;CACxB,cAAc;CACd,gBAAgB;CAChB,QAAQ;CACR,OAAO;CACP,gBAAgB;CAChB,kBAAkB;CAElB,kBAAkB;CAClB,qBAAqB;CAIrB,aAAa;CAEb,eAAe;CAEf,WAAW;CAEX,cAAc,EAAE;CAChB,eAAe,EAAE;CACjB,mBAAmB,EAAE;CAErB,eAAe;CASf;AAED,sBAAe;;;;;;;ACjCf,MAAa,cAAc;;;;AAK3B,MAAa,gBAAgB;;;;AAK7B,MAAa,cAAc;;;;;;;ACN3B,SAAwB,aAAa,QAAiC;CACrE,IAAIC,cAAmC;AACvC,MACC,IAAIC,WAAgC,OAAO,aAC3C,aAAa,MACb,WAAW,SAAS,WAEpB,KAAI,OAAO,YAAY,CAAC,SAAS,QAAQ;AAIxC,MAAI,gBAAgB,KACnB,QAAO,cAAc,SAAS;MAE9B,aAAY,aAAa,SAAS;AAInC,MAAI,SAAS,mBAAmB,MAC/B;OAAI,SAAS,OAAO,gBAAgB,SACnC,UAAS,OAAO,cAAc,SAAS;QAIxC,UAAS,eAAe,aAAa,SAAS;QAEzC;AACN,WAAS,SAAS;AAClB,gBAAc;;;;;;;;;AC5BjB,SAAwB,kBAAkB,QAAiC;AAC1E,MACC,IAAIC,YAAiC,OAAO,aAC5C,cAAc,MACd,YAAY,UAAU,WAEtB,WAAU,SAAS;;;;;;;;;ACFrB,SAAwB,YAAY,QAAsC;CACzE,MAAM,SAASC,gBAAQ;AACvB,KAAI,WAAW,MAAM;EACpB,IAAIC,MAA2B;EAC/B,IAAIC,UAA+B;AAMnC,OACC,IAAIC,UAA+B,OAAO,aAC1C,YAAY,MACZ,UAAU,QAAQ,YACjB;AACD,aAAU;AACV,OAAI,QAAQ,WAAW,QAAQ;AAC9B,UAAM;AACN;;;AAIF,MAAI,QAAQ,MAAM;AACjB,SAAM;IACL,QAAQ;IACA;IACR,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,QAAQ;IACR,QAAQ;IAER;AAED,OAAI,YAAY,KACf,QAAO,cAAc;OAErB,SAAQ,aAAa;AAGtB,OAAI,OAAO,gBAAgB,KAC1B,QAAO,cAAc;QACf;IACN,IAAI,gBAAgB,OAAO;AAC3B,SACC,IAAIA,UAA+B,cAAc,YACjD,YAAY,MACZ,UAAU,QAAQ,WAElB,iBAAgB;AAEjB,kBAAc,aAAa;;QAK5B,KAAI,SAAS;;;;;;AC/DhB,SAAwB,YAAe,UAA0B;CAIhE,MAAM,kBAAkBC,gBAAQ;AAEhC,UAAS,UAAU;AACnB,UAAS,WAAW;AAEpB,KAAI;AAGH,kBAAQ,eAAe;AAGvB,WAAS,QAAQ,SAAS,KAAK;UACvB,KAAK;AACb,WAAS,WAAW;AAEpB,WAAS,QAAQ;AACjB,QAAM;WACG;AAET,kBAAQ,eAAe;AAEvB,WAAS,UAAU;;AAGpB,aAAY,SAAS;AAErB,QAAO,SAAS;;;;;;;;;ACvBjB,SAAwB,cAAc,UAA6B;CAClE,IAAI,QAAQ,aAAa,SAAS;CAElC,IAAI,UAAU;AAEd,KAAI,OAAO;AAEV,oBAAkB,SAAS;EAG3B,MAAM,WAAW,SAAS;AAC1B,cAAY,SAAS;AACrB,YAAU,SAAS,UAAU;AAG7B,eAAa,SAAS;;AAGvB,UAAS,SAAS;AAIlB,KAAI,CAAC,QACJ,MACC,IAAIC,YAAiC,SAAS,aAC9C,cAAc,MACd,YAAY,UAAU,YACrB;AACD,YAAU,SAAS;AACnB,YAAU,SAAS;;AAIrB,QAAO;;;;;;;;;AC/BR,SAAwB,aAAa,QAAoC;CAKxE,IAAI,eAAe;AAEnB,MACC,IAAIC,YAAiC,OAAO,aAC5C,cAAc,MACd,YAAY,UAAU,WAGtB,KAAI,UAAU,OACb,KAAI,UAAU,OAAO,SAAS,YAC7B,QAAO;UAEH,UAAU,OAAO,OACpB,gBAAe;KAEf,QAAO;AAMX,KAAI,cACH;OACC,IAAIA,YAAiC,OAAO,aAC5C,cAAc,MACd,YAAY,UAAU,WAGtB,KAAI,UAAU,UAAU,UAAU,OAAO,SAAS,iBAAiB,UAAU,OAAO,QAAQ;GAC3F,MAAM,kBAAkBC,gBAAQ;AAChC,mBAAQ,eAAe;GAEvB,MAAM,SAAS,cAAc,UAAU,OAAO;AAE9C,mBAAQ,eAAe;AAEvB,OAAI,OACH,QAAO;;;AAMX,QAAO;;;;;;;;ACtDR,SAAwB,YAAY,QAAsB;CACzD,IAAIC,gBAA+B;AACnC,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACvC,MAAI,OAAO,cAAc,YAAY,YAAY;GAEhD,MAAM,kBAAkBC,gBAAQ;AAChC,mBAAQ,eAAe;AAEvB,OAAI;AACH,kBAAc,SAAS;YACf,KAAK;AACb,kBAAc,WAAW;AACzB,iBAAa,cAAc;AAC3B,UAAM;aACG;AACT,kBAAc,UAAU;AACxB,oBAAQ,eAAe;;;EAIzB,MAAMC,aAAqB,cAAc;AAKzC,MAAI,MAAM,KAAK,OAAO,oBAAoB,eAAe;AACxD,UAAO,kBAAkB,cAAc;AACvC,iBAAc,aAAa,cAAc,kBAAkB;;AAG5D,kBAAgB;;;;;;ACnClB,SAAwB,aAAmB;AAC1C,iBAAQ;;;;;ACGT,SAAwB,UAAU,QAAsB;CAIvD,MAAM,kBAAkBC,gBAAQ;CAChC,MAAM,YAAYA,gBAAQ;AAE1B,QAAO,WAAW;AAElB,aAAY;AAEZ,KAAI;AAEH,MAAIA,gBAAQ,mBAAmB,KAC9B,iBAAQ,eAAe,aAAa;AAKrC,kBAAQ,eAAe;AACvB,kBAAQ,iBAAiB;AACzB,kBAAQ,SAAS;AAIjB,SAAO,UAAU,OAAO,KAAK;AAE7B,SAAO,SAASA,gBAAQ;UAChB,KAAK;AACb,SAAO,WAAW;AAClB,eAAa,OAAO;AACpB,QAAM;WACG;AAET,kBAAQ,eAAe;AACvB,kBAAQ,UAAU,YAAY;AAE9B,YAAU;;;;;;;;;;AChCZ,SAAwB,YAAY,QAAsB;AAKzD,KAFY,aAAa,OAAO,EAErB;AAEV,cAAY,OAAO;AAGnB,oBAAkB,OAAO;AAGzB,YAAU,OAAO;AAGjB,eAAa,OAAO;;;;;;;;;ACpBtB,SAAwB,aAAa,QAAsC;CAC1E,IAAIC,cAAmC;AACvC,MACC,IAAIC,WAAgC,OAAO,aAC3C,aAAa,MACb,WAAW,SAAS,WAEpB,KAAI,CAAC,SAAS,OAIb,KAAI,gBAAgB,KACnB,QAAO,cAAc,SAAS;KAE9B,aAAY,aAAa,SAAS;KAGnC,eAAc;;;;;;;;ACfjB,SAAwB,iBAAuB;CAK9C,IAAI,WAAW;CACf,IAAIC;CAGJ,IAAIC,SAAwBC,gBAAQ;AACpC,QAAO,WAAW,MAAM;AACvB,kBAAQ;AAER,MAAI;AACH,eAAY,OAAO;WACX,KAAK;AACb,OAAI,CAAC,UAAU;AACd,eAAW;AACX,YAAQ;;;AAIV,WAAS,OAAO;;AAIjB,UAASA,gBAAQ;AACjB,iBAAQ,mBAAmB;AAC3B,QAAO,WAAW,MAAM;EACvB,IAAI,aAAa,OAAO;AACxB,SAAO,kBAAkB;AACzB,WAAS;;CAKV,IAAIC,SAA6BD,gBAAQ;AACzC,iBAAQ,sBAAsB;AAC9B,QAAO,WAAW,MAAM;AACvB,eAAa,OAAO;EAEpB,MAAM,aAAa,OAAO;AAC1B,SAAO,qBAAqB;AAC5B,WAAS;;AAGV,KAAI,SACH,OAAM;;;;;ACrDR,SAAwB,WAAiB;AACxC,KAAIE,gBAAQ,QAAQ,GAAG;AACtB,kBAAQ;AACR;;AAGD,KAAI;AACH,kBAAgB;WACP;AACT,kBAAQ,QAAQ;AAChB,kBAAQ,iBAAiB;AACzB,kBAAQ,iBAAiB;;;;;;;;;;;;ACJ3B,SAAwB,OAAU,IAAgB;AACjD,KAAIC,gBAAQ,QAAQ,EACnB,QAAO,IAAI;AAGZ,aAAY;AACZ,KAAI;AACH,SAAO,IAAI;WACF;AACT,YAAU;;;;;;;;;;;ACTZ,SAAwB,OAAU,IAAgB;AACjD,KAAIC,gBAAQ,qBAAqB,KAChC,OAAM,IAAI,MAAM,kCAAkC;CAGnD,IAAIC,WAAqB;EACxB,MAAM;EACN,OAAO;EACP,KAAK;EACL,aAAa;EACb,aAAa;EACb,QAAQ;EACR,SAAS;EACT,UAAU;EACV,UAAU;EAEV;AAED,iBAAQ,iBAAiB,SAAS;AAElC,aAAY,SAAS;AAErB,QAAO,SAAS;;;;;AC5BjB,SAAwB,MAAS,IAAgB;CAChD,MAAM,kBAAkBC,gBAAQ;AAChC,iBAAQ,eAAe;CAEvB,MAAM,SAAS,IAAI;AAEnB,iBAAQ,eAAe;AAEvB,QAAO;;;;;ACZR,SAAwB,aAAa,OAAgB,WAA4B;AAChF,KAAI,OAAO,UAAU,UAAU;AAC9B,MAAI,cAAc,OACjB,UAAS,MAAM;AAEhB,SAAO;QACD;EACN,IAAIC,UAAoB,EAAE;AAC1B,cAAY,IAAI,OAAO,QAAQ;AAC/B,MAAI,cAAc,OACjB,SAAQ,KAAK,UAAU;AAExB,SAAO,QAAQ,KAAK,IAAI;;;AAI1B,SAAS,YAAY,MAAe,OAAgB,SAAmB;AACtE,KAAI,MACH,KAAI,MAAM,QAAQ,MAAM,CACvB,MAAK,IAAI,KAAK,MACb,aAAY,GAAG,GAAG,QAAQ;UAEjB,OAAO,UAAU,SAC3B,MAAK,IAAI,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,CACvC,aAAY,GAAG,GAAG,QAAQ;KAG3B,SAAQ,KAAK,KAAe;;;;;AC3B/B,SAAwB,YAAY,OAAwB;AAC3D,KAAI,OAAO,UAAU,SACpB,QAAO;MACD;EACN,IAAIC,SAAmB,EAAE;AACzB,MAAI,OACH;OAAI,MAAM,QAAQ,MAAM,CACvB,MAAK,IAAI,KAAK,MACb,QAAO,KAAK,EAAE;YAEL,OAAO,UAAU,SAC3B,MAAK,IAAI,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,CACvC,QAAO,KAAK,GAAG,EAAE,IAAI,IAAI;;AAI5B,SAAO,OAAO,KAAK,KAAK;;;;;;AChB1B,SAAwB,WAAW,OAAoB;AACtD,QAAO,SAAS"}