@opengeni/react 6.37.3 → 6.37.4-canary.45279257475001

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 (1192) hide show
  1. package/dist/app/app-state.js +32 -32
  2. package/dist/app/components/Composer.css +1 -1
  3. package/dist/app/components/Composer.css.map +1 -1
  4. package/dist/app/components/Composer.js +44 -43
  5. package/dist/app/components/add-card-dialog.js +3 -2
  6. package/dist/app/components/add-card-dialog.js.map +1 -1
  7. package/dist/app/components/add-card.js +3 -3
  8. package/dist/app/components/agent/agent-capability-picker.js +9 -9
  9. package/dist/app/components/agents/agent-can-use.js +48 -47
  10. package/dist/app/components/agents/agent-form-page.js +143 -142
  11. package/dist/app/components/agents/agent-form-page.js.map +1 -1
  12. package/dist/app/components/agents/agent-page.js +124 -123
  13. package/dist/app/components/agents/agent-setup-sections.js +78 -77
  14. package/dist/app/components/agents/agent-skills.js +14 -13
  15. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  16. package/dist/app/components/agents/agent-trigger-dialog.js +34 -33
  17. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  18. package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
  19. package/dist/app/components/agents/agents-page.js +96 -95
  20. package/dist/app/components/agents/agents-page.js.map +1 -1
  21. package/dist/app/components/agents/composer-agent-chip.js +60 -59
  22. package/dist/app/components/agents/session-agent-chip.js +55 -54
  23. package/dist/app/components/artifacts/app-package.js +13 -12
  24. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  25. package/dist/app/components/artifacts/artifact-library.js +29 -28
  26. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  27. package/dist/app/components/artifacts/artifact-viewer.js +67 -66
  28. package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
  29. package/dist/app/components/artifacts/chat-interactive-block.js +30 -29
  30. package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
  31. package/dist/app/components/artifacts/copy-artifact-link.js +2 -2
  32. package/dist/app/components/artifacts/file-reach-dialog.js +13 -12
  33. package/dist/app/components/artifacts/inline-chat-image.js +52 -51
  34. package/dist/app/components/artifacts/ready-made-apps.js +13 -12
  35. package/dist/app/components/artifacts/retained-file-preview.js +58 -57
  36. package/dist/app/components/artifacts/retained-text-preview.js +8 -8
  37. package/dist/app/components/artifacts/site-actions.js +12 -12
  38. package/dist/app/components/artifacts/site-audience.js +9 -8
  39. package/dist/app/components/artifacts/site-conversations.js +35 -35
  40. package/dist/app/components/artifacts/site-data.js +27 -26
  41. package/dist/app/components/artifacts/site-public-link.js +3 -3
  42. package/dist/app/components/artifacts/site-publishing-page.js +69 -68
  43. package/dist/app/components/artifacts/site-publishing.js +54 -53
  44. package/dist/app/components/artifacts/site-settings.js +68 -67
  45. package/dist/app/components/artifacts/site-version-menu.js +10 -10
  46. package/dist/app/components/billing-class-mark.js +7 -7
  47. package/dist/app/components/capabilities/capability-detail-sheet.js +18 -17
  48. package/dist/app/components/capabilities/capability-logo-source.js +29 -28
  49. package/dist/app/components/capabilities/capability-logo.js +1 -1
  50. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  51. package/dist/app/components/capabilities/connection-ownership-selector.js +4 -3
  52. package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
  53. package/dist/app/components/capabilities/detail-dialog.js +3 -2
  54. package/dist/app/components/capabilities/native-connect-setup.js +32 -31
  55. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
  56. package/dist/app/components/capabilities/perform-capability-action.js +2 -2
  57. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +32 -31
  58. package/dist/app/components/capabilities/session-capability-card.css +1 -1
  59. package/dist/app/components/capabilities/session-capability-card.css.map +1 -1
  60. package/dist/app/components/capabilities/session-capability-card.js +136 -135
  61. package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
  62. package/dist/app/components/capabilities/session-chrome-card.css +1 -1
  63. package/dist/app/components/capabilities/session-chrome-card.css.map +1 -1
  64. package/dist/app/components/capabilities/session-chrome-card.js +49 -48
  65. package/dist/app/components/capabilities/session-connect-inputs-card.js +34 -33
  66. package/dist/app/components/capabilities/session-custom-mcp-card.js +39 -38
  67. package/dist/app/components/capabilities/session-github-card.js +45 -44
  68. package/dist/app/components/capabilities/session-machine-card.css +1 -1
  69. package/dist/app/components/capabilities/session-machine-card.css.map +1 -1
  70. package/dist/app/components/capabilities/session-machine-card.js +50 -49
  71. package/dist/app/components/capabilities/session-personal-github-card.js +33 -32
  72. package/dist/app/components/capabilities/session-plugin-card.js +21 -20
  73. package/dist/app/components/capabilities/use-capabilities-catalog.js +1 -1
  74. package/dist/app/components/capabilities/use-connection-accounts.js +2 -2
  75. package/dist/app/components/chat-payment-pages.js +2 -2
  76. package/dist/app/components/command-menu/chat-status.js +26 -26
  77. package/dist/app/components/command-menu/chat-switcher.js +87 -86
  78. package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
  79. package/dist/app/components/command-menu/command-menu.js +332 -330
  80. package/dist/app/components/command-menu/command-menu.js.map +1 -1
  81. package/dist/app/components/command-menu/shortcut-sheet.js +27 -26
  82. package/dist/app/components/command-menu/shortcut-sheet.js.map +1 -1
  83. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  84. package/dist/app/components/composer-mobile-plus-panel.js +29 -28
  85. package/dist/app/components/composer-mobile-plus-panel.js.map +1 -1
  86. package/dist/app/components/composer-mobile-plus.js +5 -4
  87. package/dist/app/components/credit-required-gate.js +7 -7
  88. package/dist/app/components/credit-required-prompt.js +25 -24
  89. package/dist/app/components/credit-required-prompt.js.map +1 -1
  90. package/dist/app/components/credits/checkout-credits-celebration.js +4 -3
  91. package/dist/app/components/credits/checkout-return.js +4 -3
  92. package/dist/app/components/credits/checkout-return.js.map +1 -1
  93. package/dist/app/components/credits/coupon-redeem.js +1 -1
  94. package/dist/app/components/credits/credit-refusal-notice.js +7 -7
  95. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  96. package/dist/app/components/desktop/app-shots.css +1 -1
  97. package/dist/app/components/desktop/app-shots.css.map +1 -1
  98. package/dist/app/components/desktop/app-shots.js +10 -9
  99. package/dist/app/components/desktop/app-update.js +3 -3
  100. package/dist/app/components/desktop/computer-use.js +3 -3
  101. package/dist/app/components/desktop/this-computer.css +1 -1
  102. package/dist/app/components/desktop/this-computer.css.map +1 -1
  103. package/dist/app/components/desktop/this-computer.js +7 -6
  104. package/dist/app/components/feedback.js +11 -10
  105. package/dist/app/components/follow-up-repository-menu-body.js +13 -13
  106. package/dist/app/components/follow-up-repository-picker.js +1 -1
  107. package/dist/app/components/github-app-connect-launcher.js +3 -3
  108. package/dist/app/components/in-app-help-link.js +3 -3
  109. package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
  110. package/dist/app/components/machines/connect-machine-dialog.css +1 -1
  111. package/dist/app/components/machines/connect-machine-dialog.css.map +1 -1
  112. package/dist/app/components/machines/connect-machine-dialog.js +25 -24
  113. package/dist/app/components/manual-repository-editor.js +3 -3
  114. package/dist/app/components/markdown.js +16 -15
  115. package/dist/app/components/model-identity.js +3 -3
  116. package/dist/app/components/models/models-ui.js +17 -16
  117. package/dist/app/components/models/provider-mark.js +3 -3
  118. package/dist/app/components/models/subscription-usage.js +5 -5
  119. package/dist/app/components/my-things.js +16 -15
  120. package/dist/app/components/my-things.js.map +1 -1
  121. package/dist/app/components/own-where-it-works.js +11 -10
  122. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  123. package/dist/app/components/pickers.js +11 -11
  124. package/dist/app/components/rail/channel-create-dialog.js +7 -6
  125. package/dist/app/components/rail/project-glyph.js +53 -52
  126. package/dist/app/components/rail/project-profile.js +74 -73
  127. package/dist/app/components/rail/rail-context.js +2 -2
  128. package/dist/app/components/rail/rail-sections.js +155 -154
  129. package/dist/app/components/rail/session-header.js +125 -124
  130. package/dist/app/components/rail/session-list.js +152 -151
  131. package/dist/app/components/rail/session-row-content.js +6 -6
  132. package/dist/app/components/rail/session-row-hover-details.js +36 -36
  133. package/dist/app/components/rail/session-shell.js +192 -191
  134. package/dist/app/components/rail/site-session-group-heading.js +36 -36
  135. package/dist/app/components/repository-picker.js +13 -13
  136. package/dist/app/components/secrets/session-secrets-panel.js +4 -4
  137. package/dist/app/components/session/agent-configuration-panel.js +45 -44
  138. package/dist/app/components/session/agent-configuration-panel.js.map +1 -1
  139. package/dist/app/components/session/artifact-session-page.js +7 -7
  140. package/dist/app/components/session/banners.js +20 -19
  141. package/dist/app/components/session/chat-avatar.js +53 -52
  142. package/dist/app/components/session/console-new-conversation.css +1 -1
  143. package/dist/app/components/session/console-new-conversation.css.map +1 -1
  144. package/dist/app/components/session/console-new-conversation.js +110 -109
  145. package/dist/app/components/session/descendant-requests.js +110 -109
  146. package/dist/app/components/session/descendant-requests.js.map +1 -1
  147. package/dist/app/components/session/editable-artifacts-workspace.js +60 -59
  148. package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
  149. package/dist/app/components/session/failed-session-banner.js +29 -28
  150. package/dist/app/components/session/failed-session-banner.js.map +1 -1
  151. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  152. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  153. package/dist/app/components/session/human-input.js +88 -87
  154. package/dist/app/components/session/inspector.js +146 -145
  155. package/dist/app/components/session/inspector.js.map +1 -1
  156. package/dist/app/components/session/linked-panel.js +3 -3
  157. package/dist/app/components/session/message-actions.js +11 -10
  158. package/dist/app/components/session/message-actions.js.map +1 -1
  159. package/dist/app/components/session/model-recovery-notice.js +4 -4
  160. package/dist/app/components/session/new-session-settings-menu.css +1 -1
  161. package/dist/app/components/session/new-session-settings-menu.css.map +1 -1
  162. package/dist/app/components/session/new-session-settings-menu.js +30 -29
  163. package/dist/app/components/session/new-session-setup-strip.js +56 -55
  164. package/dist/app/components/session/pull-request-panel.js +25 -24
  165. package/dist/app/components/session/sandbox-recovery-actions.js +5 -4
  166. package/dist/app/components/session/sandbox-switcher.js +22 -22
  167. package/dist/app/components/session/sandbox-workspace.js +120 -119
  168. package/dist/app/components/session/search-markdown-highlight.js +17 -16
  169. package/dist/app/components/session/search-results-view.js +18 -17
  170. package/dist/app/components/session/session-admin-access.js +14 -13
  171. package/dist/app/components/session/session-admission-notice.js +11 -11
  172. package/dist/app/components/session/session-avatar-picker.js +60 -59
  173. package/dist/app/components/session/session-avatar.js +55 -54
  174. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  175. package/dist/app/components/session/session-profile-dialog.js +71 -70
  176. package/dist/app/components/session/session-profile-editor.js +72 -71
  177. package/dist/app/components/session/session-retention.js +6 -6
  178. package/dist/app/components/session/session-search-dialog.js +21 -20
  179. package/dist/app/components/session/session-search-dialog.js.map +1 -1
  180. package/dist/app/components/session/session-skill-reviews.js +5 -5
  181. package/dist/app/components/session/session-tenancy-control.js +32 -31
  182. package/dist/app/components/session/session-tenancy-control.js.map +1 -1
  183. package/dist/app/components/session/session-unattended-setting.js +1 -1
  184. package/dist/app/components/session/session-usage-limit-section.js +11 -11
  185. package/dist/app/components/session/share-chat-dialog.js +11 -10
  186. package/dist/app/components/session/subagents.js +23 -23
  187. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  188. package/dist/app/components/session/subscription-account-menu.js +7 -7
  189. package/dist/app/components/session-connectors-menu-body.js +10 -10
  190. package/dist/app/components/settings/row-select.js +6 -6
  191. package/dist/app/components/toaster.js +2 -2
  192. package/dist/app/components/transcription-settings.js +10 -10
  193. package/dist/app/components/ui/destructive-confirm.js +11 -10
  194. package/dist/app/components/usage/usage-entry.js +8 -8
  195. package/dist/app/components/window-bar.js +26 -26
  196. package/dist/app/components/workspace-composer-plus.js +44 -43
  197. package/dist/app/components/workspace-reach.js +6 -6
  198. package/dist/app/embed/session-app.css +1 -1
  199. package/dist/app/embed/session-app.css.map +1 -1
  200. package/dist/app/embed/session-app.js +388 -387
  201. package/dist/app/lib/actions/actions-provider.js +19 -19
  202. package/dist/app/lib/agent-capabilities.js +4 -4
  203. package/dist/app/lib/app-connect-card.js +15 -14
  204. package/dist/app/lib/app-shared-key-dialog.js +9 -8
  205. package/dist/app/lib/app-surfaces.js +2 -2
  206. package/dist/app/lib/app-sync-opt-in.js +6 -5
  207. package/dist/app/lib/codex-usage-query.js +3 -3
  208. package/dist/app/lib/composer-agent.js +2 -2
  209. package/dist/app/lib/composer-connectors.js +33 -32
  210. package/dist/app/lib/composer-send-blocking.js +2 -2
  211. package/dist/app/lib/console-site.js +8 -7
  212. package/dist/app/lib/console-text.js +2 -2
  213. package/dist/app/lib/events.js +30 -29
  214. package/dist/app/lib/failed-session-copy.js +5 -5
  215. package/dist/app/lib/feedback-capture.js +2 -2
  216. package/dist/app/lib/model-access-onboarding.js +4 -4
  217. package/dist/app/lib/move-chat-to-machine.js +5 -5
  218. package/dist/app/lib/personal-resource-attachments.js +1 -1
  219. package/dist/app/lib/session-branch-cache.js +19 -19
  220. package/dist/app/lib/session-create.js +5 -5
  221. package/dist/app/lib/session-group-pagination.js +19 -19
  222. package/dist/app/lib/session-hover-facts.js +26 -26
  223. package/dist/app/lib/session-list-dirty-scopes.js +20 -20
  224. package/dist/app/lib/session-model.js +2 -2
  225. package/dist/app/lib/session-rail.js +16 -16
  226. package/dist/app/lib/session-rename.js +3 -3
  227. package/dist/app/lib/sessions-group.js +23 -23
  228. package/dist/app/lib/site-tool-consent-dialog.js +25 -24
  229. package/dist/app/lib/site-tool-consent-dialog.js.map +1 -1
  230. package/dist/app/lib/site-tool-consent.js +1 -1
  231. package/dist/app/lib/turn-failure-analytics.js +6 -6
  232. package/dist/app/lib/use-artifact-catalog.js +2 -2
  233. package/dist/app/lib/use-duplicate-site.js +5 -5
  234. package/dist/app/lib/use-follow-up-repositories.js +7 -6
  235. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  236. package/dist/app/lib/use-workspace-machines.js +9 -9
  237. package/dist/app/lib/use-workspace-model-catalog.js +5 -5
  238. package/dist/app/lib/use-workspace-rigs.js +6 -6
  239. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  240. package/dist/app/lib/workspace-scope-context.js +4 -4
  241. package/dist/app/routes/app-page-view.js +22 -21
  242. package/dist/app/routes/app-page-view.js.map +1 -1
  243. package/dist/app/routes/app-page.js +2 -2
  244. package/dist/app/routes/artifacts.js +153 -152
  245. package/dist/app/routes/artifacts.js.map +1 -1
  246. package/dist/app/routes/retained-artifact.js +106 -105
  247. package/dist/app/routes/retained-artifact.js.map +1 -1
  248. package/dist/app/routes/session-unavailable.js +6 -6
  249. package/dist/app/routes/session.css +1 -1
  250. package/dist/app/routes/session.css.map +1 -1
  251. package/dist/app/routes/session.js +246 -245
  252. package/dist/app/routes/sessions-index-hydration.js +6 -6
  253. package/dist/app/routes/sessions-index.css +1 -1
  254. package/dist/app/routes/sessions-index.css.map +1 -1
  255. package/dist/app/routes/sessions-index.js +202 -201
  256. package/dist/app/routes/site-view.css +1 -1
  257. package/dist/app/routes/site-view.css.map +1 -1
  258. package/dist/app/routes/site-view.js +195 -194
  259. package/dist/app/routes/site-view.js.map +1 -1
  260. package/dist/artifacts-document.js +4 -4
  261. package/dist/artifacts-presentation.js +9 -8
  262. package/dist/artifacts-spreadsheet.js +4 -4
  263. package/dist/artifacts.js +51 -50
  264. package/dist/automation-model.js +6 -6
  265. package/dist/automations.js +71 -70
  266. package/dist/automations.js.map +1 -1
  267. package/dist/browser-viewer-O5FJOWWI.js +23 -0
  268. package/dist/chat-interactive-block-TQTOUHRC.js +22 -0
  269. package/dist/chunk-23TTCFRP.js +3690 -0
  270. package/dist/chunk-2BOFLWNJ.js +129 -0
  271. package/dist/chunk-2NO5QJCL.js +438 -0
  272. package/dist/chunk-2NO5QJCL.js.map +1 -0
  273. package/dist/chunk-3DMD2KHT.js +851 -0
  274. package/dist/chunk-3DOISS3I.js +132 -0
  275. package/dist/chunk-3KWTXE4O.js +199 -0
  276. package/dist/chunk-3TRERIPD.js +93 -0
  277. package/dist/chunk-3UXBTL7Z.js +92 -0
  278. package/dist/chunk-3XEKXNB4.js +283 -0
  279. package/dist/chunk-3ZJUQG4K.js +428 -0
  280. package/dist/chunk-42WTAUUW.js +335 -0
  281. package/dist/chunk-46ZC5VNC.js +38 -0
  282. package/dist/chunk-4BVEFGX7.js +166 -0
  283. package/dist/chunk-4IOFV4S4.js +401 -0
  284. package/dist/chunk-4ISXBLJV.js +137 -0
  285. package/dist/chunk-4L2MBYLH.js +283 -0
  286. package/dist/chunk-4N3B25HA.js +850 -0
  287. package/dist/chunk-4N3B25HA.js.map +1 -0
  288. package/dist/chunk-4NWUZ6SL.js +176 -0
  289. package/dist/chunk-4QVX6CTT.js +318 -0
  290. package/dist/chunk-4YARO4Y5.js +2984 -0
  291. package/dist/chunk-4Z7BPBS7.js +34 -0
  292. package/dist/chunk-55ILMX6B.js +794 -0
  293. package/dist/chunk-57OAQTWD.js +103 -0
  294. package/dist/chunk-5BRPLALX.js +380 -0
  295. package/dist/chunk-5BRPLALX.js.map +1 -0
  296. package/dist/chunk-5EF4JI6Q.js +214 -0
  297. package/dist/chunk-5EF4JI6Q.js.map +1 -0
  298. package/dist/chunk-5GXX3NI7.js +46 -0
  299. package/dist/chunk-5VE3PPSK.js +353 -0
  300. package/dist/chunk-62T2ZPD5.js +266 -0
  301. package/dist/chunk-655JT4VH.js +251 -0
  302. package/dist/chunk-65OPNLE4.js +505 -0
  303. package/dist/chunk-67PIP46J.js +229 -0
  304. package/dist/chunk-6CAK65QV.js +211 -0
  305. package/dist/chunk-6CDBX3XG.js +33 -0
  306. package/dist/chunk-6D3D2JWY.js +278 -0
  307. package/dist/chunk-6DGQB6GT.js +107 -0
  308. package/dist/chunk-6NFK3J2O.js +188 -0
  309. package/dist/chunk-6R3QX3AC.js +538 -0
  310. package/dist/chunk-6S5OMLAL.js +400 -0
  311. package/dist/chunk-6SG2VVVB.js +249 -0
  312. package/dist/chunk-6U57GGJI.js +110 -0
  313. package/dist/chunk-6V2PEFPS.js +98 -0
  314. package/dist/chunk-6VASZZVV.js +3321 -0
  315. package/dist/chunk-7BBYH5R5.js +168 -0
  316. package/dist/chunk-7EO3T3IX.js +209 -0
  317. package/dist/chunk-7EZQ6EKM.js +158 -0
  318. package/dist/chunk-7HI53NPP.js +15 -0
  319. package/dist/chunk-7J4BFENI.js +37 -0
  320. package/dist/chunk-7LSGNY2L.js +114 -0
  321. package/dist/chunk-7MMONDFK.js +1236 -0
  322. package/dist/chunk-7MWPBGDX.js +175 -0
  323. package/dist/chunk-7NSDIQMY.js +371 -0
  324. package/dist/chunk-7XPDLT5G.js +231 -0
  325. package/dist/chunk-A3BCF4MV.js +378 -0
  326. package/dist/chunk-A5GX3CAE.js +849 -0
  327. package/dist/chunk-AAHQJWEP.js +515 -0
  328. package/dist/chunk-AAWEPZOG.js +144 -0
  329. package/dist/chunk-ABRT345L.js +598 -0
  330. package/dist/chunk-AJ7KJ7XZ.js +4519 -0
  331. package/dist/chunk-AJ7KJ7XZ.js.map +1 -0
  332. package/dist/chunk-ANXFE2EP.js +91 -0
  333. package/dist/chunk-AQNE4XWU.js +271 -0
  334. package/dist/chunk-AV2OMWDS.js +4979 -0
  335. package/dist/chunk-AYHMHAU5.js +1019 -0
  336. package/dist/chunk-AZ637XK3.js +50 -0
  337. package/dist/chunk-B6AH43UQ.js +2434 -0
  338. package/dist/chunk-BBECLK22.js +383 -0
  339. package/dist/chunk-BWYPJG3P.js +158 -0
  340. package/dist/chunk-CI7F4Y26.js +396 -0
  341. package/dist/chunk-CNLSXEQC.js +931 -0
  342. package/dist/chunk-COCB4HE3.js +65 -0
  343. package/dist/chunk-CPEVLG3B.js +357 -0
  344. package/dist/chunk-CRHH5C6Z.js +5920 -0
  345. package/dist/chunk-CRHH5C6Z.js.map +1 -0
  346. package/dist/chunk-CVC4RO7D.js +155 -0
  347. package/dist/chunk-CY6RLRHJ.js +3110 -0
  348. package/dist/chunk-D3WLSMCL.js +117 -0
  349. package/dist/chunk-D7SSOJEU.js +178 -0
  350. package/dist/chunk-DBOD5WXT.js +818 -0
  351. package/dist/chunk-DFWSRIFL.js +162 -0
  352. package/dist/chunk-DITZUBOK.js +126 -0
  353. package/dist/chunk-DKD2ZZSJ.js +287 -0
  354. package/dist/chunk-DOJWHSRD.js +246 -0
  355. package/dist/chunk-DR6LZXJI.js +187 -0
  356. package/dist/chunk-DV73XOVB.js +650 -0
  357. package/dist/chunk-DYO7DNDD.js +316 -0
  358. package/dist/chunk-DYZASWWT.js +234 -0
  359. package/dist/chunk-EAJHD44A.js +573 -0
  360. package/dist/chunk-EAJHD44A.js.map +1 -0
  361. package/dist/chunk-EC5HUNXI.js +1263 -0
  362. package/dist/chunk-ECQ7FV3E.js +247 -0
  363. package/dist/chunk-ECVCSZWY.js +406 -0
  364. package/dist/chunk-EMXO5HCY.js +333 -0
  365. package/dist/chunk-ENJX5TAA.js +265 -0
  366. package/dist/chunk-EQSYPIAI.js +66 -0
  367. package/dist/chunk-EV73XMK3.js +1152 -0
  368. package/dist/chunk-F2SGC74A.js +2553 -0
  369. package/dist/chunk-F3LIUDXN.js +738 -0
  370. package/dist/chunk-F3LIUDXN.js.map +1 -0
  371. package/dist/chunk-F5ABIEWA.js +1029 -0
  372. package/dist/chunk-F5ABIEWA.js.map +1 -0
  373. package/dist/chunk-F5DEBD4D.js +230 -0
  374. package/dist/chunk-F6JJBUQ2.js +566 -0
  375. package/dist/chunk-FEVZDJOZ.js +1024 -0
  376. package/dist/chunk-FF22IUY3.js +121 -0
  377. package/dist/chunk-FILRDNUQ.js +256 -0
  378. package/dist/chunk-FLB3BP2E.js +227 -0
  379. package/dist/chunk-FZVMMHPC.js +639 -0
  380. package/dist/chunk-G6D5NVWM.js +112 -0
  381. package/dist/chunk-GGH5STTP.js +192 -0
  382. package/dist/chunk-GGHX6GS7.js +187 -0
  383. package/dist/chunk-GIHE7U3Y.js +174 -0
  384. package/dist/chunk-GO5VIAA7.js +264 -0
  385. package/dist/chunk-GSK637QS.js +27 -0
  386. package/dist/chunk-HBYO34CP.js +56 -0
  387. package/dist/chunk-HFROJDFQ.js +118 -0
  388. package/dist/chunk-HGEDFQ7G.js +251 -0
  389. package/dist/chunk-HH3QTFGV.js +1356 -0
  390. package/dist/chunk-HHFFPE67.js +220 -0
  391. package/dist/chunk-HHYTB5OL.js +246 -0
  392. package/dist/chunk-HPKWAHHI.js +48 -0
  393. package/dist/chunk-HSPOCEGP.js +373 -0
  394. package/dist/chunk-IC74VN2I.js +608 -0
  395. package/dist/chunk-ICSQO2CV.js +1021 -0
  396. package/dist/chunk-IEZE7SL6.js +3070 -0
  397. package/dist/chunk-IGHNTARW.js +170 -0
  398. package/dist/chunk-IKYS56PQ.js +138 -0
  399. package/dist/chunk-IO474NRY.js +56 -0
  400. package/dist/chunk-IP2CCFAV.js +723 -0
  401. package/dist/chunk-IT5GF54F.js +3851 -0
  402. package/dist/chunk-IX67G5FD.js +270 -0
  403. package/dist/chunk-IXNJK7KJ.js +292 -0
  404. package/dist/chunk-IZWTARYT.js +276 -0
  405. package/dist/chunk-JBV2HY43.js +108 -0
  406. package/dist/chunk-JE62XK5K.js +33 -0
  407. package/dist/chunk-JFAWCALM.js +85 -0
  408. package/dist/chunk-JQGPATQZ.js +83 -0
  409. package/dist/chunk-JYZGX5UZ.js +274 -0
  410. package/dist/chunk-K227GMSM.js +72 -0
  411. package/dist/chunk-KB2O7JIJ.js +449 -0
  412. package/dist/chunk-KT6GC67G.js +12 -0
  413. package/dist/chunk-KTGKGHEA.js +75 -0
  414. package/dist/chunk-KU77XHWB.js +285 -0
  415. package/dist/chunk-KZIRVLCM.js +175 -0
  416. package/dist/chunk-L3DUSTRN.js +259 -0
  417. package/dist/chunk-L6WVCO6D.js +61 -0
  418. package/dist/chunk-L7PCZEEG.js +79 -0
  419. package/dist/chunk-LEN2DVU6.js +311 -0
  420. package/dist/chunk-LGOQW2CE.js +191 -0
  421. package/dist/chunk-LK2JO72Y.js +389 -0
  422. package/dist/chunk-LSJPFW34.js +3996 -0
  423. package/dist/chunk-LSJPFW34.js.map +1 -0
  424. package/dist/chunk-LXLHIOJM.js +584 -0
  425. package/dist/chunk-LYQQ4VBE.js +1333 -0
  426. package/dist/chunk-M22ZHQ7S.js +1628 -0
  427. package/dist/chunk-M5RKFV6K.js +20 -0
  428. package/dist/chunk-MCPKUVMQ.js +99 -0
  429. package/dist/chunk-MDGNCUAC.js +145 -0
  430. package/dist/chunk-MFLU3466.js +99 -0
  431. package/dist/chunk-MIUJ3EH5.js +60 -0
  432. package/dist/chunk-MO3XJQN2.js +629 -0
  433. package/dist/chunk-MTHAYXDH.js +107 -0
  434. package/dist/chunk-MVYQDBE6.js +79 -0
  435. package/dist/chunk-NA7VZQPL.js +307 -0
  436. package/dist/chunk-ND6FWOSO.js +2431 -0
  437. package/dist/chunk-NGTCSS53.js +24 -0
  438. package/dist/chunk-NGTCSS53.js.map +1 -0
  439. package/dist/chunk-NIFPH34L.js +351 -0
  440. package/dist/chunk-NKYC6WHQ.js +103 -0
  441. package/dist/chunk-NML7VKLU.js +391 -0
  442. package/dist/chunk-NPAWLKJB.js +41 -0
  443. package/dist/chunk-NQSKI2YD.js +1185 -0
  444. package/dist/chunk-NXQFBC22.js +114 -0
  445. package/dist/chunk-NXRZMHVM.js +43 -0
  446. package/dist/chunk-NYU5DE4K.js +1309 -0
  447. package/dist/chunk-O2EEYPIZ.js +48 -0
  448. package/dist/chunk-O4TOEISQ.js +67 -0
  449. package/dist/chunk-O533L2TG.js +129 -0
  450. package/dist/chunk-O664PL2U.js +47 -0
  451. package/dist/chunk-O664PL2U.js.map +1 -0
  452. package/dist/chunk-ON6ZGJDW.js +532 -0
  453. package/dist/chunk-OPELE3Z4.js +311 -0
  454. package/dist/chunk-OTSUC6PP.js +234 -0
  455. package/dist/chunk-OXM267RC.js +128 -0
  456. package/dist/chunk-OXM267RC.js.map +1 -0
  457. package/dist/chunk-OZNL5OKT.js +1184 -0
  458. package/dist/chunk-P3PDKPLK.js +432 -0
  459. package/dist/chunk-PCZBYN2H.js +372 -0
  460. package/dist/chunk-PIPXXQFV.js +57 -0
  461. package/dist/chunk-PMUZUPPE.js +131 -0
  462. package/dist/chunk-PN52EIFV.js +113 -0
  463. package/dist/chunk-PPQJIVGM.js +175 -0
  464. package/dist/chunk-PQYFOTNI.js +469 -0
  465. package/dist/chunk-PUX4YJAW.js +1095 -0
  466. package/dist/chunk-PYMQM65Y.js +125 -0
  467. package/dist/chunk-Q5UO7GT5.js +404 -0
  468. package/dist/chunk-QA5UNVHD.js +85 -0
  469. package/dist/chunk-QDZR7FXG.js +215 -0
  470. package/dist/chunk-QNOWKKZ4.js +40 -0
  471. package/dist/chunk-QUXQYYZO.js +73 -0
  472. package/dist/chunk-QVOTPOXK.js +29 -0
  473. package/dist/chunk-R2DSOIME.js +772 -0
  474. package/dist/chunk-RFQQXXJ6.js +366 -0
  475. package/dist/chunk-RLWI34XM.js +27 -0
  476. package/dist/chunk-RMWCGSEP.js +124 -0
  477. package/dist/chunk-ROTEQD2Z.js +441 -0
  478. package/dist/chunk-RPCWZFP7.js +296 -0
  479. package/dist/chunk-RW5QRWVI.js +141 -0
  480. package/dist/chunk-RZZHOHL6.js +5089 -0
  481. package/dist/chunk-S5STZCBZ.js +133 -0
  482. package/dist/chunk-SD4A5P24.js +1803 -0
  483. package/dist/chunk-SJM4TCWJ.js +197 -0
  484. package/dist/chunk-SJXK56WZ.js +905 -0
  485. package/dist/chunk-SJXK56WZ.js.map +1 -0
  486. package/dist/chunk-SQYTYXR4.js +100 -0
  487. package/dist/chunk-SRDHDIRQ.js +177 -0
  488. package/dist/chunk-SVC674IM.js +263 -0
  489. package/dist/chunk-SYYFA7W7.js +23 -0
  490. package/dist/chunk-T2UUHB7V.js +1187 -0
  491. package/dist/chunk-TBOH54QP.js +298 -0
  492. package/dist/chunk-TG2GO424.js +196 -0
  493. package/dist/chunk-TOJNLC42.js +107 -0
  494. package/dist/chunk-TW75KM7T.js +412 -0
  495. package/dist/chunk-TWWAPJYE.js +26 -0
  496. package/dist/chunk-UARZCGWU.js +202 -0
  497. package/dist/chunk-UCNTAS2U.js +2580 -0
  498. package/dist/chunk-UD7IARSL.js +162 -0
  499. package/dist/chunk-UDKZKGUQ.js +379 -0
  500. package/dist/chunk-UEUYUUZA.js +3183 -0
  501. package/dist/chunk-UEUYUUZA.js.map +1 -0
  502. package/dist/chunk-UJRSZ6ZB.js +391 -0
  503. package/dist/chunk-UTM23O3G.js +50 -0
  504. package/dist/chunk-UUJSS56V.js +4570 -0
  505. package/dist/chunk-UWSF733U.js +42 -0
  506. package/dist/chunk-V4ZYJWU3.js +386 -0
  507. package/dist/chunk-VEIT2EGK.js +207 -0
  508. package/dist/chunk-VGG6DOTN.js +172 -0
  509. package/dist/chunk-VGSGAQJX.js +82 -0
  510. package/dist/chunk-VHK5CBIG.js +2317 -0
  511. package/dist/chunk-VLA2DTYG.js +154 -0
  512. package/dist/chunk-VSN6XKZ5.js +278 -0
  513. package/dist/chunk-VW6TOTDQ.js +111 -0
  514. package/dist/chunk-W3HKBWPM.js +406 -0
  515. package/dist/chunk-WDYM5SFM.js +73 -0
  516. package/dist/chunk-WJ4AZ2AR.js +2551 -0
  517. package/dist/chunk-WMQHP4E3.js +214 -0
  518. package/dist/chunk-WP5A6F6P.js +269 -0
  519. package/dist/chunk-WUR2DYJX.js +527 -0
  520. package/dist/chunk-WUR2DYJX.js.map +1 -0
  521. package/dist/chunk-WWQH3L6M.js +407 -0
  522. package/dist/chunk-WYIC3CXE.js +157 -0
  523. package/dist/chunk-WYIC3CXE.js.map +1 -0
  524. package/dist/chunk-X3T6ULUZ.js +297 -0
  525. package/dist/chunk-XA32OUL4.js +52 -0
  526. package/dist/chunk-XCICIQIE.js +113 -0
  527. package/dist/chunk-XHRIUCBD.js +138 -0
  528. package/dist/chunk-XJBWVT5X.js +1177 -0
  529. package/dist/chunk-XKQRWJFE.js +270 -0
  530. package/dist/chunk-XN3EVUB5.js +134 -0
  531. package/dist/chunk-XT6GBN2G.js +828 -0
  532. package/dist/chunk-XYVDTM4D.js +184 -0
  533. package/dist/chunk-XZO5X3KH.js +84 -0
  534. package/dist/chunk-Y34DIEOG.js +201 -0
  535. package/dist/chunk-YAIYUFCX.js +114 -0
  536. package/dist/chunk-YFLRBEDS.js +200 -0
  537. package/dist/chunk-YIKMBS4B.js +10053 -0
  538. package/dist/chunk-YIKMBS4B.js.map +1 -0
  539. package/dist/chunk-YQX227EF.js +403 -0
  540. package/dist/chunk-YVAB57JZ.js +340 -0
  541. package/dist/chunk-YWHSODBB.js +250 -0
  542. package/dist/chunk-YWJHCJQW.js +218 -0
  543. package/dist/chunk-Z37DSW2K.js +570 -0
  544. package/dist/chunk-ZELN2B72.js +399 -0
  545. package/dist/chunk-ZFGGR2JW.js +236 -0
  546. package/dist/chunk-ZL7SEED7.js +773 -0
  547. package/dist/composer.js +37 -36
  548. package/dist/computer-viewer-CNYFTUGF.js +21 -0
  549. package/dist/connect.js +31 -30
  550. package/dist/connection-step-up-EZRZW2LY.js +147 -0
  551. package/dist/connection-step-up-EZRZW2LY.js.map +1 -0
  552. package/dist/desktop-dictation.js +24 -24
  553. package/dist/desktop.js +2 -2
  554. package/dist/editor.js +2 -2
  555. package/dist/embedded-new-voice-A56WDECM.js +25 -0
  556. package/dist/embedded-voice-CBTSMIWW.js +25 -0
  557. package/dist/fleet-decision-row-6PQTGI2U.js +361 -0
  558. package/dist/in-chat-connect-model.js +5 -5
  559. package/dist/index.js +299 -298
  560. package/dist/interaction.js +9 -9
  561. package/dist/latest-question-F3VPDR7U.js +1 -1
  562. package/dist/lib/modal-layer.d.ts +11 -0
  563. package/dist/machine-request-model.js +1 -1
  564. package/dist/machines.js +8 -8
  565. package/dist/meetings-recorder.js +1 -1
  566. package/dist/meetings.js +117 -116
  567. package/dist/meetings.js.map +1 -1
  568. package/dist/messages/en.d.ts +1 -0
  569. package/dist/messages.js +1 -1
  570. package/dist/model-policy-picker-menu-ZU72JATS.js +23 -0
  571. package/dist/payment-page-card-5VEUANFD.js +227 -0
  572. package/dist/payment-page-card-5VEUANFD.js.map +1 -0
  573. package/dist/platform-activity-row-5IQT6R5Z.js +156 -0
  574. package/dist/queue-surface-implementation-TPCJ4R6N.js +933 -0
  575. package/dist/queue-surface-implementation-TPCJ4R6N.js.map +1 -0
  576. package/dist/realtime.js +17 -17
  577. package/dist/recorder-host-G5M676VM.js +80 -0
  578. package/dist/recordings.js +3 -3
  579. package/dist/sandbox-files-HCXOP6ZO.js +29 -0
  580. package/dist/session-app.css +1 -1
  581. package/dist/session-app.css.map +1 -1
  582. package/dist/session-app.js +388 -387
  583. package/dist/session-connect-cards-MYJRQWSA.js +28 -0
  584. package/dist/session-list-model.js +2 -2
  585. package/dist/session-realtime-YFVGQFJK.js +30 -0
  586. package/dist/session-realtime.js +2 -2
  587. package/dist/session-ui.js +96 -95
  588. package/dist/session.js +42 -42
  589. package/dist/sites.js +3 -3
  590. package/dist/terminal.js +2 -2
  591. package/dist/this-computer.js +4 -3
  592. package/dist/timeline-annotation-markers-5ELTFV5B.js +157 -0
  593. package/dist/timeline-annotation-selection-XHUOFRIY.js +208 -0
  594. package/dist/timeline-annotations-dialog-X2VNDYZ4.js +283 -0
  595. package/dist/timeline-model.js +58 -58
  596. package/dist/ui/access-list.js +24 -23
  597. package/dist/ui/access-list.js.map +1 -1
  598. package/dist/ui/cadence-picker.js +7 -7
  599. package/dist/ui/choice-cards.js +3 -3
  600. package/dist/ui/confirm-dialog.js +4 -3
  601. package/dist/ui/copy-field.js +3 -3
  602. package/dist/ui/detail-page.js +6 -5
  603. package/dist/ui/detail-sheet.js +6 -5
  604. package/dist/ui/dialog.js +2 -1
  605. package/dist/ui/diff-view.js +3 -3
  606. package/dist/ui/disclosure.js +7 -6
  607. package/dist/ui/email-chips-input.js +3 -3
  608. package/dist/ui/field.js +2 -2
  609. package/dist/ui/flush-form-page.js +8 -7
  610. package/dist/ui/form-dialog.js +7 -6
  611. package/dist/ui/list-row.js +6 -6
  612. package/dist/ui/load-failure.js +3 -3
  613. package/dist/ui/relative-time.js +3 -3
  614. package/dist/ui/revision-history.js +13 -13
  615. package/dist/ui/role-select.js +12 -11
  616. package/dist/ui/select-menu.js +5 -5
  617. package/dist/ui/settings-nav.js +6 -6
  618. package/dist/ui/sheet.js +3 -2
  619. package/dist/ui/usage-meter.js +4 -4
  620. package/dist/usage.js +3 -3
  621. package/dist/workbench.js +11 -11
  622. package/package.json +6 -5
  623. package/src/app/components/command-menu/command-menu.tsx +232 -228
  624. package/src/components/automations/automation-model.ts +1 -0
  625. package/src/components/file-browser.tsx +69 -64
  626. package/src/components/session-capability-frame.tsx +36 -34
  627. package/src/components/this-computer/this-computer-setup.tsx +36 -29
  628. package/src/lib/modal-layer.tsx +33 -0
  629. package/src/messages/en.ts +1 -0
  630. package/src/timeline/screenshot-lightbox.tsx +137 -128
  631. package/src/ui/detail-sheet.tsx +44 -40
  632. package/src/ui/dialog.tsx +39 -35
  633. package/src/ui/form-dialog-layer.test.tsx +4 -3
  634. package/src/ui/form-dialog.tsx +28 -26
  635. package/src/ui/sheet.tsx +36 -46
  636. package/styles/compiled.css +57 -12
  637. package/styles/index.css +19 -0
  638. package/styles/this-computer.css +1 -1
  639. package/dist/browser-viewer-J6O65JXH.js +0 -23
  640. package/dist/chat-interactive-block-R5JEJYMR.js +0 -22
  641. package/dist/chunk-236GMLCR.js +0 -50
  642. package/dist/chunk-24S44WBL.js +0 -200
  643. package/dist/chunk-27HN57HE.js +0 -274
  644. package/dist/chunk-2FLGURHP.js +0 -297
  645. package/dist/chunk-2SH6CLOR.js +0 -378
  646. package/dist/chunk-2XZ3EUSP.js +0 -505
  647. package/dist/chunk-2ZC62PY4.js +0 -113
  648. package/dist/chunk-36YTBVYF.js +0 -197
  649. package/dist/chunk-3775TQE5.js +0 -10053
  650. package/dist/chunk-3775TQE5.js.map +0 -1
  651. package/dist/chunk-3CF2B2LD.js +0 -110
  652. package/dist/chunk-3GENISSH.js +0 -129
  653. package/dist/chunk-3IEVQMGO.js +0 -2431
  654. package/dist/chunk-3N3EN7FA.js +0 -34
  655. package/dist/chunk-3NMKLLEB.js +0 -218
  656. package/dist/chunk-3VSKLEUE.js +0 -4570
  657. package/dist/chunk-3X4HTUUR.js +0 -538
  658. package/dist/chunk-3XHPCZ6N.js +0 -380
  659. package/dist/chunk-3XHPCZ6N.js.map +0 -1
  660. package/dist/chunk-4GFLP4OY.js +0 -131
  661. package/dist/chunk-4GUPD7CJ.js +0 -234
  662. package/dist/chunk-4OGDD2EM.js +0 -2434
  663. package/dist/chunk-4T2RJ2HY.js +0 -93
  664. package/dist/chunk-4XEPZARK.js +0 -391
  665. package/dist/chunk-4YJGB22T.js +0 -570
  666. package/dist/chunk-4YNWA5YG.js +0 -236
  667. package/dist/chunk-4ZRGFCSP.js +0 -5919
  668. package/dist/chunk-4ZRGFCSP.js.map +0 -1
  669. package/dist/chunk-54NTSBQO.js +0 -33
  670. package/dist/chunk-5BRK72J5.js +0 -214
  671. package/dist/chunk-5BRK72J5.js.map +0 -1
  672. package/dist/chunk-5CGZOJN7.js +0 -111
  673. package/dist/chunk-5ERDSF2C.js +0 -79
  674. package/dist/chunk-5I6CWDA6.js +0 -3176
  675. package/dist/chunk-5I6CWDA6.js.map +0 -1
  676. package/dist/chunk-5JG277OH.js +0 -92
  677. package/dist/chunk-5JOTMM3F.js +0 -3996
  678. package/dist/chunk-5JOTMM3F.js.map +0 -1
  679. package/dist/chunk-5ORXRVXV.js +0 -469
  680. package/dist/chunk-5XVOL3KH.js +0 -931
  681. package/dist/chunk-67BMBRTK.js +0 -406
  682. package/dist/chunk-67JCL67N.js +0 -84
  683. package/dist/chunk-6F34IWSA.js +0 -47
  684. package/dist/chunk-6F34IWSA.js.map +0 -1
  685. package/dist/chunk-6GCMLYER.js +0 -432
  686. package/dist/chunk-6GODDS6F.js +0 -103
  687. package/dist/chunk-6GYRHQVL.js +0 -5089
  688. package/dist/chunk-6LF2ZE52.js +0 -851
  689. package/dist/chunk-6MSTIFAL.js +0 -406
  690. package/dist/chunk-6OMREP52.js +0 -187
  691. package/dist/chunk-6P3QOMPV.js +0 -57
  692. package/dist/chunk-6SPEMI7K.js +0 -850
  693. package/dist/chunk-6SPEMI7K.js.map +0 -1
  694. package/dist/chunk-6WGJB6GO.js +0 -65
  695. package/dist/chunk-72PGXQDN.js +0 -399
  696. package/dist/chunk-75LF7LSI.js +0 -307
  697. package/dist/chunk-7CIMPDGL.js +0 -26
  698. package/dist/chunk-7EJWP62C.js +0 -271
  699. package/dist/chunk-7FY47EN2.js +0 -138
  700. package/dist/chunk-7I4KWTJS.js +0 -112
  701. package/dist/chunk-7J3TLTPI.js +0 -50
  702. package/dist/chunk-7M5DPUGZ.js +0 -215
  703. package/dist/chunk-7ZQVRVNI.js +0 -1263
  704. package/dist/chunk-A2QOUEU3.js +0 -256
  705. package/dist/chunk-A36WG3BT.js +0 -175
  706. package/dist/chunk-ADFUTR45.js +0 -138
  707. package/dist/chunk-ADNH5GSP.js +0 -1236
  708. package/dist/chunk-AGW5H6QV.js +0 -1356
  709. package/dist/chunk-AHBEBGLO.js +0 -27
  710. package/dist/chunk-AJIGRQIO.js +0 -311
  711. package/dist/chunk-AP63EUPJ.js +0 -145
  712. package/dist/chunk-ATWXYAWP.js +0 -227
  713. package/dist/chunk-AU2DT7O2.js +0 -29
  714. package/dist/chunk-AX65L6QV.js +0 -316
  715. package/dist/chunk-AZHZ2EU4.js +0 -333
  716. package/dist/chunk-B57G2C45.js +0 -357
  717. package/dist/chunk-BIQMUTVW.js +0 -1333
  718. package/dist/chunk-BOZN54YB.js +0 -149
  719. package/dist/chunk-BOZN54YB.js.map +0 -1
  720. package/dist/chunk-BPCI4ZGR.js +0 -4979
  721. package/dist/chunk-BRJLN3ZL.js +0 -67
  722. package/dist/chunk-BY7AWWDB.js +0 -177
  723. package/dist/chunk-CBSBNUGV.js +0 -523
  724. package/dist/chunk-CBSBNUGV.js.map +0 -1
  725. package/dist/chunk-CGS44LYC.js +0 -1022
  726. package/dist/chunk-CGS44LYC.js.map +0 -1
  727. package/dist/chunk-CHKHQHOO.js +0 -3070
  728. package/dist/chunk-CSGKUDNB.js +0 -1024
  729. package/dist/chunk-CZPN2HP3.js +0 -441
  730. package/dist/chunk-D2VP4C5B.js +0 -515
  731. package/dist/chunk-D32VVOBJ.js +0 -738
  732. package/dist/chunk-D32VVOBJ.js.map +0 -1
  733. package/dist/chunk-D4AF4SOJ.js +0 -246
  734. package/dist/chunk-DCML4SXQ.js +0 -201
  735. package/dist/chunk-DECSYLBP.js +0 -572
  736. package/dist/chunk-DECSYLBP.js.map +0 -1
  737. package/dist/chunk-DEKCTHXM.js +0 -639
  738. package/dist/chunk-DGS62JWP.js +0 -828
  739. package/dist/chunk-DHXRMZPQ.js +0 -276
  740. package/dist/chunk-DJ4X4U4A.js +0 -1021
  741. package/dist/chunk-DLMMQMKZ.js +0 -2551
  742. package/dist/chunk-DWPE3Y7M.js +0 -144
  743. package/dist/chunk-EFD4DD3E.js +0 -113
  744. package/dist/chunk-EGSRY63C.js +0 -251
  745. package/dist/chunk-EIVA3MAH.js +0 -85
  746. package/dist/chunk-EJYHPNXD.js +0 -103
  747. package/dist/chunk-EQ263DHZ.js +0 -27
  748. package/dist/chunk-EVJ42E62.js +0 -137
  749. package/dist/chunk-EW3N5SCT.js +0 -1628
  750. package/dist/chunk-F47X7XPQ.js +0 -124
  751. package/dist/chunk-F4ESDJTE.js +0 -400
  752. package/dist/chunk-F7NV3EL5.js +0 -2580
  753. package/dist/chunk-FFWVFU6S.js +0 -48
  754. package/dist/chunk-FPPPLIGK.js +0 -1184
  755. package/dist/chunk-FUJ6DWRZ.js +0 -207
  756. package/dist/chunk-FWEMP52Y.js +0 -199
  757. package/dist/chunk-FX4HG4FR.js +0 -37
  758. package/dist/chunk-FZOK37SC.js +0 -155
  759. package/dist/chunk-GBGJIR6F.js +0 -404
  760. package/dist/chunk-GCURVP5U.js +0 -211
  761. package/dist/chunk-GFMRMSFN.js +0 -196
  762. package/dist/chunk-GH4VY3H5.js +0 -178
  763. package/dist/chunk-GJFTPSGN.js +0 -278
  764. package/dist/chunk-GKOIWZ4C.js +0 -794
  765. package/dist/chunk-GNTEF5TL.js +0 -158
  766. package/dist/chunk-GQF2HWQE.js +0 -407
  767. package/dist/chunk-GXYS6BI3.js +0 -311
  768. package/dist/chunk-H27MS36Q.js +0 -318
  769. package/dist/chunk-H4NDK35I.js +0 -85
  770. package/dist/chunk-H6DJIEO6.js +0 -269
  771. package/dist/chunk-HC7C4ZN2.js +0 -608
  772. package/dist/chunk-HUKGLWAY.js +0 -174
  773. package/dist/chunk-HUS2QEPV.js +0 -428
  774. package/dist/chunk-HUTQJY3F.js +0 -23
  775. package/dist/chunk-HWOYJOKK.js +0 -266
  776. package/dist/chunk-I46F7LUI.js +0 -15
  777. package/dist/chunk-I57PYKVN.js +0 -386
  778. package/dist/chunk-IBI3N3P7.js +0 -56
  779. package/dist/chunk-IEUZ4ASX.js +0 -3110
  780. package/dist/chunk-IHLF7R6Q.js +0 -1309
  781. package/dist/chunk-J3XWJ2A6.js +0 -209
  782. package/dist/chunk-J45WTHTL.js +0 -229
  783. package/dist/chunk-J4OOKDRV.js +0 -40
  784. package/dist/chunk-J6YVN3W7.js +0 -162
  785. package/dist/chunk-JOZFVEBN.js +0 -2984
  786. package/dist/chunk-K7GGLL2U.js +0 -231
  787. package/dist/chunk-KDHWX7XH.js +0 -292
  788. package/dist/chunk-KMLELG4O.js +0 -46
  789. package/dist/chunk-KQY4P4EO.js +0 -373
  790. package/dist/chunk-KSDCQPJY.js +0 -12
  791. package/dist/chunk-KW4OJ3RS.js +0 -175
  792. package/dist/chunk-KWOYMJKM.js +0 -1803
  793. package/dist/chunk-KYDLVMKA.js +0 -99
  794. package/dist/chunk-KZYQNVXE.js +0 -449
  795. package/dist/chunk-L3GNEC6B.js +0 -1019
  796. package/dist/chunk-L5JV7MAF.js +0 -372
  797. package/dist/chunk-LC5E7CVA.js +0 -191
  798. package/dist/chunk-LEYZQZFS.js +0 -121
  799. package/dist/chunk-LFMTPBET.js +0 -265
  800. package/dist/chunk-LFQI2C46.js +0 -175
  801. package/dist/chunk-LH3SDMDC.js +0 -172
  802. package/dist/chunk-LJKZGQTI.js +0 -192
  803. package/dist/chunk-LQDSZPB5.js +0 -73
  804. package/dist/chunk-LTYUE572.js +0 -117
  805. package/dist/chunk-M3WCB73E.js +0 -379
  806. package/dist/chunk-M47MKLW2.js +0 -283
  807. package/dist/chunk-M5FX5KH5.js +0 -629
  808. package/dist/chunk-MHL727ZE.js +0 -129
  809. package/dist/chunk-N3AAMSBH.js +0 -170
  810. package/dist/chunk-N4TJ7A7I.js +0 -41
  811. package/dist/chunk-NFZAMHSR.js +0 -401
  812. package/dist/chunk-NRAVQJE2.js +0 -61
  813. package/dist/chunk-NU4HYZ3C.js +0 -48
  814. package/dist/chunk-NUZNJSL5.js +0 -285
  815. package/dist/chunk-NY5DX43C.js +0 -133
  816. package/dist/chunk-O3C4BASC.js +0 -773
  817. package/dist/chunk-O5JDQZGV.js +0 -176
  818. package/dist/chunk-OMYT3X2Y.js +0 -107
  819. package/dist/chunk-OSQ6YGZW.js +0 -412
  820. package/dist/chunk-OWXSWGP3.js +0 -263
  821. package/dist/chunk-PBCSPCF6.js +0 -43
  822. package/dist/chunk-PBKG2OPJ.js +0 -849
  823. package/dist/chunk-PCP5GF77.js +0 -366
  824. package/dist/chunk-PCSRHFRF.js +0 -75
  825. package/dist/chunk-PHNHJKEL.js +0 -287
  826. package/dist/chunk-PIPD74PT.js +0 -650
  827. package/dist/chunk-PMBZMVKE.js +0 -33
  828. package/dist/chunk-PMVZYQ5W.js +0 -107
  829. package/dist/chunk-POUIWV6K.js +0 -2553
  830. package/dist/chunk-PTSRBKQC.js +0 -118
  831. package/dist/chunk-Q5AQJQXU.js +0 -114
  832. package/dist/chunk-QAS2OFG5.js +0 -371
  833. package/dist/chunk-QCJ6SNCP.js +0 -532
  834. package/dist/chunk-QFMPAR74.js +0 -73
  835. package/dist/chunk-QHF4B7R4.js +0 -166
  836. package/dist/chunk-QHGWFKTK.js +0 -52
  837. package/dist/chunk-QJ4YC4PM.js +0 -353
  838. package/dist/chunk-QMFX5BDA.js +0 -3851
  839. package/dist/chunk-QSG6FWOK.js +0 -126
  840. package/dist/chunk-QTT5574G.js +0 -154
  841. package/dist/chunk-R6CFPY3F.js +0 -278
  842. package/dist/chunk-R6OBJ7LF.js +0 -131
  843. package/dist/chunk-R6OBJ7LF.js.map +0 -1
  844. package/dist/chunk-RAUWORZV.js +0 -1187
  845. package/dist/chunk-RG7PMYWW.js +0 -82
  846. package/dist/chunk-RLS563ST.js +0 -403
  847. package/dist/chunk-RQAE6DI7.js +0 -259
  848. package/dist/chunk-RWWQLVGV.js +0 -184
  849. package/dist/chunk-S6GFECVG.js +0 -56
  850. package/dist/chunk-SBWVYYRA.js +0 -283
  851. package/dist/chunk-SHW2QUOE.js +0 -158
  852. package/dist/chunk-SQJQVTHA.js +0 -3690
  853. package/dist/chunk-STTCF3OR.js +0 -202
  854. package/dist/chunk-SVG5U7UN.js +0 -270
  855. package/dist/chunk-SY6V3Z2U.js +0 -270
  856. package/dist/chunk-T3WYQHAO.js +0 -42
  857. package/dist/chunk-TCDDOFRG.js +0 -79
  858. package/dist/chunk-TGG3ODCS.js +0 -99
  859. package/dist/chunk-TL6UOSMX.js +0 -4519
  860. package/dist/chunk-TL6UOSMX.js.map +0 -1
  861. package/dist/chunk-TU6FW6IJ.js +0 -566
  862. package/dist/chunk-TXSZR2SB.js +0 -188
  863. package/dist/chunk-TYZ3WUKG.js +0 -1095
  864. package/dist/chunk-U3GQZEAO.js +0 -584
  865. package/dist/chunk-U4EMW7RP.js +0 -249
  866. package/dist/chunk-UBSHJB6M.js +0 -83
  867. package/dist/chunk-UFRXYZCJ.js +0 -125
  868. package/dist/chunk-UHBIXNRW.js +0 -100
  869. package/dist/chunk-UJB54P4M.js +0 -335
  870. package/dist/chunk-UJKVMFFF.js +0 -114
  871. package/dist/chunk-UJSXNGKJ.js +0 -141
  872. package/dist/chunk-UNOJ5PNN.js +0 -3321
  873. package/dist/chunk-UOBJFO25.js +0 -351
  874. package/dist/chunk-UPRN4FBY.js +0 -38
  875. package/dist/chunk-UQQUMT5P.js +0 -91
  876. package/dist/chunk-UTFX46TK.js +0 -1177
  877. package/dist/chunk-V5HRUE42.js +0 -396
  878. package/dist/chunk-VCWRMKTQ.js +0 -296
  879. package/dist/chunk-VJAP57SP.js +0 -114
  880. package/dist/chunk-VMJN6YQL.js +0 -391
  881. package/dist/chunk-VUNGU657.js +0 -20
  882. package/dist/chunk-VWEGG7JQ.js +0 -134
  883. package/dist/chunk-VWT7ORWC.js +0 -437
  884. package/dist/chunk-VWT7ORWC.js.map +0 -1
  885. package/dist/chunk-VXGQVX53.js +0 -1152
  886. package/dist/chunk-W7UFWXZ6.js +0 -72
  887. package/dist/chunk-WKBJNGYV.js +0 -230
  888. package/dist/chunk-WZZV7DUU.js +0 -723
  889. package/dist/chunk-XDWW2DLJ.js +0 -247
  890. package/dist/chunk-XF55A7CC.js +0 -162
  891. package/dist/chunk-XGUBIE35.js +0 -187
  892. package/dist/chunk-XIUJL352.js +0 -66
  893. package/dist/chunk-XKPVWLMM.js +0 -383
  894. package/dist/chunk-XSR6J5LY.js +0 -234
  895. package/dist/chunk-Y2LD4FTV.js +0 -132
  896. package/dist/chunk-Y3TQ2M2O.js +0 -214
  897. package/dist/chunk-Y5HXP2NR.js +0 -251
  898. package/dist/chunk-Y6CNWBV3.js +0 -264
  899. package/dist/chunk-YGPMLIFT.js +0 -2317
  900. package/dist/chunk-YIR4KVJO.js +0 -389
  901. package/dist/chunk-YN6UVG4Z.js +0 -250
  902. package/dist/chunk-YNIDJOGT.js +0 -340
  903. package/dist/chunk-YP4SNX4P.js +0 -220
  904. package/dist/chunk-YPIOAMHD.js +0 -246
  905. package/dist/chunk-YPM3T3UM.js +0 -598
  906. package/dist/chunk-YRJZYQ5A.js +0 -898
  907. package/dist/chunk-YRJZYQ5A.js.map +0 -1
  908. package/dist/chunk-YVODOJZG.js +0 -298
  909. package/dist/chunk-ZAGLLXX5.js +0 -107
  910. package/dist/chunk-ZD67RM6G.js +0 -60
  911. package/dist/chunk-ZLY7M463.js +0 -1185
  912. package/dist/chunk-ZNIG3CPB.js +0 -98
  913. package/dist/chunk-ZOQKWIFS.js +0 -108
  914. package/dist/chunk-ZU5WVSHV.js +0 -168
  915. package/dist/chunk-ZWEVJPXC.js +0 -818
  916. package/dist/chunk-ZWFLYN7T.js +0 -772
  917. package/dist/computer-viewer-ZISZUM4L.js +0 -21
  918. package/dist/connection-step-up-UQHDCXFE.js +0 -146
  919. package/dist/connection-step-up-UQHDCXFE.js.map +0 -1
  920. package/dist/embedded-new-voice-UWSSA7AB.js +0 -25
  921. package/dist/embedded-voice-T34K465A.js +0 -25
  922. package/dist/fleet-decision-row-REAWMEHI.js +0 -361
  923. package/dist/model-policy-picker-menu-2CTRKSDJ.js +0 -23
  924. package/dist/payment-page-card-OOOFGIMH.js +0 -226
  925. package/dist/payment-page-card-OOOFGIMH.js.map +0 -1
  926. package/dist/platform-activity-row-EZYTZPYR.js +0 -156
  927. package/dist/queue-surface-implementation-HDZ42LN7.js +0 -932
  928. package/dist/queue-surface-implementation-HDZ42LN7.js.map +0 -1
  929. package/dist/recorder-host-6HFQQTNI.js +0 -80
  930. package/dist/sandbox-files-6JY7WVMO.js +0 -28
  931. package/dist/session-connect-cards-VTSJODCX.js +0 -27
  932. package/dist/session-realtime-G3ZGG3KR.js +0 -30
  933. package/dist/timeline-annotation-markers-S6DMHCI6.js +0 -157
  934. package/dist/timeline-annotation-selection-UFZOKL5E.js +0 -208
  935. package/dist/timeline-annotations-dialog-FPJ4MPHD.js +0 -283
  936. /package/dist/{browser-viewer-J6O65JXH.js.map → browser-viewer-O5FJOWWI.js.map} +0 -0
  937. /package/dist/{chat-interactive-block-R5JEJYMR.js.map → chat-interactive-block-TQTOUHRC.js.map} +0 -0
  938. /package/dist/{chunk-SQJQVTHA.js.map → chunk-23TTCFRP.js.map} +0 -0
  939. /package/dist/{chunk-3GENISSH.js.map → chunk-2BOFLWNJ.js.map} +0 -0
  940. /package/dist/{chunk-6LF2ZE52.js.map → chunk-3DMD2KHT.js.map} +0 -0
  941. /package/dist/{chunk-Y2LD4FTV.js.map → chunk-3DOISS3I.js.map} +0 -0
  942. /package/dist/{chunk-FWEMP52Y.js.map → chunk-3KWTXE4O.js.map} +0 -0
  943. /package/dist/{chunk-4T2RJ2HY.js.map → chunk-3TRERIPD.js.map} +0 -0
  944. /package/dist/{chunk-5JG277OH.js.map → chunk-3UXBTL7Z.js.map} +0 -0
  945. /package/dist/{chunk-M47MKLW2.js.map → chunk-3XEKXNB4.js.map} +0 -0
  946. /package/dist/{chunk-HUS2QEPV.js.map → chunk-3ZJUQG4K.js.map} +0 -0
  947. /package/dist/{chunk-UJB54P4M.js.map → chunk-42WTAUUW.js.map} +0 -0
  948. /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
  949. /package/dist/{chunk-QHF4B7R4.js.map → chunk-4BVEFGX7.js.map} +0 -0
  950. /package/dist/{chunk-NFZAMHSR.js.map → chunk-4IOFV4S4.js.map} +0 -0
  951. /package/dist/{chunk-EVJ42E62.js.map → chunk-4ISXBLJV.js.map} +0 -0
  952. /package/dist/{chunk-SBWVYYRA.js.map → chunk-4L2MBYLH.js.map} +0 -0
  953. /package/dist/{chunk-O5JDQZGV.js.map → chunk-4NWUZ6SL.js.map} +0 -0
  954. /package/dist/{chunk-H27MS36Q.js.map → chunk-4QVX6CTT.js.map} +0 -0
  955. /package/dist/{chunk-JOZFVEBN.js.map → chunk-4YARO4Y5.js.map} +0 -0
  956. /package/dist/{chunk-3N3EN7FA.js.map → chunk-4Z7BPBS7.js.map} +0 -0
  957. /package/dist/{chunk-GKOIWZ4C.js.map → chunk-55ILMX6B.js.map} +0 -0
  958. /package/dist/{chunk-6GODDS6F.js.map → chunk-57OAQTWD.js.map} +0 -0
  959. /package/dist/{chunk-KMLELG4O.js.map → chunk-5GXX3NI7.js.map} +0 -0
  960. /package/dist/{chunk-QJ4YC4PM.js.map → chunk-5VE3PPSK.js.map} +0 -0
  961. /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
  962. /package/dist/{chunk-EGSRY63C.js.map → chunk-655JT4VH.js.map} +0 -0
  963. /package/dist/{chunk-2XZ3EUSP.js.map → chunk-65OPNLE4.js.map} +0 -0
  964. /package/dist/{chunk-J45WTHTL.js.map → chunk-67PIP46J.js.map} +0 -0
  965. /package/dist/{chunk-GCURVP5U.js.map → chunk-6CAK65QV.js.map} +0 -0
  966. /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
  967. /package/dist/{chunk-R6CFPY3F.js.map → chunk-6D3D2JWY.js.map} +0 -0
  968. /package/dist/{chunk-PMVZYQ5W.js.map → chunk-6DGQB6GT.js.map} +0 -0
  969. /package/dist/{chunk-TXSZR2SB.js.map → chunk-6NFK3J2O.js.map} +0 -0
  970. /package/dist/{chunk-3X4HTUUR.js.map → chunk-6R3QX3AC.js.map} +0 -0
  971. /package/dist/{chunk-F4ESDJTE.js.map → chunk-6S5OMLAL.js.map} +0 -0
  972. /package/dist/{chunk-U4EMW7RP.js.map → chunk-6SG2VVVB.js.map} +0 -0
  973. /package/dist/{chunk-3CF2B2LD.js.map → chunk-6U57GGJI.js.map} +0 -0
  974. /package/dist/{chunk-ZNIG3CPB.js.map → chunk-6V2PEFPS.js.map} +0 -0
  975. /package/dist/{chunk-UNOJ5PNN.js.map → chunk-6VASZZVV.js.map} +0 -0
  976. /package/dist/{chunk-ZU5WVSHV.js.map → chunk-7BBYH5R5.js.map} +0 -0
  977. /package/dist/{chunk-J3XWJ2A6.js.map → chunk-7EO3T3IX.js.map} +0 -0
  978. /package/dist/{chunk-SHW2QUOE.js.map → chunk-7EZQ6EKM.js.map} +0 -0
  979. /package/dist/{chunk-I46F7LUI.js.map → chunk-7HI53NPP.js.map} +0 -0
  980. /package/dist/{chunk-FX4HG4FR.js.map → chunk-7J4BFENI.js.map} +0 -0
  981. /package/dist/{chunk-Q5AQJQXU.js.map → chunk-7LSGNY2L.js.map} +0 -0
  982. /package/dist/{chunk-ADNH5GSP.js.map → chunk-7MMONDFK.js.map} +0 -0
  983. /package/dist/{chunk-KW4OJ3RS.js.map → chunk-7MWPBGDX.js.map} +0 -0
  984. /package/dist/{chunk-QAS2OFG5.js.map → chunk-7NSDIQMY.js.map} +0 -0
  985. /package/dist/{chunk-K7GGLL2U.js.map → chunk-7XPDLT5G.js.map} +0 -0
  986. /package/dist/{chunk-2SH6CLOR.js.map → chunk-A3BCF4MV.js.map} +0 -0
  987. /package/dist/{chunk-PBKG2OPJ.js.map → chunk-A5GX3CAE.js.map} +0 -0
  988. /package/dist/{chunk-D2VP4C5B.js.map → chunk-AAHQJWEP.js.map} +0 -0
  989. /package/dist/{chunk-DWPE3Y7M.js.map → chunk-AAWEPZOG.js.map} +0 -0
  990. /package/dist/{chunk-YPM3T3UM.js.map → chunk-ABRT345L.js.map} +0 -0
  991. /package/dist/{chunk-UQQUMT5P.js.map → chunk-ANXFE2EP.js.map} +0 -0
  992. /package/dist/{chunk-7EJWP62C.js.map → chunk-AQNE4XWU.js.map} +0 -0
  993. /package/dist/{chunk-BPCI4ZGR.js.map → chunk-AV2OMWDS.js.map} +0 -0
  994. /package/dist/{chunk-L3GNEC6B.js.map → chunk-AYHMHAU5.js.map} +0 -0
  995. /package/dist/{chunk-7J3TLTPI.js.map → chunk-AZ637XK3.js.map} +0 -0
  996. /package/dist/{chunk-4OGDD2EM.js.map → chunk-B6AH43UQ.js.map} +0 -0
  997. /package/dist/{chunk-XKPVWLMM.js.map → chunk-BBECLK22.js.map} +0 -0
  998. /package/dist/{chunk-GNTEF5TL.js.map → chunk-BWYPJG3P.js.map} +0 -0
  999. /package/dist/{chunk-V5HRUE42.js.map → chunk-CI7F4Y26.js.map} +0 -0
  1000. /package/dist/{chunk-5XVOL3KH.js.map → chunk-CNLSXEQC.js.map} +0 -0
  1001. /package/dist/{chunk-6WGJB6GO.js.map → chunk-COCB4HE3.js.map} +0 -0
  1002. /package/dist/{chunk-B57G2C45.js.map → chunk-CPEVLG3B.js.map} +0 -0
  1003. /package/dist/{chunk-FZOK37SC.js.map → chunk-CVC4RO7D.js.map} +0 -0
  1004. /package/dist/{chunk-IEUZ4ASX.js.map → chunk-CY6RLRHJ.js.map} +0 -0
  1005. /package/dist/{chunk-LTYUE572.js.map → chunk-D3WLSMCL.js.map} +0 -0
  1006. /package/dist/{chunk-GH4VY3H5.js.map → chunk-D7SSOJEU.js.map} +0 -0
  1007. /package/dist/{chunk-ZWEVJPXC.js.map → chunk-DBOD5WXT.js.map} +0 -0
  1008. /package/dist/{chunk-J6YVN3W7.js.map → chunk-DFWSRIFL.js.map} +0 -0
  1009. /package/dist/{chunk-QSG6FWOK.js.map → chunk-DITZUBOK.js.map} +0 -0
  1010. /package/dist/{chunk-PHNHJKEL.js.map → chunk-DKD2ZZSJ.js.map} +0 -0
  1011. /package/dist/{chunk-YPIOAMHD.js.map → chunk-DOJWHSRD.js.map} +0 -0
  1012. /package/dist/{chunk-XGUBIE35.js.map → chunk-DR6LZXJI.js.map} +0 -0
  1013. /package/dist/{chunk-PIPD74PT.js.map → chunk-DV73XOVB.js.map} +0 -0
  1014. /package/dist/{chunk-AX65L6QV.js.map → chunk-DYO7DNDD.js.map} +0 -0
  1015. /package/dist/{chunk-4GUPD7CJ.js.map → chunk-DYZASWWT.js.map} +0 -0
  1016. /package/dist/{chunk-7ZQVRVNI.js.map → chunk-EC5HUNXI.js.map} +0 -0
  1017. /package/dist/{chunk-XDWW2DLJ.js.map → chunk-ECQ7FV3E.js.map} +0 -0
  1018. /package/dist/{chunk-67BMBRTK.js.map → chunk-ECVCSZWY.js.map} +0 -0
  1019. /package/dist/{chunk-AZHZ2EU4.js.map → chunk-EMXO5HCY.js.map} +0 -0
  1020. /package/dist/{chunk-LFMTPBET.js.map → chunk-ENJX5TAA.js.map} +0 -0
  1021. /package/dist/{chunk-XIUJL352.js.map → chunk-EQSYPIAI.js.map} +0 -0
  1022. /package/dist/{chunk-VXGQVX53.js.map → chunk-EV73XMK3.js.map} +0 -0
  1023. /package/dist/{chunk-POUIWV6K.js.map → chunk-F2SGC74A.js.map} +0 -0
  1024. /package/dist/{chunk-WKBJNGYV.js.map → chunk-F5DEBD4D.js.map} +0 -0
  1025. /package/dist/{chunk-TU6FW6IJ.js.map → chunk-F6JJBUQ2.js.map} +0 -0
  1026. /package/dist/{chunk-CSGKUDNB.js.map → chunk-FEVZDJOZ.js.map} +0 -0
  1027. /package/dist/{chunk-LEYZQZFS.js.map → chunk-FF22IUY3.js.map} +0 -0
  1028. /package/dist/{chunk-A2QOUEU3.js.map → chunk-FILRDNUQ.js.map} +0 -0
  1029. /package/dist/{chunk-ATWXYAWP.js.map → chunk-FLB3BP2E.js.map} +0 -0
  1030. /package/dist/{chunk-DEKCTHXM.js.map → chunk-FZVMMHPC.js.map} +0 -0
  1031. /package/dist/{chunk-7I4KWTJS.js.map → chunk-G6D5NVWM.js.map} +0 -0
  1032. /package/dist/{chunk-LJKZGQTI.js.map → chunk-GGH5STTP.js.map} +0 -0
  1033. /package/dist/{chunk-6OMREP52.js.map → chunk-GGHX6GS7.js.map} +0 -0
  1034. /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
  1035. /package/dist/{chunk-Y6CNWBV3.js.map → chunk-GO5VIAA7.js.map} +0 -0
  1036. /package/dist/{chunk-AHBEBGLO.js.map → chunk-GSK637QS.js.map} +0 -0
  1037. /package/dist/{chunk-S6GFECVG.js.map → chunk-HBYO34CP.js.map} +0 -0
  1038. /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
  1039. /package/dist/{chunk-Y5HXP2NR.js.map → chunk-HGEDFQ7G.js.map} +0 -0
  1040. /package/dist/{chunk-AGW5H6QV.js.map → chunk-HH3QTFGV.js.map} +0 -0
  1041. /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
  1042. /package/dist/{chunk-D4AF4SOJ.js.map → chunk-HHYTB5OL.js.map} +0 -0
  1043. /package/dist/{chunk-FFWVFU6S.js.map → chunk-HPKWAHHI.js.map} +0 -0
  1044. /package/dist/{chunk-KQY4P4EO.js.map → chunk-HSPOCEGP.js.map} +0 -0
  1045. /package/dist/{chunk-HC7C4ZN2.js.map → chunk-IC74VN2I.js.map} +0 -0
  1046. /package/dist/{chunk-DJ4X4U4A.js.map → chunk-ICSQO2CV.js.map} +0 -0
  1047. /package/dist/{chunk-CHKHQHOO.js.map → chunk-IEZE7SL6.js.map} +0 -0
  1048. /package/dist/{chunk-N3AAMSBH.js.map → chunk-IGHNTARW.js.map} +0 -0
  1049. /package/dist/{chunk-7FY47EN2.js.map → chunk-IKYS56PQ.js.map} +0 -0
  1050. /package/dist/{chunk-IBI3N3P7.js.map → chunk-IO474NRY.js.map} +0 -0
  1051. /package/dist/{chunk-WZZV7DUU.js.map → chunk-IP2CCFAV.js.map} +0 -0
  1052. /package/dist/{chunk-QMFX5BDA.js.map → chunk-IT5GF54F.js.map} +0 -0
  1053. /package/dist/{chunk-SVG5U7UN.js.map → chunk-IX67G5FD.js.map} +0 -0
  1054. /package/dist/{chunk-KDHWX7XH.js.map → chunk-IXNJK7KJ.js.map} +0 -0
  1055. /package/dist/{chunk-DHXRMZPQ.js.map → chunk-IZWTARYT.js.map} +0 -0
  1056. /package/dist/{chunk-ZOQKWIFS.js.map → chunk-JBV2HY43.js.map} +0 -0
  1057. /package/dist/{chunk-54NTSBQO.js.map → chunk-JE62XK5K.js.map} +0 -0
  1058. /package/dist/{chunk-EIVA3MAH.js.map → chunk-JFAWCALM.js.map} +0 -0
  1059. /package/dist/{chunk-UBSHJB6M.js.map → chunk-JQGPATQZ.js.map} +0 -0
  1060. /package/dist/{chunk-27HN57HE.js.map → chunk-JYZGX5UZ.js.map} +0 -0
  1061. /package/dist/{chunk-W7UFWXZ6.js.map → chunk-K227GMSM.js.map} +0 -0
  1062. /package/dist/{chunk-KZYQNVXE.js.map → chunk-KB2O7JIJ.js.map} +0 -0
  1063. /package/dist/{chunk-KSDCQPJY.js.map → chunk-KT6GC67G.js.map} +0 -0
  1064. /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
  1065. /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
  1066. /package/dist/{chunk-A36WG3BT.js.map → chunk-KZIRVLCM.js.map} +0 -0
  1067. /package/dist/{chunk-RQAE6DI7.js.map → chunk-L3DUSTRN.js.map} +0 -0
  1068. /package/dist/{chunk-NRAVQJE2.js.map → chunk-L6WVCO6D.js.map} +0 -0
  1069. /package/dist/{chunk-TCDDOFRG.js.map → chunk-L7PCZEEG.js.map} +0 -0
  1070. /package/dist/{chunk-GXYS6BI3.js.map → chunk-LEN2DVU6.js.map} +0 -0
  1071. /package/dist/{chunk-LC5E7CVA.js.map → chunk-LGOQW2CE.js.map} +0 -0
  1072. /package/dist/{chunk-YIR4KVJO.js.map → chunk-LK2JO72Y.js.map} +0 -0
  1073. /package/dist/{chunk-U3GQZEAO.js.map → chunk-LXLHIOJM.js.map} +0 -0
  1074. /package/dist/{chunk-BIQMUTVW.js.map → chunk-LYQQ4VBE.js.map} +0 -0
  1075. /package/dist/{chunk-EW3N5SCT.js.map → chunk-M22ZHQ7S.js.map} +0 -0
  1076. /package/dist/{chunk-VUNGU657.js.map → chunk-M5RKFV6K.js.map} +0 -0
  1077. /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
  1078. /package/dist/{chunk-AP63EUPJ.js.map → chunk-MDGNCUAC.js.map} +0 -0
  1079. /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
  1080. /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
  1081. /package/dist/{chunk-M5FX5KH5.js.map → chunk-MO3XJQN2.js.map} +0 -0
  1082. /package/dist/{chunk-OMYT3X2Y.js.map → chunk-MTHAYXDH.js.map} +0 -0
  1083. /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
  1084. /package/dist/{chunk-75LF7LSI.js.map → chunk-NA7VZQPL.js.map} +0 -0
  1085. /package/dist/{chunk-3IEVQMGO.js.map → chunk-ND6FWOSO.js.map} +0 -0
  1086. /package/dist/{chunk-UOBJFO25.js.map → chunk-NIFPH34L.js.map} +0 -0
  1087. /package/dist/{chunk-EJYHPNXD.js.map → chunk-NKYC6WHQ.js.map} +0 -0
  1088. /package/dist/{chunk-4XEPZARK.js.map → chunk-NML7VKLU.js.map} +0 -0
  1089. /package/dist/{chunk-N4TJ7A7I.js.map → chunk-NPAWLKJB.js.map} +0 -0
  1090. /package/dist/{chunk-ZLY7M463.js.map → chunk-NQSKI2YD.js.map} +0 -0
  1091. /package/dist/{chunk-VJAP57SP.js.map → chunk-NXQFBC22.js.map} +0 -0
  1092. /package/dist/{chunk-PBCSPCF6.js.map → chunk-NXRZMHVM.js.map} +0 -0
  1093. /package/dist/{chunk-IHLF7R6Q.js.map → chunk-NYU5DE4K.js.map} +0 -0
  1094. /package/dist/{chunk-NU4HYZ3C.js.map → chunk-O2EEYPIZ.js.map} +0 -0
  1095. /package/dist/{chunk-BRJLN3ZL.js.map → chunk-O4TOEISQ.js.map} +0 -0
  1096. /package/dist/{chunk-MHL727ZE.js.map → chunk-O533L2TG.js.map} +0 -0
  1097. /package/dist/{chunk-QCJ6SNCP.js.map → chunk-ON6ZGJDW.js.map} +0 -0
  1098. /package/dist/{chunk-AJIGRQIO.js.map → chunk-OPELE3Z4.js.map} +0 -0
  1099. /package/dist/{chunk-XSR6J5LY.js.map → chunk-OTSUC6PP.js.map} +0 -0
  1100. /package/dist/{chunk-FPPPLIGK.js.map → chunk-OZNL5OKT.js.map} +0 -0
  1101. /package/dist/{chunk-6GCMLYER.js.map → chunk-P3PDKPLK.js.map} +0 -0
  1102. /package/dist/{chunk-L5JV7MAF.js.map → chunk-PCZBYN2H.js.map} +0 -0
  1103. /package/dist/{chunk-6P3QOMPV.js.map → chunk-PIPXXQFV.js.map} +0 -0
  1104. /package/dist/{chunk-4GFLP4OY.js.map → chunk-PMUZUPPE.js.map} +0 -0
  1105. /package/dist/{chunk-EFD4DD3E.js.map → chunk-PN52EIFV.js.map} +0 -0
  1106. /package/dist/{chunk-LFQI2C46.js.map → chunk-PPQJIVGM.js.map} +0 -0
  1107. /package/dist/{chunk-5ORXRVXV.js.map → chunk-PQYFOTNI.js.map} +0 -0
  1108. /package/dist/{chunk-TYZ3WUKG.js.map → chunk-PUX4YJAW.js.map} +0 -0
  1109. /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
  1110. /package/dist/{chunk-GBGJIR6F.js.map → chunk-Q5UO7GT5.js.map} +0 -0
  1111. /package/dist/{chunk-H4NDK35I.js.map → chunk-QA5UNVHD.js.map} +0 -0
  1112. /package/dist/{chunk-7M5DPUGZ.js.map → chunk-QDZR7FXG.js.map} +0 -0
  1113. /package/dist/{chunk-J4OOKDRV.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1114. /package/dist/{chunk-QFMPAR74.js.map → chunk-QUXQYYZO.js.map} +0 -0
  1115. /package/dist/{chunk-AU2DT7O2.js.map → chunk-QVOTPOXK.js.map} +0 -0
  1116. /package/dist/{chunk-ZWFLYN7T.js.map → chunk-R2DSOIME.js.map} +0 -0
  1117. /package/dist/{chunk-PCP5GF77.js.map → chunk-RFQQXXJ6.js.map} +0 -0
  1118. /package/dist/{chunk-EQ263DHZ.js.map → chunk-RLWI34XM.js.map} +0 -0
  1119. /package/dist/{chunk-F47X7XPQ.js.map → chunk-RMWCGSEP.js.map} +0 -0
  1120. /package/dist/{chunk-CZPN2HP3.js.map → chunk-ROTEQD2Z.js.map} +0 -0
  1121. /package/dist/{chunk-VCWRMKTQ.js.map → chunk-RPCWZFP7.js.map} +0 -0
  1122. /package/dist/{chunk-UJSXNGKJ.js.map → chunk-RW5QRWVI.js.map} +0 -0
  1123. /package/dist/{chunk-6GYRHQVL.js.map → chunk-RZZHOHL6.js.map} +0 -0
  1124. /package/dist/{chunk-NY5DX43C.js.map → chunk-S5STZCBZ.js.map} +0 -0
  1125. /package/dist/{chunk-KWOYMJKM.js.map → chunk-SD4A5P24.js.map} +0 -0
  1126. /package/dist/{chunk-36YTBVYF.js.map → chunk-SJM4TCWJ.js.map} +0 -0
  1127. /package/dist/{chunk-UHBIXNRW.js.map → chunk-SQYTYXR4.js.map} +0 -0
  1128. /package/dist/{chunk-BY7AWWDB.js.map → chunk-SRDHDIRQ.js.map} +0 -0
  1129. /package/dist/{chunk-OWXSWGP3.js.map → chunk-SVC674IM.js.map} +0 -0
  1130. /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
  1131. /package/dist/{chunk-RAUWORZV.js.map → chunk-T2UUHB7V.js.map} +0 -0
  1132. /package/dist/{chunk-YVODOJZG.js.map → chunk-TBOH54QP.js.map} +0 -0
  1133. /package/dist/{chunk-GFMRMSFN.js.map → chunk-TG2GO424.js.map} +0 -0
  1134. /package/dist/{chunk-ZAGLLXX5.js.map → chunk-TOJNLC42.js.map} +0 -0
  1135. /package/dist/{chunk-OSQ6YGZW.js.map → chunk-TW75KM7T.js.map} +0 -0
  1136. /package/dist/{chunk-7CIMPDGL.js.map → chunk-TWWAPJYE.js.map} +0 -0
  1137. /package/dist/{chunk-STTCF3OR.js.map → chunk-UARZCGWU.js.map} +0 -0
  1138. /package/dist/{chunk-F7NV3EL5.js.map → chunk-UCNTAS2U.js.map} +0 -0
  1139. /package/dist/{chunk-XF55A7CC.js.map → chunk-UD7IARSL.js.map} +0 -0
  1140. /package/dist/{chunk-M3WCB73E.js.map → chunk-UDKZKGUQ.js.map} +0 -0
  1141. /package/dist/{chunk-VMJN6YQL.js.map → chunk-UJRSZ6ZB.js.map} +0 -0
  1142. /package/dist/{chunk-236GMLCR.js.map → chunk-UTM23O3G.js.map} +0 -0
  1143. /package/dist/{chunk-3VSKLEUE.js.map → chunk-UUJSS56V.js.map} +0 -0
  1144. /package/dist/{chunk-T3WYQHAO.js.map → chunk-UWSF733U.js.map} +0 -0
  1145. /package/dist/{chunk-I57PYKVN.js.map → chunk-V4ZYJWU3.js.map} +0 -0
  1146. /package/dist/{chunk-FUJ6DWRZ.js.map → chunk-VEIT2EGK.js.map} +0 -0
  1147. /package/dist/{chunk-LH3SDMDC.js.map → chunk-VGG6DOTN.js.map} +0 -0
  1148. /package/dist/{chunk-RG7PMYWW.js.map → chunk-VGSGAQJX.js.map} +0 -0
  1149. /package/dist/{chunk-YGPMLIFT.js.map → chunk-VHK5CBIG.js.map} +0 -0
  1150. /package/dist/{chunk-QTT5574G.js.map → chunk-VLA2DTYG.js.map} +0 -0
  1151. /package/dist/{chunk-GJFTPSGN.js.map → chunk-VSN6XKZ5.js.map} +0 -0
  1152. /package/dist/{chunk-5CGZOJN7.js.map → chunk-VW6TOTDQ.js.map} +0 -0
  1153. /package/dist/{chunk-6MSTIFAL.js.map → chunk-W3HKBWPM.js.map} +0 -0
  1154. /package/dist/{chunk-LQDSZPB5.js.map → chunk-WDYM5SFM.js.map} +0 -0
  1155. /package/dist/{chunk-DLMMQMKZ.js.map → chunk-WJ4AZ2AR.js.map} +0 -0
  1156. /package/dist/{chunk-Y3TQ2M2O.js.map → chunk-WMQHP4E3.js.map} +0 -0
  1157. /package/dist/{chunk-H6DJIEO6.js.map → chunk-WP5A6F6P.js.map} +0 -0
  1158. /package/dist/{chunk-GQF2HWQE.js.map → chunk-WWQH3L6M.js.map} +0 -0
  1159. /package/dist/{chunk-2FLGURHP.js.map → chunk-X3T6ULUZ.js.map} +0 -0
  1160. /package/dist/{chunk-QHGWFKTK.js.map → chunk-XA32OUL4.js.map} +0 -0
  1161. /package/dist/{chunk-2ZC62PY4.js.map → chunk-XCICIQIE.js.map} +0 -0
  1162. /package/dist/{chunk-ADFUTR45.js.map → chunk-XHRIUCBD.js.map} +0 -0
  1163. /package/dist/{chunk-UTFX46TK.js.map → chunk-XJBWVT5X.js.map} +0 -0
  1164. /package/dist/{chunk-SY6V3Z2U.js.map → chunk-XKQRWJFE.js.map} +0 -0
  1165. /package/dist/{chunk-VWEGG7JQ.js.map → chunk-XN3EVUB5.js.map} +0 -0
  1166. /package/dist/{chunk-DGS62JWP.js.map → chunk-XT6GBN2G.js.map} +0 -0
  1167. /package/dist/{chunk-RWWQLVGV.js.map → chunk-XYVDTM4D.js.map} +0 -0
  1168. /package/dist/{chunk-67JCL67N.js.map → chunk-XZO5X3KH.js.map} +0 -0
  1169. /package/dist/{chunk-DCML4SXQ.js.map → chunk-Y34DIEOG.js.map} +0 -0
  1170. /package/dist/{chunk-UJKVMFFF.js.map → chunk-YAIYUFCX.js.map} +0 -0
  1171. /package/dist/{chunk-24S44WBL.js.map → chunk-YFLRBEDS.js.map} +0 -0
  1172. /package/dist/{chunk-RLS563ST.js.map → chunk-YQX227EF.js.map} +0 -0
  1173. /package/dist/{chunk-YNIDJOGT.js.map → chunk-YVAB57JZ.js.map} +0 -0
  1174. /package/dist/{chunk-YN6UVG4Z.js.map → chunk-YWHSODBB.js.map} +0 -0
  1175. /package/dist/{chunk-3NMKLLEB.js.map → chunk-YWJHCJQW.js.map} +0 -0
  1176. /package/dist/{chunk-4YJGB22T.js.map → chunk-Z37DSW2K.js.map} +0 -0
  1177. /package/dist/{chunk-72PGXQDN.js.map → chunk-ZELN2B72.js.map} +0 -0
  1178. /package/dist/{chunk-4YNWA5YG.js.map → chunk-ZFGGR2JW.js.map} +0 -0
  1179. /package/dist/{chunk-O3C4BASC.js.map → chunk-ZL7SEED7.js.map} +0 -0
  1180. /package/dist/{computer-viewer-ZISZUM4L.js.map → computer-viewer-CNYFTUGF.js.map} +0 -0
  1181. /package/dist/{embedded-new-voice-UWSSA7AB.js.map → embedded-new-voice-A56WDECM.js.map} +0 -0
  1182. /package/dist/{embedded-voice-T34K465A.js.map → embedded-voice-CBTSMIWW.js.map} +0 -0
  1183. /package/dist/{fleet-decision-row-REAWMEHI.js.map → fleet-decision-row-6PQTGI2U.js.map} +0 -0
  1184. /package/dist/{model-policy-picker-menu-2CTRKSDJ.js.map → model-policy-picker-menu-ZU72JATS.js.map} +0 -0
  1185. /package/dist/{platform-activity-row-EZYTZPYR.js.map → platform-activity-row-5IQT6R5Z.js.map} +0 -0
  1186. /package/dist/{recorder-host-6HFQQTNI.js.map → recorder-host-G5M676VM.js.map} +0 -0
  1187. /package/dist/{sandbox-files-6JY7WVMO.js.map → sandbox-files-HCXOP6ZO.js.map} +0 -0
  1188. /package/dist/{session-connect-cards-VTSJODCX.js.map → session-connect-cards-MYJRQWSA.js.map} +0 -0
  1189. /package/dist/{session-realtime-G3ZGG3KR.js.map → session-realtime-YFVGQFJK.js.map} +0 -0
  1190. /package/dist/{timeline-annotation-markers-S6DMHCI6.js.map → timeline-annotation-markers-5ELTFV5B.js.map} +0 -0
  1191. /package/dist/{timeline-annotation-selection-UFZOKL5E.js.map → timeline-annotation-selection-XHUOFRIY.js.map} +0 -0
  1192. /package/dist/{timeline-annotations-dialog-FPJ4MPHD.js.map → timeline-annotations-dialog-X2VNDYZ4.js.map} +0 -0
@@ -0,0 +1,3690 @@
1
+ "use client";
2
+ import {
3
+ Tooltip,
4
+ TooltipContent,
5
+ TooltipProvider,
6
+ TooltipTrigger
7
+ } from "./chunk-SS4QT7SL.js";
8
+ import {
9
+ useLatestTaskRunner
10
+ } from "./chunk-2DDJ6YH6.js";
11
+ import {
12
+ ArtifactSubmissionProvider,
13
+ ArtifactSurface,
14
+ EditableArtifactDownloadButton,
15
+ EditableArtifactMessage,
16
+ artifactSubmissionSessionKey,
17
+ asEditableArtifactError,
18
+ editableArtifactAccessRevoked,
19
+ editableArtifactProjectionKey,
20
+ editableArtifactStatusLabel,
21
+ useArtifactSubmissions,
22
+ useEditableArtifactView
23
+ } from "./chunk-EMXO5HCY.js";
24
+ import {
25
+ ConfirmDialog
26
+ } from "./chunk-NXQFBC22.js";
27
+ import {
28
+ cn
29
+ } from "./chunk-TXS65BB2.js";
30
+ import {
31
+ useOpenGeniText
32
+ } from "./chunk-CRHH5C6Z.js";
33
+
34
+ // src/components/artifacts/presentation-editor.tsx
35
+ import {
36
+ ChevronLeftIcon,
37
+ ChevronRightIcon,
38
+ ExpandIcon,
39
+ FilePlus2Icon,
40
+ MinusIcon,
41
+ PlusIcon,
42
+ Trash2Icon,
43
+ TypeIcon
44
+ } from "lucide-react";
45
+ import {
46
+ useCallback,
47
+ useEffect,
48
+ useId,
49
+ useLayoutEffect,
50
+ useMemo,
51
+ useRef,
52
+ useState
53
+ } from "react";
54
+ import { jsx, jsxs } from "react/jsx-runtime";
55
+ var MIN_ZOOM = 0.2;
56
+ var MAX_ZOOM = 4;
57
+ var RAIL_ITEM_HEIGHT = 116;
58
+ var RAIL_OVERSCAN = 3;
59
+ var DEFAULT_RAIL_HEIGHT = 640;
60
+ var MOBILE_RAIL_ITEM_HEIGHT = 44;
61
+ var MOBILE_RAIL_OVERSCAN = 3;
62
+ var DEFAULT_MOBILE_LIST_HEIGHT = 264;
63
+ var DEFAULT_VIEWPORT = { width: 960, height: 640 };
64
+ var SPATIAL_TILE = 256;
65
+ var MAX_SPATIAL_BUCKETS_PER_OBJECT = 1024;
66
+ var CANVAS_OVERSCAN_PX = 96;
67
+ var MAX_CANVAS_EDGE = 8192;
68
+ var MAX_CANVAS_PIXELS = 16e6;
69
+ var MAX_EDITOR_GEOMETRY = 1e6;
70
+ var MAX_TABLE_CELLS_PER_PAINT = 2e4;
71
+ var MAX_PROJECTION_SLIDES = 1e5;
72
+ var MAX_PROJECTION_ELEMENTS_PER_SLIDE = 1e5;
73
+ var MAX_PROJECTION_GROUP_DEPTH = 16;
74
+ var MAX_PROJECTION_TABLE_CELLS = 1e6;
75
+ var MAX_PROJECTION_TEXT = 1e6;
76
+ function PresentationEditor(props) {
77
+ return /* @__PURE__ */ jsx(PresentationEditorCore, { ...props });
78
+ }
79
+ function PresentationProjectionEditor({
80
+ projection,
81
+ commit,
82
+ onCommandError,
83
+ onSlideChange,
84
+ onSelectionChange,
85
+ readOnly = false,
86
+ ...props
87
+ }) {
88
+ const view = useMemo(() => presentationViewFromProjection(projection), [projection]);
89
+ return /* @__PURE__ */ jsx(
90
+ PresentationEditorCore,
91
+ {
92
+ ...props,
93
+ presentation: view.presentation,
94
+ revision: projection.revision,
95
+ readOnly: readOnly || !commit,
96
+ onCommit: commit ? (command) => commit({ ...command, revision: projection.revision }) : void 0,
97
+ onCommandError,
98
+ onSlideChange: (slide, index) => {
99
+ const projected = view.slideById.get(slide.id);
100
+ if (projected) onSlideChange?.(projected, index);
101
+ },
102
+ onSelectionChange: (object, slide) => {
103
+ const projectedSlide = view.slideById.get(slide.id);
104
+ if (!projectedSlide) return;
105
+ onSelectionChange?.(
106
+ object ? view.elementById.get(object.id) ?? null : null,
107
+ projectedSlide
108
+ );
109
+ }
110
+ }
111
+ );
112
+ }
113
+ function nextSlideIndexFromKey(key, activeIndex, length) {
114
+ if (length === 0) return null;
115
+ if (key === "ArrowDown") return Math.min(length - 1, activeIndex + 1);
116
+ if (key === "ArrowUp") return Math.max(0, activeIndex - 1);
117
+ if (key === "Home") return 0;
118
+ if (key === "End") return length - 1;
119
+ return null;
120
+ }
121
+ function PresentationEditorCore({
122
+ presentation,
123
+ revision,
124
+ activeSlideId: controlledSlideId,
125
+ defaultActiveSlideId,
126
+ selectedObjectId: controlledSelectionId,
127
+ defaultSelectedObjectId = null,
128
+ zoom: controlledZoom,
129
+ defaultZoom = 0.75,
130
+ readOnly = false,
131
+ authoringBlockedReason,
132
+ className,
133
+ onSlideChange,
134
+ onSelectionChange,
135
+ onCommit,
136
+ onCommandError,
137
+ onZoomChange
138
+ }) {
139
+ const t = useOpenGeniText();
140
+ const mutationsBlocked = readOnly || authoringBlockedReason !== void 0;
141
+ const authoringStatus = readOnly ? null : authoringBlockedReason === "pending_conflict" ? t("artifacts.presentationEditor.anEarlierChangeNeedsAttention") : authoringBlockedReason === "prior_writer" ? t("artifacts.presentationEditor.savingEarlierChanges") : null;
142
+ const slides = presentation.slides.items;
143
+ const firstSlideId = slides[0]?.id ?? null;
144
+ const [localSlideId, setLocalSlideId] = useState(
145
+ defaultActiveSlideId ?? controlledSlideId ?? firstSlideId
146
+ );
147
+ const requestedSlideId = controlledSlideId ?? localSlideId;
148
+ const activeSlide = slides.find((slide) => slide.id === requestedSlideId) ?? slides[0] ?? null;
149
+ const activeIndex = activeSlide ? slides.indexOf(activeSlide) : -1;
150
+ const [localSelectionId, setLocalSelectionId] = useState(defaultSelectedObjectId);
151
+ const selectedId = controlledSelectionId === void 0 ? localSelectionId : controlledSelectionId;
152
+ const [localZoom, setLocalZoom] = useState(() => clampZoom(defaultZoom));
153
+ const zoom = clampZoom(controlledZoom ?? localZoom);
154
+ const [fitMode, setFitMode] = useState(false);
155
+ const [viewportMeasured, setViewportMeasured] = useState(false);
156
+ const [modelEpoch, setModelEpoch] = useState(0);
157
+ const [pendingCommands, setPendingCommands] = useState(0);
158
+ const [commandFailure, setCommandFailure] = useState(null);
159
+ const [rail, setRail] = useState({
160
+ scrollTop: 0,
161
+ height: DEFAULT_RAIL_HEIGHT
162
+ });
163
+ const [mobileSelectorOpen, setMobileSelectorOpen] = useState(false);
164
+ const [mobileRail, setMobileRail] = useState({
165
+ scrollTop: 0,
166
+ height: DEFAULT_MOBILE_LIST_HEIGHT
167
+ });
168
+ const [viewport, setViewport] = useState({
169
+ scrollLeft: 0,
170
+ scrollTop: 0,
171
+ ...DEFAULT_VIEWPORT,
172
+ stageLeft: 0,
173
+ stageTop: 0
174
+ });
175
+ const [draftPosition, setDraftPosition] = useState(null);
176
+ const [textEdit, setTextEdit] = useState(null);
177
+ const [textDraft, setTextDraft] = useState("");
178
+ const [paintEpoch, setPaintEpoch] = useState(0);
179
+ const railRef = useRef(null);
180
+ const mobileSelectorTriggerRef = useRef(null);
181
+ const mobileSelectorPanelRef = useRef(null);
182
+ const mobileRailRef = useRef(null);
183
+ const viewportRef = useRef(null);
184
+ const stageRef = useRef(null);
185
+ const canvasRef = useRef(null);
186
+ const overlayRef = useRef(null);
187
+ const editorRef = useRef(null);
188
+ const dragRef = useRef(null);
189
+ const textEditRef = useRef(null);
190
+ const imageCacheRef = useRef(/* @__PURE__ */ new Map());
191
+ const mountedRef = useRef(true);
192
+ const commandScopeRef = useRef(0);
193
+ const commandVersionsRef = useRef(/* @__PURE__ */ new Map());
194
+ const pendingSlideIdRef = useRef(null);
195
+ const pendingObjectIdRef = useRef(null);
196
+ const mobileRailScrollOnOpenRef = useRef(0);
197
+ const domId = useId().replaceAll(":", "");
198
+ const selectionProxyId = `${domId}-presentation-selection`;
199
+ const instructionsId = `${domId}-presentation-instructions`;
200
+ const objects = useMemo(
201
+ () => activeSlide ? listSlideObjects(activeSlide) : [],
202
+ // revision is a deliberate host invalidation token; modelEpoch covers local commits.
203
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
204
+ [activeSlide, modelEpoch, revision]
205
+ );
206
+ const objectById = useMemo(
207
+ () => new Map(objects.map((entry) => [entry.id, entry])),
208
+ [objects]
209
+ );
210
+ const objectIndexById = useMemo(
211
+ () => new Map(objects.map((entry, index) => [entry.id, index])),
212
+ [objects]
213
+ );
214
+ const selected = selectedId ? objectById.get(selectedId) ?? null : null;
215
+ const spatialIndex = useMemo(
216
+ () => buildSpatialIndex(objects, presentation.slideSize),
217
+ [objects, presentation.slideSize]
218
+ );
219
+ const effectiveSelectedPosition = selected && draftPosition?.objectId === selected.id ? draftPosition.position : selected ? copyPosition(selected.object.position) : null;
220
+ useEffect(() => {
221
+ const pendingSlideId = pendingSlideIdRef.current;
222
+ if (pendingSlideId && controlledSlideId === void 0 && slides.some((slide) => slide.id === pendingSlideId)) {
223
+ pendingSlideIdRef.current = null;
224
+ setLocalSlideId(pendingSlideId);
225
+ return;
226
+ }
227
+ if (activeSlide && requestedSlideId !== activeSlide.id && controlledSlideId === void 0 && pendingSlideId === null) {
228
+ setLocalSlideId(activeSlide.id);
229
+ }
230
+ }, [activeSlide, controlledSlideId, requestedSlideId, slides]);
231
+ useEffect(() => {
232
+ if (selectedId && !objectById.has(selectedId) && controlledSelectionId === void 0) {
233
+ setLocalSelectionId(null);
234
+ }
235
+ }, [controlledSelectionId, objectById, selectedId]);
236
+ useEffect(() => {
237
+ const pendingObjectId = pendingObjectIdRef.current;
238
+ if (pendingObjectId && controlledSelectionId === void 0 && objectById.has(pendingObjectId)) {
239
+ pendingObjectIdRef.current = null;
240
+ setLocalSelectionId(pendingObjectId);
241
+ }
242
+ }, [controlledSelectionId, objectById]);
243
+ useLayoutEffect(() => {
244
+ const element = railRef.current;
245
+ if (!element || typeof ResizeObserver === "undefined") return;
246
+ const measure = () => setRail((current) => ({
247
+ scrollTop: element.scrollTop,
248
+ height: element.clientHeight || current.height
249
+ }));
250
+ measure();
251
+ const observer = new ResizeObserver(measure);
252
+ observer.observe(element);
253
+ return () => observer.disconnect();
254
+ }, []);
255
+ useLayoutEffect(() => {
256
+ if (!mobileSelectorOpen) return;
257
+ const element = mobileRailRef.current;
258
+ if (!element) return;
259
+ element.scrollTop = mobileRailScrollOnOpenRef.current;
260
+ element.focus();
261
+ const measure = () => setMobileRail((current) => ({
262
+ scrollTop: element.scrollTop,
263
+ height: element.clientHeight || current.height
264
+ }));
265
+ measure();
266
+ if (typeof ResizeObserver === "undefined") return;
267
+ const observer = new ResizeObserver(measure);
268
+ observer.observe(element);
269
+ return () => observer.disconnect();
270
+ }, [mobileSelectorOpen]);
271
+ useEffect(() => {
272
+ if (!mobileSelectorOpen) return;
273
+ const onPointerDown = (event) => {
274
+ const target = event.target;
275
+ if (!(target instanceof Node)) return;
276
+ if (mobileSelectorTriggerRef.current?.contains(target)) return;
277
+ if (mobileSelectorPanelRef.current?.contains(target)) return;
278
+ setMobileSelectorOpen(false);
279
+ };
280
+ const onKeyDown = (event) => {
281
+ if (event.key !== "Escape") return;
282
+ event.preventDefault();
283
+ setMobileSelectorOpen(false);
284
+ mobileSelectorTriggerRef.current?.focus();
285
+ };
286
+ document.addEventListener("pointerdown", onPointerDown);
287
+ document.addEventListener("keydown", onKeyDown);
288
+ return () => {
289
+ document.removeEventListener("pointerdown", onPointerDown);
290
+ document.removeEventListener("keydown", onKeyDown);
291
+ };
292
+ }, [mobileSelectorOpen]);
293
+ useLayoutEffect(() => {
294
+ const element = viewportRef.current;
295
+ if (!element) return;
296
+ const measure = () => {
297
+ const stage = stageRef.current;
298
+ const measuredWidth = element.clientWidth;
299
+ const measuredHeight = element.clientHeight;
300
+ const next = {
301
+ scrollLeft: element.scrollLeft,
302
+ scrollTop: element.scrollTop,
303
+ width: measuredWidth || DEFAULT_VIEWPORT.width,
304
+ height: measuredHeight || DEFAULT_VIEWPORT.height,
305
+ stageLeft: stage?.offsetLeft ?? 0,
306
+ stageTop: stage?.offsetTop ?? 0
307
+ };
308
+ setViewport((current) => sameViewport(current, next) ? current : next);
309
+ if (measuredWidth > 0 && measuredHeight > 0) setViewportMeasured(true);
310
+ };
311
+ measure();
312
+ if (typeof ResizeObserver === "undefined") return;
313
+ const observer = new ResizeObserver(measure);
314
+ observer.observe(element);
315
+ if (stageRef.current) observer.observe(stageRef.current);
316
+ return () => observer.disconnect();
317
+ }, [activeSlide?.id, presentation.slideSize.height, presentation.slideSize.width, zoom]);
318
+ useLayoutEffect(() => {
319
+ const imageCache = imageCacheRef.current;
320
+ return () => disposeCanvasImageCache(imageCache);
321
+ }, [activeSlide]);
322
+ useEffect(() => {
323
+ const edit = textEditRef.current;
324
+ const currentEntry = edit ? objectById.get(edit.shape.id) : null;
325
+ if (edit && activeSlide?.id === edit.slideId && currentEntry?.kind === "shape" && !currentEntry.readOnly && currentEntry.object.geometry !== "line") {
326
+ const rebound = {
327
+ ...edit,
328
+ shape: currentEntry.object
329
+ };
330
+ textEditRef.current = rebound;
331
+ setTextEdit(rebound);
332
+ } else {
333
+ textEditRef.current = null;
334
+ setTextEdit(null);
335
+ }
336
+ }, [activeSlide?.id, objectById]);
337
+ useEffect(() => {
338
+ dragRef.current = null;
339
+ setDraftPosition(null);
340
+ commandScopeRef.current += 1;
341
+ commandVersionsRef.current.clear();
342
+ setPendingCommands(0);
343
+ setCommandFailure(null);
344
+ }, [activeSlide?.id, revision]);
345
+ useEffect(() => {
346
+ const edit = textEditRef.current;
347
+ if (edit && edit.shape.id !== selectedId) {
348
+ textEditRef.current = null;
349
+ setTextEdit(null);
350
+ }
351
+ const drag = dragRef.current;
352
+ if (drag && drag.object.id !== selectedId) {
353
+ dragRef.current = null;
354
+ setDraftPosition(null);
355
+ }
356
+ }, [selectedId]);
357
+ useEffect(() => {
358
+ if (!readOnly) return;
359
+ dragRef.current = null;
360
+ setDraftPosition(null);
361
+ textEditRef.current = null;
362
+ setTextEdit(null);
363
+ }, [readOnly]);
364
+ useEffect(() => {
365
+ mountedRef.current = true;
366
+ return () => {
367
+ mountedRef.current = false;
368
+ dragRef.current = null;
369
+ textEditRef.current = null;
370
+ };
371
+ }, []);
372
+ useEffect(() => {
373
+ const element = railRef.current;
374
+ if (!element || activeIndex < 0) return;
375
+ const top = activeIndex * RAIL_ITEM_HEIGHT;
376
+ const bottom = top + RAIL_ITEM_HEIGHT;
377
+ const height = element.clientHeight || rail.height;
378
+ if (top >= element.scrollTop && bottom <= element.scrollTop + height) return;
379
+ const nextTop = Math.max(0, top - height / 2);
380
+ element.scrollTop = nextTop;
381
+ setRail((current) => ({ ...current, scrollTop: nextTop }));
382
+ }, [activeIndex, rail.height]);
383
+ const visibleSlideRegion = useMemo(() => {
384
+ const slideWidth = presentation.slideSize.width;
385
+ const slideHeight = presentation.slideSize.height;
386
+ const stageWidth2 = slideWidth * zoom;
387
+ const stageHeight2 = slideHeight * zoom;
388
+ if (stageWidth2 <= viewport.width && stageHeight2 <= viewport.height) {
389
+ return { left: 0, top: 0, width: slideWidth, height: slideHeight };
390
+ }
391
+ const overscan = CANVAS_OVERSCAN_PX / zoom;
392
+ const visibleLeft = Math.max(0, (viewport.scrollLeft - viewport.stageLeft) / zoom);
393
+ const visibleTop = Math.max(0, (viewport.scrollTop - viewport.stageTop) / zoom);
394
+ const left = Math.max(0, visibleLeft - overscan);
395
+ const top = Math.max(0, visibleTop - overscan);
396
+ return {
397
+ left,
398
+ top,
399
+ width: Math.max(0, Math.min(slideWidth - left, viewport.width / zoom + overscan * 2)),
400
+ height: Math.max(0, Math.min(slideHeight - top, viewport.height / zoom + overscan * 2))
401
+ };
402
+ }, [presentation.slideSize.height, presentation.slideSize.width, viewport, zoom]);
403
+ const visibleObjectIndexes = useMemo(() => {
404
+ if (!activeSlide) return [];
405
+ if (visibleSlideRegion.left === 0 && visibleSlideRegion.top === 0 && visibleSlideRegion.width === presentation.slideSize.width && visibleSlideRegion.height === presentation.slideSize.height) {
406
+ return objects.map((_, index) => index);
407
+ }
408
+ const visible = querySpatialIndex(spatialIndex, visibleSlideRegion);
409
+ const selectedIndex = selectedId ? objectIndexById.get(selectedId) ?? -1 : -1;
410
+ if (selectedIndex >= 0 && !visible.includes(selectedIndex)) visible.push(selectedIndex);
411
+ const draftIndex = draftPosition ? objectIndexById.get(draftPosition.objectId) ?? -1 : -1;
412
+ if (draftIndex >= 0 && !visible.includes(draftIndex)) visible.push(draftIndex);
413
+ return visible.sort((a, b) => a - b);
414
+ }, [
415
+ activeSlide,
416
+ objects,
417
+ objectIndexById,
418
+ presentation.slideSize,
419
+ draftPosition,
420
+ selectedId,
421
+ spatialIndex,
422
+ visibleSlideRegion
423
+ ]);
424
+ useLayoutEffect(() => {
425
+ const canvas = canvasRef.current;
426
+ if (!canvas || !activeSlide) return;
427
+ paintSlideCanvas(t, {
428
+ canvas,
429
+ slide: activeSlide,
430
+ slideSize: presentation.slideSize,
431
+ zoom,
432
+ objects,
433
+ objectIndexes: visibleObjectIndexes,
434
+ renderRegion: visibleSlideRegion,
435
+ draftPosition,
436
+ imageCache: imageCacheRef.current,
437
+ requestRepaint: () => setPaintEpoch((value) => value + 1)
438
+ });
439
+ }, [
440
+ activeSlide,
441
+ draftPosition,
442
+ objects,
443
+ paintEpoch,
444
+ presentation.slideSize,
445
+ visibleObjectIndexes,
446
+ visibleSlideRegion,
447
+ zoom,
448
+ t
449
+ ]);
450
+ const selectObject = useCallback(
451
+ (entry) => {
452
+ textEditRef.current = null;
453
+ setTextEdit(null);
454
+ setDraftPosition(null);
455
+ if (controlledSelectionId === void 0) setLocalSelectionId(entry?.id ?? null);
456
+ if (activeSlide) onSelectionChange?.(entry?.object ?? null, activeSlide);
457
+ },
458
+ [activeSlide, controlledSelectionId, onSelectionChange]
459
+ );
460
+ const selectSlide = useCallback(
461
+ (slide, index) => {
462
+ if (controlledSlideId === void 0) setLocalSlideId(slide.id);
463
+ selectObject(null);
464
+ onSlideChange?.(slide, index);
465
+ },
466
+ [controlledSlideId, onSlideChange, selectObject]
467
+ );
468
+ const changeZoom = useCallback(
469
+ (next) => {
470
+ const clamped = clampZoom(next);
471
+ setFitMode(false);
472
+ if (clamped === zoom) return;
473
+ if (controlledZoom === void 0) setLocalZoom(clamped);
474
+ onZoomChange?.(clamped);
475
+ },
476
+ [controlledZoom, onZoomChange, zoom]
477
+ );
478
+ const applyFittedZoom = useCallback(() => {
479
+ const next = fittedPresentationZoom(viewport, presentation.slideSize);
480
+ if (next === zoom) return;
481
+ if (controlledZoom === void 0) setLocalZoom(next);
482
+ onZoomChange?.(next);
483
+ }, [controlledZoom, onZoomChange, presentation.slideSize, viewport, zoom]);
484
+ const fitSlide = useCallback(() => {
485
+ setFitMode(true);
486
+ applyFittedZoom();
487
+ }, [applyFittedZoom]);
488
+ useLayoutEffect(() => {
489
+ if (!viewportMeasured || controlledZoom !== void 0) return;
490
+ const fitted = fittedPresentationZoom(viewport, presentation.slideSize);
491
+ if (!fitMode && zoom <= fitted) return;
492
+ if (!fitMode) setFitMode(true);
493
+ applyFittedZoom();
494
+ }, [
495
+ applyFittedZoom,
496
+ controlledZoom,
497
+ fitMode,
498
+ presentation.slideSize,
499
+ viewport,
500
+ viewportMeasured,
501
+ zoom
502
+ ]);
503
+ const runCommit = useCallback(
504
+ (key, command, rollback, retry) => {
505
+ if (mutationsBlocked || !onCommit) return;
506
+ const version = (commandVersionsRef.current.get(key) ?? 0) + 1;
507
+ commandVersionsRef.current.set(key, version);
508
+ const scope = commandScopeRef.current;
509
+ setCommandFailure(null);
510
+ let result;
511
+ try {
512
+ result = onCommit(command);
513
+ } catch (cause) {
514
+ if (!mountedRef.current || commandScopeRef.current !== scope || commandVersionsRef.current.get(key) !== version) {
515
+ return;
516
+ }
517
+ rollback();
518
+ const error = asPresentationError(cause);
519
+ setCommandFailure({ message: error.message, retry });
520
+ onCommandError?.(error);
521
+ return;
522
+ }
523
+ if (!result || typeof result.then !== "function") return;
524
+ setPendingCommands((current) => current + 1);
525
+ void Promise.resolve(result).then(
526
+ () => {
527
+ if (!mountedRef.current || commandScopeRef.current !== scope) return;
528
+ setPendingCommands((current) => Math.max(0, current - 1));
529
+ },
530
+ (cause) => {
531
+ if (!mountedRef.current || commandScopeRef.current !== scope) return;
532
+ setPendingCommands((current) => Math.max(0, current - 1));
533
+ if (commandVersionsRef.current.get(key) !== version) return;
534
+ rollback();
535
+ const error = asPresentationError(cause);
536
+ setCommandFailure({ message: error.message, retry });
537
+ onCommandError?.(error);
538
+ }
539
+ );
540
+ },
541
+ [mutationsBlocked, onCommandError, onCommit]
542
+ );
543
+ const commitPosition = useCallback(
544
+ (entry, kind, next) => {
545
+ if (!activeSlide || mutationsBlocked || entry.readOnly) return;
546
+ const before = copyPosition(entry.object.position);
547
+ const after = normalizeEditorPosition(next);
548
+ if (samePosition(before, after)) return;
549
+ entry.object.position = after;
550
+ setModelEpoch((value) => value + 1);
551
+ const command = {
552
+ kind,
553
+ slideId: activeSlide.id,
554
+ objectId: entry.id,
555
+ before,
556
+ after
557
+ };
558
+ const submit = () => runCommit(
559
+ `position:${activeSlide.id}:${entry.id}`,
560
+ command,
561
+ () => {
562
+ entry.object.position = before;
563
+ setModelEpoch((value) => value + 1);
564
+ },
565
+ () => {
566
+ entry.object.position = after;
567
+ setModelEpoch((value) => value + 1);
568
+ submit();
569
+ }
570
+ );
571
+ submit();
572
+ },
573
+ [activeSlide, mutationsBlocked, runCommit]
574
+ );
575
+ const insertSlide = useCallback(() => {
576
+ if (mutationsBlocked) return;
577
+ const slideId = randomPresentationId();
578
+ const index = activeIndex < 0 ? slides.length : activeIndex + 1;
579
+ const command = { kind: "slide-insert", slideId, index };
580
+ const submit = () => {
581
+ pendingSlideIdRef.current = slideId;
582
+ runCommit(
583
+ `slide-insert:${slideId}`,
584
+ command,
585
+ () => {
586
+ if (pendingSlideIdRef.current === slideId) pendingSlideIdRef.current = null;
587
+ },
588
+ submit
589
+ );
590
+ };
591
+ submit();
592
+ }, [activeIndex, mutationsBlocked, runCommit, slides.length]);
593
+ const deleteSlide = useCallback(
594
+ (slideId) => {
595
+ const index = slides.findIndex((slide) => slide.id === slideId);
596
+ if (mutationsBlocked || index < 0) return;
597
+ const command = { kind: "slide-delete", slideId, index };
598
+ const submit = () => runCommit(`slide-delete:${slideId}`, command, () => void 0, submit);
599
+ submit();
600
+ },
601
+ [mutationsBlocked, runCommit, slides]
602
+ );
603
+ const insertTextBox = useCallback(() => {
604
+ if (mutationsBlocked || !activeSlide) return;
605
+ const objectId = randomPresentationId();
606
+ const position = nextTextBoxPosition(objects, presentation.slideSize);
607
+ const command = {
608
+ kind: "object-insert",
609
+ slideId: activeSlide.id,
610
+ objectId,
611
+ index: activeSlide.elements.length,
612
+ position
613
+ };
614
+ const submit = () => {
615
+ pendingObjectIdRef.current = objectId;
616
+ runCommit(
617
+ `object-insert:${activeSlide.id}:${objectId}`,
618
+ command,
619
+ () => {
620
+ if (pendingObjectIdRef.current === objectId) pendingObjectIdRef.current = null;
621
+ },
622
+ submit
623
+ );
624
+ };
625
+ submit();
626
+ }, [activeSlide, objects, presentation.slideSize, mutationsBlocked, runCommit]);
627
+ const deleteObject = useCallback(
628
+ (slideId, objectId) => {
629
+ const entry = activeSlide?.id === slideId ? objectById.get(objectId) : void 0;
630
+ if (mutationsBlocked || !entry || entry.readOnly) return;
631
+ const command = { kind: "object-delete", slideId, objectId };
632
+ const submit = () => runCommit(`object-delete:${slideId}:${objectId}`, command, () => void 0, submit);
633
+ submit();
634
+ },
635
+ [activeSlide, mutationsBlocked, objectById, runCommit]
636
+ );
637
+ const deleteTriggerRef = useRef(null);
638
+ const addSlideRef = useRef(null);
639
+ const [confirmingDelete, setConfirmingDelete] = useState(null);
640
+ const deleteTarget = selected && !selected.readOnly && activeSlide ? {
641
+ kind: "object",
642
+ slideId: activeSlide.id,
643
+ objectId: selected.id,
644
+ name: objectLabel(t, selected)
645
+ } : activeSlide ? { kind: "slide", slideId: activeSlide.id, index: activeIndex } : null;
646
+ const deleteEnabled = !mutationsBlocked && deleteTarget !== null;
647
+ const deleteKind = deleteTarget?.kind ?? "slide";
648
+ const deleteLabel = deleteKind === "object" ? t("artifacts.presentationEditor.deleteObject") : t("artifacts.presentationEditor.deleteSlide");
649
+ const confirmingTargetExists = confirmingDelete === null ? false : confirmingDelete.kind === "slide" ? slides.some((slide) => slide.id === confirmingDelete.slideId) : activeSlide?.id === confirmingDelete.slideId && objectById.has(confirmingDelete.objectId);
650
+ useEffect(() => {
651
+ if (confirmingDelete !== null && (mutationsBlocked || !confirmingTargetExists)) {
652
+ setConfirmingDelete(null);
653
+ }
654
+ }, [confirmingDelete, confirmingTargetExists, mutationsBlocked]);
655
+ const confirmDelete = useCallback(() => {
656
+ if (confirmingDelete?.kind === "object") {
657
+ deleteObject(confirmingDelete.slideId, confirmingDelete.objectId);
658
+ } else if (confirmingDelete?.kind === "slide") {
659
+ deleteSlide(confirmingDelete.slideId);
660
+ }
661
+ }, [confirmingDelete, deleteObject, deleteSlide]);
662
+ const startTextEdit = useCallback(
663
+ (entry) => {
664
+ if (mutationsBlocked || !entry || entry.readOnly || entry.kind !== "shape") return;
665
+ const shape = entry.object;
666
+ if (shape.geometry === "line") return;
667
+ const before = shape.text.toString();
668
+ if (!activeSlide) return;
669
+ const edit = { slideId: activeSlide.id, shape, before };
670
+ textEditRef.current = edit;
671
+ setTextEdit(edit);
672
+ setTextDraft(before);
673
+ },
674
+ [activeSlide, mutationsBlocked]
675
+ );
676
+ useEffect(() => {
677
+ if (!textEdit) return;
678
+ editorRef.current?.focus();
679
+ editorRef.current?.select();
680
+ }, [textEdit]);
681
+ const finishTextEdit = useCallback(
682
+ (cancel = false) => {
683
+ const edit = textEditRef.current;
684
+ if (!edit || !cancel && authoringBlockedReason !== void 0) return;
685
+ textEditRef.current = null;
686
+ setTextEdit(null);
687
+ const { shape, before, slideId } = edit;
688
+ if (!activeSlide || activeSlide.id !== slideId) return;
689
+ if (cancel || mutationsBlocked || before === textDraft) return;
690
+ shape.text.set(textDraft);
691
+ setModelEpoch((value) => value + 1);
692
+ const command = {
693
+ kind: "text",
694
+ slideId,
695
+ objectId: shape.id,
696
+ before,
697
+ after: textDraft
698
+ };
699
+ const submit = () => runCommit(
700
+ `text:${slideId}:${shape.id}`,
701
+ command,
702
+ () => {
703
+ shape.text.set(before);
704
+ setModelEpoch((value) => value + 1);
705
+ },
706
+ () => {
707
+ shape.text.set(textDraft);
708
+ setModelEpoch((value) => value + 1);
709
+ submit();
710
+ }
711
+ );
712
+ submit();
713
+ },
714
+ [activeSlide, authoringBlockedReason, mutationsBlocked, runCommit, textDraft]
715
+ );
716
+ const cycleObject = useCallback(
717
+ (direction) => {
718
+ if (objects.length === 0) return;
719
+ const current = selected ? objects.indexOf(selected) : direction === 1 ? -1 : 0;
720
+ const next = (current + direction + objects.length) % objects.length;
721
+ selectObject(objects[next] ?? null);
722
+ },
723
+ [objects, selectObject, selected]
724
+ );
725
+ const changeSlideBy = useCallback(
726
+ (amount) => {
727
+ if (activeIndex < 0) return;
728
+ const nextIndex = Math.max(0, Math.min(slides.length - 1, activeIndex + amount));
729
+ const next = slides[nextIndex];
730
+ if (next && next !== activeSlide) selectSlide(next, nextIndex);
731
+ },
732
+ [activeIndex, activeSlide, selectSlide, slides]
733
+ );
734
+ const toggleMobileSlideSelector = useCallback(() => {
735
+ setMobileSelectorOpen((open) => {
736
+ if (open) return false;
737
+ const index = Math.max(0, activeIndex);
738
+ const height = DEFAULT_MOBILE_LIST_HEIGHT;
739
+ const maxScroll = Math.max(0, slides.length * MOBILE_RAIL_ITEM_HEIGHT - height);
740
+ const scrollTop = Math.max(
741
+ 0,
742
+ Math.min(
743
+ maxScroll,
744
+ index * MOBILE_RAIL_ITEM_HEIGHT - height / 2 + MOBILE_RAIL_ITEM_HEIGHT / 2
745
+ )
746
+ );
747
+ mobileRailScrollOnOpenRef.current = scrollTop;
748
+ setMobileRail({ scrollTop, height });
749
+ return true;
750
+ });
751
+ }, [activeIndex, slides.length]);
752
+ const chooseMobileSlide = useCallback(
753
+ (slide, index) => {
754
+ if (slide !== activeSlide) selectSlide(slide, index);
755
+ setMobileSelectorOpen(false);
756
+ mobileSelectorTriggerRef.current?.focus();
757
+ },
758
+ [activeSlide, selectSlide]
759
+ );
760
+ const handleCanvasKeyDown = useCallback(
761
+ (event) => {
762
+ if (event.metaKey || event.ctrlKey) {
763
+ if (event.key === "+" || event.key === "=") {
764
+ event.preventDefault();
765
+ changeZoom(zoom * 1.15);
766
+ } else if (event.key === "-") {
767
+ event.preventDefault();
768
+ changeZoom(zoom / 1.15);
769
+ } else if (event.key === "0") {
770
+ event.preventDefault();
771
+ fitSlide();
772
+ }
773
+ return;
774
+ }
775
+ if (event.key === "]") {
776
+ event.preventDefault();
777
+ cycleObject(1);
778
+ return;
779
+ }
780
+ if (event.key === "[") {
781
+ event.preventDefault();
782
+ cycleObject(-1);
783
+ return;
784
+ }
785
+ if (event.key === "PageDown") {
786
+ event.preventDefault();
787
+ changeSlideBy(1);
788
+ return;
789
+ }
790
+ if (event.key === "PageUp") {
791
+ event.preventDefault();
792
+ changeSlideBy(-1);
793
+ return;
794
+ }
795
+ if (event.key === "Escape") {
796
+ event.preventDefault();
797
+ selectObject(null);
798
+ return;
799
+ }
800
+ if (event.key === "Enter" || event.key === "F2") {
801
+ if (selected?.kind === "shape") {
802
+ event.preventDefault();
803
+ startTextEdit(selected);
804
+ }
805
+ return;
806
+ }
807
+ if (!selected || !event.key.startsWith("Arrow")) return;
808
+ event.preventDefault();
809
+ if (mutationsBlocked || selected.readOnly) return;
810
+ const amount = event.shiftKey ? 10 : 1;
811
+ const dx = event.key === "ArrowLeft" ? -amount : event.key === "ArrowRight" ? amount : 0;
812
+ const dy = event.key === "ArrowUp" ? -amount : event.key === "ArrowDown" ? amount : 0;
813
+ const before = selected.object.position;
814
+ commitPosition(
815
+ selected,
816
+ event.altKey ? "resize" : "move",
817
+ event.altKey ? {
818
+ ...before,
819
+ width: Math.max(8, before.width + dx),
820
+ height: Math.max(8, before.height + dy)
821
+ } : { ...before, left: before.left + dx, top: before.top + dy }
822
+ );
823
+ },
824
+ [
825
+ changeSlideBy,
826
+ changeZoom,
827
+ commitPosition,
828
+ cycleObject,
829
+ fitSlide,
830
+ mutationsBlocked,
831
+ selectObject,
832
+ selected,
833
+ startTextEdit,
834
+ zoom
835
+ ]
836
+ );
837
+ const pointFromPointer = useCallback(
838
+ (event) => {
839
+ const rect = overlayRef.current?.getBoundingClientRect() ?? event.currentTarget.getBoundingClientRect();
840
+ const width = rect.width || presentation.slideSize.width * zoom;
841
+ const height = rect.height || presentation.slideSize.height * zoom;
842
+ return {
843
+ x: (event.clientX - rect.left) / Math.max(1, width) * presentation.slideSize.width,
844
+ y: (event.clientY - rect.top) / Math.max(1, height) * presentation.slideSize.height
845
+ };
846
+ },
847
+ [presentation.slideSize.height, presentation.slideSize.width, zoom]
848
+ );
849
+ const beginDrag = useCallback(
850
+ (event, entry, mode) => {
851
+ event.preventDefault();
852
+ event.stopPropagation();
853
+ selectObject(entry);
854
+ if (mutationsBlocked || entry.readOnly) return;
855
+ const start = pointFromPointer(event);
856
+ const before = copyPosition(entry.object.position);
857
+ dragRef.current = {
858
+ pointerId: event.pointerId,
859
+ mode,
860
+ object: entry.object,
861
+ rotation: objectRotation(entry),
862
+ start,
863
+ before
864
+ };
865
+ setDraftPosition({ objectId: entry.id, position: before });
866
+ overlayRef.current?.setPointerCapture?.(event.pointerId);
867
+ },
868
+ [pointFromPointer, mutationsBlocked, selectObject]
869
+ );
870
+ const handlePointerDown = useCallback(
871
+ (event) => {
872
+ if (event.button !== 0) return;
873
+ const point = pointFromPointer(event);
874
+ const hit = hitTest(spatialIndex, point.x, point.y);
875
+ if (!hit) {
876
+ selectObject(null);
877
+ return;
878
+ }
879
+ beginDrag(event, hit, "move");
880
+ },
881
+ [beginDrag, pointFromPointer, selectObject, spatialIndex]
882
+ );
883
+ const handlePointerMove = useCallback(
884
+ (event) => {
885
+ const drag = dragRef.current;
886
+ if (!drag || drag.pointerId !== event.pointerId || mutationsBlocked) return;
887
+ const point = pointFromPointer(event);
888
+ setDraftPosition({ objectId: drag.object.id, position: positionFromDrag(drag, point) });
889
+ },
890
+ [mutationsBlocked, pointFromPointer]
891
+ );
892
+ const finishDrag = useCallback(
893
+ (event, cancel = false) => {
894
+ const drag = dragRef.current;
895
+ if (!drag || drag.pointerId !== event.pointerId || !cancel && authoringBlockedReason !== void 0)
896
+ return;
897
+ dragRef.current = null;
898
+ const captureTarget = overlayRef.current;
899
+ if (captureTarget?.hasPointerCapture?.(event.pointerId)) {
900
+ captureTarget.releasePointerCapture(event.pointerId);
901
+ }
902
+ setDraftPosition(null);
903
+ if (cancel) return;
904
+ const entry = objectById.get(drag.object.id);
905
+ if (!entry) return;
906
+ const point = pointFromPointer(event);
907
+ commitPosition(entry, drag.mode, positionFromDrag(drag, point));
908
+ },
909
+ [authoringBlockedReason, commitPosition, objectById, pointFromPointer]
910
+ );
911
+ const handleLostPointerCapture = useCallback(
912
+ (event) => {
913
+ const drag = dragRef.current;
914
+ if (!drag || drag.pointerId !== event.pointerId || authoringBlockedReason !== void 0)
915
+ return;
916
+ dragRef.current = null;
917
+ setDraftPosition(null);
918
+ },
919
+ [authoringBlockedReason]
920
+ );
921
+ const railStart = Math.max(0, Math.floor(rail.scrollTop / RAIL_ITEM_HEIGHT) - RAIL_OVERSCAN);
922
+ const railEnd = Math.min(
923
+ slides.length,
924
+ Math.ceil((rail.scrollTop + rail.height) / RAIL_ITEM_HEIGHT) + RAIL_OVERSCAN
925
+ );
926
+ const mobileRailStart = Math.max(
927
+ 0,
928
+ Math.floor(mobileRail.scrollTop / MOBILE_RAIL_ITEM_HEIGHT) - MOBILE_RAIL_OVERSCAN
929
+ );
930
+ const mobileRailEnd = Math.min(
931
+ slides.length,
932
+ Math.ceil((mobileRail.scrollTop + mobileRail.height) / MOBILE_RAIL_ITEM_HEIGHT) + MOBILE_RAIL_OVERSCAN
933
+ );
934
+ const slideCountLabel = activeIndex >= 0 ? `${activeIndex + 1} / ${slides.length}` : `0 / ${slides.length}`;
935
+ const stageWidth = presentation.slideSize.width * zoom;
936
+ const stageHeight = presentation.slideSize.height * zoom;
937
+ return /* @__PURE__ */ jsxs(
938
+ "div",
939
+ {
940
+ className: cn("flex size-full min-w-0 flex-col bg-og-surface-1", className),
941
+ style: { minHeight: "22rem" },
942
+ "data-og-presentation-editor": true,
943
+ "data-og-painted-object-count": visibleObjectIndexes.length,
944
+ "data-og-command-state": commandFailure || authoringBlockedReason === "pending_conflict" ? "error" : pendingCommands > 0 || authoringBlockedReason === "prior_writer" ? "pending" : "idle",
945
+ "aria-busy": pendingCommands > 0 || authoringBlockedReason === "prior_writer" ? "true" : void 0,
946
+ children: [
947
+ /* @__PURE__ */ jsxs(
948
+ "div",
949
+ {
950
+ role: "toolbar",
951
+ "aria-label": t("artifacts.presentationEditor.presentationControls"),
952
+ className: "flex h-10 shrink-0 items-center border-b border-og-border bg-og-surface-2",
953
+ children: [
954
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto px-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: [
955
+ /* @__PURE__ */ jsx(
956
+ "button",
957
+ {
958
+ type: "button",
959
+ "aria-label": t("artifacts.presentationEditor.previousSlide"),
960
+ disabled: activeIndex <= 0,
961
+ onClick: () => changeSlideBy(-1),
962
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
963
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
964
+ }
965
+ ),
966
+ /* @__PURE__ */ jsx(
967
+ "button",
968
+ {
969
+ ref: mobileSelectorTriggerRef,
970
+ type: "button",
971
+ "aria-label": t("artifacts.presentationEditor.chooseSlide"),
972
+ "aria-haspopup": "listbox",
973
+ "aria-expanded": mobileSelectorOpen,
974
+ "aria-controls": mobileSelectorOpen ? `${domId}-mobile-slides` : void 0,
975
+ disabled: slides.length === 0,
976
+ "data-og-mobile-slide-selector": true,
977
+ onClick: toggleMobileSlideSelector,
978
+ className: "inline-flex min-h-11 min-w-16 shrink-0 items-center justify-center rounded-og-sm px-2 text-og-xs tabular-nums text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 sm:hidden",
979
+ children: /* @__PURE__ */ jsx("span", { children: slideCountLabel })
980
+ }
981
+ ),
982
+ /* @__PURE__ */ jsx("span", { className: "hidden min-w-16 shrink-0 text-center text-og-xs tabular-nums text-og-fg-muted sm:inline", children: slideCountLabel }),
983
+ /* @__PURE__ */ jsx(
984
+ "button",
985
+ {
986
+ type: "button",
987
+ "aria-label": t("artifacts.presentationEditor.nextSlide"),
988
+ disabled: activeIndex < 0 || activeIndex >= slides.length - 1,
989
+ onClick: () => changeSlideBy(1),
990
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
991
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
992
+ }
993
+ ),
994
+ /* @__PURE__ */ jsx(
995
+ "button",
996
+ {
997
+ type: "button",
998
+ ref: addSlideRef,
999
+ "aria-label": t("artifacts.presentationEditor.addSlide"),
1000
+ disabled: mutationsBlocked,
1001
+ onClick: insertSlide,
1002
+ className: "ml-0.5 grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
1003
+ children: /* @__PURE__ */ jsx(FilePlus2Icon, {})
1004
+ }
1005
+ ),
1006
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1007
+ /* @__PURE__ */ jsx(
1008
+ "button",
1009
+ {
1010
+ type: "button",
1011
+ "aria-label": t("artifacts.presentationEditor.zoomOut"),
1012
+ onClick: () => changeZoom(zoom / 1.15),
1013
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1014
+ children: /* @__PURE__ */ jsx(MinusIcon, {})
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ jsxs("span", { className: "min-w-11 shrink-0 text-center text-og-xs tabular-nums text-og-fg-muted", children: [
1018
+ Math.round(zoom * 100),
1019
+ "%"
1020
+ ] }),
1021
+ /* @__PURE__ */ jsx(
1022
+ "button",
1023
+ {
1024
+ type: "button",
1025
+ "aria-label": t("artifacts.presentationEditor.zoomIn"),
1026
+ onClick: () => changeZoom(zoom * 1.15),
1027
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1028
+ children: /* @__PURE__ */ jsx(PlusIcon, {})
1029
+ }
1030
+ ),
1031
+ /* @__PURE__ */ jsx(
1032
+ "button",
1033
+ {
1034
+ type: "button",
1035
+ "aria-label": t("artifacts.presentationEditor.fitSlide"),
1036
+ onClick: fitSlide,
1037
+ className: "ml-0.5 grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1038
+ children: /* @__PURE__ */ jsx(ExpandIcon, {})
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1042
+ /* @__PURE__ */ jsx(
1043
+ "button",
1044
+ {
1045
+ type: "button",
1046
+ "aria-label": t("artifacts.presentationEditor.addTextBox"),
1047
+ disabled: mutationsBlocked || !activeSlide,
1048
+ onClick: insertTextBox,
1049
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
1050
+ children: /* @__PURE__ */ jsx(TypeIcon, {})
1051
+ }
1052
+ ),
1053
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1054
+ /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
1055
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1056
+ "button",
1057
+ {
1058
+ ref: deleteTriggerRef,
1059
+ type: "button",
1060
+ "data-og-presentation-delete": deleteKind,
1061
+ disabled: !deleteEnabled,
1062
+ onClick: () => setConfirmingDelete(deleteTarget),
1063
+ className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-og-sm px-2 text-og-xs text-og-fg-muted hover:bg-og-surface-3 hover:text-og-status-failed disabled:opacity-35 [&>svg]:size-3.5",
1064
+ children: [
1065
+ /* @__PURE__ */ jsx(Trash2Icon, { "aria-hidden": true }),
1066
+ /* @__PURE__ */ jsx("span", { children: deleteLabel })
1067
+ ]
1068
+ }
1069
+ ) }),
1070
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: deleteKind === "object" ? t("artifacts.presentationEditor.deleteObjectHint") : t("artifacts.presentationEditor.deleteSlideHint") })
1071
+ ] }) })
1072
+ ] }),
1073
+ /* @__PURE__ */ jsx(
1074
+ "span",
1075
+ {
1076
+ className: "hidden max-w-44 shrink-0 truncate border-l border-og-border px-2 text-og-xs text-og-fg-subtle sm:block",
1077
+ title: commandFailure ? t("artifacts.presentationEditor.changeNotSaved") : authoringStatus ? authoringStatus : pendingCommands > 0 ? t("artifacts.presentationEditor.saving") : mutationsBlocked ? t("artifacts.presentationEditor.viewOnly") : selected ? `${objectLabel(t, selected)}${selected.readOnly ? " \xB7 View only" : ""}` : t("artifacts.presentationEditor.selectAnObjectToEdit"),
1078
+ children: commandFailure ? t("artifacts.presentationEditor.changeNotSaved") : authoringStatus ? authoringStatus : pendingCommands > 0 ? t("artifacts.presentationEditor.saving") : mutationsBlocked ? t("artifacts.presentationEditor.viewOnly") : selected ? `${objectLabel(t, selected)}${selected.readOnly ? " \xB7 View only" : ""}` : t("artifacts.presentationEditor.selectAnObjectToEdit")
1079
+ }
1080
+ )
1081
+ ]
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: commandFailure?.message ?? authoringStatus ?? (pendingCommands > 0 ? t("artifacts.presentationEditor.savingPresentationChanges") : "") }),
1085
+ /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 min-w-0 flex-1", children: [
1086
+ /* @__PURE__ */ jsx(
1087
+ "div",
1088
+ {
1089
+ ref: railRef,
1090
+ role: "listbox",
1091
+ tabIndex: 0,
1092
+ "aria-label": t("artifacts.presentationEditor.slides"),
1093
+ "aria-orientation": "vertical",
1094
+ "aria-activedescendant": activeSlide && activeIndex >= railStart && activeIndex < railEnd ? `${domId}-slide-${safeDomId(activeSlide.id)}` : void 0,
1095
+ className: "relative hidden w-40 shrink-0 overflow-y-auto border-r border-og-border bg-og-surface-2/70 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent sm:block",
1096
+ "data-og-slide-rail": true,
1097
+ "data-og-window-start": railStart,
1098
+ "data-og-window-end": railEnd,
1099
+ onScroll: (event) => {
1100
+ const scrollTop = event.currentTarget.scrollTop;
1101
+ const height = event.currentTarget.clientHeight;
1102
+ setRail((current) => ({
1103
+ scrollTop,
1104
+ height: height || current.height
1105
+ }));
1106
+ },
1107
+ onKeyDown: (event) => {
1108
+ const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
1109
+ if (nextIndex === null) return;
1110
+ event.preventDefault();
1111
+ const next = slides[nextIndex];
1112
+ if (next && next !== activeSlide) selectSlide(next, nextIndex);
1113
+ },
1114
+ children: /* @__PURE__ */ jsx("div", { className: "relative w-full", style: { height: slides.length * RAIL_ITEM_HEIGHT }, children: slides.slice(railStart, railEnd).map((slide, offset) => {
1115
+ const index = railStart + offset;
1116
+ const active = slide === activeSlide;
1117
+ return /* @__PURE__ */ jsxs(
1118
+ "button",
1119
+ {
1120
+ id: `${domId}-slide-${safeDomId(slide.id)}`,
1121
+ type: "button",
1122
+ role: "option",
1123
+ tabIndex: -1,
1124
+ "aria-selected": active,
1125
+ "aria-label": t("artifacts.presentationEditor.slideIndexValue", {
1126
+ index: index + 1,
1127
+ value: slide.title ? `: ${slide.title}` : ""
1128
+ }),
1129
+ onClick: () => selectSlide(slide, index),
1130
+ className: cn(
1131
+ "absolute left-0 flex w-full items-start gap-2 px-2 py-2 text-left transition-colors",
1132
+ active ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3/70"
1133
+ ),
1134
+ style: { top: index * RAIL_ITEM_HEIGHT, height: 116 },
1135
+ "data-og-slide-index": index,
1136
+ children: [
1137
+ /* @__PURE__ */ jsx("span", { className: "w-5 shrink-0 pt-0.5 text-right text-og-xs tabular-nums text-og-fg-subtle", children: index + 1 }),
1138
+ /* @__PURE__ */ jsx(
1139
+ "span",
1140
+ {
1141
+ className: cn(
1142
+ "block min-w-0 flex-1 overflow-hidden border bg-white shadow-og-sm",
1143
+ active ? "border-og-accent" : "border-og-border"
1144
+ ),
1145
+ style: { aspectRatio: "16 / 9", borderRadius: 3 },
1146
+ children: /* @__PURE__ */ jsx(
1147
+ SlideThumbnail,
1148
+ {
1149
+ slide,
1150
+ width: presentation.slideSize.width,
1151
+ height: presentation.slideSize.height,
1152
+ paintRevision: `${String(revision ?? "")}:${modelEpoch}`
1153
+ }
1154
+ )
1155
+ }
1156
+ )
1157
+ ]
1158
+ },
1159
+ slide.id
1160
+ );
1161
+ }) })
1162
+ }
1163
+ ),
1164
+ mobileSelectorOpen ? /* @__PURE__ */ jsx(
1165
+ "div",
1166
+ {
1167
+ ref: mobileSelectorPanelRef,
1168
+ className: "absolute left-2 top-2 z-40 max-w-56 overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 shadow-og-md sm:hidden",
1169
+ style: { width: "calc(100% - 1rem)" },
1170
+ children: /* @__PURE__ */ jsx(
1171
+ "div",
1172
+ {
1173
+ ref: mobileRailRef,
1174
+ id: `${domId}-mobile-slides`,
1175
+ role: "listbox",
1176
+ tabIndex: 0,
1177
+ "aria-label": t("artifacts.presentationEditor.slides"),
1178
+ "aria-orientation": "vertical",
1179
+ "aria-activedescendant": activeSlide && activeIndex >= mobileRailStart && activeIndex < mobileRailEnd ? `${domId}-mobile-slide-${safeDomId(activeSlide.id)}` : void 0,
1180
+ className: "max-h-72 overflow-y-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
1181
+ "data-og-mobile-slide-list": true,
1182
+ "data-og-window-start": mobileRailStart,
1183
+ "data-og-window-end": mobileRailEnd,
1184
+ onScroll: (event) => {
1185
+ const scrollTop = event.currentTarget.scrollTop;
1186
+ const height = event.currentTarget.clientHeight;
1187
+ setMobileRail((current) => ({
1188
+ scrollTop,
1189
+ height: height || current.height
1190
+ }));
1191
+ },
1192
+ onKeyDown: (event) => {
1193
+ if (event.key === "Escape") {
1194
+ event.preventDefault();
1195
+ setMobileSelectorOpen(false);
1196
+ mobileSelectorTriggerRef.current?.focus();
1197
+ return;
1198
+ }
1199
+ const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
1200
+ if (nextIndex === null) return;
1201
+ event.preventDefault();
1202
+ const next = slides[nextIndex];
1203
+ if (!next) return;
1204
+ if (next !== activeSlide) selectSlide(next, nextIndex);
1205
+ const list = event.currentTarget;
1206
+ const top = nextIndex * MOBILE_RAIL_ITEM_HEIGHT;
1207
+ const bottom = top + MOBILE_RAIL_ITEM_HEIGHT;
1208
+ if (top < list.scrollTop) list.scrollTop = top;
1209
+ else if (bottom > list.scrollTop + list.clientHeight) {
1210
+ list.scrollTop = bottom - list.clientHeight;
1211
+ }
1212
+ },
1213
+ children: /* @__PURE__ */ jsx(
1214
+ "div",
1215
+ {
1216
+ className: "relative w-full",
1217
+ style: { height: slides.length * MOBILE_RAIL_ITEM_HEIGHT },
1218
+ children: slides.slice(mobileRailStart, mobileRailEnd).map((slide, offset) => {
1219
+ const index = mobileRailStart + offset;
1220
+ const active = slide === activeSlide;
1221
+ return /* @__PURE__ */ jsxs(
1222
+ "button",
1223
+ {
1224
+ id: `${domId}-mobile-slide-${safeDomId(slide.id)}`,
1225
+ type: "button",
1226
+ role: "option",
1227
+ tabIndex: -1,
1228
+ "aria-selected": active,
1229
+ "aria-label": t("artifacts.presentationEditor.slideIndexValue", {
1230
+ index: index + 1,
1231
+ value: slide.title ? `: ${slide.title}` : ""
1232
+ }),
1233
+ onClick: () => chooseMobileSlide(slide, index),
1234
+ className: cn(
1235
+ "absolute left-0 flex min-h-11 w-full items-center gap-2 px-2 text-left",
1236
+ active ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3/70"
1237
+ ),
1238
+ style: {
1239
+ top: index * MOBILE_RAIL_ITEM_HEIGHT,
1240
+ height: MOBILE_RAIL_ITEM_HEIGHT
1241
+ },
1242
+ "data-og-mobile-slide-index": index,
1243
+ children: [
1244
+ /* @__PURE__ */ jsx("span", { className: "w-7 shrink-0 text-right text-og-xs tabular-nums text-og-fg-subtle", children: index + 1 }),
1245
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-og-sm", children: slide.title || t("artifacts.presentationEditor.slideIndex", { index: index + 1 }) })
1246
+ ]
1247
+ },
1248
+ slide.id
1249
+ );
1250
+ })
1251
+ }
1252
+ )
1253
+ }
1254
+ )
1255
+ }
1256
+ ) : null,
1257
+ /* @__PURE__ */ jsxs(
1258
+ "div",
1259
+ {
1260
+ ref: viewportRef,
1261
+ className: "relative min-h-0 min-w-0 flex-1 overflow-auto bg-og-surface-3/60 p-6",
1262
+ onScroll: (event) => {
1263
+ const element = event.currentTarget;
1264
+ const width = element.clientWidth || viewport.width;
1265
+ const height = element.clientHeight || viewport.height;
1266
+ const next = {
1267
+ scrollLeft: element.scrollLeft,
1268
+ scrollTop: element.scrollTop,
1269
+ width,
1270
+ height,
1271
+ stageLeft: stageRef.current?.offsetLeft ?? 0,
1272
+ stageTop: stageRef.current?.offsetTop ?? 0
1273
+ };
1274
+ setViewport((current) => sameViewport(current, next) ? current : next);
1275
+ if (element.clientWidth > 0 && element.clientHeight > 0) setViewportMeasured(true);
1276
+ },
1277
+ "data-og-presentation-viewport": true,
1278
+ children: [
1279
+ commandFailure ? /* @__PURE__ */ jsxs(
1280
+ "div",
1281
+ {
1282
+ role: "alert",
1283
+ className: "absolute left-2 top-2 z-30 flex w-fit items-center gap-2 rounded-og-sm border border-og-status-failed/30 bg-og-surface-1/95 px-2 py-1 text-og-xs text-og-status-failed shadow-og-sm",
1284
+ style: { maxWidth: "calc(100% - 1rem)" },
1285
+ children: [
1286
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: commandFailure.message }),
1287
+ /* @__PURE__ */ jsx(
1288
+ "button",
1289
+ {
1290
+ type: "button",
1291
+ disabled: mutationsBlocked,
1292
+ onClick: () => {
1293
+ if (!mutationsBlocked) commandFailure.retry();
1294
+ },
1295
+ className: "shrink-0 rounded-og-xs px-1.5 py-0.5 font-medium outline-hidden hover:bg-og-surface-3 focus-visible:ring-2 focus-visible:ring-og-accent",
1296
+ children: t("artifacts.presentationEditor.retry")
1297
+ }
1298
+ )
1299
+ ]
1300
+ }
1301
+ ) : null,
1302
+ activeSlide ? /* @__PURE__ */ jsxs(
1303
+ "div",
1304
+ {
1305
+ ref: stageRef,
1306
+ className: "relative mx-auto shrink-0 overflow-hidden shadow-og-lg",
1307
+ style: { width: stageWidth, height: stageHeight, backgroundColor: "#fff" },
1308
+ "data-og-presentation-stage": true,
1309
+ "data-og-theme": "light",
1310
+ children: [
1311
+ /* @__PURE__ */ jsx(
1312
+ "canvas",
1313
+ {
1314
+ ref: canvasRef,
1315
+ "aria-hidden": true,
1316
+ className: "absolute inset-0 size-full",
1317
+ style: { width: stageWidth, height: stageHeight }
1318
+ }
1319
+ ),
1320
+ /* @__PURE__ */ jsx(
1321
+ "svg",
1322
+ {
1323
+ ref: overlayRef,
1324
+ role: "application",
1325
+ tabIndex: 0,
1326
+ "aria-label": t("artifacts.presentationEditor.slideActiveindexEditor", {
1327
+ activeIndex: activeIndex + 1
1328
+ }),
1329
+ "aria-describedby": selected ? `${instructionsId} ${selectionProxyId}` : instructionsId,
1330
+ "aria-readonly": mutationsBlocked || selected?.readOnly || void 0,
1331
+ viewBox: `0 0 ${presentation.slideSize.width} ${presentation.slideSize.height}`,
1332
+ className: "absolute inset-0 size-full touch-none outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
1333
+ onKeyDown: handleCanvasKeyDown,
1334
+ onPointerDown: handlePointerDown,
1335
+ onPointerMove: handlePointerMove,
1336
+ onPointerUp: (event) => finishDrag(event),
1337
+ onPointerCancel: (event) => finishDrag(event, true),
1338
+ onLostPointerCapture: handleLostPointerCapture,
1339
+ onDoubleClick: () => startTextEdit(selected),
1340
+ children: selected && effectiveSelectedPosition ? /* @__PURE__ */ jsxs(
1341
+ "g",
1342
+ {
1343
+ "data-og-presentation-object": selected.id,
1344
+ transform: selectionTransform(selected, effectiveSelectedPosition),
1345
+ children: [
1346
+ /* @__PURE__ */ jsx(
1347
+ "rect",
1348
+ {
1349
+ x: effectiveSelectedPosition.left,
1350
+ y: effectiveSelectedPosition.top,
1351
+ width: effectiveSelectedPosition.width,
1352
+ height: effectiveSelectedPosition.height,
1353
+ fill: "transparent",
1354
+ stroke: "var(--og-color-accent-deep)",
1355
+ strokeWidth: 2,
1356
+ vectorEffect: "non-scaling-stroke",
1357
+ pointerEvents: "none"
1358
+ }
1359
+ ),
1360
+ !mutationsBlocked && !selected.readOnly ? /* @__PURE__ */ jsx(
1361
+ "circle",
1362
+ {
1363
+ cx: effectiveSelectedPosition.left + effectiveSelectedPosition.width,
1364
+ cy: effectiveSelectedPosition.top + effectiveSelectedPosition.height,
1365
+ r: 6 / zoom,
1366
+ fill: "var(--og-color-accent-deep)",
1367
+ stroke: "white",
1368
+ strokeWidth: 1.5,
1369
+ vectorEffect: "non-scaling-stroke",
1370
+ className: "cursor-nwse-resize",
1371
+ onPointerDown: (event) => beginDrag(event, selected, "resize")
1372
+ }
1373
+ ) : null
1374
+ ]
1375
+ }
1376
+ ) : null
1377
+ }
1378
+ ),
1379
+ selected ? /* @__PURE__ */ jsx("span", { id: selectionProxyId, role: "status", "aria-live": "polite", className: "sr-only", children: accessibleObjectLabel(t, selected) }) : null,
1380
+ /* @__PURE__ */ jsx("span", { id: instructionsId, className: "sr-only", children: t("artifacts.presentationEditor.useBracketKeysToSelect") }),
1381
+ textEdit && selected?.id === textEdit.shape.id && effectiveSelectedPosition ? /* @__PURE__ */ jsx(
1382
+ "textarea",
1383
+ {
1384
+ ref: editorRef,
1385
+ "aria-label": t("artifacts.presentationEditor.editName", {
1386
+ name: textEdit.shape.name
1387
+ }),
1388
+ value: textDraft,
1389
+ readOnly: mutationsBlocked,
1390
+ maxLength: 1e6,
1391
+ onChange: (event) => {
1392
+ if (!mutationsBlocked) setTextDraft(event.currentTarget.value);
1393
+ },
1394
+ onInput: (event) => {
1395
+ if (!mutationsBlocked) setTextDraft(event.currentTarget.value);
1396
+ },
1397
+ onBlur: () => finishTextEdit(),
1398
+ onKeyDown: (event) => {
1399
+ if (event.key === "Escape") {
1400
+ event.preventDefault();
1401
+ finishTextEdit(true);
1402
+ } else if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
1403
+ event.preventDefault();
1404
+ finishTextEdit();
1405
+ }
1406
+ },
1407
+ className: "absolute resize-none overflow-hidden border-2 border-og-accent p-1 outline-hidden",
1408
+ style: {
1409
+ left: effectiveSelectedPosition.left * zoom,
1410
+ top: effectiveSelectedPosition.top * zoom,
1411
+ width: effectiveSelectedPosition.width * zoom,
1412
+ height: effectiveSelectedPosition.height * zoom,
1413
+ backgroundColor: "#fffffff2",
1414
+ color: resolveColor(textEdit.shape.text.style.color ?? "slate-950"),
1415
+ fontFamily: textEdit.shape.text.style.fontFamily ?? "Arial, sans-serif",
1416
+ fontSize: Math.max(8, (textEdit.shape.text.style.fontSize ?? 18) * zoom),
1417
+ fontWeight: textEdit.shape.text.style.bold ? 700 : 400,
1418
+ fontStyle: textEdit.shape.text.style.italic ? "italic" : "normal",
1419
+ textAlign: textEdit.shape.text.style.alignment ?? "left",
1420
+ transform: textEdit.shape.rotation === 0 ? void 0 : `rotate(${textEdit.shape.rotation}deg)`,
1421
+ transformOrigin: "center"
1422
+ }
1423
+ }
1424
+ ) : null
1425
+ ]
1426
+ }
1427
+ ) : /* @__PURE__ */ jsx("div", { className: "grid size-full min-h-72 place-items-center text-og-sm text-og-fg-muted", children: t("artifacts.presentationEditor.thisPresentationHasNoSlides") })
1428
+ ]
1429
+ }
1430
+ )
1431
+ ] }),
1432
+ /* @__PURE__ */ jsx(
1433
+ ConfirmDialog,
1434
+ {
1435
+ open: confirmingDelete !== null,
1436
+ onOpenChange: (open) => {
1437
+ if (!open) setConfirmingDelete(null);
1438
+ },
1439
+ title: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObjectTitle", { name: confirmingDelete.name }) : t("artifacts.presentationEditor.deleteSlideTitle", {
1440
+ index: (confirmingDelete?.index ?? activeIndex) + 1
1441
+ }),
1442
+ description: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObjectDescription") : t("artifacts.presentationEditor.deleteSlideDescription"),
1443
+ confirmLabel: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObject") : t("artifacts.presentationEditor.deleteSlide"),
1444
+ restoreFocusRef: deleteTriggerRef,
1445
+ restoreFocusFallbackRef: addSlideRef,
1446
+ onConfirm: confirmDelete
1447
+ }
1448
+ )
1449
+ ]
1450
+ }
1451
+ );
1452
+ }
1453
+ function PresentationArtifactSurface({
1454
+ presentation,
1455
+ title: titleProp,
1456
+ showHeader,
1457
+ subtitle,
1458
+ actions,
1459
+ busy,
1460
+ className,
1461
+ ...editorProps
1462
+ }) {
1463
+ const t = useOpenGeniText();
1464
+ const title = titleProp === void 0 ? t("artifacts.presentationEditor.presentation") : titleProp;
1465
+ const count = presentation.slides.items.length;
1466
+ return /* @__PURE__ */ jsx(
1467
+ ArtifactSurface,
1468
+ {
1469
+ modality: "presentation",
1470
+ title,
1471
+ showHeader,
1472
+ subtitle: subtitle ?? t("counts.slides", { count }),
1473
+ actions,
1474
+ busy,
1475
+ className,
1476
+ children: /* @__PURE__ */ jsx(PresentationEditor, { ...editorProps, presentation })
1477
+ }
1478
+ );
1479
+ }
1480
+ function PresentationProjectionArtifactSurface({
1481
+ projection,
1482
+ title: titleProp,
1483
+ showHeader,
1484
+ subtitle,
1485
+ actions,
1486
+ busy,
1487
+ className,
1488
+ ...editorProps
1489
+ }) {
1490
+ const t = useOpenGeniText();
1491
+ const title = titleProp === void 0 ? t("artifacts.presentationEditor.presentation") : titleProp;
1492
+ const count = projection.slides.length;
1493
+ return /* @__PURE__ */ jsx(
1494
+ ArtifactSurface,
1495
+ {
1496
+ modality: "presentation",
1497
+ title,
1498
+ showHeader,
1499
+ subtitle: subtitle ?? t("counts.slides", { count }),
1500
+ actions,
1501
+ busy,
1502
+ className,
1503
+ children: /* @__PURE__ */ jsx(PresentationProjectionEditor, { ...editorProps, projection })
1504
+ }
1505
+ );
1506
+ }
1507
+ function SlideThumbnail({
1508
+ slide,
1509
+ width,
1510
+ height,
1511
+ paintRevision
1512
+ }) {
1513
+ const t = useOpenGeniText();
1514
+ const canvasRef = useRef(null);
1515
+ const imageCacheRef = useRef(/* @__PURE__ */ new Map());
1516
+ const [paintEpoch, setPaintEpoch] = useState(0);
1517
+ useLayoutEffect(() => {
1518
+ const imageCache = imageCacheRef.current;
1519
+ return () => disposeCanvasImageCache(imageCache);
1520
+ }, []);
1521
+ useLayoutEffect(() => {
1522
+ const canvas = canvasRef.current;
1523
+ const context = canvas?.getContext("2d");
1524
+ if (!canvas || !context) return;
1525
+ const displayWidth = 112;
1526
+ const scale = displayWidth / width;
1527
+ canvas.width = Math.max(1, Math.round(width * scale));
1528
+ canvas.height = Math.max(1, Math.round(height * scale));
1529
+ context.setTransform(scale, 0, 0, scale, 0, 0);
1530
+ context.fillStyle = resolveColor(slide.background.fill);
1531
+ context.fillRect(0, 0, width, height);
1532
+ const objects = listSlideObjects(slide);
1533
+ const usedImageSources = /* @__PURE__ */ new Set();
1534
+ for (const entry of objects) {
1535
+ drawObject(
1536
+ t,
1537
+ context,
1538
+ entry,
1539
+ entry.object.position,
1540
+ imageCacheRef.current,
1541
+ () => setPaintEpoch((value) => value + 1),
1542
+ { left: 0, top: 0, width, height },
1543
+ scale,
1544
+ usedImageSources
1545
+ );
1546
+ }
1547
+ disposeUnusedCanvasImages(imageCacheRef.current, usedImageSources);
1548
+ }, [height, paintEpoch, paintRevision, slide, width, t]);
1549
+ return /* @__PURE__ */ jsx("canvas", { ref: canvasRef, "aria-hidden": true, className: "block size-full" });
1550
+ }
1551
+ function presentationViewFromProjection(projection) {
1552
+ if (projection.slides.length > MAX_PROJECTION_SLIDES) {
1553
+ throw new Error(`Presentation projection exceeds ${MAX_PROJECTION_SLIDES} slides`);
1554
+ }
1555
+ const slideById = /* @__PURE__ */ new Map();
1556
+ const elementById = /* @__PURE__ */ new Map();
1557
+ const slideSize = {
1558
+ width: Math.min(MAX_EDITOR_GEOMETRY, Math.max(1, finite(projection.slideSize.width, 1))),
1559
+ height: Math.min(MAX_EDITOR_GEOMETRY, Math.max(1, finite(projection.slideSize.height, 1)))
1560
+ };
1561
+ const slides = projection.slides.map((slideProjection) => {
1562
+ if (slideProjection.elements.length > MAX_PROJECTION_ELEMENTS_PER_SLIDE) {
1563
+ throw new Error(
1564
+ `Slide ${slideProjection.id} exceeds ${MAX_PROJECTION_ELEMENTS_PER_SLIDE} projected objects`
1565
+ );
1566
+ }
1567
+ slideById.set(slideProjection.id, slideProjection);
1568
+ const elements = slideProjection.elements.map(
1569
+ (element) => presentationElementView(element, elementById, 0)
1570
+ );
1571
+ return {
1572
+ id: slideProjection.id,
1573
+ title: boundedProjectionText(slideProjection.title ?? ""),
1574
+ background: { fill: cloneProjectionFill(slideProjection.background ?? "white") },
1575
+ elements
1576
+ };
1577
+ });
1578
+ return {
1579
+ presentation: {
1580
+ slideSize,
1581
+ slides: { items: slides }
1582
+ },
1583
+ slideById,
1584
+ elementById
1585
+ };
1586
+ }
1587
+ function presentationElementView(element, byId, depth) {
1588
+ if (depth > MAX_PROJECTION_GROUP_DEPTH) {
1589
+ throw new Error(`Presentation group depth exceeds ${MAX_PROJECTION_GROUP_DEPTH}`);
1590
+ }
1591
+ byId.set(element.id, element);
1592
+ const position = normalizeEditorPosition(element.position);
1593
+ switch (element.kind) {
1594
+ case "shape": {
1595
+ const text = mutableProjectionText(element.text, element.textStyle);
1596
+ return {
1597
+ id: element.id,
1598
+ name: boundedProjectionText(element.name),
1599
+ __projectionReadOnly: element.readOnly ?? false,
1600
+ geometry: element.geometry,
1601
+ position,
1602
+ fill: cloneProjectionFill(
1603
+ element.fill ?? (element.geometry === "textbox" ? "none" : "white")
1604
+ ),
1605
+ line: cloneProjectionLine(element.line),
1606
+ rotation: finite(element.rotation ?? 0, 0),
1607
+ borderRadius: element.borderRadius,
1608
+ text
1609
+ };
1610
+ }
1611
+ case "chart":
1612
+ return {
1613
+ id: element.id,
1614
+ name: boundedProjectionText(element.name),
1615
+ __projectionReadOnly: element.readOnly ?? false,
1616
+ type: element.type,
1617
+ position,
1618
+ title: boundedProjectionText(element.title ?? ""),
1619
+ series: {
1620
+ items: element.series.map((series) => ({
1621
+ name: boundedProjectionText(series.name),
1622
+ categories: (series.categories ?? []).map(boundedProjectionText),
1623
+ values: series.values.map((value) => finite(value, 0)),
1624
+ xValues: (series.xValues ?? []).map((value) => finite(value, 0)),
1625
+ bubbleSizes: (series.bubbleSizes ?? []).map((value) => finite(value, 0)),
1626
+ fill: series.fill ? cloneProjectionFill(series.fill) : void 0,
1627
+ line: cloneProjectionLine(series.line)
1628
+ }))
1629
+ },
1630
+ xAxis: element.xAxis ? { ...element.xAxis } : void 0,
1631
+ yAxis: element.yAxis ? { ...element.yAxis } : void 0,
1632
+ dataLabels: element.dataLabels ? { ...element.dataLabels } : void 0
1633
+ };
1634
+ case "image": {
1635
+ const source = safeProjectionImageSource(element.source);
1636
+ return {
1637
+ id: element.id,
1638
+ name: boundedProjectionText(element.name),
1639
+ __projectionReadOnly: element.readOnly ?? false,
1640
+ position,
1641
+ alt: boundedProjectionText(element.alt ?? ""),
1642
+ prompt: element.prompt ? boundedProjectionText(element.prompt) : void 0,
1643
+ fit: element.fit ?? "contain",
1644
+ crop: element.crop ? { ...element.crop } : void 0,
1645
+ geometry: element.geometry ?? "rect",
1646
+ borderRadius: element.borderRadius,
1647
+ rotation: finite(element.rotation ?? 0, 0),
1648
+ flipHorizontal: element.flipHorizontal ?? false,
1649
+ flipVertical: element.flipVertical ?? false,
1650
+ sourceForSvg: () => source
1651
+ };
1652
+ }
1653
+ case "table": {
1654
+ const columns = element.rows[0]?.length ?? 0;
1655
+ if (columns <= 0 || element.rows.some((row) => row.length !== columns) || element.rows.length * columns > MAX_PROJECTION_TABLE_CELLS) {
1656
+ throw new Error(`Table ${element.id} has an invalid or oversized projected grid`);
1657
+ }
1658
+ return {
1659
+ id: element.id,
1660
+ name: boundedProjectionText(element.name),
1661
+ __projectionReadOnly: element.readOnly ?? false,
1662
+ position,
1663
+ rows: element.rows.map(
1664
+ (row) => row.map(
1665
+ (cell) => cell ? {
1666
+ text: mutableProjectionText(cell.text, cell.textStyle),
1667
+ fill: cloneProjectionFill(cell.fill ?? "white"),
1668
+ rowSpan: boundedSpan(cell.rowSpan),
1669
+ colSpan: boundedSpan(cell.colSpan)
1670
+ } : null
1671
+ )
1672
+ ),
1673
+ columnWidths: [...element.columnWidths ?? []],
1674
+ rowHeights: [...element.rowHeights ?? []],
1675
+ fill: cloneProjectionFill(element.fill ?? "white"),
1676
+ line: cloneProjectionLine(element.line),
1677
+ textStyle: { ...element.textStyle ?? {} }
1678
+ };
1679
+ }
1680
+ case "group":
1681
+ return {
1682
+ id: element.id,
1683
+ name: boundedProjectionText(element.name),
1684
+ __projectionReadOnly: element.readOnly ?? false,
1685
+ position,
1686
+ childOffset: {
1687
+ left: finite(element.childOffset.left, 0),
1688
+ top: finite(element.childOffset.top, 0)
1689
+ },
1690
+ childExtent: {
1691
+ width: Math.max(1, finite(element.childExtent.width, 1)),
1692
+ height: Math.max(1, finite(element.childExtent.height, 1))
1693
+ },
1694
+ rotation: finite(element.rotation ?? 0, 0),
1695
+ flipHorizontal: element.flipHorizontal ?? false,
1696
+ flipVertical: element.flipVertical ?? false,
1697
+ children: element.children.map((child) => presentationElementView(child, byId, depth + 1))
1698
+ };
1699
+ case "connector":
1700
+ return {
1701
+ id: element.id,
1702
+ name: boundedProjectionText(element.name),
1703
+ __projectionReadOnly: element.readOnly ?? false,
1704
+ geometry: "line",
1705
+ position,
1706
+ fill: "none",
1707
+ line: cloneProjectionLine(element.line),
1708
+ rotation: 0,
1709
+ text: mutableProjectionText("", void 0)
1710
+ };
1711
+ }
1712
+ }
1713
+ function mutableProjectionText(initial, style) {
1714
+ let value = boundedProjectionText(initial);
1715
+ return {
1716
+ style: { ...style ?? {} },
1717
+ set(next) {
1718
+ value = boundedProjectionText(next);
1719
+ },
1720
+ toString() {
1721
+ return value;
1722
+ }
1723
+ };
1724
+ }
1725
+ function cloneProjectionFill(fill) {
1726
+ return typeof fill === "string" ? fill : { ...fill };
1727
+ }
1728
+ function cloneProjectionLine(line) {
1729
+ return {
1730
+ style: line?.style ?? "solid",
1731
+ fill: line?.fill ? cloneProjectionFill(line.fill) : "slate-900",
1732
+ width: Math.max(0, finite(line?.width ?? 1, 1))
1733
+ };
1734
+ }
1735
+ function boundedProjectionText(value) {
1736
+ return value.slice(0, MAX_PROJECTION_TEXT);
1737
+ }
1738
+ function boundedSpan(value) {
1739
+ return Math.max(1, Math.min(1e4, Math.floor(finite(value ?? 1, 1))));
1740
+ }
1741
+ function safeProjectionImageSource(source) {
1742
+ if (!source || source.length > 64 * 1024 * 1024) return void 0;
1743
+ if (/^data:image\/(?:png|jpeg|gif|webp);base64,/i.test(source) || source.startsWith("blob:")) {
1744
+ return source;
1745
+ }
1746
+ try {
1747
+ const base = globalThis.location?.href;
1748
+ if (!base) return void 0;
1749
+ const url = new URL(source, base);
1750
+ return url.origin === globalThis.location.origin && /^https?:$/.test(url.protocol) ? url.href : void 0;
1751
+ } catch {
1752
+ return void 0;
1753
+ }
1754
+ }
1755
+ function asPresentationError(cause) {
1756
+ return cause instanceof Error ? cause : new Error("Presentation change failed");
1757
+ }
1758
+ function listSlideObjects(slide) {
1759
+ return slide.elements.map(displayObjectFromElement);
1760
+ }
1761
+ function displayObjectFromElement(object) {
1762
+ const readOnly = object.__projectionReadOnly === true;
1763
+ if ("geometry" in object && "text" in object)
1764
+ return { id: object.id, kind: "shape", object, readOnly };
1765
+ if ("series" in object) return { id: object.id, kind: "chart", object, readOnly };
1766
+ if ("sourceForSvg" in object) return { id: object.id, kind: "image", object, readOnly };
1767
+ if ("rows" in object) return { id: object.id, kind: "table", object, readOnly };
1768
+ return { id: object.id, kind: "group", object, readOnly };
1769
+ }
1770
+ function buildSpatialIndex(objects, slideSize) {
1771
+ const buckets = /* @__PURE__ */ new Map();
1772
+ const overflowObjects = [];
1773
+ const bounds = objects.map(objectBounds);
1774
+ const maxX = Math.max(0, Math.ceil(slideSize.width / SPATIAL_TILE) - 1);
1775
+ const maxY = Math.max(0, Math.ceil(slideSize.height / SPATIAL_TILE) - 1);
1776
+ for (const [index, entry] of objects.entries()) {
1777
+ const objectBound = bounds[index] ?? entry.object.position;
1778
+ if (!intersects(objectBound, { left: 0, top: 0, ...slideSize })) continue;
1779
+ const left = Math.max(0, Math.floor(objectBound.left / SPATIAL_TILE));
1780
+ const top = Math.max(0, Math.floor(objectBound.top / SPATIAL_TILE));
1781
+ const right = Math.min(maxX, Math.floor((objectBound.left + objectBound.width) / SPATIAL_TILE));
1782
+ const bottom = Math.min(
1783
+ maxY,
1784
+ Math.floor((objectBound.top + objectBound.height) / SPATIAL_TILE)
1785
+ );
1786
+ const bucketCount = (right - left + 1) * (bottom - top + 1);
1787
+ if (!Number.isSafeInteger(bucketCount) || bucketCount > MAX_SPATIAL_BUCKETS_PER_OBJECT) {
1788
+ overflowObjects.push(index);
1789
+ continue;
1790
+ }
1791
+ for (let y = top; y <= bottom; y += 1) {
1792
+ for (let x = left; x <= right; x += 1) {
1793
+ const key = `${x}:${y}`;
1794
+ const bucket = buckets.get(key);
1795
+ if (bucket) bucket.push(index);
1796
+ else buckets.set(key, [index]);
1797
+ }
1798
+ }
1799
+ }
1800
+ return { objects, bounds, buckets, overflowObjects };
1801
+ }
1802
+ function querySpatialIndex(index, viewport) {
1803
+ const seen = new Set(index.overflowObjects);
1804
+ const left = Math.floor(viewport.left / SPATIAL_TILE);
1805
+ const top = Math.floor(viewport.top / SPATIAL_TILE);
1806
+ const right = Math.floor((viewport.left + viewport.width) / SPATIAL_TILE);
1807
+ const bottom = Math.floor((viewport.top + viewport.height) / SPATIAL_TILE);
1808
+ for (let y = top; y <= bottom; y += 1) {
1809
+ for (let x = left; x <= right; x += 1) {
1810
+ for (const objectIndex of index.buckets.get(`${x}:${y}`) ?? []) {
1811
+ if (intersects(index.bounds[objectIndex], viewport)) seen.add(objectIndex);
1812
+ }
1813
+ }
1814
+ }
1815
+ return [...seen].filter((objectIndex) => {
1816
+ return !!index.objects[objectIndex] && intersects(index.bounds[objectIndex], viewport);
1817
+ }).sort((a, b) => a - b);
1818
+ }
1819
+ function paintSlideCanvas(t, options) {
1820
+ const { canvas, slide, slideSize, zoom } = options;
1821
+ const context = canvas.getContext("2d");
1822
+ if (!context) return;
1823
+ const cssWidth = slideSize.width * zoom;
1824
+ const cssHeight = slideSize.height * zoom;
1825
+ const ratio = Math.max(
1826
+ 1e-4,
1827
+ Math.min(
1828
+ 2,
1829
+ Math.max(1, globalThis.devicePixelRatio || 1),
1830
+ MAX_CANVAS_EDGE / Math.max(1, cssWidth),
1831
+ MAX_CANVAS_EDGE / Math.max(1, cssHeight),
1832
+ Math.sqrt(MAX_CANVAS_PIXELS / Math.max(1, cssWidth * cssHeight))
1833
+ )
1834
+ );
1835
+ const pixelWidth = Math.max(1, Math.round(slideSize.width * zoom * ratio));
1836
+ const pixelHeight = Math.max(1, Math.round(slideSize.height * zoom * ratio));
1837
+ if (canvas.width !== pixelWidth) canvas.width = pixelWidth;
1838
+ if (canvas.height !== pixelHeight) canvas.height = pixelHeight;
1839
+ context.setTransform(zoom * ratio, 0, 0, zoom * ratio, 0, 0);
1840
+ context.clearRect(0, 0, slideSize.width, slideSize.height);
1841
+ context.fillStyle = resolveColor(slide.background.fill);
1842
+ context.fillRect(0, 0, slideSize.width, slideSize.height);
1843
+ const usedImageSources = /* @__PURE__ */ new Set();
1844
+ for (const index of options.objectIndexes) {
1845
+ const entry = options.objects[index];
1846
+ if (!entry) continue;
1847
+ const position = entry.id === options.draftPosition?.objectId ? options.draftPosition.position : entry.object.position;
1848
+ drawObject(
1849
+ t,
1850
+ context,
1851
+ entry,
1852
+ position,
1853
+ options.imageCache,
1854
+ options.requestRepaint,
1855
+ options.renderRegion,
1856
+ zoom * ratio,
1857
+ usedImageSources
1858
+ );
1859
+ }
1860
+ disposeUnusedCanvasImages(options.imageCache, usedImageSources);
1861
+ }
1862
+ function drawObject(t, context, entry, position, imageCache, requestRepaint, renderRegion, pixelScale, usedImageSources) {
1863
+ switch (entry.kind) {
1864
+ case "shape":
1865
+ drawShape(t, context, entry.object, position);
1866
+ return;
1867
+ case "chart":
1868
+ drawChart(t, context, entry.object, position);
1869
+ return;
1870
+ case "image": {
1871
+ const source = drawImage(
1872
+ t,
1873
+ context,
1874
+ entry.object,
1875
+ position,
1876
+ imageCache,
1877
+ requestRepaint
1878
+ );
1879
+ if (source) usedImageSources.add(source);
1880
+ return;
1881
+ }
1882
+ case "table":
1883
+ drawTable(t, context, entry.object, position, renderRegion, pixelScale);
1884
+ return;
1885
+ case "group":
1886
+ drawGroup(
1887
+ t,
1888
+ context,
1889
+ entry.object,
1890
+ position,
1891
+ imageCache,
1892
+ requestRepaint,
1893
+ renderRegion,
1894
+ pixelScale,
1895
+ usedImageSources
1896
+ );
1897
+ }
1898
+ }
1899
+ function drawTable(t, context, table, position, renderRegion, pixelScale) {
1900
+ const rowCount = table.rows.length;
1901
+ const columnCount = table.rows[0]?.length ?? 0;
1902
+ if (rowCount === 0 || columnCount === 0 || !intersects(position, renderRegion)) return;
1903
+ const columnWidths = normalizeTableTracks(table.columnWidths, columnCount, position.width);
1904
+ const rowHeights = normalizeTableTracks(table.rowHeights, rowCount, position.height);
1905
+ const columnOffsets = cumulativeOffsets(columnWidths, position.left);
1906
+ const rowOffsets = cumulativeOffsets(rowHeights, position.top);
1907
+ const columnStart = visibleTrackStart(columnOffsets, renderRegion.left);
1908
+ const columnEnd = visibleTrackEnd(columnOffsets, renderRegion.left + renderRegion.width);
1909
+ const rowStart = visibleTrackStart(rowOffsets, renderRegion.top);
1910
+ const rowEnd = visibleTrackEnd(rowOffsets, renderRegion.top + renderRegion.height);
1911
+ const visibleCellCount = (rowEnd - rowStart) * (columnEnd - columnStart);
1912
+ if (visibleCellCount > MAX_TABLE_CELLS_PER_PAINT) {
1913
+ drawTableOverview(context, table, position, columnOffsets, rowOffsets, {
1914
+ columnStart,
1915
+ columnEnd,
1916
+ rowStart,
1917
+ rowEnd
1918
+ });
1919
+ return;
1920
+ }
1921
+ context.save();
1922
+ for (let rowIndex = rowStart; rowIndex < rowEnd; rowIndex += 1) {
1923
+ const row = table.rows[rowIndex];
1924
+ if (!row) continue;
1925
+ for (let columnIndex = columnStart; columnIndex < columnEnd; columnIndex += 1) {
1926
+ const cell = row[columnIndex];
1927
+ if (!cell) continue;
1928
+ const rightIndex = Math.min(columnCount, columnIndex + cell.colSpan);
1929
+ const bottomIndex = Math.min(rowCount, rowIndex + cell.rowSpan);
1930
+ const left = columnOffsets[columnIndex] ?? position.left;
1931
+ const top = rowOffsets[rowIndex] ?? position.top;
1932
+ const right = columnOffsets[rightIndex] ?? position.left + position.width;
1933
+ const bottom = rowOffsets[bottomIndex] ?? position.top + position.height;
1934
+ const width = Math.max(1, right - left);
1935
+ const height = Math.max(1, bottom - top);
1936
+ context.beginPath();
1937
+ context.rect(left, top, width, height);
1938
+ applyFillAndLine(context, cell.fill, table.line, false);
1939
+ if (width * pixelScale >= 8 && height * pixelScale >= 8) {
1940
+ drawText(t, context, cell.text.toString(), cell.text.style, {
1941
+ left: left + 4,
1942
+ top: top + 2,
1943
+ width: Math.max(1, width - 8),
1944
+ height: Math.max(1, height - 4)
1945
+ });
1946
+ }
1947
+ }
1948
+ }
1949
+ context.restore();
1950
+ }
1951
+ function visibleTrackStart(offsets, value) {
1952
+ return Math.max(0, Math.min(offsets.length - 2, lowerBound(offsets, value) - 1));
1953
+ }
1954
+ function visibleTrackEnd(offsets, value) {
1955
+ return Math.max(0, Math.min(offsets.length - 1, lowerBound(offsets, value) + 1));
1956
+ }
1957
+ function lowerBound(values, target) {
1958
+ let low = 0;
1959
+ let high = values.length;
1960
+ while (low < high) {
1961
+ const middle = low + Math.floor((high - low) / 2);
1962
+ if ((values[middle] ?? Number.POSITIVE_INFINITY) < target) low = middle + 1;
1963
+ else high = middle;
1964
+ }
1965
+ return low;
1966
+ }
1967
+ function drawTableOverview(context, table, position, columnOffsets, rowOffsets, visible) {
1968
+ context.save();
1969
+ context.beginPath();
1970
+ context.rect(position.left, position.top, position.width, position.height);
1971
+ applyFillAndLine(context, table.fill, table.line, false);
1972
+ const columnStep = Math.max(1, Math.ceil((visible.columnEnd - visible.columnStart) / 96));
1973
+ const rowStep = Math.max(1, Math.ceil((visible.rowEnd - visible.rowStart) / 96));
1974
+ context.beginPath();
1975
+ for (let index = visible.columnStart; index <= visible.columnEnd; index += columnStep) {
1976
+ const x = columnOffsets[index];
1977
+ if (x === void 0) continue;
1978
+ context.moveTo(x, position.top);
1979
+ context.lineTo(x, position.top + position.height);
1980
+ }
1981
+ for (let index = visible.rowStart; index <= visible.rowEnd; index += rowStep) {
1982
+ const y = rowOffsets[index];
1983
+ if (y === void 0) continue;
1984
+ context.moveTo(position.left, y);
1985
+ context.lineTo(position.left + position.width, y);
1986
+ }
1987
+ applyFillAndLine(context, "none", table.line, true);
1988
+ context.restore();
1989
+ }
1990
+ function normalizeTableTracks(values, count, total) {
1991
+ if (values.length !== count) return Array.from({ length: count }, () => total / count);
1992
+ const sum = values.reduce((value, next) => value + next, 0);
1993
+ if (!Number.isFinite(sum) || sum <= 0) {
1994
+ return Array.from({ length: count }, () => total / count);
1995
+ }
1996
+ return values.map((value) => value / sum * total);
1997
+ }
1998
+ function cumulativeOffsets(tracks, start) {
1999
+ const offsets = [start];
2000
+ for (const track of tracks) offsets.push((offsets.at(-1) ?? start) + track);
2001
+ return offsets;
2002
+ }
2003
+ function drawGroup(t, context, group, position, imageCache, requestRepaint, renderRegion, pixelScale, usedImageSources) {
2004
+ const scaleX = position.width / group.childExtent.width;
2005
+ const scaleY = position.height / group.childExtent.height;
2006
+ const translatedX = position.left - group.childOffset.left * scaleX;
2007
+ const translatedY = position.top - group.childOffset.top * scaleY;
2008
+ const centerX = position.left + position.width / 2;
2009
+ const centerY = position.top + position.height / 2;
2010
+ context.save();
2011
+ context.translate(centerX, centerY);
2012
+ context.rotate(group.rotation * Math.PI / 180);
2013
+ context.scale(group.flipHorizontal ? -1 : 1, group.flipVertical ? -1 : 1);
2014
+ context.translate(-centerX, -centerY);
2015
+ context.translate(translatedX, translatedY);
2016
+ context.scale(scaleX, scaleY);
2017
+ const childRenderRegion = inverseGroupRegion(group, position, renderRegion);
2018
+ for (const child of group.children) {
2019
+ const entry = displayObjectFromElement(child);
2020
+ if (!intersects(objectBounds(entry), childRenderRegion)) continue;
2021
+ drawObject(
2022
+ t,
2023
+ context,
2024
+ entry,
2025
+ child.position,
2026
+ imageCache,
2027
+ requestRepaint,
2028
+ childRenderRegion,
2029
+ pixelScale * Math.min(Math.abs(scaleX), Math.abs(scaleY)),
2030
+ usedImageSources
2031
+ );
2032
+ }
2033
+ context.restore();
2034
+ }
2035
+ function inverseGroupRegion(group, position, region) {
2036
+ const scaleX = position.width / group.childExtent.width;
2037
+ const scaleY = position.height / group.childExtent.height;
2038
+ const translatedX = position.left - group.childOffset.left * scaleX;
2039
+ const translatedY = position.top - group.childOffset.top * scaleY;
2040
+ const centerX = position.left + position.width / 2;
2041
+ const centerY = position.top + position.height / 2;
2042
+ const radians = -group.rotation * Math.PI / 180;
2043
+ const cos = Math.cos(radians);
2044
+ const sin = Math.sin(radians);
2045
+ const points = [
2046
+ [region.left, region.top],
2047
+ [region.left + region.width, region.top],
2048
+ [region.left, region.top + region.height],
2049
+ [region.left + region.width, region.top + region.height]
2050
+ ].map(([x = 0, y = 0]) => {
2051
+ const dx = x - centerX;
2052
+ const dy = y - centerY;
2053
+ const rotatedX = dx * cos - dy * sin;
2054
+ const rotatedY = dx * sin + dy * cos;
2055
+ const unflippedX = rotatedX * (group.flipHorizontal ? -1 : 1) + centerX;
2056
+ const unflippedY = rotatedY * (group.flipVertical ? -1 : 1) + centerY;
2057
+ return {
2058
+ x: (unflippedX - translatedX) / scaleX,
2059
+ y: (unflippedY - translatedY) / scaleY
2060
+ };
2061
+ });
2062
+ const xs = points.map((point) => point.x);
2063
+ const ys = points.map((point) => point.y);
2064
+ const left = Math.min(...xs);
2065
+ const right = Math.max(...xs);
2066
+ const top = Math.min(...ys);
2067
+ const bottom = Math.max(...ys);
2068
+ return { left, top, width: right - left, height: bottom - top };
2069
+ }
2070
+ function drawShape(t, context, shape, position) {
2071
+ context.save();
2072
+ context.translate(position.left + position.width / 2, position.top + position.height / 2);
2073
+ context.rotate(shape.rotation * Math.PI / 180);
2074
+ const x = -position.width / 2;
2075
+ const y = -position.height / 2;
2076
+ context.beginPath();
2077
+ switch (shape.geometry) {
2078
+ case "ellipse":
2079
+ context.ellipse(0, 0, position.width / 2, position.height / 2, 0, 0, Math.PI * 2);
2080
+ break;
2081
+ case "triangle":
2082
+ context.moveTo(0, y);
2083
+ context.lineTo(x + position.width, y + position.height);
2084
+ context.lineTo(x, y + position.height);
2085
+ context.closePath();
2086
+ break;
2087
+ case "rightArrow": {
2088
+ const body = position.width * 0.65;
2089
+ context.moveTo(x, y + position.height * 0.25);
2090
+ context.lineTo(x + body, y + position.height * 0.25);
2091
+ context.lineTo(x + body, y);
2092
+ context.lineTo(x + position.width, 0);
2093
+ context.lineTo(x + body, y + position.height);
2094
+ context.lineTo(x + body, y + position.height * 0.75);
2095
+ context.lineTo(x, y + position.height * 0.75);
2096
+ context.closePath();
2097
+ break;
2098
+ }
2099
+ case "line":
2100
+ context.moveTo(x, y);
2101
+ context.lineTo(x + position.width, y + position.height);
2102
+ break;
2103
+ case "roundRect":
2104
+ roundedRect(
2105
+ context,
2106
+ x,
2107
+ y,
2108
+ position.width,
2109
+ position.height,
2110
+ resolveRadius(shape.borderRadius, position)
2111
+ );
2112
+ break;
2113
+ default:
2114
+ context.rect(x, y, position.width, position.height);
2115
+ }
2116
+ applyFillAndLine(context, shape.fill, shape.line, shape.geometry === "line");
2117
+ const text = shape.text.toString();
2118
+ if (text)
2119
+ drawText(t, context, text, shape.text.style, {
2120
+ left: x,
2121
+ top: y,
2122
+ width: position.width,
2123
+ height: position.height
2124
+ });
2125
+ context.restore();
2126
+ }
2127
+ function drawChart(t, context, chart, position) {
2128
+ context.save();
2129
+ context.fillStyle = "#ffffff";
2130
+ context.strokeStyle = "#e2e8f0";
2131
+ context.lineWidth = 1;
2132
+ context.fillRect(position.left, position.top, position.width, position.height);
2133
+ context.strokeRect(position.left, position.top, position.width, position.height);
2134
+ if (chart.title) {
2135
+ drawText(
2136
+ t,
2137
+ context,
2138
+ chart.title,
2139
+ { fontSize: 18, bold: true, alignment: "center" },
2140
+ {
2141
+ left: position.left + 16,
2142
+ top: position.top + 8,
2143
+ width: Math.max(1, position.width - 32),
2144
+ height: 28
2145
+ }
2146
+ );
2147
+ }
2148
+ const plot = {
2149
+ left: position.left + 36,
2150
+ top: position.top + (chart.title ? 46 : 20),
2151
+ width: Math.max(1, position.width - 56),
2152
+ height: Math.max(1, position.height - (chart.title ? 72 : 48))
2153
+ };
2154
+ const values = chart.series.items.flatMap((series) => series.values).filter(Number.isFinite);
2155
+ const minValue = Math.min(0, chart.yAxis?.min ?? Math.min(...values, 0));
2156
+ const maxValue = Math.max(1, chart.yAxis?.max ?? Math.max(...values, 1));
2157
+ const valueRange = Math.max(Number.EPSILON, maxValue - minValue);
2158
+ const yForValue = (value) => plot.top + plot.height - (value - minValue) / valueRange * plot.height;
2159
+ const palette = ["#2563eb", "#0f766e", "#f59e0b", "#dc2626", "#7c3aed"];
2160
+ if (chart.type === "pie" || chart.type === "doughnut") {
2161
+ const series = chart.series.items[0];
2162
+ const slices = series?.values.map((value) => Math.max(0, value)) ?? [];
2163
+ const total = slices.reduce((sum, value) => sum + value, 0);
2164
+ let angle = -Math.PI / 2;
2165
+ const radius = Math.min(plot.width, plot.height) * 0.42;
2166
+ const cx = plot.left + plot.width / 2;
2167
+ const cy = plot.top + plot.height / 2;
2168
+ slices.forEach((value, index) => {
2169
+ const next = angle + (total > 0 ? value / total * Math.PI * 2 : 0);
2170
+ context.beginPath();
2171
+ context.moveTo(cx, cy);
2172
+ context.arc(cx, cy, radius, angle, next);
2173
+ context.closePath();
2174
+ context.fillStyle = palette[index % palette.length] ?? "#2563eb";
2175
+ context.fill();
2176
+ angle = next;
2177
+ });
2178
+ if (chart.type === "doughnut") {
2179
+ context.beginPath();
2180
+ context.arc(cx, cy, radius * 0.55, 0, Math.PI * 2);
2181
+ context.fillStyle = "#ffffff";
2182
+ context.fill();
2183
+ }
2184
+ } else if (chart.type === "line" || chart.type === "area") {
2185
+ drawChartAxes(context, chart, plot, yForValue(0));
2186
+ chart.series.items.forEach((series, seriesIndex) => {
2187
+ if (series.values.length === 0) return;
2188
+ const points = series.values.map((value, index) => ({
2189
+ x: plot.left + index / Math.max(1, series.values.length - 1) * plot.width,
2190
+ y: yForValue(value)
2191
+ }));
2192
+ const color = resolveColor(
2193
+ series.line?.fill ?? series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2194
+ );
2195
+ if (chart.type === "area") {
2196
+ context.beginPath();
2197
+ context.moveTo(points[0]?.x ?? plot.left, yForValue(0));
2198
+ for (const point of points) context.lineTo(point.x, point.y);
2199
+ context.lineTo(points.at(-1)?.x ?? plot.left + plot.width, yForValue(0));
2200
+ context.closePath();
2201
+ context.globalAlpha = 0.22;
2202
+ context.fillStyle = color;
2203
+ context.fill();
2204
+ context.globalAlpha = 1;
2205
+ }
2206
+ context.beginPath();
2207
+ points.forEach((point, index) => {
2208
+ if (index === 0) context.moveTo(point.x, point.y);
2209
+ else context.lineTo(point.x, point.y);
2210
+ });
2211
+ context.strokeStyle = color;
2212
+ context.lineWidth = series.line?.width ?? 3;
2213
+ context.stroke();
2214
+ for (const point of points) {
2215
+ context.beginPath();
2216
+ context.arc(point.x, point.y, 3, 0, Math.PI * 2);
2217
+ context.fillStyle = color;
2218
+ context.fill();
2219
+ }
2220
+ });
2221
+ } else if (chart.type === "scatter" || chart.type === "bubble") {
2222
+ drawChartAxes(context, chart, plot, yForValue(0));
2223
+ const xValues = chart.series.items.flatMap(
2224
+ (series) => series.values.map((_value, index) => series.xValues[index] ?? index)
2225
+ );
2226
+ const minX = chart.xAxis?.min ?? Math.min(...xValues, 0);
2227
+ const maxX = chart.xAxis?.max ?? Math.max(...xValues, 1);
2228
+ const xRange = Math.max(Number.EPSILON, maxX - minX);
2229
+ chart.series.items.forEach((series, seriesIndex) => {
2230
+ context.fillStyle = resolveColor(
2231
+ series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2232
+ );
2233
+ series.values.forEach((value, index) => {
2234
+ const xValue = series.xValues[index] ?? index;
2235
+ const x = plot.left + (xValue - minX) / xRange * plot.width;
2236
+ const radius = chart.type === "bubble" ? Math.max(3, Math.sqrt(Math.max(0, series.bubbleSizes[index] ?? 9))) : 4;
2237
+ context.beginPath();
2238
+ context.arc(x, yForValue(value), radius, 0, Math.PI * 2);
2239
+ context.fill();
2240
+ });
2241
+ });
2242
+ } else if (chart.type === "radar") {
2243
+ drawRadarChart(context, chart, plot, palette);
2244
+ } else {
2245
+ drawChartAxes(context, chart, plot, yForValue(0));
2246
+ const count = Math.max(1, ...chart.series.items.map((series) => series.values.length));
2247
+ const groupWidth = plot.width / count;
2248
+ const barWidth = groupWidth * 0.72 / Math.max(1, chart.series.items.length);
2249
+ const baseline = yForValue(0);
2250
+ chart.series.items.forEach((series, seriesIndex) => {
2251
+ series.values.forEach((value, valueIndex) => {
2252
+ const valueY = yForValue(value);
2253
+ const height = Math.abs(baseline - valueY);
2254
+ context.fillStyle = resolveColor(
2255
+ series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2256
+ );
2257
+ const left = plot.left + valueIndex * groupWidth + groupWidth * 0.14 + seriesIndex * barWidth;
2258
+ context.fillRect(left, Math.min(baseline, valueY), Math.max(1, barWidth), height);
2259
+ if (chart.dataLabels?.showValue) {
2260
+ drawText(
2261
+ t,
2262
+ context,
2263
+ String(value),
2264
+ { fontSize: 11, alignment: "center" },
2265
+ {
2266
+ left,
2267
+ top: Math.max(plot.top, Math.min(baseline, valueY) - 14),
2268
+ width: Math.max(1, barWidth),
2269
+ height: 14
2270
+ }
2271
+ );
2272
+ }
2273
+ });
2274
+ });
2275
+ }
2276
+ context.restore();
2277
+ }
2278
+ function drawChartAxes(context, chart, plot, baseline) {
2279
+ context.save();
2280
+ context.strokeStyle = "#94a3b8";
2281
+ context.lineWidth = 1;
2282
+ if (chart.xAxis?.visible !== false) {
2283
+ context.beginPath();
2284
+ context.moveTo(plot.left, Math.max(plot.top, Math.min(plot.top + plot.height, baseline)));
2285
+ context.lineTo(
2286
+ plot.left + plot.width,
2287
+ Math.max(plot.top, Math.min(plot.top + plot.height, baseline))
2288
+ );
2289
+ context.stroke();
2290
+ }
2291
+ if (chart.yAxis?.visible !== false) {
2292
+ context.beginPath();
2293
+ context.moveTo(plot.left, plot.top);
2294
+ context.lineTo(plot.left, plot.top + plot.height);
2295
+ context.stroke();
2296
+ }
2297
+ context.restore();
2298
+ }
2299
+ function drawRadarChart(context, chart, plot, palette) {
2300
+ const count = Math.max(3, ...chart.series.items.map((series) => series.values.length));
2301
+ const maximum = Math.max(
2302
+ 1,
2303
+ ...chart.series.items.flatMap((series) => series.values.map((value) => Math.max(0, value)))
2304
+ );
2305
+ const centerX = plot.left + plot.width / 2;
2306
+ const centerY = plot.top + plot.height / 2;
2307
+ const radius = Math.min(plot.width, plot.height) * 0.42;
2308
+ const point = (index, value) => {
2309
+ const angle = -Math.PI / 2 + index / count * Math.PI * 2;
2310
+ const scaled = Math.max(0, value) / maximum * radius;
2311
+ return { x: centerX + Math.cos(angle) * scaled, y: centerY + Math.sin(angle) * scaled };
2312
+ };
2313
+ context.save();
2314
+ context.strokeStyle = "#cbd5e1";
2315
+ for (let ring = 1; ring <= 4; ring += 1) {
2316
+ context.beginPath();
2317
+ for (let index = 0; index < count; index += 1) {
2318
+ const next = point(index, maximum * ring / 4);
2319
+ if (index === 0) context.moveTo(next.x, next.y);
2320
+ else context.lineTo(next.x, next.y);
2321
+ }
2322
+ context.closePath();
2323
+ context.stroke();
2324
+ }
2325
+ chart.series.items.forEach((series, seriesIndex) => {
2326
+ const color = resolveColor(series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb");
2327
+ context.beginPath();
2328
+ for (let index = 0; index < count; index += 1) {
2329
+ const next = point(index, series.values[index] ?? 0);
2330
+ if (index === 0) context.moveTo(next.x, next.y);
2331
+ else context.lineTo(next.x, next.y);
2332
+ }
2333
+ context.closePath();
2334
+ context.globalAlpha = 0.18;
2335
+ context.fillStyle = color;
2336
+ context.fill();
2337
+ context.globalAlpha = 1;
2338
+ context.strokeStyle = color;
2339
+ context.lineWidth = series.line?.width ?? 2;
2340
+ context.stroke();
2341
+ });
2342
+ context.restore();
2343
+ }
2344
+ function drawImage(t, context, image, position, imageCache, requestRepaint) {
2345
+ context.save();
2346
+ applyImageTransform(context, image, position);
2347
+ imageClipPath(context, image, position);
2348
+ context.clip();
2349
+ context.fillStyle = "#f1f5f9";
2350
+ context.fillRect(position.left, position.top, position.width, position.height);
2351
+ const source = imageSourceForCanvas(image);
2352
+ if (source && typeof Image !== "undefined") {
2353
+ let cached = imageCache.get(source);
2354
+ if (!cached) {
2355
+ const element = new Image();
2356
+ cached = { image: element, ready: false };
2357
+ imageCache.set(source, cached);
2358
+ element.onload = () => {
2359
+ const current = imageCache.get(source);
2360
+ if (!current || current.image !== element) return;
2361
+ current.ready = true;
2362
+ requestRepaint();
2363
+ };
2364
+ element.onerror = () => {
2365
+ const current = imageCache.get(source);
2366
+ if (current?.image === element) current.ready = false;
2367
+ };
2368
+ element.src = source;
2369
+ }
2370
+ if (cached.ready && cached.image.naturalWidth > 0 && cached.image.naturalHeight > 0) {
2371
+ drawFittedImage(context, cached.image, image, position);
2372
+ context.restore();
2373
+ return source;
2374
+ }
2375
+ }
2376
+ context.strokeStyle = "#94a3b8";
2377
+ context.lineWidth = 1;
2378
+ context.setLineDash([8, 6]);
2379
+ imageClipPath(context, image, position);
2380
+ context.stroke();
2381
+ context.setLineDash([]);
2382
+ drawText(
2383
+ t,
2384
+ context,
2385
+ image.alt || image.prompt || t("artifacts.presentationEditor.image"),
2386
+ { fontSize: 14, color: "slate-600" },
2387
+ {
2388
+ left: position.left + 12,
2389
+ top: position.top + 12,
2390
+ width: Math.max(1, position.width - 24),
2391
+ height: Math.max(1, position.height - 24)
2392
+ }
2393
+ );
2394
+ context.restore();
2395
+ return source;
2396
+ }
2397
+ function imageSourceForCanvas(image) {
2398
+ try {
2399
+ return image.sourceForSvg();
2400
+ } catch {
2401
+ return void 0;
2402
+ }
2403
+ }
2404
+ function applyImageTransform(context, image, position) {
2405
+ const centerX = position.left + position.width / 2;
2406
+ const centerY = position.top + position.height / 2;
2407
+ context.translate(centerX, centerY);
2408
+ context.rotate(image.rotation * Math.PI / 180);
2409
+ context.scale(image.flipHorizontal ? -1 : 1, image.flipVertical ? -1 : 1);
2410
+ context.translate(-centerX, -centerY);
2411
+ }
2412
+ function imageClipPath(context, image, position) {
2413
+ context.beginPath();
2414
+ if (image.geometry === "ellipse") {
2415
+ context.ellipse(
2416
+ position.left + position.width / 2,
2417
+ position.top + position.height / 2,
2418
+ position.width / 2,
2419
+ position.height / 2,
2420
+ 0,
2421
+ 0,
2422
+ Math.PI * 2
2423
+ );
2424
+ } else if (image.geometry === "roundRect") {
2425
+ roundedRect(
2426
+ context,
2427
+ position.left,
2428
+ position.top,
2429
+ position.width,
2430
+ position.height,
2431
+ resolveRadius(image.borderRadius, position)
2432
+ );
2433
+ } else {
2434
+ context.rect(position.left, position.top, position.width, position.height);
2435
+ }
2436
+ context.closePath();
2437
+ }
2438
+ function drawFittedImage(context, source, image, position) {
2439
+ const crop = image.crop ?? { left: 0, top: 0, right: 0, bottom: 0 };
2440
+ const sourceX = source.naturalWidth * crop.left;
2441
+ const sourceY = source.naturalHeight * crop.top;
2442
+ const sourceWidth = source.naturalWidth * (1 - crop.left - crop.right);
2443
+ const sourceHeight = source.naturalHeight * (1 - crop.top - crop.bottom);
2444
+ if (sourceWidth <= 0 || sourceHeight <= 0) return;
2445
+ const scale = image.fit === "cover" ? Math.max(position.width / sourceWidth, position.height / sourceHeight) : Math.min(position.width / sourceWidth, position.height / sourceHeight);
2446
+ const width = sourceWidth * scale;
2447
+ const height = sourceHeight * scale;
2448
+ const left = position.left + (position.width - width) / 2;
2449
+ const top = position.top + (position.height - height) / 2;
2450
+ context.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, left, top, width, height);
2451
+ }
2452
+ function disposeCanvasImageCache(cache) {
2453
+ for (const entry of cache.values()) disposeCanvasImageEntry(entry);
2454
+ cache.clear();
2455
+ }
2456
+ function disposeUnusedCanvasImages(cache, usedSources) {
2457
+ for (const [source, entry] of cache) {
2458
+ if (usedSources.has(source)) continue;
2459
+ disposeCanvasImageEntry(entry);
2460
+ cache.delete(source);
2461
+ }
2462
+ }
2463
+ function disposeCanvasImageEntry(entry) {
2464
+ entry.image.onload = null;
2465
+ entry.image.onerror = null;
2466
+ entry.image.removeAttribute("src");
2467
+ }
2468
+ function drawText(t, context, text, style, position) {
2469
+ const fontSize = style.fontSize ?? 18;
2470
+ const fontStyle = style.italic ? "italic " : "";
2471
+ const fontWeight = style.bold ? "700 " : "400 ";
2472
+ context.font = `${fontStyle}${fontWeight}${fontSize}px ${style.fontFamily ?? t("artifacts.presentationEditor.arialSansSerif")}`;
2473
+ context.fillStyle = resolveColor(style.color ?? "slate-950");
2474
+ context.textAlign = style.alignment === "center" ? "center" : style.alignment === "right" ? "right" : "left";
2475
+ context.textBaseline = "top";
2476
+ const x = style.alignment === "center" ? position.left + position.width / 2 : style.alignment === "right" ? position.left + position.width : position.left;
2477
+ const lineHeight = fontSize * 1.2;
2478
+ const lines = wrapCanvasText(context, text, position.width);
2479
+ const totalHeight = lines.length * lineHeight;
2480
+ const top = style.verticalAlignment === "middle" ? position.top + (position.height - totalHeight) / 2 : style.verticalAlignment === "bottom" ? position.top + position.height - totalHeight : position.top;
2481
+ context.save();
2482
+ context.beginPath();
2483
+ context.rect(position.left, position.top, position.width, position.height);
2484
+ context.clip();
2485
+ lines.forEach((line, index) => context.fillText(line, x, top + index * lineHeight));
2486
+ context.restore();
2487
+ }
2488
+ function wrapCanvasText(context, text, width) {
2489
+ const result = [];
2490
+ for (const paragraph of text.split("\n")) {
2491
+ const words = paragraph.split(/\s+/).filter(Boolean);
2492
+ if (words.length === 0) {
2493
+ result.push("");
2494
+ continue;
2495
+ }
2496
+ let line = words[0] ?? "";
2497
+ for (let index = 1; index < words.length; index += 1) {
2498
+ const word = words[index] ?? "";
2499
+ const candidate = `${line} ${word}`;
2500
+ if (context.measureText(candidate).width <= width || line.length === 0) line = candidate;
2501
+ else {
2502
+ result.push(line);
2503
+ line = word;
2504
+ }
2505
+ }
2506
+ result.push(line);
2507
+ }
2508
+ return result;
2509
+ }
2510
+ function applyFillAndLine(context, fill, line, lineOnly) {
2511
+ if (!lineOnly && resolveColor(fill) !== "transparent") {
2512
+ context.fillStyle = resolveColor(fill);
2513
+ context.fill();
2514
+ }
2515
+ if (line.style !== "none" && resolveColor(line.fill ?? "slate-900") !== "transparent" && (line.width ?? 1) > 0) {
2516
+ context.strokeStyle = resolveColor(line.fill ?? "slate-900");
2517
+ context.lineWidth = line.width ?? 1;
2518
+ context.setLineDash(line.style === "dash" ? [8, 5] : line.style === "dot" ? [2, 4] : []);
2519
+ context.stroke();
2520
+ context.setLineDash([]);
2521
+ }
2522
+ }
2523
+ function roundedRect(context, x, y, width, height, radius) {
2524
+ const r = Math.min(Math.max(0, radius), width / 2, height / 2);
2525
+ context.moveTo(x + r, y);
2526
+ context.lineTo(x + width - r, y);
2527
+ context.quadraticCurveTo(x + width, y, x + width, y + r);
2528
+ context.lineTo(x + width, y + height - r);
2529
+ context.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
2530
+ context.lineTo(x + r, y + height);
2531
+ context.quadraticCurveTo(x, y + height, x, y + height - r);
2532
+ context.lineTo(x, y + r);
2533
+ context.quadraticCurveTo(x, y, x + r, y);
2534
+ context.closePath();
2535
+ }
2536
+ function hitTest(index, x, y) {
2537
+ const candidates = querySpatialIndex(index, { left: x, top: y, width: 0, height: 0 });
2538
+ for (let candidateIndex = candidates.length - 1; candidateIndex >= 0; candidateIndex -= 1) {
2539
+ const entry = index.objects[candidates[candidateIndex] ?? -1];
2540
+ if (entry && objectContainsPoint(entry, x, y)) return entry;
2541
+ }
2542
+ return null;
2543
+ }
2544
+ function objectContainsPoint(entry, x, y) {
2545
+ const position = entry.object.position;
2546
+ const rotation = objectRotation(entry);
2547
+ if (rotation === 0) {
2548
+ return x >= position.left && x <= position.left + position.width && y >= position.top && y <= position.top + position.height;
2549
+ }
2550
+ const centerX = position.left + position.width / 2;
2551
+ const centerY = position.top + position.height / 2;
2552
+ const radians = -rotation * Math.PI / 180;
2553
+ const dx = x - centerX;
2554
+ const dy = y - centerY;
2555
+ const localX = dx * Math.cos(radians) - dy * Math.sin(radians) + centerX;
2556
+ const localY = dx * Math.sin(radians) + dy * Math.cos(radians) + centerY;
2557
+ return localX >= position.left && localX <= position.left + position.width && localY >= position.top && localY <= position.top + position.height;
2558
+ }
2559
+ function objectBounds(entry) {
2560
+ const position = entry.object.position;
2561
+ const rotation = objectRotation(entry);
2562
+ if (rotation === 0) return position;
2563
+ const radians = rotation * Math.PI / 180;
2564
+ const width = Math.abs(position.width * Math.cos(radians)) + Math.abs(position.height * Math.sin(radians));
2565
+ const height = Math.abs(position.width * Math.sin(radians)) + Math.abs(position.height * Math.cos(radians));
2566
+ return {
2567
+ left: position.left + (position.width - width) / 2,
2568
+ top: position.top + (position.height - height) / 2,
2569
+ width,
2570
+ height
2571
+ };
2572
+ }
2573
+ function objectRotation(entry) {
2574
+ if (entry.kind === "shape") return finite(entry.object.rotation, 0);
2575
+ if (entry.kind === "image") return finite(entry.object.rotation, 0);
2576
+ if (entry.kind === "group") return finite(entry.object.rotation, 0);
2577
+ return 0;
2578
+ }
2579
+ function objectLabel(t, entry) {
2580
+ const object = entry.object;
2581
+ if (entry.kind === "shape") {
2582
+ const shape = object;
2583
+ return shape.text.toString().trim() || shape.name || t("artifacts.presentationEditor.shape");
2584
+ }
2585
+ if (entry.kind === "chart")
2586
+ return object.title || object.name || t("artifacts.presentationEditor.chart");
2587
+ if (entry.kind === "image")
2588
+ return object.alt || object.name || t("artifacts.presentationEditor.image");
2589
+ if (entry.kind === "table") return object.name || t("artifacts.presentationEditor.table");
2590
+ return object.name || t("artifacts.presentationEditor.group");
2591
+ }
2592
+ function accessibleObjectLabel(t, entry) {
2593
+ const position = entry.object.position;
2594
+ return `${objectLabel(t, entry)}. Position ${Math.round(position.left)}, ${Math.round(position.top)}. Size ${Math.round(position.width)} by ${Math.round(position.height)}.`;
2595
+ }
2596
+ function nextTextBoxPosition(objects, slideSize) {
2597
+ const width = slideSize.width * 0.6;
2598
+ const height = Math.max(48, slideSize.height * 0.16);
2599
+ const lefts = [0.2, 0.08, 0.32].map(
2600
+ (ratio) => Math.max(0, Math.min(slideSize.width - width, slideSize.width * ratio))
2601
+ );
2602
+ const tops = [0.2, 0.42, 0.64, 0.06].map(
2603
+ (ratio) => Math.max(0, Math.min(slideSize.height - height, slideSize.height * ratio))
2604
+ );
2605
+ const occupied = objects.map(objectBounds);
2606
+ let best = null;
2607
+ let bestOverlap = Number.POSITIVE_INFINITY;
2608
+ for (const left of lefts) {
2609
+ for (const top of tops) {
2610
+ const candidate = normalizeEditorPosition({ left, top, width, height });
2611
+ const overlap = occupied.reduce(
2612
+ (total, bounds) => total + intersectionArea(candidate, bounds),
2613
+ 0
2614
+ );
2615
+ if (overlap < bestOverlap) {
2616
+ best = candidate;
2617
+ bestOverlap = overlap;
2618
+ if (overlap === 0) return candidate;
2619
+ }
2620
+ }
2621
+ }
2622
+ return best ?? normalizeEditorPosition({ left: 0, top: 0, width, height });
2623
+ }
2624
+ function intersectionArea(a, b) {
2625
+ const width = Math.max(
2626
+ 0,
2627
+ Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)
2628
+ );
2629
+ const height = Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top));
2630
+ return width * height;
2631
+ }
2632
+ function normalizeEditorPosition(position) {
2633
+ return {
2634
+ left: clampGeometry(finite(position.left, 0)),
2635
+ top: clampGeometry(finite(position.top, 0)),
2636
+ width: Math.min(MAX_EDITOR_GEOMETRY, Math.max(8, finite(position.width, 8))),
2637
+ height: Math.min(MAX_EDITOR_GEOMETRY, Math.max(8, finite(position.height, 8)))
2638
+ };
2639
+ }
2640
+ function clampGeometry(value) {
2641
+ return Math.max(-MAX_EDITOR_GEOMETRY, Math.min(MAX_EDITOR_GEOMETRY, value));
2642
+ }
2643
+ function positionFromDrag(drag, point) {
2644
+ const dx = point.x - drag.start.x;
2645
+ const dy = point.y - drag.start.y;
2646
+ const radians = -drag.rotation * Math.PI / 180;
2647
+ const resizeDx = dx * Math.cos(radians) - dy * Math.sin(radians);
2648
+ const resizeDy = dx * Math.sin(radians) + dy * Math.cos(radians);
2649
+ return normalizeEditorPosition(
2650
+ drag.mode === "move" ? {
2651
+ ...drag.before,
2652
+ left: drag.before.left + dx,
2653
+ top: drag.before.top + dy
2654
+ } : {
2655
+ ...drag.before,
2656
+ width: Math.max(8, drag.before.width + resizeDx),
2657
+ height: Math.max(8, drag.before.height + resizeDy)
2658
+ }
2659
+ );
2660
+ }
2661
+ function selectionTransform(entry, position) {
2662
+ const rotation = objectRotation(entry);
2663
+ if (rotation === 0) return void 0;
2664
+ const centerX = position.left + position.width / 2;
2665
+ const centerY = position.top + position.height / 2;
2666
+ return `rotate(${rotation} ${centerX} ${centerY})`;
2667
+ }
2668
+ function copyPosition(position) {
2669
+ return {
2670
+ left: position.left,
2671
+ top: position.top,
2672
+ width: position.width,
2673
+ height: position.height
2674
+ };
2675
+ }
2676
+ function samePosition(a, b) {
2677
+ return a.left === b.left && a.top === b.top && a.width === b.width && a.height === b.height;
2678
+ }
2679
+ function sameViewport(a, b) {
2680
+ return a.scrollLeft === b.scrollLeft && a.scrollTop === b.scrollTop && a.width === b.width && a.height === b.height && a.stageLeft === b.stageLeft && a.stageTop === b.stageTop;
2681
+ }
2682
+ function intersects(a, b) {
2683
+ return !!a && a.left <= b.left + b.width && a.left + a.width >= b.left && a.top <= b.top + b.height && a.top + a.height >= b.top;
2684
+ }
2685
+ function clampZoom(value) {
2686
+ return Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, finite(value, 0.75)));
2687
+ }
2688
+ function fittedPresentationZoom(viewport, slideSize) {
2689
+ const horizontalRoom = Math.max(1, viewport.width - 48);
2690
+ const verticalRoom = Math.max(1, viewport.height - 48);
2691
+ return clampZoom(Math.min(horizontalRoom / slideSize.width, verticalRoom / slideSize.height));
2692
+ }
2693
+ function finite(value, fallback) {
2694
+ return Number.isFinite(value) ? value : fallback;
2695
+ }
2696
+ function safeDomId(value) {
2697
+ return value.replaceAll(/[^a-zA-Z0-9_-]/g, "-");
2698
+ }
2699
+ function randomPresentationId() {
2700
+ for (; ; ) {
2701
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
2702
+ if (bytes.some((byte) => byte !== 0)) {
2703
+ return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
2704
+ }
2705
+ }
2706
+ }
2707
+ function resolveRadius(value, position) {
2708
+ if (typeof value === "number") return value;
2709
+ const min = Math.min(position.width, position.height);
2710
+ const preset = value?.startsWith("rounded-") ? value.slice("rounded-".length) : void 0;
2711
+ if (preset === "full") return min / 2;
2712
+ if (preset === "2xl") return 16;
2713
+ if (preset === "xl") return 12;
2714
+ if (preset === "lg") return 8;
2715
+ return 6;
2716
+ }
2717
+ var COLORS = {
2718
+ none: "transparent",
2719
+ transparent: "transparent",
2720
+ white: "#ffffff",
2721
+ black: "#000000",
2722
+ "slate-50": "#f8fafc",
2723
+ "slate-100": "#f1f5f9",
2724
+ "slate-200": "#e2e8f0",
2725
+ "slate-300": "#cbd5e1",
2726
+ "slate-400": "#94a3b8",
2727
+ "slate-500": "#64748b",
2728
+ "slate-600": "#475569",
2729
+ "slate-700": "#334155",
2730
+ "slate-800": "#1e293b",
2731
+ "slate-900": "#0f172a",
2732
+ "slate-950": "#020617"
2733
+ };
2734
+ function resolveColor(fill) {
2735
+ const value = typeof fill === "string" ? fill : fill.color;
2736
+ return COLORS[value] ?? value;
2737
+ }
2738
+
2739
+ // src/components/artifacts/editable-presentation.tsx
2740
+ import {
2741
+ PRESENTATION_ARTIFACT_COMMAND_VERSION,
2742
+ PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
2743
+ PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
2744
+ PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
2745
+ PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
2746
+ } from "@opengeni/sdk/editable-artifacts";
2747
+ import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
2748
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2749
+ var EMU_PER_CSS_PIXEL = 9525;
2750
+ var PRESENTATION_CATALOG_PAGE = 128;
2751
+ var PRESENTATION_MAX_INTERACTIVE_SLIDES = 256;
2752
+ var PRESENTATION_MAX_INTERACTIVE_NODES = 16384;
2753
+ var PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES = 4 * 1024 * 1024;
2754
+ var PRESENTATION_MAX_CATALOG_PAGES = 32;
2755
+ var PRESENTATION_SCENE_CONCURRENCY = 4;
2756
+ var PRESENTATION_COMPOSITION_ATTEMPTS = 3;
2757
+ var DEFAULT_PRESENTATION_TEXT_STYLE = Object.freeze({
2758
+ fontFamily: "Arial",
2759
+ fontSizeCentipoints: 1800,
2760
+ color: 255,
2761
+ bold: false,
2762
+ italic: false,
2763
+ underline: false,
2764
+ language: null
2765
+ });
2766
+ function EditablePresentationArtifactSurface(props) {
2767
+ return /* @__PURE__ */ jsx2(ArtifactSubmissionProvider, { children: /* @__PURE__ */ jsx2(EditablePresentationArtifactSurfaceSession, { ...props }) }, artifactSubmissionSessionKey(props.session));
2768
+ }
2769
+ function EditablePresentationArtifactSurfaceSession({
2770
+ session,
2771
+ title: titleProp,
2772
+ showHeader,
2773
+ subtitle,
2774
+ readOnly = false,
2775
+ onCommit,
2776
+ onCommandError,
2777
+ download,
2778
+ actions: actionsProp,
2779
+ ...surfaceProps
2780
+ }) {
2781
+ const t = useOpenGeniText();
2782
+ const title = titleProp === void 0 ? t("artifacts.editablePresentation.presentation") : titleProp;
2783
+ const view = useEditableArtifactView(session);
2784
+ const submissions = useArtifactSubmissions();
2785
+ const invalidator = editableArtifactProjectionKey(view);
2786
+ const [retryEpoch, setRetryEpoch] = useState2(0);
2787
+ const [state, setState] = useState2({
2788
+ composed: null,
2789
+ loading: true,
2790
+ error: null
2791
+ });
2792
+ const loadGeneration = useRef2(0);
2793
+ const scheduleLoad = useLatestTaskRunner(session);
2794
+ const sceneNodes = useRef2(/* @__PURE__ */ new Map());
2795
+ useEffect2(() => {
2796
+ const generation = ++loadGeneration.current;
2797
+ let cancelled = false;
2798
+ setState((current) => ({ ...current, loading: true, error: null }));
2799
+ scheduleLoad(async () => {
2800
+ if (cancelled || generation !== loadGeneration.current) return;
2801
+ await composePresentationEditorProjection(t, session).then(
2802
+ (composed) => {
2803
+ if (cancelled || generation !== loadGeneration.current) return;
2804
+ sceneNodes.current = new Map(composed.sceneNodes);
2805
+ setState({ composed, loading: false, error: null });
2806
+ },
2807
+ (cause) => {
2808
+ if (cancelled || generation !== loadGeneration.current) return;
2809
+ setState({
2810
+ composed: null,
2811
+ loading: false,
2812
+ error: asEditableArtifactError(
2813
+ cause,
2814
+ t("artifacts.editablePresentation.couldNotOpenThisPresentation")
2815
+ )
2816
+ });
2817
+ }
2818
+ );
2819
+ });
2820
+ return () => {
2821
+ cancelled = true;
2822
+ };
2823
+ }, [invalidator, retryEpoch, scheduleLoad, session, t]);
2824
+ const refresh = useCallback2(() => setRetryEpoch((value) => value + 1), []);
2825
+ const writable = !readOnly && view.writable;
2826
+ const applyCommit = useCallback2(
2827
+ async (commit) => {
2828
+ const composed = state.composed;
2829
+ if (!composed) throw new Error("Presentation projection is not ready");
2830
+ if (!writable)
2831
+ throw new Error(t("artifacts.editablePresentation.thisPresentationIsReadOnly"));
2832
+ if (view.authoringBlockedReason)
2833
+ throw new Error(t("artifacts.editablePresentation.anEarlierChangeMustSettle"));
2834
+ if (commit.revision !== void 0 && String(commit.revision) !== String(composed.projection.revision)) {
2835
+ throw new Error(t("artifacts.editablePresentation.thePresentationChangedRetryThis"));
2836
+ }
2837
+ if (commit.kind === "slide-insert") {
2838
+ await session.createPresentationSlide({
2839
+ slideId: commit.slideId,
2840
+ index: commit.index
2841
+ });
2842
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2843
+ refresh();
2844
+ return;
2845
+ }
2846
+ if (commit.kind === "slide-delete") {
2847
+ await session.applyPresentationCommands({
2848
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2849
+ commands: [
2850
+ ...presentationNodeDeletionCommands(
2851
+ [...sceneNodes.current.values()],
2852
+ commit.slideId,
2853
+ null
2854
+ ),
2855
+ { kind: "slide.delete", id: commit.slideId }
2856
+ ]
2857
+ });
2858
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2859
+ refresh();
2860
+ return;
2861
+ }
2862
+ if (commit.kind === "object-insert") {
2863
+ await session.applyPresentationCommands({
2864
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2865
+ commands: [
2866
+ {
2867
+ kind: "node.insert",
2868
+ owner: { kind: "slide", id: commit.slideId },
2869
+ parentId: null,
2870
+ index: commit.index,
2871
+ node: {
2872
+ id: commit.objectId,
2873
+ name: "Text box",
2874
+ bounds: {
2875
+ x: canonicalCoordinate(commit.position.left),
2876
+ y: canonicalCoordinate(commit.position.top),
2877
+ width: Math.max(1, canonicalCoordinate(commit.position.width)),
2878
+ height: Math.max(1, canonicalCoordinate(commit.position.height))
2879
+ },
2880
+ transform: { rotation: 0, flipHorizontal: false, flipVertical: false },
2881
+ content: {
2882
+ kind: "shape",
2883
+ geometry: "text-box",
2884
+ fill: { kind: "none" },
2885
+ line: { fill: { kind: "none" }, width: 0, dash: "solid" },
2886
+ text: emptyPresentationText(),
2887
+ placeholder: null
2888
+ }
2889
+ }
2890
+ }
2891
+ ]
2892
+ });
2893
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2894
+ refresh();
2895
+ return;
2896
+ }
2897
+ if (commit.kind === "object-delete") {
2898
+ await session.applyPresentationCommands({
2899
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2900
+ commands: presentationNodeDeletionCommands(
2901
+ [...sceneNodes.current.values()],
2902
+ commit.slideId,
2903
+ commit.objectId
2904
+ )
2905
+ });
2906
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2907
+ refresh();
2908
+ return;
2909
+ }
2910
+ const key = sceneNodeKey(commit.slideId, commit.objectId);
2911
+ const node = sceneNodes.current.get(key);
2912
+ if (!node) throw new Error(t("artifacts.editablePresentation.theEditedPresentationObjectIs"));
2913
+ if (node.inherited || node.source.kind !== "slide" || node.source.id !== commit.slideId) {
2914
+ throw new Error(t("artifacts.editablePresentation.inheritedMasterAndLayoutObjects"));
2915
+ }
2916
+ let command;
2917
+ let nextNode;
2918
+ if (commit.kind === "text") {
2919
+ if (node.content.kind !== "shape" || node.content.text === null) {
2920
+ throw new Error(t("artifacts.editablePresentation.thisPresentationObjectDoesNot"));
2921
+ }
2922
+ if (flattenPresentationRichText(node.content.text) !== commit.before) {
2923
+ throw new Error(t("artifacts.editablePresentation.thePresentationTextChangedRetry"));
2924
+ }
2925
+ const text = replacePresentationRichText(node.content.text, commit.before, commit.after);
2926
+ const content = Object.freeze({ ...node.content, text });
2927
+ command = { kind: "node.content.set", id: node.id, content };
2928
+ nextNode = Object.freeze({ ...node, content });
2929
+ } else {
2930
+ const current = normalizeProjectedEditorPosition(projectPosition(node.bounds));
2931
+ if (!sameProjectedPosition(current, commit.before)) {
2932
+ throw new Error(t("artifacts.editablePresentation.thePresentationObjectChangedRetry"));
2933
+ }
2934
+ const bounds = commit.kind === "move" ? Object.freeze({
2935
+ ...node.bounds,
2936
+ x: canonicalCoordinate(commit.after.left),
2937
+ y: canonicalCoordinate(commit.after.top)
2938
+ }) : Object.freeze({
2939
+ ...node.bounds,
2940
+ width: Math.max(1, canonicalCoordinate(commit.after.width)),
2941
+ height: Math.max(1, canonicalCoordinate(commit.after.height))
2942
+ });
2943
+ command = { kind: "node.bounds.set", id: node.id, bounds };
2944
+ nextNode = Object.freeze({ ...node, bounds });
2945
+ }
2946
+ await session.applyPresentationCommands({
2947
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2948
+ commands: [command]
2949
+ });
2950
+ sceneNodes.current.set(key, nextNode);
2951
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2952
+ refresh();
2953
+ },
2954
+ [
2955
+ onCommandError,
2956
+ onCommit,
2957
+ refresh,
2958
+ session,
2959
+ state.composed,
2960
+ view.authoringBlockedReason,
2961
+ writable,
2962
+ t
2963
+ ]
2964
+ );
2965
+ const submitCommit = useCallback2(
2966
+ (commit) => submissions.run(() => applyCommit(commit)),
2967
+ [applyCommit, submissions]
2968
+ );
2969
+ const actions = download ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2970
+ actionsProp,
2971
+ /* @__PURE__ */ jsx2(
2972
+ EditableArtifactDownloadButton,
2973
+ {
2974
+ session,
2975
+ title,
2976
+ download,
2977
+ format: "pptx"
2978
+ }
2979
+ )
2980
+ ] }) : actionsProp;
2981
+ const projection = state.composed?.projection ?? null;
2982
+ const status = editableArtifactStatusLabel(t, view);
2983
+ const accessRevoked = editableArtifactAccessRevoked(view);
2984
+ return projection && !accessRevoked ? /* @__PURE__ */ jsx2(
2985
+ PresentationProjectionArtifactSurface,
2986
+ {
2987
+ ...surfaceProps,
2988
+ title,
2989
+ showHeader,
2990
+ actions,
2991
+ subtitle: subtitle ?? writable ? t("counts.slides", { count: projection.slides.length }) : t("artifacts.readOnlySubtitle", {
2992
+ subtitle: t("counts.slides", { count: projection.slides.length })
2993
+ }),
2994
+ projection,
2995
+ commit: writable ? submitCommit : void 0,
2996
+ readOnly: !writable,
2997
+ authoringBlockedReason: view.authoringBlockedReason,
2998
+ busy: state.loading,
2999
+ onCommandError
3000
+ }
3001
+ ) : /* @__PURE__ */ jsx2(
3002
+ ArtifactSurface,
3003
+ {
3004
+ modality: "presentation",
3005
+ title,
3006
+ showHeader,
3007
+ subtitle: subtitle ?? status,
3008
+ actions: accessRevoked ? actionsProp : actions,
3009
+ busy: !accessRevoked && !state.error,
3010
+ className: surfaceProps.className,
3011
+ children: /* @__PURE__ */ jsx2(
3012
+ EditableArtifactMessage,
3013
+ {
3014
+ title: accessRevoked ? t("artifacts.editablePresentation.accessChanged") : state.error ? t("artifacts.editablePresentation.couldNotOpenThisPresentation") : t("artifacts.editablePresentation.openingPresentation"),
3015
+ detail: accessRevoked ? status : state.error?.message ?? status,
3016
+ retry: !accessRevoked && state.error ? refresh : void 0
3017
+ }
3018
+ )
3019
+ }
3020
+ );
3021
+ }
3022
+ function presentationNodeDeletionCommands(nodes, slideId, rootId) {
3023
+ const owned = nodes.filter(
3024
+ (node) => !node.inherited && node.source.kind === "slide" && node.source.id === slideId
3025
+ );
3026
+ if (rootId !== null && !owned.some((node) => node.id === rootId)) {
3027
+ return [{ kind: "node.delete", id: rootId }];
3028
+ }
3029
+ let targets;
3030
+ if (rootId === null) {
3031
+ targets = new Set(owned.map((node) => node.id));
3032
+ } else {
3033
+ const children = /* @__PURE__ */ new Map();
3034
+ for (const node of owned) {
3035
+ if (node.parentId === null) continue;
3036
+ const siblings = children.get(node.parentId);
3037
+ if (siblings) siblings.push(node.id);
3038
+ else children.set(node.parentId, [node.id]);
3039
+ }
3040
+ targets = /* @__PURE__ */ new Set([rootId]);
3041
+ const stack = [rootId];
3042
+ while (stack.length > 0) {
3043
+ for (const child of children.get(stack.pop()) ?? []) {
3044
+ if (targets.has(child)) continue;
3045
+ targets.add(child);
3046
+ stack.push(child);
3047
+ }
3048
+ }
3049
+ }
3050
+ const commands = [];
3051
+ for (const node of owned) {
3052
+ if (targets.has(node.id) || node.content.kind !== "connector") continue;
3053
+ const { start, end } = node.content;
3054
+ const detachStart = start.nodeId !== null && targets.has(start.nodeId);
3055
+ const detachEnd = end.nodeId !== null && targets.has(end.nodeId);
3056
+ if (!detachStart && !detachEnd) continue;
3057
+ commands.push({
3058
+ kind: "node.content.set",
3059
+ id: node.id,
3060
+ content: {
3061
+ ...node.content,
3062
+ start: detachStart ? { ...start, nodeId: null } : start,
3063
+ end: detachEnd ? { ...end, nodeId: null } : end
3064
+ }
3065
+ });
3066
+ }
3067
+ const doomed = owned.filter((node) => targets.has(node.id));
3068
+ const referencedBy = (node) => {
3069
+ const referenced = /* @__PURE__ */ new Set();
3070
+ if (node.parentId !== null && targets.has(node.parentId)) referenced.add(node.parentId);
3071
+ if (node.content.kind === "connector") {
3072
+ for (const endpoint of [node.content.start.nodeId, node.content.end.nodeId]) {
3073
+ if (endpoint !== null && endpoint !== node.id && targets.has(endpoint)) {
3074
+ referenced.add(endpoint);
3075
+ }
3076
+ }
3077
+ }
3078
+ return referenced;
3079
+ };
3080
+ const references = new Map(doomed.map((node) => [node.id, referencedBy(node)]));
3081
+ const blockers = new Map(doomed.map((node) => [node.id, 0]));
3082
+ for (const referenced of references.values()) {
3083
+ for (const id of referenced) blockers.set(id, blockers.get(id) + 1);
3084
+ }
3085
+ const ready = doomed.filter((node) => blockers.get(node.id) === 0).map((node) => node.id);
3086
+ const deleted = /* @__PURE__ */ new Set();
3087
+ for (let index = 0; index < ready.length; index += 1) {
3088
+ const id = ready[index];
3089
+ deleted.add(id);
3090
+ commands.push({ kind: "node.delete", id });
3091
+ for (const referenced of references.get(id)) {
3092
+ const left = blockers.get(referenced) - 1;
3093
+ blockers.set(referenced, left);
3094
+ if (left === 0) ready.push(referenced);
3095
+ }
3096
+ }
3097
+ for (const node of doomed) {
3098
+ if (!deleted.has(node.id)) commands.push({ kind: "node.delete", id: node.id });
3099
+ }
3100
+ return commands;
3101
+ }
3102
+ async function composePresentationEditorProjection(t, session) {
3103
+ if (session.modality !== "presentation") {
3104
+ throw new Error("Expected a presentation artifact session");
3105
+ }
3106
+ let lastRevisionError = null;
3107
+ for (let attempt = 0; attempt < PRESENTATION_COMPOSITION_ATTEMPTS; attempt += 1) {
3108
+ try {
3109
+ return await composePresentationAttempt(session);
3110
+ } catch (cause) {
3111
+ const error = asEditableArtifactError(
3112
+ cause,
3113
+ t("artifacts.editablePresentation.couldNotProjectThisPresentation")
3114
+ );
3115
+ if (!isPresentationRevisionDrift(error) || attempt === PRESENTATION_COMPOSITION_ATTEMPTS - 1) {
3116
+ throw error;
3117
+ }
3118
+ lastRevisionError = error;
3119
+ }
3120
+ }
3121
+ throw lastRevisionError ?? new Error("Presentation changed while it was opening");
3122
+ }
3123
+ async function composePresentationAttempt(session) {
3124
+ const metadata = await session.queryPresentation({
3125
+ kind: "metadata",
3126
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3127
+ });
3128
+ if (metadata.kind !== "metadata") throw new Error("Presentation metadata response is malformed");
3129
+ if (metadata.slides > PRESENTATION_MAX_INTERACTIVE_SLIDES) {
3130
+ throw new Error(
3131
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_SLIDES} slides`
3132
+ );
3133
+ }
3134
+ const catalog = await collectSlideCatalog(session, metadata.revision, metadata.slides);
3135
+ const scenes = [];
3136
+ for (let start = 0; start < catalog.length; start += PRESENTATION_SCENE_CONCURRENCY) {
3137
+ const batch = catalog.slice(start, start + PRESENTATION_SCENE_CONCURRENCY);
3138
+ const projected = await Promise.all(
3139
+ batch.map(
3140
+ (slide) => session.queryPresentationEditorSlide({
3141
+ kind: "editor-slide",
3142
+ slideId: slide.id,
3143
+ maxNodes: PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
3144
+ maxTextBytes: PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
3145
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3146
+ })
3147
+ )
3148
+ );
3149
+ for (const scene of projected) {
3150
+ if (scene.revision !== metadata.revision) {
3151
+ throw new Error("Presentation projection revision drifted");
3152
+ }
3153
+ if (scene.truncated) {
3154
+ throw new Error(`Slide ${scene.slide.index + 1} exceeds the bounded editor projection`);
3155
+ }
3156
+ scenes.push(scene);
3157
+ }
3158
+ }
3159
+ const totalNodes = scenes.reduce((sum, scene) => sum + scene.nodes.length, 0);
3160
+ const totalText = scenes.reduce((sum, scene) => sum + scene.projectedTextBytes, 0);
3161
+ if (totalNodes > PRESENTATION_MAX_INTERACTIVE_NODES) {
3162
+ throw new Error(
3163
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_NODES} scene nodes`
3164
+ );
3165
+ }
3166
+ if (totalText > PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES) {
3167
+ throw new Error(
3168
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES} text bytes`
3169
+ );
3170
+ }
3171
+ if (scenes.length !== catalog.length) {
3172
+ throw new Error("Presentation slides changed while they were opening");
3173
+ }
3174
+ const sceneNodeMap = /* @__PURE__ */ new Map();
3175
+ const slides = scenes.map((scene, index) => {
3176
+ if (scene.slide.id !== catalog[index]?.id || scene.slide.index !== index) {
3177
+ throw new Error("Presentation slide catalog changed while it was opening");
3178
+ }
3179
+ for (const node of scene.nodes) {
3180
+ sceneNodeMap.set(sceneNodeKey(scene.slide.id, node.id), node);
3181
+ }
3182
+ return projectPresentationSlide(scene);
3183
+ });
3184
+ return Object.freeze({
3185
+ projection: Object.freeze({
3186
+ revision: metadata.revision.toString(),
3187
+ slideSize: Object.freeze({
3188
+ width: displayCoordinate(metadata.slideSize.width),
3189
+ height: displayCoordinate(metadata.slideSize.height)
3190
+ }),
3191
+ slides: Object.freeze(slides)
3192
+ }),
3193
+ sceneNodes: sceneNodeMap
3194
+ });
3195
+ }
3196
+ async function collectSlideCatalog(session, revision, expectedSlides) {
3197
+ const slides = [];
3198
+ let startSlide = 0;
3199
+ let projectedText = 0;
3200
+ for (let page = 0; page < PRESENTATION_MAX_CATALOG_PAGES; page += 1) {
3201
+ const response = await session.queryPresentationSlideCatalog({
3202
+ kind: "slide-catalog",
3203
+ startSlide,
3204
+ maxSlides: Math.min(
3205
+ PRESENTATION_CATALOG_PAGE,
3206
+ PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
3207
+ Math.max(1, expectedSlides - slides.length)
3208
+ ),
3209
+ maxTextBytes: PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
3210
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3211
+ });
3212
+ if (response.revision !== revision) {
3213
+ throw new Error("Presentation projection revision drifted");
3214
+ }
3215
+ if (response.startSlide !== startSlide) {
3216
+ throw new Error("Presentation slide catalog cursor is malformed");
3217
+ }
3218
+ if (response.slides.some((slide, offset) => slide.index !== startSlide + offset)) {
3219
+ throw new Error("Presentation slide catalog order is malformed");
3220
+ }
3221
+ slides.push(...response.slides);
3222
+ projectedText += response.projectedTextBytes;
3223
+ if (slides.length > PRESENTATION_MAX_INTERACTIVE_SLIDES || projectedText > PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES) {
3224
+ throw new Error("Presentation slide catalog exceeds its interactive limit");
3225
+ }
3226
+ if (response.nextSlide === null) {
3227
+ if (response.truncated || slides.length !== expectedSlides) {
3228
+ throw new Error("Presentation slide catalog is incomplete");
3229
+ }
3230
+ return slides;
3231
+ }
3232
+ if (!response.truncated || response.nextSlide <= startSlide || response.nextSlide !== startSlide + response.slides.length || response.slides.length === 0) {
3233
+ throw new Error("Presentation slide catalog did not advance");
3234
+ }
3235
+ startSlide = response.nextSlide;
3236
+ }
3237
+ throw new Error(`Presentation catalog exceeds ${PRESENTATION_MAX_CATALOG_PAGES} pages`);
3238
+ }
3239
+ function projectPresentationSlide(scene) {
3240
+ const byId = new Map(scene.nodes.map((node) => [node.id, node]));
3241
+ if (byId.size !== scene.nodes.length)
3242
+ throw new Error("Presentation slide contains duplicate IDs");
3243
+ const children = /* @__PURE__ */ new Map();
3244
+ for (const node of scene.nodes) {
3245
+ const entries = children.get(node.parentId) ?? [];
3246
+ entries.push(node);
3247
+ children.set(node.parentId, entries);
3248
+ }
3249
+ for (const entries of children.values()) {
3250
+ entries.sort((left, right) => left.order - right.order || left.id.localeCompare(right.id));
3251
+ }
3252
+ const visited = /* @__PURE__ */ new Set();
3253
+ const stack = /* @__PURE__ */ new Set();
3254
+ const projectNode = (node) => {
3255
+ if (stack.has(node.id)) throw new Error("Presentation group hierarchy contains a cycle");
3256
+ if (visited.has(node.id)) throw new Error("Presentation node appears more than once");
3257
+ stack.add(node.id);
3258
+ visited.add(node.id);
3259
+ const directChildren = children.get(node.id) ?? [];
3260
+ let orderedChildren = directChildren;
3261
+ if (node.content.kind === "group") {
3262
+ const directIds = new Set(directChildren.map((child) => child.id));
3263
+ if (node.content.children.length !== directChildren.length || node.content.children.some((id) => !directIds.has(id))) {
3264
+ throw new Error(`Presentation group ${node.id} hierarchy is inconsistent`);
3265
+ }
3266
+ orderedChildren = node.content.children.map((id) => byId.get(id));
3267
+ } else if (directChildren.length > 0) {
3268
+ throw new Error(`Presentation non-group node ${node.id} contains children`);
3269
+ }
3270
+ const result = projectPresentationNode(node, orderedChildren.map(projectNode));
3271
+ stack.delete(node.id);
3272
+ return result;
3273
+ };
3274
+ const elements = (children.get(null) ?? []).map(projectNode);
3275
+ if (visited.size !== scene.nodes.length) {
3276
+ throw new Error("Presentation slide contains orphaned hierarchy nodes");
3277
+ }
3278
+ return Object.freeze({
3279
+ id: scene.slide.id,
3280
+ title: scene.slide.title,
3281
+ background: projectFill(scene.slide.background),
3282
+ elements: Object.freeze(elements),
3283
+ layout: scene.slide.layout ? Object.freeze({
3284
+ id: scene.slide.layout.id,
3285
+ name: scene.slide.layout.name,
3286
+ masterId: scene.slide.layout.masterId,
3287
+ background: projectFill(scene.slide.layout.background)
3288
+ }) : null,
3289
+ notes: scene.notes ? projectRichText(scene.notes) : null
3290
+ });
3291
+ }
3292
+ function projectPresentationNode(node, children) {
3293
+ const metadata = {
3294
+ nodeSource: { ...node.source },
3295
+ inherited: node.inherited,
3296
+ parentId: node.parentId,
3297
+ order: node.order,
3298
+ readOnly: node.inherited || node.source.kind !== "slide"
3299
+ };
3300
+ const position = projectPosition(node.bounds);
3301
+ const rotation = node.transform.rotation / 6e4;
3302
+ const content = node.content;
3303
+ if (content.kind === "shape") {
3304
+ const richText = content.text ? projectRichText(content.text) : void 0;
3305
+ const textStyle = richText ? firstTextStyle(richText) : void 0;
3306
+ return Object.freeze({
3307
+ ...metadata,
3308
+ kind: "shape",
3309
+ id: node.id,
3310
+ name: node.name,
3311
+ geometry: projectShapeGeometry(content.geometry),
3312
+ position,
3313
+ fill: projectFill(content.fill),
3314
+ line: projectLine(content.line),
3315
+ rotation,
3316
+ text: content.text ? flattenPresentationRichText(content.text) : "",
3317
+ ...richText ? { richText } : {},
3318
+ ...textStyle ? { textStyle } : {}
3319
+ });
3320
+ }
3321
+ if (content.kind === "group") {
3322
+ return Object.freeze({
3323
+ ...metadata,
3324
+ kind: "group",
3325
+ id: node.id,
3326
+ name: node.name,
3327
+ position,
3328
+ childOffset: Object.freeze({
3329
+ left: displayCoordinate(content.childOffsetX),
3330
+ top: displayCoordinate(content.childOffsetY)
3331
+ }),
3332
+ childExtent: Object.freeze({
3333
+ width: displayCoordinate(content.childExtentWidth),
3334
+ height: displayCoordinate(content.childExtentHeight)
3335
+ }),
3336
+ rotation,
3337
+ flipHorizontal: node.transform.flipHorizontal,
3338
+ flipVertical: node.transform.flipVertical,
3339
+ children: Object.freeze([...children])
3340
+ });
3341
+ }
3342
+ if (content.kind === "connector") {
3343
+ return Object.freeze({
3344
+ ...metadata,
3345
+ kind: "connector",
3346
+ id: node.id,
3347
+ name: node.name,
3348
+ connectorKind: content.connectorKind,
3349
+ position,
3350
+ start: Object.freeze({
3351
+ nodeId: content.start.nodeId,
3352
+ x: displayCoordinate(content.start.x),
3353
+ y: displayCoordinate(content.start.y)
3354
+ }),
3355
+ end: Object.freeze({
3356
+ nodeId: content.end.nodeId,
3357
+ x: displayCoordinate(content.end.x),
3358
+ y: displayCoordinate(content.end.y)
3359
+ }),
3360
+ line: projectLine(content.line)
3361
+ });
3362
+ }
3363
+ if (content.kind === "chart") {
3364
+ const titleRichText = projectRichText(content.title);
3365
+ return Object.freeze({
3366
+ ...metadata,
3367
+ kind: "chart",
3368
+ id: node.id,
3369
+ name: node.name,
3370
+ type: content.chartType,
3371
+ position,
3372
+ title: flattenPresentationRichText(content.title),
3373
+ titleRichText,
3374
+ hasLegend: content.hasLegend,
3375
+ series: Object.freeze(
3376
+ content.series.map((series) => ({
3377
+ name: series.name,
3378
+ categories: Object.freeze([...series.categories]),
3379
+ values: Object.freeze([...series.values]),
3380
+ xValues: Object.freeze([...series.xValues]),
3381
+ bubbleSizes: Object.freeze([...series.bubbleSizes])
3382
+ }))
3383
+ )
3384
+ });
3385
+ }
3386
+ if (content.kind === "table") {
3387
+ return Object.freeze({
3388
+ ...metadata,
3389
+ kind: "table",
3390
+ id: node.id,
3391
+ name: node.name,
3392
+ position,
3393
+ rows: Object.freeze(
3394
+ content.rows.map(
3395
+ (row) => Object.freeze(
3396
+ row.map(
3397
+ (cell) => cell ? Object.freeze({
3398
+ text: flattenPresentationRichText(cell.text),
3399
+ richText: projectRichText(cell.text),
3400
+ fill: projectFill(cell.fill),
3401
+ rowSpan: cell.rowSpan,
3402
+ colSpan: cell.columnSpan
3403
+ }) : null
3404
+ )
3405
+ )
3406
+ )
3407
+ ),
3408
+ columnWidths: Object.freeze(content.columnWidths.map(displayCoordinate)),
3409
+ rowHeights: Object.freeze(content.rowHeights.map(displayCoordinate)),
3410
+ line: projectLine(content.line)
3411
+ });
3412
+ }
3413
+ return Object.freeze({
3414
+ ...metadata,
3415
+ kind: "image",
3416
+ id: node.id,
3417
+ name: node.name,
3418
+ position,
3419
+ alt: content.altText,
3420
+ fit: content.fit,
3421
+ rotation,
3422
+ flipHorizontal: node.transform.flipHorizontal,
3423
+ flipVertical: node.transform.flipVertical,
3424
+ digest: bytesToHex(content.digest),
3425
+ contentType: content.contentType,
3426
+ intrinsicWidth: content.intrinsicWidth,
3427
+ intrinsicHeight: content.intrinsicHeight
3428
+ });
3429
+ }
3430
+ function projectRichText(text) {
3431
+ return Object.freeze({
3432
+ verticalAlignment: text.verticalAlignment,
3433
+ paragraphs: Object.freeze(
3434
+ text.paragraphs.map(
3435
+ (paragraph) => Object.freeze({
3436
+ alignment: paragraph.alignment,
3437
+ runs: Object.freeze(
3438
+ paragraph.runs.map(
3439
+ (run) => Object.freeze({
3440
+ text: run.text,
3441
+ style: projectTextStyle(run.style, paragraph.alignment, text.verticalAlignment),
3442
+ language: run.style.language
3443
+ })
3444
+ )
3445
+ )
3446
+ })
3447
+ )
3448
+ )
3449
+ });
3450
+ }
3451
+ function projectTextStyle(style, alignment, verticalAlignment) {
3452
+ return Object.freeze({
3453
+ fontFamily: style.fontFamily,
3454
+ fontSize: style.fontSizeCentipoints / 100,
3455
+ color: rgbaCss(style.color),
3456
+ bold: style.bold,
3457
+ italic: style.italic,
3458
+ underline: style.underline,
3459
+ ...alignment ? { alignment } : {},
3460
+ ...verticalAlignment ? { verticalAlignment } : {}
3461
+ });
3462
+ }
3463
+ function firstTextStyle(text) {
3464
+ return text.paragraphs[0]?.runs[0]?.style;
3465
+ }
3466
+ function projectFill(fill) {
3467
+ return fill.kind === "none" ? "none" : Object.freeze({ type: "solid", color: rgbaCss(fill.color) });
3468
+ }
3469
+ function projectLine(line) {
3470
+ return Object.freeze({
3471
+ style: line.dash,
3472
+ fill: projectFill(line.fill),
3473
+ width: displayCoordinate(line.width)
3474
+ });
3475
+ }
3476
+ function projectPosition(bounds) {
3477
+ return Object.freeze({
3478
+ left: displayCoordinate(bounds.x),
3479
+ top: displayCoordinate(bounds.y),
3480
+ width: displayCoordinate(bounds.width),
3481
+ height: displayCoordinate(bounds.height)
3482
+ });
3483
+ }
3484
+ function displayCoordinate(value) {
3485
+ return value / EMU_PER_CSS_PIXEL;
3486
+ }
3487
+ function normalizeProjectedEditorPosition(position) {
3488
+ const clamp = (value) => Math.max(-1e6, Math.min(1e6, value));
3489
+ return {
3490
+ left: clamp(position.left),
3491
+ top: clamp(position.top),
3492
+ width: Math.min(1e6, Math.max(8, position.width)),
3493
+ height: Math.min(1e6, Math.max(8, position.height))
3494
+ };
3495
+ }
3496
+ function canonicalCoordinate(value) {
3497
+ if (!Number.isFinite(value)) throw new Error("Presentation coordinate must be finite");
3498
+ const canonical = Math.round(value * EMU_PER_CSS_PIXEL);
3499
+ if (!Number.isSafeInteger(canonical)) throw new Error("Presentation coordinate is out of range");
3500
+ return canonical;
3501
+ }
3502
+ function sameProjectedPosition(left, right) {
3503
+ return canonicalCoordinate(left.left) === canonicalCoordinate(right.left) && canonicalCoordinate(left.top) === canonicalCoordinate(right.top) && canonicalCoordinate(left.width) === canonicalCoordinate(right.width) && canonicalCoordinate(left.height) === canonicalCoordinate(right.height);
3504
+ }
3505
+ function projectShapeGeometry(geometry) {
3506
+ return {
3507
+ "text-box": "textbox",
3508
+ rectangle: "rect",
3509
+ "rounded-rectangle": "roundRect",
3510
+ ellipse: "ellipse",
3511
+ triangle: "triangle",
3512
+ "right-arrow": "rightArrow",
3513
+ line: "line"
3514
+ }[geometry];
3515
+ }
3516
+ function emptyPresentationText() {
3517
+ return Object.freeze({
3518
+ verticalAlignment: "middle",
3519
+ paragraphs: Object.freeze([
3520
+ Object.freeze({
3521
+ alignment: "left",
3522
+ runs: Object.freeze([Object.freeze({ text: "", style: DEFAULT_PRESENTATION_TEXT_STYLE })])
3523
+ })
3524
+ ])
3525
+ });
3526
+ }
3527
+ function flattenPresentationRichText(text) {
3528
+ return text.paragraphs.map((paragraph) => paragraph.runs.map((run) => run.text).join("")).join("\n");
3529
+ }
3530
+ function replacePresentationRichText(richText, before, after) {
3531
+ const canonicalBefore = flattenPresentationRichText(richText);
3532
+ if (canonicalBefore !== before) throw new Error("Presentation rich text does not match its edit");
3533
+ if (before === after) return richText;
3534
+ const diff = textReplacementRange(before, after);
3535
+ const spans = presentationStyleSpans(richText);
3536
+ const paragraphStarts = presentationParagraphStarts(richText);
3537
+ const insertionStyle = styleAtOffset(spans, diff.start) ?? DEFAULT_PRESENTATION_TEXT_STYLE;
3538
+ const insertionAlignment = alignmentAtOffset(richText, paragraphStarts, diff.start);
3539
+ const paragraphs = [];
3540
+ let newOffset = 0;
3541
+ for (const paragraphText of after.split("\n")) {
3542
+ const alignment = alignmentForNewOffset(
3543
+ richText,
3544
+ paragraphStarts,
3545
+ diff,
3546
+ newOffset,
3547
+ insertionAlignment
3548
+ );
3549
+ const runs = [];
3550
+ let localOffset = 0;
3551
+ for (const character of paragraphText) {
3552
+ const offset = newOffset + localOffset;
3553
+ const oldOffset = oldOffsetForNewOffset(diff, offset);
3554
+ const style = oldOffset === null ? insertionStyle : styleAtOffset(spans, oldOffset) ?? insertionStyle;
3555
+ const previous = runs.at(-1);
3556
+ if (previous && samePresentationTextStyle(previous.style, style)) previous.text += character;
3557
+ else runs.push({ text: character, style });
3558
+ localOffset += character.length;
3559
+ }
3560
+ paragraphs.push(
3561
+ Object.freeze({
3562
+ alignment,
3563
+ runs: Object.freeze(
3564
+ runs.map(
3565
+ (run) => Object.freeze({ text: run.text, style: Object.freeze({ ...run.style }) })
3566
+ )
3567
+ )
3568
+ })
3569
+ );
3570
+ newOffset += paragraphText.length + 1;
3571
+ }
3572
+ return Object.freeze({
3573
+ verticalAlignment: richText.verticalAlignment,
3574
+ paragraphs: Object.freeze(paragraphs)
3575
+ });
3576
+ }
3577
+ function textReplacementRange(before, after) {
3578
+ let start = 0;
3579
+ while (start < before.length && start < after.length && before.charCodeAt(start) === after.charCodeAt(start)) {
3580
+ start += 1;
3581
+ }
3582
+ while (start > 0 && (splitsSurrogate(before, start) || splitsSurrogate(after, start))) start -= 1;
3583
+ let suffix = 0;
3584
+ while (suffix < before.length - start && suffix < after.length - start && before.charCodeAt(before.length - suffix - 1) === after.charCodeAt(after.length - suffix - 1)) {
3585
+ suffix += 1;
3586
+ }
3587
+ while (suffix > 0 && (splitsSurrogate(before, before.length - suffix) || splitsSurrogate(after, after.length - suffix))) {
3588
+ suffix -= 1;
3589
+ }
3590
+ const oldEnd = before.length - suffix;
3591
+ const newEnd = after.length - suffix;
3592
+ return { start, oldEnd, newEnd, delta: oldEnd - newEnd };
3593
+ }
3594
+ function oldOffsetForNewOffset(diff, offset) {
3595
+ if (offset < diff.start) return offset;
3596
+ if (offset >= diff.newEnd) return offset + diff.delta;
3597
+ return null;
3598
+ }
3599
+ function presentationStyleSpans(text) {
3600
+ const spans = [];
3601
+ let offset = 0;
3602
+ text.paragraphs.forEach((paragraph, paragraphIndex) => {
3603
+ for (const run of paragraph.runs) {
3604
+ spans.push({ start: offset, end: offset + run.text.length, style: run.style });
3605
+ offset += run.text.length;
3606
+ }
3607
+ if (paragraphIndex < text.paragraphs.length - 1) offset += 1;
3608
+ });
3609
+ return spans;
3610
+ }
3611
+ function presentationParagraphStarts(text) {
3612
+ const starts = [];
3613
+ let offset = 0;
3614
+ text.paragraphs.forEach((paragraph, index) => {
3615
+ starts.push(offset);
3616
+ offset += paragraph.runs.reduce((sum, run) => sum + run.text.length, 0);
3617
+ if (index < text.paragraphs.length - 1) offset += 1;
3618
+ });
3619
+ return starts;
3620
+ }
3621
+ function styleAtOffset(spans, offset) {
3622
+ const containing = spans.find((span) => offset >= span.start && offset < span.end);
3623
+ if (containing) return containing.style;
3624
+ const before = [...spans].reverse().find((span) => span.end <= offset);
3625
+ return before?.style ?? spans[0]?.style ?? null;
3626
+ }
3627
+ function alignmentAtOffset(text, starts, offset) {
3628
+ let index = 0;
3629
+ while (index + 1 < starts.length && (starts[index + 1] ?? Number.POSITIVE_INFINITY) <= offset) {
3630
+ index += 1;
3631
+ }
3632
+ return text.paragraphs[index]?.alignment ?? "left";
3633
+ }
3634
+ function alignmentForNewOffset(text, starts, diff, newOffset, fallback) {
3635
+ const oldOffset = oldOffsetForNewOffset(diff, newOffset);
3636
+ return oldOffset === null ? fallback : alignmentAtOffset(text, starts, oldOffset);
3637
+ }
3638
+ function samePresentationTextStyle(left, right) {
3639
+ return left.fontFamily === right.fontFamily && left.fontSizeCentipoints === right.fontSizeCentipoints && left.color === right.color && left.bold === right.bold && left.italic === right.italic && left.underline === right.underline && left.language === right.language;
3640
+ }
3641
+ function splitsSurrogate(value, index) {
3642
+ if (index <= 0 || index >= value.length) return false;
3643
+ const left = value.charCodeAt(index - 1);
3644
+ const right = value.charCodeAt(index);
3645
+ return left >= 55296 && left <= 56319 && right >= 56320 && right <= 57343;
3646
+ }
3647
+ function rgbaCss(value) {
3648
+ const hex = (value >>> 0).toString(16).padStart(8, "0");
3649
+ return hex.endsWith("ff") ? `#${hex.slice(0, 6)}` : `#${hex}`;
3650
+ }
3651
+ function bytesToHex(value) {
3652
+ return [...value].map((byte) => byte.toString(16).padStart(2, "0")).join("");
3653
+ }
3654
+ function sceneNodeKey(slideId, nodeId) {
3655
+ return `${slideId}:${nodeId}`;
3656
+ }
3657
+ function isPresentationRevisionDrift(error) {
3658
+ return error.message.includes("changed while") || error.message.includes("revision drifted");
3659
+ }
3660
+ function notifyPresentationCommit(t, observer, onError, commit) {
3661
+ try {
3662
+ const result = observer?.(commit);
3663
+ if (result && typeof result.then === "function") {
3664
+ void Promise.resolve(result).catch(
3665
+ (cause) => onError?.(
3666
+ asEditableArtifactError(
3667
+ cause,
3668
+ t("artifacts.editablePresentation.presentationCommitObserverFailed")
3669
+ )
3670
+ )
3671
+ );
3672
+ }
3673
+ } catch (cause) {
3674
+ onError?.(
3675
+ asEditableArtifactError(
3676
+ cause,
3677
+ t("artifacts.editablePresentation.presentationCommitObserverFailed")
3678
+ )
3679
+ );
3680
+ }
3681
+ }
3682
+
3683
+ export {
3684
+ PresentationEditor,
3685
+ PresentationProjectionEditor,
3686
+ PresentationArtifactSurface,
3687
+ PresentationProjectionArtifactSurface,
3688
+ EditablePresentationArtifactSurface
3689
+ };
3690
+ //# sourceMappingURL=chunk-23TTCFRP.js.map