create-pmos 0.398.0 → 0.400.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/package.json +30 -25
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +19 -15
  7. package/workspace/briefing-premium-board-test.js +82 -50
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +8 -10
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +48 -43
  18. package/workspace/briefing-premium-work-test.js +16 -11
  19. package/workspace/c3-capture-test.js +0 -17
  20. package/workspace/changelog.json +29 -0
  21. package/workspace/ev-everywhere-test.js +210 -0
  22. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  23. package/workspace/guide/briefing-premium.md +2 -2
  24. package/workspace/guide/home.md +58 -19
  25. package/workspace/guide/index.md +1 -1
  26. package/workspace/guide/layout.md +2 -2
  27. package/workspace/guide/notes.md +2 -2
  28. package/workspace/guide/phone-companion.md +1 -1
  29. package/workspace/lib/board-grill.js +63 -0
  30. package/workspace/lib/board-premium.js +36 -5
  31. package/workspace/lib/initiative-layout.js +77 -0
  32. package/workspace/lib/insights-premium.js +3 -2
  33. package/workspace/lib/insights-records.js +21 -7
  34. package/workspace/lib/meeting-points.js +52 -0
  35. package/workspace/lib/news-for-you.js +88 -0
  36. package/workspace/lib/notes-series.js +29 -6
  37. package/workspace/lib/report-confirm.js +48 -0
  38. package/workspace/lib/route-modules.js +9 -9
  39. package/workspace/lib/routes-board-docs.js +46 -0
  40. package/workspace/lib/routes-board-grill.js +90 -0
  41. package/workspace/lib/routes-home-review.js +108 -0
  42. package/workspace/lib/routes-initiative-layout.js +57 -0
  43. package/workspace/lib/routes-insights-premium.js +4 -1
  44. package/workspace/lib/routes-insights-records.js +8 -4
  45. package/workspace/lib/routes-meeting-points.js +37 -0
  46. package/workspace/lib/routes-news.js +57 -0
  47. package/workspace/lib/routes-notes.js +2 -1
  48. package/workspace/lib/routes-phone-day.js +18 -9
  49. package/workspace/lib/routes-report-confirm.js +31 -0
  50. package/workspace/lib/routes-search.js +38 -0
  51. package/workspace/lib/routes-slash.js +95 -0
  52. package/workspace/lib/search-index.js +176 -0
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -2
  55. package/workspace/premium-board-actions-test.js +86 -50
  56. package/workspace/premium-briefing-depth-test.js +55 -54
  57. package/workspace/premium-chat-chart-tab-test.js +4 -2
  58. package/workspace/premium-chat-goal-view-test.js +1 -1
  59. package/workspace/premium-chat-report-tab-test.js +16 -2
  60. package/workspace/premium-chat-term-test.js +0 -10
  61. package/workspace/premium-core-doc-issue-test.js +15 -13
  62. package/workspace/premium-menu-rows-test.js +1 -1
  63. package/workspace/premium-phone-card-test.js +7 -5
  64. package/workspace/premium-report-read-test.js +55 -18
  65. package/workspace/premium-vw-backlog-test.js +2 -2
  66. package/workspace/premium-vw-cal-test.js +50 -35
  67. package/workspace/premium-vw-doc-test.js +10 -11
  68. package/workspace/premium-vw-item-test.js +1 -1
  69. package/workspace/premium-vw-jira-test.js +2 -2
  70. package/workspace/premium-vw-meet-test.js +37 -40
  71. package/workspace/premium-vw-notes-test.js +21 -19
  72. package/workspace/premium-vw-rec-test.js +11 -12
  73. package/workspace/premium-welcome-test.js +3 -3
  74. package/workspace/premium-work-depth-test.js +5 -6
  75. package/workspace/public/capture.html +23 -0
  76. package/workspace/public/pm/bd-acts.js +303 -225
  77. package/workspace/public/pm/bd-asks.js +261 -0
  78. package/workspace/public/pm/bd-pop.js +59 -0
  79. package/workspace/public/pm/bd-span.js +49 -13
  80. package/workspace/public/pm/bd-views.js +169 -0
  81. package/workspace/public/pm/c3-base.js +47 -0
  82. package/workspace/public/pm/c3-capture.js +1 -1
  83. package/workspace/public/pm/c3-ini-ui.js +1 -1
  84. package/workspace/public/pm/c3-sheet.js +1 -1
  85. package/workspace/public/pm/c3-toast.js +1 -1
  86. package/workspace/public/pm/console3.css +3 -0
  87. package/workspace/public/pm/cozy-board.css +301 -0
  88. package/workspace/public/pm/cozy-ev.css +228 -0
  89. package/workspace/public/pm/cozy-evmodel.js +106 -0
  90. package/workspace/public/pm/cozy-evui.js +47 -0
  91. package/workspace/public/pm/cozy-home.css +20 -5
  92. package/workspace/public/pm/cozy-insights.css +148 -10
  93. package/workspace/public/pm/cozy-nav.js +103 -39
  94. package/workspace/public/pm/cozy-news.js +140 -0
  95. package/workspace/public/pm/cozy-search.js +203 -0
  96. package/workspace/public/pm/cozy-settings.js +198 -0
  97. package/workspace/public/pm/cozy-sources.js +89 -0
  98. package/workspace/public/pm/cozy-today.css +220 -0
  99. package/workspace/public/pm/cozy-viewer.js +5 -2
  100. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  101. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  102. package/workspace/public/pm/cozy.css +9 -0
  103. package/workspace/public/pm/goal-chat.js +5 -1
  104. package/workspace/public/pm/home-adddoc.js +5 -5
  105. package/workspace/public/pm/home-app.js +365 -70
  106. package/workspace/public/pm/home-around.js +24 -126
  107. package/workspace/public/pm/home-chat.js +77 -18
  108. package/workspace/public/pm/home-data.js +9 -7
  109. package/workspace/public/pm/home-dictate.js +57 -0
  110. package/workspace/public/pm/home-draft.js +6 -6
  111. package/workspace/public/pm/home-ini-model.js +190 -0
  112. package/workspace/public/pm/home-ini.css +171 -0
  113. package/workspace/public/pm/home-ini.js +466 -0
  114. package/workspace/public/pm/home-list.js +289 -0
  115. package/workspace/public/pm/home-more.js +18 -135
  116. package/workspace/public/pm/home-phone-card.js +13 -8
  117. package/workspace/public/pm/home-review.js +103 -0
  118. package/workspace/public/pm/home-task.js +67 -0
  119. package/workspace/public/pm/home-today.js +148 -0
  120. package/workspace/public/pm/home-work.js +63 -28
  121. package/workspace/public/pm/note-dock.js +1 -2
  122. package/workspace/public/pm/notes-links.js +1 -2
  123. package/workspace/public/pm/notes-task.js +3 -4
  124. package/workspace/public/pm/premium-board.js +164 -40
  125. package/workspace/public/pm/premium-chart-tab.js +4 -5
  126. package/workspace/public/pm/premium-first.js +5 -7
  127. package/workspace/public/pm/premium-initiative-head.js +3 -3
  128. package/workspace/public/pm/premium-insights.js +499 -202
  129. package/workspace/public/pm/premium-mtg-present.js +138 -0
  130. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  131. package/workspace/public/pm/premium-report-read.js +216 -52
  132. package/workspace/public/pm/premium-report-tab.js +44 -19
  133. package/workspace/public/pm/premium-shell.js +7 -7
  134. package/workspace/public/pm/premium-vw-cal.js +150 -60
  135. package/workspace/public/pm/premium-vw-doc.css +20 -2
  136. package/workspace/public/pm/premium-vw-doc.js +22 -7
  137. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  138. package/workspace/public/pm/premium-vw-notes.js +61 -0
  139. package/workspace/public/pm/rp-parts.js +269 -0
  140. package/workspace/public/pm/view-notes.js +2 -2
  141. package/workspace/public/premium-board.html +4 -3
  142. package/workspace/public/premium-insights.html +10 -10
  143. package/workspace/public/premium.html +3 -1
  144. package/workspace/r/m1.png +0 -0
  145. package/workspace/r/m2.png +0 -0
  146. package/workspace/r/m3.png +0 -0
  147. package/workspace/r/nl.png +0 -0
  148. package/workspace/replaced-tests.json +435 -0
  149. package/workspace/run-tests.js +323 -28
  150. package/workspace/server.js +15 -10
  151. package/workspace/test-files.json +3 -140
  152. package/workspace/test-lists/base.json +1 -2
  153. package/workspace/test-lists/c3-desktop-light-load.json +1 -2
  154. package/workspace/test-lists/c3-initiative-boards.json +1 -2
  155. package/workspace/test-lists/c3-meeting-focus.json +2 -12
  156. package/workspace/test-lists/c3-work-agent.json +1 -2
  157. package/workspace/test-lists/calendar-tidy-up.json +1 -2
  158. package/workspace/test-lists/console3-reports.json +1 -2
  159. package/workspace/test-lists/docs-three-way-sync.json +1 -2
  160. package/workspace/test-lists/extension-capture.json +5 -0
  161. package/workspace/test-lists/initiative-layout.json +9 -0
  162. package/workspace/test-lists/jira-wbs.json +1 -2
  163. package/workspace/test-lists/legacy-cleanup-a.json +9 -0
  164. package/workspace/test-lists/meeting-material.json +1 -2
  165. package/workspace/test-lists/meeting-notes.json +2 -36
  166. package/workspace/test-lists/meeting-replay.json +1 -2
  167. package/workspace/test-lists/mm-capture.json +2 -12
  168. package/workspace/test-lists/my-work.json +2 -10
  169. package/workspace/test-lists/onboarding-firstrun.json +2 -12
  170. package/workspace/test-lists/people-directory.json +1 -2
  171. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  172. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  173. package/workspace/test-lists/run2-a.json +1 -2
  174. package/workspace/test-lists/run2-d.json +2 -19
  175. package/workspace/test-lists/run3-b.json +1 -2
  176. package/workspace/test-lists/run3-c.json +2 -12
  177. package/workspace/test-lists/run4-b.json +1 -2
  178. package/workspace/test-lists/run4-d.json +1 -5
  179. package/workspace/test-lists/run5-c.json +1 -11
  180. package/workspace/test-lists/run6.json +1 -5
  181. package/workspace/test-lists/uf-everywhere.json +15 -0
  182. package/workspace/test-lists/uf-home.json +9 -0
  183. package/workspace/test-lists/uncovered-board.json +9 -0
  184. package/workspace/test-lists/workspace-launch-flags.json +2 -12
  185. package/workspace/test-lists/workspace-profile-detection.json +2 -10
  186. package/workspace/test-timings.json +242 -123
  187. package/workspace/c3-briefing-test.js +0 -136
  188. package/workspace/c3-core-docs-test.js +0 -170
  189. package/workspace/c3-driver-fixture.js +0 -64
  190. package/workspace/c3-driver-test.js +0 -169
  191. package/workspace/c3-foundation-test.js +0 -163
  192. package/workspace/c3-ib-items-test.js +0 -114
  193. package/workspace/c3-ib-more-test.js +0 -146
  194. package/workspace/c3-ib-triage-backlog-test.js +0 -128
  195. package/workspace/c3-ini-harness.js +0 -66
  196. package/workspace/c3-ini-life-test.js +0 -167
  197. package/workspace/c3-initiatives-test.js +0 -186
  198. package/workspace/c3-light-load-test.js +0 -112
  199. package/workspace/c3-one-home-test.js +0 -149
  200. package/workspace/c3-phone-test.js +0 -289
  201. package/workspace/c3-quiet-test.js +0 -157
  202. package/workspace/c3-report-design-real-test.js +0 -264
  203. package/workspace/c3-report-design-test.js +0 -442
  204. package/workspace/c3-report-setup-test.js +0 -192
  205. package/workspace/c3-report-structure-real-test.js +0 -248
  206. package/workspace/c3-report-structure-test.js +0 -397
  207. package/workspace/c3-reports-test.js +0 -288
  208. package/workspace/c3-scan-test.js +0 -517
  209. package/workspace/c3-sessions-panel-test.js +0 -365
  210. package/workspace/c3-settings-test.js +0 -204
  211. package/workspace/c3-updates-test.js +0 -131
  212. package/workspace/c3-work-test.js +0 -260
  213. package/workspace/cut-stub.js +0 -40
  214. package/workspace/first-paint-audit.js +0 -160
  215. package/workspace/lib/c3-full-console.js +0 -15
  216. package/workspace/lib/engine/derived/trust.js +0 -3
  217. package/workspace/lib/engine/plan-forecast.js +0 -342
  218. package/workspace/lib/engine/report-families.js +0 -175
  219. package/workspace/lib/engine/truth-table.js +0 -57
  220. package/workspace/lib/routes-c3-init.js +0 -54
  221. package/workspace/lib/routes-c3-life.js +0 -120
  222. package/workspace/lib/routes-c3-timeline.js +0 -192
  223. package/workspace/lib/routes-forecast.js +0 -86
  224. package/workspace/lib/routes-releases.js +0 -130
  225. package/workspace/lib/routes-report-facts.js +0 -85
  226. package/workspace/lib/routes-report-families.js +0 -33
  227. package/workspace/lib/routes-signals.js +0 -51
  228. package/workspace/lib/routes-timeline.js +0 -197
  229. package/workspace/public/c3.html +0 -35
  230. package/workspace/public/index.html +0 -156
  231. package/workspace/public/pm/app.js +0 -831
  232. package/workspace/public/pm/bd-board.js +0 -159
  233. package/workspace/public/pm/bd-drag.js +0 -59
  234. package/workspace/public/pm/bd-model.js +0 -152
  235. package/workspace/public/pm/bd-timeline.js +0 -233
  236. package/workspace/public/pm/bd-tree.js +0 -244
  237. package/workspace/public/pm/board-copy.js +0 -59
  238. package/workspace/public/pm/board-read.js +0 -38
  239. package/workspace/public/pm/branches-sheet.js +0 -56
  240. package/workspace/public/pm/breakdown-api.js +0 -58
  241. package/workspace/public/pm/breakdown-copy.js +0 -138
  242. package/workspace/public/pm/briefing-deck.js +0 -441
  243. package/workspace/public/pm/briefing-model.js +0 -251
  244. package/workspace/public/pm/c3-ambient.js +0 -100
  245. package/workspace/public/pm/c3-audience-link.js +0 -21
  246. package/workspace/public/pm/c3-audience.js +0 -46
  247. package/workspace/public/pm/c3-boot.js +0 -13
  248. package/workspace/public/pm/c3-breakdown.js +0 -240
  249. package/workspace/public/pm/c3-brief-data.js +0 -11
  250. package/workspace/public/pm/c3-brief-mentions.js +0 -137
  251. package/workspace/public/pm/c3-brief-needs.js +0 -288
  252. package/workspace/public/pm/c3-brief-pulse.js +0 -112
  253. package/workspace/public/pm/c3-brief-summary.js +0 -139
  254. package/workspace/public/pm/c3-brief-today.js +0 -79
  255. package/workspace/public/pm/c3-brief.js +0 -279
  256. package/workspace/public/pm/c3-cal-strategy.js +0 -529
  257. package/workspace/public/pm/c3-calendar.js +0 -965
  258. package/workspace/public/pm/c3-calpop.js +0 -111
  259. package/workspace/public/pm/c3-case.js +0 -196
  260. package/workspace/public/pm/c3-core-docs.css +0 -18
  261. package/workspace/public/pm/c3-core-docs.js +0 -236
  262. package/workspace/public/pm/c3-daypart.js +0 -176
  263. package/workspace/public/pm/c3-demo-boards.js +0 -764
  264. package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
  265. package/workspace/public/pm/c3-demo-brief-page.js +0 -70
  266. package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
  267. package/workspace/public/pm/c3-demo-cal2.js +0 -66
  268. package/workspace/public/pm/c3-demo-cal3.js +0 -173
  269. package/workspace/public/pm/c3-demo-cal4.js +0 -169
  270. package/workspace/public/pm/c3-demo-cal5.js +0 -52
  271. package/workspace/public/pm/c3-demo-coredocs.js +0 -221
  272. package/workspace/public/pm/c3-demo-data.js +0 -552
  273. package/workspace/public/pm/c3-demo-focus.js +0 -181
  274. package/workspace/public/pm/c3-demo-init.js +0 -430
  275. package/workspace/public/pm/c3-demo-life.js +0 -77
  276. package/workspace/public/pm/c3-demo-material.js +0 -58
  277. package/workspace/public/pm/c3-demo-misc2.js +0 -34
  278. package/workspace/public/pm/c3-demo-phone.js +0 -48
  279. package/workspace/public/pm/c3-demo-plan2.js +0 -30
  280. package/workspace/public/pm/c3-demo-rd.js +0 -432
  281. package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
  282. package/workspace/public/pm/c3-demo-rep2.js +0 -130
  283. package/workspace/public/pm/c3-demo-rep3.js +0 -138
  284. package/workspace/public/pm/c3-demo-rs.js +0 -287
  285. package/workspace/public/pm/c3-demo-term.js +0 -153
  286. package/workspace/public/pm/c3-demo-time.js +0 -49
  287. package/workspace/public/pm/c3-demo-work-ix.js +0 -32
  288. package/workspace/public/pm/c3-demo.js +0 -131
  289. package/workspace/public/pm/c3-design-studio.js +0 -369
  290. package/workspace/public/pm/c3-doc-formats.js +0 -153
  291. package/workspace/public/pm/c3-doc-sheet.js +0 -1230
  292. package/workspace/public/pm/c3-dock.js +0 -206
  293. package/workspace/public/pm/c3-docs.js +0 -291
  294. package/workspace/public/pm/c3-driver-work.js +0 -110
  295. package/workspace/public/pm/c3-driver.css +0 -18
  296. package/workspace/public/pm/c3-driver.js +0 -298
  297. package/workspace/public/pm/c3-focus.css +0 -304
  298. package/workspace/public/pm/c3-focus.js +0 -983
  299. package/workspace/public/pm/c3-ib-docs.js +0 -92
  300. package/workspace/public/pm/c3-ib-initiatives.js +0 -201
  301. package/workspace/public/pm/c3-ib-items.js +0 -210
  302. package/workspace/public/pm/c3-ib-releases.js +0 -48
  303. package/workspace/public/pm/c3-ib-sprints.js +0 -201
  304. package/workspace/public/pm/c3-ib-triage.js +0 -177
  305. package/workspace/public/pm/c3-ii-tabs.js +0 -252
  306. package/workspace/public/pm/c3-ini-life.css +0 -34
  307. package/workspace/public/pm/c3-ini-life.js +0 -379
  308. package/workspace/public/pm/c3-ini-records.js +0 -197
  309. package/workspace/public/pm/c3-ini-timeline.js +0 -278
  310. package/workspace/public/pm/c3-ini-work.js +0 -139
  311. package/workspace/public/pm/c3-init-extras.js +0 -170
  312. package/workspace/public/pm/c3-initiatives.js +0 -852
  313. package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
  314. package/workspace/public/pm/c3-look.js +0 -27
  315. package/workspace/public/pm/c3-material.css +0 -22
  316. package/workspace/public/pm/c3-material.js +0 -321
  317. package/workspace/public/pm/c3-md.js +0 -3
  318. package/workspace/public/pm/c3-misc-panels.js +0 -89
  319. package/workspace/public/pm/c3-new-session.js +0 -110
  320. package/workspace/public/pm/c3-notes.js +0 -751
  321. package/workspace/public/pm/c3-phone-boot.js +0 -47
  322. package/workspace/public/pm/c3-phone-detail.js +0 -97
  323. package/workspace/public/pm/c3-phone-model.js +0 -3
  324. package/workspace/public/pm/c3-phone.css +0 -66
  325. package/workspace/public/pm/c3-phone.js +0 -444
  326. package/workspace/public/pm/c3-plan-panels.js +0 -163
  327. package/workspace/public/pm/c3-plan.js +0 -193
  328. package/workspace/public/pm/c3-quiet.css +0 -113
  329. package/workspace/public/pm/c3-quiet.js +0 -177
  330. package/workspace/public/pm/c3-replay.css +0 -133
  331. package/workspace/public/pm/c3-replay.js +0 -429
  332. package/workspace/public/pm/c3-report-deck.css +0 -163
  333. package/workspace/public/pm/c3-report-deck.js +0 -598
  334. package/workspace/public/pm/c3-report-frame.css +0 -20
  335. package/workspace/public/pm/c3-report-print.css +0 -20
  336. package/workspace/public/pm/c3-report-setup.css +0 -67
  337. package/workspace/public/pm/c3-report-setup.js +0 -298
  338. package/workspace/public/pm/c3-report-store.js +0 -244
  339. package/workspace/public/pm/c3-report-structure.css +0 -44
  340. package/workspace/public/pm/c3-report-structure.js +0 -473
  341. package/workspace/public/pm/c3-reports.css +0 -68
  342. package/workspace/public/pm/c3-reports.js +0 -377
  343. package/workspace/public/pm/c3-roadmap.js +0 -249
  344. package/workspace/public/pm/c3-scan-api.js +0 -167
  345. package/workspace/public/pm/c3-scan-next.js +0 -248
  346. package/workspace/public/pm/c3-scan-setup.js +0 -313
  347. package/workspace/public/pm/c3-scan-words.js +0 -41
  348. package/workspace/public/pm/c3-scan.css +0 -74
  349. package/workspace/public/pm/c3-scan.js +0 -93
  350. package/workspace/public/pm/c3-session-chat.js +0 -103
  351. package/workspace/public/pm/c3-session-conv.js +0 -165
  352. package/workspace/public/pm/c3-session-term.js +0 -216
  353. package/workspace/public/pm/c3-settings.css +0 -85
  354. package/workspace/public/pm/c3-settings.js +0 -1045
  355. package/workspace/public/pm/c3-shell.js +0 -628
  356. package/workspace/public/pm/c3-signals.js +0 -196
  357. package/workspace/public/pm/c3-strategy-panels.js +0 -45
  358. package/workspace/public/pm/c3-swipe.js +0 -230
  359. package/workspace/public/pm/c3-terminal-data.js +0 -48
  360. package/workspace/public/pm/c3-terminal-edge.js +0 -91
  361. package/workspace/public/pm/c3-terminal-icons.js +0 -40
  362. package/workspace/public/pm/c3-terminal-results.js +0 -141
  363. package/workspace/public/pm/c3-terminal.js +0 -52
  364. package/workspace/public/pm/c3-tickets.js +0 -163
  365. package/workspace/public/pm/c3-timeline.js +0 -201
  366. package/workspace/public/pm/calendar-views.js +0 -1049
  367. package/workspace/public/pm/console3-lift.md +0 -220
  368. package/workspace/public/pm/cozy-home.js +0 -172
  369. package/workspace/public/pm/cozy-initiative.css +0 -138
  370. package/workspace/public/pm/cycle-review.js +0 -125
  371. package/workspace/public/pm/data.js +0 -1577
  372. package/workspace/public/pm/dest-board.js +0 -444
  373. package/workspace/public/pm/dest-docs.js +0 -530
  374. package/workspace/public/pm/dest-initiatives.js +0 -162
  375. package/workspace/public/pm/dest-mywork.js +0 -307
  376. package/workspace/public/pm/dest-notes.js +0 -537
  377. package/workspace/public/pm/dest-people.js +0 -449
  378. package/workspace/public/pm/dest-reports.js +0 -383
  379. package/workspace/public/pm/dest-settings.js +0 -601
  380. package/workspace/public/pm/dest-today.js +0 -267
  381. package/workspace/public/pm/display-word.js +0 -56
  382. package/workspace/public/pm/doc-editor.js +0 -473
  383. package/workspace/public/pm/doc-graph.js +0 -272
  384. package/workspace/public/pm/doc-health-panel.js +0 -110
  385. package/workspace/public/pm/doc-rail.js +0 -167
  386. package/workspace/public/pm/doc-remote.js +0 -180
  387. package/workspace/public/pm/dock-sessions.js +0 -472
  388. package/workspace/public/pm/dock.js +0 -216
  389. package/workspace/public/pm/fixture.js +0 -821
  390. package/workspace/public/pm/flag-picker.js +0 -104
  391. package/workspace/public/pm/frame-copy.js +0 -278
  392. package/workspace/public/pm/freshness-line.js +0 -149
  393. package/workspace/public/pm/handoff-box.js +0 -82
  394. package/workspace/public/pm/initiative-list.js +0 -235
  395. package/workspace/public/pm/initiative-sheet.js +0 -331
  396. package/workspace/public/pm/initiatives-api.js +0 -95
  397. package/workspace/public/pm/initiatives-copy.js +0 -287
  398. package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
  399. package/workspace/public/pm/initiatives-timeline.js +0 -410
  400. package/workspace/public/pm/initiatives-ui.js +0 -291
  401. package/workspace/public/pm/item-sheet.js +0 -268
  402. package/workspace/public/pm/keep-card.js +0 -204
  403. package/workspace/public/pm/lifecycle-lens-model.js +0 -246
  404. package/workspace/public/pm/lifecycle-lens.js +0 -276
  405. package/workspace/public/pm/lifecycle.js +0 -111
  406. package/workspace/public/pm/mobile.css +0 -366
  407. package/workspace/public/pm/mobile.js +0 -581
  408. package/workspace/public/pm/modes-live.js +0 -453
  409. package/workspace/public/pm/modes.js +0 -147
  410. package/workspace/public/pm/my-work-card.js +0 -51
  411. package/workspace/public/pm/my-work-data.js +0 -36
  412. package/workspace/public/pm/new-initiative-sheet.js +0 -169
  413. package/workspace/public/pm/next-step-ui.js +0 -190
  414. package/workspace/public/pm/outbox-panel.js +0 -125
  415. package/workspace/public/pm/palette-copy.js +0 -55
  416. package/workspace/public/pm/palette.js +0 -343
  417. package/workspace/public/pm/panel-breakdown.js +0 -702
  418. package/workspace/public/pm/panel-cockpit.js +0 -425
  419. package/workspace/public/pm/panel-detail.js +0 -1513
  420. package/workspace/public/pm/panel-initiatives.js +0 -929
  421. package/workspace/public/pm/panel-newsess.js +0 -709
  422. package/workspace/public/pm/panel-repos.js +0 -741
  423. package/workspace/public/pm/panel-tabs.js +0 -1506
  424. package/workspace/public/pm/panel-trees.js +0 -204
  425. package/workspace/public/pm/people-link.js +0 -106
  426. package/workspace/public/pm/phone-deck.js +0 -167
  427. package/workspace/public/pm/pm-work-view.js +0 -1533
  428. package/workspace/public/pm/portfolio-report.js +0 -61
  429. package/workspace/public/pm/premium-acts.js +0 -280
  430. package/workspace/public/pm/premium-brief.js +0 -111
  431. package/workspace/public/pm/premium-chat.js +0 -22
  432. package/workspace/public/pm/premium-doc-sheet.js +0 -312
  433. package/workspace/public/pm/premium-initiative.js +0 -324
  434. package/workspace/public/pm/premium-insights.css +0 -228
  435. package/workspace/public/pm/premium-metric-tiles.js +0 -68
  436. package/workspace/public/pm/premium-report-brief.js +0 -132
  437. package/workspace/public/pm/premium-vw-rec.js +0 -67
  438. package/workspace/public/pm/premium-wide.css +0 -30
  439. package/workspace/public/pm/print.css +0 -44
  440. package/workspace/public/pm/provider-cards.js +0 -136
  441. package/workspace/public/pm/registry.js +0 -203
  442. package/workspace/public/pm/release-card.js +0 -110
  443. package/workspace/public/pm/releases-view.js +0 -248
  444. package/workspace/public/pm/report-families-view.js +0 -505
  445. package/workspace/public/pm/report-slides.js +0 -438
  446. package/workspace/public/pm/report-tab.js +0 -33
  447. package/workspace/public/pm/report-view.js +0 -337
  448. package/workspace/public/pm/reports-copy.js +0 -134
  449. package/workspace/public/pm/roadmap.js +0 -294
  450. package/workspace/public/pm/run-card.js +0 -260
  451. package/workspace/public/pm/sessions-panel.js +0 -219
  452. package/workspace/public/pm/sheet-jira.js +0 -353
  453. package/workspace/public/pm/shell-bell.js +0 -163
  454. package/workspace/public/pm/shell-model.js +0 -83
  455. package/workspace/public/pm/shell-phone.js +0 -124
  456. package/workspace/public/pm/shell-readaloud.js +0 -53
  457. package/workspace/public/pm/shell-recording.js +0 -274
  458. package/workspace/public/pm/shell-ticker.js +0 -90
  459. package/workspace/public/pm/sig-watch.js +0 -41
  460. package/workspace/public/pm/slide-confirm.js +0 -163
  461. package/workspace/public/pm/slides-copy.js +0 -52
  462. package/workspace/public/pm/status-banner.js +0 -95
  463. package/workspace/public/pm/tab-doc.js +0 -859
  464. package/workspace/public/pm/tab-gone.js +0 -21
  465. package/workspace/public/pm/tab-term.js +0 -1210
  466. package/workspace/public/pm/tab-web.js +0 -90
  467. package/workspace/public/pm/timeline-copy.js +0 -48
  468. package/workspace/public/pm/timeline-forecast-view.js +0 -164
  469. package/workspace/public/pm/today-agenda.js +0 -331
  470. package/workspace/public/pm/today-cards.js +0 -244
  471. package/workspace/public/pm/today-copy.js +0 -506
  472. package/workspace/public/pm/today-day.js +0 -1371
  473. package/workspace/public/pm/today-goals.js +0 -297
  474. package/workspace/public/pm/today-jobs.js +0 -84
  475. package/workspace/public/pm/today-mentions.js +0 -50
  476. package/workspace/public/pm/topbar.js +0 -202
  477. package/workspace/public/pm/triage-card.js +0 -60
  478. package/workspace/public/pm/undo-hold.js +0 -103
  479. package/workspace/public/pm/view-addrepo.js +0 -208
  480. package/workspace/public/pm/view-files.js +0 -197
  481. package/workspace/public/pm/view-livenotes.js +0 -399
  482. package/workspace/public/pm/view-today.js +0 -13
  483. package/workspace/public/pm/view-validate.js +0 -171
  484. package/workspace/public/pm/welcome.js +0 -391
  485. package/workspace/public/pm/work-place.js +0 -68
  486. package/workspace/public/pm/xlsx-read.js +0 -117
  487. package/workspace/public/welcome.html +0 -22
  488. package/workspace/test-lists/browser-suites-green.json +0 -5
  489. package/workspace/test-lists/c3-core-docs.json +0 -9
  490. package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
  491. package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
  492. package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
  493. package/workspace/test-lists/c3-ib-items.json +0 -9
  494. package/workspace/test-lists/c3-ib-more.json +0 -9
  495. package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
  496. package/workspace/test-lists/c3-ini-life.json +0 -9
  497. package/workspace/test-lists/c3-meeting-board.json +0 -5
  498. package/workspace/test-lists/c3-meeting-card.json +0 -5
  499. package/workspace/test-lists/c3-notes-place.json +0 -5
  500. package/workspace/test-lists/c3-notes-series.json +0 -5
  501. package/workspace/test-lists/calendar-time-page.json +0 -5
  502. package/workspace/test-lists/calpop.json +0 -4
  503. package/workspace/test-lists/console3-briefing.json +0 -9
  504. package/workspace/test-lists/console3-foundation.json +0 -9
  505. package/workspace/test-lists/console3-work-page.json +0 -9
  506. package/workspace/test-lists/premium-brief-parity.json +0 -9
  507. package/workspace/test-lists/report-design-studio-ui.json +0 -5
  508. package/workspace/test-lists/report-structure-ui.json +0 -11
  509. package/workspace/test-lists/report-workspace-ui.json +0 -5
  510. package/workspace/test-lists/run3-a.json +0 -5
  511. package/workspace/test-lists/run3-d.json +0 -6
  512. package/workspace/test-lists/run4-c.json +0 -13
  513. package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
  514. package/workspace/test-lists/today-mentions-cards.json +0 -5
  515. package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
@@ -1,18 +1,30 @@
1
- /* pm/premium-report-read.js — a report cycle in the Viewer card (initiative premium-agreed-design, area viewer; ReportPanel.dc.html).
1
+ /* pm/premium-report-read.js — a report cycle in the Viewer card (initiative premium-agreed-design, area viewer; ReportPanel.dc.html; the
2
+ * uncovered parts drawn by premium-uncovered-features, workstream reports: canvas RpBrief, RpStates, RpDoc, RpLive, RpPhone).
2
3
  *
3
- * One report cycle, drawn as the design's report panel inside the czViewer card (cozy-viewer.js): no conversation, no tabs, nothing in #dlg.
4
+ * One report cycle, drawn as the design's report panel inside the czViewer card (cozy-viewer.js): no conversation, nothing in #dlg.
4
5
  * Header kind "Report · <audience>" (the template's audience), the report's name.
5
- * Chips the cycle chip (Draft · Oct 21, Issued · Oct 21; orange "Editing the Oct 21 draft" while editing), the schedule chip and its
6
- * popover (Every week, Every 2 weeks, Every month on the 1st, Something else: say it in the chat; Mon to Fri; the time; Cancel and
7
- * Schedule it), and Brief.
8
- * Toolbar Slides | Page, Edit, Present, Share (its popover: Link | Send a file, Ends in, Password, Create link, the open links and Turn off),
9
- * the blue Issue button and More (PPTX DOCX PDF XLSX CSV MD, Print, Versions "N cycles", Discard this draft… or Archive).
6
+ * Tabs Report | Brief, Brief with the count of what waits for the PM's confirm (RpBrief).
7
+ * Chips the cycle chip (Draft · Oct 21, Issued · Oct 21; orange "Editing the Oct 21 draft" while editing) and its menu in groups:
8
+ * Draft, Issued, Archived with Bring back, and Archive <cycle> (RpStates); the schedule chip and its popover (Every week, Every
9
+ * 2 weeks, Every month on the 1st, Something else: say it in the chat; Mon to Fri; the time; Cancel and Schedule it).
10
+ * Toolbar Slides | Document | Live page, Edit, Present, Share (its popover: Link | Send a file, Ends in, Password, Create link, the open
11
+ * links and Turn off), Download (PDF or Word), the blue Issue button and More (PPTX DOCX PDF XLSX CSV MD, Print, Versions
12
+ * "N cycles", Discard this draft… or Archive).
10
13
  * Issue a confirm with the three checks of GET /api/viewer-report/checks, Issue it and Not yet. POST /api/report/issue freezes the cycle.
14
+ * Issued the lock line "Issued, so it stays as sent. Changes go into the next cycle." with Start the next cycle (RpStates).
15
+ * Discard a card at the foot of the panel: "Discard the Oct 12 draft?", the cycle that stays, "This cannot be undone." (RpStates).
11
16
  * Slides the current slide, "Slides", the counter (1 of 5) with previous and next, and a thumbnail of each slide.
12
- * Phone Slides | Page as icons, Issue and More; More also holds Edit, Present, Share and Brief.
13
- * Parts the design does not draw yet carry the "Waiting for design" marker: the Brief, the cycle menu (Versions), Discard and Archive confirms,
14
- * the issued and archived states, Present, the page editor that Edit mounts on Page (premium-vw-doc.js), and the slide editor's tools the design
15
- * does not draw (the slide tools, the selected item's tools, the speaker notes).
17
+ * Document the words as paper pages: the eyebrow, the title, "In one minute", numbered sections, tables, the sources as footnotes,
18
+ * "Page n of N" and Download as PDF or Word (RpDoc; rp-parts.js paperModel). A designed cycle shows its designed page.
19
+ * Live page the numbers Insights reads (GET /api/insights-premium): the goal tiles, Goals on track, Shipped and At risk, the picked goal's
20
+ * line with its range and its points, the shipped rows that open for detail (RpLive; rp-parts.js liveModel). An issued cycle
21
+ * reads only the readings up to its day, so its page never changes later.
22
+ * Brief At a glance (For, Read by, Goes out, Built from), Please confirm (Confirm or Correct, Use it or Read again), Why it looks like
23
+ * this, Earlier looks with Go back to it (RpBrief; rp-parts.js briefModel).
24
+ * Present the slide over the whole page, "Slide n of N", the numbered strip, ← → and B to blank the screen, Stop presenting.
25
+ * Phone Report | Brief, Slides | Page, the slide, "Slide 1 of 6 · swipe for the next", the lock line and Present (RpPhone).
26
+ * The page editor that Edit mounts on Document (premium-vw-doc.js) and the slide editor's own tools have no artboard: they keep the "Waiting
27
+ * for design" marker.
16
28
  * Edit (Slides) the design's edit mode: the tip, the slide with a dashed outline and the selected item boxed, then "Slides ‹ n of N ›" and the
17
29
  * thumbnails; Undo and Redo dim when there is nothing to take back or do again. premium-vw-slides.js draws it in the card.
18
30
  *
@@ -22,14 +34,18 @@
22
34
  * slideHtml(lines) a section's lines as html (pure) · splitRender(html) · slideCard(s, mini) · fit(root) · schedLabel(setup) (pure)
23
35
  *
24
36
  * READS: GET /api/doc, /api/report-design/cycle and cycle-html (a cycle drawn to its saved design), /api/report-setups (schedule and audience),
25
- * /api/viewer-report/checks, /api/shares, /api/shares/password, /api/report-export (the files). Every render is HTML the server sanitized,
26
- * shown in a frame with an empty sandbox: nothing in it runs.
37
+ * /api/viewer-report/checks, /api/report-structure and /api/report-design (the Brief), /api/report-confirm, /api/insights-premium (Live page),
38
+ * /api/shares, /api/shares/password, /api/report-export (the files). Every render is HTML the server sanitized, shown in a frame with an empty
39
+ * sandbox: nothing in it runs.
27
40
  * WRITES (each a press, pmPost behind the launch nonce): /api/report/issue, /api/report-setups/edit or /setup (Schedule it),
28
- * /api/report-documents/discard and /archive, /api/shares and /api/shares/off. */
41
+ * /api/report-documents/discard and /archive, /api/shares and /api/shares/off, /api/report-confirm (Confirm, Use it), /api/report/draft
42
+ * (Read again: a redraft that keeps the notes; Start the next cycle without a template), /api/report-setups/draft (Start the next cycle),
43
+ * /api/report-design/revert (Go back to it). */
29
44
  import { pmGet, pmPost } from './http.js';
30
45
  import { open as vOpen, current as vCur } from './cozy-viewer.js';
31
46
  import { placeholderHtml } from './cozy-placeholder.js';
32
47
  import './premium-vw-open.js'; // registers window.czViews
48
+ import { cycleGroups, cycleName, briefModel, briefHtml, paperModel, paperHtml, liveModel, liveHtml, presentHtml, dayMon } from './rp-parts.js';
33
49
 
34
50
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
35
51
  const svg = (p, n = 18) => `<svg viewBox="0 0 24 24" width="${n}" height="${n}" aria-hidden="true">${p}</svg>`;
@@ -42,7 +58,7 @@ const P = {
42
58
  page: '<path d="M6 3h9l4 4v14H6zM14 3v5h5"/>', print: '<path d="M7 9V4h10v5M7 17H5v-6h14v6h-2M8 14h8v6H8z"/>', hist: '<path d="M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5M12 7v5l3 2"/>',
43
59
  bin: '<path d="M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13"/>', box: '<path d="M4 5h16v4H4zM5 9v10h14V9M10 13h4"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
44
60
  redo2: '<path d="M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7"/>', undo: '<path d="M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3"/>', redo: '<path d="m15 14 5-5-5-5M20 9H9a5 5 0 0 0 0 10h3"/>',
45
- plus: '<path d="M12 5v14M5 12h14"/>', layout: '<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 10h16M10 10v10"/>',
61
+ plus: '<path d="M12 5v14M5 12h14"/>', dl: '<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>', live: '<path d="M3 17l5-5 4 4 8-8M16 8h4v4"/>', layout: '<rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 10h16M10 10v10"/>',
46
62
  theme: '<path d="M12 3a9 9 0 1 0 0 18c1 0 1.5-.8 1.5-1.6 0-1-.8-1.4-.8-2.4 0-1 .8-1.6 1.8-1.6H17a4 4 0 0 0 4-4c0-4.6-4-8.4-9-8.4z"/><circle cx="7.5" cy="11" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15" cy="7.5" r="1"/>',
47
63
  };
48
64
  const ic = (k, n) => svg(P[k], n);
@@ -51,7 +67,12 @@ const DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
51
67
  const W = 1280;
52
68
  const q = (o) => Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
53
69
  const inline = (s) => esc(s).replace(/\*\*([^*]+)\*\*/g, '<b>$1</b>').replace(/`([^`]+)`/g, '<code>$1</code>');
54
- const WAIT = (f) => `<span class="vz-wait" data-cz-placeholder="${esc(f)}">Waiting for design</span>`;
70
+ const WAIT = (f) => `<span class="vz-wait" data-cz-placeholder="${esc(f)}">Waiting for design</span>`; // only the page editor keeps it
71
+ /** The reader's own sheet (cozy-vw-rp.css), added to the page once. */
72
+ function rpStyle() {
73
+ if (typeof document === 'undefined' || document.querySelector('link[data-rp-css]')) return;
74
+ const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/pm/cozy-vw-rp.css'; l.setAttribute('data-rp-css', ''); document.head.appendChild(l);
75
+ }
55
76
  /** "Oct 21", from a cycle's YYYY-MM-DD slot. */
56
77
  export const shortSlot = (s) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(s || '')); return m ? MONS[+m[2] - 1] + ' ' + +m[3] : String(s || ''); };
57
78
 
@@ -179,11 +200,17 @@ function chipsHtml() {
179
200
  const st = R.issued ? (R.archived ? 'Archived' : 'Issued') : 'Draft';
180
201
  const sched = R.setup === undefined ? '' : chip(R.pop === 'sched' ? 'open' : '', `${ic('clock', 14)}${esc(schedLabel(R.setup))}${ic('chev', 14)}`, 'sched', { exp: R.pop === 'sched', pop: 'dialog', label: 'Schedule: ' + schedLabel(R.setup) + '. Change it' });
181
202
  return `<div class="vz-rpc">${chip(R.issued ? 'issued' : '', `<i aria-hidden="true"></i>${st} · ${esc(when)}${ic('chev', 14)}`, 'cycm', { exp: R.pop === 'cyc', label: st + ', ' + when + '. Other cycles' })}`
182
- + `${R.issued ? WAIT(R.archived ? 'Archived state' : 'Issued state') : ''}${sched}${chip('line', `${ic('brief', 14)}Brief`, 'brief', { cls: ' vz-dko', exp: R.pop === 'brief', pop: 'dialog' })}`
183
- + `${R.pop === 'sched' ? schedPop() : R.pop === 'cyc' ? cycPop() : ''}</div>`;
203
+ + `${sched}${R.pop === 'sched' ? schedPop() : R.pop === 'cyc' ? cycPop() : ''}</div>`;
204
+ }
205
+ /** Report | Brief (RpBrief). Brief carries the count of what waits for the PM's confirm. */
206
+ function tabsHtml() {
207
+ const n = R.BF ? R.BF.count : 0;
208
+ return `<div class="cz-tabs rp-tabs" role="tablist" aria-label="Report or its brief"><button type="button" role="tab" class="cz-tab" data-r="tab|report" aria-selected="${R.tab === 'report'}">Report</button>`
209
+ + `<button type="button" role="tab" class="cz-tab" data-r="tab|brief" aria-selected="${R.tab === 'brief'}">Brief${n ? ` <span class="cz-pill late rp-n" aria-label="${n} to confirm">${n}</span>` : ''}</button></div>`;
184
210
  }
185
211
  function toolHtml() {
186
- const seg = `<div class="vz-sg" role="group" aria-label="${R.edit ? 'Edit as' : 'Read as'}"><button type="button" data-r="view|deck" aria-pressed="${R.view === 'deck'}" aria-label="Slides" title="Slides">${ic('slides', 16)}<span class="vz-dko">Slides</span></button><button type="button" data-r="view|doc" aria-pressed="${R.view === 'doc'}" aria-label="Page" title="Page">${ic('page', 16)}<span class="vz-dko">Page</span></button></div>`;
212
+ const sb = (k, icon, l, cls) => `<button type="button" data-r="view|${k}" aria-pressed="${R.view === k}" aria-label="${l}" title="${l}"${cls ? ` class="${cls}"` : ''}>${ic(icon, 16)}<span class="vz-dko">${l}</span></button>`;
213
+ const seg = `<div class="vz-sg" role="group" aria-label="${R.edit ? 'Edit as' : 'Read as'}">${sb('deck', 'slides', 'Slides')}${sb('doc', 'page', R.edit ? 'Page' : 'Document')}${R.edit ? '' : sb('live', 'live', 'Live page', 'vz-dko')}</div>`;
187
214
  if (R.edit) {
188
215
  const deck = R.view === 'deck';
189
216
  const SS = slideState(); // Undo and Redo are dimmed while there is nothing to take back or to do again (ReportPanel.dc.html: Redo at .4)
@@ -196,8 +223,15 @@ function toolHtml() {
196
223
  return `<div class="vz-tb">${seg}<span class="vz-sp"></span>`
197
224
  + (R.issued ? '' : ib('edit', ic('pen'), R.view === 'deck' ? 'Edit the slides' : 'Edit the words', { cls: ' vz-dko' }))
198
225
  + ib('present', ic('play'), 'Present', { cls: ' vz-dko' }) + ib('share', ic('share'), 'Share a link to a copy', { cls: ' vz-dko', exp: R.pop === 'share', pop: 'dialog' })
226
+ + ib('dlm', ic('dl'), 'Download', { cls: ' vz-dko', exp: R.pop === 'dl' })
199
227
  + (issue ? '<span class="vz-sep vz-dko"></span>' + issue : '') + ib('more', ic('more'), 'More', { exp: R.pop === 'more' })
200
- + (R.pop === 'more' ? morePop() : R.pop === 'share' ? sharePop() : '') + '</div>';
228
+ + (R.pop === 'more' ? morePop() : R.pop === 'share' ? sharePop() : R.pop === 'dl' ? dlPop() : '') + '</div>';
229
+ }
230
+ /** Download (RpDoc): the paper as PDF (the browser prints it) or Word. The other files stay in More. */
231
+ function dlPop() {
232
+ return `<div class="vz-pop vz-pop-dl" data-esc-layer="1" role="menu" aria-label="Download"><button type="button" class="vz-mi vz-hv" role="menuitem" data-r="pdf">${ic('print')}<span class="vz-grow">PDF</span><small class="vz-note">keeps the look</small></button>`
233
+ + `<a class="vz-mi vz-hv" role="menuitem" data-r="dl|docx" href="/api/report-export?${esc(q({ ws: R.ws, path: R.row.path, fmt: 'docx' }))}" download>${ic('page')}<span class="vz-grow">Word</span><small class="vz-note">to change the words</small></a>`
234
+ + `<p class="vz-note vz-padmi">Slides, tables and Markdown are in More.</p></div>`;
201
235
  }
202
236
  function schedPop() {
203
237
  const k = R.sch, opts = [['weekly', 'Every week'], ['bi-weekly', 'Every 2 weeks'], ['monthly', 'Every month, on the 1st'], ['else', 'Something else: say it in the chat']];
@@ -213,17 +247,21 @@ function schedPop() {
213
247
  }
214
248
  /** The times the schedule's chip offers, 24-hour, every half hour from 06:00 to 20:00, with the saved one kept. */
215
249
  export const times = (cur) => { const L = []; for (let h = 6; h <= 20; h++) for (const m of ['00', '30']) L.push(String(h).padStart(2, '0') + ':' + m); if (cur && !L.includes(cur)) L.push(cur); return L.sort(); };
250
+ /** The cycle menu (RpStates): Draft, Issued and Archived, an archived cycle with Bring back, and Archive for the open issued cycle. */
216
251
  function cycPop() {
217
- const C = R.cycles.length ? R.cycles : [R.row];
218
- const st = (x) => (x.state === 'issued' ? (x.archived ? 'Archived' : 'Issued') : 'Draft');
219
- return `<div class="vz-pop vz-pop-cyc" data-esc-layer="1" role="menu" aria-label="Cycles"><p class="vz-lab">Cycles ${WAIT('Cycle menu')}</p>`
220
- + C.map((x) => `<button type="button" class="vz-mi vz-hv" role="menuitemradio" aria-checked="${x.path === R.row.path}" data-r="cyc|${esc(x.path)}"><span class="vz-grow">${esc(shortSlot(x.slot || x.date))}</span><small class="vz-note">${st(x)}</small></button>`).join('') + '</div>';
252
+ const G = cycleGroups(R.cycles.length ? R.cycles : [R.row], R.row.path, R.id);
253
+ const row = (x, g) => g === 'archived'
254
+ ? `<div class="vz-mi rp-arch"><span class="vz-grow">${esc(x.name)}</span><button type="button" class="rp-btn soft" data-r="unarch|${esc(x.path)}"${R.busy ? ' disabled' : ''}>Bring back</button></div>`
255
+ : `<button type="button" class="vz-mi vz-hv" role="menuitemradio" aria-checked="${x.cur}" data-r="cyc|${esc(x.path)}"><span class="vz-grow">${esc(x.name)}</span><small class="vz-note">${esc(x.when)}</small></button>`;
256
+ return `<div class="vz-pop vz-pop-cyc" data-esc-layer="1" role="menu" aria-label="Cycles">`
257
+ + G.map((g) => `<p class="vz-lab">${g.t}</p>` + g.rows.map((x) => row(x, g.k)).join('')).join('')
258
+ + (R.issued && !R.archived && !R.edit ? `<hr><button type="button" class="vz-mi vz-hv" role="menuitem" data-r="archive">${ic('box')}Archive ${esc(cycleName(R.row, R.id))}</button>` : '') + '</div>';
221
259
  }
222
260
  function morePop() {
223
261
  const fmt = (k, l) => (k === 'pdf' || k === 'md' ? `<button type="button" class="vz-fmt" data-r="${k}">${l}</button>` : `<a class="vz-fmt" data-r="dl|${k}" href="/api/report-export?${esc(q({ ws: R.ws, path: R.row.path, fmt: k }))}" download>${l}</a>`);
224
262
  const n = R.cycles.length || 1;
225
263
  return `<div class="vz-pop vz-pop-more" data-esc-layer="1" role="menu" aria-label="More">`
226
- + `<span class="vz-pho">${R.issued ? '' : mi('edit', 'pen', 'Edit')}${mi('present', 'play', 'Present')}${mi('share', 'share', 'Share')}${mi('brief', 'brief', 'Brief')}<hr></span>`
264
+ + `<span class="vz-pho">${R.issued ? '' : mi('edit', 'pen', 'Edit')}${mi('present', 'play', 'Present')}${mi('share', 'share', 'Share')}<hr></span>`
227
265
  + `<p class="vz-lab">Download</p><div class="vz-fmts">${fmt('pptx', 'PPTX')}${fmt('docx', 'DOCX')}${fmt('pdf', 'PDF')}${fmt('xlsx', 'XLSX')}${fmt('csv', 'CSV')}${fmt('md', 'MD')}</div>`
228
266
  + `<p class="vz-note vz-padmi">Slides as PowerPoint, words as Word or Markdown, tables as Excel or CSV. PDF keeps the look.</p>`
229
267
  + mi('print', 'print', 'Print') + `<button type="button" class="vz-mi vz-hv" role="menuitem" data-r="cycm">${ic('hist')}<span class="vz-grow">Versions</span><small class="vz-note">${n} ${n === 1 ? 'cycle' : 'cycles'}</small></button><hr>`
@@ -270,26 +308,44 @@ function confHtml() {
270
308
  + (R.issueErr ? `<p class="vz-msg" data-tone="bad" role="alert">${esc(R.issueErr)}</p>` : '')
271
309
  + `<div><button type="button" class="vz-issue vz-hv vz-h36" data-r="issueok"${R.busy ? ' disabled' : ''}>${ic('check', 16)}Issue it</button><button type="button" class="vz-sec2 vz-hv vz-h36" data-r="issueno"${R.busy ? ' disabled' : ''}>Not yet</button></div></div>`;
272
310
  }
273
- if (R.ask) {
274
- const T = { discard: ['Discard this draft? The file is deleted. Issued reports are not touched.', 'Discard', 'Keep it', 'Discard confirm'],
275
- archive: ['Archive this report? It is kept for good and moved to the end of the Reports list.', 'Archive', 'Cancel', 'Archive confirm'] }[R.ask];
276
- return `<div class="vz-ask2" role="group" aria-label="${esc(T[1])}"><span>${esc(T[0])} ${WAIT(T[3])}</span>${R.askErr ? `<p class="vz-msg" data-tone="bad" role="alert">${esc(R.askErr)}</p>` : ''}<div><button type="button" class="vz-issue vz-hv vz-h36" data-r="askok"${R.ask === 'discard' ? ' data-k="bad"' : ''}${R.busy ? ' disabled' : ''}>${esc(T[1])}</button><button type="button" class="vz-sec2 vz-hv vz-h36" data-r="askno">${esc(T[2])}</button></div></div>`;
277
- }
278
311
  return '';
279
312
  }
313
+ /** Discard or Archive asks in a card at the foot of the panel (RpStates: "Discard draft 2? Draft 1 stays. This cannot be undone."). */
314
+ function askHtml() {
315
+ if (!R.ask) return '';
316
+ const name = cycleName(R.row, R.id), other = R.cycles.filter((x) => x.path !== R.row.path && !x.archived)[0];
317
+ const T = R.ask === 'discard'
318
+ ? [`Discard the ${name} draft?`, (other ? cycleName(other, R.id) + ' stays. ' : '') + 'This cannot be undone.', 'Discard']
319
+ : [`Archive ${name}?`, 'It stays as sent, at the end of the Reports list. Bring it back from the cycle menu.', 'Archive'];
320
+ return `<div class="rp-ask" role="alertdialog" aria-label="${esc(T[0])}"><p><b>${esc(T[0])}</b> <span class="rp-mut">${esc(T[1])}</span></p>`
321
+ + (R.askErr ? `<p class="vz-msg" data-tone="bad" role="alert">${esc(R.askErr)}</p>` : '')
322
+ + `<div><button type="button" class="rp-btn${R.ask === 'discard' ? ' bad' : ' dark'}" data-r="askok"${R.busy ? ' disabled' : ''}>${esc(T[2])}</button><button type="button" class="rp-btn" data-r="askno">Keep it</button></div></div>`;
323
+ }
324
+ /** The lock line of an issued or archived cycle (RpStates, RpPhone). */
325
+ function lockHtml() {
326
+ if (!R.issued || R.edit) return '';
327
+ return `<div class="rp-lock">${ic('lock', 14)}<span>${R.archived ? 'Archived, so it stays as sent. Bring it back from the cycle menu.' : 'Issued, so it stays as sent. Changes go into the next cycle.'}</span>`
328
+ + (R.archived ? `<button type="button" class="rp-btn" data-r="unarch|${esc(R.row.path)}"${R.busy ? ' disabled' : ''}>Bring back</button>` : `<button type="button" class="rp-btn" data-r="nextcyc"${R.busy ? ' disabled' : ''}>Start the next cycle</button>`) + '</div>';
329
+ }
280
330
  function deckHtml() {
281
331
  const L = slides();
282
- if (!L.length) return '<p class="vz-empty">This cycle has no slides. Read it as a page.</p>';
332
+ if (!L.length) return '<p class="vz-empty">This cycle has no slides. Read it as a document.</p>';
283
333
  const i = R.i = Math.max(0, Math.min(R.i, L.length - 1));
284
334
  return `<div class="vz-slide" tabindex="0" role="group" aria-roledescription="slide" aria-label="Slide ${i + 1} of ${L.length}: ${esc(L[i].h)}. Use the arrow keys to change slide." data-r="slide">${slideCard(L[i])}</div>`
285
- + `<div class="vz-snav"><b>Slides</b><span class="vz-sp"></span>${ib('prev', ic('prev', 16), 'Previous slide', { cls: ' vz-small', off: i === 0 })}<span aria-live="polite">${i + 1} of ${L.length}</span>${ib('next', ic('next', 16), 'Next slide', { cls: ' vz-small', off: i === L.length - 1 })}</div>`
335
+ + `<div class="vz-snav rp-dkn"><b>Slides</b><span class="vz-sp"></span>${ib('prev', ic('prev', 16), 'Previous slide', { cls: ' vz-small', off: i === 0 })}<span aria-live="polite">${i + 1} of ${L.length}</span>${ib('next', ic('next', 16), 'Next slide', { cls: ' vz-small', off: i === L.length - 1 })}</div>`
336
+ + `<p class="rp-swipe rp-pho">Slide ${i + 1} of ${L.length} · swipe for the next</p>`
286
337
  + `<div class="vz-thumbs" role="group" aria-label="Slides">${L.map((x, j) => `<button type="button" class="vz-th vz-hv" data-r="go|${j}"${j === i ? ' aria-current="true"' : ''} aria-label="Slide ${j + 1}: ${esc(x.h)}"><span>${j === i || x.k === 'frame' ? slideCard(x, true) : ''}</span><span>${j + 1} · ${esc(x.h)}</span></button>`).join('')}</div>`;
287
338
  }
288
339
  function pageHtml() {
289
340
  if (R.cyc) return `<div class="vz-pagefr">${frame(R.cyc.style, R.cyc.body, '', 'The report as a page')}</div>`;
290
341
  const w = R.W || { title: R.name, sections: [] };
291
- return `<article class="vz-page"><h2>${esc(w.title)}</h2>${w.sections.map((x) => `<h4>${esc(x.h)}</h4>${slideHtml(x.lines)}`).join('')}</article>`;
342
+ return paperHtml(paperModel(w, { audience: R.audience, name: R.name, slot: R.row.slot }), { state: R.archived ? 'archived' : R.issued ? 'issued' : 'draft', issuedOn: dayMon(R.row.slot) });
292
343
  }
344
+ function liveView() {
345
+ const L = R.LV && R.LV.m ? liveModel(R.LV.m, { upTo: R.issued ? R.row.slot : null, range: R.LV.range, pick: R.LV.pick, open: R.LV.open }) : R.LV && R.LV.err ? { none: R.LV.err } : null;
346
+ return liveHtml(L, { name: R.name, audience: R.audience, period: R.issued ? 'As issued · ' + dayMon(R.row.slot) : 'Now', issued: R.issued, readAgo: R.LV && agoOf(R.LV.at), hover: R.LV ? R.LV.hover : null, prodOpen: R.pop === 'prod', products: R.LV && R.LV.m && R.LV.m.board ? R.LV.m.board.switcher : [] });
347
+ }
348
+ const agoOf = (t) => { if (!t) return ''; const m = Math.round((Date.now() - t) / 60000); return m < 1 ? 'just now' : m === 1 ? '1 min ago' : m < 60 ? m + ' min ago' : Math.round(m / 60) + ' h ago'; };
293
349
  function bodyHtml() {
294
350
  if (R.edit) {
295
351
  const SS = slideState(), n = SS ? SS.deck.slides.length : slides().length, at = SS ? SS.i : R.i;
@@ -297,9 +353,11 @@ function bodyHtml() {
297
353
  + (R.view === 'deck' && !R.noTip ? `<p class="vz-tip"><span>${tipText(at, n)}</span>${ib('notip', ic('x', 14), 'Hide this tip', { cls: ' vz-small' })}</p>` : '')
298
354
  + (R.view === 'deck' ? '' : `<div class="vz-r1">${WAIT('Page editor')}</div>`) + '<div class="vz-ed" data-vz-ed></div></div>';
299
355
  }
300
- return `<div class="vz-rpb">${confHtml()}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}`
301
- + (R.pop === 'brief' ? `<div class="vz-ask2"><div><b>Brief</b><span class="vz-sp"></span>${ib('pop|', ic('x', 14), 'Close the brief', { cls: ' vz-small' })}</div>${placeholderHtml('Report brief', 'How this report is made: its sources, sections and look.')}</div>` : '')
302
- + (R.err ? `<p class="vz-msg" data-tone="bad" role="alert">The document could not be read: ${esc(R.err)}</p>` : !R.W ? '<p class="vz-empty" role="status">Reading the report.</p>' : R.view === 'deck' ? deckHtml() : pageHtml()) + '</div>';
356
+ if (R.tab === 'brief') return `<div class="vz-rpb">${briefHtml(R.BF, { issued: R.issued, busy: R.busy, msg: R.bfMsg })}</div>`;
357
+ const view = R.err ? `<p class="vz-msg" data-tone="bad" role="alert">The document could not be read: ${esc(R.err)}</p>` : !R.W ? '<p class="vz-empty" role="status">Reading the report.</p>'
358
+ : R.view === 'deck' ? deckHtml() : R.view === 'live' ? liveView() : pageHtml();
359
+ return `<div class="vz-rpb">${confHtml()}${R.msg ? `<p class="vz-msg" role="status" data-tone="${R.msg.tone || ''}">${esc(R.msg.text)}</p>` : ''}${lockHtml()}${view}`
360
+ + (R.view === 'deck' && R.W && !R.err ? `<button type="button" class="rp-btn rp-present rp-pho" data-r="present">${ic('play', 16)}Present</button>` : '') + askHtml() + '</div>';
303
361
  }
304
362
  const tipText = (i, n) => `Slide ${i + 1} of ${n}. Click an item to change it; double-click text to type.`;
305
363
  /** The editor's slide and its undo history changed: the tip and the dimmed Undo and Redo follow it. */
@@ -310,7 +368,7 @@ function edState(S) {
310
368
  if (u) u.classList.toggle('vz-dim', !S.hist.length); if (r) r.classList.toggle('vz-dim', !S.fut.length);
311
369
  }
312
370
  /** The whole panel as html. */
313
- export function panelHtml() { return `<div class="vz vz-rp0" data-view="${R.view}"${R.edit ? ' data-edit' : ''}><div class="vz-rph">${chipsHtml()}${toolHtml()}</div>${bodyHtml()}</div>`; }
371
+ export function panelHtml() { return `<div class="vz vz-rp0" data-view="${R.view}" data-tab="${R.tab}"${R.edit ? ' data-edit' : ''}><div class="vz-rph">${R.edit ? '' : tabsHtml()}${R.tab === 'brief' && !R.edit ? '' : chipsHtml() + toolHtml()}</div>${bodyHtml()}</div>`; }
314
372
 
315
373
  const bodyEl = () => (R && vCur() && vCur().id === R.vid ? document.querySelector('#czViewer .cz-vw-body') : null);
316
374
  function draw() {
@@ -331,7 +389,7 @@ function wire(b) {
331
389
  const t = e.target.closest('[data-r]');
332
390
  if (!t) { if (R.pop && R.pop !== 'brief' && !e.target.closest('.vz-pop')) { R.pop = null; draw(); } return; }
333
391
  if (t.disabled || t.tagName === 'INPUT' || t.tagName === 'SELECT') return;
334
- if (t.tagName === 'A' && t.dataset.r.startsWith('dl|')) { R.pop = null; setTimeout(draw, 0); return; }
392
+ if (t.tagName === 'A') { if (t.dataset.r.startsWith('dl|')) { R.pop = null; setTimeout(draw, 0); } return; } // a download or a link to another page
335
393
  e.preventDefault(); act(t.dataset.r.split('|'), t);
336
394
  };
337
395
  b.onchange = (e) => { if (e.target.dataset.r === 'stime') R.sch.time = e.target.value || '09:00'; };
@@ -340,6 +398,14 @@ function wire(b) {
340
398
  if (e.key === 'Escape' && R.pop) { e.preventDefault(); e.stopPropagation(); R.pop = null; draw(); return; }
341
399
  if (!R.edit && R.view === 'deck' && /^Arrow(Left|Right)$/.test(e.key) && !e.target.closest('input')) { const L = slides().length, j = R.i + (e.key === 'ArrowRight' ? 1 : -1); if (j >= 0 && j < L) { e.preventDefault(); R.i = j; draw(); const s = bodyEl().querySelector('.vz-slide'); if (s) s.focus(); } }
342
400
  };
401
+ /* a phone swipes the slide (RpPhone "swipe for the next") */
402
+ let x0 = null;
403
+ b.ontouchstart = (e) => { x0 = !R.edit && R.view === 'deck' && e.target.closest('.vz-slide') && e.touches.length === 1 ? e.touches[0].clientX : null; };
404
+ b.ontouchend = (e) => {
405
+ if (x0 == null) return; const dx = e.changedTouches[0].clientX - x0; x0 = null;
406
+ if (Math.abs(dx) < 40) return; const j = R.i + (dx < 0 ? 1 : -1); if (j >= 0 && j < slides().length) { R.i = j; draw(); }
407
+ };
408
+ b.onmousemove = (e) => { if (R.view !== 'live' || !R.LV) return; const pt = e.target.closest('.rp-pt'); if (pt) { const h = +pt.dataset.r.split('|')[2]; if (R.LV.hover !== h) { R.LV.hover = h; draw(); } } };
343
409
  }
344
410
  /* a 1280 x 720 frame scales to its slide's width */
345
411
  const RO = typeof ResizeObserver === 'function' ? new ResizeObserver((es) => { for (const e of es) scaleOf(e.target, e.contentRect.width); }) : null;
@@ -350,7 +416,13 @@ export function fit(root) { root.querySelectorAll('.vz-fr').forEach((c) => { if
350
416
  const say = (text, tone) => { R.msg = { text, tone }; draw(); };
351
417
  async function act([k, v], t) {
352
418
  if (k === 'pop') { R.pop = v || null; return draw(); }
353
- if (k === 'view') { if (R.view === v) return; R.view = v; R.pop = null; const ed = R.edit && bodyEl() && bodyEl().querySelector('[data-vz-ed]'); if (ed) delete ed.dataset.mounted; return draw(); }
419
+ if (k === 'tab') { if (R.tab === v) return; R.tab = v; R.pop = null; R.conf = false; R.ask = ''; if (v === 'brief' && !R.BF) readBrief(); return draw(); }
420
+ if (k === 'bf') return briefAct(v, t.dataset.r.split('|').slice(2).join('|'));
421
+ if (k === 'lv') return liveAct(v, t.dataset.r.split('|').slice(2).join('|'));
422
+ if (k === 'dlm') { R.pop = R.pop === 'dl' ? null : 'dl'; return draw(); }
423
+ if (k === 'nextcyc') return nextCycle();
424
+ if (k === 'unarch') { R.pop = null; return lifeIt('unarchive', v); }
425
+ if (k === 'view') { if (R.view === v) return; R.view = v; R.pop = null; if (v === 'live' && !R.LV) readLive(); const ed = R.edit && bodyEl() && bodyEl().querySelector('[data-vz-ed]'); if (ed) delete ed.dataset.mounted; return draw(); }
354
426
  if (k === 'cycm') { R.pop = R.pop === 'cyc' ? null : 'cyc'; return draw(); }
355
427
  if (k === 'cyc') { const row = R.cycles.find((x) => x.path === v); R.pop = null; if (row && row.path !== R.row.path) return openReport(row, R.hand); return draw(); }
356
428
  if (k === 'sched') { if (R.pop !== 'sched') { R.sch = schedPick(R.setup); R.schErr = ''; } R.pop = R.pop === 'sched' ? null : 'sched'; return draw(); }
@@ -358,7 +430,6 @@ async function act([k, v], t) {
358
430
  if (k === 'sday') { R.sch.day = v; return draw(); }
359
431
  if (k === 'sgo') return schedIt(schedOf(R.sch));
360
432
  if (k === 'soff') return schedIt('off');
361
- if (k === 'brief') { R.pop = R.pop === 'brief' ? null : 'brief'; return draw(); }
362
433
  if (k === 'more') { R.pop = R.pop === 'more' ? null : 'more'; return draw(); }
363
434
  if (k === 'share') { if (R.pop !== 'share') openShare(); else { R.pop = null; draw(); } return; }
364
435
  if (k === 'prev' || k === 'next') { R.i += k === 'next' ? 1 : -1; return draw(); }
@@ -438,11 +509,11 @@ async function issueIt() {
438
509
  say('Issued and frozen. Nothing was sent to anyone; share it yourself.');
439
510
  if (R.onIssue) R.onIssue(R.row);
440
511
  }
441
- async function lifeIt(k) {
512
+ async function lifeIt(k, at) {
442
513
  if (R.busy) return;
443
- const me = R; R.busy = true; R.askErr = ''; draw();
514
+ const me = R, rel = at || R.row.path; R.busy = true; R.askErr = ''; draw();
444
515
  const archived = k === 'archive';
445
- const r = await pmPost('/api/report-documents/' + (k === 'discard' ? 'discard' : 'archive'), k === 'discard' ? { ws: R.ws, path: R.row.path } : { ws: R.ws, path: R.row.path, archived }).catch(() => null);
516
+ const r = await pmPost('/api/report-documents/' + (k === 'discard' ? 'discard' : 'archive'), k === 'discard' ? { ws: R.ws, path: rel } : { ws: R.ws, path: rel, archived }).catch(() => null);
446
517
  if (R !== me) return;
447
518
  R.busy = false;
448
519
  if (!r || r.ok !== true) { R.askErr = (k === 'discard' ? 'The draft was not discarded: ' : 'Nothing changed: ') + ((r && r.error) || 'the page could not reach PMOS') + '.'; if (!R.ask) R.msg = { text: R.askErr, tone: 'bad' }; return draw(); }
@@ -454,11 +525,100 @@ async function lifeIt(k) {
454
525
  const b = bodyEl(); if (b) b.innerHTML = '<div class="vz"><p class="vz-empty" role="status">The draft is discarded.</p></div>';
455
526
  return;
456
527
  }
457
- R.archived = archived; R.row = { ...R.row, archived };
458
- R.cycles = R.cycles.map((x) => (x.path === R.row.path ? { ...x, archived } : x));
459
- say(archived ? 'Archived. It is kept, at the end of the Reports list.' : 'It is back in the Reports list.');
528
+ R.cycles = R.cycles.map((x) => (x.path === rel ? { ...x, archived } : x));
529
+ if (rel === R.row.path) { R.archived = archived; R.row = { ...R.row, archived }; }
530
+ say(archived ? 'Archived. It is kept, at the end of the Reports list.' : (rel === R.row.path ? 'It is back in the Reports list.' : cycleName(R.cycles.find((x) => x.path === rel) || {}, R.id) + ' is back in the Reports list.'));
460
531
  if (R.onChange) R.onChange();
461
532
  }
533
+ /** Start the next cycle (RpStates): the template drafts its next cycle; a report with no template drafts one now. The new draft opens. */
534
+ async function nextCycle() {
535
+ if (R.busy) return;
536
+ const me = R, c = cycleOf(R.row); R.busy = true; draw();
537
+ const r = R.setup ? await pmPost('/api/report-setups/draft', { ws: R.ws, id: R.setup.id }).catch(() => null) : await pmPost('/api/report/draft', { ws: R.ws, cadence: c.cadence }).catch(() => null);
538
+ if (R !== me) return;
539
+ R.busy = false;
540
+ if (!r || r.ok !== true) return say('The next cycle was not started: ' + ((r && r.error) || 'the page could not reach PMOS') + '.', 'bad');
541
+ if (R.onChange) R.onChange();
542
+ const at = (r.drafted && r.drafted.path) || r.path;
543
+ if (!at) return say('PMOS is drafting the next cycle. It shows in the cycle menu when it is ready.');
544
+ const slot = (r.drafted && r.drafted.slot) || r.slot || '';
545
+ const row = { path: at, slot, state: 'draft', cadence: c.cadence };
546
+ return openReport(row, { ...R.hand, name: R.name, cycles: [row].concat(R.cycles.filter((x) => x.path !== at)) });
547
+ }
548
+
549
+ /* ── the Brief (RpBrief): the template, its structure and look, the checks and what the PM confirmed ── */
550
+ async function readBrief() {
551
+ const me = R;
552
+ const [st, de, ch, cf] = await Promise.all([
553
+ R.setup ? pmGet('/api/report-structure?' + q({ ws: R.ws, id: R.id })) : null, R.setup ? pmGet('/api/report-design?' + q({ ws: R.ws, id: R.id })) : null,
554
+ R.issued ? null : pmGet('/api/viewer-report/checks?' + q({ ws: R.ws, path: R.row.path, slot: R.row.slot })), pmGet('/api/report-confirm?' + q({ path: R.row.path })),
555
+ ].map((x) => Promise.resolve(x).catch(() => null)));
556
+ if (R !== me) return;
557
+ R.bfRaw = { structure: st && st.ok ? st.structure : null, design: de && de.ok ? de.design : null, checks: ch, confirms: cf && cf.ok ? cf.keys : [] };
558
+ buildBrief(); draw();
559
+ }
560
+ function buildBrief() {
561
+ const x = R.bfRaw; if (!x) return;
562
+ const goes = R.issued ? 'Issued ' + dayMon(R.row.slot) : R.setup && R.setup.status !== 'paused' ? schedLabel(R.setup) + (R.setup.next_draft ? ' · next ' + dayMon(String(R.setup.next_draft).slice(0, 10)) : '') : '';
563
+ R.BF = briefModel({ ...x, setup: R.setup, W: R.W, issued: R.issued, goesOut: goes, hasTemplate: !!R.setup });
564
+ }
565
+ async function briefAct(a, v) {
566
+ const me = R;
567
+ if (a === 'fix') {
568
+ const it = R.BF && R.BF.confirm.find((c) => c.key === v); if (!it) return;
569
+ const text = (it.where === 'Brief' ? 'Answer' : 'Correct') + ' "' + R.name + '", ' + it.where.toLowerCase() + ': ' + it.text + ' → ';
570
+ const ta = document.getElementById('hmIn'); // Home's chat box, when the Viewer sits beside it
571
+ if (ta) { ta.value = text; ta.dispatchEvent(new Event('input', { bubbles: true })); ta.focus(); R.bfMsg = 'Say the correction in the chat. The report changes on its next draft.'; }
572
+ else R.bfMsg = 'Say the correction in the chat on Home: ' + it.where + ': ' + it.text;
573
+ return draw();
574
+ }
575
+ if (a === 'ok' || a === 'use') {
576
+ R.busy = true; draw();
577
+ const r = await pmPost('/api/report-confirm', { path: R.row.path, key: v, act: a === 'use' ? 'use' : 'confirm' }).catch(() => null);
578
+ if (R !== me) return;
579
+ R.busy = false;
580
+ if (!r || !r.ok) { R.bfMsg = 'That was not kept: ' + ((r && r.error) || 'the page could not reach PMOS') + '.'; return draw(); }
581
+ R.bfRaw.confirms = (R.bfRaw.confirms || []).concat(v); buildBrief(); R.bfMsg = a === 'use' ? 'Kept: it goes out with that figure.' : 'Confirmed.'; return draw();
582
+ }
583
+ if (a === 'again') {
584
+ const c = cycleOf(R.row); R.busy = true; R.bfMsg = 'Reading the sources again.'; draw();
585
+ const r = await pmPost('/api/report/draft', { ws: R.ws, cadence: c.cadence, slot: c.slot, redraft: true }).catch(() => null);
586
+ if (R !== me) return;
587
+ R.busy = false;
588
+ if (!r || !r.ok) { R.bfMsg = 'It was not read again: ' + ((r && r.error) || 'the page could not reach PMOS') + '.'; return draw(); }
589
+ await reread(); if (R !== me) return; R.bfMsg = 'Read again. Your notes are kept.'; return readBrief();
590
+ }
591
+ if (a === 'back') {
592
+ R.busy = true; draw();
593
+ const r = await pmPost('/api/report-design/revert', { ws: R.ws, id: R.id, n: +v }).catch(() => null);
594
+ if (R !== me) return;
595
+ R.busy = false;
596
+ if (!r || !r.ok) { R.bfMsg = 'The look did not change: ' + ((r && r.error) || 'the page could not reach PMOS') + '.'; return draw(); }
597
+ R.bfMsg = 'Back to D' + v + '. Press Use it in the report\'s design to keep it for the next cycle.'; return readBrief();
598
+ }
599
+ }
600
+
601
+ /* ── the live page (RpLive): GET /api/insights-premium, the numbers Insights reads ── */
602
+ async function readLive(board) {
603
+ const me = R;
604
+ R.LV = Object.assign(R.LV || { range: '8w', pick: null, open: null, hover: null }, { m: null, err: '' });
605
+ const qq = board ? q({ ws: board.ws, board: board.id }) : q({ ws: R.ws });
606
+ let j = null;
607
+ try { const res = await fetch('/api/insights-premium' + (qq ? '?' + qq : ''), { credentials: 'same-origin' }); j = await res.json(); } catch { j = null; }
608
+ if (R !== me) return;
609
+ if (!j || !j.ok || !j.model) R.LV.err = 'The numbers could not be read' + (j && j.error ? ': ' + j.error : '') + '.';
610
+ else { R.LV.m = j.model; R.LV.at = j.as_of ? Date.parse(j.as_of) || Date.now() : Date.now(); }
611
+ draw();
612
+ }
613
+ function liveAct(a, v) {
614
+ const L = R.LV; if (!L) return;
615
+ if (a === 'goal') { L.pick = v; L.hover = null; return draw(); }
616
+ if (a === 'range') { L.range = v; L.hover = null; return draw(); }
617
+ if (a === 'pt') { L.hover = +v; return draw(); }
618
+ if (a === 'row') { L.open = L.open === v ? null : v; return draw(); }
619
+ if (a === 'prod') { R.pop = R.pop === 'prod' ? null : 'prod'; return draw(); }
620
+ if (a === 'board') { const [ws, id] = v.split('~'); R.pop = null; return readLive({ ws, id }); }
621
+ }
462
622
 
463
623
  /* ── share (Link | Send a file): POST /api/shares makes a copy of the file as it is now ── */
464
624
  async function openShare() {
@@ -574,23 +734,25 @@ function printIt() {
574
734
  w.focus(); setTimeout(() => { try { w.print(); } catch { /* the PM prints from the window */ } }, 300);
575
735
  }
576
736
 
577
- /* ── Present: the current slide on the whole screen (Waiting for design) ── */
737
+ /* ── Present: the current slide on the whole screen (RpPhone Present; the strip and the hint of MtPresent) ── */
578
738
  function present(on) {
579
739
  let p = document.getElementById('vzPres');
580
740
  if (!on) { if (!p) return; p.remove(); if (document.fullscreenElement) document.exitFullscreen().catch(() => {}); if (R) draw(); const b = bodyEl() && bodyEl().querySelector('[data-r="present"]'); if (b) b.focus(); return; }
581
741
  const L = slides(); if (!L.length) return say('This cycle has no slides to present.');
582
742
  if (!p) {
583
- p = document.createElement('div'); p.id = 'vzPres'; p.className = 'vz vz-pres'; p.setAttribute('role', 'dialog'); p.setAttribute('aria-modal', 'true'); p.setAttribute('aria-label', 'Presenting ' + R.name); p.tabIndex = -1; p.dataset.escLayer = '1';
584
- p.onclick = (e) => { const t = e.target.closest('[data-r]'); if (!t || t.disabled) return; const k = t.dataset.r; if (k === 'end') return present(false); R.i += k === 'next' ? 1 : -1; present(true); };
743
+ p = document.createElement('div'); p.id = 'vzPres'; p.className = 'vz vz-pres rp-pres'; p.setAttribute('role', 'dialog'); p.setAttribute('aria-modal', 'true'); p.setAttribute('aria-label', 'Presenting ' + R.name); p.tabIndex = -1; p.dataset.escLayer = '1';
744
+ R.blank = false;
745
+ p.onclick = (e) => { const t = e.target.closest('[data-r]'); if (!t || t.disabled) return; const [k, v] = t.dataset.r.split('|'); if (k === 'end') return present(false); if (k === 'go') R.i = +v; else R.i += k === 'next' ? 1 : -1; R.blank = false; present(true); };
585
746
  p.onkeydown = (e) => {
586
747
  if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); return present(false); }
587
- if (/^Arrow(Left|Right)$/.test(e.key)) { e.preventDefault(); const j = R.i + (e.key === 'ArrowRight' ? 1 : -1); if (j >= 0 && j < slides().length) { R.i = j; present(true); } }
748
+ if (e.key === 'b' || e.key === 'B') { e.preventDefault(); R.blank = !R.blank; return present(true); }
749
+ if (/^Arrow(Left|Right)$/.test(e.key)) { e.preventDefault(); const j = R.i + (e.key === 'ArrowRight' ? 1 : -1); if (j >= 0 && j < slides().length) { R.i = j; R.blank = false; present(true); } }
588
750
  };
589
751
  document.body.appendChild(p);
590
752
  if (p.requestFullscreen && !document.fullscreenElement) p.requestFullscreen().catch(() => {});
591
753
  }
592
754
  const i = R.i = Math.max(0, Math.min(R.i, L.length - 1));
593
- p.innerHTML = `<div class="vz-slide">${slideCard(L[i])}</div><div class="vz-snav">${ib('prev', ic('prev', 16), 'Previous slide', { off: i === 0 })}<span>${i + 1} of ${L.length}</span>${ib('next', ic('next', 16), 'Next slide', { off: i === L.length - 1 })}${ib('end', ic('x', 16), 'Stop presenting')}${WAIT('Present')}</div>`;
755
+ p.innerHTML = presentHtml({ name: R.name, i, n: L.length, slide: slideCard(L[i]), blank: R.blank });
594
756
  fit(p); p.focus();
595
757
  }
596
758
  if (typeof document !== 'undefined') document.addEventListener('fullscreenchange', () => { if (!document.fullscreenElement && document.getElementById('vzPres')) present(false); });
@@ -610,9 +772,10 @@ export async function openReport(row, hand = {}) {
610
772
  if (!row || !row.path) return null;
611
773
  const c = cycleOf(row);
612
774
  row = { ...row, cadence: c.cadence, slot: c.slot };
775
+ rpStyle();
613
776
  if (R) present(false);
614
777
  const me = R = { row, ws: hand.ws || '', id: c.cadence, name: hand.name || row.name || c.cadence || 'Report', audience: hand.audience || '', issued: row.state === 'issued', archived: !!row.archived,
615
- text: '', err: '', W: null, view: 'deck', i: 0, cyc: null, setup: undefined, pop: null, conf: false, checks: null, issueErr: '', busy: false, ask: '', askErr: '', edit: false, msg: null,
778
+ text: '', err: '', W: null, view: 'deck', tab: 'report', BF: null, bfRaw: null, bfMsg: '', LV: null, blank: false, i: 0, cyc: null, setup: undefined, pop: null, conf: false, checks: null, issueErr: '', busy: false, ask: '', askErr: '', edit: false, msg: null,
616
779
  sch: schedPick(null), schErr: '', shr: null, hand, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
617
780
  const head = () => ({ id: me.vid, kind: 'Report' + (me.audience ? ' · ' + me.audience : ''), title: me.name, icon: 'report', full: true, url: viewUrl(row, me.ws), render: (b) => { b.innerHTML = panelHtml(); wire(b); }, onClose: () => { if (R === me && !me.reopen) { present(false); R = null; } } });
618
781
  vOpen(head());
@@ -625,6 +788,7 @@ export async function openReport(row, hand = {}) {
625
788
  }
626
789
  await Promise.all([readCycle(), readSetup()]);
627
790
  if (R !== me) return me;
791
+ readBrief(); // the Brief tab's count shows at once
628
792
  if (vCur() && vCur().id === me.vid && (vCur().title !== me.name || me.audience)) { me.reopen = true; vOpen(head()); me.reopen = false; } // the name and audience are known now
629
793
  draw();
630
794
  return me;