@elaraai/e3-ui 1.0.97 → 1.0.99

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 (491) hide show
  1. package/README.md +0 -2
  2. package/dist/src/allocation/adapters.d.ts +1 -1
  3. package/dist/src/allocation/adapters.js +1 -1
  4. package/dist/src/allocation/index.d.ts +232 -25
  5. package/dist/src/allocation/index.d.ts.map +1 -1
  6. package/dist/src/allocation/index.js +35 -6
  7. package/dist/src/allocation/index.js.map +1 -1
  8. package/dist/src/allocation/types.d.ts +41 -0
  9. package/dist/src/allocation/types.d.ts.map +1 -1
  10. package/dist/src/allocation/types.js +35 -0
  11. package/dist/src/allocation/types.js.map +1 -1
  12. package/dist/src/bind/data-indexed.d.ts +286 -37
  13. package/dist/src/bind/data-indexed.d.ts.map +1 -1
  14. package/dist/src/bind/data-indexed.js +259 -38
  15. package/dist/src/bind/data-indexed.js.map +1 -1
  16. package/dist/src/bind/data.d.ts +48 -9
  17. package/dist/src/bind/data.d.ts.map +1 -1
  18. package/dist/src/bind/data.js +48 -3
  19. package/dist/src/bind/data.js.map +1 -1
  20. package/dist/src/bind/record.d.ts +61 -24
  21. package/dist/src/bind/record.d.ts.map +1 -1
  22. package/dist/src/bind/record.js +17 -57
  23. package/dist/src/bind/record.js.map +1 -1
  24. package/dist/src/calendar/index.d.ts +522 -36
  25. package/dist/src/calendar/index.d.ts.map +1 -1
  26. package/dist/src/calendar/index.js +53 -13
  27. package/dist/src/calendar/index.js.map +1 -1
  28. package/dist/src/calendar/paged.d.ts +89 -0
  29. package/dist/src/calendar/paged.d.ts.map +1 -0
  30. package/dist/src/calendar/paged.js +148 -0
  31. package/dist/src/calendar/paged.js.map +1 -0
  32. package/dist/src/flowchart/index.d.ts +35 -31
  33. package/dist/src/flowchart/index.d.ts.map +1 -1
  34. package/dist/src/flowchart/index.js +35 -31
  35. package/dist/src/flowchart/index.js.map +1 -1
  36. package/dist/src/flowchart/library.d.ts +108 -84
  37. package/dist/src/flowchart/library.d.ts.map +1 -1
  38. package/dist/src/flowchart/library.js +108 -84
  39. package/dist/src/flowchart/library.js.map +1 -1
  40. package/dist/src/flowchart/payload.d.ts +105 -17
  41. package/dist/src/flowchart/payload.d.ts.map +1 -1
  42. package/dist/src/flowchart/payload.js +3 -3
  43. package/dist/src/flowchart/payload.js.map +1 -1
  44. package/dist/src/flowchart/values.d.ts +35 -31
  45. package/dist/src/flowchart/values.d.ts.map +1 -1
  46. package/dist/src/flowchart/values.js +35 -31
  47. package/dist/src/flowchart/values.js.map +1 -1
  48. package/dist/src/flowchart/window.d.ts.map +1 -1
  49. package/dist/src/flowchart/window.js +3 -2
  50. package/dist/src/flowchart/window.js.map +1 -1
  51. package/dist/src/index.d.ts +13 -4
  52. package/dist/src/index.d.ts.map +1 -1
  53. package/dist/src/index.js +20 -1
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/internal.d.ts +18 -8
  56. package/dist/src/internal.d.ts.map +1 -1
  57. package/dist/src/internal.js +40 -10
  58. package/dist/src/internal.js.map +1 -1
  59. package/dist/src/plan/assemble.d.ts +8 -0
  60. package/dist/src/plan/assemble.d.ts.map +1 -1
  61. package/dist/src/plan/assemble.js +1 -1
  62. package/dist/src/plan/assemble.js.map +1 -1
  63. package/dist/src/plan/builders.d.ts +1530 -10
  64. package/dist/src/plan/builders.d.ts.map +1 -1
  65. package/dist/src/plan/builders.js +260 -122
  66. package/dist/src/plan/builders.js.map +1 -1
  67. package/dist/src/plan/event-rows.d.ts +224 -157
  68. package/dist/src/plan/event-rows.d.ts.map +1 -1
  69. package/dist/src/plan/event-rows.js +201 -56
  70. package/dist/src/plan/event-rows.js.map +1 -1
  71. package/dist/src/plan/factories.d.ts +72 -4
  72. package/dist/src/plan/factories.d.ts.map +1 -1
  73. package/dist/src/plan/factories.js +147 -1
  74. package/dist/src/plan/factories.js.map +1 -1
  75. package/dist/src/plan/index.d.ts +152 -125
  76. package/dist/src/plan/index.d.ts.map +1 -1
  77. package/dist/src/plan/index.js +138 -122
  78. package/dist/src/plan/index.js.map +1 -1
  79. package/dist/src/plan/ir.d.ts +1139 -8
  80. package/dist/src/plan/ir.d.ts.map +1 -1
  81. package/dist/src/plan/ir.js +5 -0
  82. package/dist/src/plan/ir.js.map +1 -1
  83. package/dist/src/plan/library.d.ts +65 -42
  84. package/dist/src/plan/library.d.ts.map +1 -1
  85. package/dist/src/plan/library.js +65 -42
  86. package/dist/src/plan/library.js.map +1 -1
  87. package/dist/src/plan/nested-checks.d.ts +146 -0
  88. package/dist/src/plan/nested-checks.d.ts.map +1 -0
  89. package/dist/src/plan/nested-checks.js +468 -0
  90. package/dist/src/plan/nested-checks.js.map +1 -0
  91. package/dist/src/plan/nested-patch.d.ts +35 -0
  92. package/dist/src/plan/nested-patch.d.ts.map +1 -0
  93. package/dist/src/plan/nested-patch.js +143 -0
  94. package/dist/src/plan/nested-patch.js.map +1 -0
  95. package/dist/src/plan/nested-read.d.ts +3250 -0
  96. package/dist/src/plan/nested-read.d.ts.map +1 -0
  97. package/dist/src/plan/nested-read.js +163 -0
  98. package/dist/src/plan/nested-read.js.map +1 -0
  99. package/dist/src/plan/nested.d.ts +280 -0
  100. package/dist/src/plan/nested.d.ts.map +1 -0
  101. package/dist/src/plan/nested.js +6 -0
  102. package/dist/src/plan/nested.js.map +1 -0
  103. package/dist/src/plan/ordered-source.d.ts +3067 -1
  104. package/dist/src/plan/ordered-source.d.ts.map +1 -1
  105. package/dist/src/plan/ordered-source.js +67 -17
  106. package/dist/src/plan/ordered-source.js.map +1 -1
  107. package/dist/src/plan/over.d.ts +111 -75
  108. package/dist/src/plan/over.d.ts.map +1 -1
  109. package/dist/src/plan/over.js +111 -75
  110. package/dist/src/plan/over.js.map +1 -1
  111. package/dist/src/plan/pick.d.ts +15 -3
  112. package/dist/src/plan/pick.d.ts.map +1 -1
  113. package/dist/src/plan/pick.js +75 -36
  114. package/dist/src/plan/pick.js.map +1 -1
  115. package/dist/src/plan/plan.d.ts +3143 -501
  116. package/dist/src/plan/plan.d.ts.map +1 -1
  117. package/dist/src/plan/plan.js +133 -34
  118. package/dist/src/plan/plan.js.map +1 -1
  119. package/dist/src/plan/reads.d.ts +421 -0
  120. package/dist/src/plan/reads.d.ts.map +1 -0
  121. package/dist/src/plan/reads.js +143 -0
  122. package/dist/src/plan/reads.js.map +1 -0
  123. package/dist/src/plan/refs.d.ts +111 -75
  124. package/dist/src/plan/refs.d.ts.map +1 -1
  125. package/dist/src/plan/refs.js +111 -75
  126. package/dist/src/plan/refs.js.map +1 -1
  127. package/dist/src/plan/root.d.ts +14 -7
  128. package/dist/src/plan/root.d.ts.map +1 -1
  129. package/dist/src/plan/root.js +82 -17
  130. package/dist/src/plan/root.js.map +1 -1
  131. package/dist/src/plan/series.d.ts +5153 -4331
  132. package/dist/src/plan/series.d.ts.map +1 -1
  133. package/dist/src/plan/series.js +1082 -266
  134. package/dist/src/plan/series.js.map +1 -1
  135. package/dist/src/plan/shade.d.ts +981 -0
  136. package/dist/src/plan/shade.d.ts.map +1 -0
  137. package/dist/src/plan/shade.js +60 -0
  138. package/dist/src/plan/shade.js.map +1 -0
  139. package/dist/src/plan/types.d.ts +192 -18
  140. package/dist/src/plan/types.d.ts.map +1 -1
  141. package/dist/src/plan/types.js +77 -19
  142. package/dist/src/plan/types.js.map +1 -1
  143. package/dist/src/query/builder.d.ts +3 -3
  144. package/dist/src/query/builder.d.ts.map +1 -1
  145. package/dist/src/query/builder.js +1 -1
  146. package/dist/src/query/library.d.ts +3 -3
  147. package/dist/src/query/library.d.ts.map +1 -1
  148. package/dist/src/query/library.js +1 -1
  149. package/dist/src/query/queries.d.ts +2 -2
  150. package/dist/src/query/queries.js +1 -1
  151. package/dist/src/query/saved.d.ts +8 -4
  152. package/dist/src/query/saved.d.ts.map +1 -1
  153. package/dist/src/query/saved.js +8 -4
  154. package/dist/src/query/saved.js.map +1 -1
  155. package/dist/src/query/types.d.ts +8 -3
  156. package/dist/src/query/types.d.ts.map +1 -1
  157. package/dist/src/query/types.js +8 -3
  158. package/dist/src/query/types.js.map +1 -1
  159. package/dist/src/roster/index.d.ts +583 -39
  160. package/dist/src/roster/index.d.ts.map +1 -1
  161. package/dist/src/roster/index.js +109 -35
  162. package/dist/src/roster/index.js.map +1 -1
  163. package/dist/src/roster/library.d.ts +12 -2
  164. package/dist/src/roster/library.d.ts.map +1 -1
  165. package/dist/src/roster/library.js +8 -0
  166. package/dist/src/roster/library.js.map +1 -1
  167. package/dist/src/roster/lists.d.ts +59 -12
  168. package/dist/src/roster/lists.d.ts.map +1 -1
  169. package/dist/src/roster/lists.js +51 -58
  170. package/dist/src/roster/lists.js.map +1 -1
  171. package/dist/src/roster/targets.d.ts +8 -4
  172. package/dist/src/roster/targets.d.ts.map +1 -1
  173. package/dist/src/roster/targets.js +9 -5
  174. package/dist/src/roster/targets.js.map +1 -1
  175. package/dist/src/roster/times.d.ts +402 -0
  176. package/dist/src/roster/times.d.ts.map +1 -1
  177. package/dist/src/roster/types.d.ts +913 -1
  178. package/dist/src/roster/types.d.ts.map +1 -1
  179. package/dist/src/roster/types.js +43 -3
  180. package/dist/src/roster/types.js.map +1 -1
  181. package/dist/src/schedule/cell-checks.d.ts +85 -0
  182. package/dist/src/schedule/cell-checks.d.ts.map +1 -0
  183. package/dist/src/schedule/cell-checks.js +211 -0
  184. package/dist/src/schedule/cell-checks.js.map +1 -0
  185. package/dist/src/schedule/days.d.ts +1 -1
  186. package/dist/src/schedule/days.js +1 -1
  187. package/dist/src/schedule/events.d.ts +52 -16
  188. package/dist/src/schedule/events.d.ts.map +1 -1
  189. package/dist/src/schedule/events.js +574 -356
  190. package/dist/src/schedule/events.js.map +1 -1
  191. package/dist/src/schedule/fields.d.ts +134 -0
  192. package/dist/src/schedule/fields.d.ts.map +1 -0
  193. package/dist/src/schedule/fields.js +207 -0
  194. package/dist/src/schedule/fields.js.map +1 -0
  195. package/dist/src/schedule/library.d.ts +11 -3
  196. package/dist/src/schedule/library.d.ts.map +1 -1
  197. package/dist/src/schedule/library.js +9 -6
  198. package/dist/src/schedule/library.js.map +1 -1
  199. package/dist/src/schedule/optimise.d.ts +124 -0
  200. package/dist/src/schedule/optimise.d.ts.map +1 -0
  201. package/dist/src/schedule/optimise.js +140 -0
  202. package/dist/src/schedule/optimise.js.map +1 -0
  203. package/dist/src/schedule/pages.d.ts +76 -0
  204. package/dist/src/schedule/pages.d.ts.map +1 -0
  205. package/dist/src/schedule/pages.js +86 -0
  206. package/dist/src/schedule/pages.js.map +1 -0
  207. package/dist/src/schedule/patch.d.ts +1 -1
  208. package/dist/src/schedule/patch.js +1 -1
  209. package/dist/src/schedule/periods.d.ts +8 -4
  210. package/dist/src/schedule/periods.d.ts.map +1 -1
  211. package/dist/src/schedule/periods.js +1 -1
  212. package/dist/src/schedule/periods.js.map +1 -1
  213. package/dist/src/schedule/record-window.d.ts +115 -22
  214. package/dist/src/schedule/record-window.d.ts.map +1 -1
  215. package/dist/src/schedule/record-window.js +140 -62
  216. package/dist/src/schedule/record-window.js.map +1 -1
  217. package/dist/src/schedule/resources.d.ts +9 -5
  218. package/dist/src/schedule/resources.d.ts.map +1 -1
  219. package/dist/src/schedule/resources.js +35 -15
  220. package/dist/src/schedule/resources.js.map +1 -1
  221. package/dist/src/schedule/session.d.ts +15 -1
  222. package/dist/src/schedule/session.d.ts.map +1 -1
  223. package/dist/src/schedule/session.js +30 -18
  224. package/dist/src/schedule/session.js.map +1 -1
  225. package/dist/src/schedule/types.d.ts +455 -37
  226. package/dist/src/schedule/types.d.ts.map +1 -1
  227. package/dist/src/schedule/types.js +79 -18
  228. package/dist/src/schedule/types.js.map +1 -1
  229. package/dist/src/schedule/window.d.ts +30 -9
  230. package/dist/src/schedule/window.d.ts.map +1 -1
  231. package/dist/src/schedule/window.js +101 -49
  232. package/dist/src/schedule/window.js.map +1 -1
  233. package/dist/src/schematic/index.d.ts +287 -0
  234. package/dist/src/schematic/index.d.ts.map +1 -0
  235. package/dist/src/schematic/index.js +216 -0
  236. package/dist/src/schematic/index.js.map +1 -0
  237. package/dist/src/schematic/kinds.d.ts +501 -0
  238. package/dist/src/schematic/kinds.d.ts.map +1 -0
  239. package/dist/src/schematic/kinds.js +1027 -0
  240. package/dist/src/schematic/kinds.js.map +1 -0
  241. package/dist/src/schematic/layers.d.ts +74 -0
  242. package/dist/src/schematic/layers.d.ts.map +1 -0
  243. package/dist/src/schematic/layers.js +99 -0
  244. package/dist/src/schematic/layers.js.map +1 -0
  245. package/dist/src/schematic/library.d.ts +202 -0
  246. package/dist/src/schematic/library.d.ts.map +1 -0
  247. package/dist/src/schematic/library.js +244 -0
  248. package/dist/src/schematic/library.js.map +1 -0
  249. package/dist/src/schematic/payload.d.ts +8310 -0
  250. package/dist/src/schematic/payload.d.ts.map +1 -0
  251. package/dist/src/schematic/payload.js +446 -0
  252. package/dist/src/schematic/payload.js.map +1 -0
  253. package/dist/src/schematic/schematic.d.ts +27 -0
  254. package/dist/src/schematic/schematic.d.ts.map +1 -0
  255. package/dist/src/schematic/schematic.js +17 -0
  256. package/dist/src/schematic/schematic.js.map +1 -0
  257. package/dist/src/schematic/shapes.d.ts +150 -0
  258. package/dist/src/schematic/shapes.d.ts.map +1 -0
  259. package/dist/src/schematic/shapes.js +171 -0
  260. package/dist/src/schematic/shapes.js.map +1 -0
  261. package/dist/src/schematic/templates.d.ts +96 -0
  262. package/dist/src/schematic/templates.d.ts.map +1 -0
  263. package/dist/src/schematic/templates.js +91 -0
  264. package/dist/src/schematic/templates.js.map +1 -0
  265. package/dist/src/schematic/types.d.ts +5766 -0
  266. package/dist/src/schematic/types.d.ts.map +1 -0
  267. package/dist/src/schematic/types.js +688 -0
  268. package/dist/src/schematic/types.js.map +1 -0
  269. package/dist/src/schematic/window.d.ts +213 -0
  270. package/dist/src/schematic/window.d.ts.map +1 -0
  271. package/dist/src/schematic/window.js +340 -0
  272. package/dist/src/schematic/window.js.map +1 -0
  273. package/dist/src/sheet/bridge.d.ts +19 -0
  274. package/dist/src/sheet/bridge.d.ts.map +1 -1
  275. package/dist/src/sheet/bridge.js +28 -21
  276. package/dist/src/sheet/bridge.js.map +1 -1
  277. package/dist/src/sheet/editing-bridge.d.ts +4 -2
  278. package/dist/src/sheet/editing-bridge.d.ts.map +1 -1
  279. package/dist/src/sheet/editing-bridge.js +8 -2
  280. package/dist/src/sheet/editing-bridge.js.map +1 -1
  281. package/dist/src/sheet/editing-types.d.ts +9 -5
  282. package/dist/src/sheet/editing-types.d.ts.map +1 -1
  283. package/dist/src/sheet/editing-types.js +9 -5
  284. package/dist/src/sheet/editing-types.js.map +1 -1
  285. package/dist/src/sheet/index.d.ts +84 -54
  286. package/dist/src/sheet/index.d.ts.map +1 -1
  287. package/dist/src/sheet/index.js +81 -53
  288. package/dist/src/sheet/index.js.map +1 -1
  289. package/dist/src/sheet/library.d.ts +13 -8
  290. package/dist/src/sheet/library.d.ts.map +1 -1
  291. package/dist/src/sheet/library.js +13 -8
  292. package/dist/src/sheet/library.js.map +1 -1
  293. package/dist/src/sheet/optimise.d.ts +69 -0
  294. package/dist/src/sheet/optimise.d.ts.map +1 -0
  295. package/dist/src/sheet/optimise.js +81 -0
  296. package/dist/src/sheet/optimise.js.map +1 -0
  297. package/dist/src/sheet/record.d.ts +1 -1
  298. package/dist/src/sheet/record.js +2 -2
  299. package/dist/src/sheet/record.js.map +1 -1
  300. package/dist/src/sheet/registers.d.ts +157 -133
  301. package/dist/src/sheet/registers.d.ts.map +1 -1
  302. package/dist/src/sheet/registers.js +157 -133
  303. package/dist/src/sheet/registers.js.map +1 -1
  304. package/dist/src/sheet/root.d.ts +6 -1
  305. package/dist/src/sheet/root.d.ts.map +1 -1
  306. package/dist/src/sheet/root.js +17 -5
  307. package/dist/src/sheet/root.js.map +1 -1
  308. package/dist/src/sheet/sheet.d.ts +696 -590
  309. package/dist/src/sheet/sheet.d.ts.map +1 -1
  310. package/dist/src/sheet/sheet.js +49 -15
  311. package/dist/src/sheet/sheet.js.map +1 -1
  312. package/dist/src/sheet/sub-rows.d.ts +106 -76
  313. package/dist/src/sheet/sub-rows.d.ts.map +1 -1
  314. package/dist/src/sheet/sub-rows.js +106 -76
  315. package/dist/src/sheet/sub-rows.js.map +1 -1
  316. package/dist/src/sheet/types.d.ts +57 -20
  317. package/dist/src/sheet/types.d.ts.map +1 -1
  318. package/dist/src/sheet/types.js +4 -8
  319. package/dist/src/sheet/types.js.map +1 -1
  320. package/dist/src/studio/builder.d.ts +3 -153
  321. package/dist/src/studio/builder.d.ts.map +1 -1
  322. package/dist/src/studio/builder.js +1 -1
  323. package/dist/src/studio/canvas.d.ts +5 -4
  324. package/dist/src/studio/canvas.d.ts.map +1 -1
  325. package/dist/src/studio/canvas.js +8 -7
  326. package/dist/src/studio/canvas.js.map +1 -1
  327. package/dist/src/studio/component.d.ts +30 -20
  328. package/dist/src/studio/component.d.ts.map +1 -1
  329. package/dist/src/studio/component.js +26 -61
  330. package/dist/src/studio/component.js.map +1 -1
  331. package/dist/src/studio/index.d.ts +2 -2
  332. package/dist/src/studio/index.d.ts.map +1 -1
  333. package/dist/src/studio/index.js +1 -1
  334. package/dist/src/studio/index.js.map +1 -1
  335. package/dist/src/studio/inspector.d.ts +10 -39
  336. package/dist/src/studio/inspector.d.ts.map +1 -1
  337. package/dist/src/studio/inspector.js +11 -31
  338. package/dist/src/studio/inspector.js.map +1 -1
  339. package/dist/src/studio/library.d.ts +3 -169
  340. package/dist/src/studio/library.d.ts.map +1 -1
  341. package/dist/src/studio/library.js +1 -1
  342. package/dist/src/studio/page.d.ts +0 -8
  343. package/dist/src/studio/page.d.ts.map +1 -1
  344. package/dist/src/studio/pages.d.ts +17 -591
  345. package/dist/src/studio/pages.d.ts.map +1 -1
  346. package/dist/src/studio/pages.js +17 -44
  347. package/dist/src/studio/pages.js.map +1 -1
  348. package/dist/src/studio/palette.d.ts +2 -7
  349. package/dist/src/studio/palette.d.ts.map +1 -1
  350. package/dist/src/studio/palette.js +4 -5
  351. package/dist/src/studio/palette.js.map +1 -1
  352. package/dist/src/studio/publish.d.ts +8 -18
  353. package/dist/src/studio/publish.d.ts.map +1 -1
  354. package/dist/src/studio/publish.js +10 -36
  355. package/dist/src/studio/publish.js.map +1 -1
  356. package/dist/src/utils/derive.d.ts +12 -12
  357. package/dist/src/utils/derive.d.ts.map +1 -1
  358. package/dist/src/utils/derive.js +5 -2
  359. package/dist/src/utils/derive.js.map +1 -1
  360. package/dist/src/utils/keyed-rows.d.ts +41 -0
  361. package/dist/src/utils/keyed-rows.d.ts.map +1 -0
  362. package/dist/src/utils/keyed-rows.js +64 -0
  363. package/dist/src/utils/keyed-rows.js.map +1 -0
  364. package/dist/src/utils/optimise.d.ts +79 -0
  365. package/dist/src/utils/optimise.d.ts.map +1 -0
  366. package/dist/src/utils/optimise.js +46 -0
  367. package/dist/src/utils/optimise.js.map +1 -0
  368. package/dist/src/utils/ordered-source.d.ts.map +1 -1
  369. package/dist/src/utils/ordered-source.js +14 -5
  370. package/dist/src/utils/ordered-source.js.map +1 -1
  371. package/dist/test/allocation/allocation.examples.d.ts +1900 -1610
  372. package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
  373. package/dist/test/allocation/allocation.examples.js +179 -89
  374. package/dist/test/allocation/allocation.examples.js.map +1 -1
  375. package/dist/test/allocation/optimise.examples.d.ts +109 -0
  376. package/dist/test/allocation/optimise.examples.d.ts.map +1 -0
  377. package/dist/test/allocation/optimise.examples.js +223 -0
  378. package/dist/test/allocation/optimise.examples.js.map +1 -0
  379. package/dist/test/bind/data/data.examples.d.ts +1172 -514
  380. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  381. package/dist/test/bind/data/data.examples.js +284 -164
  382. package/dist/test/bind/data/data.examples.js.map +1 -1
  383. package/dist/test/bind/record/record.examples.d.ts +457 -428
  384. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  385. package/dist/test/bind/record/record.examples.js +41 -21
  386. package/dist/test/bind/record/record.examples.js.map +1 -1
  387. package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
  388. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
  389. package/dist/test/calendar/calendar-records.examples.js +20 -12
  390. package/dist/test/calendar/calendar-records.examples.js.map +1 -1
  391. package/dist/test/calendar/calendar-windows.examples.d.ts +9 -0
  392. package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -0
  393. package/dist/test/calendar/calendar-windows.examples.js +111 -0
  394. package/dist/test/calendar/calendar-windows.examples.js.map +1 -0
  395. package/dist/test/calendar/calendar.examples.d.ts +1172 -915
  396. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  397. package/dist/test/calendar/calendar.examples.js +211 -124
  398. package/dist/test/calendar/calendar.examples.js.map +1 -1
  399. package/dist/test/calendar/optimise.examples.d.ts +132 -0
  400. package/dist/test/calendar/optimise.examples.d.ts.map +1 -0
  401. package/dist/test/calendar/optimise.examples.js +75 -0
  402. package/dist/test/calendar/optimise.examples.js.map +1 -0
  403. package/dist/test/examples-package.d.ts +49 -16
  404. package/dist/test/examples-package.d.ts.map +1 -1
  405. package/dist/test/examples-package.js +138 -49
  406. package/dist/test/examples-package.js.map +1 -1
  407. package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2840
  408. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  409. package/dist/test/flowchart/flowchart.examples.js +211 -121
  410. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  411. package/dist/test/plan/optimise.examples.d.ts +207 -0
  412. package/dist/test/plan/optimise.examples.d.ts.map +1 -0
  413. package/dist/test/plan/optimise.examples.js +98 -0
  414. package/dist/test/plan/optimise.examples.js.map +1 -0
  415. package/dist/test/plan/plan-events.examples.d.ts +4055 -3279
  416. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  417. package/dist/test/plan/plan-events.examples.js +492 -319
  418. package/dist/test/plan/plan-events.examples.js.map +1 -1
  419. package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
  420. package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
  421. package/dist/test/plan/plan-nested.examples.js +321 -0
  422. package/dist/test/plan/plan-nested.examples.js.map +1 -0
  423. package/dist/test/plan/plan-records.examples.d.ts +391 -244
  424. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  425. package/dist/test/plan/plan-records.examples.js +186 -65
  426. package/dist/test/plan/plan-records.examples.js.map +1 -1
  427. package/dist/test/plan/plan-windows.examples.d.ts +1978 -803
  428. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
  429. package/dist/test/plan/plan-windows.examples.js +269 -99
  430. package/dist/test/plan/plan-windows.examples.js.map +1 -1
  431. package/dist/test/plan/plan.examples.d.ts +2238 -5726
  432. package/dist/test/plan/plan.examples.d.ts.map +1 -1
  433. package/dist/test/plan/plan.examples.js +846 -973
  434. package/dist/test/plan/plan.examples.js.map +1 -1
  435. package/dist/test/query/query.examples.d.ts +5221 -3005
  436. package/dist/test/query/query.examples.d.ts.map +1 -1
  437. package/dist/test/query/query.examples.js +169 -118
  438. package/dist/test/query/query.examples.js.map +1 -1
  439. package/dist/test/roster/domain.examples.d.ts +804 -0
  440. package/dist/test/roster/domain.examples.d.ts.map +1 -1
  441. package/dist/test/roster/domain.examples.js +3 -3
  442. package/dist/test/roster/domain.examples.js.map +1 -1
  443. package/dist/test/roster/optimise.examples.d.ts +485 -0
  444. package/dist/test/roster/optimise.examples.d.ts.map +1 -0
  445. package/dist/test/roster/optimise.examples.js +155 -0
  446. package/dist/test/roster/optimise.examples.js.map +1 -0
  447. package/dist/test/roster/roster-records.examples.d.ts +364 -404
  448. package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
  449. package/dist/test/roster/roster-records.examples.js +40 -26
  450. package/dist/test/roster/roster-records.examples.js.map +1 -1
  451. package/dist/test/roster/roster.examples.d.ts +5091 -1424
  452. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  453. package/dist/test/roster/roster.examples.js +255 -109
  454. package/dist/test/roster/roster.examples.js.map +1 -1
  455. package/dist/test/roster/warehouse.d.ts +150 -7
  456. package/dist/test/roster/warehouse.d.ts.map +1 -1
  457. package/dist/test/roster/warehouse.js +36 -11
  458. package/dist/test/roster/warehouse.js.map +1 -1
  459. package/dist/test/schedule/schedule.examples.d.ts +2646 -2473
  460. package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
  461. package/dist/test/schedule/schedule.examples.js +144 -88
  462. package/dist/test/schedule/schedule.examples.js.map +1 -1
  463. package/dist/test/schematic/schematic-records.examples.d.ts +454 -0
  464. package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -0
  465. package/dist/test/schematic/schematic-records.examples.js +219 -0
  466. package/dist/test/schematic/schematic-records.examples.js.map +1 -0
  467. package/dist/test/schematic/schematic.examples.d.ts +2640 -0
  468. package/dist/test/schematic/schematic.examples.d.ts.map +1 -0
  469. package/dist/test/schematic/schematic.examples.js +559 -0
  470. package/dist/test/schematic/schematic.examples.js.map +1 -0
  471. package/dist/test/sheet/optimise.examples.d.ts +184 -0
  472. package/dist/test/sheet/optimise.examples.d.ts.map +1 -0
  473. package/dist/test/sheet/optimise.examples.js +79 -0
  474. package/dist/test/sheet/optimise.examples.js.map +1 -0
  475. package/dist/test/sheet/sheet-records.examples.d.ts +208 -356
  476. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
  477. package/dist/test/sheet/sheet-records.examples.js +66 -29
  478. package/dist/test/sheet/sheet-records.examples.js.map +1 -1
  479. package/dist/test/sheet/sheet.examples.d.ts +3650 -3377
  480. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  481. package/dist/test/sheet/sheet.examples.js +406 -296
  482. package/dist/test/sheet/sheet.examples.js.map +1 -1
  483. package/dist/test/studio/component.examples.js +2 -2
  484. package/dist/test/studio/component.examples.js.map +1 -1
  485. package/dist/test/studio/page.examples.js +6 -6
  486. package/dist/test/studio/page.examples.js.map +1 -1
  487. package/dist/test/studio/studio.examples.d.ts +2329 -873
  488. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  489. package/dist/test/studio/studio.examples.js +155 -107
  490. package/dist/test/studio/studio.examples.js.map +1 -1
  491. package/package.json +15 -11
@@ -4,8 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
4
4
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
5
5
  */
6
6
  /** @jsxImportSource @elaraai/e3-ui */
7
- import { ArrayType, DateTimeType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, StringType, StructType, VariantType, example, none, some, variant, } from "@elaraai/east";
8
- import { Chart, EventStateType, Format, Reactive, SegmentGroup, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
7
+ import { ArrayType, DateTimeType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, SortedMap, StringType, StructType, VariantType, compareFor, example, none, some, variant, } from "@elaraai/east";
8
+ import { Box, Button, Chart, EventStateType, Format, HStack, Reactive, SegmentGroup, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
9
9
  import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
10
10
  import e3 from "@elaraai/e3";
11
11
  // A Plan of event kinds (#1191, `Plan Builder Spec.md` §3): the resources are
@@ -58,141 +58,181 @@ export const PrintShift = StructType({ title: StringType, start: DateTimeType, e
58
58
  /** A customer: its name, the district it is in and its trade. */
59
59
  export const PrintCustomer = StructType({ name: StringType, district: StringType, trade: StringType });
60
60
  /** The presses: three in each hall. A Plan never writes its resources. */
61
- export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
62
- ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
63
- ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
64
- ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
65
- ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
66
- ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
67
- ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
68
- ]));
69
- /** The presses' patch door: the works edits its presses elsewhere, and a Plan reads them live. */
70
- export const planPrintPressesPatch = e3.mutation.patch(planPrintPresses);
61
+ export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), {
62
+ initial: new Map([
63
+ ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
64
+ ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
65
+ ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
66
+ ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
67
+ ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
68
+ ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
69
+ ]),
70
+ indexes: (index) => ({
71
+ plan_print_presses_by_hall: index.on(["hall"]),
72
+ }),
73
+ mutations: (mutation) => ({
74
+ // The presses' patch door: the works edits its presses elsewhere, and a Plan reads them live.
75
+ patch: mutation.patch(),
76
+ }),
77
+ });
71
78
  /** The crews: two in each hall. */
72
- export const planPrintCrews = e3.record("plan_print_crews", DictType(StringType, PrintCrew), new Map([
73
- ["c1", { name: "Crew 1", hall: "Hall A" }],
74
- ["c2", { name: "Crew 2", hall: "Hall A" }],
75
- ["c3", { name: "Crew 3", hall: "Hall B" }],
76
- ["c4", { name: "Crew 4", hall: "Hall B" }],
77
- ]));
79
+ export const planPrintCrews = e3.record("plan_print_crews", DictType(StringType, PrintCrew), {
80
+ initial: new Map([
81
+ ["c1", { name: "Crew 1", hall: "Hall A" }],
82
+ ["c2", { name: "Crew 2", hall: "Hall A" }],
83
+ ["c3", { name: "Crew 3", hall: "Hall B" }],
84
+ ["c4", { name: "Crew 4", hall: "Hall B" }],
85
+ ]),
86
+ });
78
87
  /**
79
88
  * The print jobs: actual before 14 October, in progress on it, confirmed,
80
89
  * proposed and estimated after it; two overlapping on Press B2 on the 20th;
81
90
  * and eight with no start waiting in the backlog, two due this week, two next
82
91
  * week, two later and two with no due date.
83
92
  */
84
- export const planPrintJobs = e3.record("plan_print_jobs", DictType(StringType, PrintJob), new Map([
85
- ["J-1001", { title: "Spring catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
86
- ["J-1002", { title: "Museum guide", start: some(new Date("2026-10-07T06:00:00Z")), end: some(new Date("2026-10-07T12:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 72000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
87
- ["J-1003", { title: "Event posters", start: some(new Date("2026-10-14T07:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a1"), state: variant("in-progress", null), sheets: 60000.0, customer: "Granite Hall", stock: variant("uncoated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
88
- ["J-1004", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
89
- ["J-1005", { title: "Menu cards", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T08:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 24000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
90
- ["J-1006", { title: "Tour brochure", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a2"), state: variant("actual", null), sheets: 80000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
91
- ["J-1007", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
92
- ["J-1008", { title: "Seed catalogue", start: some(new Date("2026-10-21T06:00:00Z")), end: some(new Date("2026-10-21T16:00:00Z")), press: some("a2"), state: variant("proposed", variant("added", null)), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-24T00:00:00Z")) }],
93
- ["J-1009", { title: "Season flyers", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-28T09:00:00Z")), press: some("a2"), state: variant("estimated", null), sheets: 30000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-31T00:00:00Z")) }],
94
- ["J-1010", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
95
- ["J-1011", { title: "Stationery set", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T09:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 24000.0, customer: "Ivy Lane Studio", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
96
- ["J-1012", { title: "Gift boxes", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T12:00:00Z")), press: some("a3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
97
- ["J-1013", { title: "Holiday catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T22:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 240000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
98
- ["J-1014", { title: "Magazine run", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 180000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
99
- ["J-1015", { title: "Store flyers", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T16:00:00Z")), press: some("b1"), state: variant("in-progress", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
100
- ["J-1016", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-26T12:00:00Z")), press: some("b1"), state: variant("estimated", null), sheets: 90000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
101
- ["J-1017", { title: "Timetables", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T10:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 48000.0, customer: "Bluewater Tours", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
102
- ["J-1018", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
103
- ["J-1019", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
104
- ["J-1020", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-29T08:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
105
- ["J-1021", { title: "Handbook covers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
106
- ["J-1022", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
107
- ["J-1023", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
108
- ["J-1024", { title: "Order forms", start: none, end: none, press: none, state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-17T00:00:00Z")) }],
109
- ["J-1025", { title: "Winter brochure", start: none, end: none, press: none, state: variant("estimated", null), sheets: 64000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
110
- ["J-1026", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
111
- ["J-1027", { title: "Prospectus", start: none, end: none, press: none, state: variant("estimated", null), sheets: 100000.0, customer: "Elmway College", stock: variant("coated", null), due: some(new Date("2026-11-06T00:00:00Z")) }],
112
- ["J-1028", { title: "Price lists", start: none, end: none, press: none, state: variant("estimated", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-11-13T00:00:00Z")) }],
113
- ["J-1029", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
114
- ["J-1030", { title: "Proof sheets", start: none, end: none, press: none, state: variant("estimated", null), sheets: 2000.0, customer: "Alder & Finch", stock: variant("uncoated", null), due: none }],
115
- ]));
116
- /** The jobs' patch door: every Save commits through it. */
117
- export const planPrintJobsPatch = e3.mutation.patch(planPrintJobs);
93
+ export const planPrintJobs = e3.record("plan_print_jobs", DictType(StringType, PrintJob), {
94
+ initial: new Map([
95
+ ["J-1001", { title: "Spring catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
96
+ ["J-1002", { title: "Museum guide", start: some(new Date("2026-10-07T06:00:00Z")), end: some(new Date("2026-10-07T12:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 72000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
97
+ ["J-1003", { title: "Event posters", start: some(new Date("2026-10-14T07:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a1"), state: variant("in-progress", null), sheets: 60000.0, customer: "Granite Hall", stock: variant("uncoated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
98
+ ["J-1004", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
99
+ ["J-1005", { title: "Menu cards", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T08:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 24000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
100
+ ["J-1006", { title: "Tour brochure", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a2"), state: variant("actual", null), sheets: 80000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
101
+ ["J-1007", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
102
+ ["J-1008", { title: "Seed catalogue", start: some(new Date("2026-10-21T06:00:00Z")), end: some(new Date("2026-10-21T16:00:00Z")), press: some("a2"), state: variant("proposed", variant("added", null)), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-24T00:00:00Z")) }],
103
+ ["J-1009", { title: "Season flyers", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-28T09:00:00Z")), press: some("a2"), state: variant("estimated", null), sheets: 30000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-31T00:00:00Z")) }],
104
+ ["J-1010", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
105
+ ["J-1011", { title: "Stationery set", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T09:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 24000.0, customer: "Ivy Lane Studio", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
106
+ ["J-1012", { title: "Gift boxes", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T12:00:00Z")), press: some("a3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
107
+ ["J-1013", { title: "Holiday catalogue", start: some(new Date("2026-10-05T06:00:00Z")), end: some(new Date("2026-10-05T22:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 240000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
108
+ ["J-1014", { title: "Magazine run", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 180000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
109
+ ["J-1015", { title: "Store flyers", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T16:00:00Z")), press: some("b1"), state: variant("in-progress", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
110
+ ["J-1016", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-26T12:00:00Z")), press: some("b1"), state: variant("estimated", null), sheets: 90000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
111
+ ["J-1017", { title: "Timetables", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T10:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 48000.0, customer: "Bluewater Tours", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
112
+ ["J-1018", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
113
+ ["J-1019", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
114
+ ["J-1020", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-29T08:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
115
+ ["J-1021", { title: "Handbook covers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
116
+ ["J-1022", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
117
+ ["J-1023", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
118
+ ["J-1024", { title: "Order forms", start: none, end: none, press: none, state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-17T00:00:00Z")) }],
119
+ ["J-1025", { title: "Winter brochure", start: none, end: none, press: none, state: variant("estimated", null), sheets: 64000.0, customer: "Bluewater Tours", stock: variant("coated", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
120
+ ["J-1026", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
121
+ ["J-1027", { title: "Prospectus", start: none, end: none, press: none, state: variant("estimated", null), sheets: 100000.0, customer: "Elmway College", stock: variant("coated", null), due: some(new Date("2026-11-06T00:00:00Z")) }],
122
+ ["J-1028", { title: "Price lists", start: none, end: none, press: none, state: variant("estimated", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-11-13T00:00:00Z")) }],
123
+ ["J-1029", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
124
+ ["J-1030", { title: "Proof sheets", start: none, end: none, press: none, state: variant("estimated", null), sheets: 2000.0, customer: "Alder & Finch", stock: variant("uncoated", null), due: none }],
125
+ ]),
126
+ indexes: (index) => ({
127
+ // The rail narrows each record through its own indexes (#1344): the jobs and the shifts over their interval
128
+ // indexes — on their own, and after a job's stock — so a narrowing keeps every event overlapping the window once;
129
+ // the presses by hall, the customers by district, and each templates record by its group.
130
+ plan_print_jobs_by_time: index.interval({ from: "start", to: "end" }),
131
+ plan_print_jobs_by_stock_time: index.interval({ on: ["stock"], from: "start", to: "end" }),
132
+ }),
133
+ mutations: (mutation) => ({
134
+ // The jobs' patch door: every Save commits through it.
135
+ patch: mutation.patch(),
136
+ }),
137
+ });
118
138
  /** The stops: plate changes and services across the presses. */
119
- export const planPrintStops = e3.record("plan_print_stops", DictType(StringType, PrintStop), new Map([
120
- ["S-01", { title: "Plate change", at: new Date("2026-10-07T12:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
121
- ["S-02", { title: "Service", at: new Date("2026-10-12T04:00:00Z"), press: "b1", kind: variant("service", null) }],
122
- ["S-03", { title: "Plate change", at: new Date("2026-10-14T12:00:00Z"), press: "a2", kind: variant("plate_change", null) }],
123
- ["S-04", { title: "Plate change", at: new Date("2026-10-19T18:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
124
- ["S-05", { title: "Service", at: new Date("2026-10-26T14:00:00Z"), press: "a3", kind: variant("service", null) }],
125
- ["S-06", { title: "Plate change", at: new Date("2026-10-28T10:00:00Z"), press: "b2", kind: variant("plate_change", null) }],
126
- ]));
127
- /** The stops' patch door. */
128
- export const planPrintStopsPatch = e3.mutation.patch(planPrintStops);
139
+ export const planPrintStops = e3.record("plan_print_stops", DictType(StringType, PrintStop), {
140
+ initial: new Map([
141
+ ["S-01", { title: "Plate change", at: new Date("2026-10-07T12:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
142
+ ["S-02", { title: "Service", at: new Date("2026-10-12T04:00:00Z"), press: "b1", kind: variant("service", null) }],
143
+ ["S-03", { title: "Plate change", at: new Date("2026-10-14T12:00:00Z"), press: "a2", kind: variant("plate_change", null) }],
144
+ ["S-04", { title: "Plate change", at: new Date("2026-10-19T18:00:00Z"), press: "a1", kind: variant("plate_change", null) }],
145
+ ["S-05", { title: "Service", at: new Date("2026-10-26T14:00:00Z"), press: "a3", kind: variant("service", null) }],
146
+ ["S-06", { title: "Plate change", at: new Date("2026-10-28T10:00:00Z"), press: "b2", kind: variant("plate_change", null) }],
147
+ ]),
148
+ mutations: (mutation) => ({
149
+ // The stops' patch door.
150
+ patch: mutation.patch(),
151
+ }),
152
+ });
129
153
  /** The shifts: each crew's early and late shifts, confirmed for the first two weeks and proposed for the last two. */
130
- export const planPrintShifts = e3.record("plan_print_shifts", DictType(StringType, PrintShift), new Map([
131
- ["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
132
- ["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
133
- ["SH-03", { title: "Late", start: new Date("2026-10-13T14:00:00Z"), end: new Date("2026-10-13T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
134
- ["SH-04", { title: "Late", start: new Date("2026-10-15T14:00:00Z"), end: new Date("2026-10-15T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
135
- ["SH-05", { title: "Early", start: new Date("2026-10-19T06:00:00Z"), end: new Date("2026-10-19T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
136
- ["SH-06", { title: "Early", start: new Date("2026-10-26T06:00:00Z"), end: new Date("2026-10-26T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
137
- ["SH-07", { title: "Late", start: new Date("2026-10-05T14:00:00Z"), end: new Date("2026-10-05T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
138
- ["SH-08", { title: "Late", start: new Date("2026-10-07T14:00:00Z"), end: new Date("2026-10-07T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
139
- ["SH-09", { title: "Early", start: new Date("2026-10-13T06:00:00Z"), end: new Date("2026-10-13T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
140
- ["SH-10", { title: "Early", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-15T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
141
- ["SH-11", { title: "Late", start: new Date("2026-10-19T14:00:00Z"), end: new Date("2026-10-19T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
142
- ["SH-12", { title: "Late", start: new Date("2026-10-26T14:00:00Z"), end: new Date("2026-10-26T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
143
- ["SH-13", { title: "Early", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
144
- ["SH-14", { title: "Early", start: new Date("2026-10-08T06:00:00Z"), end: new Date("2026-10-08T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
145
- ["SH-15", { title: "Late", start: new Date("2026-10-12T14:00:00Z"), end: new Date("2026-10-12T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
146
- ["SH-16", { title: "Late", start: new Date("2026-10-14T14:00:00Z"), end: new Date("2026-10-14T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
147
- ["SH-17", { title: "Early", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), crew: "c3", state: variant("proposed", variant("recommended", null)) }],
148
- ["SH-18", { title: "Early", start: new Date("2026-10-27T06:00:00Z"), end: new Date("2026-10-27T14:00:00Z"), crew: "c3", state: variant("proposed", variant("added", null)) }],
149
- ["SH-19", { title: "Late", start: new Date("2026-10-06T14:00:00Z"), end: new Date("2026-10-06T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
150
- ["SH-20", { title: "Late", start: new Date("2026-10-08T14:00:00Z"), end: new Date("2026-10-08T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
151
- ["SH-21", { title: "Early", start: new Date("2026-10-12T06:00:00Z"), end: new Date("2026-10-12T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
152
- ["SH-22", { title: "Early", start: new Date("2026-10-14T06:00:00Z"), end: new Date("2026-10-14T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
153
- ["SH-23", { title: "Late", start: new Date("2026-10-20T14:00:00Z"), end: new Date("2026-10-20T22:00:00Z"), crew: "c4", state: variant("proposed", variant("recommended", null)) }],
154
- ["SH-24", { title: "Late", start: new Date("2026-10-27T14:00:00Z"), end: new Date("2026-10-27T22:00:00Z"), crew: "c4", state: variant("proposed", variant("added", null)) }],
155
- ]));
156
- /** The shifts' patch door. */
157
- export const planPrintShiftsPatch = e3.mutation.patch(planPrintShifts);
154
+ export const planPrintShifts = e3.record("plan_print_shifts", DictType(StringType, PrintShift), {
155
+ initial: new Map([
156
+ ["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
157
+ ["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
158
+ ["SH-03", { title: "Late", start: new Date("2026-10-13T14:00:00Z"), end: new Date("2026-10-13T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
159
+ ["SH-04", { title: "Late", start: new Date("2026-10-15T14:00:00Z"), end: new Date("2026-10-15T22:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
160
+ ["SH-05", { title: "Early", start: new Date("2026-10-19T06:00:00Z"), end: new Date("2026-10-19T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
161
+ ["SH-06", { title: "Early", start: new Date("2026-10-26T06:00:00Z"), end: new Date("2026-10-26T14:00:00Z"), crew: "c1", state: variant("proposed", variant("recommended", null)) }],
162
+ ["SH-07", { title: "Late", start: new Date("2026-10-05T14:00:00Z"), end: new Date("2026-10-05T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
163
+ ["SH-08", { title: "Late", start: new Date("2026-10-07T14:00:00Z"), end: new Date("2026-10-07T22:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
164
+ ["SH-09", { title: "Early", start: new Date("2026-10-13T06:00:00Z"), end: new Date("2026-10-13T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
165
+ ["SH-10", { title: "Early", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-15T14:00:00Z"), crew: "c2", state: variant("confirmed", null) }],
166
+ ["SH-11", { title: "Late", start: new Date("2026-10-19T14:00:00Z"), end: new Date("2026-10-19T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
167
+ ["SH-12", { title: "Late", start: new Date("2026-10-26T14:00:00Z"), end: new Date("2026-10-26T22:00:00Z"), crew: "c2", state: variant("proposed", variant("recommended", null)) }],
168
+ ["SH-13", { title: "Early", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
169
+ ["SH-14", { title: "Early", start: new Date("2026-10-08T06:00:00Z"), end: new Date("2026-10-08T14:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
170
+ ["SH-15", { title: "Late", start: new Date("2026-10-12T14:00:00Z"), end: new Date("2026-10-12T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
171
+ ["SH-16", { title: "Late", start: new Date("2026-10-14T14:00:00Z"), end: new Date("2026-10-14T22:00:00Z"), crew: "c3", state: variant("confirmed", null) }],
172
+ ["SH-17", { title: "Early", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), crew: "c3", state: variant("proposed", variant("recommended", null)) }],
173
+ ["SH-18", { title: "Early", start: new Date("2026-10-27T06:00:00Z"), end: new Date("2026-10-27T14:00:00Z"), crew: "c3", state: variant("proposed", variant("added", null)) }],
174
+ ["SH-19", { title: "Late", start: new Date("2026-10-06T14:00:00Z"), end: new Date("2026-10-06T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
175
+ ["SH-20", { title: "Late", start: new Date("2026-10-08T14:00:00Z"), end: new Date("2026-10-08T22:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
176
+ ["SH-21", { title: "Early", start: new Date("2026-10-12T06:00:00Z"), end: new Date("2026-10-12T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
177
+ ["SH-22", { title: "Early", start: new Date("2026-10-14T06:00:00Z"), end: new Date("2026-10-14T14:00:00Z"), crew: "c4", state: variant("confirmed", null) }],
178
+ ["SH-23", { title: "Late", start: new Date("2026-10-20T14:00:00Z"), end: new Date("2026-10-20T22:00:00Z"), crew: "c4", state: variant("proposed", variant("recommended", null)) }],
179
+ ["SH-24", { title: "Late", start: new Date("2026-10-27T14:00:00Z"), end: new Date("2026-10-27T22:00:00Z"), crew: "c4", state: variant("proposed", variant("added", null)) }],
180
+ ]),
181
+ indexes: (index) => ({
182
+ plan_print_shifts_by_time: index.interval({ from: "start", to: "end" }),
183
+ }),
184
+ mutations: (mutation) => ({
185
+ // The shifts' patch door.
186
+ patch: mutation.patch(),
187
+ }),
188
+ });
158
189
  /** A crew roster the works has locked for the week: Crew 1's two early shifts. */
159
- export const planLockedShifts = e3.record("plan_locked_shifts", DictType(StringType, PrintShift), new Map([
160
- ["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
161
- ["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
162
- ]));
163
- /**
164
- * The locked roster's patch door, a checked one: it takes any change to a
165
- * shift, and refuses one that takes a shift off the roster, naming why — what
166
- * a Save that deletes one is answered.
167
- */
168
- export const planLockedShiftsPatch = e3.mutation.reduce("patch", planLockedShifts, East.function([DictType(StringType, PrintShift), PatchType(DictType(StringType, PrintShift))], DictType(StringType, PrintShift), ($, roster, patch) => {
169
- const next = $.let(East.applyPatch(roster, patch));
170
- $.for(roster, ($2, _shift, key) => {
171
- $2.if(next.has(key).not(), ($3) => { $3.error("the crew roster is locked for the week"); });
172
- });
173
- return next;
174
- }));
190
+ export const planLockedShifts = e3.record("plan_locked_shifts", DictType(StringType, PrintShift), {
191
+ initial: new Map([
192
+ ["SH-01", { title: "Early", start: new Date("2026-10-05T06:00:00Z"), end: new Date("2026-10-05T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
193
+ ["SH-02", { title: "Early", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T14:00:00Z"), crew: "c1", state: variant("confirmed", null) }],
194
+ ]),
195
+ mutations: (mutation) => ({
196
+ // The locked roster's patch door, a checked one: it takes any change to a
197
+ // shift, and refuses one that takes a shift off the roster, naming why — what
198
+ // a Save that deletes one is answered.
199
+ patch: mutation.reduce(East.function([DictType(StringType, PrintShift), PatchType(DictType(StringType, PrintShift))], DictType(StringType, PrintShift), ($, roster, patch) => {
200
+ const next = $.let(East.applyPatch(roster, patch));
201
+ $.for(roster, ($2, _shift, key) => {
202
+ $2.if(next.has(key).not(), ($3) => { $3.error("the crew roster is locked for the week"); });
203
+ });
204
+ return next;
205
+ })),
206
+ }),
207
+ });
175
208
  /** The customers the jobs are printed for, by account, in three districts: what the print works' library lists. A Plan never writes them. */
176
- export const planPrintCustomers = e3.record("plan_print_customers", DictType(StringType, PrintCustomer), new Map([
177
- ["alder-finch", { name: "Alder & Finch", district: "Old Town", trade: "Retail" }],
178
- ["bluewater-tours", { name: "Bluewater Tours", district: "North Quay", trade: "Travel" }],
179
- ["copperleaf-cafe", { name: "Copperleaf Cafe", district: "Old Town", trade: "Hospitality" }],
180
- ["driftwood-museum", { name: "Driftwood Museum", district: "North Quay", trade: "Arts" }],
181
- ["elmway-college", { name: "Elmway College", district: "Riverside", trade: "Education" }],
182
- ["foxglove-gardens", { name: "Foxglove Gardens", district: "Riverside", trade: "Retail" }],
183
- ["granite-hall", { name: "Granite Hall", district: "Old Town", trade: "Events" }],
184
- ["harbour-arts", { name: "Harbour Arts Society", district: "North Quay", trade: "Arts" }],
185
- ["heathfield", { name: "Heathfield Theatre", district: "Old Town", trade: "Arts" }],
186
- ["ivy-lane", { name: "Ivy Lane Studio", district: "Riverside", trade: "Design" }],
187
- ["juniper-toys", { name: "Juniper Toys", district: "Riverside", trade: "Retail" }],
188
- ["kestrel-cycling", { name: "Kestrel Cycling Club", district: "Riverside", trade: "Sport" }],
189
- ["larkspur-home", { name: "Larkspur Home", district: "Old Town", trade: "Retail" }],
190
- ["meridian-monthly", { name: "Meridian Monthly", district: "North Quay", trade: "Publishing" }],
191
- ["northwind", { name: "Northwind Outfitters", district: "North Quay", trade: "Retail" }],
192
- ["orchard-market", { name: "Orchard Street Market", district: "Old Town", trade: "Markets" }],
193
- ]));
194
- /** The customers' patch door: the works edits its customers elsewhere, and a Plan reads them live. */
195
- export const planPrintCustomersPatch = e3.mutation.patch(planPrintCustomers);
209
+ export const planPrintCustomers = e3.record("plan_print_customers", DictType(StringType, PrintCustomer), {
210
+ initial: new Map([
211
+ ["alder-finch", { name: "Alder & Finch", district: "Old Town", trade: "Retail" }],
212
+ ["bluewater-tours", { name: "Bluewater Tours", district: "North Quay", trade: "Travel" }],
213
+ ["copperleaf-cafe", { name: "Copperleaf Cafe", district: "Old Town", trade: "Hospitality" }],
214
+ ["driftwood-museum", { name: "Driftwood Museum", district: "North Quay", trade: "Arts" }],
215
+ ["elmway-college", { name: "Elmway College", district: "Riverside", trade: "Education" }],
216
+ ["foxglove-gardens", { name: "Foxglove Gardens", district: "Riverside", trade: "Retail" }],
217
+ ["granite-hall", { name: "Granite Hall", district: "Old Town", trade: "Events" }],
218
+ ["harbour-arts", { name: "Harbour Arts Society", district: "North Quay", trade: "Arts" }],
219
+ ["heathfield", { name: "Heathfield Theatre", district: "Old Town", trade: "Arts" }],
220
+ ["ivy-lane", { name: "Ivy Lane Studio", district: "Riverside", trade: "Design" }],
221
+ ["juniper-toys", { name: "Juniper Toys", district: "Riverside", trade: "Retail" }],
222
+ ["kestrel-cycling", { name: "Kestrel Cycling Club", district: "Riverside", trade: "Sport" }],
223
+ ["larkspur-home", { name: "Larkspur Home", district: "Old Town", trade: "Retail" }],
224
+ ["meridian-monthly", { name: "Meridian Monthly", district: "North Quay", trade: "Publishing" }],
225
+ ["northwind", { name: "Northwind Outfitters", district: "North Quay", trade: "Retail" }],
226
+ ["orchard-market", { name: "Orchard Street Market", district: "Old Town", trade: "Markets" }],
227
+ ]),
228
+ indexes: (index) => ({
229
+ plan_print_customers_by_district: index.on(["district"]),
230
+ }),
231
+ mutations: (mutation) => ({
232
+ // The customers' patch door: the works edits its customers elsewhere, and a Plan reads them live.
233
+ patch: mutation.patch(),
234
+ }),
235
+ });
196
236
  /**
197
237
  * Each press's utilisation (%): a reading a day from 5 October, as the
198
238
  * dataflow measures it, idle at the weekends. Press B2's 97 on the 20th is
@@ -222,22 +262,26 @@ export const planPrintOutput = e3.input("plan_print_output", ArrayType(FloatType
222
262
  * yet; and three with no start waiting in the backlog, due this week, next
223
263
  * week and never.
224
264
  */
225
- export const planEventJobs = e3.record("plan_event_jobs", DictType(StringType, PrintJob), new Map([
226
- ["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
227
- ["J-3002", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
228
- ["J-3003", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
229
- ["J-3004", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
230
- ["J-3005", { title: "Store flyers", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
231
- ["J-3006", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
232
- ["J-3007", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
233
- ["J-3008", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
234
- ["J-3009", { title: "Ticket books", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T09:00:00Z")), press: none, state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
235
- ["J-3010", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
236
- ["J-3011", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
237
- ["J-3012", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
238
- ]));
239
- /** The smallest builder's jobs' patch door: its Save commits through it. */
240
- export const planEventJobsPatch = e3.mutation.patch(planEventJobs);
265
+ export const planEventJobs = e3.record("plan_event_jobs", DictType(StringType, PrintJob), {
266
+ initial: new Map([
267
+ ["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("actual", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
268
+ ["J-3002", { title: "Course handbook", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-19T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
269
+ ["J-3003", { title: "Annual report", start: some(new Date("2026-10-14T06:00:00Z")), end: some(new Date("2026-10-14T12:00:00Z")), press: some("a2"), state: variant("in-progress", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
270
+ ["J-3004", { title: "Club newsletter", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Kestrel Cycling Club", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
271
+ ["J-3005", { title: "Store flyers", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-15T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
272
+ ["J-3006", { title: "Market posters", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-22T00:00:00Z")) }],
273
+ ["J-3007", { title: "Loyalty cards", start: some(new Date("2026-10-20T10:00:00Z")), end: some(new Date("2026-10-20T13:00:00Z")), press: some("b2"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
274
+ ["J-3008", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
275
+ ["J-3009", { title: "Ticket books", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-22T09:00:00Z")), press: none, state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
276
+ ["J-3010", { title: "Guide reprint", start: none, end: none, press: none, state: variant("estimated", null), sheets: 24000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
277
+ ["J-3011", { title: "Wall calendars", start: none, end: none, press: none, state: variant("estimated", null), sheets: 50000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
278
+ ["J-3012", { title: "Spare covers", start: none, end: none, press: none, state: variant("estimated", null), sheets: 8000.0, customer: "Meridian Monthly", stock: variant("board", null), due: none }],
279
+ ]),
280
+ mutations: (mutation) => ({
281
+ // The smallest builder's jobs' patch door: its Save commits through it.
282
+ patch: mutation.patch(),
283
+ }),
284
+ });
241
285
  /**
242
286
  * The smallest builder (`Plan Builder Spec.md` §3.2): a row per press, each
243
287
  * job a bar on its press, the jobs a record of the example's own. Jobs move
@@ -257,13 +301,13 @@ export const planEvents = example({
257
301
  "Plan", "Schedule", "Schedule.resources", "Schedule.events", "Schedule.field", "event kinds", "events", "resources",
258
302
  "rows", "jobs", "presses", "bars", "state", "backlog", "duration", "due", "fields", "library", "Plan.library",
259
303
  "Plan.library.backlog", "Plan.library.tab", "customers", "drop", "Schedule.patch", "inspector", "overlaps",
260
- "Unassigned", "id", "record", "Record.bind", "e3.record", "e3.mutation.patch", "patch", "smallest", "builder",
304
+ "Unassigned", "id", "record", "Record.bind", "e3.record", "mutation.patch", "patch", "smallest", "builder",
261
305
  "#1191", "#1195", "#1197", "#1198",
262
306
  ],
263
307
  description: "The smallest builder — the presses as its rows (`Schedule.resources`) and the print jobs as bars on them (`Schedule.events`), a record of its own bound with its patch mutation; its library the backlog and the customers, each card setting the customer of the job it is dropped on (`Schedule.patch`); its inspector a job's customer and stock; an overlap on Press B2, and a job on no press on the Unassigned row",
264
308
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
265
309
  const presses = $.let(Record.bind(planPrintPresses, []));
266
- const jobs = $.let(Record.bind(planEventJobs, [planEventJobsPatch]));
310
+ const jobs = $.let(Record.bind(planEventJobs));
267
311
  const customers = $.let(Record.bind(planPrintCustomers, []));
268
312
  const axis = $.let(Plan.axis({
269
313
  window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
@@ -300,22 +344,32 @@ export const planEvents = example({
300
344
  // ============================================================================
301
345
  // planEventLinks — every way a link draws, and rows over a dataset
302
346
  // ============================================================================
303
- /** A paper stock: its name, and its level in thousands of sheets, a reading a week from 5 October. */
304
- export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
347
+ /** A paper stock: its name, and its level in thousands of sheets, a reading a week keyed by its week (#1436). */
348
+ export const PrintStock = StructType({ name: StringType, weekly: DictType(DateTimeType, FloatType) });
305
349
  /** Four jobs on the print works' presses — the covers and the sleeves on Press B3, and the handbooks and the boxes they go into on Press A1 — which the Plan's specs read as a second kind of job. */
306
- export const planLinkJobs = e3.record("plan_link_jobs", DictType(StringType, PrintJob), new Map([
307
- ["J-2001", { title: "Handbook covers", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
308
- ["J-2002", { title: "Course handbook", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
309
- ["J-2003", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
310
- ["J-2004", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
311
- ]));
312
- /** The linked jobs' patch door. */
313
- export const planLinkJobsPatch = e3.mutation.patch(planLinkJobs);
350
+ export const planLinkJobs = e3.record("plan_link_jobs", DictType(StringType, PrintJob), {
351
+ initial: new Map([
352
+ ["J-2001", { title: "Handbook covers", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T08:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 12000.0, customer: "Elmway College", stock: variant("board", null), due: some(new Date("2026-10-07T00:00:00Z")) }],
353
+ ["J-2002", { title: "Course handbook", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
354
+ ["J-2003", { title: "Box sleeves", start: some(new Date("2026-10-20T06:00:00Z")), end: some(new Date("2026-10-20T09:00:00Z")), press: some("b3"), state: variant("proposed", variant("recommended", null)), sheets: 18000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
355
+ ["J-2004", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T12:00:00Z")), press: some("a1"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
356
+ ]),
357
+ mutations: (mutation) => ({
358
+ // The linked jobs' patch door.
359
+ patch: mutation.patch(),
360
+ }),
361
+ });
314
362
  /** The paper in stock. */
315
363
  export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
316
- ["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
317
- ["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
318
- ["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
364
+ ["board", { name: "Board", weekly: new SortedMap([
365
+ [new Date("2026-10-05T00:00:00Z"), 40.0], [new Date("2026-10-12T00:00:00Z"), 22.0], [new Date("2026-10-19T00:00:00Z"), 31.0], [new Date("2026-10-26T00:00:00Z"), 18.0],
366
+ ], compareFor(DateTimeType)) }],
367
+ ["coated", { name: "Coated", weekly: new SortedMap([
368
+ [new Date("2026-10-05T00:00:00Z"), 520.0], [new Date("2026-10-12T00:00:00Z"), 410.0], [new Date("2026-10-19T00:00:00Z"), 460.0], [new Date("2026-10-26T00:00:00Z"), 380.0],
369
+ ], compareFor(DateTimeType)) }],
370
+ ["uncoated", { name: "Uncoated", weekly: new SortedMap([
371
+ [new Date("2026-10-05T00:00:00Z"), 300.0], [new Date("2026-10-12T00:00:00Z"), 260.0], [new Date("2026-10-19T00:00:00Z"), 280.0], [new Date("2026-10-26T00:00:00Z"), 240.0],
372
+ ], compareFor(DateTimeType)) }],
319
373
  ])));
320
374
  /** A work centre a job passes through on its way out: the platesetter, the bindery's folder and binder, the dispatch bay. */
321
375
  export const PrintCentre = StructType({ name: StringType });
@@ -326,73 +380,95 @@ export const PrintBinding = StructType({ title: StringType, start: DateTimeType,
326
380
  /** A delivery leaving the dispatch bay. */
327
381
  export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
328
382
  /** The platesetter. A Plan never writes its resources. */
329
- export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
330
- ["ps", { name: "Platesetter" }],
331
- ]));
383
+ export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), {
384
+ initial: new Map([
385
+ ["ps", { name: "Platesetter" }],
386
+ ]),
387
+ });
332
388
  /** The bindery's two lines. */
333
- export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
334
- ["fold", { name: "Folder" }],
335
- ["bind", { name: "Binder" }],
336
- ]));
389
+ export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), {
390
+ initial: new Map([
391
+ ["fold", { name: "Folder" }],
392
+ ["bind", { name: "Binder" }],
393
+ ]),
394
+ });
337
395
  /** The dispatch bay. */
338
- export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
339
- ["bay", { name: "Dispatch bay" }],
340
- ]));
396
+ export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), {
397
+ initial: new Map([
398
+ ["bay", { name: "Dispatch bay" }],
399
+ ]),
400
+ });
341
401
  /** The plates for the catalogue covers, made on the window's first day. */
342
- export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
343
- ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
344
- ]));
345
- /** The plates' patch door. */
346
- export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
402
+ export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), {
403
+ initial: new Map([
404
+ ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
405
+ ]),
406
+ mutations: (mutation) => ({
407
+ // The plates' patch door.
408
+ patch: mutation.patch(),
409
+ }),
410
+ });
347
411
  /**
348
412
  * The jobs the links join, on the six presses. Each link's jobs sit where its
349
413
  * figure needs them: a job of two hours, which draws the narrowest bar; a job
350
414
  * running in from before the window; one that ends before it starts, and one
351
415
  * that starts after it ends; two jobs back to back on one press.
352
416
  */
353
- export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
354
- ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
355
- ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
356
- ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
357
- ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
358
- ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
359
- ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
360
- ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
361
- ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
362
- ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
363
- ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
364
- ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
365
- ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
366
- ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
367
- ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
368
- ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
369
- ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
370
- ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
371
- ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
372
- ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
373
- ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
374
- ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
375
- ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
376
- ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
377
- ]));
378
- /** The jobs' patch door. */
379
- export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
417
+ export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), {
418
+ initial: new Map([
419
+ ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
420
+ ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
421
+ ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
422
+ ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
423
+ ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
424
+ ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
425
+ ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
426
+ ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
427
+ ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
428
+ ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
429
+ ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
430
+ ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
431
+ ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
432
+ ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
433
+ ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
434
+ ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
435
+ ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
436
+ ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
437
+ ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
438
+ ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
439
+ ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
440
+ ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
441
+ ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
442
+ ]),
443
+ mutations: (mutation) => ({
444
+ // The jobs' patch door.
445
+ patch: mutation.patch(),
446
+ }),
447
+ });
380
448
  /** The bindery's jobs: two foldings of the book's sections, and two bindings. */
381
- export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
382
- ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
383
- ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
384
- ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
385
- ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
386
- ]));
387
- /** The bindery's patch door. */
388
- export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
449
+ export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), {
450
+ initial: new Map([
451
+ ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
452
+ ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
453
+ ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
454
+ ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
455
+ ]),
456
+ mutations: (mutation) => ({
457
+ // The bindery's patch door.
458
+ patch: mutation.patch(),
459
+ }),
460
+ });
389
461
  /** The deliveries: the shop posters in the third week, the bound books in the fourth. */
390
- export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
391
- ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
392
- ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
393
- ]));
394
- /** The deliveries' patch door. */
395
- export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
462
+ export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), {
463
+ initial: new Map([
464
+ ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
465
+ ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
466
+ ]),
467
+ mutations: (mutation) => ({
468
+ // The deliveries' patch door.
469
+ patch: mutation.patch(),
470
+ }),
471
+ });
396
472
  // ============================================================================
397
473
  // Jobs of the Plan's specs' own: a kind in lanes, and a resource by its case
398
474
  // ============================================================================
@@ -406,33 +482,45 @@ export const PrintLaneJob = StructType({
406
482
  status: VariantType({ fine: NullType, late: NullType }),
407
483
  });
408
484
  /** Three lane jobs in the first week: two on Press A1 in its AM and PM lanes, one late; one late on Press A2. */
409
- export const planRowsLaneJobs = e3.record("plan_rows_lane_jobs", DictType(StringType, PrintLaneJob), new Map([
410
- ["L-1", { title: "Proofs", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), press: some("a1"), lane: "pm", status: variant("fine", null) }],
411
- ["L-2", { title: "Plates", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), press: some("a1"), lane: "am", status: variant("late", null) }],
412
- ["L-3", { title: "Wash-up", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T07:00:00Z"), press: some("a2"), lane: "am", status: variant("late", null) }],
413
- ]));
414
- /** The lane jobs' patch door. */
415
- export const planRowsLaneJobsPatch = e3.mutation.patch(planRowsLaneJobs);
485
+ export const planRowsLaneJobs = e3.record("plan_rows_lane_jobs", DictType(StringType, PrintLaneJob), {
486
+ initial: new Map([
487
+ ["L-1", { title: "Proofs", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), press: some("a1"), lane: "pm", status: variant("fine", null) }],
488
+ ["L-2", { title: "Plates", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), press: some("a1"), lane: "am", status: variant("late", null) }],
489
+ ["L-3", { title: "Wash-up", start: new Date("2026-10-07T06:00:00Z"), end: new Date("2026-10-07T07:00:00Z"), press: some("a2"), lane: "am", status: variant("late", null) }],
490
+ ]),
491
+ mutations: (mutation) => ({
492
+ // The lane jobs' patch door.
493
+ patch: mutation.patch(),
494
+ }),
495
+ });
416
496
  /** A job on a press or in a bay — a resource field whose case names the kind. */
417
497
  export const PrintOnJob = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, on: VariantType({ press: StringType, bay: StringType }) });
418
498
  /** One job on Press A1, and one in Bay A1: two kinds of resource with the same key. */
419
- export const planRowsOnJobs = e3.record("plan_rows_on_jobs", DictType(StringType, PrintOnJob), new Map([
420
- ["O-1", { title: "On the press", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), on: variant("press", "a1") }],
421
- ["O-2", { title: "In the bay", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), on: variant("bay", "a1") }],
422
- ]));
423
- /** The press-or-bay jobs' patch door. */
424
- export const planRowsOnJobsPatch = e3.mutation.patch(planRowsOnJobs);
499
+ export const planRowsOnJobs = e3.record("plan_rows_on_jobs", DictType(StringType, PrintOnJob), {
500
+ initial: new Map([
501
+ ["O-1", { title: "On the press", start: new Date("2026-10-06T06:00:00Z"), end: new Date("2026-10-06T08:00:00Z"), on: variant("press", "a1") }],
502
+ ["O-2", { title: "In the bay", start: new Date("2026-10-06T09:00:00Z"), end: new Date("2026-10-06T10:00:00Z"), on: variant("bay", "a1") }],
503
+ ]),
504
+ mutations: (mutation) => ({
505
+ // The press-or-bay jobs' patch door.
506
+ patch: mutation.patch(),
507
+ }),
508
+ });
425
509
  // ============================================================================
426
510
  // The print works' finishing and dispatch records (#1200)
427
511
  // ============================================================================
428
512
  /** The parent of the shared folder and binder, held in a record like every other resource. */
429
- export const planPrintBindery = e3.record("plan_print_bindery", DictType(StringType, PrintCentre), new Map([
430
- ["bindery", { name: "Bindery" }],
431
- ]));
513
+ export const planPrintBindery = e3.record("plan_print_bindery", DictType(StringType, PrintCentre), {
514
+ initial: new Map([
515
+ ["bindery", { name: "Bindery" }],
516
+ ]),
517
+ });
432
518
  /** The vans a delivery can move onto from the dispatch bay. */
433
- export const planPrintVans = e3.record("plan_print_vans", DictType(StringType, PrintCentre), new Map([
434
- ["van1", { name: "Van 1" }], ["van2", { name: "Van 2" }],
435
- ]));
519
+ export const planPrintVans = e3.record("plan_print_vans", DictType(StringType, PrintCentre), {
520
+ initial: new Map([
521
+ ["van1", { name: "Van 1" }], ["van2", { name: "Van 2" }],
522
+ ]),
523
+ });
436
524
  /** A delivery's own status, separate from the schedule's lifecycle. */
437
525
  export const PrintDispatchStatus = VariantType({ queued: NullType, ready: NullType, dispatched: NullType });
438
526
  /** A delivery on a bay or a van: the variant preserves the resource kind when it moves. */
@@ -442,28 +530,40 @@ export const PrintDispatch = StructType({
442
530
  lane: StringType, status: PrintDispatchStatus, pallets: FloatType,
443
531
  });
444
532
  /** The print works' own plate orders, timed before its existing jobs. */
445
- export const planPrintPlates = e3.record("plan_print_plates", DictType(StringType, PrintPlates), new Map([
446
- ["P-101", { title: "Handbook plates", at: new Date("2026-10-16T14:00:00Z"), setter: "ps" }],
447
- ["P-102", { title: "Poster plates", at: new Date("2026-10-13T14:00:00Z"), setter: "ps" }],
448
- ]));
449
- /** The print works' plates commit through their own patch door. */
450
- export const planPrintPlatesPatch = e3.mutation.patch(planPrintPlates);
533
+ export const planPrintPlates = e3.record("plan_print_plates", DictType(StringType, PrintPlates), {
534
+ initial: new Map([
535
+ ["P-101", { title: "Handbook plates", at: new Date("2026-10-16T14:00:00Z"), setter: "ps" }],
536
+ ["P-102", { title: "Poster plates", at: new Date("2026-10-13T14:00:00Z"), setter: "ps" }],
537
+ ]),
538
+ mutations: (mutation) => ({
539
+ // The print works' plates commit through their own patch door.
540
+ patch: mutation.patch(),
541
+ }),
542
+ });
451
543
  /** Two foldings run in parallel, followed by binding, after the handbook leaves Press A1. */
452
- export const planPrintBindings = e3.record("plan_print_bindings", DictType(StringType, PrintBinding), new Map([
453
- ["B-101", { title: "Fold handbook sections", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), line: "fold", state: variant("confirmed", null) }],
454
- ["B-102", { title: "Fold handbook inserts", start: new Date("2026-10-20T10:00:00Z"), end: new Date("2026-10-20T16:00:00Z"), line: "fold", state: variant("confirmed", null) }],
455
- ["B-103", { title: "Bind handbooks", start: new Date("2026-10-21T06:00:00Z"), end: new Date("2026-10-21T14:00:00Z"), line: "bind", state: variant("confirmed", null) }],
456
- ]));
457
- /** The print works' bindery jobs commit through their own patch door. */
458
- export const planPrintBindingsPatch = e3.mutation.patch(planPrintBindings);
544
+ export const planPrintBindings = e3.record("plan_print_bindings", DictType(StringType, PrintBinding), {
545
+ initial: new Map([
546
+ ["B-101", { title: "Fold handbook sections", start: new Date("2026-10-20T06:00:00Z"), end: new Date("2026-10-20T14:00:00Z"), line: "fold", state: variant("confirmed", null) }],
547
+ ["B-102", { title: "Fold handbook inserts", start: new Date("2026-10-20T10:00:00Z"), end: new Date("2026-10-20T16:00:00Z"), line: "fold", state: variant("confirmed", null) }],
548
+ ["B-103", { title: "Bind handbooks", start: new Date("2026-10-21T06:00:00Z"), end: new Date("2026-10-21T14:00:00Z"), line: "bind", state: variant("confirmed", null) }],
549
+ ]),
550
+ mutations: (mutation) => ({
551
+ // The print works' bindery jobs commit through their own patch door.
552
+ patch: mutation.patch(),
553
+ }),
554
+ });
459
555
  /** Deliveries occupy AM/PM lanes and carry each of the dispatch statuses. */
460
- export const planPrintDeliveries = e3.record("plan_print_deliveries", DictType(StringType, PrintDispatch), new Map([
461
- ["D-101", { title: "Handbooks", at: new Date("2026-10-22T10:00:00Z"), location: variant("bay", "bay"), lane: "AM", status: variant("queued", null), pallets: 3.0 }],
462
- ["D-102", { title: "Event posters", at: new Date("2026-10-15T14:00:00Z"), location: variant("van", "van1"), lane: "PM", status: variant("ready", null), pallets: 2.0 }],
463
- ["D-103", { title: "Museum guides", at: new Date("2026-10-09T10:00:00Z"), location: variant("van", "van2"), lane: "AM", status: variant("dispatched", null), pallets: 1.0 }],
464
- ]));
465
- /** The print works' deliveries commit through their own patch door. */
466
- export const planPrintDeliveriesPatch = e3.mutation.patch(planPrintDeliveries);
556
+ export const planPrintDeliveries = e3.record("plan_print_deliveries", DictType(StringType, PrintDispatch), {
557
+ initial: new Map([
558
+ ["D-101", { title: "Handbooks", at: new Date("2026-10-22T10:00:00Z"), location: variant("bay", "bay"), lane: "AM", status: variant("queued", null), pallets: 3.0 }],
559
+ ["D-102", { title: "Event posters", at: new Date("2026-10-15T14:00:00Z"), location: variant("van", "van1"), lane: "PM", status: variant("ready", null), pallets: 2.0 }],
560
+ ["D-103", { title: "Museum guides", at: new Date("2026-10-09T10:00:00Z"), location: variant("van", "van2"), lane: "AM", status: variant("dispatched", null), pallets: 1.0 }],
561
+ ]),
562
+ mutations: (mutation) => ({
563
+ // The print works' deliveries commit through their own patch door.
564
+ patch: mutation.patch(),
565
+ }),
566
+ });
467
567
  // ============================================================================
468
568
  // The print works' templates, each a record of its own (#1344)
469
569
  // ============================================================================
@@ -486,49 +586,65 @@ export const PrintDeliveryTemplate = StructType({
486
586
  values: StructType({ title: StringType, lane: StringType, status: PrintDispatchStatus, pallets: FloatType }),
487
587
  });
488
588
  /** The job templates. A Plan never writes them: the library lists them, and a drop creates a job from one. */
489
- export const planPrintJobTemplates = e3.record("plan_print_job_templates", DictType(StringType, PrintJobTemplate), new Map([
490
- ["board", { name: "Board run", group: "Jobs", hours: 8.0, values: { title: "Board run", state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "", stock: variant("board", null), due: none } }],
491
- ["brochure", { name: "Brochure run", group: "Jobs", hours: 6.0, values: { title: "Brochure run", state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "", stock: variant("coated", null), due: none } }],
492
- ["catalogue", { name: "Catalogue run", group: "Jobs", hours: 12.0, values: { title: "Catalogue run", state: variant("proposed", variant("added", null)), sheets: 96000.0, customer: "", stock: variant("coated", null), due: none } }],
493
- ["poster", { name: "Poster run", group: "Jobs", hours: 4.0, values: { title: "Poster run", state: variant("proposed", variant("added", null)), sheets: 20000.0, customer: "", stock: variant("uncoated", null), due: none } }],
494
- ]));
589
+ export const planPrintJobTemplates = e3.record("plan_print_job_templates", DictType(StringType, PrintJobTemplate), {
590
+ initial: new Map([
591
+ ["board", { name: "Board run", group: "Jobs", hours: 8.0, values: { title: "Board run", state: variant("proposed", variant("added", null)), sheets: 24000.0, customer: "", stock: variant("board", null), due: none } }],
592
+ ["brochure", { name: "Brochure run", group: "Jobs", hours: 6.0, values: { title: "Brochure run", state: variant("proposed", variant("added", null)), sheets: 40000.0, customer: "", stock: variant("coated", null), due: none } }],
593
+ ["catalogue", { name: "Catalogue run", group: "Jobs", hours: 12.0, values: { title: "Catalogue run", state: variant("proposed", variant("added", null)), sheets: 96000.0, customer: "", stock: variant("coated", null), due: none } }],
594
+ ["poster", { name: "Poster run", group: "Jobs", hours: 4.0, values: { title: "Poster run", state: variant("proposed", variant("added", null)), sheets: 20000.0, customer: "", stock: variant("uncoated", null), due: none } }],
595
+ ]),
596
+ indexes: (index) => ({
597
+ plan_print_job_templates_by_group: index.on(["group"]),
598
+ }),
599
+ });
495
600
  /** The stop templates. */
496
- export const planPrintStopTemplates = e3.record("plan_print_stop_templates", DictType(StringType, PrintStopTemplate), new Map([
497
- ["plates", { name: "Plate change", group: "Stops", values: { title: "Plate change", kind: variant("plate_change", null) } }],
498
- ["service", { name: "Service", group: "Stops", values: { title: "Service", kind: variant("service", null) } }],
499
- ]));
601
+ export const planPrintStopTemplates = e3.record("plan_print_stop_templates", DictType(StringType, PrintStopTemplate), {
602
+ initial: new Map([
603
+ ["plates", { name: "Plate change", group: "Stops", values: { title: "Plate change", kind: variant("plate_change", null) } }],
604
+ ["service", { name: "Service", group: "Stops", values: { title: "Service", kind: variant("service", null) } }],
605
+ ]),
606
+ indexes: (index) => ({
607
+ plan_print_stop_templates_by_group: index.on(["group"]),
608
+ }),
609
+ });
500
610
  /** The shift templates: early, late and night. */
501
- export const planPrintShiftTemplates = e3.record("plan_print_shift_templates", DictType(StringType, PrintShiftTemplate), new Map([
502
- ["early", { name: "Early shift", group: "Shifts", hour: 6n, values: { title: "Early", state: variant("confirmed", null) } }],
503
- ["late", { name: "Late shift", group: "Shifts", hour: 14n, values: { title: "Late", state: variant("confirmed", null) } }],
504
- ["night", { name: "Night shift", group: "Shifts", hour: 22n, values: { title: "Night", state: variant("proposed", variant("added", null)) } }],
505
- ]));
611
+ export const planPrintShiftTemplates = e3.record("plan_print_shift_templates", DictType(StringType, PrintShiftTemplate), {
612
+ initial: new Map([
613
+ ["early", { name: "Early shift", group: "Shifts", hour: 6n, values: { title: "Early", state: variant("confirmed", null) } }],
614
+ ["late", { name: "Late shift", group: "Shifts", hour: 14n, values: { title: "Late", state: variant("confirmed", null) } }],
615
+ ["night", { name: "Night shift", group: "Shifts", hour: 22n, values: { title: "Night", state: variant("proposed", variant("added", null)) } }],
616
+ ]),
617
+ indexes: (index) => ({
618
+ plan_print_shift_templates_by_group: index.on(["group"]),
619
+ }),
620
+ });
506
621
  /** The plates templates. */
507
- export const planPrintPlatesTemplates = e3.record("plan_print_plates_templates", DictType(StringType, PrintPlatesTemplate), new Map([
508
- ["plates", { name: "Job plates", group: "Plate room", values: { title: "Job plates" } }],
509
- ]));
622
+ export const planPrintPlatesTemplates = e3.record("plan_print_plates_templates", DictType(StringType, PrintPlatesTemplate), {
623
+ initial: new Map([
624
+ ["plates", { name: "Job plates", group: "Plate room", values: { title: "Job plates" } }],
625
+ ]),
626
+ indexes: (index) => ({
627
+ plan_print_plates_templates_by_group: index.on(["group"]),
628
+ }),
629
+ });
510
630
  /** The bindery templates. */
511
- export const planPrintBindingTemplates = e3.record("plan_print_binding_templates", DictType(StringType, PrintBindingTemplate), new Map([
512
- ["fold", { name: "Fold sections", group: "Bindery", hours: 8.0, values: { title: "Fold sections", state: variant("confirmed", null) } }],
513
- ]));
631
+ export const planPrintBindingTemplates = e3.record("plan_print_binding_templates", DictType(StringType, PrintBindingTemplate), {
632
+ initial: new Map([
633
+ ["fold", { name: "Fold sections", group: "Bindery", hours: 8.0, values: { title: "Fold sections", state: variant("confirmed", null) } }],
634
+ ]),
635
+ indexes: (index) => ({
636
+ plan_print_binding_templates_by_group: index.on(["group"]),
637
+ }),
638
+ });
514
639
  /** The delivery templates. */
515
- export const planPrintDeliveryTemplates = e3.record("plan_print_delivery_templates", DictType(StringType, PrintDeliveryTemplate), new Map([
516
- ["delivery", { name: "Morning delivery", group: "Dispatch", hour: 10n, values: { title: "Delivery", lane: "AM", status: variant("queued", null), pallets: 1.0 } }],
517
- ]));
518
- // The rail narrows each record through its own indexes (#1344): the jobs and the shifts over their interval
519
- // indexes — on their own, and after a job's stock — so a narrowing keeps every event overlapping the window once;
520
- // the presses by hall, the customers by district, and each templates record by its group.
521
- export const planPrintJobsByTime = e3.recordIndex("plan_print_jobs_by_time", planPrintJobs, { interval: { from: "start", to: "end" } });
522
- export const planPrintJobsByStockTime = e3.recordIndex("plan_print_jobs_by_stock_time", planPrintJobs, { on: ["stock"], interval: { from: "start", to: "end" } });
523
- export const planPrintShiftsByTime = e3.recordIndex("plan_print_shifts_by_time", planPrintShifts, { interval: { from: "start", to: "end" } });
524
- export const planPrintPressesByHall = e3.recordIndex("plan_print_presses_by_hall", planPrintPresses, { on: ["hall"] });
525
- export const planPrintCustomersByDistrict = e3.recordIndex("plan_print_customers_by_district", planPrintCustomers, { on: ["district"] });
526
- export const planPrintJobTemplatesByGroup = e3.recordIndex("plan_print_job_templates_by_group", planPrintJobTemplates, { on: ["group"] });
527
- export const planPrintStopTemplatesByGroup = e3.recordIndex("plan_print_stop_templates_by_group", planPrintStopTemplates, { on: ["group"] });
528
- export const planPrintShiftTemplatesByGroup = e3.recordIndex("plan_print_shift_templates_by_group", planPrintShiftTemplates, { on: ["group"] });
529
- export const planPrintPlatesTemplatesByGroup = e3.recordIndex("plan_print_plates_templates_by_group", planPrintPlatesTemplates, { on: ["group"] });
530
- export const planPrintBindingTemplatesByGroup = e3.recordIndex("plan_print_binding_templates_by_group", planPrintBindingTemplates, { on: ["group"] });
531
- export const planPrintDeliveryTemplatesByGroup = e3.recordIndex("plan_print_delivery_templates_by_group", planPrintDeliveryTemplates, { on: ["group"] });
640
+ export const planPrintDeliveryTemplates = e3.record("plan_print_delivery_templates", DictType(StringType, PrintDeliveryTemplate), {
641
+ initial: new Map([
642
+ ["delivery", { name: "Morning delivery", group: "Dispatch", hour: 10n, values: { title: "Delivery", lane: "AM", status: variant("queued", null), pallets: 1.0 } }],
643
+ ]),
644
+ indexes: (index) => ({
645
+ plan_print_delivery_templates_by_group: index.on(["group"]),
646
+ }),
647
+ });
532
648
  // ============================================================================
533
649
  // planPrintWorks — the print works (§3.3)
534
650
  // ============================================================================
@@ -566,7 +682,7 @@ export const planPrintWorks = example({
566
682
  "Plan.library", "customers", "Schedule.patch", "inspector", "selection", "kind's own inspector", "update",
567
683
  "Record.bind", "Data.bind", "e3.record", "e3.input", "#1191", "#1195", "#1197", "#1200", "parent", "rollup", "collapsed", "meta", "value",
568
684
  "buckets", "lane", "status", "ready", "overlaps", "allow", "canDrop", "Schedule.Types.Candidate",
569
- "variant resource", "bay", "van", "Slice", "Slice.bindRecords", "sources", "Data.bindPaged", "recordIndex", "interval",
685
+ "variant resource", "bay", "van", "Slice", "Slice.bindRecords", "sources", "Data.bindPaged", "indexes", "interval",
570
686
  "window", "range", "brush", "resolution", "Schedule.templates", "templates record", "Plan.eventRef", "Plan.over", "#1344",
571
687
  ],
572
688
  description: "The print works from plates to dispatch — jobs, stops and shifts on grouped presses and crews, nested bindery resources, deliveries in AM/PM lanes on a bay or a van, status and readiness, links between event kinds, utilisation and paper stock; one Slice.bindRecords rail — the jobs and the shifts through their interval indexes, their range the one window, the presses, the customers and each kind's templates record — and the shared library, inspector and Save session",
@@ -576,9 +692,9 @@ export const planPrintWorks = example({
576
692
  // pages alone.
577
693
  const presses = $.let(Data.bind(planPrintPresses));
578
694
  const crews = $.let(Record.bind(planPrintCrews, []));
579
- const jobs = $.let(Record.bind(planPrintJobs, [planPrintJobsPatch]));
580
- const stops = $.let(Record.bind(planPrintStops, [planPrintStopsPatch]));
581
- const shifts = $.let(Record.bind(planPrintShifts, [planPrintShiftsPatch]));
695
+ const jobs = $.let(Record.bind(planPrintJobs));
696
+ const stops = $.let(Record.bind(planPrintStops));
697
+ const shifts = $.let(Record.bind(planPrintShifts));
582
698
  const customers = $.let(Data.bind(planPrintCustomers));
583
699
  const jobTemplates = $.let(Data.bind(planPrintJobTemplates));
584
700
  const stopTemplates = $.let(Data.bind(planPrintStopTemplates));
@@ -590,25 +706,25 @@ export const planPrintWorks = example({
590
706
  // indexes, their range the one window the toolbar's dates, the resolution and the brush write; the
591
707
  // presses, the customers and each templates record by its fields.
592
708
  const slice = $.let(Slice.bindRecords("ex.planPrintWorks", {
593
- job: { source: Data.bindPaged(planPrintJobs, { indexes: [planPrintJobsByTime, planPrintJobsByStockTime] }), icon: { prefix: "fas", name: "file-lines" },
709
+ job: { source: Data.bindPaged(planPrintJobs, { indexes: ["plan_print_jobs_by_time", "plan_print_jobs_by_stock_time"] }), icon: { prefix: "fas", name: "file-lines" },
594
710
  fields: { stock: { label: "Stock" }, start: { label: "Dates" } }, range: "start" },
595
- shift: { source: Data.bindPaged(planPrintShifts, { indexes: [planPrintShiftsByTime] }), icon: { prefix: "fas", name: "user-clock" },
711
+ shift: { source: Data.bindPaged(planPrintShifts, { indexes: ["plan_print_shifts_by_time"] }), icon: { prefix: "fas", name: "user-clock" },
596
712
  fields: { start: { label: "Dates" } }, range: "start" },
597
- presses: { source: Data.bindPaged(planPrintPresses, { indexes: [planPrintPressesByHall] }), icon: { prefix: "fas", name: "print" },
713
+ presses: { source: Data.bindPaged(planPrintPresses, { indexes: ["plan_print_presses_by_hall"] }), icon: { prefix: "fas", name: "print" },
598
714
  fields: { hall: { label: "Hall", hints: ["Hall A", "Hall B"] } } },
599
- customers: { source: Data.bindPaged(planPrintCustomers, { indexes: [planPrintCustomersByDistrict] }), icon: { prefix: "fas", name: "building" },
715
+ customers: { source: Data.bindPaged(planPrintCustomers, { indexes: ["plan_print_customers_by_district"] }), icon: { prefix: "fas", name: "building" },
600
716
  fields: { district: { label: "District", hints: ["North Quay", "Old Town", "Riverside"] } } },
601
- jobTemplates: { source: Data.bindPaged(planPrintJobTemplates, { indexes: [planPrintJobTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
717
+ jobTemplates: { source: Data.bindPaged(planPrintJobTemplates, { indexes: ["plan_print_job_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
602
718
  fields: { group: { label: "Job templates", hints: ["Jobs"] } } },
603
- stopTemplates: { source: Data.bindPaged(planPrintStopTemplates, { indexes: [planPrintStopTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
719
+ stopTemplates: { source: Data.bindPaged(planPrintStopTemplates, { indexes: ["plan_print_stop_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
604
720
  fields: { group: { label: "Stop templates", hints: ["Stops"] } } },
605
- shiftTemplates: { source: Data.bindPaged(planPrintShiftTemplates, { indexes: [planPrintShiftTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
721
+ shiftTemplates: { source: Data.bindPaged(planPrintShiftTemplates, { indexes: ["plan_print_shift_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
606
722
  fields: { group: { label: "Shift templates", hints: ["Shifts"] } } },
607
- platesTemplates: { source: Data.bindPaged(planPrintPlatesTemplates, { indexes: [planPrintPlatesTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
723
+ platesTemplates: { source: Data.bindPaged(planPrintPlatesTemplates, { indexes: ["plan_print_plates_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
608
724
  fields: { group: { label: "Plates templates", hints: ["Plate room"] } } },
609
- bindingTemplates: { source: Data.bindPaged(planPrintBindingTemplates, { indexes: [planPrintBindingTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
725
+ bindingTemplates: { source: Data.bindPaged(planPrintBindingTemplates, { indexes: ["plan_print_binding_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
610
726
  fields: { group: { label: "Bindery templates", hints: ["Bindery"] } } },
611
- deliveryTemplates: { source: Data.bindPaged(planPrintDeliveryTemplates, { indexes: [planPrintDeliveryTemplatesByGroup] }), icon: { prefix: "fas", name: "layer-group" },
727
+ deliveryTemplates: { source: Data.bindPaged(planPrintDeliveryTemplates, { indexes: ["plan_print_delivery_templates_by_group"] }), icon: { prefix: "fas", name: "layer-group" },
612
728
  fields: { group: { label: "Delivery templates", hints: ["Dispatch"] } } },
613
729
  }));
614
730
  // A kind narrowed through its source reads one event by its key through the record's own entries.
@@ -619,9 +735,9 @@ export const planPrintWorks = example({
619
735
  const bindery = $.let(Record.bind(planPrintBindery, []));
620
736
  const bays = $.let(Record.bind(planLinkBays, []));
621
737
  const vans = $.let(Record.bind(planPrintVans, []));
622
- const plates = $.let(Record.bind(planPrintPlates, [planPrintPlatesPatch]));
623
- const bindings = $.let(Record.bind(planPrintBindings, [planPrintBindingsPatch]));
624
- const deliveries = $.let(Record.bind(planPrintDeliveries, [planPrintDeliveriesPatch]));
738
+ const plates = $.let(Record.bind(planPrintPlates));
739
+ const bindings = $.let(Record.bind(planPrintBindings));
740
+ const deliveries = $.let(Record.bind(planPrintDeliveries));
625
741
  const stock = $.let(Data.bind(planLinkStock));
626
742
  const lineRows = $.const(lines.read().union(bindery.read(), (_$2, line) => line));
627
743
  const util = $.let(Data.bind(planPrintUtilisation));
@@ -642,8 +758,6 @@ export const planPrintWorks = example({
642
758
  window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
643
759
  resolution: "day", resolutions: ["week", "day"], now: new Date("2026-10-14T09:00:00Z"),
644
760
  }));
645
- const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
646
- const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
647
761
  const canDrop = $.const(East.function([Schedule.Types.Candidate], OptionType(StringType), ($2, candidate) => {
648
762
  const reason = $2.let(none, OptionType(StringType));
649
763
  $2.match(candidate.resource, { some: ($3, resource) => {
@@ -757,7 +871,7 @@ export const planPrintWorks = example({
757
871
  }),
758
872
  Plan.over(stock, [Plan.series.table(PrintStock, {
759
873
  key: "stock", title: "Paper stock", label: s => s.name,
760
- cells: s => Plan.tableCells(weekly(s.weekly)), format: Format.Number({ maximumFractionDigits: 0n }),
874
+ cells: Plan.tableCells(Plan.values("weekly", (level) => ({ value: level }))), format: Format.Number({ maximumFractionDigits: 0n }),
761
875
  })]),
762
876
  ], links: [
763
877
  Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-101"), to: Plan.eventRef("job", "J-1004") }),
@@ -835,15 +949,11 @@ export const planEventLinks = example({
835
949
  const presses = $.let(Record.bind(planPrintPresses, []));
836
950
  const lines = $.let(Record.bind(planLinkLines, []));
837
951
  const bays = $.let(Record.bind(planLinkBays, []));
838
- const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
839
- const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
840
- const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
841
- const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
952
+ const plates = $.let(Record.bind(planLinkPlates));
953
+ const jobs = $.let(Record.bind(planLinkCaseJobs));
954
+ const bindings = $.let(Record.bind(planLinkBindings));
955
+ const deliveries = $.let(Record.bind(planLinkDeliveries));
842
956
  const stock = $.let(Data.bind(planLinkStock));
843
- // The window's first Monday: each stock reading runs from it, a week apiece.
844
- const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
845
- const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
846
- const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) => East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
847
957
  const axis = $.let(Plan.axis({
848
958
  window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
849
959
  resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
@@ -881,7 +991,7 @@ export const planEventLinks = example({
881
991
  Plan.over(stock, [
882
992
  Plan.series.table(PrintStock, {
883
993
  key: "stock", title: "Paper stock", label: s => s.name,
884
- cells: s => Plan.tableCells(weekly(s.weekly)),
994
+ cells: Plan.tableCells(Plan.values("weekly", (level) => ({ value: level }))),
885
995
  format: Format.Number({ maximumFractionDigits: 0n }),
886
996
  }),
887
997
  ]),
@@ -910,4 +1020,67 @@ export const planEventLinks = example({
910
1020
  } }))),
911
1021
  inputs: [],
912
1022
  });
1023
+ /** The jobs the conflicts example edits, in a record of their own, so no other example's edits meet them. */
1024
+ export const planConflictJobs = e3.record("plan_conflict_jobs", DictType(StringType, PrintJob), {
1025
+ initial: new Map([
1026
+ ["J-3001", { title: "Spring catalogue", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Alder & Finch", stock: variant("coated", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
1027
+ ["J-3002", { title: "Course handbook", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-12T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Elmway College", stock: variant("uncoated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
1028
+ ["J-3003", { title: "Annual report", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T12:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 60000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-10T00:00:00Z")) }],
1029
+ ["J-3005", { title: "Store flyers", start: some(new Date("2026-10-09T06:00:00Z")), end: some(new Date("2026-10-09T16:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 150000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-12T00:00:00Z")) }],
1030
+ ["J-3006", { title: "Market posters", start: some(new Date("2026-10-13T06:00:00Z")), end: some(new Date("2026-10-13T12:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Orchard Street Market", stock: variant("coated", null), due: some(new Date("2026-10-15T00:00:00Z")) }],
1031
+ ]),
1032
+ mutations: (mutation) => ({
1033
+ // The jobs' patch door — every Save commits through it.
1034
+ patch: mutation.patch(),
1035
+ // Someone else's save: every job a day later, its press and its other fields as they were.
1036
+ elsewhere: mutation.reduce(East.function([DictType(StringType, PrintJob)], DictType(StringType, PrintJob), (_$, jobs) => jobs.map((_$2, job) => ({
1037
+ title: job.title,
1038
+ start: job.start.match({
1039
+ some: (_$3, at) => East.value(some(at.addDays(1n)), OptionType(DateTimeType)),
1040
+ none: (_$3) => East.value(none, OptionType(DateTimeType)),
1041
+ }),
1042
+ end: job.end.match({
1043
+ some: (_$3, at) => East.value(some(at.addDays(1n)), OptionType(DateTimeType)),
1044
+ none: (_$3) => East.value(none, OptionType(DateTimeType)),
1045
+ }),
1046
+ press: job.press, state: job.state, sheets: job.sheets, customer: job.customer, stock: job.stock, due: job.due,
1047
+ })))),
1048
+ }),
1049
+ });
1050
+ /**
1051
+ * Your edits meeting someone else's save, in one window: edit, then press
1052
+ * Someone else saves, which saves another person's change to the same jobs —
1053
+ * every job a day later. A bar you moved or resized too is a conflict, its
1054
+ * dates one card to choose; a customer or stock you changed in the panel
1055
+ * combines with theirs. Each press saves their change again.
1056
+ */
1057
+ export const planConflicts = example({
1058
+ keywords: ["Plan", "conflict", "conflicts", "combine", "someone else", "Choose", "dates", "bars", "Schedule.events", "Record.bind", "mutate", "Button", "inspector", "Save"],
1059
+ description: "Your edits meeting someone else's save, in one window — move or resize a job's bar, then press Someone else saves, which saves another person's change to the same jobs (every job a day later), so yours conflict, its dates one card to choose; a customer or stock you change in the panel combines with theirs",
1060
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1061
+ const presses = $.let(Record.bind(planPrintPresses, []));
1062
+ const jobs = $.let(Record.bind(planConflictJobs, ["patch"]));
1063
+ const others = $.let(Record.bind(planConflictJobs, ["elsewhere"]));
1064
+ const theirs = $.const(East.function([], NullType, ($) => { $(others.mutate.elsewhere()); }));
1065
+ const axis = $.let(Plan.axis({
1066
+ window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-10-19T00:00:00Z") },
1067
+ resolution: "day", now: new Date("2026-10-07T09:00:00Z"),
1068
+ }));
1069
+ return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsxs(HStack, { gap: "3", children: [_jsx(Button, { variant: "outline", onClick: theirs, loading: others.mutate.pending(), children: "Someone else saves" }), _jsx(Text, { color: "fg.muted", children: "Their change: every job a day later" })] }), _jsx(Box, { height: "560px", children: _jsx(Plan, { id: "conflicts", axis: axis, resources: {
1070
+ presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name }),
1071
+ }, events: {
1072
+ job: Schedule.events(jobs, {
1073
+ name: "Print job", icon: "file-lines",
1074
+ title: "title", start: "start", end: "end",
1075
+ resource: { field: "press", of: "presses" },
1076
+ state: "state",
1077
+ fields: {
1078
+ customer: Schedule.field.text({ label: "Customer" }),
1079
+ stock: Schedule.field.select({ labels: { coated: "Coated", uncoated: "Uncoated", board: "Board" } }),
1080
+ },
1081
+ }),
1082
+ }, inspector: true }) })] }));
1083
+ } }))),
1084
+ inputs: [],
1085
+ });
913
1086
  //# sourceMappingURL=plan-events.examples.js.map